UserNoteController.java 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. package com.zhongzheng.controller.user;
  2. import java.util.List;
  3. import java.util.Arrays;
  4. import com.zhongzheng.modules.user.vo.UserDateNoteVo;
  5. import lombok.RequiredArgsConstructor;
  6. import org.springframework.security.access.prepost.PreAuthorize;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.web.bind.annotation.GetMapping;
  9. import org.springframework.web.bind.annotation.PostMapping;
  10. import org.springframework.web.bind.annotation.PutMapping;
  11. import org.springframework.web.bind.annotation.DeleteMapping;
  12. import org.springframework.web.bind.annotation.PathVariable;
  13. import org.springframework.web.bind.annotation.RequestBody;
  14. import org.springframework.web.bind.annotation.RequestMapping;
  15. import org.springframework.web.bind.annotation.RestController;
  16. import com.zhongzheng.common.annotation.Log;
  17. import com.zhongzheng.common.core.controller.BaseController;
  18. import com.zhongzheng.common.core.domain.AjaxResult;
  19. import com.zhongzheng.common.enums.BusinessType;
  20. import com.zhongzheng.modules.user.vo.UserNoteVo;
  21. import com.zhongzheng.modules.user.bo.UserNoteQueryBo;
  22. import com.zhongzheng.modules.user.bo.UserNoteAddBo;
  23. import com.zhongzheng.modules.user.bo.UserNoteEditBo;
  24. import com.zhongzheng.modules.user.service.IUserNoteService;
  25. import com.zhongzheng.common.utils.poi.ExcelUtil;
  26. import com.zhongzheng.common.core.page.TableDataInfo;
  27. import io.swagger.annotations.Api;
  28. import io.swagger.annotations.ApiOperation;
  29. /**
  30. * 用户笔记记录Controller
  31. *
  32. * @author ruoyi
  33. * @date 2021-12-14
  34. */
  35. @Api(value = "用户笔记记录控制器", tags = {"用户笔记记录管理"})
  36. @RequiredArgsConstructor(onConstructor_ = @Autowired)
  37. @RestController
  38. @RequestMapping("/user/note")
  39. public class UserNoteController extends BaseController {
  40. private final IUserNoteService iUserNoteService;
  41. /**
  42. * 查询用户笔记记录列表
  43. */
  44. @ApiOperation("查询用户笔记记录列表")
  45. @PreAuthorize("@ss.hasPermi('system:note:list')")
  46. @GetMapping("/listDate")
  47. public TableDataInfo<UserDateNoteVo> listDate(UserNoteQueryBo bo) {
  48. startPage();
  49. List<UserDateNoteVo> list = iUserNoteService.listDate(bo);
  50. return getDataTable(list);
  51. }
  52. /**
  53. * 新增用户笔记记录
  54. */
  55. @ApiOperation("新增用户笔记记录")
  56. @PreAuthorize("@ss.hasPermi('system:note:add')")
  57. @Log(title = "用户笔记记录", businessType = BusinessType.INSERT)
  58. @PostMapping()
  59. public AjaxResult<Void> add(@RequestBody UserNoteAddBo bo) {
  60. return toAjax(iUserNoteService.insertByAddBo(bo) ? 1 : 0);
  61. }
  62. /**
  63. * 修改用户笔记记录
  64. */
  65. @ApiOperation("修改用户笔记记录")
  66. @PreAuthorize("@ss.hasPermi('system:note:edit')")
  67. @Log(title = "用户笔记记录", businessType = BusinessType.UPDATE)
  68. @PostMapping("edit")
  69. public AjaxResult<Void> edit(@RequestBody UserNoteEditBo bo) {
  70. return toAjax(iUserNoteService.updateByEditBo(bo) ? 1 : 0);
  71. }
  72. }