PatentController.java 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. package com.fjhx.common.controller.patent;
  2. import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  3. import com.fjhx.common.entity.patent.dto.PatentDto;
  4. import com.fjhx.common.entity.patent.dto.PatentSelectDto;
  5. import com.fjhx.common.entity.patent.vo.PatentVo;
  6. import com.fjhx.common.service.patent.PatentService;
  7. import com.ruoyi.common.annotation.Log;
  8. import com.ruoyi.common.core.domain.BaseSelectDto;
  9. import com.ruoyi.common.enums.BusinessType;
  10. import org.springframework.beans.factory.annotation.Autowired;
  11. import org.springframework.web.bind.annotation.PostMapping;
  12. import org.springframework.web.bind.annotation.RequestBody;
  13. import org.springframework.web.bind.annotation.RequestMapping;
  14. import org.springframework.web.bind.annotation.RestController;
  15. /**
  16. * <p>
  17. * 专利 前端控制器
  18. * </p>
  19. *
  20. * @author
  21. * @since 2024-03-24
  22. */
  23. @RestController
  24. @RequestMapping("/patent")
  25. public class PatentController {
  26. @Autowired
  27. private PatentService patentService;
  28. /**
  29. * 专利分页
  30. */
  31. @PostMapping("/page")
  32. public Page<PatentVo> page(@RequestBody PatentSelectDto dto) {
  33. return patentService.getPage(dto);
  34. }
  35. /**
  36. * 专利明细
  37. */
  38. @PostMapping("/detail")
  39. public PatentVo detail(@RequestBody BaseSelectDto dto) {
  40. return patentService.detail(dto.getId());
  41. }
  42. /**
  43. * 专利新增
  44. */
  45. @Log(title = "专利管理", businessType = BusinessType.INSERT)
  46. @PostMapping("/add")
  47. public void add(@RequestBody PatentDto patentDto) {
  48. patentService.add(patentDto);
  49. }
  50. /**
  51. * 专利编辑
  52. */
  53. @Log(title = "专利管理", businessType = BusinessType.UPDATE)
  54. @PostMapping("/edit")
  55. public void edit(@RequestBody PatentDto patentDto) {
  56. patentService.edit(patentDto);
  57. }
  58. /**
  59. * 专利删除
  60. */
  61. @Log(title = "专利管理", businessType = BusinessType.DELETE)
  62. @PostMapping("/delete")
  63. public void delete(@RequestBody BaseSelectDto dto) {
  64. patentService.delete(dto.getId());
  65. }
  66. }