书签查看

This commit is contained in:
WangHao 2020-09-30 22:36:44 +08:00
parent f5cd3fd44e
commit 6db93e0123
6 changed files with 120 additions and 31 deletions

View File

@ -3,6 +3,7 @@ package com.ruoyi.web.controller.note;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.sun.org.apache.bcel.internal.generic.NEW;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -37,20 +38,61 @@ public class NmNoteController extends BaseController
/**
* 查看栏目下 用户的便签
* 用户查看栏目下的所有便签
*/
@PreAuthorize("@ss.hasPermi('note:note:list')")
@GetMapping("/selectBymenuNote")
public TableDataInfo selectBymenuNote(NmNote nmNote)
public TableDataInfo selectBymenuNote(Long menuId)
{
SysUser sysUser=getAuthUser();
NmNote nmNote= new NmNote();
nmNote.setUserId(sysUser.getUserId());
nmNote.setMenuId(menuId);
startPage();
List<NmNote> list = nmNoteService.selectNmNoteList(nmNote);
return getDataTable(list);
}
/**
* 用户新增便签
*/
@PostMapping("/addUserNote")
public AjaxResult userAddNote(@RequestBody NmNote nmNote)
{
SysUser sysUser=getAuthUser();
nmNote.setUserId(sysUser.getUserId());
return toAjax(nmNoteService.insertNmNote(nmNote));
}
/**
*用户 获取便签详细信息 然后修改
*/
@GetMapping(value = "/user/{noteId}")
public AjaxResult userGetInfo(@PathVariable("noteId") Long noteId)
{
SysUser sysUser=getAuthUser();
return AjaxResult.success(nmNoteService.selectNmNoteuserById(noteId,sysUser.getUserId()));
}
/**
* 用户修改便签
*/
/**
* 用户删除便签
*/
@ -66,6 +108,7 @@ public class NmNoteController extends BaseController
return getDataTable(list);
}
/**
* 导出便签管理列表
*/
@ -79,6 +122,7 @@ public class NmNoteController extends BaseController
return util.exportExcel(list, "note");
}
/**
* 获取便签管理详细信息
*/
@ -89,6 +133,7 @@ public class NmNoteController extends BaseController
return AjaxResult.success(nmNoteService.selectNmNoteById(noteId));
}
/**
* 新增便签管理
*/

View File

@ -8,6 +8,8 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import javax.persistence.Column;
import javax.persistence.Table;
import java.util.Date;
/**
@ -19,76 +21,94 @@ import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table(name="nm_note")
public class NmNote
{
private static final long serialVersionUID = 1L;
/** Note便签ID */
@Column(name = "note_id")
@Excel(name = "Note便签ID")
private Long noteId;
/** 用户ID */
@Column(name = "user_id")
@Excel(name = "用户ID")
private Long userId;
/** 便签标题(自动截取) */
@Column(name = "title")
@Excel(name = "便签标题(自动截取)")
private String title;
/** 摘要(前50字) 循环展示 */
@Column(name = "description")
@Excel(name = "摘要(前50字) 循环展示")
private String description;
/** 所属分组Id */
@Column(name = "menu_id")
@Excel(name = "所属分组Id")
private Integer menuId;
private Long menuId;
/** 背景颜色 '白','红','黄','蓝','紫' */
@Excel(name = "背景颜色 '白','红','黄','蓝','紫'")
@Column(name = "background")
private String background;
/** 字数 */
@Excel(name = "字数")
@Column(name = "note_count")
private Integer noteCount;
/** 排序(小到大) */
@Excel(name = "排序(小到大)")
@Column(name = "note_sort")
private Integer noteSort;
/** 便签状态 */
@Excel(name = "便签状态")
@Column(name = "is_state")
private Integer isState;
/** 阅读进度 */
@Excel(name = "阅读进度")
@Column(name = "read_progress")
private Integer readProgress;
/** 是否星标 */
@Excel(name = "是否星标")
@Column(name = "is_star")
private Integer isStar;
/** 是否删除 */
@Excel(name = "是否删除")
@Column(name = "is_delete")
private Integer isDelete;
/** 是否置顶 */
@Excel(name = "是否置顶")
@Column(name = "top_flag")
private Integer topFlag;
/** 是否分享(判断是否可以随意访问) */
@Excel(name = "是否分享(判断是否可以随意访问)")
@Column(name = "is_share")
private Integer isShare;
/** 是否加密 */
@Excel(name = "是否加密")
@Column(name = "is_encryption")
private Integer isEncryption;
/** 创建时间 */
@Column(name = "create_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Column(name = "update_time")
private Date updateTime;

View File

@ -1,19 +1,21 @@
package com.ruoyi.note.mapper;
import java.util.List;
import com.ruoyi.common.mybatisMapper.MyMapper;
import com.ruoyi.note.domain.NmNote;
/**
* 便签管理Mapper接口
*
*
* @author wang
* @date 2020-09-12
*/
public interface NmNoteMapper
public interface NmNoteMapper extends MyMapper<NmNote>
{
/**
* 查询便签管理
*
*
* @param noteId 便签管理ID
* @return 便签管理
*/
@ -21,7 +23,7 @@ public interface NmNoteMapper
/**
* 查询便签管理列表
*
*
* @param nmNote 便签管理
* @return 便签管理集合
*/
@ -29,7 +31,7 @@ public interface NmNoteMapper
/**
* 新增便签管理
*
*
* @param nmNote 便签管理
* @return 结果
*/
@ -37,7 +39,7 @@ public interface NmNoteMapper
/**
* 修改便签管理
*
*
* @param nmNote 便签管理
* @return 结果
*/
@ -45,7 +47,7 @@ public interface NmNoteMapper
/**
* 删除便签管理
*
*
* @param noteId 便签管理ID
* @return 结果
*/
@ -53,7 +55,7 @@ public interface NmNoteMapper
/**
* 批量删除便签管理
*
*
* @param noteIds 需要删除的数据ID
* @return 结果
*/

View File

@ -5,15 +5,15 @@ import com.ruoyi.note.domain.NmNote;
/**
* 便签管理Service接口
*
*
* @author wang
* @date 2020-09-12
*/
public interface INmNoteService
public interface INmNoteService
{
/**
* 查询便签管理
*
*
* @param noteId 便签管理ID
* @return 便签管理
*/
@ -21,7 +21,7 @@ public interface INmNoteService
/**
* 查询便签管理列表
*
*
* @param nmNote 便签管理
* @return 便签管理集合
*/
@ -29,7 +29,7 @@ public interface INmNoteService
/**
* 新增便签管理
*
*
* @param nmNote 便签管理
* @return 结果
*/
@ -37,7 +37,7 @@ public interface INmNoteService
/**
* 修改便签管理
*
*
* @param nmNote 便签管理
* @return 结果
*/
@ -45,7 +45,7 @@ public interface INmNoteService
/**
* 批量删除便签管理
*
*
* @param noteIds 需要删除的便签管理ID
* @return 结果
*/
@ -53,9 +53,17 @@ public interface INmNoteService
/**
* 删除便签管理信息
*
*
* @param noteId 便签管理ID
* @return 结果
*/
public int deleteNmNoteById(Long noteId);
/**
* 用户根据ID查询便签
*
* @param noteId 便签管理ID
* @return 便签管理
*/
public NmNote selectNmNoteuserById(Long noteId,Long userID);
}

View File

@ -10,19 +10,19 @@ import com.ruoyi.note.service.INmNoteService;
/**
* 便签管理Service业务层处理
*
*
* @author wang
* @date 2020-09-12
*/
@Service
public class NmNoteServiceImpl implements INmNoteService
public class NmNoteServiceImpl implements INmNoteService
{
@Autowired
private NmNoteMapper nmNoteMapper;
/**
* 查询便签管理
*
*
* @param noteId 便签管理ID
* @return 便签管理
*/
@ -34,7 +34,7 @@ public class NmNoteServiceImpl implements INmNoteService
/**
* 查询便签管理列表
*
*
* @param nmNote 便签管理
* @return 便签管理
*/
@ -46,7 +46,7 @@ public class NmNoteServiceImpl implements INmNoteService
/**
* 新增便签管理
*
*
* @param nmNote 便签管理
* @return 结果
*/
@ -59,7 +59,7 @@ public class NmNoteServiceImpl implements INmNoteService
/**
* 修改便签管理
*
*
* @param nmNote 便签管理
* @return 结果
*/
@ -72,7 +72,7 @@ public class NmNoteServiceImpl implements INmNoteService
/**
* 批量删除便签管理
*
*
* @param noteIds 需要删除的便签管理ID
* @return 结果
*/
@ -84,7 +84,7 @@ public class NmNoteServiceImpl implements INmNoteService
/**
* 删除便签管理信息
*
*
* @param noteId 便签管理ID
* @return 结果
*/
@ -93,4 +93,20 @@ public class NmNoteServiceImpl implements INmNoteService
{
return nmNoteMapper.deleteNmNoteById(noteId);
}
/**
* 用户根据ID查询便签
*
* @param noteId 便签管理ID
* @return 便签管理
*/
@Override
public NmNote selectNmNoteuserById(Long noteId,Long userID) {
NmNote nmNote = new NmNote();
nmNote.setNoteId(noteId);
nmNote.setUserId(userID);
return nmNoteMapper.selectOne(nmNote);
}
}

View File

@ -563,9 +563,7 @@
.bookmarktag{
margin-right: 5px;
}
.bookmarklist{
/*height: 400px !important;*/
}
</style>