为了直接用Swagger,?RequestMapping?要有method = {RequestMethod.POST}
入参是实体还是几个参数,与是否get、post没有关系
get也能实体
@ApiOperation(value = "查询xx")
@GetMapping(value="/list")
public JsonResult list(PageRequest req){
PageUtils pageUtil = ${classname}Service.queryPage(req);
return JsonResult.ok("查询成功!", pageUtil);
}
@ApiOperation(value = "查询xx范围")
@GetMapping(value = "/gradeRange")
public JsonResult<List<ParamRes>> gradeList(@RequestParam(value = "leftCode")String leftCode,@RequestParam(value = "rightCode")String rightCode) {
List<EhrOrgGradeEntity> list = ehrOrgGradeService.selectGradeRangeByType(leftCode,rightCode);
//老土
@RequestMapping(value="/list", method = {RequestMethod.GET})
public R list(@RequestParam Map<String, Object> params){
@RequestMapping(value="/list", method = {RequestMethod.GET})
public R list(String jobNum,String name){
post也能几个参
@ApiOperation("上传")
@PostMapping("/uploads")
public R uploads(
@ApiParam(name = "file", value = "文件", required = true, type = "form")
@RequestParam("file") MultipartFile file,
@ApiParam(name = "cwId", value = "xxid", type = "query")
@RequestParam(name = "cwId", required = true, defaultValue = "") Integer cwId,
@ApiParam(name = "openId", value = "yyid", type = "query")
@RequestParam(name = "openId", required = true) String openId,
@ApiParam(name = "hrId", value = "推荐人工号", type = "query")
@RequestParam(name = "hrId", required = true) String hrId) {
}
@PostMapping("/uploads")
public R update(@RequestBody ManagementEntity managementEntity){
//老土
@RequestMapping("/update", method = {RequestMethod.POST})
public R update(@RequestBody ManagementEntity managementEntity){
|