From aa218d70e29e77cfbea2a65d66f119d45e634c66 Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Fri, 29 Oct 2021 09:32:38 +0800
Subject: [PATCH] 点赞评论相关提交

---
 src/main/java/org/springblade/modules/collect/service/impl/CollectServiceImpl.java |   45 ++++
 src/main/java/org/springblade/modules/collect/vo/CollectVO.java                    |   16 +
 src/main/java/org/springblade/modules/collect/controller/CollectController.java    |  154 +++++++++++++++
 src/main/java/org/springblade/modules/collect/service/CollectService.java          |   41 ++++
 src/main/java/org/springblade/modules/collect/mapper/CollectMapper.java            |   44 ++++
 src/main/java/org/springblade/modules/collect/mapper/CollectMapper.xml             |   18 +
 src/main/java/org/springblade/modules/article/mapper/ArticleMapper.xml             |  104 ++++++++++
 src/main/java/org/springblade/modules/article/controller/ArticleController.java    |   20 ++
 src/main/java/org/springblade/modules/article/mapper/ArticleMapper.java            |    4 
 src/main/java/org/springblade/modules/article/service/impl/ArticleServiceImpl.java |   11 +
 src/main/java/org/springblade/common/config/BladeConfiguration.java                |    3 
 src/main/java/org/springblade/modules/article/vo/ArticleVo.java                    |   10 +
 src/main/java/org/springblade/modules/collect/entity/Collect.java                  |   61 ++++++
 src/main/java/org/springblade/modules/collect/wrapper/CollectWrapper.java          |   45 ++++
 src/main/java/org/springblade/modules/system/controller/UserController.java        |   12 
 src/main/java/org/springblade/modules/article/service/ArticleService.java          |   10 +
 16 files changed, 592 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/springblade/common/config/BladeConfiguration.java b/src/main/java/org/springblade/common/config/BladeConfiguration.java
index dd84d9d..610bb6b 100644
--- a/src/main/java/org/springblade/common/config/BladeConfiguration.java
+++ b/src/main/java/org/springblade/common/config/BladeConfiguration.java
@@ -97,6 +97,9 @@
 		secureRegistry.excludePathPatterns("/zc/**");
 		secureRegistry.excludePathPatterns("/energy/**");
 		secureRegistry.excludePathPatterns("/jurisdiction/**");
+		secureRegistry.excludePathPatterns("/likes/**");
+		secureRegistry.excludePathPatterns("/comment/**");
+		secureRegistry.excludePathPatterns("/collect/**");
 		return secureRegistry;
 	}
 
diff --git a/src/main/java/org/springblade/modules/article/controller/ArticleController.java b/src/main/java/org/springblade/modules/article/controller/ArticleController.java
index 40077e3..71a8ba2 100644
--- a/src/main/java/org/springblade/modules/article/controller/ArticleController.java
+++ b/src/main/java/org/springblade/modules/article/controller/ArticleController.java
@@ -64,6 +64,14 @@
 		return R.data(articleService.pageDate(Condition.getPage(query),article));
 	}
 
+	@GetMapping("/pageCollectList")
+	public R<IPage<Article>> pageCollectList(HttpServletResponse response, ArticleVo article, Query query){
+		response.setHeader("Access-Control-Allow-Origin", "*");
+		response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
+		response.setHeader("Access-Control-Allow-Credentials","true");
+		return R.data(articleService.pageCollectList(Condition.getPage(query),article));
+	}
+
 	/**
 	 *
 	 * 查询资讯分页信息(角色权限)附带点赞评论数
@@ -81,6 +89,18 @@
 	}
 
 	/**
+	 * 查询已收藏的资讯
+	 */
+	@GetMapping("/pageCollect")
+	public R<IPage<Article>> pageCollect(HttpServletResponse response, ArticleVo article, Query query){
+		response.setHeader("Access-Control-Allow-Origin", "*");
+		response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
+		response.setHeader("Access-Control-Allow-Credentials","true");
+		return R.data(articleService.pageCollect(Condition.getPage(query),article));
+	}
+
+
+	/**
 	 * 资讯详情
 	 * @param article 资讯查询对象
 	 * @param response
diff --git a/src/main/java/org/springblade/modules/article/mapper/ArticleMapper.java b/src/main/java/org/springblade/modules/article/mapper/ArticleMapper.java
index 13b9eb2..727c54e 100644
--- a/src/main/java/org/springblade/modules/article/mapper/ArticleMapper.java
+++ b/src/main/java/org/springblade/modules/article/mapper/ArticleMapper.java
@@ -30,6 +30,8 @@
 	 */
 	List<Article> pageDate(IPage<Article> page, @Param("article") ArticleVo article);
 
+	List<Article> pageCollectList(IPage<Article> page, @Param("article") ArticleVo article);
+
 	/**
 	 * 查询资讯分页信息(角色权限)附带评论点赞数量
 	 * @param page
@@ -38,5 +40,7 @@
 	 */
 	List<Article> pageLikes(IPage<Article> page, @Param("article") ArticleVo article);
 
+	List<Article> pageCollect(IPage<Article> page, @Param("article") ArticleVo article);
+
 	Boolean upcomment(String ids,String type);
 }
diff --git a/src/main/java/org/springblade/modules/article/mapper/ArticleMapper.xml b/src/main/java/org/springblade/modules/article/mapper/ArticleMapper.xml
index 7214381..edcd5f8 100644
--- a/src/main/java/org/springblade/modules/article/mapper/ArticleMapper.xml
+++ b/src/main/java/org/springblade/modules/article/mapper/ArticleMapper.xml
@@ -45,6 +45,28 @@
         order by create_time desc
     </select>
 
+    <!--查询收藏资讯分页列表信息-->
+    <select id="pageCollectList" resultType="org.springblade.modules.article.entity.Article">
+        SELECT
+        art.*
+        FROM
+        sys_collect col
+        LEFT JOIN sys_article art on art.id = col.collect_article
+        WHERE
+        1 = 1 AND collect_user =  #{article.userid}
+        <if test="article.articleType!=null and article.articleType!=''">
+            and article_type LIKE CONCAT ('%', #{article.articleType},'%')
+        </if>
+        <if test="article.keyword!=null and article.keyword!=''">
+            AND CONCAT(title,source_name)
+            LIKE CONCAT ('%', #{article.keyword},'%')
+        </if>
+        <if test="(article.rolename==null and article.rolename=='') or (article.rolename!='administrator' and article.rolename!='policeAdmin')">
+            AND publish = 1
+        </if>
+        order by create_time desc
+    </select>
+
     <!--查询资讯分页列表信息-->
     <select id="pageLikes" resultType="org.springblade.modules.article.vo.ArticleVo">
         SELECT
@@ -67,6 +89,24 @@
         likes_article,
         b.islikes
         ) likes ON art.id = likes.likes_article
+
+        LEFT JOIN (
+        SELECT
+        a.collect_article,
+        COUNT( * ) AS collectcount,
+        b.iscollect
+        FROM
+        sys_collect a
+        LEFT JOIN ( SELECT collect_article, COUNT( * ) AS iscollect FROM sys_collect WHERE 1 = 1
+        <if test="article.userid!=null and article.userid!=''">
+            and collect_user = #{article.userid}
+        </if>
+        GROUP BY collect_article ) b ON a.collect_article = b.collect_article
+        GROUP BY
+        collect_article,
+        b.iscollect
+        ) collect ON art.id = collect.collect_article
+
         LEFT JOIN (
         SELECT
         article,
@@ -90,6 +130,70 @@
         order by create_time desc
     </select>
 
+    <!--查询资讯分页列表信息-->
+    <select id="pageCollect" resultType="org.springblade.modules.article.vo.ArticleVo">
+        SELECT
+        *
+        FROM
+        sys_article art
+        LEFT JOIN (
+        SELECT
+        a.likes_article,
+        COUNT( * ) AS count,
+        b.islikes
+        FROM
+        sys_likes a
+        LEFT JOIN ( SELECT likes_article, COUNT( * ) AS islikes FROM sys_likes WHERE 1 = 1
+        <if test="article.userid!=null and article.userid!=''">
+            and likes_user = #{article.userid}
+        </if>
+        GROUP BY likes_article ) b ON a.likes_article = b.likes_article
+        GROUP BY
+        likes_article,
+        b.islikes
+        ) likes ON art.id = likes.likes_article
+
+        LEFT JOIN (
+        SELECT
+        a.collect_article,
+        COUNT( * ) AS collectcount,
+        b.iscollect
+        FROM
+        sys_collect a
+        LEFT JOIN ( SELECT collect_article, COUNT( * ) AS iscollect FROM sys_collect WHERE 1 = 1
+        <if test="article.userid!=null and article.userid!=''">
+            and collect_user = #{article.userid}
+        </if>
+        GROUP BY collect_article ) b ON a.collect_article = b.collect_article
+        GROUP BY
+        collect_article,
+        b.iscollect
+        ) collect ON art.id = collect.collect_article
+
+        LEFT JOIN (
+        SELECT
+        article,
+        COUNT(*) as comments
+        FROM
+        sys_comment
+        GROUP BY article
+        ) com on com.article = art.id
+        WHERE
+        1 = 1
+        AND iscollect = 1
+        <if test="article.articleType!=null and article.articleType!=''">
+            and article_type LIKE CONCAT ('%', #{article.articleType},'%')
+        </if>
+        <if test="article.keyword!=null and article.keyword!=''">
+            AND CONCAT(title,source_name)
+            LIKE CONCAT ('%', #{article.keyword},'%')
+        </if>
+        <if test="(article.rolename==null and article.rolename=='') or (article.rolename!='administrator' and article.rolename!='policeAdmin')">
+            AND publish = 1
+        </if>
+        order by create_time desc
+    </select>
+
     <update id="upcomment">
         update sys_article set iscomment = #{type}
         where id in(${ids})
diff --git a/src/main/java/org/springblade/modules/article/service/ArticleService.java b/src/main/java/org/springblade/modules/article/service/ArticleService.java
index fcba994..55bce36 100644
--- a/src/main/java/org/springblade/modules/article/service/ArticleService.java
+++ b/src/main/java/org/springblade/modules/article/service/ArticleService.java
@@ -27,6 +27,8 @@
 	 */
 	IPage<Article> pageDate(IPage<Article> page, ArticleVo article);
 
+	IPage<Article> pageCollectList(IPage<Article> page, ArticleVo article);
+
 	/**
 	 * 查询资讯分页信息(角色权限)附带评论点赞数
 	 * @param page
@@ -35,5 +37,13 @@
 	 */
 	IPage<Article> pageLikes(IPage<Article> page, ArticleVo article);
 
+	/**
+	 * 查看已收藏的资讯
+	 * @param page
+	 * @param article 资讯对象
+	 * @return
+	 */
+	IPage<Article> pageCollect(IPage<Article> page, ArticleVo article);
+
 	Boolean upcomment(String ids,String type);
 }
diff --git a/src/main/java/org/springblade/modules/article/service/impl/ArticleServiceImpl.java b/src/main/java/org/springblade/modules/article/service/impl/ArticleServiceImpl.java
index b4b78ca..376f07f 100644
--- a/src/main/java/org/springblade/modules/article/service/impl/ArticleServiceImpl.java
+++ b/src/main/java/org/springblade/modules/article/service/impl/ArticleServiceImpl.java
@@ -38,6 +38,12 @@
 	public IPage<Article> pageDate(IPage<Article> page, ArticleVo article) {
 		return page.setRecords(baseMapper.pageDate(page,article));
 	}
+
+	@Override
+	public IPage<Article> pageCollectList(IPage<Article> page, ArticleVo article) {
+		return page.setRecords(baseMapper.pageCollectList(page,article));
+	}
+
 	/**
 	 * 查询资讯分页信息(角色权限)附带评论点赞数
 	 * @param page
@@ -49,6 +55,11 @@
 		return page.setRecords(baseMapper.pageLikes(page,article));
 	}
 
+	@Override
+	public IPage<Article> pageCollect(IPage<Article> page, ArticleVo article) {
+		return page.setRecords(baseMapper.pageCollect(page,article));
+	}
+
 	/**
 	 * 批量更新
 	 * @return
diff --git a/src/main/java/org/springblade/modules/article/vo/ArticleVo.java b/src/main/java/org/springblade/modules/article/vo/ArticleVo.java
index 834719e..e4483f7 100644
--- a/src/main/java/org/springblade/modules/article/vo/ArticleVo.java
+++ b/src/main/java/org/springblade/modules/article/vo/ArticleVo.java
@@ -44,6 +44,16 @@
 	private String islikes;
 
 	/**
+	 * 收藏总数
+	 */
+	private String collectcount;
+
+	/**
+	 * 是否收藏
+	 */
+	private String iscollect;
+
+	/**
 	 * 评论总数
 	 */
 	private String comments;
diff --git a/src/main/java/org/springblade/modules/collect/controller/CollectController.java b/src/main/java/org/springblade/modules/collect/controller/CollectController.java
new file mode 100644
index 0000000..c543601
--- /dev/null
+++ b/src/main/java/org/springblade/modules/collect/controller/CollectController.java
@@ -0,0 +1,154 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright collect,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  collect, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.collect.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.github.xiaoymin.knife4j.annotations.ApiSort;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tenant.annotation.TenantDS;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.collect.entity.Collect;
+import org.springblade.modules.collect.service.CollectService;
+import org.springblade.modules.collect.vo.CollectVO;
+import org.springblade.modules.collect.wrapper.CollectWrapper;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.Date;
+import java.util.Map;
+
+/**
+ * 控制器
+ *
+ * @author Chill
+ */
+@TenantDS
+@RestController
+@RequestMapping("collect/collect")
+@AllArgsConstructor
+@ApiSort(2)
+public class CollectController extends BladeController {
+
+	private final CollectService collectService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入collect")
+	public R<CollectVO> detail(Collect collect) {
+		Collect detail = collectService.getOne(Condition.getQueryWrapper(collect));
+		return R.data(CollectWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/list")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "category", value = "公告类型", paramType = "query", dataType = "integer"),
+		@ApiImplicitParam(name = "title", value = "公告标题", paramType = "query", dataType = "string")
+	})
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入collect")
+	public R<IPage<CollectVO>> list(@ApiIgnore @RequestParam Map<String, Object> collect, Query query) {
+		IPage<Collect> pages = collectService.page(Condition.getPage(query), Condition.getQueryWrapper(collect, Collect.class));
+		return R.data(CollectWrapper.build().pageVO(pages));
+	}
+
+	/**
+	 * 多表联合查询自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "category", value = "公告类型", paramType = "query", dataType = "integer"),
+		@ApiImplicitParam(name = "title", value = "公告标题", paramType = "query", dataType = "string")
+	})
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入collect")
+	public R<IPage<CollectVO>> page(@ApiIgnore CollectVO collect, Query query) {
+		IPage<CollectVO> pages = collectService.selectCollectPage(Condition.getPage(query), collect);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入collect")
+	public R save(@RequestBody Collect collect) {
+		return R.status(collectService.save(collect));
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入collect")
+	public R update(@RequestBody Collect collect) {
+		return R.status(collectService.updateById(collect));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入collect")
+	public R submit(@RequestBody Collect collect) {
+		if (null==collect.getTime()){
+			collect.setTime(new Date());
+		}
+		return R.status(collectService.saveOrUpdate(collect));
+	}
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入collect")
+	public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
+		boolean temp = collectService.removeByIds(Func.toLongList(ids));
+		return R.status(temp);
+	}
+
+	/**
+	 * 删除指定点赞记录
+	 */
+	@PostMapping("/removecollect")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入collect")
+	public R removecollect(@ApiParam(value = "主键集合") @RequestBody Collect collect) {
+		boolean temp = collectService.removecollect(collect);
+		return R.status(temp);
+	}
+
+}
+
diff --git a/src/main/java/org/springblade/modules/collect/entity/Collect.java b/src/main/java/org/springblade/modules/collect/entity/Collect.java
new file mode 100644
index 0000000..f81d604
--- /dev/null
+++ b/src/main/java/org/springblade/modules/collect/entity/Collect.java
@@ -0,0 +1,61 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.collect.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 实体类
+ *
+ * @author Chill
+ */
+@Data
+@TableName("sys_collect")
+public class Collect implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	@TableId(value = "id", type = IdType.AUTO)
+	private Integer id;
+
+	/**
+	 * 点赞文章id
+	 */
+	@ApiModelProperty(value = "点赞文章id")
+	private String collectArticle;
+	/**
+	 * 点赞文章id
+	 */
+	@ApiModelProperty(value = "点赞人id")
+	private String collectUser;
+	/**
+	 * 点赞文章id
+	 */
+	@ApiModelProperty(value = "点赞时间")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+	private Date time;
+
+
+}
diff --git a/src/main/java/org/springblade/modules/collect/mapper/CollectMapper.java b/src/main/java/org/springblade/modules/collect/mapper/CollectMapper.java
new file mode 100644
index 0000000..a1786fb
--- /dev/null
+++ b/src/main/java/org/springblade/modules/collect/mapper/CollectMapper.java
@@ -0,0 +1,44 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright collect,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  collect, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.collect.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.collect.entity.Collect;
+import org.springblade.modules.collect.vo.CollectVO;
+
+import java.util.List;
+
+/**
+ * Mapper 接口
+ *
+ * @author Chill
+ */
+public interface CollectMapper extends BaseMapper<Collect> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page   分页
+	 * @param collect 实体
+	 * @return List<CollectVO>
+	 */
+	List<CollectVO> selectCollectPage(IPage page, CollectVO collect);
+
+	Boolean removecollect(Collect collect);
+
+}
diff --git a/src/main/java/org/springblade/modules/collect/mapper/CollectMapper.xml b/src/main/java/org/springblade/modules/collect/mapper/CollectMapper.xml
new file mode 100644
index 0000000..67f2b0b
--- /dev/null
+++ b/src/main/java/org/springblade/modules/collect/mapper/CollectMapper.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.collect.mapper.CollectMapper">
+
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="collectVOResultMap" type="org.springblade.modules.collect.vo.CollectVO">
+
+    </resultMap>
+
+    <select id="selectCollectPage" resultMap="collectVOResultMap">
+        select * from sys_collect
+    </select>
+
+    <delete id="removecollect">
+        delete from sys_collect where collect_article=#{collectArticle} AND collect_user =#{collectUser}
+    </delete>
+</mapper>
diff --git a/src/main/java/org/springblade/modules/collect/service/CollectService.java b/src/main/java/org/springblade/modules/collect/service/CollectService.java
new file mode 100644
index 0000000..7289049
--- /dev/null
+++ b/src/main/java/org/springblade/modules/collect/service/CollectService.java
@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright collect,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  collect, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.collect.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.modules.collect.entity.Collect;
+import org.springblade.modules.collect.vo.CollectVO;
+
+/**
+ * 服务类
+ *
+ * @author Chill
+ */
+public interface CollectService extends IService<Collect> {
+
+	/**
+	 * 自定义分页
+	 * @param page
+	 * @param collect
+	 * @return
+	 */
+	IPage<CollectVO> selectCollectPage(IPage<CollectVO> page, CollectVO collect);
+
+	Boolean removecollect(Collect collect);
+
+}
diff --git a/src/main/java/org/springblade/modules/collect/service/impl/CollectServiceImpl.java b/src/main/java/org/springblade/modules/collect/service/impl/CollectServiceImpl.java
new file mode 100644
index 0000000..7e66994
--- /dev/null
+++ b/src/main/java/org/springblade/modules/collect/service/impl/CollectServiceImpl.java
@@ -0,0 +1,45 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright collect,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  collect, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.collect.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.modules.collect.entity.Collect;
+import org.springblade.modules.collect.mapper.CollectMapper;
+import org.springblade.modules.collect.service.CollectService;
+import org.springblade.modules.collect.vo.CollectVO;
+import org.springframework.stereotype.Service;
+
+/**
+ * 服务实现类
+ *
+ * @author Chill
+ */
+@Service
+public class CollectServiceImpl extends ServiceImpl<CollectMapper, Collect> implements CollectService {
+
+	@Override
+	public IPage<CollectVO> selectCollectPage(IPage<CollectVO> page, CollectVO collect) {
+		return page.setRecords(baseMapper.selectCollectPage(page, collect));
+	}
+
+	@Override
+	public Boolean removecollect(Collect collect) {
+		return baseMapper.removecollect(collect);
+	}
+
+}
diff --git a/src/main/java/org/springblade/modules/collect/vo/CollectVO.java b/src/main/java/org/springblade/modules/collect/vo/CollectVO.java
new file mode 100644
index 0000000..6c3164e
--- /dev/null
+++ b/src/main/java/org/springblade/modules/collect/vo/CollectVO.java
@@ -0,0 +1,16 @@
+package org.springblade.modules.collect.vo;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.collect.entity.Collect;
+
+/**
+ * 通知公告视图类
+ *
+ * @author Chill
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class CollectVO extends Collect {
+
+}
diff --git a/src/main/java/org/springblade/modules/collect/wrapper/CollectWrapper.java b/src/main/java/org/springblade/modules/collect/wrapper/CollectWrapper.java
new file mode 100644
index 0000000..2a7b0d2
--- /dev/null
+++ b/src/main/java/org/springblade/modules/collect/wrapper/CollectWrapper.java
@@ -0,0 +1,45 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright collect,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  collect, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.collect.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.modules.collect.entity.Collect;
+import org.springblade.modules.collect.vo.CollectVO;
+
+import java.util.Objects;
+
+/**
+ * Collect包装类,返回视图层所需的字段
+ *
+ * @author Chill
+ */
+public class CollectWrapper extends BaseEntityWrapper<Collect, CollectVO> {
+
+	public static CollectWrapper build() {
+		return new CollectWrapper();
+	}
+
+	@Override
+	public CollectVO entityVO(Collect collect) {
+		CollectVO collectVO = Objects.requireNonNull(BeanUtil.copy(collect, CollectVO.class));
+//		String dictValue = DictCache.getValue(DictEnum.NOTICE, collectVO.getCategory());
+//		collectVO.setCategoryName(dictValue);
+		return collectVO;
+	}
+
+}
diff --git a/src/main/java/org/springblade/modules/system/controller/UserController.java b/src/main/java/org/springblade/modules/system/controller/UserController.java
index f53a9fe..12aa775 100644
--- a/src/main/java/org/springblade/modules/system/controller/UserController.java
+++ b/src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -294,12 +294,12 @@
 	@ApiOperation(value = "修改基本信息", notes = "传入User")
 	public R updateInfo(@Valid @RequestBody User user) {
 		CacheUtil.clear(USER_CACHE);
-		if (null!= user.getAvatar() && user.getAvatar()!="") {
-			String avatar = user.getAvatar();
-			String substring = avatar.substring(25, avatar.length());
-			String url = "https://web.byisf.com/minio" + substring;
-			user.setAvatar(url);
-		}
+//		if (null!= user.getAvatar() && user.getAvatar()!="") {
+//			String avatar = user.getAvatar();
+//			String substring = avatar.substring(25, avatar.length());
+//			String url = "https://web.byisf.com/minio" + substring;
+//			user.setAvatar(url);
+//		}
 		return R.status(userService.updateUserInfo(user));
 	}
 

--
Gitblit v1.9.3