diff --git a/pom.xml b/pom.xml index 35127175a..481bf0d29 100644 --- a/pom.xml +++ b/pom.xml @@ -181,6 +181,13 @@ ${ruoyi.version} + + + com.ruoyi + ruoyi-note + ${ruoyi.version} + + com.ruoyi @@ -199,6 +206,7 @@ ruoyi-generator ruoyi-common ruoyi-yunbookmark + ruoyi-note pom diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/note/NmNoteContentController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/note/NmNoteContentController.java new file mode 100644 index 000000000..12a9367ef --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/note/NmNoteContentController.java @@ -0,0 +1,103 @@ +package com.ruoyi.web.controller.note; + +import java.util.List; +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.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.note.domain.NmNoteContent; +import com.ruoyi.note.service.INmNoteContentService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 文章内容Controller + * + * @author wang + * @date 2020-09-12 + */ +@RestController +@RequestMapping("/note/content") +public class NmNoteContentController extends BaseController +{ + @Autowired + private INmNoteContentService nmNoteContentService; + + /** + * 查询文章内容列表 + */ + @PreAuthorize("@ss.hasPermi('note:content:list')") + @GetMapping("/list") + public TableDataInfo list(NmNoteContent nmNoteContent) + { + startPage(); + List list = nmNoteContentService.selectNmNoteContentList(nmNoteContent); + return getDataTable(list); + } + + /** + * 导出文章内容列表 + */ + @PreAuthorize("@ss.hasPermi('note:content:export')") + @Log(title = "文章内容", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(NmNoteContent nmNoteContent) + { + List list = nmNoteContentService.selectNmNoteContentList(nmNoteContent); + ExcelUtil util = new ExcelUtil(NmNoteContent.class); + return util.exportExcel(list, "content"); + } + + /** + * 获取文章内容详细信息 + */ + @PreAuthorize("@ss.hasPermi('note:content:query')") + @GetMapping(value = "/{noteId}") + public AjaxResult getInfo(@PathVariable("noteId") Long noteId) + { + return AjaxResult.success(nmNoteContentService.selectNmNoteContentById(noteId)); + } + + /** + * 新增文章内容 + */ + @PreAuthorize("@ss.hasPermi('note:content:add')") + @Log(title = "文章内容", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody NmNoteContent nmNoteContent) + { + return toAjax(nmNoteContentService.insertNmNoteContent(nmNoteContent)); + } + + /** + * 修改文章内容 + */ + @PreAuthorize("@ss.hasPermi('note:content:edit')") + @Log(title = "文章内容", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody NmNoteContent nmNoteContent) + { + return toAjax(nmNoteContentService.updateNmNoteContent(nmNoteContent)); + } + + /** + * 删除文章内容 + */ + @PreAuthorize("@ss.hasPermi('note:content:remove')") + @Log(title = "文章内容", businessType = BusinessType.DELETE) + @DeleteMapping("/{noteIds}") + public AjaxResult remove(@PathVariable Long[] noteIds) + { + return toAjax(nmNoteContentService.deleteNmNoteContentByIds(noteIds)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/note/NmNoteController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/note/NmNoteController.java new file mode 100644 index 000000000..dba8d5a75 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/note/NmNoteController.java @@ -0,0 +1,124 @@ +package com.ruoyi.web.controller.note; + +import java.util.List; + +import com.ruoyi.common.core.domain.entity.SysUser; +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.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.note.domain.NmNote; +import com.ruoyi.note.service.INmNoteService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 便签管理Controller + * + * @author wang + * @date 2020-09-12 + */ +@RestController +@RequestMapping("/note/note") +public class NmNoteController extends BaseController +{ + @Autowired + private INmNoteService nmNoteService; + + + /** + * 查看栏目下 用户的便签 + */ + @PreAuthorize("@ss.hasPermi('note:note:list')") + @GetMapping("/selectBymenuNote") + public TableDataInfo selectBymenuNote(NmNote nmNote) + { + SysUser sysUser=getAuthUser(); + nmNote.setUserId(sysUser.getUserId()); + startPage(); + List list = nmNoteService.selectNmNoteList(nmNote); + return getDataTable(list); + } + + + + + + /** + * 查询便签管理列表 + */ + @PreAuthorize("@ss.hasPermi('note:note:list')") + @GetMapping("/list") + public TableDataInfo list(NmNote nmNote) + { + startPage(); + List list = nmNoteService.selectNmNoteList(nmNote); + return getDataTable(list); + } + + /** + * 导出便签管理列表 + */ + @PreAuthorize("@ss.hasPermi('note:note:export')") + @Log(title = "便签管理", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(NmNote nmNote) + { + List list = nmNoteService.selectNmNoteList(nmNote); + ExcelUtil util = new ExcelUtil(NmNote.class); + return util.exportExcel(list, "note"); + } + + /** + * 获取便签管理详细信息 + */ + @PreAuthorize("@ss.hasPermi('note:note:query')") + @GetMapping(value = "/{noteId}") + public AjaxResult getInfo(@PathVariable("noteId") Long noteId) + { + return AjaxResult.success(nmNoteService.selectNmNoteById(noteId)); + } + + /** + * 新增便签管理 + */ + @PreAuthorize("@ss.hasPermi('note:note:add')") + @Log(title = "便签管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody NmNote nmNote) + { + return toAjax(nmNoteService.insertNmNote(nmNote)); + } + + /** + * 修改便签管理 + */ + @PreAuthorize("@ss.hasPermi('note:note:edit')") + @Log(title = "便签管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody NmNote nmNote) + { + return toAjax(nmNoteService.updateNmNote(nmNote)); + } + + /** + * 删除便签管理 + */ + @PreAuthorize("@ss.hasPermi('note:note:remove')") + @Log(title = "便签管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{noteIds}") + public AjaxResult remove(@PathVariable Long[] noteIds) + { + return toAjax(nmNoteService.deleteNmNoteByIds(noteIds)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/note/NmNoteTagController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/note/NmNoteTagController.java new file mode 100644 index 000000000..a0258ac03 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/note/NmNoteTagController.java @@ -0,0 +1,103 @@ +package com.ruoyi.web.controller.note; + +import java.util.List; +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.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.note.domain.NmNoteTag; +import com.ruoyi.note.service.INmNoteTagService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 便签标签Controller + * + * @author wang + * @date 2020-09-12 + */ +@RestController +@RequestMapping("/note/tag") +public class NmNoteTagController extends BaseController +{ + @Autowired + private INmNoteTagService nmNoteTagService; + + /** + * 查询便签标签列表 + */ + @PreAuthorize("@ss.hasPermi('note:tag:list')") + @GetMapping("/list") + public TableDataInfo list(NmNoteTag nmNoteTag) + { + startPage(); + List list = nmNoteTagService.selectNmNoteTagList(nmNoteTag); + return getDataTable(list); + } + + /** + * 导出便签标签列表 + */ + @PreAuthorize("@ss.hasPermi('note:tag:export')") + @Log(title = "便签标签", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(NmNoteTag nmNoteTag) + { + List list = nmNoteTagService.selectNmNoteTagList(nmNoteTag); + ExcelUtil util = new ExcelUtil(NmNoteTag.class); + return util.exportExcel(list, "tag"); + } + + /** + * 获取便签标签详细信息 + */ + @PreAuthorize("@ss.hasPermi('note:tag:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(nmNoteTagService.selectNmNoteTagById(id)); + } + + /** + * 新增便签标签 + */ + @PreAuthorize("@ss.hasPermi('note:tag:add')") + @Log(title = "便签标签", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody NmNoteTag nmNoteTag) + { + return toAjax(nmNoteTagService.insertNmNoteTag(nmNoteTag)); + } + + /** + * 修改便签标签 + */ + @PreAuthorize("@ss.hasPermi('note:tag:edit')") + @Log(title = "便签标签", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody NmNoteTag nmNoteTag) + { + return toAjax(nmNoteTagService.updateNmNoteTag(nmNoteTag)); + } + + /** + * 删除便签标签 + */ + @PreAuthorize("@ss.hasPermi('note:tag:remove')") + @Log(title = "便签标签", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(nmNoteTagService.deleteNmNoteTagByIds(ids)); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java index 1dcdb1a36..ea746a6fc 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java @@ -44,17 +44,7 @@ public class BaseController return user.getUser(); } -// /** -// * @auther: Wang -// * @date: 2020/08/17 20:19 -// * 功能描述:获取当前用户UserID -// */ -// protected Long getAuthUserId() -// { -// Authentication auth = SecurityContextHolder.getContext().getAuthentication(); -// LoginUser user = (LoginUser) auth.getPrincipal(); -// return user.getUser().getUserId(); -// } + /** * 将前台传递过来的日期格式的字符串,自动转化为Date类型 diff --git a/ruoyi-framework/pom.xml b/ruoyi-framework/pom.xml index 6e0c9d5e5..636c53928 100644 --- a/ruoyi-framework/pom.xml +++ b/ruoyi-framework/pom.xml @@ -74,6 +74,12 @@ ruoyi-yunbookmark + + + com.ruoyi + ruoyi-note + + diff --git a/ruoyi-note/pom.xml b/ruoyi-note/pom.xml new file mode 100644 index 000000000..fdf162c85 --- /dev/null +++ b/ruoyi-note/pom.xml @@ -0,0 +1,28 @@ + + + + ruoyi + com.ruoyi + 3.0.0 + + 4.0.0 + + + ruoyi-note + + + note系统模块 + + + + + + + com.ruoyi + ruoyi-common + + + + diff --git a/ruoyi-note/src/main/java/com/ruoyi/note/domain/NmNote.java b/ruoyi-note/src/main/java/com/ruoyi/note/domain/NmNote.java new file mode 100644 index 000000000..2576e7ae8 --- /dev/null +++ b/ruoyi-note/src/main/java/com/ruoyi/note/domain/NmNote.java @@ -0,0 +1,263 @@ +package com.ruoyi.note.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.util.Date; + +/** + * 便签管理对象 nm_note + * + * @author wang + * @date 2020-09-12 + */ +public class NmNote +{ + private static final long serialVersionUID = 1L; + + /** Note便签ID */ + @Excel(name = "Note便签ID") + private Long noteId; + + /** 用户ID */ + @Excel(name = "用户ID") + private Long userId; + + /** 便签标题(自动截取) */ + @Excel(name = "便签标题(自动截取)") + private String title; + + /** 摘要(前50字) 循环展示 */ + @Excel(name = "摘要(前50字) 循环展示") + private String description; + + /** 所属分组Id */ + @Excel(name = "所属分组Id") + private Integer menuId; + + /** 背景颜色 '白','红','黄','蓝','紫' */ + @Excel(name = "背景颜色 '白','红','黄','蓝','紫'") + private String background; + + /** 字数 */ + @Excel(name = "字数") + private Integer noteCount; + + /** 排序(小到大) */ + @Excel(name = "排序(小到大)") + private Integer noteSort; + + /** 便签状态 */ + @Excel(name = "便签状态") + private Integer isState; + + /** 阅读进度 */ + @Excel(name = "阅读进度") + private Integer readProgress; + + /** 是否星标 */ + @Excel(name = "是否星标") + private Integer isStar; + + /** 是否删除 */ + @Excel(name = "是否删除") + private Integer isDelete; + + /** 是否置顶 */ + @Excel(name = "是否置顶") + private Integer topFlag; + + /** 是否分享(判断是否可以随意访问) */ + @Excel(name = "是否分享(判断是否可以随意访问)") + private Integer isShare; + + /** 是否加密 */ + @Excel(name = "是否加密") + private Integer isEncryption; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + /** 更新时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + public void setNoteId(Long noteId) + { + this.noteId = noteId; + } + + public Long getNoteId() + { + return noteId; + } + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setTitle(String title) + { + this.title = title; + } + + public String getTitle() + { + return title; + } + public void setDescription(String description) + { + this.description = description; + } + + public String getDescription() + { + return description; + } + public void setMenuId(Integer menuId) + { + this.menuId = menuId; + } + + public Integer getMenuId() + { + return menuId; + } + public void setBackground(String background) + { + this.background = background; + } + + public String getBackground() + { + return background; + } + public void setNoteCount(Integer noteCount) + { + this.noteCount = noteCount; + } + + public Integer getNoteCount() + { + return noteCount; + } + public void setNoteSort(Integer noteSort) + { + this.noteSort = noteSort; + } + + public Integer getNoteSort() + { + return noteSort; + } + public void setIsState(Integer isState) + { + this.isState = isState; + } + + public Integer getIsState() + { + return isState; + } + public void setReadProgress(Integer readProgress) + { + this.readProgress = readProgress; + } + + public Integer getReadProgress() + { + return readProgress; + } + public void setIsStar(Integer isStar) + { + this.isStar = isStar; + } + + public Integer getIsStar() + { + return isStar; + } + public void setIsDelete(Integer isDelete) + { + this.isDelete = isDelete; + } + + public Integer getIsDelete() + { + return isDelete; + } + public void setTopFlag(Integer topFlag) + { + this.topFlag = topFlag; + } + + public Integer getTopFlag() + { + return topFlag; + } + public void setIsShare(Integer isShare) + { + this.isShare = isShare; + } + + public Integer getIsShare() + { + return isShare; + } + public void setIsEncryption(Integer isEncryption) + { + this.isEncryption = isEncryption; + } + + public Integer getIsEncryption() + { + return isEncryption; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("noteId", getNoteId()) + .append("userId", getUserId()) + .append("title", getTitle()) + .append("description", getDescription()) + .append("menuId", getMenuId()) + .append("background", getBackground()) + .append("noteCount", getNoteCount()) + .append("noteSort", getNoteSort()) + .append("isState", getIsState()) + .append("readProgress", getReadProgress()) + .append("isStar", getIsStar()) + .append("isDelete", getIsDelete()) + .append("topFlag", getTopFlag()) + .append("isShare", getIsShare()) + .append("isEncryption", getIsEncryption()) + .append("createTime", getCreateTime()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/ruoyi-note/src/main/java/com/ruoyi/note/domain/NmNoteContent.java b/ruoyi-note/src/main/java/com/ruoyi/note/domain/NmNoteContent.java new file mode 100644 index 000000000..eac2330b4 --- /dev/null +++ b/ruoyi-note/src/main/java/com/ruoyi/note/domain/NmNoteContent.java @@ -0,0 +1,65 @@ +package com.ruoyi.note.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 文章内容对象 nm_note_content + * + * @author wang + * @date 2020-09-12 + */ +public class NmNoteContent extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 便签主键ID */ + private Long noteId; + + /** markdown编辑器内容 */ + @Excel(name = "markdown编辑器内容") + private String markdownContent; + + /** ueditor编辑器内容 */ + @Excel(name = "ueditor编辑器内容") + private String ueditorContent; + + public void setNoteId(Long noteId) + { + this.noteId = noteId; + } + + public Long getNoteId() + { + return noteId; + } + public void setMarkdownContent(String markdownContent) + { + this.markdownContent = markdownContent; + } + + public String getMarkdownContent() + { + return markdownContent; + } + public void setUeditorContent(String ueditorContent) + { + this.ueditorContent = ueditorContent; + } + + public String getUeditorContent() + { + return ueditorContent; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("noteId", getNoteId()) + .append("markdownContent", getMarkdownContent()) + .append("ueditorContent", getUeditorContent()) + .toString(); + } +} diff --git a/ruoyi-note/src/main/java/com/ruoyi/note/domain/NmNoteTag.java b/ruoyi-note/src/main/java/com/ruoyi/note/domain/NmNoteTag.java new file mode 100644 index 000000000..2bc6260a0 --- /dev/null +++ b/ruoyi-note/src/main/java/com/ruoyi/note/domain/NmNoteTag.java @@ -0,0 +1,65 @@ +package com.ruoyi.note.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 便签标签对象 nm_note_tag + * + * @author wang + * @date 2020-09-12 + */ +public class NmNoteTag extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 便签id */ + @Excel(name = "便签id") + private Long noteId; + + /** 标签Id */ + @Excel(name = "标签Id") + private Long tagId; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setNoteId(Long noteId) + { + this.noteId = noteId; + } + + public Long getNoteId() + { + return noteId; + } + public void setTagId(Long tagId) + { + this.tagId = tagId; + } + + public Long getTagId() + { + return tagId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("noteId", getNoteId()) + .append("tagId", getTagId()) + .toString(); + } +} diff --git a/ruoyi-note/src/main/java/com/ruoyi/note/mapper/NmNoteContentMapper.java b/ruoyi-note/src/main/java/com/ruoyi/note/mapper/NmNoteContentMapper.java new file mode 100644 index 000000000..d5c76a62d --- /dev/null +++ b/ruoyi-note/src/main/java/com/ruoyi/note/mapper/NmNoteContentMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.note.mapper; + +import java.util.List; +import com.ruoyi.note.domain.NmNoteContent; + +/** + * 文章内容Mapper接口 + * + * @author wang + * @date 2020-09-12 + */ +public interface NmNoteContentMapper +{ + /** + * 查询文章内容 + * + * @param noteId 文章内容ID + * @return 文章内容 + */ + public NmNoteContent selectNmNoteContentById(Long noteId); + + /** + * 查询文章内容列表 + * + * @param nmNoteContent 文章内容 + * @return 文章内容集合 + */ + public List selectNmNoteContentList(NmNoteContent nmNoteContent); + + /** + * 新增文章内容 + * + * @param nmNoteContent 文章内容 + * @return 结果 + */ + public int insertNmNoteContent(NmNoteContent nmNoteContent); + + /** + * 修改文章内容 + * + * @param nmNoteContent 文章内容 + * @return 结果 + */ + public int updateNmNoteContent(NmNoteContent nmNoteContent); + + /** + * 删除文章内容 + * + * @param noteId 文章内容ID + * @return 结果 + */ + public int deleteNmNoteContentById(Long noteId); + + /** + * 批量删除文章内容 + * + * @param noteIds 需要删除的数据ID + * @return 结果 + */ + public int deleteNmNoteContentByIds(Long[] noteIds); +} diff --git a/ruoyi-note/src/main/java/com/ruoyi/note/mapper/NmNoteMapper.java b/ruoyi-note/src/main/java/com/ruoyi/note/mapper/NmNoteMapper.java new file mode 100644 index 000000000..cafafb63b --- /dev/null +++ b/ruoyi-note/src/main/java/com/ruoyi/note/mapper/NmNoteMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.note.mapper; + +import java.util.List; +import com.ruoyi.note.domain.NmNote; + +/** + * 便签管理Mapper接口 + * + * @author wang + * @date 2020-09-12 + */ +public interface NmNoteMapper +{ + /** + * 查询便签管理 + * + * @param noteId 便签管理ID + * @return 便签管理 + */ + public NmNote selectNmNoteById(Long noteId); + + /** + * 查询便签管理列表 + * + * @param nmNote 便签管理 + * @return 便签管理集合 + */ + public List selectNmNoteList(NmNote nmNote); + + /** + * 新增便签管理 + * + * @param nmNote 便签管理 + * @return 结果 + */ + public int insertNmNote(NmNote nmNote); + + /** + * 修改便签管理 + * + * @param nmNote 便签管理 + * @return 结果 + */ + public int updateNmNote(NmNote nmNote); + + /** + * 删除便签管理 + * + * @param noteId 便签管理ID + * @return 结果 + */ + public int deleteNmNoteById(Long noteId); + + /** + * 批量删除便签管理 + * + * @param noteIds 需要删除的数据ID + * @return 结果 + */ + public int deleteNmNoteByIds(Long[] noteIds); +} diff --git a/ruoyi-note/src/main/java/com/ruoyi/note/mapper/NmNoteTagMapper.java b/ruoyi-note/src/main/java/com/ruoyi/note/mapper/NmNoteTagMapper.java new file mode 100644 index 000000000..f75196879 --- /dev/null +++ b/ruoyi-note/src/main/java/com/ruoyi/note/mapper/NmNoteTagMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.note.mapper; + +import java.util.List; +import com.ruoyi.note.domain.NmNoteTag; + +/** + * 便签标签Mapper接口 + * + * @author wang + * @date 2020-09-12 + */ +public interface NmNoteTagMapper +{ + /** + * 查询便签标签 + * + * @param id 便签标签ID + * @return 便签标签 + */ + public NmNoteTag selectNmNoteTagById(Long id); + + /** + * 查询便签标签列表 + * + * @param nmNoteTag 便签标签 + * @return 便签标签集合 + */ + public List selectNmNoteTagList(NmNoteTag nmNoteTag); + + /** + * 新增便签标签 + * + * @param nmNoteTag 便签标签 + * @return 结果 + */ + public int insertNmNoteTag(NmNoteTag nmNoteTag); + + /** + * 修改便签标签 + * + * @param nmNoteTag 便签标签 + * @return 结果 + */ + public int updateNmNoteTag(NmNoteTag nmNoteTag); + + /** + * 删除便签标签 + * + * @param id 便签标签ID + * @return 结果 + */ + public int deleteNmNoteTagById(Long id); + + /** + * 批量删除便签标签 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteNmNoteTagByIds(Long[] ids); +} diff --git a/ruoyi-note/src/main/java/com/ruoyi/note/service/INmNoteContentService.java b/ruoyi-note/src/main/java/com/ruoyi/note/service/INmNoteContentService.java new file mode 100644 index 000000000..732d976c9 --- /dev/null +++ b/ruoyi-note/src/main/java/com/ruoyi/note/service/INmNoteContentService.java @@ -0,0 +1,61 @@ +package com.ruoyi.note.service; + +import java.util.List; +import com.ruoyi.note.domain.NmNoteContent; + +/** + * 文章内容Service接口 + * + * @author wang + * @date 2020-09-12 + */ +public interface INmNoteContentService +{ + /** + * 查询文章内容 + * + * @param noteId 文章内容ID + * @return 文章内容 + */ + public NmNoteContent selectNmNoteContentById(Long noteId); + + /** + * 查询文章内容列表 + * + * @param nmNoteContent 文章内容 + * @return 文章内容集合 + */ + public List selectNmNoteContentList(NmNoteContent nmNoteContent); + + /** + * 新增文章内容 + * + * @param nmNoteContent 文章内容 + * @return 结果 + */ + public int insertNmNoteContent(NmNoteContent nmNoteContent); + + /** + * 修改文章内容 + * + * @param nmNoteContent 文章内容 + * @return 结果 + */ + public int updateNmNoteContent(NmNoteContent nmNoteContent); + + /** + * 批量删除文章内容 + * + * @param noteIds 需要删除的文章内容ID + * @return 结果 + */ + public int deleteNmNoteContentByIds(Long[] noteIds); + + /** + * 删除文章内容信息 + * + * @param noteId 文章内容ID + * @return 结果 + */ + public int deleteNmNoteContentById(Long noteId); +} diff --git a/ruoyi-note/src/main/java/com/ruoyi/note/service/INmNoteService.java b/ruoyi-note/src/main/java/com/ruoyi/note/service/INmNoteService.java new file mode 100644 index 000000000..11d0d277b --- /dev/null +++ b/ruoyi-note/src/main/java/com/ruoyi/note/service/INmNoteService.java @@ -0,0 +1,61 @@ +package com.ruoyi.note.service; + +import java.util.List; +import com.ruoyi.note.domain.NmNote; + +/** + * 便签管理Service接口 + * + * @author wang + * @date 2020-09-12 + */ +public interface INmNoteService +{ + /** + * 查询便签管理 + * + * @param noteId 便签管理ID + * @return 便签管理 + */ + public NmNote selectNmNoteById(Long noteId); + + /** + * 查询便签管理列表 + * + * @param nmNote 便签管理 + * @return 便签管理集合 + */ + public List selectNmNoteList(NmNote nmNote); + + /** + * 新增便签管理 + * + * @param nmNote 便签管理 + * @return 结果 + */ + public int insertNmNote(NmNote nmNote); + + /** + * 修改便签管理 + * + * @param nmNote 便签管理 + * @return 结果 + */ + public int updateNmNote(NmNote nmNote); + + /** + * 批量删除便签管理 + * + * @param noteIds 需要删除的便签管理ID + * @return 结果 + */ + public int deleteNmNoteByIds(Long[] noteIds); + + /** + * 删除便签管理信息 + * + * @param noteId 便签管理ID + * @return 结果 + */ + public int deleteNmNoteById(Long noteId); +} diff --git a/ruoyi-note/src/main/java/com/ruoyi/note/service/INmNoteTagService.java b/ruoyi-note/src/main/java/com/ruoyi/note/service/INmNoteTagService.java new file mode 100644 index 000000000..cfb775001 --- /dev/null +++ b/ruoyi-note/src/main/java/com/ruoyi/note/service/INmNoteTagService.java @@ -0,0 +1,61 @@ +package com.ruoyi.note.service; + +import java.util.List; +import com.ruoyi.note.domain.NmNoteTag; + +/** + * 便签标签Service接口 + * + * @author wang + * @date 2020-09-12 + */ +public interface INmNoteTagService +{ + /** + * 查询便签标签 + * + * @param id 便签标签ID + * @return 便签标签 + */ + public NmNoteTag selectNmNoteTagById(Long id); + + /** + * 查询便签标签列表 + * + * @param nmNoteTag 便签标签 + * @return 便签标签集合 + */ + public List selectNmNoteTagList(NmNoteTag nmNoteTag); + + /** + * 新增便签标签 + * + * @param nmNoteTag 便签标签 + * @return 结果 + */ + public int insertNmNoteTag(NmNoteTag nmNoteTag); + + /** + * 修改便签标签 + * + * @param nmNoteTag 便签标签 + * @return 结果 + */ + public int updateNmNoteTag(NmNoteTag nmNoteTag); + + /** + * 批量删除便签标签 + * + * @param ids 需要删除的便签标签ID + * @return 结果 + */ + public int deleteNmNoteTagByIds(Long[] ids); + + /** + * 删除便签标签信息 + * + * @param id 便签标签ID + * @return 结果 + */ + public int deleteNmNoteTagById(Long id); +} diff --git a/ruoyi-note/src/main/java/com/ruoyi/note/service/impl/NmNoteContentServiceImpl.java b/ruoyi-note/src/main/java/com/ruoyi/note/service/impl/NmNoteContentServiceImpl.java new file mode 100644 index 000000000..99dd5d3e7 --- /dev/null +++ b/ruoyi-note/src/main/java/com/ruoyi/note/service/impl/NmNoteContentServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.note.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.note.mapper.NmNoteContentMapper; +import com.ruoyi.note.domain.NmNoteContent; +import com.ruoyi.note.service.INmNoteContentService; + +/** + * 文章内容Service业务层处理 + * + * @author wang + * @date 2020-09-12 + */ +@Service +public class NmNoteContentServiceImpl implements INmNoteContentService +{ + @Autowired + private NmNoteContentMapper nmNoteContentMapper; + + /** + * 查询文章内容 + * + * @param noteId 文章内容ID + * @return 文章内容 + */ + @Override + public NmNoteContent selectNmNoteContentById(Long noteId) + { + return nmNoteContentMapper.selectNmNoteContentById(noteId); + } + + /** + * 查询文章内容列表 + * + * @param nmNoteContent 文章内容 + * @return 文章内容 + */ + @Override + public List selectNmNoteContentList(NmNoteContent nmNoteContent) + { + return nmNoteContentMapper.selectNmNoteContentList(nmNoteContent); + } + + /** + * 新增文章内容 + * + * @param nmNoteContent 文章内容 + * @return 结果 + */ + @Override + public int insertNmNoteContent(NmNoteContent nmNoteContent) + { + return nmNoteContentMapper.insertNmNoteContent(nmNoteContent); + } + + /** + * 修改文章内容 + * + * @param nmNoteContent 文章内容 + * @return 结果 + */ + @Override + public int updateNmNoteContent(NmNoteContent nmNoteContent) + { + return nmNoteContentMapper.updateNmNoteContent(nmNoteContent); + } + + /** + * 批量删除文章内容 + * + * @param noteIds 需要删除的文章内容ID + * @return 结果 + */ + @Override + public int deleteNmNoteContentByIds(Long[] noteIds) + { + return nmNoteContentMapper.deleteNmNoteContentByIds(noteIds); + } + + /** + * 删除文章内容信息 + * + * @param noteId 文章内容ID + * @return 结果 + */ + @Override + public int deleteNmNoteContentById(Long noteId) + { + return nmNoteContentMapper.deleteNmNoteContentById(noteId); + } +} diff --git a/ruoyi-note/src/main/java/com/ruoyi/note/service/impl/NmNoteServiceImpl.java b/ruoyi-note/src/main/java/com/ruoyi/note/service/impl/NmNoteServiceImpl.java new file mode 100644 index 000000000..fa9080fb5 --- /dev/null +++ b/ruoyi-note/src/main/java/com/ruoyi/note/service/impl/NmNoteServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.note.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.note.mapper.NmNoteMapper; +import com.ruoyi.note.domain.NmNote; +import com.ruoyi.note.service.INmNoteService; + +/** + * 便签管理Service业务层处理 + * + * @author wang + * @date 2020-09-12 + */ +@Service +public class NmNoteServiceImpl implements INmNoteService +{ + @Autowired + private NmNoteMapper nmNoteMapper; + + /** + * 查询便签管理 + * + * @param noteId 便签管理ID + * @return 便签管理 + */ + @Override + public NmNote selectNmNoteById(Long noteId) + { + return nmNoteMapper.selectNmNoteById(noteId); + } + + /** + * 查询便签管理列表 + * + * @param nmNote 便签管理 + * @return 便签管理 + */ + @Override + public List selectNmNoteList(NmNote nmNote) + { + return nmNoteMapper.selectNmNoteList(nmNote); + } + + /** + * 新增便签管理 + * + * @param nmNote 便签管理 + * @return 结果 + */ + @Override + public int insertNmNote(NmNote nmNote) + { + nmNote.setCreateTime(DateUtils.getNowDate()); + return nmNoteMapper.insertNmNote(nmNote); + } + + /** + * 修改便签管理 + * + * @param nmNote 便签管理 + * @return 结果 + */ + @Override + public int updateNmNote(NmNote nmNote) + { + nmNote.setUpdateTime(DateUtils.getNowDate()); + return nmNoteMapper.updateNmNote(nmNote); + } + + /** + * 批量删除便签管理 + * + * @param noteIds 需要删除的便签管理ID + * @return 结果 + */ + @Override + public int deleteNmNoteByIds(Long[] noteIds) + { + return nmNoteMapper.deleteNmNoteByIds(noteIds); + } + + /** + * 删除便签管理信息 + * + * @param noteId 便签管理ID + * @return 结果 + */ + @Override + public int deleteNmNoteById(Long noteId) + { + return nmNoteMapper.deleteNmNoteById(noteId); + } +} diff --git a/ruoyi-note/src/main/java/com/ruoyi/note/service/impl/NmNoteTagServiceImpl.java b/ruoyi-note/src/main/java/com/ruoyi/note/service/impl/NmNoteTagServiceImpl.java new file mode 100644 index 000000000..a123494a2 --- /dev/null +++ b/ruoyi-note/src/main/java/com/ruoyi/note/service/impl/NmNoteTagServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.note.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.note.mapper.NmNoteTagMapper; +import com.ruoyi.note.domain.NmNoteTag; +import com.ruoyi.note.service.INmNoteTagService; + +/** + * 便签标签Service业务层处理 + * + * @author wang + * @date 2020-09-12 + */ +@Service +public class NmNoteTagServiceImpl implements INmNoteTagService +{ + @Autowired + private NmNoteTagMapper nmNoteTagMapper; + + /** + * 查询便签标签 + * + * @param id 便签标签ID + * @return 便签标签 + */ + @Override + public NmNoteTag selectNmNoteTagById(Long id) + { + return nmNoteTagMapper.selectNmNoteTagById(id); + } + + /** + * 查询便签标签列表 + * + * @param nmNoteTag 便签标签 + * @return 便签标签 + */ + @Override + public List selectNmNoteTagList(NmNoteTag nmNoteTag) + { + return nmNoteTagMapper.selectNmNoteTagList(nmNoteTag); + } + + /** + * 新增便签标签 + * + * @param nmNoteTag 便签标签 + * @return 结果 + */ + @Override + public int insertNmNoteTag(NmNoteTag nmNoteTag) + { + return nmNoteTagMapper.insertNmNoteTag(nmNoteTag); + } + + /** + * 修改便签标签 + * + * @param nmNoteTag 便签标签 + * @return 结果 + */ + @Override + public int updateNmNoteTag(NmNoteTag nmNoteTag) + { + return nmNoteTagMapper.updateNmNoteTag(nmNoteTag); + } + + /** + * 批量删除便签标签 + * + * @param ids 需要删除的便签标签ID + * @return 结果 + */ + @Override + public int deleteNmNoteTagByIds(Long[] ids) + { + return nmNoteTagMapper.deleteNmNoteTagByIds(ids); + } + + /** + * 删除便签标签信息 + * + * @param id 便签标签ID + * @return 结果 + */ + @Override + public int deleteNmNoteTagById(Long id) + { + return nmNoteTagMapper.deleteNmNoteTagById(id); + } +} diff --git a/ruoyi-note/src/main/resources/mapper/note/NmNoteContentMapper.xml b/ruoyi-note/src/main/resources/mapper/note/NmNoteContentMapper.xml new file mode 100644 index 000000000..c6b966018 --- /dev/null +++ b/ruoyi-note/src/main/resources/mapper/note/NmNoteContentMapper.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + select note_id, markdown_content, ueditor_content from nm_note_content + + + + + + + + + insert into nm_note_content + + note_id, + markdown_content, + ueditor_content, + + + #{noteId}, + #{markdownContent}, + #{ueditorContent}, + + + + + update nm_note_content + + markdown_content = #{markdownContent}, + ueditor_content = #{ueditorContent}, + + where note_id = #{noteId} + + + + delete from nm_note_content where note_id = #{noteId} + + + + delete from nm_note_content where note_id in + + #{noteId} + + + + diff --git a/ruoyi-note/src/main/resources/mapper/note/NmNoteMapper.xml b/ruoyi-note/src/main/resources/mapper/note/NmNoteMapper.xml new file mode 100644 index 000000000..aae3dacdc --- /dev/null +++ b/ruoyi-note/src/main/resources/mapper/note/NmNoteMapper.xml @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + select note_id, user_id, title, description, menu_id, background, note_count, note_sort, is_state, read_progress, is_star, is_delete, top_flag, is_share, is_encryption, create_time, update_time from nm_note + + + + + + + + insert into nm_note + + note_id, + user_id, + title, + description, + menu_id, + background, + note_count, + note_sort, + is_state, + read_progress, + is_star, + is_delete, + top_flag, + is_share, + is_encryption, + create_time, + update_time, + + + #{noteId}, + #{userId}, + #{title}, + #{description}, + #{menuId}, + #{background}, + #{noteCount}, + #{noteSort}, + #{isState}, + #{readProgress}, + #{isStar}, + #{isDelete}, + #{topFlag}, + #{isShare}, + #{isEncryption}, + #{createTime}, + #{updateTime}, + + + + + update nm_note + + user_id = #{userId}, + title = #{title}, + description = #{description}, + menu_id = #{menuId}, + background = #{background}, + note_count = #{noteCount}, + note_sort = #{noteSort}, + is_state = #{isState}, + read_progress = #{readProgress}, + is_star = #{isStar}, + is_delete = #{isDelete}, + top_flag = #{topFlag}, + is_share = #{isShare}, + is_encryption = #{isEncryption}, + create_time = #{createTime}, + update_time = #{updateTime}, + + where note_id = #{noteId} + + + + delete from nm_note where note_id = #{noteId} + + + + delete from nm_note where note_id in + + #{noteId} + + + + diff --git a/ruoyi-note/src/main/resources/mapper/note/NmNoteTagMapper.xml b/ruoyi-note/src/main/resources/mapper/note/NmNoteTagMapper.xml new file mode 100644 index 000000000..a2fe5c0fb --- /dev/null +++ b/ruoyi-note/src/main/resources/mapper/note/NmNoteTagMapper.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + select id, note_id, tag_id from nm_note_tag + + + + + + + + + insert into nm_note_tag + + note_id, + tag_id, + + + #{noteId}, + #{tagId}, + + + + + update nm_note_tag + + note_id = #{noteId}, + tag_id = #{tagId}, + + where id = #{id} + + + + delete from nm_note_tag where id = #{id} + + + + delete from nm_note_tag where id in + + #{id} + + + + diff --git a/ruoyi-ui/src/api/note/content.js b/ruoyi-ui/src/api/note/content.js new file mode 100644 index 000000000..e64977172 --- /dev/null +++ b/ruoyi-ui/src/api/note/content.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询文章内容列表 +export function listContent(query) { + return request({ + url: '/note/content/list', + method: 'get', + params: query + }) +} + +// 查询文章内容详细 +export function getContent(noteId) { + return request({ + url: '/note/content/' + noteId, + method: 'get' + }) +} + +// 新增文章内容 +export function addContent(data) { + return request({ + url: '/note/content', + method: 'post', + data: data + }) +} + +// 修改文章内容 +export function updateContent(data) { + return request({ + url: '/note/content', + method: 'put', + data: data + }) +} + +// 删除文章内容 +export function delContent(noteId) { + return request({ + url: '/note/content/' + noteId, + method: 'delete' + }) +} + +// 导出文章内容 +export function exportContent(query) { + return request({ + url: '/note/content/export', + method: 'get', + params: query + }) +} \ No newline at end of file diff --git a/ruoyi-ui/src/api/note/note.js b/ruoyi-ui/src/api/note/note.js new file mode 100644 index 000000000..db5cd3b7d --- /dev/null +++ b/ruoyi-ui/src/api/note/note.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询便签管理列表 +export function listNote(query) { + return request({ + url: '/note/note/list', + method: 'get', + params: query + }) +} + +// 查询便签管理详细 +export function getNote(noteId) { + return request({ + url: '/note/note/' + noteId, + method: 'get' + }) +} + +// 新增便签管理 +export function addNote(data) { + return request({ + url: '/note/note', + method: 'post', + data: data + }) +} + +// 修改便签管理 +export function updateNote(data) { + return request({ + url: '/note/note', + method: 'put', + data: data + }) +} + +// 删除便签管理 +export function delNote(noteId) { + return request({ + url: '/note/note/' + noteId, + method: 'delete' + }) +} + +// 导出便签管理 +export function exportNote(query) { + return request({ + url: '/note/note/export', + method: 'get', + params: query + }) +} \ No newline at end of file diff --git a/ruoyi-ui/src/api/note/tag.js b/ruoyi-ui/src/api/note/tag.js new file mode 100644 index 000000000..dd9b1c9bd --- /dev/null +++ b/ruoyi-ui/src/api/note/tag.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询便签标签列表 +export function listTag(query) { + return request({ + url: '/note/tag/list', + method: 'get', + params: query + }) +} + +// 查询便签标签详细 +export function getTag(id) { + return request({ + url: '/note/tag/' + id, + method: 'get' + }) +} + +// 新增便签标签 +export function addTag(data) { + return request({ + url: '/note/tag', + method: 'post', + data: data + }) +} + +// 修改便签标签 +export function updateTag(data) { + return request({ + url: '/note/tag', + method: 'put', + data: data + }) +} + +// 删除便签标签 +export function delTag(id) { + return request({ + url: '/note/tag/' + id, + method: 'delete' + }) +} + +// 导出便签标签 +export function exportTag(query) { + return request({ + url: '/note/tag/export', + method: 'get', + params: query + }) +} \ No newline at end of file diff --git a/ruoyi-ui/src/views/note/content/index.vue b/ruoyi-ui/src/views/note/content/index.vue new file mode 100644 index 000000000..3b2488c48 --- /dev/null +++ b/ruoyi-ui/src/views/note/content/index.vue @@ -0,0 +1,279 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/views/note/note/index.vue b/ruoyi-ui/src/views/note/note/index.vue new file mode 100644 index 000000000..e0ae8abe2 --- /dev/null +++ b/ruoyi-ui/src/views/note/note/index.vue @@ -0,0 +1,539 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/views/note/tag/index.vue b/ruoyi-ui/src/views/note/tag/index.vue new file mode 100644 index 000000000..4571238e9 --- /dev/null +++ b/ruoyi-ui/src/views/note/tag/index.vue @@ -0,0 +1,269 @@ + + + \ No newline at end of file