8 files modified
8 files added
| | |
| | | secureRegistry.excludePathPatterns("/zc/**"); |
| | | secureRegistry.excludePathPatterns("/energy/**"); |
| | | secureRegistry.excludePathPatterns("/jurisdiction/**"); |
| | | secureRegistry.excludePathPatterns("/likes/**"); |
| | | secureRegistry.excludePathPatterns("/comment/**"); |
| | | secureRegistry.excludePathPatterns("/collect/**"); |
| | | return secureRegistry; |
| | | } |
| | | |
| | |
| | | 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)); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 查询资讯分页信息(角色权限)附带点赞评论数 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查询已收藏的资讯 |
| | | */ |
| | | @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 |
| | |
| | | */ |
| | | List<Article> pageDate(IPage<Article> page, @Param("article") ArticleVo article); |
| | | |
| | | List<Article> pageCollectList(IPage<Article> page, @Param("article") ArticleVo article); |
| | | |
| | | /** |
| | | * 查询资讯分页信息(角色权限)附带评论点赞数量 |
| | | * @param page |
| | |
| | | */ |
| | | 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); |
| | | } |
| | |
| | | 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 |
| | |
| | | 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, |
| | |
| | | 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}) |
| | |
| | | */ |
| | | IPage<Article> pageDate(IPage<Article> page, ArticleVo article); |
| | | |
| | | IPage<Article> pageCollectList(IPage<Article> page, ArticleVo article); |
| | | |
| | | /** |
| | | * 查询资讯分页信息(角色权限)附带评论点赞数 |
| | | * @param page |
| | |
| | | */ |
| | | 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); |
| | | } |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | private String islikes; |
| | | |
| | | /** |
| | | * 收藏总数 |
| | | */ |
| | | private String collectcount; |
| | | |
| | | /** |
| | | * 是否收藏 |
| | | */ |
| | | private String iscollect; |
| | | |
| | | /** |
| | | * 评论总数 |
| | | */ |
| | | private String comments; |
| New file |
| | |
| | | /* |
| | | * 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); |
| | | } |
| | | |
| | | } |
| | | |
| New file |
| | |
| | | /* |
| | | * 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; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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); |
| | | |
| | | } |
| New file |
| | |
| | | <?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> |
| New file |
| | |
| | | /* |
| | | * 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); |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | 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 { |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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; |
| | | } |
| | | |
| | | } |
| | |
| | | @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)); |
| | | } |
| | | |