TaskAnnualReportController.java 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. package com.goafanti.techproject.controller;
  2. import com.goafanti.common.bo.Result;
  3. import com.goafanti.common.controller.BaseController;
  4. import com.goafanti.common.model.TaskAnnualReport;
  5. import com.goafanti.techproject.service.TaskAnnualReportService;
  6. import org.springframework.web.bind.annotation.GetMapping;
  7. import org.springframework.web.bind.annotation.PostMapping;
  8. import org.springframework.web.bind.annotation.RequestMapping;
  9. import org.springframework.web.bind.annotation.RestController;
  10. import javax.annotation.Resource;
  11. /**
  12. * 项目年报(TaskAnnualReport)表控制层
  13. *
  14. * @author makejava
  15. * @since 2024-12-26 10:55:04
  16. */
  17. @RestController
  18. @RequestMapping("/api/admin/taskAnnualReport")
  19. public class TaskAnnualReportController extends BaseController {
  20. /**
  21. * 服务对象
  22. */
  23. @Resource
  24. private TaskAnnualReportService taskAnnualReportService;
  25. /**
  26. * 新增数据
  27. *
  28. * @param taskAnnualReport 实体
  29. * @return 新增结果
  30. */
  31. @PostMapping("/add")
  32. public Result add(TaskAnnualReport taskAnnualReport) {
  33. return new Result<>().data(this.taskAnnualReportService.insert(taskAnnualReport));
  34. }
  35. /**
  36. * 通过主键查询单条数据
  37. *
  38. * @param id 主键
  39. * @return 单条数据
  40. */
  41. @GetMapping("/get")
  42. public Result<TaskAnnualReport> queryById(Integer id) {
  43. return new Result<>().data(this.taskAnnualReportService.queryById(id));
  44. }
  45. /**
  46. * 编辑数据
  47. *
  48. * @param taskAnnualReport 实体
  49. * @return 编辑结果
  50. */
  51. @PostMapping("/update")
  52. public Result edit(TaskAnnualReport taskAnnualReport) {
  53. return new Result<>().data(this.taskAnnualReportService.update(taskAnnualReport));
  54. }
  55. /**
  56. * 删除数据
  57. *
  58. * @param id 主键
  59. * @return 删除是否成功
  60. */
  61. @GetMapping("/delete")
  62. public Result deleteById(Integer id) {
  63. return new Result<>().data(this.taskAnnualReportService.deleteById(id));
  64. }
  65. /**
  66. * 列表查询
  67. *
  68. * @param in 参数
  69. * @return
  70. */
  71. @GetMapping("/list")
  72. public Result<TaskAnnualReport> list(TaskAnnualReport in, Integer pageNo, Integer pageSize) {
  73. return new Result<>().data(this.taskAnnualReportService.list(in, pageNo, pageSize));
  74. }
  75. }