新增便签ruoyi-note模块
This commit is contained in:
@ -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<NmNoteContent> 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<NmNoteContent> list = nmNoteContentService.selectNmNoteContentList(nmNoteContent);
|
||||
ExcelUtil<NmNoteContent> util = new ExcelUtil<NmNoteContent>(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));
|
||||
}
|
||||
}
|
@ -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<NmNote> list = nmNoteService.selectNmNoteList(nmNote);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询便签管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('note:note:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(NmNote nmNote)
|
||||
{
|
||||
startPage();
|
||||
List<NmNote> 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<NmNote> list = nmNoteService.selectNmNoteList(nmNote);
|
||||
ExcelUtil<NmNote> util = new ExcelUtil<NmNote>(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));
|
||||
}
|
||||
}
|
@ -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<NmNoteTag> 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<NmNoteTag> list = nmNoteTagService.selectNmNoteTagList(nmNoteTag);
|
||||
ExcelUtil<NmNoteTag> util = new ExcelUtil<NmNoteTag>(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));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user