后台服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
3.1 KiB

  1. package com.iformall.controller;
  2. import com.github.pagehelper.PageInfo;
  3. import com.iformall.annotation.AuthIgnore;
  4. import com.iformall.common.ErrorCode;
  5. import com.iformall.common.ResultData;
  6. import com.iformall.domain.po.base.BaseEntity;
  7. import com.iformall.domain.po.sm.MouldPatch;
  8. import com.iformall.domain.po.sm.PersonMould;
  9. import com.iformall.domain.po.sm.UserMouldVideo;
  10. import com.iformall.enums.EnumLanguages;
  11. import com.iformall.enums.EnumMouldPatchType;
  12. import com.iformall.enums.EnumMouldSendType;
  13. import com.iformall.enums.EnumaMouldPatchStatus;
  14. import com.iformall.language.LanguageDetect;
  15. import com.iformall.service.sm.MouldPatchService;
  16. import com.iformall.service.sm.MouldPatchSignService;
  17. import com.iformall.service.sm.PersonMouldService;
  18. import io.swagger.annotations.Api;
  19. import io.swagger.annotations.ApiImplicitParam;
  20. import io.swagger.annotations.ApiImplicitParams;
  21. import io.swagger.annotations.ApiOperation;
  22. import org.apache.commons.lang3.StringUtils;
  23. import org.slf4j.Logger;
  24. import org.slf4j.LoggerFactory;
  25. import org.springframework.beans.factory.annotation.Autowired;
  26. import org.springframework.web.bind.annotation.*;
  27. @RestController
  28. @RequestMapping("/api/personPatch")
  29. @Api(description = "模板接口")
  30. public class PersonMouldController extends BaseController {
  31. private final Logger logger = LoggerFactory.getLogger(this.getClass());
  32. @Autowired
  33. private PersonMouldService personMouldService;
  34. @Autowired
  35. private MouldPatchSignService mouldPatchSignService;
  36. @AuthIgnore
  37. @ApiOperation("分页列表接口")
  38. @GetMapping("list")
  39. @ApiImplicitParams({
  40. @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
  41. @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
  42. public ResultData list(@ModelAttribute PersonMould record, Integer pageNum, Integer pageSize) {
  43. logger.debug("[" + getIpAddr() + "] MouldPatchController::list");
  44. if (record == null) record = new PersonMould();
  45. if(record.getVideoType() != null && record.getVideoType().intValue() == -1){
  46. record.setVideoType(null);
  47. }
  48. if(record.getSex() != null && record.getSex().intValue() == -1){
  49. record.setSex(null);
  50. }
  51. // record.setSendType(EnumMouldSendType.auto.getCode());
  52. record.setStatus(EnumaMouldPatchStatus.put_on.getCode());
  53. record.setSortColumns(BaseEntity.SortField.UpdateDate_DESC);
  54. final PageInfo<PersonMould> page = personMouldService.cListAsPage(record, pageNum, pageSize);
  55. return new ResultData(page);
  56. }
  57. @AuthIgnore
  58. @ApiOperation("根据id查询接口")
  59. @GetMapping("/findById")
  60. @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
  61. public ResultData findById(Long id) {
  62. logger.debug("[" + getIpAddr() + "] MouldPatchController::findById");
  63. PersonMould personMould = personMouldService.getDetailById(id);
  64. return new ResultData(personMould);
  65. }
  66. }