标签管理
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package com.ruoyi.bookmark.mapper;
|
||||
|
||||
import com.ruoyi.bookmark.domain.SqBookmark;
|
||||
import com.ruoyi.bookmark.pojo.SqBookmarkReq;
|
||||
import com.ruoyi.common.mybatisMapper.MyMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -120,4 +121,6 @@ public interface SqBookmarkMapper extends MyMapper<SqBookmark>
|
||||
*
|
||||
*/
|
||||
List<SqBookmark> listByUserAndPolymerization(SqBookmark sqBookmark);
|
||||
|
||||
List<SqBookmark> getlistByTag(SqBookmarkReq sqBookmarkReq);
|
||||
}
|
||||
|
@ -0,0 +1,92 @@
|
||||
package com.ruoyi.bookmark.pojo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 书签管理对象 sq_bookmark 不存在的字段注解 @Transient
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class SqBookmarkReq
|
||||
{
|
||||
private Long bookmarkId;
|
||||
|
||||
private Long userid;
|
||||
|
||||
/** 书签标题 */
|
||||
private String title;
|
||||
|
||||
/** 书签地址 */
|
||||
private String url;
|
||||
|
||||
/** 官网地址 */
|
||||
private String urls;
|
||||
|
||||
/** 书签描述 */
|
||||
private String description;
|
||||
|
||||
/** 图片 */
|
||||
private String image;
|
||||
|
||||
/** 标签 */
|
||||
private String label;
|
||||
|
||||
/** 分类ID */
|
||||
private Long menuId;
|
||||
|
||||
/** 点赞数 */
|
||||
private Long zcount;
|
||||
|
||||
/** 0 未删除 1表示删除 */
|
||||
private Integer idelete;
|
||||
|
||||
/** 0公开显示 1隐藏显示 2好友显示 3稍后再看 */
|
||||
private Integer start;
|
||||
|
||||
/** 0非星标 1星标 */
|
||||
private Integer bookmarkStar;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/**tag名称串**/
|
||||
private String tagNameAll;
|
||||
|
||||
/**是否稍后读 0不是 1是**/
|
||||
private Integer seeYouLater;
|
||||
|
||||
private Long parentId;
|
||||
|
||||
/** 书签的类型 星标 稍后看 最新书签 **/
|
||||
private String type;
|
||||
|
||||
/** 排序的方式 **/
|
||||
private String sort;
|
||||
|
||||
/** 搜索 **/
|
||||
private String sousuo;
|
||||
|
||||
/** 标签ID **/
|
||||
private Long tagId;
|
||||
|
||||
|
||||
|
||||
private List<Map<String,Object>> sqTags;
|
||||
public SqBookmarkReq(){
|
||||
}
|
||||
|
||||
public SqBookmarkReq(String url, Long userid){
|
||||
this.url = url;
|
||||
this.userid = userid;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package com.ruoyi.bookmark.pojo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 书签_标签对象 sq_tag
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-05
|
||||
*/
|
||||
@Data
|
||||
public class SqTagReq
|
||||
{
|
||||
/** 书签标签id */
|
||||
private Long id;
|
||||
|
||||
/** 标签名字 */
|
||||
private String name;
|
||||
|
||||
/** 链接 */
|
||||
private String url;
|
||||
|
||||
/** 状态 0显示默认*/
|
||||
private Integer status;
|
||||
|
||||
|
||||
/** 标签的字体颜色 */
|
||||
private String isFontColor;
|
||||
|
||||
/** 标签的背景颜色 */
|
||||
private String isBgColor;
|
||||
|
||||
|
||||
|
||||
}
|
@ -2,6 +2,7 @@ package com.ruoyi.bookmark.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bookmark.domain.SqBookmark;
|
||||
import com.ruoyi.bookmark.pojo.SqBookmarkReq;
|
||||
import com.ruoyi.common.utils.bookmarkhtml.HtmlName;
|
||||
|
||||
/**
|
||||
@ -170,4 +171,12 @@ public interface ISqBookmarkService
|
||||
*
|
||||
*/
|
||||
List<SqBookmark> listByUserAndPolymerization(SqBookmark sqBookmark);
|
||||
|
||||
|
||||
/**
|
||||
* 用户根据标签ID 查询对应的书签 分页
|
||||
* @param
|
||||
*
|
||||
*/
|
||||
List<SqBookmark> getlistByTag(SqBookmarkReq sqBookmarkReq);
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ import com.ruoyi.bookmark.mapper.SqBookmarkTagMapper;
|
||||
import com.ruoyi.bookmark.mapper.SqMenuMapper;
|
||||
import com.ruoyi.bookmark.mapper.SqTagMapper;
|
||||
|
||||
import com.ruoyi.bookmark.pojo.SqBookmarkReq;
|
||||
import com.ruoyi.bookmark.service.ISqTagService;
|
||||
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
@ -135,7 +136,7 @@ public class SqBookmarkServiceImpl implements ISqBookmarkService
|
||||
} catch (MalformedURLException e) {
|
||||
logger.info("用户ID:"+sqBookmark.getUserid()+",新增书签"+sqBookmark.getUrl()+"获取网址的 主机信息 报错 -"+new Date());
|
||||
}
|
||||
if(null==sqBookmark.getDescription()||"".equals(sqBookmark.getDescription())){
|
||||
if(StringUtils.isEmpty(sqBookmark.getDescription())){
|
||||
sqBookmark.setDescription(sqBookmark.getTitle());
|
||||
}
|
||||
//转换传入的父级ID
|
||||
@ -537,5 +538,11 @@ public class SqBookmarkServiceImpl implements ISqBookmarkService
|
||||
return sqBookmarkMapper.listByUserAndPolymerization(search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SqBookmark> getlistByTag(SqBookmarkReq sqBookmarkReq) {
|
||||
|
||||
return sqBookmarkMapper.getlistByTag(sqBookmarkReq);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -210,4 +210,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</choose>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getlistByTag" parameterType="com.ruoyi.bookmark.pojo.SqBookmarkReq" resultMap="SqBookmarkResult">
|
||||
SELECT sb.* FROM sq_bookmark_tag as sbt LEFT JOIN sq_bookmark as sb ON sbt.bookmark_id = sb.bookmark_id
|
||||
WHERE sbt.tag_id = #{tagId} AND sb.userid = #{userid} AND sb.idelete = 0
|
||||
ORDER BY
|
||||
<choose>
|
||||
<when test="sort == 0">
|
||||
sb.create_time desc
|
||||
</when>
|
||||
<when test="sort == 1">
|
||||
sb.create_time asc
|
||||
</when>
|
||||
<when test="sort == 2">
|
||||
sb.CONVERT(sb.title USING GBK) asc
|
||||
</when>
|
||||
<when test="sort == 3">
|
||||
sb.CONVERT(sb.title USING GBK) desc
|
||||
</when>
|
||||
<otherwise>
|
||||
sb.create_time desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -24,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectSqTagList" parameterType="SqTag" resultMap="SqTagResult">
|
||||
<include refid="selectSqTagVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name = #{name}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="icount != null "> and icount = #{icount}</if>
|
||||
<if test="userId != null "> and user_Id = #{userId}</if>
|
||||
<if test="isFontColor != null and isFontColor != ''"> and is_font_color = #{isFontColor}</if>
|
||||
|
Reference in New Issue
Block a user