SecondaryArchiveController.java 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. package com.gz.controller.archive;
  2. import com.github.pagehelper.PageInfo;
  3. import com.gz.dto.archive.ArchiveDTO;
  4. import com.gz.dto.archive.SecondaryArchiveDTO;
  5. import com.gz.service.archive.SecondaryArchiveService;
  6. import com.gz.vo.PageVO;
  7. import com.gz.vo.archive.SecondaryArchiveInsertVO;
  8. import com.gz.vo.archive.SecondaryArchiveVO;
  9. import org.springframework.web.bind.annotation.*;
  10. import javax.annotation.Resource;
  11. import java.util.List;
  12. /**
  13. * @author LiuchangLan
  14. * @date 2021/3/2 18:34
  15. */
  16. @RestController
  17. @RequestMapping("secondary/archive")
  18. public class SecondaryArchiveController {
  19. @Resource
  20. private SecondaryArchiveService service;
  21. /**
  22. * @description 增
  23. * @author LiuChangLan
  24. * @since 2020/9/4 14:46
  25. */
  26. @PostMapping("insert")
  27. Integer insert(SecondaryArchiveInsertVO dto) throws Exception{
  28. return service.insert(dto);
  29. }
  30. /**
  31. * @description 删
  32. * @author LiuChangLan
  33. * @since 2020/9/4 14:46
  34. */
  35. @DeleteMapping("delete")
  36. Integer delete(Integer id){
  37. return service.delete(id);
  38. }
  39. /**
  40. * @description 改
  41. * @author LiuChangLan
  42. * @since 2020/9/4 14:46
  43. */
  44. @PostMapping("update")
  45. Integer update(@RequestBody SecondaryArchiveDTO dto){
  46. return service.update(dto);
  47. }
  48. /**
  49. * @description 分页查询
  50. * @author LiuChangLan
  51. * @since 2020/9/4 14:46
  52. */
  53. @GetMapping("selectByPage")
  54. PageInfo<SecondaryArchiveDTO> selectByPage(SecondaryArchiveVO vo){
  55. return service.selectByPage(vo);
  56. }
  57. /**
  58. * @description 根据主键查询
  59. * @author LiuChangLan
  60. * @since 2021/3/2 19:24
  61. */
  62. @GetMapping("selectByPrimaryKey")
  63. SecondaryArchiveDTO selectByPrimaryKey(Integer id) {
  64. return service.selectByPrimaryKey(id);
  65. }
  66. /**
  67. * @description 根据文档id查询卷内目录
  68. * @author LiuChangLan
  69. * @since 2021/3/9 15:35
  70. */
  71. @GetMapping("selectByArchiveId")
  72. List<SecondaryArchiveDTO> selectByArchiveId(Integer archiveId){
  73. return service.selectByArchiveId(archiveId);
  74. }
  75. }