288e3a9aea765e42c4ea97d78db389735593bf41.svn-base 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. package cn.com.goldenwater.dcproj.controller.meeting;
  2. import cn.com.goldenwater.dcproj.model.AttMeetingEval;
  3. import cn.com.goldenwater.dcproj.param.AttMeetingEvalParam;
  4. import cn.com.goldenwater.dcproj.service.AttMeetingEvalService;
  5. import cn.com.goldenwater.core.web.BaseController;
  6. import cn.com.goldenwater.core.web.BaseResponse;
  7. import cn.com.goldenwater.id.util.UuidUtil;
  8. import io.swagger.annotations.Api;
  9. import io.swagger.annotations.ApiOperation;
  10. import io.swagger.annotations.ApiParam;
  11. import org.apache.commons.lang3.StringUtils;
  12. import com.github.pagehelper.PageInfo;
  13. import org.slf4j.Logger;
  14. import org.slf4j.LoggerFactory;
  15. import org.springframework.beans.factory.annotation.Autowired;
  16. import org.springframework.beans.factory.annotation.Value;
  17. import org.springframework.web.bind.annotation.PathVariable;
  18. import org.springframework.web.bind.annotation.RequestBody;
  19. import org.springframework.web.bind.annotation.RequestMapping;
  20. import org.springframework.web.bind.annotation.RequestMethod;
  21. import org.springframework.web.bind.annotation.RestController;
  22. import java.util.List;
  23. /**
  24. * @author lune
  25. * @date 2019-7-9
  26. */
  27. @Api(value = "ATT 培训会议评价管理表管理", tags = "ATT 培训会议评价管理表管理")
  28. @RestController
  29. @RequestMapping("/att/meeting/eval")
  30. public class AttMeetingEvalController extends BaseController {
  31. private Logger logger = LoggerFactory.getLogger(getClass());
  32. @Autowired
  33. private AttMeetingEvalService attMeetingEvalService;
  34. @Value("${web.upload-path}")
  35. public String fileDir;
  36. @ApiOperation(value = "添加/修改培训会议评价管理表")
  37. @RequestMapping(value = "", method = RequestMethod.POST)
  38. public BaseResponse<AttMeetingEval> insert(@ApiParam(name = "attMeetingEval", value = "AttMeetingEval", required = true) @RequestBody AttMeetingEval attMeetingEval) {
  39. if (StringUtils.isBlank(attMeetingEval.getId())) {
  40. String uuid = UuidUtil.uuid(); // 生成uuid
  41. attMeetingEval.setId(uuid);
  42. attMeetingEvalService.insert(attMeetingEval);
  43. } else {
  44. attMeetingEvalService.update(attMeetingEval);
  45. }
  46. return buildSuccessResponse(attMeetingEval);
  47. }
  48. @ApiOperation(value = "根据ID删除培训会议评价管理表")
  49. @RequestMapping(value = "/del/{id}", method = RequestMethod.GET)
  50. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  51. int ret = attMeetingEvalService.delete(id);
  52. return buildSuccessResponse();
  53. }
  54. @ApiOperation(value = "根据ID获取培训会议评价管理表(单表)")
  55. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  56. public BaseResponse<AttMeetingEval> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  57. AttMeetingEval attMeetingEval = attMeetingEvalService.get(id);
  58. return buildSuccessResponse(attMeetingEval);
  59. }
  60. @ApiOperation(value = "获取培训会议评价管理表(列表所有)")
  61. @RequestMapping(value = "/list", method = RequestMethod.POST)
  62. public BaseResponse<List<AttMeetingEval>> list(@ApiParam(name = "attMeetingEvalParam", value = "attMeetingEvalParam", required = true) @RequestBody AttMeetingEvalParam attMeetingEvalParam) {
  63. List<AttMeetingEval> attMeetingEvalList = attMeetingEvalService.findList(attMeetingEvalParam);
  64. return buildSuccessResponse(attMeetingEvalList);
  65. }
  66. @ApiOperation(value = "获取培训会议评价管理表(列表--分页)")
  67. @RequestMapping(value = "/page", method = RequestMethod.POST)
  68. public BaseResponse<PageInfo<AttMeetingEval>> page(@ApiParam(name = "attMeetingEvalParam", value = "attMeetingEvalParam", required = true) @RequestBody AttMeetingEvalParam attMeetingEvalParam) {
  69. PageInfo<AttMeetingEval> attMeetingEvalList = attMeetingEvalService.findPageInfo(attMeetingEvalParam);
  70. return buildSuccessResponse(attMeetingEvalList);
  71. }
  72. }