书签查看
This commit is contained in:
parent
f5cd3fd44e
commit
6db93e0123
@ -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));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增便签管理
|
||||
*/
|
||||
|
@ -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;
|
||||
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.ruoyi.note.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.mybatisMapper.MyMapper;
|
||||
import com.ruoyi.note.domain.NmNote;
|
||||
|
||||
/**
|
||||
@ -9,7 +11,7 @@ import com.ruoyi.note.domain.NmNote;
|
||||
* @author wang
|
||||
* @date 2020-09-12
|
||||
*/
|
||||
public interface NmNoteMapper
|
||||
public interface NmNoteMapper extends MyMapper<NmNote>
|
||||
{
|
||||
/**
|
||||
* 查询便签管理
|
||||
|
@ -58,4 +58,12 @@ public interface INmNoteService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNmNoteById(Long noteId);
|
||||
|
||||
/**
|
||||
* 用户根据ID查询便签
|
||||
*
|
||||
* @param noteId 便签管理ID
|
||||
* @return 便签管理
|
||||
*/
|
||||
public NmNote selectNmNoteuserById(Long noteId,Long userID);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -563,9 +563,7 @@
|
||||
.bookmarktag{
|
||||
margin-right: 5px;
|
||||
}
|
||||
.bookmarklist{
|
||||
/*height: 400px !important;*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
|
Loading…
x
Reference in New Issue
Block a user