Commit 653f3196 by liangkaiping

copy

parent 2d2954d1
# comment-project
评论
\ No newline at end of file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.yizhi</groupId>
<artifactId>comment</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>com.yizhi</groupId>
<version>1.0-SNAPSHOT</version>
<artifactId>cloud-comment-api</artifactId>
<dependencies>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-common-api</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-core</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!--<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-system-api</artifactId>
<scope>provided</scope>
</dependency>-->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package com.yizhi.comment.application.constans;
public interface Constant {
public final Integer STATE_DELETED = 0;
public final Integer NOT_DELETED = 0;
public final Integer DELETED = 1;
public final Integer UP = 1;
public final Integer DOWN = 2;
/**
* 对于举报,业务类型是帖子
*/
public final Integer TASK_TYPE_POSTS = 2;
/**
* 对于举报,业务类型是评论回复
*/
public final Integer TASK_TYPE_COMMENT_REPLY = 1;
/**
* 类型是评论
*/
public final Integer TYPE_COMMENT = 1;
/**
* 类型是回复
*/
public final Integer TYPE_REPLY = 2;
/**
* 类型是举报
*/
public final Integer TYPE_INFORM = 3;
/**
* 排序类型是最新回复
*/
public final Integer ORDER_BY_NEW_REPLY = 1;
/**
* 排序类型是最早回复
*/
public final Integer ORDER_BY_OLD_REPLY = 2;
public final Integer ZERO = 0;
/**
* 该回复已被删除
*
*/
public static final String COMMENT_HAS_DELETED = "该回复已被删除";
}
package com.yizhi.comment.application.feign;
import com.yizhi.comment.application.vo.StatisticsForumAccountVo;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Map;
@FeignClient(name = "comment", contextId = "AdmireClient")
public interface AdmireClient {
@GetMapping("/remote/commentAdmire/up")
public boolean up(@ApiParam(name = "commentId",value = "评论或帖子id")@RequestParam(name = "commentId") Long commentId,@ApiParam(name = "bizType",value = "业务类型 1评论 2帖子") @RequestParam("bizType") Integer bizType);
@GetMapping("/remote/commentAdmire/down")
public boolean down(@ApiParam(name = "commentId",value = "评论或帖子id")@RequestParam(name = "commentId")Long commentId,@ApiParam(name = "bizType",value = "业务类型 1评论 2帖子") @RequestParam("bizType") Integer bizType);
@GetMapping("/remote/commentAdmire/getNum")
public Integer getNum(@RequestParam("bizType") Integer bizType,
@RequestParam(name = "taskId") Long taskId,
@RequestParam(name = "accountId",required = false) Long accountId);
/**
* 获取用户的相关数据Map
* @param bizType
* @return
*/
@GetMapping("/remote/commentAdmire/getPersonalDataMap")
public Map<Long, StatisticsForumAccountVo> getPersonalDataMap(@RequestParam("bizType") Integer bizType);
}
package com.yizhi.comment.application.feign;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.comment.application.vo.InformRecordVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
@FeignClient(name = "comment", contextId = "InformRecordClient")
public interface InformRecordClient {
@PostMapping("/remote/informRecord/save")
public Integer save(@RequestBody InformRecordVo informRecordVo);
@GetMapping("/remote/informRecord/getPage")
public Page<InformRecordVo> getPage(@RequestParam("taskType") Integer taskType,
@RequestParam("taskId") Long taskId,
@RequestParam("type") Integer type,
@RequestParam("terminalType") Integer terminalType,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize);
@GetMapping("/remote/informRecord/cancel")
public Integer cancel(@RequestParam("id") Long id);
@GetMapping("informRecord/cancelByCommentId")
public Integer cancelByCommentId(@RequestParam("taskType") Integer taskType,
@RequestParam("taskId") Long taskId,
@RequestParam("type") Integer type,
@RequestParam(value = "commentId",required = false) Long commentId);
// @GetMapping("/remote/informRecord/getPersonalDataMap")
// public Map<Long, Integer> getPersonalDataMap(@RequestParam("bizType") Integer bizType);
}
package com.yizhi.comment.application.feign;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.comment.application.vo.*;
import com.yizhi.comment.application.vo.domain.NewCommentVo;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@FeignClient(name = "comment", contextId = "ManageCommentClient")
public interface ManageCommentClient {
@PostMapping("/remote/manage/comment/delete")
public String delateComment(@RequestBody CommentDelVO vo);
@PostMapping("/remote/manage/comment/save")
public NewCommentVo saveComment(@RequestBody NewCommentVo comment);
@GetMapping("/remote/manage/comment/list")
public Page<CommentVo> list(@RequestParam(name = "bizId") Long bizId, @RequestParam("bizType") Integer bizType, @RequestParam(name = "pageNo") Integer pageNo,
@RequestParam(name = "pageSize") Integer pageSize);
/**
* 评论(回复)上架
*
* @param id
* @param type
* @return boolean
*/
@GetMapping("/remote/manage/comment/up")
public Boolean up(@RequestParam("id") Long id, @RequestParam("type") Integer type);
/**
* 评论(回复)下架
*
* @param id
* @param type
* @return
*/
@GetMapping("/remote/manage/comment/down")
public Boolean down(@RequestParam("id") Long id, @RequestParam("type") Integer type);
@GetMapping("/remote/manage/comment/list/export")
public Map<String, Object> export(
@ApiParam(name = "bizId", value = "业务id") @RequestParam(name = "bizId") Long bizId,
@ApiParam(name = "bizType", value = "业务类型") @RequestParam("bizType") Integer bizType,
@ApiParam(name = "bizName", value = "业务名称") @RequestParam(name = "bizName") String bizName);
/**
* 学员端 评论列表
*
* @param accountId
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/remote/manage/comment/api/list")
public Page<NewApiCommentVo> apiList(@RequestParam("bizId") Long bizId, @RequestParam("bizType") Integer bizType,
@RequestParam("accountId") Long accountId, @RequestParam("companyId") Long companyId, @RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize);
@GetMapping("/remote/manage/comment/getAllComments")
public List<NewCommentVo> getAllComments();
/**
* 管理端 评论(回复)下架或者是删除 若是评论则包含子级,否则不包含
*
* @param id
* @param type 1:评论、2-回复
* @param operationType 1-下架 2-删除
* @return
*/
@GetMapping("/remote/manage/comment/down/include/children")
public Integer downIncludeChildren(@RequestParam("id") Long id,
@RequestParam("type") Integer type,
@RequestParam("operationType") Integer operationType);
/**
*论坛 管理端--单个帖子--回复列表分页
* @param type
* @param postsId
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/remote/manage/comment/getPageToManage")
public Page<ManageCommentVo> getPageToManage(@RequestParam("type") Integer type,
@RequestParam("postsId") Long postsId,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize);
/**
* 论坛--单个帖子的回复下载
* @return
*/
@GetMapping("/remote/manage/comment/forum/export")
public String exportFromForum(@RequestBody Map map);
@GetMapping("/remote/manage/comment/getPersonalDataMap")
public Map<Long, StatisticsForumAccountVo> getPersonalDataMap(@RequestParam("bizType") Integer bizType);
@GetMapping("/remote/manage/comment/getCommentNum")
public Integer getCommentNum(@RequestParam(name = "bizId") Long bizId,@RequestParam(name = "bizType") Integer bizType);
}
package com.yizhi.comment.application.feign;
import com.yizhi.comment.application.vo.domain.PdfPagesVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@FeignClient(name = "comment", contextId = "PdfPagesClient")
public interface PdfPagesClient {
@PostMapping("/remote/pdfPages/save")
public boolean save(@RequestBody List<PdfPagesVo> pdfPageVos);
@GetMapping("/remote/pdfPages/list")
public List<PdfPagesVo> list(@RequestParam("bizId")Long bizId, @RequestParam("bizType")Integer bizType);
}
package com.yizhi.comment.application.feign;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.comment.application.vo.domain.NewReplyVo;
import com.yizhi.comment.application.vo.CommentVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
@FeignClient(name = "comment", contextId = "ReplyClient")
public interface ReplyClient {
/**
* 新增回复评论接口(保存)
* @param
* @return
*/
@PostMapping("/remote/reply/save")
public Boolean saveReply(@RequestBody NewReplyVo reply);
@GetMapping("/remote/reply/list")
public Page<CommentVo> list(@RequestParam(name = "bizId") Long bizId, @RequestParam(name = "pageNo") Integer pageNo,
@RequestParam(name = "pageSize") Integer pageSize);
/**
* 用于学员移动端回复列表查询
*/
@GetMapping("/remote/reply/list2")
public Page<NewReplyVo> replyList2(@RequestParam("commentId") Long commentId, @RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize);
}
package com.yizhi.comment.application.feign;
import com.yizhi.comment.application.vo.domain.SubscribeVo;
import com.yizhi.core.application.context.RequestContext;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@FeignClient(name = "comment", contextId = "SubscribeClient")
public interface SubscribeClient {
@GetMapping("/remote/subscribe/get")
public SubscribeVo get(@RequestParam(name = "bizId") Long bizId, @RequestParam(name = "bizType") Integer bizType, @RequestParam("accountId") Long accountId, @RequestParam("siteId") Long siteId, @RequestParam("companyId") Long companyId);
@GetMapping("/remote/subscribe/save")
public SubscribeVo save(@RequestParam(name = "bizId") Long bizId, @RequestParam(name = "bizType") Integer bizType, @RequestParam("accountId") Long accountId, @RequestParam("siteId") Long siteId, @RequestParam("companyId") Long companyId);
@GetMapping("/remote/subscribe/getMyList")
public List<Long> getMyList(@RequestParam(name = "bizType") Integer bizType,@RequestParam("accountId") Long accountId,@RequestParam("siteId") Long siteId,@RequestParam("companyId") Long companyId);
@GetMapping("/remote/subscribe/getAllList")
public List<SubscribeVo> getAllList();
@GetMapping("/remote/subscribe/getSubscribeNum")
public Integer getSubscribeNum(@RequestParam(name = "bizId") Long bizId,@RequestParam(name = "bizType") Integer bizType);
@PostMapping("/remote/subscribe/getMySubscribeNum")
public Integer getMySubscribeNum(@RequestBody RequestContext context);
}
package com.yizhi.comment.application.feign.student;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.comment.application.vo.domain.NewCommentVo;
import com.yizhi.comment.application.vo.CommentParam;
import com.yizhi.comment.application.vo.NewApiCommentVo;
import com.yizhi.comment.application.vo.PostsCommentVo;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(name = "comment", contextId = "StudentCommentClient")
public interface StudentCommentClient {
@PostMapping("/remote/student/comment/getPage")
public Page<NewApiCommentVo> getPage(@RequestBody CommentParam param);
/**
* 论坛 我收到的回复分页
*
* @param param
* @return
*/
@PostMapping("/remote/student/comment/myReceivedPage")
public Page<PostsCommentVo> myReceivedPage(@RequestBody CommentParam param);
/**
* 论坛 我收到的回复分页--查看对话
*
* @param id
* @return
*/
@GetMapping("/remote/student/comment/catCommunication")
public List<PostsCommentVo> catCommunication(@RequestParam("id") Long id);
/**
* 论坛 我发送的回复分页
*
* @param param
* @return
*/
@PostMapping("/remote/student/comment/mySendPage")
public Page<PostsCommentVo> mySendPage(@RequestBody CommentParam param);
/**
* 我的管理--回复管理--回复列表
*
* @param type
* @param postsId
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/remote/student/comment/getPageByPostsId")
public Page<PostsCommentVo> getPageByPostsId(@ApiParam("type必传 ") @RequestParam("type") Integer type,
@ApiParam("帖子id ") @RequestParam("postsId") Long postsId,
@ApiParam("pageNo") @RequestParam("pageNo") Integer pageNo,
@ApiParam("pageSize ") @RequestParam("pageSize") Integer pageSize);
/**
* 论坛 评论(回复)--删除(下架) 包含子级回复
*
* @param id
* @param type
* @return
*/
@GetMapping("/remote/student/comment/down")
public Integer down(@RequestParam("id") Long id, @RequestParam("type") Integer type, @RequestParam("isInform") Boolean isInform);
/**
* 论坛的评论保存是可以保存评论附件的
* @param comment
* @return
*/
@PostMapping("/remote/student/comment/save")
public Integer studentSave(@RequestBody NewCommentVo comment);
/**
* 论坛我的回复--获取我的回复(收到的回复未查看的数量)
* @param taskType
* @param taskIds
* @return
*/
@GetMapping("/remote/student/comment/myNum")
public Integer myNum(@RequestParam("taskType") Integer taskType,
@RequestParam(value = "taskId",required = false) List<Long> taskIds);
/**
* 根据评论id 查询评论及其下的回复
* @param taskType
* @param taskId
* @param commentId
* @param orderType
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/remote/student/comment/getCommentDetails")
public NewApiCommentVo getCommentDetails(@ApiParam("taskType必传 ") @RequestParam("taskType") Integer taskType,
@ApiParam("业务id ") @RequestParam("taskId") Long taskId,
@ApiParam("评论id ") @RequestParam("commentId") Long commentId,
@ApiParam("作者id ") @RequestParam(value = "author",required = false) Long author,
@ApiParam("回复排序方式 ") @RequestParam("orderType") Integer orderType,
@ApiParam("回复的pageNo") @RequestParam("pageNo") Integer pageNo,
@ApiParam("回复的pageSize ") @RequestParam("pageSize") Integer pageSize);
}
package com.yizhi.comment.application.vo;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 评论点赞记录表
* </p>
*
*/
@Data
@ApiModel(value = "AdmireVO", description = "评论点赞记录表")
public class AdmireVO {
@ApiModelProperty(value = "点赞数")
private Integer admireNums = 0;
@ApiModelProperty(value = "是否已点赞")
private Boolean hasAdmire = false;
}
package com.yizhi.comment.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "评论删除参数")
public class CommentDelVO {
@ApiModelProperty(value = "评论回复Id 必传",required = true)
Long id;
@ApiModelProperty(value = "类型 必传 0评论 1回复",required = true)
Integer type;
}
package com.yizhi.comment.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "评论分页参数说明")
public class CommentParam {
@ApiModelProperty(value = "业务类型 0:课程、2:论坛、 7培训项目 15专辑", required = true)
Integer type;
@ApiModelProperty(value = "业务Id")
Long bizId;
@ApiModelProperty(value = "是否只看作者 默认否")
Boolean onlyAuthor = false;
@ApiModelProperty(value = "关键词")
String keyWord;
@ApiModelProperty(value = "作者Id")
Long author;
@ApiModelProperty(value = "排序类型:1-最新回复 2-最早回复")
Integer orderType;
@ApiModelProperty(value = "评论分页参数")
Integer pageNo = 1;
@ApiModelProperty(value = "评论分页参数")
Integer pageSize = 10;
@ApiModelProperty(value = "回复列表分页参数")
Integer replyPageNo = 1;
@ApiModelProperty(value = "回复列表分页参数")
Integer replyPageSize = Integer.MAX_VALUE;
}
package com.yizhi.comment.application.vo;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.yizhi.comment.application.vo.domain.NewReplyVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class CommentVo {
private Long id;
@ApiModelProperty(value = "账号id")
private Long accountId;
@ApiModelProperty(value = "评论人")
private String commentator;
@ApiModelProperty(value = "评论人姓名")
private String commentatorName;
@ApiModelProperty(value = "评论对象")
private String replyName;
@ApiModelProperty(value = "评论对象id")
private Long replyId;
@ApiModelProperty(value = "评论内容")
private String content;
@ApiModelProperty(value = "评论时间")
private Date createTime;
@ApiModelProperty(value = "点赞数")
private Integer thumbsUp;
@ApiModelProperty(value = "用户头像")
private String userAvatar;
@ApiModelProperty(value = "回复数")
private Integer replys;
@ApiModelProperty("状态(1:上架|2:下架 默认为1)")
private Integer state;
@ApiModelProperty(value = "回复列表")
private List<NewReplyVo> replies = new ArrayList<>();
}
package com.yizhi.comment.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel(value = "InformCommentVo", description = "举报中的回复")
public class InformCommentVo {
private Long id;
@ApiModelProperty(value = "1:评论 2-回复")
private Integer type;
@ApiModelProperty(value = "账号id")
private Long accountId;
@ApiModelProperty(value = "评论人")
private String commentator;
@ApiModelProperty(value = "评论内容")
private String content;
@ApiModelProperty(value = "评论时间")
private Date createTime;
@ApiModelProperty(value = "是否被禁言")
private Boolean hasForbidden;
@ApiModelProperty(value = "评论人的状态")
private String status;
@ApiModelProperty(value = "评论回复的状态 1:上架 2:下架")
private Integer commentStatus;
@ApiModelProperty(value = "用户头像")
private String userAvatar;
}
package com.yizhi.comment.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author taoge123
* @since 2020-01-16
*/
@Data
@ApiModel(value = "InformRecordVo", description = "")
public class InformRecordVo {
private Long id;
@ApiModelProperty(value = "业务类型:2-帖子 ")
private Integer taskType;
@ApiModelProperty(value = "业务id task_type=2时,为帖子id")
private Long taskId;
@ApiModelProperty(value = "业务名称")
private String taskName;
@ApiModelProperty(value = "1-评论 2-回复")
private Integer type;
@ApiModelProperty(value = "1:上架 2:下架")
private Integer status;
@ApiModelProperty(value = "评论回复id")
private Long commentId;
@ApiModelProperty(value = "举报描述(理由)")
private String description;
@ApiModelProperty(value = "举报附件")
private List<TaskAppendixVo> taskAppendixVos;
@ApiModelProperty(value = "举报的回复内容")
private InformCommentVo informCommentVo;
@ApiModelProperty(value = "举报人id")
private Long createById;
@ApiModelProperty(value = "举报人用户名")
private String createByName;
@ApiModelProperty(value = "举报时间")
private Date createTime;
@ApiModelProperty(value = "用户头像")
private String userAvatar;
}
package com.yizhi.comment.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel(value = "ManageCommentVo", description = "管理端评论回复")
public class ManageCommentVo {
@ApiModelProperty(value = "序号")
private Integer num;
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "1:评论、2-回复")
private Integer type;
@ApiModelProperty(value = "业务id")
private Long taskId;
@ApiModelProperty(value = "账号id")
private Long accountId;
@ApiModelProperty(value = "评论人")
private String commentator;
@ApiModelProperty(value = "评论人真实姓名")
private String fullName;
@ApiModelProperty(value = "评论人头像")
private String photo;
@ApiModelProperty(value = "评论内容")
private String content;
@ApiModelProperty(value = "评论时间")
private Date createTime;
@ApiModelProperty(value = "评论时间string格式")
private String createTimeString;
@ApiModelProperty(value = "被@的人用户id")
private Long beAnswerId;
@ApiModelProperty(value = "被@的人用户名")
private String beAnswerName;
@ApiModelProperty(value = "评论id")
private Long commentId;
@ApiModelProperty(value = "回复父级id 如果是回复评论,则为0")
private Long replyParentId;
@ApiModelProperty(value = "当前评论点赞数")
private Integer commentAdmires;
@ApiModelProperty(value = "当前回复状态 0:删除 1:上架 2:下架 ")
private Integer status;
@ApiModelProperty(value = "是否被禁言")
private Boolean hasForbidden = false;
@ApiModelProperty(value = "当前回复状态String")
private String statusString;
}
package com.yizhi.comment.application.vo;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.comment.application.vo.domain.NewReplyVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Data
public class NewApiCommentVo {
private Long id;
@ApiModelProperty(value = "账号id")
private Long accountId;
@ApiModelProperty(value = "评论人")
private String commentator;
@ApiModelProperty(value = "评论内容")
private String content;
@ApiModelProperty(value = "评论时间")
private Date createTime;
@ApiModelProperty(value = "评论时间String")
private String createTimeString;
@ApiModelProperty(value = "点赞数")
private Integer thumbsUp;
@ApiModelProperty(value = "是否点赞 1 是 0否")
private Integer status;
@ApiModelProperty(value = "是否是楼主 true:是")
private Boolean isAuthor = false;
@ApiModelProperty(value = "是否被禁言 true:是")
private Boolean hasForbidden = false;
@ApiModelProperty(value = "是否为当前用户创建的记录 true:是")
private Boolean isSelf = false;
@ApiModelProperty(value = "用户头像")
private String userAvatar;
@ApiModelProperty(value = "回复数")
private Integer replys;
@ApiModelProperty(value = "回复列表")
private List<NewReplyVo> replies = new ArrayList<>();
@ApiModelProperty(value = "回复分页列表")
private Page<NewReplyVo> replyPage = new Page<>();
@ApiModelProperty(value = "剩余回复数")
private Integer restReplys;
@ApiModelProperty(value = "评论附件")
private List<TaskAppendixVo> taskAppendixVos;
}
package com.yizhi.comment.application.vo;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotations.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class PdfVO implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "源文件url")
private String originalFileUrl;
@ApiModelProperty(value = "源文件名,带后缀")
private String originalFile;
private Long createById;
@TableField("company_id")
private Long companyId;
@TableField("site_id")
private Long siteId;
private Long bizId;
private Integer bizType;
}
package com.yizhi.comment.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
@ApiModel(value = "PostsCommentVo", description = "带帖子信息的评论回复")
public class PostsCommentVo {
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "1:评论、2-回复")
private Integer type;
@ApiModelProperty(value = "账号id")
private Long accountId;
@ApiModelProperty(value = "评论人")
private String commentator;
@ApiModelProperty(value = "评论人头像")
private String photo;
@ApiModelProperty(value = "评论内容")
private String content;
@ApiModelProperty(value = "评论时间")
private Date createTime;
@ApiModelProperty(value = "评论时间string格式")
private String createTimeString;
@ApiModelProperty(value = "帖子id")
private Long postsId;
@ApiModelProperty(value = "帖子标题")
private String postsTitle;
@ApiModelProperty(value = "帖子内容")
private String postsContent;
@ApiModelProperty(value = "帖子封面")
private String logo;
@ApiModelProperty(value = "帖子是否已被删除")
private Boolean postsHasDeleted = false;
@ApiModelProperty(value = "帖子创建时间")
private Date postsCreateTime;
@ApiModelProperty(value = "被@的人用户id")
private Long beAnswerId;
@ApiModelProperty(value = "被@的人用户名")
private String beAnswerName;
@ApiModelProperty(value = "被@的人说的话")
private String beAnswerContent;
@ApiModelProperty(value = "被@的人是否被禁言")
private Boolean beAnswerHasForbidden = false;
@ApiModelProperty(value = "评论id")
private Long commentId;
@ApiModelProperty(value = "回复父级id 如果是回复评论,则为0")
private Long replyParentId;
@ApiModelProperty(value = "创建该记录的用户在该贴是否被禁言")
private Boolean hasForbidden = false;
@ApiModelProperty(value = "是否为当前用户创建的记录 true:是")
private Boolean isSelf = false;
@ApiModelProperty(value = "是否是帖子作者")
private Boolean isAuthor = false;
@ApiModelProperty(value = "当前回复是否被删除 true:是 ")
private Boolean IsDeleted = false;
@ApiModelProperty(value = "最上层的回复是否被删除了 true:是 ")
private Boolean commentHasDeleted = false;
@ApiModelProperty(value = "被@的人说的话是否被删除啦 true:删除")
private Boolean beAnswerContentHasDelete = false;
@ApiModelProperty(value = "是否已点赞 true:已点赞")
private Boolean isAdmire = false;
@ApiModelProperty(value = "当前回复状态")
private Integer status;
@ApiModelProperty(value = "当前用户是否被禁言")
private Boolean currentHasForbidden = false;
@ApiModelProperty(value = "评论附件")
private List<TaskAppendixVo> taskAppendixVos;
}
package com.yizhi.comment.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* <p>
*
* </p>
*
* @author taoge123
* @since 2020-02-13
*/
@Data
@ApiModel(value = "StatisticsForumAccountVo", description = "")
public class StatisticsForumAccountVo {
@ApiModelProperty(value = "主键")
private Long id;
@ApiModelProperty(value = "用户id")
private Long author;
@ApiModelProperty(value = "已发表数")
private Integer sendNum;
@ApiModelProperty(value = "阅读数 ")
private Integer readNum;
@ApiModelProperty(value = "评论数 ")
private Integer commentNum;
@ApiModelProperty(value = "回复数 ")
private Integer replyNum;
@ApiModelProperty(value = "草稿帖子数 ")
private Integer draftNum;
@ApiModelProperty(value = "精选帖子数")
private Integer highlightNum;
@ApiModelProperty(value = "置顶帖子数")
private Integer topNum;
@ApiModelProperty(value = "点赞数")
private Integer admireNum;
@ApiModelProperty(value = "被点赞数")
private Integer beAdmiredNum;
@ApiModelProperty(value = "举报数")
private Integer informNum;
@ApiModelProperty(value = "被举报数")
private Integer beInformNum;
@ApiModelProperty(value = "被禁言数")
private Integer beForbiddenNum;
}
package com.yizhi.comment.application.vo;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author taoge123
* @since 2020-01-16
*/
@Data
@ApiModel(value = "TaskAppendixVo", description = "举报评论附件表")
public class TaskAppendixVo {
@ApiModelProperty(value = "主键")
private Long id;
@ApiModelProperty(value = "业务类型 1-评论 2-回复(已弃用) 3-举报 ")
private Integer taskType;
@ApiModelProperty(value = "业务id")
private Long taskId;
@ApiModelProperty(value = "附件名称 必填")
private String name;
@ApiModelProperty(value = "附件大小 必填")
private Double fileSize;
@ApiModelProperty(value = "文件后缀名 必填")
private String fileSuffer;
@ApiModelProperty(value = "下载路径 必填")
private String url;
@ApiModelProperty(value = "附件类型 :1、文档;2、图片;3、音频;4、视频;5、其他(压缩包)")
private Integer fileType;
}
package com.yizhi.comment.application.vo.domain;
import com.baomidou.mybatisplus.annotations.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author taoge123
* @since 2020-01-16
*/
@Data
@ApiModel(value = "InformRecordVo", description = "")
@TableName("inform_record")
public class InformRecordVo {
private static final long serialVersionUID = 1L;
private Long id;
@ApiModelProperty(value = "业务类型:2-帖子 ")
private Integer taskType;
@ApiModelProperty(value = "业务id task_type=2时,为帖子id")
private Long taskId;
@ApiModelProperty(value = "0-帖子 1-评论 2-回复")
private Integer type;
@ApiModelProperty(value = "评论回复id")
private Long commentId;
@ApiModelProperty(value = "1:上架 2:下架")
private Integer status;
@ApiModelProperty(value = "0:举报 1:移除举报")
private Integer deleted;
@ApiModelProperty(value = "举报描述")
private String description;
@ApiModelProperty(value = "举报人id")
private Long createById;
private String createByName;
@ApiModelProperty(value = "举报时间")
private Date createTime;
private Long updateById;
private String updateByName;
private Date updateTime;
private Long companyId;
private Long siteId;
private Long orgId;
}
package com.yizhi.comment.application.vo.domain;
import com.baomidou.mybatisplus.annotations.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 评论点赞记录表
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
@Data
@ApiModel(value = "NewCommentAdmireVo", description = "评论点赞记录表")
@TableName("new_comment_admire")
public class NewCommentAdmireVo {
private static final long serialVersionUID = 1L;
private Long Id;
@ApiModelProperty(value = "点赞人id")
private Long accountId;
@ApiModelProperty(value = "评论或帖子id")
private Long commentId;
@ApiModelProperty(value = "业务类型 1评论 2帖子")
private Integer bizType;
private Long createById;
private String createByName;
private Date createTime;
private Long updateById;
private String updateByName;
private Date updateTime;
@ApiModelProperty(value = "0:取消 1:点赞")
private Integer state;
}
package com.yizhi.comment.application.vo.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.yizhi.comment.application.vo.TaskAppendixVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* <p>
* 评论
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
@Data
@ApiModel(value = "NewCommentVo", description = "评论")
@TableName("new_comment")
public class NewCommentVo {
private static final long serialVersionUID = 1L;
private Long id;
@ApiModelProperty(value = "业务id")
private Long bizId;
@ApiModelProperty(value = "业务名称")
private String bizName;
@ApiModelProperty(value = "业务类型 0课程、2:论坛、 7培训项目 15专辑")
private Integer bizType;
@ApiModelProperty(value = "评论内容")
private String content;
@ApiModelProperty(value = "用于论坛--我的回复是否已读 0:未读(默认)")
private Integer isRead;
private Long createById;
private String createByName;
private Date createTime;
private Long updateById;
private String updateByName;
private Date updateTime;
@ApiModelProperty(value = "0:删除 1:上架 2:下架")
private Integer state;
private Long orgId;
private Long siteId;
@ApiModelProperty(value = "头像")
private String userAvatar;
private Long companyId;
@ApiModelProperty(value = "评论附件")
@TableField(exist = false)
private List<TaskAppendixVo> taskAppendixVos;
}
package com.yizhi.comment.application.vo.domain;
import com.baomidou.mybatisplus.annotations.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 回复
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
@Data
@ApiModel(value = "NewReplyVo", description = "回复")
@TableName("new_reply")
public class NewReplyVo {
private static final long serialVersionUID = 1L;
private Long id;
@ApiModelProperty(value = "业务id")
private Long bizId;
@ApiModelProperty(value = "业务名称")
private String bizName;
@ApiModelProperty(value = "业务类型 0课程 2:论坛 7培训项目 15专辑")
private Integer bizType;
@ApiModelProperty(value = "评论id")
private Long commentId;
@ApiModelProperty(value = "被回复人id(评论人或者回复人)")
private Long commenterId;
@ApiModelProperty(value = "回复父级id")
private Long replyParentId;
@ApiModelProperty(value = "回复内容")
private String content;
private Long createById;
private String createByName;
private Date createTime;
private Long updateById;
private String updateByName;
private Date updateTime;
@ApiModelProperty(value = "0:删除 1:上架 2:下架")
private Integer state;
@ApiModelProperty(value = "头像")
private String userAvatar;
@ApiModelProperty(value = "被回复人姓名")
private String commenterName;
@ApiModelProperty(value = "用于论坛--我的回复是否已读 0:未读(默认)")
private Integer isRead;
@ApiModelProperty(value = "是否是楼主 true:是")
private Boolean isAuthor = false;
@ApiModelProperty(value = "是否是自己创建的评论 true:是")
private Boolean isSelf = false;
@ApiModelProperty(value = "是否被禁言 true:是")
private Boolean hasForbidden = false;
}
package com.yizhi.comment.application.vo.domain;
import com.baomidou.mybatisplus.annotations.TableName;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@Api(tags = "PdfPagesVo", description = "pdf图片")
@TableName("pdf_pages")
public class PdfPagesVo {
private static final long serialVersionUID = 1L;
private Long id;
@ApiModelProperty(value = "页数")
private Integer pdfPage;
@ApiModelProperty(value = "业务id")
private Long bizId;
@ApiModelProperty(value = "业务类型")
private Integer bizType;
@ApiModelProperty(value = "图片地址")
private String imageUrl;
}
package com.yizhi.comment.application.vo.domain;
import com.baomidou.mybatisplus.annotations.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 订阅
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
@Data
@ApiModel(value = "SubscribeVo", description = "订阅")
@TableName("subscribe")
public class SubscribeVo {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键id")
private Long id;
@ApiModelProperty(value = "业务类型 0课程 7培训项目 15专辑")
private Integer bizType;
@ApiModelProperty(value = "业务id")
private Long bizId;
@ApiModelProperty(value = "状态")
private Integer status;
@ApiModelProperty(value = "所属站点id")
private Long siteId;
@ApiModelProperty(value = "学员id")
private Long accountId;
private String createByName;
private Date createTime;
private Long updateById;
private String updateByName;
private Date updateTime;
private Long companyId;
}
package com.yizhi.comment.application.vo.domain;
import com.baomidou.mybatisplus.annotations.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author taoge123
* @since 2020-01-16
*/
@Data
@ApiModel(value = "InformAppendix", description = "举报评论附件表")
@TableName("task_appendix")
public class TaskAppendixVo {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键 ")
private Long id;
@ApiModelProperty(value = "业务类型 1-评论 2-回复(已弃用) 3-举报 ")
private Integer taskType;
@ApiModelProperty(value = "业务id")
private Long taskId;
@ApiModelProperty(value = "附件名称 ")
private String name;
@ApiModelProperty(value = "附件大小")
private Double fileSize;
@ApiModelProperty(value = "文件后缀名")
private String fileSuffer;
@ApiModelProperty(value = "下载路径")
private String url;
@ApiModelProperty(value = "附件类型 :1、文档;2、图片;3、音频;4、视频;5、其他(压缩包)")
private Integer fileType;
@ApiModelProperty(value = "是否删除 0:未删除、1:已删除")
private Integer deleted;
@ApiModelProperty(value = "创建者id")
private Long createById;
@ApiModelProperty(value = "创建者名称")
private String createByName;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "更新者id")
private Long updateById;
@ApiModelProperty(value = "修改者名称")
private String updateByName;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.yizhi</groupId>
<artifactId>comment</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>cloud-comment</artifactId>
<dependencies>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-comment-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-system-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-forum-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-point-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-site-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-course-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-job-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-newMessage-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-course-studyLog-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-album-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-core</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-util</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-orm</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- deploy 时跳过该模块 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package com.yizhi.application;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@EnableTransactionManagement
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients(basePackages = {"com.yizhi"})
@ComponentScan(basePackages = {"com.yizhi"})
public class CommentApplication {
public static void main(String[] args) {
SpringApplication.run(CommentApplication.class, args);
}
}
package com.yizhi.application;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public class SwaggerConfig extends WebMvcConfigurerAdapter {
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
.groupName("评论")
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage("com.yizhi.application"))
.paths(PathSelectors.any())
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("评论")
//版本
.version("1.0")
.build();
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("docs.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
}
}
package com.yizhi.application.controller;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.yizhi.application.domain.NewCommentAdmire;
import com.yizhi.application.service.ICommentAdmireService;
import com.yizhi.comment.application.constans.Constant;
import com.yizhi.comment.application.vo.domain.NewCommentAdmireVo;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.forum.application.feign.remote.RemotePostsClient;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.core.application.task.AbstractTaskHandler;
import com.yizhi.core.application.task.TaskExecutor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.Map;
/**
* <p>
* 评论点赞记录表 前端控制器
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
@RestController
@RequestMapping("/commentAdmire")
public class CommentAdmireController {
@Autowired
private ICommentAdmireService commentAdmireService;
@Autowired
private IdGenerator idGenerator;
@Autowired
private TaskExecutor taskExecutor;
@Autowired
private RemotePostsClient remotePostsClient;
@GetMapping("/up")
public boolean up(@RequestParam(name = "commentId") Long commentId, @RequestParam("bizType") Integer bizType) {
RequestContext context = ContextHolder.get();
NewCommentAdmire commentAdmire = new NewCommentAdmire();
commentAdmire.setId(idGenerator.generate());
commentAdmire.setAccountId(context.getAccountId());
commentAdmire.setCommentId(commentId);
commentAdmire.setBizType(bizType);
commentAdmire.setCreateById(context.getAccountId());
commentAdmire.setCreateByName(context.getAccountName());
commentAdmire.setCreateTime(new Date());
commentAdmire.setUpdateById(context.getAccountId());
commentAdmire.setUpdateByName(context.getAccountName());
commentAdmire.setUpdateTime(new Date());
commentAdmire.setState(1);
boolean insert = commentAdmireService.insert(commentAdmire);
if (insert) {
updatePostsInfo(bizType, commentId);
}
return insert;
}
@GetMapping("/down")
public boolean down(@RequestParam(name = "commentId")Long commentId, @RequestParam("bizType") Integer bizType) {
RequestContext res = ContextHolder.get();
NewCommentAdmire commentAdmire = new NewCommentAdmire();
commentAdmire.setCommentId(commentId);
commentAdmire.setBizType(bizType);
commentAdmire.setAccountId(res.getAccountId());
commentAdmire.setState(1);
boolean delete = commentAdmireService.delete(new EntityWrapper<>(commentAdmire));
if (delete){
updatePostsInfo(bizType, commentId);
}
return delete ;
}
/**
* 获取点赞数
* @param bizType
* @param taskId
* @param accountId
* @return
*/
@GetMapping("/getNum")
public Integer getNum(@RequestParam("bizType") Integer bizType,
@RequestParam(name = "taskId") Long taskId,
@RequestParam(name = "accountId",required = false) Long accountId) {
RequestContext res = ContextHolder.get();
NewCommentAdmire commentAdmire = new NewCommentAdmire();
commentAdmire.setState(Constant.UP);
commentAdmire.setBizType(bizType);
commentAdmire.setCommentId(taskId);
commentAdmire.setAccountId(accountId);
return commentAdmireService.selectCount(new EntityWrapper<>(commentAdmire));
}
/**
* 获取<业务id,点赞数></>>Map
* @param bizType
* @return
*/
@GetMapping("/getPersonalDataMap")
public Map<Long, Integer> getPersonalDataMap(@RequestParam("bizType") Integer bizType) {
return commentAdmireService.getCountsMap(bizType);
}
/**
* 点赞或者取消点赞 更新帖子信息
* @param bizType
* @param bizId
*/
public void updatePostsInfo(Integer bizType, Long bizId) {
//如果业务类型对帖子的
if (Constant.TASK_TYPE_POSTS.equals(bizType)) {
taskExecutor.asynExecute(new AbstractTaskHandler() {
@Override
public void handle() {
NewCommentAdmire commentAdmire = new NewCommentAdmire();
commentAdmire.setBizType(bizType);
commentAdmire.setCommentId(bizId);
commentAdmire.setState(1);
//更新帖子新回复、最新评论时间、评论数、回复数字段
com.yizhi.forum.application.vo.domain.PostsVo vo = new com.yizhi.forum.application.vo.domain.PostsVo();
vo.setId(bizId);
vo.setThumbsNum(commentAdmireService.selectCount(new EntityWrapper<>(commentAdmire)));
remotePostsClient.updateInfo(vo);
}
});
}
}
}
package com.yizhi.application.controller;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.comment.application.feign.InformRecordClient;
import com.yizhi.application.service.IInformRecordService;
import com.yizhi.comment.application.vo.InformRecordVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* <p>
* 前端控制器
* </p>
*
* @author taoge123
* @since 2020-01-16
*/
@RestController
@RequestMapping("/informRecord")
public class InformRecordController implements InformRecordClient {
@Autowired
private IInformRecordService informRecordService;
@Override
@PostMapping("/save")
public Integer save(@RequestBody InformRecordVo informRecordVo) {
return informRecordService.save(informRecordVo);
}
@Override
@GetMapping("/getPage")
public Page<InformRecordVo> getPage(@RequestParam("taskType") Integer taskType,
@RequestParam("taskId") Long taskId,
@RequestParam("type") Integer type,
@RequestParam("terminalType") Integer terminalType,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize) {
return informRecordService.getPage(taskType, taskId, type, terminalType, pageNo, pageSize);
}
@Override
@GetMapping("/cancel")
public Integer cancel(@RequestParam("id") Long id) {
return informRecordService.cancel(id);
}
@Override
@GetMapping("/cancelByCommentId")
public Integer cancelByCommentId(@RequestParam("taskType") Integer taskType,
@RequestParam("taskId") Long taskId,
@RequestParam("type") Integer type,
@RequestParam(value = "commentId",required = false) Long commentId) {
return informRecordService.cancelByCommentId(taskType, taskId, type, commentId);
}
// /**
// * 获取<业务id,举报数></>>Map
// * @param bizType
// * @return
// */
// @Override
// @GetMapping("/getPersonalDataMap")
// public Map<Long, Integer> getPersonalDataMap(@RequestParam("bizType") Integer bizType) {
// return informRecordService.getCountsMap(bizType);
// }
}
package com.yizhi.application.controller;
import com.yizhi.application.domain.NewReply;
import com.yizhi.application.service.ICommentService;
import com.yizhi.application.service.IReplyService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.core.application.cache.CacheNamespace;
import com.yizhi.core.application.cache.RedisCache;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.comment.application.vo.domain.NewReplyVo;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.system.application.system.remote.AccountClient;
import com.yizhi.util.application.json.JsonUtil;
import com.yizhi.util.application.sensitive.SensitivewordFilter;
import com.yizhi.system.application.vo.AccountVO;
import com.yizhi.comment.application.vo.CommentVo;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
/**
* <p>
* 回复 前端控制器
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
@RestController
@RequestMapping("/reply")
public class ReplyController {
@Autowired
private ICommentService commentService;
@Autowired
private IReplyService replyService;
@Autowired
private IdGenerator idGenerator;
@Autowired
private AccountClient accountClient;
@Autowired
private RedisCache redisCache;
/**
* 新增回复评论接口(保存)
* @param
* @return
*/
@PostMapping("/save")
public Boolean saveReply(@RequestBody NewReply reply){
RequestContext context = ContextHolder.get();
Date date = new Date();
if (reply.getReplyParentId()!=null&&reply.getReplyParentId()!=0) {
NewReply newReplyVo = replyService.selectById(reply.getReplyParentId());
if (newReplyVo ==null) {
return false;
}
}else {
reply.setReplyParentId(0L);
}
reply.setId(idGenerator.generate());
reply.setCreateById(context.getAccountId());
reply.setCreateByName(context.getAccountName());
reply.setCreateTime(date);
if (replyService.insert(reply)){
commentService.updatePostsInfo(reply.getBizId(),reply.getBizType(),context.getSiteId(),date,true,false);
return true;
}
return false;
}
@GetMapping("/list")
public Page<CommentVo> list(@RequestParam(name = "bizId") Long bizId, @RequestParam(name = "pageNo") Integer pageNo,
@RequestParam(name = "pageSize") Integer pageSize) {
Page<CommentVo> page = new Page<CommentVo>();
page = replyService.getCommentPage(bizId, pageNo, pageSize);
List<Long> accountIds = new ArrayList<>();
Map<Long, AccountVO> accountVOMap = new HashMap<>(16);
for(CommentVo vo:page.getRecords()) {
if (!accountIds.contains(vo.getAccountId())) {
accountIds.add(vo.getAccountId());
}
if (!accountIds.contains(vo.getReplyId())) {
accountIds.add(vo.getReplyId());
}
}
List<AccountVO> accountVOList = accountClient.idsGet(accountIds);
if (CollectionUtils.isNotEmpty(accountVOList)) {
for (AccountVO accountVO : accountVOList) {
accountVOMap.put(accountVO.getId(), accountVO);
}
}
//将用户名放入返回结果中
for (CommentVo commentReplyVO : page.getRecords()) {
if (null != accountVOMap.get(commentReplyVO.getAccountId())) {
AccountVO commentAccount = accountVOMap.get(commentReplyVO.getAccountId());
commentReplyVO.setCommentator(commentAccount.getName());
commentReplyVO.setCommentatorName(commentAccount.getFullName()==""||commentAccount.getFullName()==null?commentAccount.getName():commentAccount.getFullName());
commentReplyVO.setUserAvatar(accountVOMap.get(commentReplyVO.getAccountId()).getHeadPortrait());
}
if (null != accountVOMap.get(commentReplyVO.getReplyId())) {
AccountVO replyAccount = accountVOMap.get(commentReplyVO.getReplyId());
commentReplyVO.setReplyName(replyAccount.getFullName()==""||replyAccount.getFullName()==null?replyAccount.getName():replyAccount.getFullName());
}
}
return page;
}
/**
* 用于学员移动端回复列表查询
* @param commmentId
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/list2")
public Page<NewReply> replyList2(@RequestParam("commentId") Long commentId, @RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize) {
RequestContext res = ContextHolder.get();
Page<NewReply> page = new Page<NewReply>(pageNo, pageSize);
NewReply reply = new NewReply();
reply.setCommentId(commentId);
reply.setState(1);
EntityWrapper<NewReply> wrapper = new EntityWrapper<NewReply>(reply);
List<String> list = new ArrayList<String>();
list.add("createTime");
wrapper.orderDesc(list);
replyService.selectPage(page, wrapper);
//获取评论人和被评论人id并获取信息放入map中
List<Long> accountIds = new ArrayList<>();
Map<Long, AccountVO> accountVOMap = new HashMap<>(16);
for (NewReply listCommentVo : page.getRecords()) {
if (!accountIds.contains(listCommentVo.getCreateById())) {
accountIds.add(listCommentVo.getCreateById());
}
if (!accountIds.contains(listCommentVo.getCommenterId())) {
accountIds.add(listCommentVo.getCommenterId());
}
}
List<AccountVO> accountVOList = accountClient.idsGet(accountIds);
if (CollectionUtils.isNotEmpty(accountVOList)) {
for (AccountVO accountVO : accountVOList) {
accountVOMap.put(accountVO.getId(), accountVO);
}
}
//获取敏感词
Set<String> sensitiveWordList = new HashSet<>();
String sensitiveValues = (String) redisCache.hget(CacheNamespace.REDIS_SENSITIVE_WORD_INFO, res.getCompanyId().toString());
if (StringUtils.isNotBlank(sensitiveValues)) {
sensitiveWordList = JsonUtil.json2Ojbect(sensitiveValues, Set.class);
}
//将用户名放入返回结果中
for (NewReply commentReplyVO : page.getRecords()) {
//过滤敏感词
if (CollectionUtils.isNotEmpty(sensitiveWordList)) {
if (null != commentReplyVO.getContent()) {
commentReplyVO.setContent(filterWord(commentReplyVO.getContent(), sensitiveWordList));
}
}
if (null != accountVOMap.get(commentReplyVO.getCreateById())) {
AccountVO commentAccount = accountVOMap.get(commentReplyVO.getCreateById());
commentReplyVO.setCreateByName(commentAccount.getFullName()==""||commentAccount.getFullName()==null?commentAccount.getName():commentAccount.getFullName());
commentReplyVO.setUserAvatar(accountVOMap.get(commentReplyVO.getCreateById()).getHeadPortrait());
}
if (null != accountVOMap.get(commentReplyVO.getCommenterId())) {
AccountVO replyAccount = accountVOMap.get(commentReplyVO.getCommenterId());
commentReplyVO.setCommenterName(replyAccount.getFullName()==""||replyAccount.getFullName()==null?replyAccount.getName():replyAccount.getFullName());
}
}
return page;
}
/**
* 过滤敏感词
*
* @param content 评论内容
* @param sensitiveWordList 已设置的敏感词集合
* @return
*/
public String filterWord(String content, Set<String> sensitiveWordList) {
if (sensitiveWordList != null) {
if (!StringUtils.isBlank(content)) {
return SensitivewordFilter.sensitiveFilter(content, sensitiveWordList);
}
}
return content;
}
}
package com.yizhi.application.controller;
import com.yizhi.application.domain.Subscribe;
import com.yizhi.application.mapper.SubscribeMapper;
import com.yizhi.comment.application.vo.domain.SubscribeVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.album.application.feign.AlbumClient;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.application.service.ISubscribeService;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
/**
* <p>
* 订阅 前端控制器
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
@RestController
@RequestMapping("/subscribe")
public class SubscribeController {
@Autowired
private ISubscribeService subscribeService;
@Autowired
private SubscribeMapper subscribeMapper;
@Autowired
IdGenerator idGenerator;
@Autowired
private AlbumClient albumClient;
@GetMapping("/get")
public Subscribe get(@RequestParam(name = "bizId") Long bizId, @RequestParam(name = "bizType") Integer bizType, @RequestParam("accountId") Long accountId, @RequestParam("siteId") Long siteId, @RequestParam("companyId") Long companyId) {
Subscribe subscribeVo = new Subscribe();
subscribeVo.setSiteId(siteId);
subscribeVo.setCompanyId(companyId);
subscribeVo.setAccountId(accountId);
subscribeVo.setBizId(bizId);
subscribeVo.setBizType(bizType);
EntityWrapper<Subscribe> wrapper = new EntityWrapper<Subscribe>(subscribeVo);
Subscribe one = subscribeService.selectOne(wrapper);
if (one==null) {
subscribeVo.setStatus(0);
return subscribeVo;
}
return one;
}
@GetMapping("/save")
public Subscribe save(@RequestParam(name = "bizId") Long bizId, @RequestParam(name = "bizType") Integer bizType, @RequestParam("accountId") Long accountId, @RequestParam("siteId") Long siteId, @RequestParam("companyId") Long companyId) {
Date date = new Date();
Subscribe subscribeVo = new Subscribe();
subscribeVo.setSiteId(siteId);
subscribeVo.setCompanyId(companyId);
subscribeVo.setAccountId(accountId);
subscribeVo.setBizId(bizId);
subscribeVo.setBizType(bizType);
EntityWrapper<Subscribe> wrapper = new EntityWrapper<Subscribe>(subscribeVo);
Subscribe one = subscribeService.selectOne(wrapper);
if (one==null) {
one = new Subscribe();
one.setId(idGenerator.generate());
one.setBizId(bizId);
one.setBizType(bizType);
one.setCompanyId(companyId);
one.setSiteId(siteId);
one.setAccountId(accountId);
one.setCreateTime(date);
one.setStatus(1);
subscribeService.insert(one);
}else {
one.setUpdateById(accountId);
one.setUpdateTime(date);
one.setStatus(one.getStatus().equals(0)?1:0);
subscribeService.updateById(one);
}
return one;
}
@GetMapping("/getMyList")
public List<Long> getMyList(@RequestParam(name = "bizType") Integer bizType,@RequestParam("accountId") Long accountId,@RequestParam("siteId") Long siteId,@RequestParam("companyId") Long companyId){
List<Long> list = subscribeService.getMyList(bizType, accountId, siteId, companyId);
return list;
}
@GetMapping("getAllList")
public List<Subscribe> getAllList(){
List<Subscribe> list = subscribeMapper.getAllList();
return list;
}
@GetMapping("/getSubscribeNum")
public Integer getSubscribeNum(@RequestParam(name = "bizId") Long bizId,@RequestParam(name = "bizType") Integer bizType) {
Subscribe subscribeVo = new Subscribe();
subscribeVo.setBizId(bizId);
subscribeVo.setBizType(bizType);
subscribeVo.setStatus(1);
return subscribeService.selectCount(new EntityWrapper<Subscribe>(subscribeVo));
}
@PostMapping("/getMySubscribeNum")
public Integer getMySubscribeNum(@RequestBody RequestContext context) {
Integer num = 0;
List<Long> ids = subscribeMapper.getMyList(null, context.getAccountId(), context.getSiteId(), context.getCompanyId());
if (!CollectionUtils.isEmpty(ids)) {
//专辑数量
num = albumClient.getSubcribeNum(ids);
}
return num;
}
}
package com.yizhi.application.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 前端控制器
* </p>
*
* @author taoge123
* @since 2020-01-16
*/
@RestController
@RequestMapping("/informAppendix")
public class TaskAppendixController {
}
package com.yizhi.application.controller.remote;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.yizhi.application.domain.NewCommentAdmire;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.application.service.ICommentAdmireService;
import com.yizhi.comment.application.constans.Constant;
import com.yizhi.comment.application.vo.domain.NewCommentAdmireVo;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.core.application.task.AbstractTaskHandler;
import com.yizhi.core.application.task.TaskExecutor;
import com.yizhi.forum.application.feign.remote.RemotePostsClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.Map;
/**
* <p>
* 评论点赞记录表 前端控制器
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
@RestController(value = "CommentAdmireControllerRemote")
@RequestMapping("/remote/commentAdmire")
public class CommentAdmireController {
@Autowired
private ICommentAdmireService commentAdmireService;
@Autowired
private IdGenerator idGenerator;
@Autowired
private TaskExecutor taskExecutor;
@Autowired
private RemotePostsClient remotePostsClient;
@GetMapping("/up")
public boolean up(@RequestParam(name = "commentId") Long commentId, @RequestParam("bizType") Integer bizType) {
RequestContext context = ContextHolder.get();
NewCommentAdmire commentAdmire = new NewCommentAdmire();
commentAdmire.setId(idGenerator.generate());
commentAdmire.setAccountId(context.getAccountId());
commentAdmire.setCommentId(commentId);
commentAdmire.setBizType(bizType);
commentAdmire.setCreateById(context.getAccountId());
commentAdmire.setCreateByName(context.getAccountName());
commentAdmire.setCreateTime(new Date());
commentAdmire.setUpdateById(context.getAccountId());
commentAdmire.setUpdateByName(context.getAccountName());
commentAdmire.setUpdateTime(new Date());
commentAdmire.setState(1);
boolean insert = commentAdmireService.insert(commentAdmire);
if (insert) {
updatePostsInfo(bizType, commentId);
}
return insert;
}
@GetMapping("/down")
public boolean down(@RequestParam(name = "commentId")Long commentId, @RequestParam("bizType") Integer bizType) {
RequestContext res = ContextHolder.get();
NewCommentAdmire commentAdmire = new NewCommentAdmire();
commentAdmire.setCommentId(commentId);
commentAdmire.setBizType(bizType);
commentAdmire.setAccountId(res.getAccountId());
commentAdmire.setState(1);
boolean delete = commentAdmireService.delete(new EntityWrapper<>(commentAdmire));
if (delete){
updatePostsInfo(bizType, commentId);
}
return delete ;
}
/**
* 获取点赞数
* @param bizType
* @param taskId
* @param accountId
* @return
*/
@GetMapping("/getNum")
public Integer getNum(@RequestParam("bizType") Integer bizType,
@RequestParam(name = "taskId") Long taskId,
@RequestParam(name = "accountId",required = false) Long accountId) {
RequestContext res = ContextHolder.get();
NewCommentAdmire commentAdmire = new NewCommentAdmire();
commentAdmire.setState(Constant.UP);
commentAdmire.setBizType(bizType);
commentAdmire.setCommentId(taskId);
commentAdmire.setAccountId(accountId);
return commentAdmireService.selectCount(new EntityWrapper<>(commentAdmire));
}
/**
* 获取<业务id,点赞数></>>Map
* @param bizType
* @return
*/
@GetMapping("/getPersonalDataMap")
public Map<Long, Integer> getPersonalDataMap(@RequestParam("bizType") Integer bizType) {
return commentAdmireService.getCountsMap(bizType);
}
/**
* 点赞或者取消点赞 更新帖子信息
* @param bizType
* @param bizId
*/
public void updatePostsInfo(Integer bizType, Long bizId) {
//如果业务类型对帖子的
if (Constant.TASK_TYPE_POSTS.equals(bizType)) {
taskExecutor.asynExecute(new AbstractTaskHandler() {
@Override
public void handle() {
NewCommentAdmire commentAdmire = new NewCommentAdmire();
commentAdmire.setBizType(bizType);
commentAdmire.setCommentId(bizId);
commentAdmire.setState(1);
//更新帖子新回复、最新评论时间、评论数、回复数字段
com.yizhi.forum.application.vo.domain.PostsVo vo = new com.yizhi.forum.application.vo.domain.PostsVo();
vo.setId(bizId);
vo.setThumbsNum(commentAdmireService.selectCount(new EntityWrapper<>(commentAdmire)));
remotePostsClient.updateInfo(vo);
}
});
}
}
}
package com.yizhi.application.controller.remote;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.application.service.IInformRecordService;
import com.yizhi.comment.application.feign.InformRecordClient;
import com.yizhi.comment.application.vo.InformRecordVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* <p>
* 前端控制器
* </p>
*
* @author taoge123
* @since 2020-01-16
*/
@RestController(value = "InformRecordControllerRemote")
@RequestMapping("/remote/informRecord")
public class InformRecordController implements InformRecordClient {
@Autowired
private IInformRecordService informRecordService;
@Override
@PostMapping("/save")
public Integer save(@RequestBody InformRecordVo informRecordVo) {
return informRecordService.save(informRecordVo);
}
@Override
@GetMapping("/getPage")
public Page<InformRecordVo> getPage(@RequestParam("taskType") Integer taskType,
@RequestParam("taskId") Long taskId,
@RequestParam("type") Integer type,
@RequestParam("terminalType") Integer terminalType,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize) {
return informRecordService.getPage(taskType, taskId, type, terminalType, pageNo, pageSize);
}
@Override
@GetMapping("/cancel")
public Integer cancel(@RequestParam("id") Long id) {
return informRecordService.cancel(id);
}
@Override
@GetMapping("/cancelByCommentId")
public Integer cancelByCommentId(@RequestParam("taskType") Integer taskType,
@RequestParam("taskId") Long taskId,
@RequestParam("type") Integer type,
@RequestParam(value = "commentId",required = false) Long commentId) {
return informRecordService.cancelByCommentId(taskType, taskId, type, commentId);
}
// /**
// * 获取<业务id,举报数></>>Map
// * @param bizType
// * @return
// */
// @Override
// @GetMapping("/getPersonalDataMap")
// public Map<Long, Integer> getPersonalDataMap(@RequestParam("bizType") Integer bizType) {
// return informRecordService.getCountsMap(bizType);
// }
}
package com.yizhi.application.controller.remote;
import java.util.List;
import com.yizhi.application.domain.PdfPages;
import com.yizhi.application.mapper.PdfPagesMapper;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.yizhi.comment.application.vo.domain.PdfPagesVo;
import com.yizhi.application.service.IPdfPagesService;
@RestController(value = "PdfPagesControllerRemote")
@RequestMapping("/remote/pdfPages")
public class PdfPagesController {
private static final Logger LOG = LoggerFactory.getLogger(PdfPagesController.class);
@Autowired
private PdfPagesMapper pdfPagesMapper;
@Autowired
private IPdfPagesService pdfPagesService;
@PostMapping("/save")
public boolean save(@RequestBody List<PdfPages> pdfPageVos) {
try {
if (CollectionUtils.isNotEmpty(pdfPageVos)) {
pdfPagesMapper.deleteByBizId(pdfPageVos.get(0).getBizId(), pdfPageVos.get(0).getBizType());
pdfPagesService.insertBatch(pdfPageVos, pdfPageVos.size());
}
return Boolean.TRUE;
} catch (Exception e) {
// TODO Auto-generated catch block
LOG.error("pdf图片保存异常",e.getMessage());
e.printStackTrace();
return Boolean.FALSE;
}
}
@GetMapping("/list")
public List<PdfPages> list(@RequestParam("bizId")Long bizId, @RequestParam("bizType")Integer bizType){
return pdfPagesMapper.getPages(bizId, bizType);
}
}
package com.yizhi.application.controller.remote;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.application.domain.NewReply;
import com.yizhi.comment.application.vo.domain.NewReplyVo;
import com.yizhi.core.application.cache.CacheNamespace;
import com.yizhi.core.application.cache.RedisCache;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.system.application.system.remote.AccountClient;
import com.yizhi.util.application.json.JsonUtil;
import com.yizhi.util.application.sensitive.SensitivewordFilter;
import com.yizhi.system.application.vo.AccountVO;
import com.yizhi.application.service.ICommentService;
import com.yizhi.application.service.IReplyService;
import com.yizhi.comment.application.vo.CommentVo;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.*;
/**
* <p>
* 回复 前端控制器
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
@RestController(value = "ReplyControllerRemote")
@RequestMapping("/remote/reply")
public class ReplyController {
@Autowired
private ICommentService commentService;
@Autowired
private IReplyService replyService;
@Autowired
private IdGenerator idGenerator;
@Autowired
private AccountClient accountClient;
@Autowired
private RedisCache redisCache;
/**
* 新增回复评论接口(保存)
* @param
* @return
*/
@PostMapping("/save")
public Boolean saveReply(@RequestBody NewReply reply){
RequestContext context = ContextHolder.get();
Date date = new Date();
if (reply.getReplyParentId()!=null&&reply.getReplyParentId()!=0) {
NewReply newReplyVo = replyService.selectById(reply.getReplyParentId());
if (newReplyVo ==null) {
return false;
}
}else {
reply.setReplyParentId(0L);
}
reply.setId(idGenerator.generate());
reply.setCreateById(context.getAccountId());
reply.setCreateByName(context.getAccountName());
reply.setCreateTime(date);
if (replyService.insert(reply)){
commentService.updatePostsInfo(reply.getBizId(),reply.getBizType(),context.getSiteId(),date,true,false);
return true;
}
return false;
}
@GetMapping("/list")
public Page<CommentVo> list(@RequestParam(name = "bizId") Long bizId, @RequestParam(name = "pageNo") Integer pageNo,
@RequestParam(name = "pageSize") Integer pageSize) {
Page<CommentVo> page = new Page<CommentVo>();
page = replyService.getCommentPage(bizId, pageNo, pageSize);
List<Long> accountIds = new ArrayList<>();
Map<Long, AccountVO> accountVOMap = new HashMap<>(16);
for(CommentVo vo:page.getRecords()) {
if (!accountIds.contains(vo.getAccountId())) {
accountIds.add(vo.getAccountId());
}
if (!accountIds.contains(vo.getReplyId())) {
accountIds.add(vo.getReplyId());
}
}
List<AccountVO> accountVOList = accountClient.idsGet(accountIds);
if (CollectionUtils.isNotEmpty(accountVOList)) {
for (AccountVO accountVO : accountVOList) {
accountVOMap.put(accountVO.getId(), accountVO);
}
}
//将用户名放入返回结果中
for (CommentVo commentReplyVO : page.getRecords()) {
if (null != accountVOMap.get(commentReplyVO.getAccountId())) {
AccountVO commentAccount = accountVOMap.get(commentReplyVO.getAccountId());
commentReplyVO.setCommentator(commentAccount.getName());
commentReplyVO.setCommentatorName(commentAccount.getFullName()==""||commentAccount.getFullName()==null?commentAccount.getName():commentAccount.getFullName());
commentReplyVO.setUserAvatar(accountVOMap.get(commentReplyVO.getAccountId()).getHeadPortrait());
}
if (null != accountVOMap.get(commentReplyVO.getReplyId())) {
AccountVO replyAccount = accountVOMap.get(commentReplyVO.getReplyId());
commentReplyVO.setReplyName(replyAccount.getFullName()==""||replyAccount.getFullName()==null?replyAccount.getName():replyAccount.getFullName());
}
}
return page;
}
/**
* 用于学员移动端回复列表查询
* @param commmentId
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/list2")
public Page<NewReply> replyList2(@RequestParam("commentId") Long commentId, @RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize) {
RequestContext res = ContextHolder.get();
Page<NewReply> page = new Page<NewReply>(pageNo, pageSize);
NewReply reply = new NewReply();
reply.setCommentId(commentId);
reply.setState(1);
EntityWrapper<NewReply> wrapper = new EntityWrapper<NewReply>(reply);
List<String> list = new ArrayList<String>();
list.add("createTime");
wrapper.orderDesc(list);
replyService.selectPage(page, wrapper);
//获取评论人和被评论人id并获取信息放入map中
List<Long> accountIds = new ArrayList<>();
Map<Long, AccountVO> accountVOMap = new HashMap<>(16);
for (NewReply listCommentVo : page.getRecords()) {
if (!accountIds.contains(listCommentVo.getCreateById())) {
accountIds.add(listCommentVo.getCreateById());
}
if (!accountIds.contains(listCommentVo.getCommenterId())) {
accountIds.add(listCommentVo.getCommenterId());
}
}
List<AccountVO> accountVOList = accountClient.idsGet(accountIds);
if (CollectionUtils.isNotEmpty(accountVOList)) {
for (AccountVO accountVO : accountVOList) {
accountVOMap.put(accountVO.getId(), accountVO);
}
}
//获取敏感词
Set<String> sensitiveWordList = new HashSet<>();
String sensitiveValues = (String) redisCache.hget(CacheNamespace.REDIS_SENSITIVE_WORD_INFO, res.getCompanyId().toString());
if (StringUtils.isNotBlank(sensitiveValues)) {
sensitiveWordList = JsonUtil.json2Ojbect(sensitiveValues, Set.class);
}
//将用户名放入返回结果中
for (NewReply commentReplyVO : page.getRecords()) {
//过滤敏感词
if (CollectionUtils.isNotEmpty(sensitiveWordList)) {
if (null != commentReplyVO.getContent()) {
commentReplyVO.setContent(filterWord(commentReplyVO.getContent(), sensitiveWordList));
}
}
if (null != accountVOMap.get(commentReplyVO.getCreateById())) {
AccountVO commentAccount = accountVOMap.get(commentReplyVO.getCreateById());
commentReplyVO.setCreateByName(commentAccount.getFullName()==""||commentAccount.getFullName()==null?commentAccount.getName():commentAccount.getFullName());
commentReplyVO.setUserAvatar(accountVOMap.get(commentReplyVO.getCreateById()).getHeadPortrait());
}
if (null != accountVOMap.get(commentReplyVO.getCommenterId())) {
AccountVO replyAccount = accountVOMap.get(commentReplyVO.getCommenterId());
commentReplyVO.setCommenterName(replyAccount.getFullName()==""||replyAccount.getFullName()==null?replyAccount.getName():replyAccount.getFullName());
}
}
return page;
}
/**
* 过滤敏感词
*
* @param content 评论内容
* @param sensitiveWordList 已设置的敏感词集合
* @return
*/
public String filterWord(String content, Set<String> sensitiveWordList) {
if (sensitiveWordList != null) {
if (!StringUtils.isBlank(content)) {
return SensitivewordFilter.sensitiveFilter(content, sensitiveWordList);
}
}
return content;
}
}
package com.yizhi.application.controller.remote;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.application.domain.NewComment;
import com.yizhi.application.domain.NewReply;
import com.yizhi.application.service.ICommentService;
import com.yizhi.application.service.IInformRecordService;
import com.yizhi.application.service.IReplyService;
import com.yizhi.comment.application.constans.Constant;
import com.yizhi.comment.application.feign.student.StudentCommentClient;
import com.yizhi.comment.application.vo.CommentParam;
import com.yizhi.comment.application.vo.NewApiCommentVo;
import com.yizhi.comment.application.vo.PostsCommentVo;
import com.yizhi.comment.application.vo.domain.NewCommentVo;
import com.yizhi.comment.application.vo.domain.NewReplyVo;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* <p>
* 评论 前端控制器
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
@RestController(value = "StudentCommentControllerRemote")
@RequestMapping("/remote/student/comment")
public class StudentCommentController implements StudentCommentClient {
@Autowired
private ICommentService commentService;
@Autowired
private IReplyService replyService;
@Autowired
private IInformRecordService informRecordService;
/**
* 论坛 学员端获取分页的评论和分页的回复
*
* @param param
* @return
*/
@Override
@PostMapping("/getPage")
public Page<NewApiCommentVo> getPage(@RequestBody CommentParam param) {
return commentService.getPage(param);
}
/**
* 论坛 我收到的回复分页
*
* @param param
* @return
*/
@Override
@PostMapping("/myReceivedPage")
public Page<PostsCommentVo> myReceivedPage(@RequestBody CommentParam param) {
return commentService.myReceivedPage(param);
}
/**
* 论坛 我收到的回复分页--查看对话
*
* @param id 回复的id
* @return
*/
@Override
@GetMapping("/catCommunication")
public List<PostsCommentVo> catCommunication(@RequestParam("id") Long id) {
return replyService.catCommunication(id);
}
@Override
@PostMapping("/mySendPage")
public Page<PostsCommentVo> mySendPage(@RequestBody CommentParam param) {
return commentService.mySendPage(param);
}
/**
* 论坛 我的管理--回复管理--回复列表分页
*
* @param type
* @param postsId
* @param pageNo
* @param pageSize
* @return
*/
@Override
@GetMapping("/getPageByPostsId")
@ApiOperation(value = "我的管理--回复管理--回复列表", response = PostsCommentVo.class)
public Page<PostsCommentVo> getPageByPostsId(@ApiParam("type必传 ") @RequestParam("type") Integer type,
@ApiParam("帖子id ") @RequestParam("postsId") Long postsId,
@ApiParam("pageNo") @RequestParam("pageNo") Integer pageNo,
@ApiParam("pageSize ") @RequestParam("pageSize") Integer pageSize) {
return commentService.getPageByPostsId(type, postsId, pageNo, pageSize);
}
/**
* 论坛 评论(回复)--删除(下架) 包含子级回复
*
* @param id
* @param type 1:评论、2-回复
* operationType 1-下架 2-删除
* isInform 是否是举报
* @return
*/
@Override
@GetMapping("/down")
public Integer down(@RequestParam("id") Long id, @RequestParam("type") Integer type, @RequestParam("isInform") Boolean isInform) {
if (type == 1) {
if (commentService.down(1, id) > 0) {
if (isInform) {
informRecordService.cancelByCommentId(Constant.TASK_TYPE_POSTS, null, type, id);
}
NewComment newCommentVo = commentService.selectById(id);
commentService.updatePostsInfo(newCommentVo.getBizId(), newCommentVo.getBizType(), newCommentVo.getSiteId(), null, false, false);
return 1;
}
return 0;
} else {
if (replyService.down(1, id) > 0) {
if (isInform) {
informRecordService.cancelByCommentId(Constant.TASK_TYPE_POSTS, null, type, id);
}
NewReply newReplyVo = replyService.selectById(id);
commentService.updatePostsInfo(newReplyVo.getBizId(), newReplyVo.getBizType(), null, null, false, false);
return 1;
}
return 0;
}
}
@Override
@PostMapping("/save")
public Integer studentSave(@RequestBody NewCommentVo comment) {
return commentService.save(comment);
}
/**
* 论坛我的回复--获取我的回复(收到的回复未查看的数量)
* @param taskType
* @param taskIds
* @return
*/
@Override
@GetMapping("/myNum")
public Integer myNum(@RequestParam("taskType") Integer taskType,
@RequestParam(value = "taskId",required = false) List<Long> taskIds) {
return commentService.myNum(taskType,taskIds);
}
@Override
@ApiOperation(value = "获取单个评论详情,包含回复", response = PostsCommentVo.class)
@GetMapping("/getCommentDetails")
public NewApiCommentVo getCommentDetails(@ApiParam("taskType必传 ") @RequestParam("taskType") Integer taskType,
@ApiParam("业务id ") @RequestParam("taskId") Long taskId,
@ApiParam("评论id ") @RequestParam("commentId") Long commentId,
@ApiParam("作者id ") @RequestParam(value = "author",required = false) Long author,
@ApiParam("回复排序方式 ") @RequestParam("orderType") Integer orderType,
@ApiParam("回复的pageNo") @RequestParam("pageNo") Integer pageNo,
@ApiParam("回复的pageSize ") @RequestParam("pageSize") Integer pageSize) {
return commentService.getCommentDetails(taskType, taskId,commentId,author,orderType, pageNo, pageSize);
}
}
package com.yizhi.application.controller.remote;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.yizhi.application.domain.Subscribe;
import com.yizhi.comment.application.vo.domain.SubscribeVo;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.album.application.feign.AlbumClient;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.application.mapper.SubscribeMapper;
import com.yizhi.application.service.ISubscribeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
/**
* <p>
* 订阅 前端控制器
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
@RestController(value = "SubscribeControllerRemote")
@RequestMapping("/remote/subscribe")
public class SubscribeController {
@Autowired
private ISubscribeService subscribeService;
@Autowired
private SubscribeMapper subscribeMapper;
@Autowired
IdGenerator idGenerator;
@Autowired
private AlbumClient albumClient;
@GetMapping("/get")
public Subscribe get(@RequestParam(name = "bizId") Long bizId, @RequestParam(name = "bizType") Integer bizType, @RequestParam("accountId") Long accountId, @RequestParam("siteId") Long siteId, @RequestParam("companyId") Long companyId) {
Subscribe subscribeVo = new Subscribe();
subscribeVo.setSiteId(siteId);
subscribeVo.setCompanyId(companyId);
subscribeVo.setAccountId(accountId);
subscribeVo.setBizId(bizId);
subscribeVo.setBizType(bizType);
EntityWrapper<Subscribe> wrapper = new EntityWrapper<Subscribe>(subscribeVo);
Subscribe one = subscribeService.selectOne(wrapper);
if (one==null) {
subscribeVo.setStatus(0);
return subscribeVo;
}
return one;
}
@GetMapping("/save")
public Subscribe save(@RequestParam(name = "bizId") Long bizId, @RequestParam(name = "bizType") Integer bizType, @RequestParam("accountId") Long accountId, @RequestParam("siteId") Long siteId, @RequestParam("companyId") Long companyId) {
Date date = new Date();
Subscribe subscribeVo = new Subscribe();
subscribeVo.setSiteId(siteId);
subscribeVo.setCompanyId(companyId);
subscribeVo.setAccountId(accountId);
subscribeVo.setBizId(bizId);
subscribeVo.setBizType(bizType);
EntityWrapper<Subscribe> wrapper = new EntityWrapper<Subscribe>(subscribeVo);
Subscribe one = subscribeService.selectOne(wrapper);
if (one==null) {
one = new Subscribe();
one.setId(idGenerator.generate());
one.setBizId(bizId);
one.setBizType(bizType);
one.setCompanyId(companyId);
one.setSiteId(siteId);
one.setAccountId(accountId);
one.setCreateTime(date);
one.setStatus(1);
subscribeService.insert(one);
}else {
one.setUpdateById(accountId);
one.setUpdateTime(date);
one.setStatus(one.getStatus().equals(0)?1:0);
subscribeService.updateById(one);
}
return one;
}
@GetMapping("/getMyList")
public List<Long> getMyList(@RequestParam(name = "bizType") Integer bizType,@RequestParam("accountId") Long accountId,@RequestParam("siteId") Long siteId,@RequestParam("companyId") Long companyId){
List<Long> list = subscribeService.getMyList(bizType, accountId, siteId, companyId);
return list;
}
@GetMapping("getAllList")
public List<Subscribe> getAllList(){
List<Subscribe> list = subscribeMapper.getAllList();
return list;
}
@GetMapping("/getSubscribeNum")
public Integer getSubscribeNum(@RequestParam(name = "bizId") Long bizId,@RequestParam(name = "bizType") Integer bizType) {
Subscribe subscribeVo = new Subscribe();
subscribeVo.setBizId(bizId);
subscribeVo.setBizType(bizType);
subscribeVo.setStatus(1);
return subscribeService.selectCount(new EntityWrapper<Subscribe>(subscribeVo));
}
@PostMapping("/getMySubscribeNum")
public Integer getMySubscribeNum(@RequestBody RequestContext context) {
Integer num = 0;
List<Long> ids = subscribeMapper.getMyList(null, context.getAccountId(), context.getSiteId(), context.getCompanyId());
if (!CollectionUtils.isEmpty(ids)) {
//专辑数量
num = albumClient.getSubcribeNum(ids);
}
return num;
}
}
package com.yizhi.application.controller.student;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.application.domain.NewComment;
import com.yizhi.application.domain.NewReply;
import com.yizhi.application.service.ICommentService;
import com.yizhi.application.service.IReplyService;
import com.yizhi.comment.application.constans.Constant;
import com.yizhi.comment.application.vo.domain.NewCommentVo;
import com.yizhi.comment.application.vo.domain.NewReplyVo;
import com.yizhi.comment.application.feign.student.StudentCommentClient;
import com.yizhi.application.service.IInformRecordService;
import com.yizhi.comment.application.vo.CommentParam;
import com.yizhi.comment.application.vo.NewApiCommentVo;
import com.yizhi.comment.application.vo.PostsCommentVo;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* <p>
* 评论 前端控制器
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
@RestController
@RequestMapping("/student/comment")
public class StudentCommentController implements StudentCommentClient {
@Autowired
private ICommentService commentService;
@Autowired
private IReplyService replyService;
@Autowired
private IInformRecordService informRecordService;
/**
* 论坛 学员端获取分页的评论和分页的回复
*
* @param param
* @return
*/
@Override
@PostMapping("/getPage")
public Page<NewApiCommentVo> getPage(@RequestBody CommentParam param) {
return commentService.getPage(param);
}
/**
* 论坛 我收到的回复分页
*
* @param param
* @return
*/
@Override
@PostMapping("/myReceivedPage")
public Page<PostsCommentVo> myReceivedPage(@RequestBody CommentParam param) {
return commentService.myReceivedPage(param);
}
/**
* 论坛 我收到的回复分页--查看对话
*
* @param id 回复的id
* @return
*/
@Override
@GetMapping("/catCommunication")
public List<PostsCommentVo> catCommunication(@RequestParam("id") Long id) {
return replyService.catCommunication(id);
}
@Override
@PostMapping("/mySendPage")
public Page<PostsCommentVo> mySendPage(@RequestBody CommentParam param) {
return commentService.mySendPage(param);
}
/**
* 论坛 我的管理--回复管理--回复列表分页
*
* @param type
* @param postsId
* @param pageNo
* @param pageSize
* @return
*/
@Override
@GetMapping("/getPageByPostsId")
@ApiOperation(value = "我的管理--回复管理--回复列表", response = PostsCommentVo.class)
public Page<PostsCommentVo> getPageByPostsId(@ApiParam("type必传 ") @RequestParam("type") Integer type,
@ApiParam("帖子id ") @RequestParam("postsId") Long postsId,
@ApiParam("pageNo") @RequestParam("pageNo") Integer pageNo,
@ApiParam("pageSize ") @RequestParam("pageSize") Integer pageSize) {
return commentService.getPageByPostsId(type, postsId, pageNo, pageSize);
}
/**
* 论坛 评论(回复)--删除(下架) 包含子级回复
*
* @param id
* @param type 1:评论、2-回复
* operationType 1-下架 2-删除
* isInform 是否是举报
* @return
*/
@Override
@GetMapping("/down")
public Integer down(@RequestParam("id") Long id, @RequestParam("type") Integer type, @RequestParam("isInform") Boolean isInform) {
if (type == 1) {
if (commentService.down(1, id) > 0) {
if (isInform) {
informRecordService.cancelByCommentId(Constant.TASK_TYPE_POSTS, null, type, id);
}
NewComment newCommentVo = commentService.selectById(id);
commentService.updatePostsInfo(newCommentVo.getBizId(), newCommentVo.getBizType(), newCommentVo.getSiteId(), null, false, false);
return 1;
}
return 0;
} else {
if (replyService.down(1, id) > 0) {
if (isInform) {
informRecordService.cancelByCommentId(Constant.TASK_TYPE_POSTS, null, type, id);
}
NewReply newReplyVo = replyService.selectById(id);
commentService.updatePostsInfo(newReplyVo.getBizId(), newReplyVo.getBizType(), null, null, false, false);
return 1;
}
return 0;
}
}
@Override
@PostMapping("/save")
public Integer studentSave(@RequestBody NewCommentVo comment) {
return commentService.save(comment);
}
/**
* 论坛我的回复--获取我的回复(收到的回复未查看的数量)
* @param taskType
* @param taskIds
* @return
*/
@Override
@GetMapping("/myNum")
public Integer myNum(@RequestParam("taskType") Integer taskType,
@RequestParam(value = "taskId",required = false) List<Long> taskIds) {
return commentService.myNum(taskType,taskIds);
}
@Override
@ApiOperation(value = "获取单个评论详情,包含回复", response = PostsCommentVo.class)
@GetMapping("/getCommentDetails")
public NewApiCommentVo getCommentDetails(@ApiParam("taskType必传 ") @RequestParam("taskType") Integer taskType,
@ApiParam("业务id ") @RequestParam("taskId") Long taskId,
@ApiParam("评论id ") @RequestParam("commentId") Long commentId,
@ApiParam("作者id ") @RequestParam(value = "author",required = false) Long author,
@ApiParam("回复排序方式 ") @RequestParam("orderType") Integer orderType,
@ApiParam("回复的pageNo") @RequestParam("pageNo") Integer pageNo,
@ApiParam("回复的pageSize ") @RequestParam("pageSize") Integer pageSize) {
return commentService.getCommentDetails(taskType, taskId,commentId,author,orderType, pageNo, pageSize);
}
}
package com.yizhi.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author taoge123
* @since 2020-01-16
*/
@Data
@TableName("inform_record")
public class InformRecord {
private static final long serialVersionUID = 1L;
private Long id;
@TableField("task_type")
private Integer taskType;
@TableField("task_id")
private Long taskId;
@TableField("type")
private Integer type;
@TableField("comment_id")
private Long commentId;
private Integer status;
private Integer deleted;
private String description;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@TableField("company_id")
private Long companyId;
@TableField("site_id")
private Long siteId;
@TableField("org_id")
private Long orgId;
}
package com.yizhi.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.yizhi.comment.application.vo.TaskAppendixVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* <p>
* 评论
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
@Data
@TableName("new_comment")
public class NewComment {
private static final long serialVersionUID = 1L;
private Long id;
@TableField("biz_id")
private Long bizId;
@TableField("biz_name")
private String bizName;
@TableField("biz_type")
private Integer bizType;
private String content;
@TableField("is_read")
private Integer isRead;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.UPDATE)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.UPDATE)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.UPDATE)
private Date updateTime;
private Integer state;
@TableField("org_id")
private Long orgId;
@TableField("site_id")
private Long siteId;
@TableField("user_avatar")
private String userAvatar;
@TableField("company_id")
private Long companyId;
@TableField(exist = false)
private List<TaskAppendixVo> taskAppendixVos;
}
package com.yizhi.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 评论点赞记录表
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
@Data
@TableName("new_comment_admire")
public class NewCommentAdmire {
private static final long serialVersionUID = 1L;
private Long Id;
@TableField("account_id")
private Long accountId;
@TableField("comment_id")
private Long commentId;
@TableField("biz_type")
private Integer bizType;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
private Integer state;
}
package com.yizhi.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 回复
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
@Data
@TableName("new_reply")
public class NewReply {
private static final long serialVersionUID = 1L;
private Long id;
@TableField("biz_id")
private Long bizId;
@TableField("biz_name")
private String bizName;
@TableField("biz_type")
private Integer bizType;
@TableField("comment_id")
private Long commentId;
@TableField("commenter_id")
private Long commenterId;
@TableField("reply_parent_id")
private Long replyParentId;
private String content;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.UPDATE)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.UPDATE)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.UPDATE)
private Date updateTime;
private Integer state;
@TableField("user_avatar")
private String userAvatar;
@TableField("commenter_name")
private String commenterName;
@TableField("is_read")
private Integer isRead;
@TableField(exist = false)
private Boolean isAuthor = false;
@TableField(exist = false)
private Boolean isSelf = false;
@TableField(exist = false)
private Boolean hasForbidden = false;
}
package com.yizhi.application.domain;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@TableName("pdf_pages")
public class PdfPages extends Model<PdfPages>{
private static final long serialVersionUID = 1L;
private Long id;
@TableField("pdf_page")
private Integer pdfPage;
@TableField("biz_id")
private Long bizId;
@TableField("biz_type")
private Integer bizType;
@TableField("image_url")
private String imageUrl;
@Override
protected Serializable pkVal() {
return this.id;
}
}
package com.yizhi.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 订阅
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
@Data
@TableName("subscribe")
public class Subscribe {
private static final long serialVersionUID = 1L;
private Long id;
@TableField("biz_type")
private Integer bizType;
@TableField("biz_id")
private Long bizId;
private Integer status;
@TableField("site_id")
private Long siteId;
@TableField("account_id")
private Long accountId;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.UPDATE)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.UPDATE)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.UPDATE)
private Date updateTime;
@TableField("company_id")
private Long companyId;
}
package com.yizhi.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author taoge123
* @since 2020-01-16
*/
@Data
@TableName("task_appendix")
public class TaskAppendix {
private static final long serialVersionUID = 1L;
private Long id;
@TableField("task_type")
private Integer taskType;
@TableField("task_id")
private Long taskId;
private String name;
@TableField("file_size")
private Double fileSize;
@TableField("file_suffer")
private String fileSuffer;
private String url;
@TableField("file_type")
private Integer fileType;
@TableLogic
private Integer deleted;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
}
package com.yizhi.application.mapper;
import com.yizhi.application.domain.NewCommentAdmire;
import com.yizhi.comment.application.vo.domain.NewCommentAdmireVo;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* 评论点赞记录表 Mapper 接口
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
public interface CommentAdmireMapper extends BaseMapper<NewCommentAdmire> {
}
package com.yizhi.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yizhi.application.domain.NewComment;
import com.yizhi.comment.application.vo.domain.NewCommentVo;
import com.yizhi.comment.application.vo.CommentVo;
import com.yizhi.comment.application.vo.ManageCommentVo;
import com.yizhi.comment.application.vo.NewApiCommentVo;
import com.yizhi.comment.application.vo.PostsCommentVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import java.util.List;
/**
* <p>
* 评论 Mapper 接口
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
public interface CommentMapper extends BaseMapper<NewComment> {
List<CommentVo> getCommentPage(@Param("bizId") Long bizId, @Param("bizType") Integer bizType, RowBounds rowBounds);
Integer getCommentPageCount(@Param("bizId") Long bizId, @Param("bizType") Integer bizType);
List<CommentVo> getCommentList(@Param("bizId") Long bizId, @Param("bizType") Integer bizType);
List<NewApiCommentVo> apiCommentPage(@Param("bizId") Long bizId, @Param("bizType") Integer bizType, @Param("accountId") Long accountId, RowBounds rowBounds);
Integer apiCommentPageCount(@Param("bizId") Long courseId, @Param("bizType") Integer bizType, @Param("accountId") Long accountId);
List<com.yizhi.application.domain.NewComment> getallComments();
/**
* 帖子 我收到的回复
*
* @param type 业务类型
* @param keyWord 业务关键词
* @param postsIds 帖子ids
* @param accountId
* @param rowBounds
* @return
*/
List<PostsCommentVo> myReceivedPage(@Param("type") Integer type,
@Param("keyWord") String keyWord,
@Param("postsIds") List<Long> postsIds,
@Param("keyWordPostsIds") List<Long> keyWordPostsIds,
@Param("accountId") Long accountId,
RowBounds rowBounds);
Integer myReceivedPageNum(@Param("type") Integer type,
@Param("keyWord") String keyWord,
@Param("postsIds") List<Long> postsIds,
@Param("keyWordPostsIds") List<Long> keyWordPostsIds,
@Param("accountId") Long accountId);
/**
* 帖子 我发出的回复
*
* @param type 业务类型
* @param keyWord 业务关键词
* @param keyWordPostsIds 帖子ids
* @param accountId
* @param rowBounds
* @return
*/
List<PostsCommentVo> mySendPage(@Param("type") Integer type,
@Param("keyWord") String keyWord,
@Param("keyWordPostsIds") List<Long> keyWordPostsIds,
@Param("accountId") Long accountId,
RowBounds rowBounds);
Integer mySendPageNum(@Param("type") Integer type,
@Param("keyWord") String keyWord,
@Param("keyWordPostsIds") List<Long> keyWordPostsIds,
@Param("accountId") Long accountId);
/**
* 我的管理--回复管理
*
* @param type
* @param postsId
* @param rowBounds
* @return
*/
List <PostsCommentVo> getPageByPostsId(@Param("type") Integer type, @Param("postsId") Long postsId, RowBounds rowBounds);
Integer getPageByPostsIdNum(@Param("type") Integer type, @Param("postsId") Long postsId);
/**
* 论坛管理端-单个帖子的回复列表
*
* @param type
* @param postsId
* @param rowBounds
* @return
*/
List<ManageCommentVo> getPageToManage(@Param("type") Integer type, @Param("postsId") Long postsId, RowBounds rowBounds);
Integer getPageToManageNum(@Param("type") Integer type, @Param("postsId") Long postsId);
}
<?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="com.yizhi.application.mapper.InformRecordMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.yizhi.application.domain.InformRecord">
<id column="id" property="id" />
<result column="task_type" property="taskType" />
<result column="task_id" property="taskId" />
<result column="status" property="status" />
<result column="type" property="type" />
<result column="comment_id" property="commentId" />
<result column="deleted" property="deleted" />
<result column="description" property="description" />
<result column="create_by_id" property="createById" />
<result column="create_by_name" property="createByName" />
<result column="create_time" property="createTime" />
<result column="update_by_id" property="updateById" />
<result column="update_by_name" property="updateByName" />
<result column="update_time" property="updateTime" />
<result column="company_id" property="companyId" />
<result column="site_id" property="siteId" />
<result column="org_id" property="orgId" />
</resultMap>
</mapper>
package com.yizhi.application.mapper;
import com.yizhi.application.domain.InformRecord;
import com.yizhi.comment.application.vo.domain.InformRecordVo;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author taoge123
* @since 2020-01-16
*/
public interface InformRecordMapper extends BaseMapper<InformRecord> {
}
package com.yizhi.application.mapper;
import java.util.List;
import com.yizhi.application.domain.PdfPages;
import com.yizhi.comment.application.vo.domain.PdfPagesVo;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
public interface PdfPagesMapper extends BaseMapper<PdfPages>{
void deleteByBizId(@Param(value = "bizId") Long bizId,@Param(value = "bizType") Integer bizType);
List<PdfPages> getPages(@Param(value = "bizId") Long bizId, @Param(value = "bizType") Integer bizType);
}
<?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="com.yizhi.application.mapper.PdfPagesMapper">
<delete id="deleteByBizId">
DELETE FROM pdf_pages WHERE biz_id =#{bizId} and biz_type=#{bizType}
</delete>
<select id="getPages" resultType="com.yizhi.application.domain.PdfPages">
SELECT
*
FROM
pdf_pages pg
WHERE
pg.biz_id =#{bizId} and pg.biz_type=#{bizType}
ORDER BY pg.pdf_page ASC
</select>
</mapper>
package com.yizhi.application.mapper;
import com.yizhi.application.domain.NewReply;
import com.yizhi.comment.application.vo.domain.NewReplyVo;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* 回复 Mapper 接口
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
public interface ReplyMapper extends BaseMapper<NewReply> {
List<NewReply> getCommentPage(@Param("commentId")Long commentId, RowBounds rowBounds);
Integer getCommentPageCount(@Param("commentId") Long commentId);
List<NewReply> list(@Param("bizId") Long bizId);
}
<?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="com.yizhi.application.mapper.ReplyMapper">
<select id="getCommentPage" resultType="com.yizhi.application.domain.NewReply">
SELECT
*
FROM
`new_reply` c
WHERE
c.comment_id = #{commentId}
AND c.`state` != 0
GROUP BY
c.id
ORDER BY c.`create_time`
</select>
<select id="getCommentPageCount" resultType="java.lang.Integer">
SELECT
count(c.`id`)
FROM
`new_reply` c
WHERE
c.comment_id = #{commentId} AND
c.`state` != 0
ORDER BY c.`create_time` DESC
</select>
<select id="list" resultType="com.yizhi.application.domain.NewReply">
SELECT
*
FROM
new_reply r
WHERE
r.biz_id = #{bizId} and r.state=1 ORDER BY r.create_time desc
</select>
</mapper>
package com.yizhi.application.mapper;
import com.yizhi.application.domain.Subscribe;
import com.yizhi.comment.application.vo.domain.SubscribeVo;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* 订阅 Mapper 接口
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
public interface SubscribeMapper extends BaseMapper<Subscribe> {
public List<Long> getMyList(@Param(value = "bizType")Integer bizType,@Param(value = "accountId") Long accountId,@Param(value = "siteId") Long siteId,@Param(value = "companyId") Long companyId);
public List<Subscribe> getAllList();
}
<?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="com.yizhi.application.mapper.SubscribeMapper">
<select id="getMyList" resultType="java.lang.Long">
SELECT
s.biz_id
FROM
subscribe s
WHERE
s.account_id = #{accountId}
<if test="bizType!=null">
AND s.biz_type = #{bizType}
</if>
AND s.site_id = #{siteId}
AND s.company_id = #{companyId}
AND s.`status` = 1
</select>
<select id="getAllList" resultType="com.yizhi.application.domain.Subscribe">
select id,biz_type,biz_id,account_id,create_time from subscribe where status = 1
</select>
</mapper>
<?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="com.yizhi.application.mapper.TaskAppendixMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.yizhi.application.domain.TaskAppendix">
<id column="id" property="id" />
<result column="task_type" property="taskType" />
<result column="task_id" property="taskId" />
<result column="name" property="name" />
<result column="file_size" property="fileSize" />
<result column="file_suffer" property="fileSuffer" />
<result column="url" property="url" />
<result column="file_type" property="fileType" />
<result column="deleted" property="deleted" />
<result column="create_by_id" property="createById" />
<result column="create_by_name" property="createByName" />
<result column="create_time" property="createTime" />
<result column="update_by_id" property="updateById" />
<result column="update_by_name" property="updateByName" />
<result column="update_time" property="updateTime" />
</resultMap>
</mapper>
package com.yizhi.application.mapper;
import com.yizhi.application.domain.TaskAppendix;
import com.yizhi.comment.application.vo.domain.TaskAppendixVo;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author taoge123
* @since 2020-01-16
*/
public interface TaskAppendixMapper extends BaseMapper<TaskAppendix> {
}
package com.yizhi.application.service;
import com.yizhi.application.domain.NewCommentAdmire;
import com.yizhi.comment.application.vo.domain.NewCommentAdmireVo;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.comment.application.vo.AdmireVO;
import com.yizhi.comment.application.vo.StatisticsForumAccountVo;
import java.util.List;
import java.util.Map;
/**
* <p>
* 评论点赞记录表 服务类
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
public interface ICommentAdmireService extends IService<NewCommentAdmire> {
/**
* 获取《评论id,点赞vo》
* @param type
* @param commentIds
* @return
*/
public Map<Long, AdmireVO> getCountsByCommentId(Integer type, List<Long> commentIds,Boolean isExport);
/**
* 获取 《用户id,点赞数》
* @param bizType
* @param map
* @return
*/
Map<Long, StatisticsForumAccountVo> getPersonalDataMap(Integer bizType, Map<Long, StatisticsForumAccountVo> map);
/**
* 获取《业务id,点赞数》
* @param type
* @param
* @return
*/
public Map<Long, Integer> getCountsMap(Integer type);
}
package com.yizhi.application.service;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.application.domain.NewComment;
import com.yizhi.comment.application.vo.*;
import com.yizhi.comment.application.vo.domain.NewCommentVo;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* <p>
* 评论 服务类
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
public interface ICommentService extends IService<NewComment> {
Page<com.yizhi.comment.application.vo.CommentVo> getCommentPage(Long bizId, Integer bizType, int pageNo, int pageSize);
List<CommentVo> getCommentList(Long bizId, Integer bizType);
Page<NewApiCommentVo> apiCommentPage(Long bizId, Integer bizType, Long accountId, int pageNo, int pageSize);
Page<NewApiCommentVo> getPage(CommentParam param);
/**
* 论坛 收到的回复
* @param param
* @return
*/
Page<PostsCommentVo> myReceivedPage(CommentParam param);
/**
* 获取评论id,评论的map
* @param ids
* @return
*/
Map<Long, NewCommentVo> getMap(List<Long> ids);
/**
* 论坛 发送的回复
* @param param
* @return
*/
Page<PostsCommentVo> mySendPage(CommentParam param);
Page<PostsCommentVo> getPageByPostsId(Integer type, Long postsId, Integer pageNo, Integer pageSize);
/**
* 论坛-评论删除或下架
* @param operationType 1-下架 2-删除
* @param id
* @return
*/
Integer down(Integer operationType,Long id);
Page<ManageCommentVo> getPageToManage(Integer type, Long postsId, Integer pageNo, Integer pageSize);
public void updatePostsInfo(Long bizId, Integer bizType, Long siteId,Date date, Boolean save,Boolean isManage);
Map<Long, StatisticsForumAccountVo> getPersonalDataMap(Integer bizType);
Integer save(NewCommentVo comment);
/**
* 更新评论回复的已读状态 论坛需要
* @param taskType
* @param taskId
* @return
*/
Integer updateIsReadField(Integer taskType,List<Long> taskId);
Integer myNum(Integer taskType, List<Long> taskIds);
NewApiCommentVo getCommentDetails(Integer taskType, Long taskId, Long commentId, Long author, Integer orderType, Integer pageNo, Integer pageSize);
}
package com.yizhi.application.service;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.application.domain.InformRecord;
import com.yizhi.comment.application.vo.domain.InformRecordVo;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.comment.application.vo.StatisticsForumAccountVo;
import java.util.Map;
/**
* <p>
* 服务类
* </p>
*
* @author taoge123
* @since 2020-01-16
*/
public interface IInformRecordService extends IService<InformRecord> {
Integer save(com.yizhi.comment.application.vo.InformRecordVo informRecordVo);
Page<com.yizhi.comment.application.vo.InformRecordVo> getPage(Integer taskType, Long taskId, Integer type, Integer terminalType, Integer pageNo, Integer pageSize);
Integer cancel(Long id);
Integer cancelByCommentId(Integer taskType,Long taskId,Integer type,Long commentId);
/**
* 获取《用户id,举报数》
* @param bizType
* @param map
* @return
*/
Map<Long, StatisticsForumAccountVo> getPersonalDataMap(Integer bizType, Map<Long, StatisticsForumAccountVo> map);
// /**
// * 获取《业务id,举报数》
// * @param type
// * @param
// * @return
// */
// public Map<Long, Integer> getCountsMap(Integer type);
}
package com.yizhi.application.service;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.application.domain.PdfPages;
import com.yizhi.comment.application.vo.domain.PdfPagesVo;
public interface IPdfPagesService extends IService<PdfPages> {
}
package com.yizhi.application.service;
import com.yizhi.application.domain.NewReply;
import com.yizhi.comment.application.vo.domain.NewReplyVo;
import com.yizhi.comment.application.vo.CommentParam;
import com.yizhi.comment.application.vo.CommentVo;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.comment.application.vo.PostsCommentVo;
import com.yizhi.comment.application.vo.StatisticsForumAccountVo;
/**
* <p>
* 回复 服务类
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
public interface IReplyService extends IService<NewReply> {
Page<CommentVo> getCommentPage(Long commentId, int pageNo, int pageSize);
List<NewReply> list(Long bizId);
/**
* 获取《评论id,回复数》
* @param commentId
* @return
*/
public Map<Long,Integer> getCountsByCommentId(List<Long> commentId);
/**
* 分页获取回复
* @param commentId
* @return
*/
Page<NewReplyVo> getPage(Long commentId, CommentParam param);
/**
* 获取《评论id,回复》目前是传楼主id
*
* @return
*/
public Map<Long, List<NewReplyVo>> getMapByAccountId(Integer taskType, Long taskId, Long author);
/**
* 获取回复id,回复的map
* @param ids
* @return
*/
Map<Long, NewReplyVo> getMap(List<Long> ids);
List<PostsCommentVo> catCommunication(Long id);
/**
* 论坛-评论删除或下架
* @param operationType 1-下架 2-删除
* @param id
* @return
*/
Integer down(Integer operationType,Long id);
/**
* 获取《用户id,回复数》
* @param bizType
* @param map
* @return
*/
Map<Long, StatisticsForumAccountVo> getPersonalDataMap(Integer bizType, Map<Long, StatisticsForumAccountVo> map);
}
package com.yizhi.application.service;
import com.yizhi.application.domain.Subscribe;
import com.yizhi.comment.application.vo.domain.SubscribeVo;
import java.util.List;
import com.baomidou.mybatisplus.service.IService;
/**
* <p>
* 订阅 服务类
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
public interface ISubscribeService extends IService<Subscribe> {
public List<Long> getMyList(Integer bizType,Long accountId,Long siteId,Long companyId);
}
package com.yizhi.application.service;
import com.yizhi.application.domain.TaskAppendix;
import com.yizhi.comment.application.vo.domain.TaskAppendixVo;
import com.baomidou.mybatisplus.service.IService;
import java.util.List;
import java.util.Map;
/**
* <p>
* 服务类
* </p>
*
* @author taoge123
* @since 2020-01-16
*/
public interface ITaskAppendixService extends IService<TaskAppendix> {
public Integer save(Integer taskType, Long taskId, List<com.yizhi.comment.application.vo.TaskAppendixVo> taskAppendixVoVos);
public List<com.yizhi.comment.application.vo.TaskAppendixVo> getList(Integer taskType, Long taskId);
public Map<Long,List<com.yizhi.comment.application.vo.TaskAppendixVo>> getListMap(Integer taskType, List<Long> taskIds);
}
package com.yizhi.application.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.yizhi.application.domain.NewCommentAdmire;
import com.yizhi.application.mapper.CommentAdmireMapper;
import com.yizhi.application.service.ICommentAdmireService;
import com.yizhi.comment.application.constans.Constant;
import com.yizhi.comment.application.vo.domain.NewCommentAdmireVo;
import com.yizhi.core.application.context.ContextHolder;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.comment.application.vo.AdmireVO;
import com.yizhi.comment.application.vo.StatisticsForumAccountVo;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* <p>
* 评论点赞记录表 服务实现类
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
@Service
public class CommentAdmireServiceImpl extends ServiceImpl<CommentAdmireMapper, NewCommentAdmire> implements ICommentAdmireService {
@Override
public Map<Long, AdmireVO> getCountsByCommentId(Integer type, List<Long> commentIds,Boolean isExport) {
Map<Long, AdmireVO> commentAdmireMap = null;
Long accountId = 0L;
if (!CollectionUtils.isEmpty(commentIds)) {
if (!isExport){
accountId = ContextHolder.get().getAccountId();
}
NewCommentAdmireVo commentAdmire = new NewCommentAdmireVo();
commentAdmire.setState(Constant.UP);
commentAdmire.setBizType(type);
EntityWrapper<NewCommentAdmire> wrapper = new EntityWrapper(commentAdmire);
wrapper.in("comment_id", commentIds);
List<NewCommentAdmire> newCommentAdmireVos = this.selectList(wrapper);
if (!CollectionUtils.isEmpty(newCommentAdmireVos)) {
commentAdmireMap = new HashMap<>(newCommentAdmireVos.size());
for (NewCommentAdmire a : newCommentAdmireVos) {
if (commentAdmireMap.containsKey(a.getCommentId())) {
AdmireVO vo = commentAdmireMap.get(a.getCommentId());
if (vo != null) {
Integer admireNums = vo.getAdmireNums();
vo.setAdmireNums(admireNums + 1);
vo.setHasAdmire(accountId.equals(a.getAccountId()));
commentAdmireMap.put(a.getCommentId(), vo);
}
} else {
AdmireVO vo = new AdmireVO();
vo.setAdmireNums(1);
vo.setHasAdmire(accountId.equals(a.getAccountId()));
commentAdmireMap.put(a.getCommentId(), vo);
}
}
}
}
return commentAdmireMap;
}
@Override
public Map<Long, StatisticsForumAccountVo> getPersonalDataMap(Integer bizType, Map<Long, StatisticsForumAccountVo> map) {
NewCommentAdmireVo commentAdmire = new NewCommentAdmireVo();
commentAdmire.setState(Constant.UP);
commentAdmire.setBizType(bizType);
EntityWrapper<NewCommentAdmire> wrapper = new EntityWrapper(commentAdmire);
List<NewCommentAdmire> newCommentAdmireVos = this.selectList(wrapper);
if (!CollectionUtils.isEmpty(newCommentAdmireVos)) {
for (NewCommentAdmire a : newCommentAdmireVos) {
if (map.containsKey(a.getAccountId())) {
StatisticsForumAccountVo vo = map.get(a.getAccountId());
if (vo != null) {
Integer admireNums = vo.getAdmireNum();
admireNums = admireNums == null ? 0 : admireNums;
vo.setAdmireNum(admireNums + 1);
map.put(a.getAccountId(), vo);
}
} else {
StatisticsForumAccountVo vo = new StatisticsForumAccountVo();
vo.setAdmireNum(1);
map.put(a.getAccountId(), vo);
}
}
}
return map;
}
@Override
public Map<Long, Integer> getCountsMap(Integer type) {
Map<Long, Integer> commentAdmireMap = null;
NewCommentAdmireVo commentAdmire = new NewCommentAdmireVo();
commentAdmire.setState(Constant.NOT_DELETED);
commentAdmire.setBizType(type);
EntityWrapper<NewCommentAdmire> wrapper = new EntityWrapper(commentAdmire);
List<NewCommentAdmire> newCommentAdmireVos = this.selectList(wrapper);
if (!CollectionUtils.isEmpty(newCommentAdmireVos)) {
for (NewCommentAdmire a : newCommentAdmireVos) {
if (commentAdmireMap.containsKey(a.getCommentId())) {
Integer num = commentAdmireMap.get(a.getCommentId());
commentAdmireMap.put(a.getCommentId(), num + 1);
} else {
commentAdmireMap.put(a.getCommentId(), 1);
}
}
}
return commentAdmireMap;
}
}
package com.yizhi.application.service.impl;
import com.yizhi.application.domain.PdfPages;
import com.yizhi.application.mapper.PdfPagesMapper;
import com.yizhi.comment.application.vo.domain.PdfPagesVo;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.application.service.IPdfPagesService;
@Service
public class PdfPagesServiceImpl extends ServiceImpl<PdfPagesMapper, PdfPages> implements IPdfPagesService{
}
package com.yizhi.application.service.impl;
import com.yizhi.application.domain.Subscribe;
import com.yizhi.application.mapper.SubscribeMapper;
import com.yizhi.comment.application.vo.domain.SubscribeVo;
import com.yizhi.application.service.ISubscribeService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import java.util.List;
import org.springframework.stereotype.Service;
/**
* <p>
* 订阅 服务实现类
* </p>
*
* @author yizhi123
* @since 2019-12-30
*/
@Service
public class SubscribeServiceImpl extends ServiceImpl<SubscribeMapper, Subscribe> implements ISubscribeService {
@Override
public List<Long> getMyList(Integer bizType, Long accountId, Long siteId, Long companyId) {
// TODO Auto-generated method stub
return this.baseMapper.getMyList(bizType, accountId, siteId, companyId);
}
}
package com.yizhi.application.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.application.domain.TaskAppendix;
import com.yizhi.message.application.constans.Constans;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.application.mapper.TaskAppendixMapper;
import com.yizhi.comment.application.vo.domain.TaskAppendixVo;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.application.service.ITaskAppendixService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.*;
/**
* <p>
* 服务实现类
* </p>
*
* @author taoge123
* @since 2020-01-16
*/
@Service
public class TaskAppendixServiceImpl extends ServiceImpl<TaskAppendixMapper, TaskAppendix> implements ITaskAppendixService {
@Autowired
private IdGenerator idGenerator;
@Override
public Integer save(Integer taskType, Long taskId, List<com.yizhi.comment.application.vo.TaskAppendixVo> taskAppendixVoVos) {
if (CollectionUtils.isEmpty(taskAppendixVoVos)) {
return 0;
}
RequestContext context = ContextHolder.get();
List<TaskAppendix> informAppendices = new ArrayList<>(taskAppendixVoVos.size());
taskAppendixVoVos.forEach(a -> {
TaskAppendix taskAppendixVo = new TaskAppendix();
BeanUtils.copyProperties(a, taskAppendixVo);
taskAppendixVo.setId(idGenerator.generate());
taskAppendixVo.setTaskType(taskType);
taskAppendixVo.setTaskId(taskId);
taskAppendixVo.setCreateById(context.getAccountId());
taskAppendixVo.setCreateByName(context.getAccountName());
taskAppendixVo.setCreateTime(new Date());
informAppendices.add(taskAppendixVo);
});
return this.insertBatch(informAppendices) == true ? 1 : 0;
}
@Override
public List<com.yizhi.comment.application.vo.TaskAppendixVo> getList(Integer taskType, Long taskId) {
TaskAppendix taskAppendixVo = new TaskAppendix();
taskAppendixVo.setTaskType(taskType);
taskAppendixVo.setDeleted(Constans.NOT_DELETED);
taskAppendixVo.setTaskId(taskId);
EntityWrapper<TaskAppendix> wrapper = new EntityWrapper(taskAppendixVo);
List<TaskAppendix> informAppendices = this.selectList(wrapper);
List<com.yizhi.comment.application.vo.TaskAppendixVo> taskAppendixVoVos = null;
if (!CollectionUtils.isEmpty(informAppendices)) {
taskAppendixVoVos = new ArrayList<>(informAppendices.size());
for (TaskAppendix a : informAppendices) {
com.yizhi.comment.application.vo.TaskAppendixVo vo = new com.yizhi.comment.application.vo.TaskAppendixVo();
BeanUtils.copyProperties(a, vo);
taskAppendixVoVos.add(vo);
}
}
return taskAppendixVoVos;
}
@Override
public Map<Long, List<com.yizhi.comment.application.vo.TaskAppendixVo>> getListMap(Integer taskType, List<Long> taskIds) {
Map<Long, List<com.yizhi.comment.application.vo.TaskAppendixVo>> map = null;
if (!CollectionUtils.isEmpty(taskIds)) {
map = new HashMap<>(taskIds.size());
TaskAppendix taskAppendixVo = new TaskAppendix();
taskAppendixVo.setTaskType(taskType);
taskAppendixVo.setDeleted(Constans.NOT_DELETED);
EntityWrapper<TaskAppendix> wrapper = new EntityWrapper(taskAppendixVo);
wrapper.in("task_id", taskIds);
List<TaskAppendix> informAppendices = this.selectList(wrapper);
if (!CollectionUtils.isEmpty(informAppendices)) {
for (TaskAppendix a : informAppendices) {
com.yizhi.comment.application.vo.TaskAppendixVo vo = new com.yizhi.comment.application.vo.TaskAppendixVo();
BeanUtils.copyProperties(a, vo);
if (map.containsKey(a.getTaskId())) {
List<com.yizhi.comment.application.vo.TaskAppendixVo> taskAppendixVoVos = map.get(a.getTaskId());
taskAppendixVoVos.add(vo);
map.put(a.getTaskId(), taskAppendixVoVos);
} else {
List<com.yizhi.comment.application.vo.TaskAppendixVo> taskAppendixVoVos = new ArrayList<>(informAppendices.size());
taskAppendixVoVos.add(vo);
map.put(a.getTaskId(), taskAppendixVoVos);
}
}
}
}
return map;
}
}
package com.yizhi.application.task;
import java.io.File;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.yizhi.application.domain.NewReply;
import com.yizhi.application.service.ICommentService;
import com.yizhi.application.service.IReplyService;
import com.yizhi.comment.application.vo.domain.NewReplyVo;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFFont;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.yizhi.core.application.context.TaskContext;
import com.yizhi.core.application.file.constant.FileConstant;
import com.yizhi.core.application.file.task.AbstractDefaultTask;
import com.yizhi.core.application.file.util.OssUpload;
import com.yizhi.system.application.system.remote.AccountClient;
import com.yizhi.system.application.vo.AccountVO;
import com.yizhi.comment.application.vo.CommentVo;
@Component
public class CommentListExportAsync extends AbstractDefaultTask<String, Map<String,Object>>{
private static final Logger logger = LoggerFactory.getLogger(CommentListExportAsync.class);
@Autowired
private ICommentService commentService;
@Autowired
private IReplyService replyService;
@Autowired
private AccountClient accountClient;
@Override
protected String execute(Map<String, Object> arg0) {
Long accountId=(Long) arg0.get("accountId");
Long siteId=(Long) arg0.get("siteId");
Long companyId=(Long) arg0.get("companyId");
Long taskId=(Long) arg0.get("taskId");
Date submitTime=(Date) arg0.get("submitTime");
String serialNo=(String) arg0.get("serialNo");
String taskName=(String) arg0.get("taskName");
Long bizId=(Long) arg0.get("bizId");
Integer bizType = (Integer) arg0.get("bizType");
String bizName=(String) arg0.get("bizName");
/**
* 走异步任务
*/
TaskContext taskContext = new TaskContext(taskId, serialNo, taskName, accountId, submitTime, siteId, companyId);
working(taskContext);
String upLoadUrl=null;
String requestPath=FileConstant.SAVE_PATH;
File fileDir=new File(requestPath);
if(!fileDir.exists()) {
fileDir.mkdir();
}
List<CommentVo> listVO=new ArrayList<CommentVo>();
List<CommentVo> list = null;
list = commentService.getCommentList(bizId,bizType);
NewReply reply = new NewReply();
CommentVo vo = new CommentVo();
for(CommentVo commentVo:list) {
AccountVO accountVO = accountClient.findById(commentVo.getAccountId());
commentVo.setCommentatorName(null==accountVO.getFullName()||""==accountVO.getFullName()?accountVO.getName():accountVO.getFullName());
commentVo.setReplyName(bizName);
commentVo.setCommentator(accountVO.getName());
reply.setCommentId(commentVo.getId());
EntityWrapper<NewReply> wrapper = new EntityWrapper<NewReply>(reply);
wrapper.notIn("state", 0);
List<String> time = new ArrayList<String>();
time.add("createTime");
wrapper.orderDesc(time);
List<NewReply> replyList = replyService.selectList(wrapper);
listVO.add(commentVo);
for(NewReply r:replyList) {
CommentVo vo1 = new CommentVo();
if (null!=r.getReplyParentId()&&0!=r.getReplyParentId()) {
Long accountId1 = replyService.selectById(r.getReplyParentId()).getCreateById();
AccountVO findById = accountClient.findById(accountId1);
vo1.setReplyName(null==findById.getFullName()||""==findById.getFullName()?findById.getName():findById.getFullName());
}else {
AccountVO findById = accountClient.findById(commentService.selectById(r.getCommentId()).getCreateById());
vo1.setReplyName(null==findById.getFullName()||""==findById.getFullName()?findById.getName():findById.getFullName());
}
logger.info("-----");
AccountVO findById = accountClient.findById(r.getCreateById());
vo1.setId(r.getId());
vo1.setAccountId(findById.getId());
vo1.setCommentator(findById.getName());
vo1.setCommentatorName(null==findById.getFullName()||""==findById.getFullName()?findById.getName():findById.getFullName());
vo1.setContent(r.getContent());
vo1.setCreateTime(r.getCreateTime());
vo1.setState(reply.getState());
vo1.setThumbsUp(0);
listVO.add(vo1);
}
}
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss");
try {
//excel生成过程: excel-->sheet-->row-->cell
// 第一步,创建一个Excel文件
XSSFWorkbook wb = new XSSFWorkbook();
// 第二步,在webbook中添加一个sheet,对应Excel文件中的sheet
XSSFSheet sheet = wb.createSheet("评论信息");
XSSFFont font = wb.createFont();
font.setFontName("宋体");
font.setFontHeightInPoints((short) 11);
font.setBold(true);
XSSFCellStyle style = wb.createCellStyle();
style.setFont(font);
style.setAlignment(HorizontalAlignment.CENTER); // 创建一个居中格式
style.setVerticalAlignment(VerticalAlignment.CENTER);
// 第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制short
XSSFRow row = sheet.createRow((int) 0);
row.setHeight((short) (20*20));
// 合并单元格
CellRangeAddress cra=new CellRangeAddress(0,0,0,7); // 起始行, 终止行, 起始列, 终止列
sheet.addMergedRegion(cra);
XSSFCell cell = row.createCell((short) 0);
cell.setCellValue(bizName+"评论信息 "+sf.format(submitTime));
cell.setCellStyle(style);
// 第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制short
XSSFRow row2 = sheet.createRow((int) 1);
row2.setRowStyle(style);
row2.setHeight((short) (14*20));
// 第四步,创建单元格
row2.createCell((short) 0).setCellValue("评论人/回复人");
row2.createCell((short) 1).setCellValue("姓名");
row2.createCell((short) 2).setCellValue("评论对象");
row2.createCell((short) 3).setCellValue("评论内容");
row2.createCell((short) 4).setCellValue("提交时间");
row2.createCell((short) 5).setCellValue("点赞数");
row2.createCell((short) 6).setCellValue("状态");
for(int i=0;i<listVO.size();i++) {
font.setBold(false);
row = sheet.createRow(i + 2);
row.setRowStyle(style);
row.setHeight((short) (13*20));
// 第四步,创建单元格,并设置值
vo=listVO.get(i);
if(vo!=null&&vo.getCommentator()!=null) {
row.createCell((short) 0).setCellValue(vo.getCommentator());
}
if(vo!=null&&vo.getCommentatorName()!=null) {
row.createCell((short) 1).setCellValue(null==vo.getCommentatorName()?"":vo.getCommentatorName());
}
if(vo!=null&&vo.getReplyName()!=null) {
row.createCell((short) 2).setCellValue(null==vo.getReplyName()?"":vo.getReplyName());
}
if(vo!=null&&vo.getContent()!=null) {
row.createCell((short) 3).setCellValue(vo.getContent());
}
if(vo!=null&&vo.getCreateTime()!=null) {
row.createCell((short) 4).setCellValue(df.format(vo.getCreateTime()));
}
if (vo!=null&&vo.getThumbsUp()!=null) {
row.createCell((short) 5).setCellValue(null==vo.getThumbsUp()?"--":vo.getThumbsUp().toString());
}
if (vo!=null&&vo.getState()!=null) {
row.createCell((short) 6).setCellValue(1==vo.getState()?"已上架":"已下架");
}
}
// 第五步,写入实体数据 实际应用中这些数据从数据库得到,
StringBuffer fileNameSb = new StringBuffer().append(bizName+"评论记录").append(sf.format(submitTime)).append(".xlsx");
String fileName = fileNameSb.toString();
String path = new StringBuffer().append(requestPath).append(fileNameSb).toString();
FileOutputStream os=null;
File file=null;
try {
os= new FileOutputStream(path);
wb.write(os);
//阿里云返回url
upLoadUrl = OssUpload.upload(path, fileName);
file=new File(path);
success(taskContext,"成功", upLoadUrl);
} catch (Exception e1) {
e1.printStackTrace();
fail(taskContext, "写入数据到Excel的过程中或者上传到阿里云中发生错误"+e1.getMessage());
logger.error("写入数据到Excel的过程中或者上传到阿里云中发生错误"+e1.getMessage());
}
finally {
if(os!=null) {
os.close();
}
if(wb!=null) {
wb.close();
}
if(file!=null) {
file.delete();
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
fail(taskContext, "评论信息导出过程中发生错误,请查看日志"+e.getMessage());
logger.error("评论信息导出过程中发生错误,请查看日志"+e.getMessage());
}
return upLoadUrl;
}
}
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment