资源中心客观题题库管理部分功能
parent
25ead463ca
commit
47ee4add58
@ -1,34 +1,82 @@
|
||||
package com.sztzjy.financial_bigdata.controller.tea;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion;
|
||||
import com.sztzjy.financial_bigdata.service.tea.ITeaObjectiveService;
|
||||
import com.sztzjy.financial_bigdata.util.ResultEntity;
|
||||
import com.sztzjy.financial_bigdata.util.file.IFileUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@RestController
|
||||
@Api(tags = "教师端--资源中心-题库管理")
|
||||
@RequestMapping("api/tea/objective")
|
||||
public class TeaObjectiveController {
|
||||
@Autowired
|
||||
ITeaObjectiveService teaObjectiveService;
|
||||
@Autowired
|
||||
IFileUtil fileUtil;
|
||||
@Value("${file.path}")
|
||||
private String filePath;
|
||||
|
||||
//客观题新增
|
||||
@PostMapping("insertObjective")
|
||||
@ApiOperation("客观题新增")
|
||||
public ResultEntity insertObjective(@RequestBody SysObjectiveQuestion objectiveQuestion) {
|
||||
Boolean flag=teaObjectiveService.insertObjective(objectiveQuestion);
|
||||
if (flag){
|
||||
return new ResultEntity<>(HttpStatus.OK,"客观题新增成功");
|
||||
}else {
|
||||
return new ResultEntity<>(HttpStatus.BAD_REQUEST,"客观题新增失败");
|
||||
Boolean flag = teaObjectiveService.insertObjective(objectiveQuestion);
|
||||
if (flag) {
|
||||
return new ResultEntity<>(HttpStatus.OK, "客观题新增成功");
|
||||
} else {
|
||||
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "客观题新增失败");
|
||||
}
|
||||
}
|
||||
//客观题批量导入
|
||||
|
||||
//客观题删除
|
||||
@GetMapping("/deleteObjective")
|
||||
@ApiOperation("客观题删除")
|
||||
public ResultEntity deleteObjective(@ApiParam("客观题ID") @RequestParam String objectiveId,
|
||||
@RequestParam String schoolId) {
|
||||
Boolean flag = teaObjectiveService.deleteObjective(objectiveId,schoolId);
|
||||
if (flag) {
|
||||
return new ResultEntity<>(HttpStatus.OK, "客观题删除成功");
|
||||
} else {
|
||||
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "客观题新增失败");
|
||||
}
|
||||
}
|
||||
|
||||
//客观题列表查看
|
||||
@GetMapping("/selectObjectiveList")
|
||||
@ApiOperation("客观题列表查看")
|
||||
public ResultEntity<PageInfo<SysObjectiveQuestion>> selectObjectiveList(@RequestParam String schoolId,
|
||||
@RequestParam Integer index,
|
||||
@RequestParam Integer size) {
|
||||
PageInfo<SysObjectiveQuestion> pageInfo=teaObjectiveService.selectObjectiveList(schoolId,index,size);
|
||||
return new ResultEntity<>(HttpStatus.OK, "客观题删除成功",pageInfo);
|
||||
}
|
||||
|
||||
//客观题单个详情查看
|
||||
@GetMapping("/selectObjectiveDetails")
|
||||
@ApiOperation("客观题单个详情查看")
|
||||
public ResultEntity<SysObjectiveQuestion> selectObjectiveDetails(@ApiParam("客观题ID") @RequestParam String objectiveId){
|
||||
SysObjectiveQuestion objectiveQuestion=teaObjectiveService.selectObjectiveDetails(objectiveId);
|
||||
return new ResultEntity<>(HttpStatus.OK, "客观题删除成功",objectiveQuestion);
|
||||
}
|
||||
|
||||
//客观题导入模板下载
|
||||
@GetMapping("downloadResource")
|
||||
@ApiOperation("客观题导入模板下载")
|
||||
public void downloadResource(HttpServletResponse response) {
|
||||
fileUtil.download(response, "客观题导入模板.xlsx", filePath);
|
||||
}
|
||||
|
||||
//客观题批量导入
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,16 @@
|
||||
package com.sztzjy.financial_bigdata.service.tea;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ITeaObjectiveService {
|
||||
Boolean insertObjective(SysObjectiveQuestion objectiveQuestion);
|
||||
|
||||
Boolean deleteObjective(String objectiveId, String schoolId);
|
||||
|
||||
PageInfo<SysObjectiveQuestion> selectObjectiveList(String schoolId, Integer index, Integer size);
|
||||
|
||||
SysObjectiveQuestion selectObjectiveDetails(String objectiveId);
|
||||
}
|
||||
|
Loading…
Reference in New Issue