Commit 79f709cc by liangkaiping

copy

parent 2f66db8f
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
### VS Code ###
.vscode/
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.yizhi</groupId>
<artifactId>cloud-forum</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>com.yizhi</groupId>
<artifactId>cloud-forum-api</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<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-util</artifactId>
<version>1.0-SNAPSHOT</version>
<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>
</plugins>
</build>
</project>
package com.yizhi.forum.application.constans;
public enum DocumentType {
DOCUMENT(1,"文档"),
PICTURE(2,"图片"),
AUDIO(3,"音频"),
VIDEO(4,"视频"),
OTHER(5,"其他");
private Integer type;
private String typeName;
DocumentType(Integer type, String typeName) {
this.type = type;
this.typeName = typeName;
}
public Integer getType() {
return type;
}
public String getTypeName() {
return typeName;
}
}
package com.yizhi.forum.application.constans;
import java.util.Date;
public interface ForumConstans {
/**
* 删除
*/
public static final Integer DELETED = 1;
/**
* 未删除
*/
public static final Integer NOT_DELETED = 0;
/**
* 草稿
*/
public static final Integer DRAFT = 0;
/**
* 下架
*/
public static final Integer DOWN = 1;
/**
* 上架
*/
public static final Integer UP = 2;
/**
* 加精类型
*/
public static final Integer HIGH_LIGHT = 3;
/**
* 置顶类型
*/
public static final Integer TOP = 4;
/**
* 初始值为0
*/
public static final Integer ZERO = 0;
/**
* 上移
*/
public static final Integer MOVE_UP = 1;
/**
* 下移
*/
public static final Integer MOVE_DOWN = 2;
/**
* 加精
*/
public static final Integer IS_HIGH_LIGHT = 1;
/**
* 取消加精
*/
public static final Integer CANCEL_HIGH_LIGHT = 0;
/**
* 置顶
*/
public static final Integer IS_TOP = 1;
/**
* 取消置顶
*/
public static final Integer CANCEL_TOP = 0;
/**
* 获取 2038-01-01 00:00:00 置顶时间排序需要
*/
public static Date MAX_TOP_DATE = new Date(2145888000000L);
/**
* 帖子待管理
*/
public static final Integer POSTS_NOT_MANAGE = 0;
/**
* 举报待管理
*/
public static final Integer INFORM_NOT_MANAGE = 1;
/**
*部门
*/
public static final Integer ORG = 1;
/**
* 用户
*/
public static final Integer ACCOUNT = 2;
/**
* 平台用户
*/
public static final Integer SITE_ACCOUNT = 0;
/**
* 指定用户
*/
public static final Integer VISIBLE_RANGE = 1;
/**
* 全部帖子
*/
public static final Integer ORDER_UPDATE_TIME = 0;
/**
* 最近讨论
*/
public static final Integer ORDER_BY_NEW_COMMENT_TIME = 1;
/**
* 最热讨论
*/
public static final Integer ORDER_BY_READ_NUM = 2;
/**
* 精选热帖
*/
public static final Integer ORDER_BY_HIGHLIGHT_TIME = 3;
/**
* 现在
*
*/
public static final String NOW = "现在";
/**
* 已收藏
*
*/
public static final Integer HAS_FAVORITE = 1;
/**
* 管理端 终端类型
*
*/
public static final Integer TERMINAL_MANAGE = 1;
/**
* 可评论类型
*
*/
public static final Integer COMMENT_TYPE = 2;
/**
* 可发帖类型
*
*/
public static final Integer SEND_POSTS_TYPE = 1;
/**
* 该贴已被删除
*
*/
public static final String POSTS_HAS_DELETED = "贴子已被删除";
/**
* 该用户已被禁言
*
*/
public static final String ACCOUNT_IS_FORBIDDEN = "该用户已被禁言";
/**
* name字段
*/
public static final String FEIlD_NAME = "name";
/**
* name字段
*/
public static final String FEIlD_TITLE = "title";
/**
* 评论待管理字段
*/
public static final String Field_NEW_COMMENT_NUM = "new_comment_num";
/**
* 评论数字段
*/
public static final String Field_COMMENT_NUM = "comment_num";
/**
* 作者字段
*/
public static final String Field_AUTHOR = "author";
/**
* 分类id字段
*/
public static final String Field_CLASSIFY_ID = "posts_classify_id";
/**
* 用户id字段
*/
public static final String Field_ACCOUNT_ID = "account_id";
/**
* id字段
*/
public static final String Field_ID = "id";
/**
* 排序字段
*/
public static final String Field_SORT = "sort";
/**
* 排序字段
*/
public static final String Field_SORT_TIME = "sort_time";
/**
* 分类下帖子的数量 字段
*/
public static final String Field_HAS_POSTS_NUM = "has_posts_num";
/**
* 分类下能发帖设置字段
*/
public static final String Field_SEND_SETTING = "send_setting";
/**
* 帖子阅读数字段
*/
public static final String Field_READ_NUM = "read_num";
/**
* 加精字段
*/
public static final String FEIlD_IS_HIGHLIGHT = "is_highlight";
/**
* 加精时间字段
*/
public static final String FEIlD_HIGHLIGHT_TIME = "highlight_time";
/**
* 置顶字段
*/
public static final String FEIlD_IS_TOP = "is_top";
/**
* 置顶字段
*/
public static final String FEIlD_TOP_TIME = "top_time";
/**
* 发表时间字段
*/
public static final String FEIlD_CREATE_TIME = "create_time";
/**
* 修改时间字段
*/
public static final String FEIlD_UPDATE_TIME = "update_time";
/**
* 可见范围字段
*/
public static final String FEIlD_VISIBLE_RANGE= "visible_range";
/**
* 帖子id 字段
*/
public static final String FEIlD_POSTS_ID= "posts_id";
/**
* 业务类型 字段
*/
public static final String FEIlD_TASK_TYPE= "task_type";
/**
* 状态字段
*/
public static final String FEIlD_STATUS= "status";
/**
* 终端类型 字段
*/
public static final String FEIlD_TERMINAL_TYPE= "terminal_type";
/**
* 我的管理 排序时间字段
*/
public static final String FEIlD_MANAGE_SORT = "manage_sort_time";
/**
* 我的收藏 排序时间字段
*/
public static final String FEIlD_FAVORITE_TIME = "favorite_time";
}
package com.yizhi.forum.application.feign;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* <p>
* 前端控制器
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@FeignClient(name = "cloud-forum", contextId = "PostsClassifyAccountClient")
public interface PostsClassifyAccountClient {
@GetMapping("/postsClassifyAccount/canComment")
public Integer canComment(@RequestParam("postsId") Long postsId);
}
package com.yizhi.forum.application.feign;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.forum.application.vo.domain.PostsClassifyVo;
import com.yizhi.forum.application.vo.forum.PostsClassifySettingVo;
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;
/**
* <p>
* 前端控制器
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@FeignClient(name = "cloud-forum", contextId = "PostsClassifyClient")
public interface PostsClassifyClient {
@GetMapping("/postsClassify/manage/exsitsSameName")
public Boolean exsitsSameName(@RequestParam("name") String name);
@PostMapping("/postsClassify/manage/save")
public Boolean save(@RequestBody PostsClassifyVo postsClassifyVo);
@PostMapping("/postsClassify/manage/update")
public Boolean update(@RequestBody PostsClassifyVo postsClassifyVo);
@GetMapping("/postsClassify/manage/move")
public Integer move(@RequestParam("type") Integer type, @RequestParam("id") Long id);
@GetMapping("/postsClassify/manage/get")
public PostsClassifyVo get(@RequestParam("id") Long id);
@GetMapping("/postsClassify/manage/deleted")
public Integer deleted(@ApiParam("分类id必填") @RequestParam("id") Long id);
@PostMapping("/postsClassify/manage/updateSetting")
public Boolean updateSetting(@RequestBody PostsClassifySettingVo vo);
@GetMapping("/postsClassify/manage/getSetting")
public PostsClassifySettingVo getSetting(@RequestParam("id") Long id);
@GetMapping("/postsClassify/manage/getPage")
public Page<PostsClassifyVo> getPage(@RequestParam(value = "name",required = false) String name,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize);
}
package com.yizhi.forum.application.feign;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.forum.application.vo.forum.PostsManageVo;
import com.yizhi.forum.application.vo.forum.PostsParamsVo;
import com.yizhi.forum.application.vo.forum.PostsSaveVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
/**
* <p>
* 前端控制器
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@FeignClient(name = "cloud-forum", contextId = "PostsClient")
public interface PostsClient {
@PostMapping("/posts/save")
public Integer save(@RequestBody PostsSaveVo vo);
@PostMapping("/posts/get")
public PostsSaveVo get(@RequestBody PostsParamsVo vo);
@PostMapping("/posts/update")
public Integer update(@RequestBody PostsSaveVo vo);
@PostMapping("/posts/upOrDown")
public Integer upOrDown(@RequestBody PostsParamsVo vo);
@PostMapping("/posts/topOrHighlight")
public Integer topOrHighlight(@RequestBody PostsParamsVo vo);
@PostMapping("/posts/getPage")
public Page<PostsManageVo> getPage(@RequestBody PostsParamsVo vo);
}
package com.yizhi.forum.application.feign;
import org.springframework.cloud.openfeign.FeignClient;
/**
* <p>
* 前端控制器
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@FeignClient(name = "cloud-forum", contextId = "PostsContentClient")
public interface PostsContentClient {
}
package com.yizhi.forum.application.feign;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.forum.application.vo.domain.PostsForbiddenAccountVo;
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;
/**
* <p>
* 前端控制器
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@FeignClient(name = "cloud-forum", contextId = "PostsForbiddenAccountClient")
public interface PostsForbiddenAccountClient {
@PostMapping("/postsForbiddenAccount/save")
public Integer save(@RequestBody PostsForbiddenAccountVo forbiddenAccount);
@GetMapping("/postsForbiddenAccount/getPage")
public Page<PostsForbiddenAccountVo> getPage(@RequestParam("postsId") Long postsId,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize);
@PostMapping("/postsForbiddenAccount/deleted")
public Integer deleted(@RequestBody PostsForbiddenAccountVo forbiddenAccount);
@GetMapping("/postsForbiddenAccount/hasForbiddenByPostsId")
public Integer hasForbiddenByPostsId(@RequestParam("postsId") Long postsId);
@GetMapping("/postsForbiddenAccount/getListByPostsId")
public List<PostsForbiddenAccountVo> getListByPostsId(@RequestParam("postsIds") List<Long> postsIds);
}
package com.yizhi.forum.application.feign;
import com.yizhi.forum.application.vo.forum.PostsManageAccountParamVo;
import com.yizhi.forum.application.vo.forum.PostsManageAccountVo;
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;
/**
* <p>
* 前端控制器
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@FeignClient(name = "cloud-forum", contextId = "PostsManageAccountClient")
public interface PostsManageAccountClient {
@PostMapping("/postsManageAccount/save")
public Boolean save(@RequestBody PostsManageAccountParamVo vo);
@GetMapping("/postsManageAccount/getManager")
public List<PostsManageAccountVo> getManager(@RequestParam("postsClassifyId") Long postsClassifyId);
}
package com.yizhi.forum.application.feign;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* <p>
* 前端控制器
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@FeignClient(name = "cloud-forum", contextId = "PostsReadRecordsClient")
public interface PostsReadRecordsClient {
@GetMapping("/postsReadRecords/insertReadRecord")
public Integer insertReadRecord(@RequestParam("postsId") Long postsId, @RequestParam("terminalType") Integer terminalType);
}
package com.yizhi.forum.application.feign;
import org.springframework.cloud.openfeign.FeignClient;
/**
* <p>
* 前端控制器
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@FeignClient(name = "cloud-forum", contextId = "PostsRelationClient")
public interface PostsRelationClient {
}
package com.yizhi.forum.application.feign;
import com.yizhi.forum.application.vo.forum.PostsVisibleRangeVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@FeignClient(name = "cloud-forum", contextId = "PostsVisibleRangeClient")
public interface PostsVisibleRangeClient {
@GetMapping("/postsVisibleRange/getVisibleRange")
public List<PostsVisibleRangeVo> getVisibleRange(@RequestParam("postsId") Long postsId);
}
package com.yizhi.forum.application.feign.remote;
import com.yizhi.forum.application.vo.forum.PostsParamsVo;
import com.yizhi.forum.application.vo.forum.PostsStudentVo;
import com.yizhi.forum.application.vo.domain.PostsVo;
import com.yizhi.forum.application.vo.forum.StatisticsForumAccountVo;
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;
import java.util.Map;
/**
* <p>
* 前端控制器
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@FeignClient(name = "cloud-forum", contextId = "RemotePostsClient")
public interface RemotePostsClient {
/**
* 修改帖子基本信息
*
* @param vo
* @return
*/
@PostMapping("/remote/posts/update/info")
public Integer updateInfo(@RequestBody PostsVo vo);
@PostMapping("/remote/posts/getList")
public List<PostsVo> getList(@RequestBody PostsParamsVo vo);
@PostMapping("/remote/posts/getMap")
public Map<Long, PostsStudentVo> getMap(@RequestBody PostsParamsVo vo);
@GetMapping("/remote/posts/get/info")
public PostsVo getInfo(@RequestParam("postsId") Long postsId);
@GetMapping("/remote/posts/getAllPosts")
public List<PostsVo> getAllPosts();
@GetMapping("/remote/posts//getPersonalDataMap")
public Map<Long, StatisticsForumAccountVo> getPersonalDataMap();
/**
* 首页展示精选中的帖子需要帖子实时名称
* @param postsIds
* @return
*/
@GetMapping("/remote/posts//getNames")
public Map<Long,String> getNames(@RequestParam(value = "postsIds",required = false) List<Long> postsIds);
@GetMapping({"/remote/posts/verifyVideo"})
boolean verifyVideo(@RequestParam("postsAppendixIds") List<Long> postsAppendixIds);
@PostMapping({"/remote/posts/updateVideoTranscodeUrl"})
boolean updateVideoTranscodeUrl(@RequestBody Map<String, String> var1);
}
package com.yizhi.forum.application.feign.student;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.forum.application.vo.domain.PostsClassifyVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* <p>
* 学员端分类接口
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@FeignClient(name = "cloud-forum", contextId = "StudentPostsClassifyClient")
public interface StudentPostsClassifyClient {
@GetMapping("/postsClassify/student/getPageToStudent")
public Page<PostsClassifyVo> getPageToStudent(@RequestParam(value = "name",required = false) String name,
@RequestParam("canSend") Boolean canSend,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize);
}
package com.yizhi.forum.application.feign.student;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.forum.application.vo.forum.PostsParamsVo;
import com.yizhi.forum.application.vo.forum.PostsSaveVo;
import com.yizhi.forum.application.vo.forum.PostsStudentVo;
import io.swagger.annotations.ApiOperation;
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;
import java.util.Map;
/**
* <p>
* 前端控制器
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@FeignClient(name = "cloud-forum", contextId = "StudentPostsClient")
public interface StudentPostsClient {
/**
* @param type 1:最新讨论、2:最热讨论、3:精选热帖
* @param keyword 分类名称或帖子标题
* @param classifyId
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/posts/student/getPageToStudent")
public Page<PostsStudentVo> getPageToStudent(@RequestParam("type") Integer type,
@RequestParam(value = "keyword",required = false) String keyword,
@RequestParam(value = "classifyId",required = false) Long classifyId,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize);
@PostMapping("/posts/student/save")
public Integer studentSave(@RequestBody PostsSaveVo vo);
/**
* 学员查看完整帖子
*
* @param vo
* @return
*/
@PostMapping("/posts/student/get")
public PostsSaveVo studentGet(@RequestBody PostsParamsVo vo);
/**
* 我的发帖 我的收藏 我的管理 分页数据
*
* @param type 1:我的发帖 2:我的收藏 3:我的管理
* @param status 0:草稿 1:下架 2:上架
* @param keyword 分类名称或帖子标题
* @param classifyId
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/posts/student/myPage")
public Page<PostsStudentVo> myPage(@RequestParam("type") Integer type,
@RequestParam(value = "status",required = false) Integer status,
@RequestParam(value = "keyword",required = false) String keyword,
@RequestParam(value = "classifyId",required = false) Long classifyId,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize);
/**
* 学员端修改帖子
*
* @param vo
* @return
*/
@PostMapping("/posts/student/update")
public Integer update(@RequestBody PostsSaveVo vo);
@PostMapping("/posts/student/deleted")
public Integer deleted(@RequestBody PostsParamsVo vo);
@PostMapping("/posts/student/topOrHighlight")
public Integer topOrHighlight(@RequestBody PostsParamsVo vo);
@GetMapping("/posts/student/getMapByIds")
public Map<Long, PostsStudentVo> getMapByIds(@RequestParam("postsIds") List<Long> postsIds);
@GetMapping("/posts/student/getMyNum")
@ApiOperation(value = "获取我的管理(有回复、举报或帖子未查看)的数量")
public Integer getMyNum();
}
package com.yizhi.forum.application.feign.student;
import com.yizhi.forum.application.vo.domain.PostsFavoriteVo;
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;
import java.util.Map;
/**
* <p>
* 前端控制器
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@FeignClient(name = "cloud-forum", contextId = "StudentPostsFavoriteClient")
public interface StudentPostsFavoriteClient {
@PostMapping("/postsFavorite/save")
public Integer save(@RequestBody PostsFavoriteVo postsFavorite);
@PostMapping("/postsFavorite/deleted")
public Integer deleted(@RequestBody PostsFavoriteVo PostsFavorite);
@GetMapping("/postsFavorite/hasFavoriteByPostsId")
public Integer hasFavoriteByPostsId(@RequestParam("postsId") Long postsId);
@GetMapping("/postsFavorite/hasFavoriteByPostsIds")
public Map<Long,Integer> hasFavoriteByPostsIds(@RequestParam("postsIds") List<Long> postsIds);
}
package com.yizhi.forum.application.util;
import cn.hutool.core.date.DateUtil;
import com.yizhi.forum.application.constans.ForumConstans;
import java.text.SimpleDateFormat;
import java.util.Date;
public class ForumUtil {
private static SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm");
private static SimpleDateFormat format2 = new SimpleDateFormat("MM-dd HH:mm");
private static SimpleDateFormat format3 = new SimpleDateFormat("HH:mm");
private static final Long ONE_MINUTE = 60 * 1000L;
private static final Long ONE_HOUR = 60 * ONE_MINUTE;
private static final Long TODAY = 24 * ONE_HOUR;
/**
* 根据创建时间获取回显时间
*
* @param creatTime
* @return
*/
public static String getCreatTimeString(Date creatTime) {
Date now = new Date();
Long ZERO = 0L;
//获取当前时间的年份
int currentYear = DateUtil.year(now);
//获取创建时间的年份
int creatTimeYear = DateUtil.year(creatTime);
Long a = now.getTime() - creatTime.getTime();
if (DateUtil.isSameDay(creatTime, now)) {
if (a - ONE_MINUTE <= ZERO) {
return ForumConstans.NOW;
}
if (a - ONE_HOUR <= ZERO) {
return (now.getTime() - creatTime.getTime()) / ONE_MINUTE + "分钟前";
}
if (a - TODAY <= ZERO) {
return "今天 " + format3.format(creatTime);
}
}
if (creatTimeYear == currentYear) {
return "" + format2.format(creatTime);
} else {
return "" + format1.format(creatTime);
}
}
}
package com.yizhi.forum.application.vo.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-09
*/
@Data
@ApiModel(value = "PostsAppendixVo", description = "帖子附件表")
public class PostsAppendixVo {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
private Long id;
@ApiModelProperty(value = "帖子id")
private Long postsId;
@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 type;
@ApiModelProperty(value = "是否删除 0:未删除、1:已删除")
private Integer deleted;
@ApiModelProperty(value = "是否经过转码 1:已转")
private Integer isVideo;
@ApiModelProperty(value = "经过阿里云转码后的url")
private String aliyunUrl;
@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;
@ApiModelProperty(value = "站点id")
private Long siteId;
}
package com.yizhi.forum.application.vo.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-09
*/
@Data
@ApiModel(value = "PostsClassifyAccountVo", description = "可发帖、评论人员表")
public class PostsClassifyAccountVo {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id ")
private Long id;
@ApiModelProperty(value = "帖子分类id")
private Long postsClassifyId;
@ApiModelProperty(value = "类型(1:可发帖人员、2:可评论人员)")
private Integer type;
@ApiModelProperty(value = "用户类型:1-部门 2-用户 ")
private Integer accountType;
@ApiModelProperty(value = "用户id或部门id ")
private Long accountId;
@ApiModelProperty(value = "是否删除(0:否,1:是)")
private Integer deleted;
private Long siteId;
@ApiModelProperty(value = "创建人")
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;
}
package com.yizhi.forum.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-09
*/
@Data
@TableName("posts_classify")
@ApiModel(value = "PostsClassifyEntityVo", description = "帖子分类表")
public class PostsClassifyVo {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "分类id")
private Long id;
@ApiModelProperty(value = "名称 20个字符内")
private String name;
@ApiModelProperty(value = "分类编码 备用")
private String code;
@ApiModelProperty(value = "备注 100个字符内")
private String description;
@ApiModelProperty(value = "发帖可得积分")
private Integer sendPoint;
@ApiModelProperty(value = "评论可得积分 ")
private Integer commentPoint;
@ApiModelProperty(value = "0:平台用户 1:指定用户 可评论人员范围")
private Integer commentSetting;
@ApiModelProperty(value = "0:平台用户 1:指定用户 可发帖人员范围")
private Integer sendSetting;
@ApiModelProperty(value = "是否删除(0:否,1:是)")
private Integer deleted;
@ApiModelProperty(value = "排序字段")
private Integer sort;
private Long orgId;
private Long siteId;
private Long companyId;
private Long createById;
private String createByName;
private Date createTime;
private Long updateById;
private String updateByName;
private Date updateTime;
}
package com.yizhi.forum.application.vo.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-09
*/
@Data
@ApiModel(value = "PostsContentVo", description = "帖子内容表")
public class PostsContentVo {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "帖子id")
private Long postsId;
@ApiModelProperty(value = "帖子内容")
private String content;
@ApiModelProperty(value = "是否删除(0:否,1:是)")
private Integer deleted;
private Long createById;
private String createByName;
private Date createTime;
private Long updateById;
private String updateByName;
private Date updateTime;
}
package com.yizhi.forum.application.vo.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-09
*/
@Data
@ApiModel(value = "PostsFavoriteVo", description = "帖子收藏表")
public class PostsFavoriteVo {
private static final long serialVersionUID = 1L;
private Long id;
@ApiModelProperty(value = "帖子id")
private Long postsId;
private Long accountId;
@ApiModelProperty(value = "是否删除(0:否,1:是)")
private Integer deleted;
private Long createById;
private String createByName;
private Date createTime;
private Long updateById;
private String updateByName;
private Date updateTime;
private Long companyId;
private Long siteId;
private Long orgId;
}
package com.yizhi.forum.application.vo.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-09
*/
@Data
@ApiModel(value = "PostsForbbidenAccount", description = "禁言人员表")
public class PostsForbiddenAccountVo {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "帖子id")
private Long postsId;
@ApiModelProperty(value = "用户id ")
private Long accountId;
@ApiModelProperty(value = "是否删除(0:否,1:是)")
private Integer deleted;
private Long siteId;
@ApiModelProperty(value = "被禁言用户名")
private String accountName;
@ApiModelProperty(value = "被禁言用户头像")
private String photo;
@ApiModelProperty(value = "创建人")
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;
}
package com.yizhi.forum.application.vo.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-09
*/
@Data
@ApiModel(value = "PostsManageAccountVo", description = "代管员表")
public class PostsManageAccountVo {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id ")
private Long id;
@ApiModelProperty(value = "帖子分类id")
private Long postsClassifyId;
@ApiModelProperty(value = "用户id ")
private Long accountId;
@ApiModelProperty(value = "是否删除(0:否,1:是)")
private Integer deleted;
private Long siteId;
@ApiModelProperty(value = "创建人")
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;
}
package com.yizhi.forum.application.vo.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-09
*/
@Data
@ApiModel(value = "PostsReadRecordVo", description = "帖子阅读记录表")
public class PostsReadRecordVo {
private static final long serialVersionUID = 1L;
private Long id;
@ApiModelProperty(value = "帖子id")
private Long postsId;
@ApiModelProperty(value = "用户id ")
private Long accountId;
@ApiModelProperty(value = "终端类型:1-管理端 2-pc端 3-微信端 4-app")
private Integer terminalType;
@ApiModelProperty(value = "是否删除(0:否,1:是)")
private Integer deleted;
@ApiModelProperty(value = "创建人")
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;
private Long siteId;
}
package com.yizhi.forum.application.vo.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-09
*/
@Data
@ApiModel(value = "PostsRelationVo", description = "帖子关联业务表")
public class PostsRelationVo {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "业务类型 1:training、2:course、3:offline_course、4:exam、5:research、6:live、7:assignment、8:案列活动、9:精选案列")
private Integer type;
@ApiModelProperty(value = "业务id")
private Long relationId;
@ApiModelProperty(value = "帖子id")
private Long postsId;
@ApiModelProperty(value = "业务logo")
private String taskLogo;
@ApiModelProperty(value = "业务名称")
private String taskName;
@ApiModelProperty(value = "备用字段")
private String spareField;
@ApiModelProperty(value = "是否删除(0:否,1:是)")
private Integer deleted;
@ApiModelProperty(value = "创建人")
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;
}
package com.yizhi.forum.application.vo.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-09
*/
@Data
@ApiModel(value = "PostsVisibleRangeVo", description = "帖子可见范围表")
public class PostsVisibleRangeVo {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "帖子id")
private Long postsId;
@ApiModelProperty(value = "用户类型:1-部门 2-用户 ")
private Integer accountType;
@ApiModelProperty(value = "用户id或部门id ")
private Long accountId;
@ApiModelProperty(value = "是否删除(0:否,1:是)")
private Integer deleted;
private Long siteId;
@ApiModelProperty(value = "创建人")
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;
}
package com.yizhi.forum.application.vo.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-09
*/
@Data
@ApiModel(value = "PostsVo", description = "帖子表")
public class PostsVo {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "帖子id")
private Long id;
@ApiModelProperty(value = "帖子分类id")
private Long postsClassifyId;
@ApiModelProperty(value = "帖子名称")
private String title;
@ApiModelProperty(value = "帖子封面(取内容里的图片)")
private String logo;
@ApiModelProperty(value = "状态 0:草稿 1:未上架 2:上架")
private Integer status;
@ApiModelProperty(value = "作者用户id")
private Long author;
@ApiModelProperty(value = "0:全平台 1:指定用户")
private Integer visibleRange;
@ApiModelProperty(value = "是否置顶 0:未置顶(默认) 1:置顶")
private Integer isTop;
@ApiModelProperty(value = "置顶时间 --is_top为1时有效,初始值为创建时间 ")
private Date topTime;
@ApiModelProperty(value = "是否加精 0:未加精(默认) 1:加精")
private Integer isHighlight;
@ApiModelProperty(value = "加精时间 --is_highlight为1时有效,初始值为创建时间 ")
private Date highlightTime;
@ApiModelProperty(value = "点赞数")
private Integer thumbsNum;
@ApiModelProperty(value = "阅读人数")
private Integer readNum;
@ApiModelProperty(value = "举报人数")
private Integer informNum;
@ApiModelProperty(value = "是否有新的举报而未被管理 0:未被管理(默认) 1:已被管理")
private Integer hasNewInform;
@ApiModelProperty(value = "回复人数")
private Integer replyNum;
@ApiModelProperty(value = "评论人数")
private Integer commentNum;
@ApiModelProperty(value = "最新回复时间 初始值为创建时间 ")
private Date commentTime;
@ApiModelProperty(value = "未被管理员阅读评论数")
private Integer newCommentNum;
@ApiModelProperty(value = "是否已经被管理 0:未被管理(默认) 1:已被管理")
private Integer hasManage;
@ApiModelProperty(value = "终端类型:1-管理端 2-pc端 3-微信端 4-app")
private Integer terminalType;
@ApiModelProperty(value = "若置顶该字段为允许的时间最大值,有回复则记录最新回复时间,默认帖子创建时间" +
"置顶时间>回复时间>创建时间 ")
private Date sortTime;
@ApiModelProperty(value = "有新的举报(包括对帖子和对回复的),有新的回复,帖子刚发表(包括修改以后发表)")
private Date manageSortTime;
@ApiModelProperty(value = "被收藏时间")
private Date favoriteTime;
@ApiModelProperty(value = "是否删除(0:否,1:是)")
private Integer deleted;
private Long orgId;
private Long siteId;
private Long companyId;
private Long createById;
private String createByName;
@ApiModelProperty(value = "发表时间")
private Date createTime;
private Long updateById;
private String updateByName;
@ApiModelProperty(value = "修改时间 初始值为发表时间")
private Date updateTime;
@ApiModelProperty(value = "发帖可得积分")
private Integer sendPoint;
@ApiModelProperty(value = "评论可得积分 ")
private Integer commentPoint;
}
package com.yizhi.forum.application.vo.forum;
import com.baomidou.mybatisplus.activerecord.Model;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@Api(tags = "PdfPagesVo", description = "pdf图片")
public class PdfPagesVo extends Model<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;
@Override
protected Serializable pkVal() {
return this.id;
}
}
package com.yizhi.forum.application.vo.forum;
import com.baomidou.mybatisplus.annotations.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@Data
@ApiModel(value = "PostsAppendixVo", description = "帖子附件表")
public class PostsAppendixVo {
@ApiModelProperty(value = "主键")
private Long id;
@ApiModelProperty(value = "帖子id")
@TableField("posts_id")
private Long postsId;
@ApiModelProperty(value = "附件名称 ")
private String name;
@ApiModelProperty(value = "附件大小")
@TableField("file_size")
private Double fileSize;
@ApiModelProperty(value = "文件后缀名")
@TableField("file_suffer")
private String fileSuffer;
@ApiModelProperty(value = "下载路径")
private String url;
@ApiModelProperty(value = "阿里云下载路径")
private String aliyunUrl;
@ApiModelProperty(value = "附件类型 :1、文档;2、图片;3、音频;4、视频;5、其他(压缩包)")
private Integer type;
private List<PdfPagesVo> pdfPages;
}
package com.yizhi.forum.application.vo.forum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* <p>
*
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@Data
@ApiModel(value = "PostsClassifyAccountVo", description = "可发帖、评论人员表")
public class PostsClassifyAccountVo {
@ApiModelProperty(value = "id ")
private Long id;
@ApiModelProperty(value = "帖子分类id")
private Long postsClassifyId;
@ApiModelProperty(value = "类型(1:可发帖人员、2:可评论人员)")
private Integer type;
@ApiModelProperty(value = "用户类型:1-部门 2-用户 ")
private Integer accountType;
@ApiModelProperty(value = "用户id或部门id ")
private Long accountId;
@ApiModelProperty(value = "用户名 或部门名称 ")
private String accountName;
@ApiModelProperty(value = "用户真实名 ")
private String accountFullName;
@ApiModelProperty(value = "工号 ")
private String workNum;
}
package com.yizhi.forum.application.vo.forum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@Data
@ApiModel(value = "PostsClassifySettingVo", description = "分类论坛设置Vo")
public class PostsClassifySettingVo {
@ApiModelProperty(value = "分类id")
private Long id;
@ApiModelProperty(value = "true:保存 false:修改")
private Boolean isSave = false;
@ApiModelProperty(value = "发帖可得积分")
private Integer sendPoint;
@ApiModelProperty(value = "评论可得积分 ")
private Integer commentPoint;
@ApiModelProperty(value = "0:平台用户 1:指定用户 可评论人员范围")
private Integer commentSetting;
@ApiModelProperty(value = "0:平台用户 1:指定用户 可发帖人员范围")
private Integer sendSetting;
@ApiModelProperty(value = "可发帖、评论人员集合")
private List<PostsClassifyAccountVo> postsClassifyAccountVos;
}
package com.yizhi.forum.application.vo.forum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@Data
@ApiModel(value = "PostsClassifyVo", description = "")
public class PostsClassifyVo {
@ApiModelProperty(value = "分类id")
private Long id;
@ApiModelProperty(value = "名称 20个字符内 必填")
private String name;
@ApiModelProperty(value = "修改时的新名字")
private String newName;
@ApiModelProperty(value = "备注 100个字符内")
private String description;
@ApiModelProperty(value = "发帖可得积分")
private Integer sendPoint;
@ApiModelProperty(value = "评论可得积分 ")
private Integer commentPoint;
@ApiModelProperty(value = "0:平台用户 1:指定用户 可评论人员范围")
private Integer commentSetting;
@ApiModelProperty(value = "0:平台用户 1:指定用户 可发帖人员范围")
private Integer sendSetting;
@ApiModelProperty(value = "排序字段")
private Integer sort;
@ApiModelProperty(value = "修改时间 初始值为创建时间")
private Date updateTime;
}
package com.yizhi.forum.application.vo.forum;
import com.yizhi.forum.application.vo.domain.PostsManageAccountVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@Data
@ApiModel(value = "PostsManageAccountVo", description = "代管员表")
public class PostsManageAccountParamVo {
@ApiModelProperty(value = "true:保存 false:修改")
private Boolean isSave = false;
@ApiModelProperty(value = "分类id")
private Long postsClassifyId;
@ApiModelProperty(value = "代管员集合")
private List<PostsManageAccountVo> postsManageAccounts;
}
package com.yizhi.forum.application.vo.forum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* <p>
*
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@Data
@ApiModel(value = "PostsManageAccountVo", description = "代管员表")
public class PostsManageAccountVo {
@ApiModelProperty(value = "id ")
private Long id;
@ApiModelProperty(value = "用户id ")
private Long accountId;
@ApiModelProperty(value = "用户名 ")
private String accountName;
@ApiModelProperty(value = "用户真实名 ")
private String accountFullName;
@ApiModelProperty(value = "工号 ")
private String workNum;
}
package com.yizhi.forum.application.vo.forum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@Data
@ApiModel(value = "PostsManageVo", description = "管理端帖子Vo")
public class PostsManageVo {
@ApiModelProperty(value = "帖子id")
private Long id;
@ApiModelProperty(value = "帖子分类id")
private Long postsClassifyId;
@ApiModelProperty(value = "状态 0:草稿 1:未上架 2:上架")
private String status;
@ApiModelProperty(value = "帖子名称")
private String title;
@ApiModelProperty(value = "作者用户id")
private Long author;
@ApiModelProperty(value = "是否置顶 0:未置顶(默认) 1:置顶")
private Integer isTop;
@ApiModelProperty(value = "是否加精 0:未加精(默认) 1:加精")
private Integer isHighlight;
@ApiModelProperty(value = "作者用户名")
private String authorName;
@ApiModelProperty(value = "举报人数")
private Integer informNum;
@ApiModelProperty(value = "是否有新的举报而未被管理 0:未被管理(默认) 1:已被管理")
private Integer hasNewInform;
@ApiModelProperty(value = "回复人数")
private Integer replyNum;
@ApiModelProperty(value = "评论人数")
private Integer commentNum;
@ApiModelProperty(value = "未被管理员阅读评论数")
private Integer newCommentNum;
@ApiModelProperty(value = "是否已经被管理 0:未被管理(默认) 1:已被管理")
private Integer hasManage;
@ApiModelProperty(value = "修改时间 初始值为发表时间")
private Date updateTime;
}
package com.yizhi.forum.application.vo.forum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@Data
@ApiModel(value = "PostsParamsVo", description = "搜索帖子的参数vo")
public class PostsParamsVo {
@ApiModelProperty(value = "帖子id")
private Long id;
@ApiModelProperty(value = "帖子分类id")
private Long postsClassifyId;
@ApiModelProperty(value = "类型-- 0:草稿、1:下架、 2:上架 ")
private Integer status;
@ApiModelProperty(value = "类型-- 0:草稿、1:下架、 2:上架 、3:加精、4:置顶、5:帖子待管理、6:举报待管理 、7:回复待管理")
private Integer type;
@ApiModelProperty(value = "是否置顶 0:未置顶(默认) 1:置顶")
private Integer isTop;
@ApiModelProperty(value = "是否加精 0:未加精(默认) 1:加精")
private Integer isHighlight;
@ApiModelProperty(value = "终端类型:1-管理端 2-pc端 3-微信端 4-app")
private Integer terminalType;
@ApiModelProperty(value = "帖子名称")
private String title;
@ApiModelProperty(value = "作者用户id")
private Long author;
@ApiModelProperty(value = "是否包含已删除的帖子")
private Boolean includeDeleted = false;
@ApiModelProperty(value = "作者用户id集合")
private List<Long> authors;
@ApiModelProperty(value = "作者用户名")
private String authorName;
@ApiModelProperty(value = "当前页码")
private Integer pageNo = 1;
@ApiModelProperty(value = "页内条数")
private Integer pageSize = 10;
@ApiModelProperty(value = "首页配置需要")
private Boolean portalNeed = false;
@ApiModelProperty(value = "举报需要")
private Boolean informNeed = false;
}
package com.yizhi.forum.application.vo.forum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* <p>
*
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@Data
@ApiModel(value = "PostsRelationVo", description = "帖子关联业务表")
public class PostsRelationVo {
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "业务类型" +
"1:training、2:course、3:offline_course、4:exam、5:research、6:live、7:assignment、8:案列活动、9:精选案列")
private Integer type;
@ApiModelProperty(value = "业务id")
private Long relationId;
@ApiModelProperty(value = "帖子id")
private Long postsId;
@ApiModelProperty(value = "业务logo")
private String taskLogo;
@ApiModelProperty(value = "业务名称")
private String taskName;
@ApiModelProperty(value = "备用字段 目前存放直播频道号")
private String spareField;
@ApiModelProperty(value = "观看类型:0: 公开播放 ; 1: 站内授权播放; ")
private Integer viewType;
}
package com.yizhi.forum.application.vo.forum;
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-09
*/
@Data
@ApiModel(value = "PostsSaveVo", description = "保存帖子时vo")
public class PostsSaveVo {
@ApiModelProperty(value = "帖子id")
private Long id;
@ApiModelProperty(value = "保存类型-- 0:草稿 2:上架 必传")
private Integer type;
@ApiModelProperty(value = "帖子分类id")
private Long postsClassifyId;
@ApiModelProperty(value = "帖子分类名称")
private String postClassifyName;
@ApiModelProperty(value = "帖子名称 必传")
private String title;
@ApiModelProperty(value = "帖子封面(取内容里的图片)")
private String logo;
@ApiModelProperty(value = "终端类型:1-管理端 2-pc端 3-微信端 4-app 必传")
private Integer terminalType;
@ApiModelProperty(value = "帖子内容 必传")
private String content;
@ApiModelProperty(value = "0:全平台 1:指定用户 必传")
private Integer visibleRange;
@ApiModelProperty(value = "作者用户id")
private Long author;
@ApiModelProperty(value = "作者用户名")
private String authorName;
@ApiModelProperty(value = "作者头像")
private String authorPhoto;
@ApiModelProperty(value = "点赞数")
private Integer thumbsNum;
@ApiModelProperty(value = "阅读人数")
private Integer readNum;
@ApiModelProperty(value = "回复人数")
private Integer replyNum;
@ApiModelProperty(value = "评论人数")
private Integer commentNum;
@ApiModelProperty(value = "帖子附件")
private List<PostsAppendixVo> postsAppendixVos;
@ApiModelProperty(value = "帖子关联活动")
private List<PostsRelationVo> postsRelationVos;
@ApiModelProperty(value = "帖子指定范围")
private List<PostsVisibleRangeVo> postsVisibleRangeVos;
@ApiModelProperty(value = "是否已点赞 0:未点赞(默认) 1:已点赞")
private Integer hasThumbs;
@ApiModelProperty(value = "是否已收藏 0:未收藏 (默认) 1:已收藏 ")
private Integer hasFavorite;
@ApiModelProperty(value = "是否已被禁言 0:未禁言 (默认) 1:已禁言 ")
private Integer hasForbidden;
@ApiModelProperty(value = "是否可以评论 0:不可以 (默认) 1:可以 ")
private Integer canComment;
@ApiModelProperty(value = "发表时间")
private Date creatTime;
@ApiModelProperty(value = "发表时间String已做处理 回显需要")
private String createTimeString;
}
package com.yizhi.forum.application.vo.forum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@Data
@ApiModel(value = "PostsStudentVo", description = "学员端帖子Vo")
public class PostsStudentVo {
@ApiModelProperty(value = "帖子id")
private Long id;
@ApiModelProperty(value = "帖子分类id")
private Long postsClassifyId;
@ApiModelProperty(value = "帖子分类名称")
private String postClassifyName;
@ApiModelProperty(value = "帖子名称")
private String title;
@ApiModelProperty(value = "帖子内容")
private String content;
@ApiModelProperty(value = "帖子封面(取内容里的图片)")
private String logo;
@ApiModelProperty(value = "作者用户id")
private Long author;
@ApiModelProperty(value = "状态 0:草稿 1:未上架 2:上架")
private Integer status;
@ApiModelProperty(value = "作者用户名")
private String authorName;
@ApiModelProperty(value = "作者头像")
private String authorPhoto;
@ApiModelProperty(value = "是否置顶 0:未置顶(默认) 1:置顶")
private Integer isTop;
@ApiModelProperty(value = "置顶时间 --is_top为1时有效,初始值为创建时间 ")
private Date topTime;
@ApiModelProperty(value = "是否加精 0:未加精(默认) 1:加精")
private Integer isHighlight;
@ApiModelProperty(value = "加精时间 --is_highlight为1时有效,初始值为创建时间 ")
private Date highlightTime;
@ApiModelProperty(value = "点赞数")
private Integer thumbsNum;
@ApiModelProperty(value = "阅读人数")
private Integer readNum;
@ApiModelProperty(value = "举报人数")
private Integer informNum;
@ApiModelProperty(value = "是否有新的举报而未被管理 0:未被管理(默认) 1:已被管理")
private Integer hasNewInform;
@ApiModelProperty(value = "回复人数")
private Integer replyNum;
@ApiModelProperty(value = "评论人数")
private Integer commentNum;
@ApiModelProperty(value = "最新回复时间 初始值为创建时间 置顶时间为时间最大值; ")
private Date commentTime;
@ApiModelProperty(value = "未被管理员阅读评论数")
private Integer newCommentNum;
@ApiModelProperty(value = "是否已经被管理 0:未被管理(默认) 1:已被管理")
private Integer hasManage;
@ApiModelProperty(value = "终端类型:1-管理端 2-pc端 3-微信端 4-app")
private Integer terminalType;
@ApiModelProperty(value = "若置顶该字段为允许的时间最大值,有回复则记录最新回复时间,默认帖子创建时间\n" +
"置顶时间>回复时间>创建时间 ")
private Date sortTime;
@ApiModelProperty(value = "发表时间")
private Date createTime;
@ApiModelProperty(value = "发表时间String已做处理 回显需要")
private String createTimeString;
@ApiModelProperty(value = "修改时间 初始值为发表时间")
private Date updateTime;
@ApiModelProperty(value = "状态 0未删除 1:已删除")
private Integer deleted;
}
package com.yizhi.forum.application.vo.forum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* <p>
*
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@Data
@ApiModel(value = "PostsVisibleRangeVo", description = "帖子可见范围表")
public class PostsVisibleRangeVo {
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "帖子id")
private Long postsId;
@ApiModelProperty(value = "用户类型:1-部门 2-用户 ")
private Integer accountType;
@ApiModelProperty(value = "用户id或部门id ")
private Long accountId;
@ApiModelProperty(value = "用户名 或部门名称 ")
private String accountName;
@ApiModelProperty(value = "用户真实名 ")
private String accountFullName;
@ApiModelProperty(value = "工号 ")
private String workNum;
}
package com.yizhi.forum.application.vo.forum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@Data
@ApiModel(value = "PostsVo", description = "帖子Vo")
public class PostsVo {
@ApiModelProperty(value = "帖子id")
private Long id;
@ApiModelProperty(value = "帖子分类id")
private Long postsClassifyId;
@ApiModelProperty(value = "帖子名称")
private String title;
@ApiModelProperty(value = "帖子封面(取内容里的图片)")
private String logo;
@ApiModelProperty(value = "作者用户id")
private Long author;
@ApiModelProperty(value = "是否置顶 0:未置顶(默认) 1:置顶")
private Integer isTop;
@ApiModelProperty(value = "置顶时间 --is_top为1时有效,初始值为创建时间 ")
private Date topTime;
@ApiModelProperty(value = "是否加精 0:未加精(默认) 1:加精")
private Integer isHighlight;
@ApiModelProperty(value = "加精时间 --is_highlight为1时有效,初始值为创建时间 ")
private Date highlightTime;
@ApiModelProperty(value = "点赞数")
private Integer thumbsNum;
@ApiModelProperty(value = "阅读人数")
private Integer readNum;
@ApiModelProperty(value = "举报人数")
private Integer informNum;
@ApiModelProperty(value = "是否有新的举报而未被管理 0:未被管理(默认) 1:已被管理")
private Integer hasNewInform;
@ApiModelProperty(value = "回复人数")
private Integer replyNum;
@ApiModelProperty(value = "评论人数")
private Integer commentNum;
@ApiModelProperty(value = "最新回复时间 初始值为创建时间 置顶时间为时间最大值; ")
private Date commentTime;
@ApiModelProperty(value = "未被管理员阅读评论数")
private Integer newCommentNum;
@ApiModelProperty(value = "是否已经被管理 0:未被管理(默认) 1:已被管理")
private Integer hasManage;
@ApiModelProperty(value = "终端类型:1-管理端 2-pc端 3-微信端 4-app")
private Integer terminalType;
@ApiModelProperty(value = "若置顶该字段为允许的时间最大值,有回复则记录最新回复时间,默认帖子创建时间\n" +
"置顶时间>回复时间>创建时间 ")
private Date sortTime;
@ApiModelProperty(value = "发表时间")
private Date createTime;
@ApiModelProperty(value = "被收藏时间")
private Date favoriteTime;
@ApiModelProperty(value = "修改时间 初始值为发表时间")
private Date updateTime;
@ApiModelProperty(value = "有新的举报(包括对帖子和对回复的),有新的回复,帖子刚发表(包括修改以后发表)")
private Date manageSortTime;
}
package com.yizhi.forum.application.vo.forum;
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;
}
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
### VS Code ###
.vscode/
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.yizhi</groupId>
<artifactId>cloud-forum</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>com.yizhi</groupId>
<artifactId>cloud-forum-service</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-orm</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-forum-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-comment-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-core</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-forum-api</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>
package com.yizhi.forum.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;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients(basePackages = {"com.yizhi"})
@ComponentScan(basePackages = {"com.yizhi"})
public class ForumApplication {
public static void main(String[] args) {
SpringApplication.run(ForumApplication.class, args);
}
}
package com.yizhi.forum.application.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 帖子附件接口
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@RestController
@RequestMapping("/postsAppendix")
public class PostsAppendixController {
}
package com.yizhi.forum.application.controller;
import com.yizhi.forum.application.feign.PostsClassifyAccountClient;
import com.yizhi.forum.application.service.IPostsClassifyAccountService;
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;
/**
* <p>
* 分类可评论人员、可发帖人员接口
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@RestController
@RequestMapping("/postsClassifyAccount")
public class PostsClassifyAccountController implements PostsClassifyAccountClient {
@Autowired
private IPostsClassifyAccountService postsClassifyAccountService;
@Override
@GetMapping("/canComment")
public Integer canComment(@RequestParam("postsId") Long postsId) {
return postsClassifyAccountService.canComment(postsId);
}
}
package com.yizhi.forum.application.controller;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.forum.application.domain.PostsClassify;
import com.yizhi.forum.application.feign.PostsClassifyClient;
import com.yizhi.forum.application.service.IPostsClassifyService;
import com.yizhi.forum.application.vo.domain.PostsClassifyVo;
import com.yizhi.forum.application.vo.forum.PostsClassifySettingVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
/**
* <p>
* 分类接口
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@RestController
@RequestMapping("/postsClassify/manage/")
public class PostsClassifyController implements PostsClassifyClient {
private Logger logger = LoggerFactory.getLogger(PostsClassifyController.class);
@Autowired
private IPostsClassifyService postsClassifyService;
/**
* 判断分类名称是否已存在
*
* @param name
* @return
*/
@Override
@GetMapping("/exsitsSameName")
public Boolean exsitsSameName(@RequestParam("name") String name) {
RequestContext context = ContextHolder.get();
PostsClassify postsClassify = new PostsClassify();
postsClassify.setName(name);
postsClassify.setSiteId(context.getSiteId());
EntityWrapper<PostsClassify> wrapper = new EntityWrapper(postsClassify);
if (postsClassifyService.selectCount(wrapper) > 0) {
return true;
}
return false;
}
@Override
@PostMapping("/save")
public Boolean save(@RequestBody PostsClassifyVo postsClassifyVo) {
PostsClassifyVo postsClassify = new PostsClassifyVo();
BeanUtils.copyProperties(postsClassifyVo, postsClassify);
return postsClassifyService.save(postsClassify);
}
@Override
@PostMapping("/update")
public Boolean update(@RequestBody PostsClassifyVo postsClassifyVo) {
RequestContext context = ContextHolder.get();
PostsClassify postsClassify = new PostsClassify();
BeanUtils.copyProperties(postsClassifyVo, postsClassify);
postsClassify.setUpdateById(context.getAccountId());
postsClassify.setUpdateByName(context.getAccountName());
postsClassify.setUpdateTime(new Date());
return postsClassifyService.updateById(postsClassify);
}
@Override
/**
* type;1-上移 2-下移 必填
*/
@GetMapping("/move")
public Integer move(@RequestParam("type") Integer type,
@RequestParam("id") Long id) {
return postsClassifyService.move(type, id);
}
@Override
@GetMapping("/get")
public PostsClassifyVo get(@RequestParam("id") Long id) {
PostsClassify postsClassify = this.postsClassifyService.selectById(id);
if (postsClassify != null) {
PostsClassifyVo vo = new PostsClassifyVo();
BeanUtils.copyProperties(postsClassify, vo);
return vo;
}
return null;
}
@Override
@GetMapping("/deleted")
public Integer deleted(@RequestParam("id") Long id) {
return postsClassifyService.delete(id);
}
/**
* 更新论坛设置数据包括设置的人员范围
*
* @param vo
* @return
*/
@Override
@PostMapping("/updateSetting")
public Boolean updateSetting(@RequestBody PostsClassifySettingVo vo) {
return postsClassifyService.updateSetting(vo);
}
/**
* 获取论坛设置数据包括设置的人员范围
*
* @param id
* @return
*/
@Override
@GetMapping("/getSetting")
public PostsClassifySettingVo getSetting(@RequestParam("id") Long id) {
return postsClassifyService.getSetting(id);
}
/**
* 分页查询
*
* @param name
* @param pageNo
* @param pageSize
* @return
*/
@Override
@GetMapping("/getPage")
public Page<PostsClassifyVo> getPage(@RequestParam(value = "name",required = false) String name,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize) {
return postsClassifyService.getPage(name, pageNo, pageSize);
}
}
package com.yizhi.forum.application.controller;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.forum.application.feign.PostsClient;
import com.yizhi.forum.application.service.IPostsService;
import com.yizhi.forum.application.vo.forum.PostsManageVo;
import com.yizhi.forum.application.vo.forum.PostsParamsVo;
import com.yizhi.forum.application.vo.forum.PostsSaveVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* <p>
* 帖子接口
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@RestController
@RequestMapping("/posts")
public class PostsController implements PostsClient {
@Autowired
IPostsService postsService;
/**
* 保存帖子
*
* @param vo
* @return
*/
@Override
@PostMapping("/save")
public Integer save(@RequestBody PostsSaveVo vo) {
return postsService.save(vo);
}
/**
* 查看完整帖子
*
* @param vo
* @return
*/
@Override
@PostMapping("/get")
public PostsSaveVo get(@RequestBody PostsParamsVo vo) {
return postsService.get(vo);
}
/**
* 帖子修改
*
* @param vo
* @return
*/
@Override
@PostMapping("/update")
public Integer update(@RequestBody PostsSaveVo vo) {
return postsService.update(vo);
}
/**
* 帖子上下架
*
* @param vo
* @return
*/
@Override
@PostMapping("/upOrDown")
public Integer upOrDown(@RequestBody PostsParamsVo vo) {
return postsService.upOrDown(vo);
}
/**
* 帖子加精或置顶
*
* @param vo
* @return
*/
@Override
@PostMapping("/topOrHighlight")
public Integer topOrHighlight(@RequestBody PostsParamsVo vo) {
return postsService.topOrHighlight(vo);
}
@Override
@PostMapping("/getPage")
public Page<PostsManageVo> getPage(@RequestBody PostsParamsVo vo) {
return postsService.getPage(vo);
}
}
package com.yizhi.forum.application.controller;
import com.yizhi.forum.application.feign.student.StudentPostsFavoriteClient;
import com.yizhi.forum.application.service.IPostsFavoriteService;
import com.yizhi.forum.application.vo.domain.PostsFavoriteVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* <p>
* 前端控制器
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@RestController
@RequestMapping("/postsFavorite")
public class PostsFavoriteController implements StudentPostsFavoriteClient {
@Autowired
private IPostsFavoriteService postsFavoriteService;
@Override
@PostMapping("/save")
public Integer save(@RequestBody PostsFavoriteVo postsFavorite){
return postsFavoriteService.save(postsFavorite);
}
@Override
@PostMapping("/deleted")
public Integer deleted(@RequestBody PostsFavoriteVo postsFavorite){
return postsFavoriteService.deleted(postsFavorite);
}
@Override
@GetMapping("/hasFavoriteByPostsId")
public Integer hasFavoriteByPostsId(@RequestParam("postsId") Long postsId) {
return postsFavoriteService.hasFavoriteByPostsId(postsId,false);
}
@Override
@GetMapping("/hasFavoriteByPostsIds")
public Map<Long,Integer> hasFavoriteByPostsIds(@RequestParam("postsIds") List<Long> postsIds) {
return postsFavoriteService.hasFavoriteByPostsIds(postsIds);
}
}
package com.yizhi.forum.application.controller;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.forum.application.feign.PostsForbiddenAccountClient;
import com.yizhi.forum.application.service.IPostsForbiddenAccountService;
import com.yizhi.forum.application.vo.domain.PostsForbiddenAccountVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@RestController
@RequestMapping("/postsForbiddenAccount")
public class PostsForbiddenAccountController implements PostsForbiddenAccountClient {
@Autowired
private IPostsForbiddenAccountService postsForbiddenAccountService;
@Override
@PostMapping("/save")
public Integer save(@RequestBody PostsForbiddenAccountVo forbiddenAccount) {
return postsForbiddenAccountService.save(forbiddenAccount);
}
@Override
@GetMapping("/getPage")
public Page<PostsForbiddenAccountVo> getPage(@RequestParam("postsId") Long postsId,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize) {
return postsForbiddenAccountService.getPage(postsId, pageNo, pageSize);
}
@Override
@PostMapping("/deleted")
public Integer deleted(@RequestBody PostsForbiddenAccountVo forbiddenAccount) {
return postsForbiddenAccountService.delete(forbiddenAccount);
}
@Override
@GetMapping("/hasForbiddenByPostsId")
public Integer hasForbiddenByPostsId(@RequestParam("postsId") Long postsId) {
return postsForbiddenAccountService.hasForbiddenByPostsId(postsId);
}
@Override
@GetMapping("/getListByPostsId")
public List<PostsForbiddenAccountVo> getListByPostsId(@RequestParam("postsIds") List<Long> postsIds) {
return postsForbiddenAccountService.getListByPostsId(postsIds);
}
}
package com.yizhi.forum.application.controller;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.forum.application.feign.PostsManageAccountClient;
import com.yizhi.forum.application.service.IPostsManageAccountService;
import com.yizhi.forum.application.vo.forum.PostsManageAccountParamVo;
import com.yizhi.forum.application.vo.forum.PostsManageAccountVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* <p>
* 代管员接口
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@RestController
@RequestMapping("/postsManageAccount")
public class PostsManageAccountController implements PostsManageAccountClient {
@Autowired
private IPostsManageAccountService postsManageAccountService;
@PostMapping("/save")
public Boolean save(@RequestBody PostsManageAccountParamVo vo) {
return postsManageAccountService.save(vo);
}
@Override
@GetMapping("/getManager")
public List<PostsManageAccountVo> getManager(@RequestParam("postsClassifyId") Long postsClassifyId){
return postsManageAccountService.getManager(postsClassifyId, ContextHolder.get().getSiteId());
}
}
package com.yizhi.forum.application.controller;
import com.yizhi.forum.application.constans.ForumConstans;
import com.yizhi.forum.application.feign.PostsReadRecordsClient;
import com.yizhi.forum.application.service.IPostsReadRecordsService;
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;
/**
* <p>
* 前端控制器
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@RestController
@RequestMapping("/postsReadRecords")
public class PostsReadRecordsController implements PostsReadRecordsClient {
@Autowired
private IPostsReadRecordsService postsReadRecordsService;
@Override
@GetMapping("/insertReadRecord")
public Integer insertReadRecord(@RequestParam("postsId") Long postsId, @RequestParam("terminalType") Integer terminalType) {
//插入查看帖子的阅读记录
return postsReadRecordsService.insertRecord(ForumConstans.ZERO, postsId, terminalType);
}
}
package com.yizhi.forum.application.controller;
import com.yizhi.forum.application.feign.PostsVisibleRangeClient;
import com.yizhi.forum.application.service.IPostsVisibleRangeService;
import com.yizhi.forum.application.vo.forum.PostsVisibleRangeVo;
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.RestController;
import java.util.List;
/**
* <p>
* 帖子的指定范围
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@RestController
@RequestMapping("/postsVisibleRange")
public class PostsVisibleRangeController implements PostsVisibleRangeClient {
@Autowired
private IPostsVisibleRangeService postsVisibleRangeService;
@Override
@GetMapping("/getVisibleRange")
public List<PostsVisibleRangeVo> getVisibleRange(Long postsId) {
return postsVisibleRangeService.getListByPostsId(postsId);
}
}
package com.yizhi.forum.application.controller.remote;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.yizhi.forum.application.constans.ForumConstans;
import com.yizhi.forum.application.domain.Posts;
import com.yizhi.forum.application.feign.remote.RemotePostsClient;
import com.yizhi.forum.application.service.IPostsAppendixService;
import com.yizhi.forum.application.service.IPostsService;
import com.yizhi.forum.application.vo.forum.PostsParamsVo;
import com.yizhi.forum.application.vo.forum.PostsStudentVo;
import com.yizhi.forum.application.vo.domain.PostsVo;
import com.yizhi.forum.application.vo.forum.StatisticsForumAccountVo;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* <p>
* 帖子接口
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@RestController
@RequestMapping("/remote/posts")
public class RemotePostsController implements RemotePostsClient {
@Autowired
private IPostsService postsService;
@Autowired
private IPostsAppendixService postsAppendixService;
/**
* 帖子基本信息修改
*
* @param vo
* @return
*/
@Override
@PostMapping("/update/info")
public Integer updateInfo(@RequestBody PostsVo vo) {
return postsService.updateInfo(vo);
}
@Override
@PostMapping("/getList")
public List<PostsVo> getList(@RequestBody PostsParamsVo vo) {
List<Posts> list = postsService.getList(vo);
List<PostsVo> lists = new ArrayList<>();
for (Posts p : list) {
PostsVo postsVo = new PostsVo();
BeanUtils.copyProperties(p, postsVo);
lists.add(postsVo);
}
return lists;
}
@Override
@PostMapping("/getMap")
public Map<Long, PostsStudentVo> getMap(@RequestBody PostsParamsVo vo) {
return postsService.getMap(vo);
}
@Override
@GetMapping("/get/info")
public PostsVo getInfo(@RequestParam("postsId") Long postsId) {
Posts list = postsService.getInfo(postsId);
PostsVo postsVo = new PostsVo();
BeanUtils.copyProperties(list, postsVo);
return postsVo;
}
/**
* 报表需要取得所有已上架的帖子
*
* @return
*/
@Override
@GetMapping("/getAllPosts")
public List<PostsVo> getAllPosts() {
Posts posts = new Posts();
posts.setStatus(ForumConstans.UP);
posts.setDeleted(ForumConstans.NOT_DELETED);
List<Posts> list = postsService.selectList(new EntityWrapper<>(posts));
List<PostsVo> lists = new ArrayList<>();
for (Posts p : list) {
PostsVo postsVo = new PostsVo();
BeanUtils.copyProperties(p, postsVo);
lists.add(postsVo);
}
return lists;
}
/**
* 报表需要个人的帖子数据Map
*
* @return
*/
@Override
@GetMapping("/getPersonalDataMap")
public Map<Long, StatisticsForumAccountVo> getPersonalDataMap() {
return postsService.getPersonalDataMap();
}
/**
* 首页展示精选中的帖子需要帖子实时名称
*
* @param postsIds
* @return
*/
@Override
@GetMapping("/getNames")
public Map<Long, String> getNames(@RequestParam(value = "postsIds", required = false) List<Long> postsIds) {
return postsService.getNames(postsIds);
}
@Override
@GetMapping({"/verifyVideo"})
public boolean verifyVideo(@RequestParam("postsAppendixIds") List<Long> postsAppendixIds) {
return postsAppendixService.verifyVideo(postsAppendixIds);
}
@Override
@PostMapping({"/updateVideoTranscodeUrl"})
public boolean updateVideoTranscodeUrl(@RequestBody Map<String, String> var1) {
return postsAppendixService.updateVideoTranscodeUrl(var1);
}
}
package com.yizhi.forum.application.controller.student;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.forum.application.feign.student.StudentPostsClassifyClient;
import com.yizhi.forum.application.service.IPostsClassifyService;
import com.yizhi.forum.application.vo.domain.PostsClassifyVo;
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.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 学员端分类接口
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@RestController
@RequestMapping("/postsClassify/student/")
public class StudentPostsClassifyController implements StudentPostsClassifyClient {
private Logger logger = LoggerFactory.getLogger(StudentPostsClassifyController.class);
@Autowired
private IPostsClassifyService postsClassifyService;
/**
* 学员端分类分页查询
*
* @param name
* @param canSend 是否对发帖可见范围作判断
* @param pageNo
* @param pageSize
* @return
*/
@Override
@GetMapping("/getPageToStudent")
public Page<PostsClassifyVo> getPageToStudent(@RequestParam(value = "name",required = false) String name,
@RequestParam("canSend") Boolean canSend,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize) {
return postsClassifyService.getPageToStudent(name, canSend, pageNo, pageSize);
}
}
package com.yizhi.forum.application.controller.student;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.application.orm.id.IdGenerator;
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.constans.ForumConstans;
import com.yizhi.forum.application.domain.Posts;
import com.yizhi.forum.application.feign.student.StudentPostsClient;
import com.yizhi.forum.application.service.IPostsService;
import com.yizhi.forum.application.vo.forum.PostsParamsVo;
import com.yizhi.forum.application.vo.forum.PostsSaveVo;
import com.yizhi.forum.application.vo.forum.PostsStudentVo;
import com.yizhi.point.application.feign.PointRedisFeignClients;
import com.yizhi.point.application.vo.PointParamVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* <p>
* 帖子接口
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
@RestController
@RequestMapping("/posts/student")
public class StudentPostsController implements StudentPostsClient {
@Autowired
IPostsService postsService;
@Autowired
private PointRedisFeignClients pointRedisFeignClients;
@Autowired
private AmqpTemplate amqpTemplate;
@Autowired
private TaskExecutor taskExecutor;
@Autowired
private IdGenerator idGenerator;
/**
* 参数解释见mypage
*
* @param type
* @param keyword
* @param classifyId
* @param pageNo
* @param pageSize
* @return
*/
@Override
@GetMapping("/getPageToStudent")
public Page<PostsStudentVo> getPageToStudent(@RequestParam("type") Integer type,
@RequestParam(value = "keyword", required = false) String keyword,
@RequestParam(value = "classifyId", required = false) Long classifyId,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize) {
return postsService.getPageToStudent(type, keyword, classifyId, pageNo, pageSize);
}
/**
* 保存帖子
*
* @param vo
* @return
*/
@Override
@PostMapping("/save")
public Integer studentSave(@RequestBody PostsSaveVo vo) {
Long id = idGenerator.generate();
vo.setId(id);
Integer save = postsService.save(vo);
if (save > 0 && ForumConstans.UP.equals(vo.getType())) {
// 发积分
sendPoint(id, ContextHolder.get(), vo.getTitle());
}
return save;
}
@Override
@PostMapping("/get")
public PostsSaveVo studentGet(@RequestBody PostsParamsVo vo) {
return postsService.get(vo);
}
/**
* 我的发帖 我的收藏 我的管理 分页数据
*
* @param type 1:我的发帖 2:我的收藏 3:我的管理
* @param status 0:草稿 1:下架 2:上架
* @param keyword 分类名称或帖子标题
* @param classifyId
* @param pageNo
* @param pageSize
* @return
*/
@Override
@GetMapping("/myPage")
public Page<PostsStudentVo> myPage(@RequestParam("type") Integer type,
@RequestParam(value = "status",required = false) Integer status,
@RequestParam(value = "keyword",required = false) String keyword,
@RequestParam(value = "classifyId",required = false) Long classifyId,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize) {
return postsService.myPage(type, status, keyword, classifyId, pageNo, pageSize);
}
/**
* 学员端修改帖子
*
* @param vo
* @return
*/
@Override
@PostMapping("/update")
public Integer update(@RequestBody PostsSaveVo vo) {
return postsService.update(vo);
}
/**
* 学员端删除帖子
*
* @param vo
* @return
*/
@Override
@PostMapping("/deleted")
public Integer deleted(@RequestBody PostsParamsVo vo) {
return postsService.upOrDown(vo);
}
@Override
@PostMapping("/topOrHighlight")
public Integer topOrHighlight(@RequestBody PostsParamsVo vo) {
return postsService.topOrHighlight(vo);
}
@Override
@GetMapping("/getMapByIds")
public Map<Long, PostsStudentVo> getMapByIds(@RequestParam("postsIds") List<Long> postsIds) {
return postsService.getMapByIds(postsIds);
}
/**
* 判断是否发积分
*
* @param postsId 帖子id
* @param context
*/
public void sendPoint(Long postsId, RequestContext context, String activityName) {
taskExecutor.asynExecute(new AbstractTaskHandler() {
@Override
public void handle() {
//论坛回帖发送积分
PointParamVO pointParamVO = new PointParamVO();
pointParamVO.setEventName("pointForum");
pointParamVO.setActivityName(activityName);
pointParamVO.setActivityType("发布论坛帖子发放积分");
pointParamVO.setActivitySource("论坛");
pointParamVO.setCreatePointTime(new Date());
pointParamVO.setSourceId(postsId);
pointParamVO.setAccountId(context.getAccountId());
pointParamVO.setSiteId(context.getSiteId());
pointParamVO.setCompanyId(context.getCompanyId());
pointParamVO.setAccountName(context.getAccountName());
pointParamVO.setOrgId(context.getOrgId());
pointParamVO.setOperatingPoint(0);
Posts info = postsService.getInfo(postsId);
if (info != null) {
pointParamVO.setOperatingPoint(info.getSendPoint());
}
String sitePointId = pointRedisFeignClients.addPointRedis(pointParamVO);
// 发送积分
if (!StringUtils.isEmpty(sitePointId)) {
amqpTemplate.convertAndSend("forum", sitePointId);
}
}
});
}
/**
* 获取我的回复(用户的回复收到新的回复未查看时)、我的管理(有回复、举报或帖子未查看)的数量
*
* @return
*/
@Override
@GetMapping("/getMyNum")
@ApiOperation(value = "获取我的管理(有回复、举报或帖子未查看)的数量")
public Integer getMyNum() {
return postsService.getMyNum();
}
}
package com.yizhi.forum.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-09
*/
@Data
@ApiModel(value = "PostsVo", description = "帖子表")
@TableName("posts")
public class Posts {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "帖子id")
private Long id;
@ApiModelProperty(value = "帖子分类id")
@TableField("posts_classify_id")
private Long postsClassifyId;
@ApiModelProperty(value = "帖子名称")
private String title;
@ApiModelProperty(value = "帖子封面(取内容里的图片)")
private String logo;
@ApiModelProperty(value = "状态 0:草稿 1:未上架 2:上架")
private Integer status;
@ApiModelProperty(value = "作者用户id")
private Long author;
@ApiModelProperty(value = "0:全平台 1:指定用户")
@TableField("visible_range")
private Integer visibleRange;
@ApiModelProperty(value = "是否置顶 0:未置顶(默认) 1:置顶")
@TableField("is_top")
private Integer isTop;
@ApiModelProperty(value = "置顶时间 --is_top为1时有效,初始值为创建时间 ")
@TableField("top_time")
private Date topTime;
@ApiModelProperty(value = "是否加精 0:未加精(默认) 1:加精")
@TableField("is_highlight")
private Integer isHighlight;
@ApiModelProperty(value = "加精时间 --is_highlight为1时有效,初始值为创建时间 ")
@TableField("highlight_time")
private Date highlightTime;
@ApiModelProperty(value = "点赞数")
@TableField("thumbs_num")
private Integer thumbsNum;
@ApiModelProperty(value = "阅读人数")
@TableField("read_num")
private Integer readNum;
@ApiModelProperty(value = "举报人数")
@TableField("inform_num")
private Integer informNum;
@ApiModelProperty(value = "是否有新的举报而未被管理 0:未被管理(默认) 1:已被管理")
@TableField("has_new_inform")
private Integer hasNewInform;
@ApiModelProperty(value = "回复人数")
@TableField("reply_num")
private Integer replyNum;
@ApiModelProperty(value = "评论人数")
@TableField("comment_num")
private Integer commentNum;
@ApiModelProperty(value = "最新回复时间 初始值为创建时间 ")
@TableField("comment_time")
private Date commentTime;
@ApiModelProperty(value = "未被管理员阅读评论数")
@TableField("new_comment_num")
private Integer newCommentNum;
@ApiModelProperty(value = "是否已经被管理 0:未被管理(默认) 1:已被管理")
@TableField("has_manage")
private Integer hasManage;
@ApiModelProperty(value = "终端类型:1-管理端 2-pc端 3-微信端 4-app")
@TableField("terminal_type")
private Integer terminalType;
@ApiModelProperty(value = "若置顶该字段为允许的时间最大值,有回复则记录最新回复时间,默认帖子创建时间" +
"置顶时间>回复时间>创建时间 ")
@TableField("sort_time")
private Date sortTime;
@ApiModelProperty(value = "有新的举报(包括对帖子和对回复的),有新的回复,帖子刚发表(包括修改以后发表)")
@TableField("manage_sort_time")
private Date manageSortTime;
@ApiModelProperty(value = "被收藏时间")
@TableField("favorite_time")
private Date favoriteTime;
@ApiModelProperty(value = "是否删除(0:否,1:是)")
@TableLogic
private Integer deleted;
@TableField("org_id")
private Long orgId;
@TableField("site_id")
private Long siteId;
@TableField("company_id")
private Long companyId;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@ApiModelProperty(value = "发表时间")
@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;
@ApiModelProperty(value = "修改时间 初始值为发表时间")
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@ApiModelProperty(value = "发帖可得积分")
@TableField(exist = false)
private Integer sendPoint;
@ApiModelProperty(value = "评论可得积分 ")
@TableField(exist = false)
private Integer commentPoint;
}
package com.yizhi.forum.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-09
*/
@Data
@ApiModel(value = "PostsAppendixVo", description = "帖子附件表")
@TableName("posts_appendix")
public class PostsAppendix {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
private Long id;
@ApiModelProperty(value = "帖子id")
@TableField("posts_id")
private Long postsId;
@ApiModelProperty(value = "附件名称 ")
private String name;
@ApiModelProperty(value = "附件大小")
@TableField("file_size")
private Double fileSize;
@ApiModelProperty(value = "文件后缀名")
@TableField("file_suffer")
private String fileSuffer;
@ApiModelProperty(value = "下载路径")
private String url;
@ApiModelProperty(value = "附件类型 :1、文档;2、图片;3、音频;4、视频;5、其他(压缩包)")
private Integer type;
@ApiModelProperty(value = "是否删除 0:未删除、1:已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "是否经过转码 1:已转")
@TableField("is_video")
private Integer isVideo;
@ApiModelProperty(value = "经过阿里云转码后的url")
@TableField("aliyun_url")
private String aliyunUrl;
@ApiModelProperty(value = "创建者id")
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@ApiModelProperty(value = "创建者名称")
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@ApiModelProperty(value = "创建时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@ApiModelProperty(value = "更新者id")
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@ApiModelProperty(value = "修改者名称")
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@ApiModelProperty(value = "修改时间")
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@ApiModelProperty(value = "站点id")
@TableField("site_id")
private Long siteId;
}
package com.yizhi.forum.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-09
*/
@Data
@ApiModel(value = "PostsClassifyEntityVo", description = "帖子分类表")
@TableName("posts_classify")
public class PostsClassify {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "分类id")
private Long id;
@ApiModelProperty(value = "名称 20个字符内")
private String name;
@ApiModelProperty(value = "分类编码 备用")
private String code;
@ApiModelProperty(value = "备注 100个字符内")
private String description;
@ApiModelProperty(value = "发帖可得积分")
@TableField("send_point")
private Integer sendPoint;
@ApiModelProperty(value = "评论可得积分 ")
@TableField("comment_point")
private Integer commentPoint;
@ApiModelProperty(value = "0:平台用户 1:指定用户 可评论人员范围")
@TableField("comment_setting")
private Integer commentSetting;
@ApiModelProperty(value = "0:平台用户 1:指定用户 可发帖人员范围")
@TableField("send_setting")
private Integer sendSetting;
@ApiModelProperty(value = "是否删除(0:否,1:是)")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "排序字段")
private Integer sort;
@TableField("org_id")
private Long orgId;
@TableField("site_id")
private Long siteId;
@TableField("company_id")
private Long companyId;
@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.forum.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-09
*/
@Data
@ApiModel(value = "PostsClassifyAccountVo", description = "可发帖、评论人员表")
@TableName("posts_classify_account")
public class PostsClassifyAccount {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id ")
private Long id;
@ApiModelProperty(value = "帖子分类id")
@TableField("posts_classify_id")
private Long postsClassifyId;
@ApiModelProperty(value = "类型(1:可发帖人员、2:可评论人员)")
private Integer type;
@ApiModelProperty(value = "用户类型:1-部门 2-用户 ")
@TableField("account_type")
private Integer accountType;
@ApiModelProperty(value = "用户id或部门id ")
@TableField("account_id")
private Long accountId;
@ApiModelProperty(value = "是否删除(0:否,1:是)")
@TableLogic
private Integer deleted;
@TableField("site_id")
private Long siteId;
@ApiModelProperty(value = "创建人")
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@ApiModelProperty(value = "创建人姓名")
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@ApiModelProperty(value = "创建时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@ApiModelProperty(value = "修改人id")
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@ApiModelProperty(value = "修改人账号")
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@ApiModelProperty(value = "修改时间")
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
}
package com.yizhi.forum.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-09
*/
@Data
@ApiModel(value = "PostsContentVo", description = "帖子内容表")
@TableName("posts_content")
public class PostsContent {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "帖子id")
@TableField("posts_id")
private Long postsId;
@ApiModelProperty(value = "帖子内容")
private String content;
@ApiModelProperty(value = "是否删除(0:否,1:是)")
@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.forum.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-09
*/
@Data
@ApiModel(value = "PostsFavoriteVo", description = "帖子收藏表")
@TableName("posts_favorite")
public class PostsFavorite {
private static final long serialVersionUID = 1L;
private Long id;
@ApiModelProperty(value = "帖子id")
@TableField("posts_id")
private Long postsId;
@TableField("account_id")
private Long accountId;
@ApiModelProperty(value = "是否删除(0:否,1:是)")
@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;
@TableField("company_id")
private Long companyId;
@TableField("site_id")
private Long siteId;
@TableField("org_id")
private Long orgId;
}
package com.yizhi.forum.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-09
*/
@Data
@ApiModel(value = "PostsForbbidenAccount", description = "禁言人员表")
@TableName("posts_forbbiden_account")
public class PostsForbiddenAccount {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "帖子id")
@TableField("posts_id")
private Long postsId;
@ApiModelProperty(value = "用户id ")
@TableField("account_id")
private Long accountId;
@ApiModelProperty(value = "是否删除(0:否,1:是)")
@TableLogic
private Integer deleted;
@TableField("site_id")
private Long siteId;
@TableField(exist = false)
@ApiModelProperty(value = "被禁言用户名")
private String accountName;
@TableField(exist = false)
@ApiModelProperty(value = "被禁言用户头像")
private String photo;
@ApiModelProperty(value = "创建人")
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@ApiModelProperty(value = "创建人姓名")
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@ApiModelProperty(value = "创建时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@ApiModelProperty(value = "修改人id")
@TableField(value = "update_by_id", fill = FieldFill.UPDATE)
private Long updateById;
@ApiModelProperty(value = "修改人账号")
@TableField(value = "update_by_name", fill = FieldFill.UPDATE)
private String updateByName;
@ApiModelProperty(value = "修改时间")
@TableField(value = "update_time", fill = FieldFill.UPDATE)
private Date updateTime;
}
package com.yizhi.forum.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-09
*/
@Data
@ApiModel(value = "PostsManageAccountVo", description = "代管员表")
@TableName("posts_manage_account")
public class PostsManageAccount {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id ")
private Long id;
@ApiModelProperty(value = "帖子分类id")
@TableField("posts_classify_id")
private Long postsClassifyId;
@ApiModelProperty(value = "用户id ")
@TableField("account_id")
private Long accountId;
@ApiModelProperty(value = "是否删除(0:否,1:是)")
@TableLogic
private Integer deleted;
@TableField("site_id")
private Long siteId;
@ApiModelProperty(value = "创建人")
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@ApiModelProperty(value = "创建人姓名")
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@ApiModelProperty(value = "创建时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@ApiModelProperty(value = "修改人id")
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@ApiModelProperty(value = "修改人账号")
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@ApiModelProperty(value = "修改时间")
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
}
package com.yizhi.forum.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-09
*/
@Data
@ApiModel(value = "PostsReadRecordVo", description = "帖子阅读记录表")
@TableName("posts_read_record")
public class PostsReadRecord {
private static final long serialVersionUID = 1L;
private Long id;
@ApiModelProperty(value = "帖子id")
@TableField("posts_id")
private Long postsId;
@ApiModelProperty(value = "用户id ")
@TableField("account_id")
private Long accountId;
@ApiModelProperty(value = "终端类型:1-管理端 2-pc端 3-微信端 4-app")
@TableField("terminal_type")
private Integer terminalType;
@ApiModelProperty(value = "是否删除(0:否,1:是)")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建人")
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@ApiModelProperty(value = "创建人姓名")
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@ApiModelProperty(value = "阅读时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@ApiModelProperty(value = "修改人id")
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@ApiModelProperty(value = "修改人账号")
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@ApiModelProperty(value = "修改时间")
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@TableField("site_id")
private Long siteId;
}
package com.yizhi.forum.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-09
*/
@Data
@ApiModel(value = "PostsRelationVo", description = "帖子关联业务表")
@TableName("posts_relation")
public class PostsRelation {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "业务类型 1:training、2:course、3:offline_course、4:exam、5:research、6:live、7:assignment、8:案列活动、9:精选案列")
private Integer type;
@ApiModelProperty(value = "业务id")
@TableField("relation_id")
private Long relationId;
@ApiModelProperty(value = "帖子id")
@TableField("posts_id")
private Long postsId;
@ApiModelProperty(value = "业务logo")
@TableField("task_logo")
private String taskLogo;
@ApiModelProperty(value = "业务名称")
@TableField("task_name")
private String taskName;
@ApiModelProperty(value = "备用字段")
@TableField("spare_field")
private String spareField;
@ApiModelProperty(value = "是否删除(0:否,1:是)")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建人")
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@ApiModelProperty(value = "创建人姓名")
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@ApiModelProperty(value = "创建时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@ApiModelProperty(value = "修改人id")
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@ApiModelProperty(value = "修改人账号")
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@ApiModelProperty(value = "修改时间")
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
}
package com.yizhi.forum.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-09
*/
@Data
@ApiModel(value = "PostsVisibleRangeVo", description = "帖子可见范围表")
@TableName("posts_visible_range")
public class PostsVisibleRange {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "帖子id")
@TableField("posts_id")
private Long postsId;
@ApiModelProperty(value = "用户类型:1-部门 2-用户 ")
@TableField("account_type")
private Integer accountType;
@ApiModelProperty(value = "用户id或部门id ")
@TableField("account_id")
private Long accountId;
@ApiModelProperty(value = "是否删除(0:否,1:是)")
@TableLogic
private Integer deleted;
@TableField("site_id")
private Long siteId;
@ApiModelProperty(value = "创建人")
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@ApiModelProperty(value = "创建人姓名")
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@ApiModelProperty(value = "创建时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@ApiModelProperty(value = "修改人id")
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@ApiModelProperty(value = "修改人账号")
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@ApiModelProperty(value = "修改时间")
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
}
package com.yizhi.forum.application.mapper;
import com.yizhi.forum.application.domain.PostsAppendix;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
public interface PostsAppendixMapper extends BaseMapper<PostsAppendix> {
}
package com.yizhi.forum.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yizhi.forum.application.domain.PostsClassifyAccount;
/**
* <p>
* Mapper 接口
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
public interface PostsClassifyAccountMapper extends BaseMapper<PostsClassifyAccount> {
}
package com.yizhi.forum.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yizhi.forum.application.domain.PostsClassify;
import com.yizhi.forum.application.vo.domain.PostsClassifyVo;
import org.apache.ibatis.annotations.Param;
/**
* <p>
* Mapper 接口
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
public interface PostsClassifyMapper extends BaseMapper<PostsClassify> {
Integer setSort(@Param("id") String id, @Param("siteId") Long siteId);
Integer getMaxSort(@Param("siteId") Long siteId);
PostsClassify getSort(@Param("id") Long id, @Param("siteId") Long siteId, @Param("type") Integer type);
}
package com.yizhi.forum.application.mapper;
import com.yizhi.forum.application.domain.PostsContent;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
public interface PostsContentMapper extends BaseMapper<PostsContent> {
}
package com.yizhi.forum.application.mapper;
import com.yizhi.forum.application.domain.PostsFavorite;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
public interface PostsFavoriteMapper extends BaseMapper<PostsFavorite> {
}
package com.yizhi.forum.application.mapper;
import com.yizhi.forum.application.domain.PostsForbiddenAccount;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
public interface PostsForbiddenAccountMapper extends BaseMapper<PostsForbiddenAccount> {
}
package com.yizhi.forum.application.mapper;
import com.yizhi.forum.application.domain.PostsManageAccount;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author taoge123
* @since 2020-01-09
*/
public interface PostsManageAccountMapper extends BaseMapper<PostsManageAccount> {
}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
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