9 changed files with 195 additions and 23 deletions
@ -0,0 +1,42 @@ |
|||||
|
package com.ccsens.tcm.api; |
||||
|
|
||||
|
import com.ccsens.tcm.bean.dto.CodeVo; |
||||
|
import com.ccsens.tcm.bean.vo.QuestionVo; |
||||
|
import com.ccsens.tcm.service.IImportService; |
||||
|
import com.ccsens.util.JsonResponse; |
||||
|
import com.ccsens.util.bean.dto.QueryDto; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiImplicitParams; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import io.swagger.annotations.ApiParam; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMethod; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Api(tags = "试题相关接口") |
||||
|
@RestController |
||||
|
@RequestMapping("/question") |
||||
|
public class QuestionController { |
||||
|
@Resource |
||||
|
private IImportService importService; |
||||
|
|
||||
|
@ApiOperation(value = "按code查看题目信息,code为空则查询全部",notes = "") |
||||
|
@ApiImplicitParams({}) |
||||
|
@RequestMapping(value="/queryAll",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse question(@ApiParam @Validated @RequestBody QueryDto<CodeVo.QuestionCode> params) throws Exception { |
||||
|
List<QuestionVo.ReportCodeVo> reportCodeVoList = importService.getQuestion(params.getParam()); |
||||
|
return JsonResponse.newInstance().ok(reportCodeVoList); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,19 @@ |
|||||
|
package com.ccsens.tcm.bean.dto; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CodeVo { |
||||
|
@Data |
||||
|
@ApiModel("试题类型") |
||||
|
public static class QuestionCode { |
||||
|
@ApiModelProperty("code") |
||||
|
private String code; |
||||
|
} |
||||
|
|
||||
|
} |
Loading…
Reference in new issue