package com.zhongzheng.controller.user; import java.util.List; import java.util.Arrays; import com.zhongzheng.modules.user.vo.UserDateNoteVo; import lombok.RequiredArgsConstructor; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.zhongzheng.common.annotation.Log; import com.zhongzheng.common.core.controller.BaseController; import com.zhongzheng.common.core.domain.AjaxResult; import com.zhongzheng.common.enums.BusinessType; import com.zhongzheng.modules.user.vo.UserNoteVo; import com.zhongzheng.modules.user.bo.UserNoteQueryBo; import com.zhongzheng.modules.user.bo.UserNoteAddBo; import com.zhongzheng.modules.user.bo.UserNoteEditBo; import com.zhongzheng.modules.user.service.IUserNoteService; import com.zhongzheng.common.utils.poi.ExcelUtil; import com.zhongzheng.common.core.page.TableDataInfo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; /** * 用户笔记记录Controller * * @author ruoyi * @date 2021-12-14 */ @Api(value = "用户笔记记录控制器", tags = {"用户笔记记录管理"}) @RequiredArgsConstructor(onConstructor_ = @Autowired) @RestController @RequestMapping("/user/note") public class UserNoteController extends BaseController { private final IUserNoteService iUserNoteService; /** * 查询用户笔记记录列表 */ @ApiOperation("查询用户笔记记录列表") @PreAuthorize("@ss.hasPermi('system:note:list')") @GetMapping("/listDate") public TableDataInfo listDate(UserNoteQueryBo bo) { startPage(); List list = iUserNoteService.listDate(bo); return getDataTable(list); } /** * 新增用户笔记记录 */ @ApiOperation("新增用户笔记记录") @PreAuthorize("@ss.hasPermi('system:note:add')") @Log(title = "用户笔记记录", businessType = BusinessType.INSERT) @PostMapping() public AjaxResult add(@RequestBody UserNoteAddBo bo) { return toAjax(iUserNoteService.insertByAddBo(bo) ? 1 : 0); } /** * 修改用户笔记记录 */ @ApiOperation("修改用户笔记记录") @PreAuthorize("@ss.hasPermi('system:note:edit')") @Log(title = "用户笔记记录", businessType = BusinessType.UPDATE) @PostMapping("edit") public AjaxResult edit(@RequestBody UserNoteEditBo bo) { return toAjax(iUserNoteService.updateByEditBo(bo) ? 1 : 0); } }