tagIds;
-
- /**
- * 简介
- */
- private String summary;
-
- /**
- * 正文内容
- */
- private String content;
-
- /**
- * 封面
- */
- private String cover;
-
- /**
- * 文本类型
- *
- * @see com.github.liueyueyi.forum.api.model.enums.ArticleTypeEnum
- */
- private String articleType;
-
-
- /**
- * 来源:1-转载,2-原创,3-翻译
- *
- * @see com.github.liueyueyi.forum.api.model.enums.SourceTypeEnum
- */
- private Integer source;
-
- /**
- * 原文地址
- */
- private String sourceUrl;
-
- /**
- * POST 发表, SAVE 暂存 DELETE 删除
- */
- private String actionType;
-
- public PushStatusEnum pushStatus() {
- if ("post".equalsIgnoreCase(actionType)) {
- return PushStatusEnum.ONLINE;
- } else {
- return PushStatusEnum.OFFLINE;
- }
- }
-
- public boolean deleted() {
- return "delete".equalsIgnoreCase(actionType);
- }
-}
\ No newline at end of file
diff --git a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/article/dto/ArticleDTO.java b/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/article/dto/ArticleDTO.java
deleted file mode 100644
index 0ad7fc372..000000000
--- a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/article/dto/ArticleDTO.java
+++ /dev/null
@@ -1,119 +0,0 @@
-package com.github.liueyueyi.forum.api.model.vo.article.dto;
-
-import com.github.liueyueyi.forum.api.model.vo.user.dto.ArticleFootCountDTO;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * 文章信息
- *
- * DTO 定义返回给web前端的实体类 (VO)
- *
- * @author YiHui
- * @date 2022/7/24
- */
-@Data
-public class ArticleDTO implements Serializable {
- private static final long serialVersionUID = -793906904770296838L;
-
- private Long articleId;
-
- /**
- * 文章类型:1-博文,2-问答
- */
- private Integer articleType;
-
- /**
- * 作者uid
- */
- private Long author;
-
- /**
- * 作者名
- */
- private String authorName;
-
- /**
- * 文章标题
- */
- private String title;
-
- /**
- * 短标题
- */
- private String shortTitle;
-
- /**
- * 简介
- */
- private String summary;
-
- /**
- * 封面
- */
- private String cover;
-
- /**
- * 正文
- */
- private String content;
-
- /**
- * 文章来源
- *
- * @see com.github.liueyueyi.forum.api.model.enums.SourceTypeEnum
- */
- private String sourceType;
-
- /**
- * 原文地址
- */
- private String sourceUrl;
-
- /**
- * 0 未发布 1 已发布
- */
- private Integer status;
-
- /**
- * 创建时间
- */
- private Long createTime;
-
- /**
- * 最后更新时间
- */
- private Long lastUpdateTime;
-
- /**
- * 分类
- */
- private CategoryDTO category;
-
- /**
- * 标签
- */
- private List tags;
-
- /**
- * 表示当前查看的用户是否已经点赞过
- */
- private Boolean praised;
-
- /**
- * 表示当用户是否评论过
- */
- private Boolean commented;
-
- /**
- * 表示当前用户是否收藏过
- */
- private Boolean collected;
-
- /**
- * 文章对应的统计计数
- */
- private ArticleFootCountDTO count;
-}
diff --git a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/article/dto/ArticleListDTO.java b/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/article/dto/ArticleListDTO.java
deleted file mode 100644
index 3bf4fd555..000000000
--- a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/article/dto/ArticleListDTO.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.github.liueyueyi.forum.api.model.vo.article.dto;
-
-import lombok.Data;
-
-import java.util.List;
-
-/**
- * 文章列表信息
- *
- * @author louzai
- * @date 2022/7/31
- */
-@Data
-public class ArticleListDTO {
-
- /**
- * 文章列表
- */
- List articleList;
-
- /**
- * 是否有更多
- */
- private Boolean isMore;
-}
diff --git a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/article/dto/CategoryDTO.java b/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/article/dto/CategoryDTO.java
deleted file mode 100644
index 4486583c6..000000000
--- a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/article/dto/CategoryDTO.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package com.github.liueyueyi.forum.api.model.vo.article.dto;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.io.Serializable;
-
-/**
- * @author YiHui
- * @date 2022/7/24
- */
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-public class CategoryDTO implements Serializable {
- public static final String DEFAULT_TOTAL_CATEGORY = "全部";
- public static final CategoryDTO DEFAULT_CATEGORY = new CategoryDTO(0L, "全部");
-
- private static final long serialVersionUID = 8272116638231812207L;
- public static CategoryDTO EMPTY = new CategoryDTO(-1L, "illegal");
-
- private Long categoryId;
-
- private String category;
-
- private Boolean selected;
-
- public CategoryDTO(Long categoryId, String category) {
- this.categoryId = categoryId;
- this.category = category;
- this.selected = false;
- }
-}
diff --git a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/article/dto/TagDTO.java b/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/article/dto/TagDTO.java
deleted file mode 100644
index b081d82f6..000000000
--- a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/article/dto/TagDTO.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.github.liueyueyi.forum.api.model.vo.article.dto;
-
-import lombok.Data;
-
-import java.io.Serializable;
-
-/**
- * @author YiHui
- * @date 2022/7/24
- */
-@Data
-public class TagDTO implements Serializable {
- private static final long serialVersionUID = -8614833588325787479L;
-
- private Long categoryId;
-
- private Long tagId;
-
- private String tag;
-}
diff --git a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/comment/dto/UserFollowDTO.java b/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/comment/dto/UserFollowDTO.java
deleted file mode 100644
index edc72a231..000000000
--- a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/comment/dto/UserFollowDTO.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.github.liueyueyi.forum.api.model.vo.comment.dto;
-
-import lombok.Data;
-
-/**
- * 关注用户
- *
- * @author louzai
- * @since 2022/7/19
- */
-@Data
-public class UserFollowDTO {
-
- /**
- * 关系ID
- */
- private Long userRelationId;
-
- /**
- * 用户ID
- */
- private Long userId;
-
- /**
- * 用户名
- */
- private String userName;
-
- /**
- * 用户图像
- */
- private String photo;
-
- /**
- * 个人简介
- */
- private String profile;
-}
diff --git a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/comment/dto/UserFollowListDTO.java b/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/comment/dto/UserFollowListDTO.java
deleted file mode 100644
index b4ebdf1c5..000000000
--- a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/comment/dto/UserFollowListDTO.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package com.github.liueyueyi.forum.api.model.vo.comment.dto;
-
-import lombok.Data;
-
-import java.util.Collections;
-import java.util.List;
-
-/**
- * 关注用户
- *
- * @author louzai
- * @since 2022/7/19
- */
-@Data
-public class UserFollowListDTO {
-
- /**
- * 用户列表
- */
- List userFollowList;
-
- /**
- * 是否有更多
- */
- private Boolean isMore;
-
- public static UserFollowListDTO emptyInstance() {
- UserFollowListDTO res = new UserFollowListDTO();
- res.setUserFollowList(Collections.emptyList());
- res.setIsMore(false);
- return res;
- }
-}
diff --git a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/constants/StatusEnum.java b/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/constants/StatusEnum.java
deleted file mode 100644
index a388998ff..000000000
--- a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/constants/StatusEnum.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package com.github.liueyueyi.forum.api.model.vo.constants;
-
-import lombok.Getter;
-
-/**
- * 异常码规范:
- * xxx - xxx - xxx
- * 业务 - 状态 - code
- *
- * 业务取值
- * - 100 全局
- * - 200 文章相关
- * - 300 评论相关
- * - 400 用户相关
- *
- * 状态:基于http status的含义
- * - 4xx 调用方使用姿势问题
- * - 5xx 服务内部问题
- *
- * code: 具体的业务code
- *
- * @author YiHui
- * @date 2022/7/27
- */
-@Getter
-public enum StatusEnum {
- SUCCESS(0, "OK"),
-
- // 全局传参异常
- ILLEGAL_ARGUMENTS(100_400_001, "参数异常"),
- ILLEGAL_ARGUMENTS_MIXED(100_400_002, "参数异常:%s"),
-
- // 全局权限相关
- FORBID_ERROR(100_403_001, "无权限"),
-
- FORBID_ERROR_MIXED(100_403_002, "无权限:%s"),
-
- // 全局,数据不存在
- RECORDS_NOT_EXISTS(100_500_001, "记录不存在:%s"),
-
-
- // 用户相关异常
- LOGIN_FAILED_MIXED(400_403_001, "登录失败:%s"),
- USER_NOT_EXISTS(400_500_001, "用户不存在:%s"),
-
-
- ;
-
- private int code;
-
- private String msg;
-
- StatusEnum(int code, String msg) {
- this.code = code;
- this.msg = msg;
- }
-}
diff --git a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/user/UserInfoSaveReq.java b/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/user/UserInfoSaveReq.java
deleted file mode 100644
index 311fabdd2..000000000
--- a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/user/UserInfoSaveReq.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package com.github.liueyueyi.forum.api.model.vo.user;
-
-import lombok.Data;
-
-/**
- * 用户信息入参
- *
- * @author louzai
- * @date 2022-07-24
- */
-@Data
-public class UserInfoSaveReq {
-
- /**
- * 用户ID
- */
- private Long userId;
-
- /**
- * 用户名
- */
- private String userName;
-
- /**
- * 用户图像
- */
- private String photo;
-
- /**
- * 职位
- */
- private String position;
-
- /**
- * 公司
- */
- private String company;
-
- /**
- * 个人简介
- */
- private String profile;
-}
diff --git a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/user/UserRelationReq.java b/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/user/UserRelationReq.java
deleted file mode 100644
index b2dae0cb7..000000000
--- a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/user/UserRelationReq.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.github.liueyueyi.forum.api.model.vo.user;
-
-import lombok.Data;
-
-/**
- * 用户关系入参
- *
- * @author louzai
- * @date 2022-07-24
- */
-@Data
-public class UserRelationReq {
-
- /**
- * 用户ID
- */
- private Long userId;
-
- /**
- * 是否关注当前用户
- */
- private Boolean followed;
-}
diff --git a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/user/dto/BaseUserInfoDTO.java b/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/user/dto/BaseUserInfoDTO.java
deleted file mode 100644
index de88acefb..000000000
--- a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/user/dto/BaseUserInfoDTO.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package com.github.liueyueyi.forum.api.model.vo.user.dto;
-
-import com.github.liueyueyi.forum.api.model.entity.BaseDTO;
-import lombok.Data;
-import lombok.experimental.Accessors;
-
-/**
- * @author YiHui
- * @date 2022/8/15
- */
-@Data
-@Accessors(chain = true)
-public class BaseUserInfoDTO extends BaseDTO {
- /**
- * 用户id
- */
- private Long userId;
-
- /**
- * 用户名
- */
- private String userName;
-
- /**
- * 用户角色 admin, normal
- */
- private String role;
-
- /**
- * 用户图像
- */
- private String photo;
- /**
- * 个人简介
- */
- private String profile;
- /**
- * 职位
- */
- private String position;
-
- /**
- * 公司
- */
- private String company;
-
- /**
- * 扩展字段
- */
- private String extend;
-
- /**
- * 是否删除
- */
- private Integer deleted;
-}
diff --git a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/user/dto/UserStatisticInfoDTO.java b/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/user/dto/UserStatisticInfoDTO.java
deleted file mode 100644
index e1091337d..000000000
--- a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/user/dto/UserStatisticInfoDTO.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package com.github.liueyueyi.forum.api.model.vo.user.dto;
-
-import lombok.Data;
-import lombok.ToString;
-
-/**
- * 用户主页信息
- *
- * @author louzai
- * @since 2022/7/19
- */
-@Data
-@ToString(callSuper = true)
-public class UserStatisticInfoDTO extends BaseUserInfoDTO {
-
- /**
- * 关注数
- */
- private Integer followCount;
-
- /**
- * 粉丝数
- */
- private Integer fansCount;
-
- /**
- * 已发布文章数
- */
- private Integer articleCount;
-
- /**
- * 文章点赞数
- */
- private Integer praiseCount;
-
- /**
- * 文章被阅读数
- */
- private Integer readCount;
-
- /**
- * 文章被收藏数
- */
- private Integer collectionCount;
-
- /**
- * 是否关注当前用户
- */
- private Boolean followed;
-}
diff --git a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/user/wx/WxTxtMsgResVo.java b/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/user/wx/WxTxtMsgResVo.java
deleted file mode 100644
index 8e6d267c4..000000000
--- a/form-api/src/main/java/com/github/liueyueyi/forum/api/model/vo/user/wx/WxTxtMsgResVo.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.github.liueyueyi.forum.api.model.vo.user.wx;
-
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-import lombok.Data;
-
-/**
- * 返回的数据结构体
- *
- *
- * @author yihui
- * @link
- * @date 2022/6/20
- */
-@Data
-@JacksonXmlRootElement(localName = "xml")
-public class WxTxtMsgResVo {
-
- @JacksonXmlProperty(localName = "ToUserName")
- private String toUserName;
- @JacksonXmlProperty(localName = "FromUserName")
- private String fromUserName;
- @JacksonXmlProperty(localName = "CreateTime")
- private Long createTime;
- @JacksonXmlProperty(localName = "MsgType")
- private String msgType;
- @JacksonXmlProperty(localName = "Content")
- private String content;
-
-}
diff --git a/forum-core/pom.xml b/forum-core/pom.xml
deleted file mode 100644
index 2bef089de..000000000
--- a/forum-core/pom.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
- quick-forum
- com.github.liuyueyi.quick-forum
- 0.0.1-SNAPSHOT
-
- 4.0.0
-
- forum-core
-
-
- 8
- 8
-
-
-
-
- com.github.liuyueyi.quick-forum
- form-api
-
-
- org.springframework
- spring-context
-
-
- javax.servlet
- javax.servlet-api
-
-
- org.slf4j
- slf4j-api
-
-
- ch.qos.logback
- logback-classic
-
-
- org.apache.commons
- commons-lang3
-
-
-
- com.google.guava
- guava
-
-
-
\ No newline at end of file
diff --git a/forum-core/src/main/java/com/github/liuyueyi/forum/core/package-info.java b/forum-core/src/main/java/com/github/liuyueyi/forum/core/package-info.java
deleted file mode 100644
index 56b8f36bd..000000000
--- a/forum-core/src/main/java/com/github/liuyueyi/forum/core/package-info.java
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * 公共依赖的核心包模块
- *
- * @author YiHui
- * @date 2022/7/6
- */
-package com.github.liuyueyi.forum.core;
\ No newline at end of file
diff --git a/forum-core/src/main/java/com/github/liuyueyi/forum/core/util/CodeGenerateUtil.java b/forum-core/src/main/java/com/github/liuyueyi/forum/core/util/CodeGenerateUtil.java
deleted file mode 100644
index 39b359133..000000000
--- a/forum-core/src/main/java/com/github/liuyueyi/forum/core/util/CodeGenerateUtil.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.github.liuyueyi.forum.core.util;
-
-import java.util.Random;
-
-/**
- * @author YiHui
- * @date 2022/8/15
- */
-public class CodeGenerateUtil {
-
- private static final Random random = new Random();
-
- public static String genCode() {
- return String.format("%06d", random.nextInt(1000_000));
- }
-}
diff --git a/forum-core/src/main/java/com/github/liuyueyi/forum/core/util/DateUtil.java b/forum-core/src/main/java/com/github/liuyueyi/forum/core/util/DateUtil.java
deleted file mode 100644
index 6ed890620..000000000
--- a/forum-core/src/main/java/com/github/liuyueyi/forum/core/util/DateUtil.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.github.liuyueyi.forum.core.util;
-
-import java.time.Instant;
-import java.time.LocalDateTime;
-import java.time.ZoneId;
-import java.time.format.DateTimeFormatter;
-
-/**
- * @author YiHui
- * @date 2022/8/25
- */
-public class DateUtil {
-
- /**
- * 毫秒转日期
- *
- * @param timestamp
- * @return
- */
- public static String time2day(long timestamp) {
- DateTimeFormatter ftf = DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm");
- return ftf.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(timestamp), ZoneId.systemDefault()));
- }
-}
diff --git a/forum-core/src/main/java/com/github/liuyueyi/forum/core/util/IpUtil.java b/forum-core/src/main/java/com/github/liuyueyi/forum/core/util/IpUtil.java
deleted file mode 100644
index 0f7db58ae..000000000
--- a/forum-core/src/main/java/com/github/liuyueyi/forum/core/util/IpUtil.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package com.github.liuyueyi.forum.core.util;
-
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * @author YiHui
- * @date 2022/7/6
- */
-@Slf4j
-public class IpUtil {
- private static final String UNKNOWN = "unKnown";
-
- public static String getClientIp(HttpServletRequest request) {
- try {
- String xIp = request.getHeader("X-Real-IP");
- String xFor = request.getHeader("X-Forwarded-For");
- if (StringUtils.isNotEmpty(xFor) && !UNKNOWN.equalsIgnoreCase(xFor)) {
- //多次反向代理后会有多个ip值,第一个ip才是真实ip
- int index = xFor.indexOf(",");
- if (index != -1) {
- return xFor.substring(0, index);
- } else {
- return xFor;
- }
- }
- xFor = xIp;
- if (StringUtils.isNotEmpty(xFor) && !UNKNOWN.equalsIgnoreCase(xFor)) {
- return xFor;
- }
- if (StringUtils.isBlank(xFor) || UNKNOWN.equalsIgnoreCase(xFor)) {
- xFor = request.getHeader("Proxy-Client-IP");
- }
- if (StringUtils.isBlank(xFor) || UNKNOWN.equalsIgnoreCase(xFor)) {
- xFor = request.getHeader("WL-Proxy-Client-IP");
- }
- if (StringUtils.isBlank(xFor) || UNKNOWN.equalsIgnoreCase(xFor)) {
- xFor = request.getHeader("HTTP_CLIENT_IP");
- }
- if (StringUtils.isBlank(xFor) || UNKNOWN.equalsIgnoreCase(xFor)) {
- xFor = request.getHeader("HTTP_X_FORWARDED_FOR");
- }
- if (StringUtils.isBlank(xFor) || UNKNOWN.equalsIgnoreCase(xFor)) {
- xFor = request.getRemoteAddr();
- }
- return xFor;
- } catch (Exception e) {
- log.error("get remote ip error!", e);
- return "x.0.0.1";
- }
- }
-
-}
diff --git a/forum-core/src/main/java/com/github/liuyueyi/forum/core/util/SpringUtil.java b/forum-core/src/main/java/com/github/liuyueyi/forum/core/util/SpringUtil.java
deleted file mode 100644
index 9ea909b47..000000000
--- a/forum-core/src/main/java/com/github/liuyueyi/forum/core/util/SpringUtil.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.github.liuyueyi.forum.core.util;
-
-import org.springframework.beans.BeansException;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-import org.springframework.context.EnvironmentAware;
-import org.springframework.core.env.Environment;
-import org.springframework.stereotype.Component;
-
-/**
- * @author YiHui
- * @date 2022/8/29
- */
-@Component
-public class SpringUtil implements ApplicationContextAware, EnvironmentAware {
- private static ApplicationContext context;
- private static Environment environment;
-
- @Override
- public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
- SpringUtil.context = applicationContext;
- }
-
- @Override
- public void setEnvironment(Environment environment) {
- SpringUtil.environment = environment;
- }
-
- /**
- * 获取bean
- *
- * @param bean
- * @param
- * @return
- */
- public static T getBean(Class bean) {
- return context.getBean(bean);
- }
-
- public static Object getBean(String beanName) {
- return context.getBean(beanName);
- }
-
- /**
- * 获取配置
- *
- * @param key
- * @return
- */
- public static String getConfig(String key) {
- return environment.getProperty(key);
- }
-}
diff --git a/forum-service/pom.xml b/forum-service/pom.xml
deleted file mode 100644
index 8df8ddd26..000000000
--- a/forum-service/pom.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
- quick-forum
- com.github.liuyueyi.quick-forum
- 0.0.1-SNAPSHOT
-
- 4.0.0
-
- forum-service
-
-
-
- com.github.liuyueyi.quick-forum
- forum-core
-
-
- org.springframework
- spring-context
-
-
-
- com.fasterxml.jackson.core
- jackson-databind
-
-
-
- com.baomidou
- mybatis-plus-boot-starter
-
-
- mysql
- mysql-connector-java
-
-
-
-
\ No newline at end of file
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/ServiceAutoConfig.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/ServiceAutoConfig.java
deleted file mode 100644
index e404bb120..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/ServiceAutoConfig.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.github.liuyueyi.forum.service;
-
-import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * @author YiHui
- * @date 2022/7/6
- */
-@Configuration
-@ComponentScan("com.github.liuyueyi.forum.service")
-@MapperScan(basePackages = {
- "com.github.liuyueyi.forum.service.article.repository.mapper",
- "com.github.liuyueyi.forum.service.user.repository.mapper",
- "com.github.liuyueyi.forum.service.comment.repository.mapper",})
-public class ServiceAutoConfig {
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/conveter/ArticleConverter.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/conveter/ArticleConverter.java
deleted file mode 100644
index c20b0f30f..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/conveter/ArticleConverter.java
+++ /dev/null
@@ -1,94 +0,0 @@
-package com.github.liuyueyi.forum.service.article.conveter;
-
-import com.github.liueyueyi.forum.api.model.enums.ArticleTypeEnum;
-import com.github.liueyueyi.forum.api.model.enums.SourceTypeEnum;
-import com.github.liueyueyi.forum.api.model.enums.YesOrNoEnum;
-import com.github.liueyueyi.forum.api.model.vo.article.ArticlePostReq;
-import com.github.liueyueyi.forum.api.model.vo.article.dto.ArticleDTO;
-import com.github.liueyueyi.forum.api.model.vo.article.dto.CategoryDTO;
-import com.github.liueyueyi.forum.api.model.vo.article.dto.TagDTO;
-import com.github.liuyueyi.forum.service.article.repository.entity.ArticleDO;
-import com.github.liuyueyi.forum.service.article.repository.entity.CategoryDO;
-import com.github.liuyueyi.forum.service.article.repository.entity.TagDO;
-
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * 文章转换
- *
- *
- * @author louzai
- * @date 2022-07-31
- */
-public class ArticleConverter {
-
- public static ArticleDO toArticleDo(ArticlePostReq req, Long author) {
- ArticleDO article = new ArticleDO();
- // 设置作者ID
- article.setUserId(author);
- article.setId(req.getArticleId());
- article.setTitle(req.getTitle());
- article.setShortTitle(req.getSubTitle());
- article.setArticleType(ArticleTypeEnum.valueOf(req.getArticleType().toUpperCase()).getCode());
- article.setPicture(req.getCover() == null ? "" : req.getCover());
- article.setCategoryId(req.getCategoryId());
- article.setSource(req.getSource());
- article.setSourceUrl(req.getSourceUrl());
- article.setSummary(req.getSummary());
- article.setStatus(req.pushStatus().getCode());
- article.setDeleted(req.deleted() ? YesOrNoEnum.YES.getCode() : YesOrNoEnum.NO.getCode());
- return article;
- }
-
- public static ArticleDTO toDto(ArticleDO articleDO) {
- if (articleDO == null) {
- return null;
- }
- ArticleDTO articleDTO = new ArticleDTO();
- articleDTO.setAuthor(articleDO.getUserId());
- articleDTO.setArticleId(articleDO.getId());
- articleDTO.setArticleType(articleDO.getArticleType());
- articleDTO.setTitle(articleDO.getTitle());
- articleDTO.setShortTitle(articleDO.getShortTitle());
- articleDTO.setSummary(articleDO.getSummary());
- articleDTO.setCover(articleDO.getPicture());
- articleDTO.setSourceType(SourceTypeEnum.formCode(articleDO.getSource()).getDesc());
- articleDTO.setSourceUrl(articleDO.getSourceUrl());
- articleDTO.setStatus(articleDO.getStatus());
- articleDTO.setCreateTime(articleDO.getCreateTime().getTime());
- articleDTO.setLastUpdateTime(articleDO.getUpdateTime().getTime());
-
- // 设置类目id
- articleDTO.setCategory(new CategoryDTO(articleDO.getCategoryId(), null));
- return articleDTO;
- }
-
-
- /**
- * do转换
- *
- * @param tag
- * @return
- */
- public static TagDTO toDto(TagDO tag) {
- TagDTO dto = new TagDTO();
- dto.setTag(tag.getTagName());
- dto.setTagId(tag.getId());
- dto.setCategoryId(tag.getCategoryId());
- return dto;
- }
-
- public static List toDtoList(List tags) {
- return tags.stream().map(ArticleConverter::toDto).collect(Collectors.toList());
- }
-
-
- public static CategoryDTO toDto(CategoryDO category) {
- CategoryDTO dto = new CategoryDTO();
- dto.setCategory(category.getCategoryName());
- dto.setCategoryId(category.getId());
- dto.setSelected(false);
- return dto;
- }
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/dao/ArticleDao.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/dao/ArticleDao.java
deleted file mode 100644
index a54ec3301..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/dao/ArticleDao.java
+++ /dev/null
@@ -1,173 +0,0 @@
-package com.github.liuyueyi.forum.service.article.repository.dao;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.liueyueyi.forum.api.model.enums.DocumentTypeEnum;
-import com.github.liueyueyi.forum.api.model.enums.PushStatusEnum;
-import com.github.liueyueyi.forum.api.model.enums.YesOrNoEnum;
-import com.github.liueyueyi.forum.api.model.vo.PageParam;
-import com.github.liueyueyi.forum.api.model.vo.article.dto.ArticleDTO;
-import com.github.liuyueyi.forum.service.article.conveter.ArticleConverter;
-import com.github.liuyueyi.forum.service.article.repository.entity.ArticleDO;
-import com.github.liuyueyi.forum.service.article.repository.entity.ArticleDetailDO;
-import com.github.liuyueyi.forum.service.article.repository.entity.ReadCountDO;
-import com.github.liuyueyi.forum.service.article.repository.mapper.ArticleDetailMapper;
-import com.github.liuyueyi.forum.service.article.repository.mapper.ArticleMapper;
-import com.github.liuyueyi.forum.service.article.repository.mapper.ReadCountMapper;
-import org.springframework.stereotype.Repository;
-
-import javax.annotation.Resource;
-import java.util.List;
-import java.util.Optional;
-
-/**
- * 文章相关DB操作
- *
- * 多表结构的操作封装,只与DB操作相关
- *
- * @author louzai
- * @date 2022-07-18
- */
-@Repository
-public class ArticleDao extends ServiceImpl {
- @Resource
- private ArticleDetailMapper articleDetailMapper;
- @Resource
- private ReadCountMapper readCountMapper;
-
- /**
- * 查询文章详情
- *
- * @param articleId
- * @return
- */
- public ArticleDTO queryArticleDetail(Long articleId) {
- // 查询文章记录
- ArticleDO article = baseMapper.selectById(articleId);
- if (article == null) {
- return null;
- }
-
- // 查询文章正文
- ArticleDTO dto = ArticleConverter.toDto(article);
- ArticleDetailDO detail = findLatestDetail(articleId);
- dto.setContent(detail.getContent());
- return dto;
- }
-
-
- // ------------ article content ----------------
-
- private ArticleDetailDO findLatestDetail(long articleId) {
- // 查询文章内容
- LambdaQueryWrapper contentQuery = Wrappers.lambdaQuery();
- contentQuery.eq(ArticleDetailDO::getDeleted, YesOrNoEnum.NO.getCode())
- .eq(ArticleDetailDO::getArticleId, articleId)
- .orderByDesc(ArticleDetailDO::getVersion);
- return articleDetailMapper.selectOne(contentQuery);
- }
-
- /**
- * 保存文章正文
- *
- * @param articleId
- * @param content
- * @return
- */
- public Long saveArticleContent(Long articleId, String content) {
- ArticleDetailDO detail = new ArticleDetailDO();
- detail.setArticleId(articleId);
- detail.setContent(content);
- detail.setVersion(1L);
- articleDetailMapper.insert(detail);
- return detail.getId();
- }
-
- /**
- * 更正文章正文
- *
- * @param articleId
- * @param content
- */
- public void updateArticleContent(Long articleId, String content) {
- articleDetailMapper.updateContent(articleId, content);
- }
-
- public List listArticlesByUserId(Long userId, PageParam pageParam) {
- LambdaQueryWrapper query = Wrappers.lambdaQuery();
- query.eq(ArticleDO::getDeleted, YesOrNoEnum.NO.getCode())
- .eq(ArticleDO::getStatus, PushStatusEnum.ONLINE.getCode())
- .eq(ArticleDO::getUserId, userId)
- .last(PageParam.getLimitSql(pageParam))
- .orderByDesc(ArticleDO::getId);
- return baseMapper.selectList(query);
- }
-
-
- public List listArticlesByCategoryId(Long categoryId, PageParam pageParam) {
- if (categoryId != null && categoryId <= 0) {
- // 分类不存在时,表示查所有
- categoryId = null;
- }
- LambdaQueryWrapper query = Wrappers.lambdaQuery();
- query.eq(ArticleDO::getDeleted, YesOrNoEnum.NO.getCode())
- .eq(ArticleDO::getStatus, PushStatusEnum.ONLINE.getCode());
- Optional.ofNullable(categoryId).ifPresent(cid -> query.eq(ArticleDO::getCategoryId, cid));
- query.last(PageParam.getLimitSql(pageParam))
- .orderByDesc(ArticleDO::getId);
- return baseMapper.selectList(query);
- }
-
-
- public List listArticlesByBySearchKey(String key, PageParam pageParam) {
- LambdaQueryWrapper query = Wrappers.lambdaQuery();
- query.eq(ArticleDO::getDeleted, YesOrNoEnum.NO.getCode())
- .eq(ArticleDO::getStatus, PushStatusEnum.ONLINE.getCode())
- .and(!StringUtils.isEmpty(key),
- v -> v.like(ArticleDO::getTitle, key)
- .or()
- .like(ArticleDO::getShortTitle, key)
- .or()
- .like(ArticleDO::getSummary, key));
- query.last(PageParam.getLimitSql(pageParam))
- .orderByDesc(ArticleDO::getId);
- return baseMapper.selectList(query);
- }
-
-
- /**
- * 阅读计数
- *
- * @param articleId
- * @return
- */
- public int incrReadCount(Long articleId) {
- LambdaQueryWrapper query = Wrappers.lambdaQuery();
- query.eq(ReadCountDO::getDocumentId, articleId).eq(ReadCountDO::getDocumentType, DocumentTypeEnum.ARTICLE.getCode());
- ReadCountDO record = readCountMapper.selectOne(query);
- if (record == null) {
- record = new ReadCountDO().setDocumentId(articleId).setDocumentType(DocumentTypeEnum.ARTICLE.getCode()).setCnt(1);
- readCountMapper.insert(record);
- } else {
- // fixme: 这里存在并发覆盖问题,推荐使用 update read_count set cnt = cnt + 1 where id = xxx
- record.setCnt(record.getCnt() + 1);
- readCountMapper.updateById(record);
- }
- return record.getCnt();
- }
-
- /**
- * 统计用户的文章计数
- *
- * @param userId
- * @return
- */
- public int countArticleByUser(Long userId) {
- return lambdaQuery().eq(ArticleDO::getUserId, userId)
- .eq(ArticleDO::getStatus, PushStatusEnum.ONLINE.getCode())
- .eq(ArticleDO::getDeleted, YesOrNoEnum.NO.getCode())
- .count().intValue();
- }
-}
\ No newline at end of file
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/dao/CategoryDao.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/dao/CategoryDao.java
deleted file mode 100644
index 5ce2ef71d..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/dao/CategoryDao.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.github.liuyueyi.forum.service.article.repository.dao;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.liueyueyi.forum.api.model.enums.PushStatusEnum;
-import com.github.liueyueyi.forum.api.model.enums.YesOrNoEnum;
-import com.github.liuyueyi.forum.service.article.repository.entity.CategoryDO;
-import com.github.liuyueyi.forum.service.article.repository.mapper.CategoryMapper;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-/**
- * 类目Service
- *
- * @author louzai
- * @date 2022-07-20
- */
-@Repository
-public class CategoryDao extends ServiceImpl {
- /**
- * @return
- */
- public List listAllCategoriesFromDb() {
- return lambdaQuery()
- .eq(CategoryDO::getDeleted, YesOrNoEnum.NO.getCode())
- .eq(CategoryDO::getStatus, PushStatusEnum.ONLINE.getCode())
- .list();
- }
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/dao/TagDao.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/dao/TagDao.java
deleted file mode 100644
index eebfbe5f1..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/dao/TagDao.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.github.liuyueyi.forum.service.article.repository.dao;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.liueyueyi.forum.api.model.enums.YesOrNoEnum;
-import com.github.liueyueyi.forum.api.model.vo.article.dto.TagDTO;
-import com.github.liuyueyi.forum.service.article.conveter.ArticleConverter;
-import com.github.liuyueyi.forum.service.article.repository.entity.TagDO;
-import com.github.liuyueyi.forum.service.article.repository.mapper.TagMapper;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-/**
- * @author YiHui
- * @date 2022/9/2
- */
-@Repository
-public class TagDao extends ServiceImpl {
- public List listTagsByCategoryId(Long categoryId) {
- List list = lambdaQuery()
- .eq(TagDO::getDeleted, YesOrNoEnum.NO.getCode())
- .eq(TagDO::getCategoryId, categoryId)
- .list();
- return ArticleConverter.toDtoList(list);
- }
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/entity/ArticleDO.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/entity/ArticleDO.java
deleted file mode 100644
index 8b1d5b6a8..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/entity/ArticleDO.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.github.liuyueyi.forum.service.article.repository.entity;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.github.liueyueyi.forum.api.model.entity.BaseDO;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-/**
- * 文章表
- *
- * @author louzai
- * @date 2022-07-18
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-@TableName("article")
-public class ArticleDO extends BaseDO {
- private static final long serialVersionUID = 1L;
-
- /**
- * 作者
- */
- private Long userId;
-
- /**
- * 文章类型:1-博文,2-问答
- */
- private Integer articleType;
-
- /**
- * 文章标题
- */
- private String title;
-
- /**
- * 短标题
- */
- private String shortTitle;
-
- /**
- * 文章头图
- */
- private String picture;
-
- /**
- * 文章摘要
- */
- private String summary;
-
- /**
- * 类目ID
- */
- private Long categoryId;
-
- /**
- * 来源:1-转载,2-原创,3-翻译
- *
- * @see com.github.liueyueyi.forum.api.model.enums.SourceTypeEnum
- */
- private Integer source;
-
- /**
- * 原文地址
- */
- private String sourceUrl;
-
- /**
- * 状态:0-未发布,1-已发布
- *
- * @see com.github.liueyueyi.forum.api.model.enums.PushStatusEnum
- */
- private Integer status;
-
- private Integer deleted;
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/entity/CategoryDO.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/entity/CategoryDO.java
deleted file mode 100644
index a6e9917b9..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/entity/CategoryDO.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.github.liuyueyi.forum.service.article.repository.entity;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.github.liueyueyi.forum.api.model.entity.BaseDO;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-/**
- * 类目管理表
- *
- * @author louzai
- * @date 2022-07-18
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-@TableName("category")
-public class CategoryDO extends BaseDO {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * 类目名称
- */
- private String categoryName;
-
- /**
- * 状态:0-未发布,1-已发布
- */
- private Integer status;
-
- private Integer deleted;
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/mapper/ArticleMapper.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/mapper/ArticleMapper.java
deleted file mode 100644
index 6dba72177..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/mapper/ArticleMapper.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.github.liuyueyi.forum.service.article.repository.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.github.liuyueyi.forum.service.article.repository.entity.ArticleDO;
-
-/**
- * 文章mapper接口
- *
- * @author louzai
- * @date 2022-07-18
- */
-public interface ArticleMapper extends BaseMapper {
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/mapper/ArticleTagMapper.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/mapper/ArticleTagMapper.java
deleted file mode 100644
index b8a770118..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/mapper/ArticleTagMapper.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package com.github.liuyueyi.forum.service.article.repository.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.github.liueyueyi.forum.api.model.vo.article.dto.TagDTO;
-import com.github.liuyueyi.forum.service.article.repository.entity.ArticleTagDO;
-import org.apache.ibatis.annotations.Insert;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * 文章标签映mapper接口
- *
- * @author louzai
- * @date 2022-07-18
- */
-public interface ArticleTagMapper extends BaseMapper {
-
- /**
- * 查询文章标签
- *
- * @param articleId
- * @return
- */
- List listArticleTagDetails(@Param("articleId") Long articleId);
-
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/mapper/CategoryMapper.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/mapper/CategoryMapper.java
deleted file mode 100644
index dec1e586e..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/mapper/CategoryMapper.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.github.liuyueyi.forum.service.article.repository.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.github.liuyueyi.forum.service.article.repository.entity.CategoryDO;
-
-/**
- * 类目管理mapper接口
- *
- * @author louzai
- * @date 2022-07-18
- */
-public interface CategoryMapper extends BaseMapper {
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/mapper/ReadCountMapper.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/mapper/ReadCountMapper.java
deleted file mode 100644
index b1be166d0..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/mapper/ReadCountMapper.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.github.liuyueyi.forum.service.article.repository.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.github.liuyueyi.forum.service.article.repository.entity.ReadCountDO;
-
-/**
- * 标签mapper接口
- *
- * @author louzai
- * @date 2022-07-18
- */
-public interface ReadCountMapper extends BaseMapper {
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/mapper/TagMapper.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/mapper/TagMapper.java
deleted file mode 100644
index 66368e962..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/repository/mapper/TagMapper.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.github.liuyueyi.forum.service.article.repository.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.github.liuyueyi.forum.service.article.repository.entity.TagDO;
-
-/**
- * 标签mapper接口
- *
- * @author louzai
- * @date 2022-07-18
- */
-public interface TagMapper extends BaseMapper {
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/ArticleReadService.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/ArticleReadService.java
deleted file mode 100644
index 30dcbd0e8..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/ArticleReadService.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package com.github.liuyueyi.forum.service.article.service;
-
-import com.github.liueyueyi.forum.api.model.enums.HomeSelectEnum;
-import com.github.liueyueyi.forum.api.model.vo.PageParam;
-import com.github.liueyueyi.forum.api.model.vo.article.dto.ArticleDTO;
-import com.github.liueyueyi.forum.api.model.vo.article.dto.ArticleListDTO;
-import com.github.liuyueyi.forum.service.article.repository.entity.ArticleDO;
-
-public interface ArticleReadService {
-
- /**
- * 查询基础的文章信息
- *
- * @param articleId
- * @return
- */
- ArticleDO queryBasicArticle(Long articleId);
-
-
- /**
- * 查询文章详情,包括正文内容,分类、标签等信息
- *
- * @param articleId
- * @return
- */
- ArticleDTO queryDetailArticleInfo(Long articleId);
-
- /**
- * 查询文章所有的关联信息,正文,分类,标签,阅读计数+1,当前登录用户是否点赞、评论过
- *
- * @param articleId 文章id
- * @param currentUser 当前查看的用户ID
- * @return
- */
- ArticleDTO queryTotalArticleInfo(Long articleId, Long currentUser);
-
- /**
- * 查询某个分类下的文章,支持翻页
- *
- * @param categoryId
- * @param page
- * @return
- */
- ArticleListDTO queryArticlesByCategory(Long categoryId, PageParam page);
-
- /**
- * 根据查询条件查询文章列表,支持翻页
- *
- * @param key
- * @param page
- * @return
- */
- ArticleListDTO queryArticlesBySearchKey(String key, PageParam page);
-
- /**
- * 查询用户的文章列表
- *
- * @param userId
- * @param pageParam
- * @param select
- * @return
- */
- ArticleListDTO queryArticlesByUserAndType(Long userId, PageParam pageParam, HomeSelectEnum select);
-
- /**
- * 查询作者的文章数
- *
- * @param authorId
- * @return
- */
- int queryArticleCount(long authorId);
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/ArticleWriteService.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/ArticleWriteService.java
deleted file mode 100644
index 3076950d6..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/ArticleWriteService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.github.liuyueyi.forum.service.article.service;
-
-import com.github.liueyueyi.forum.api.model.enums.PushStatusEnum;
-import com.github.liueyueyi.forum.api.model.vo.article.ArticlePostReq;
-
-public interface ArticleWriteService {
-
- /**
- * 保存or更新文章
- *
- * @param req
- * @param author 作者
- * @return
- */
- Long saveArticle(ArticlePostReq req, Long author);
-
- /**
- * 删除文章
- *
- * @param articleId
- */
- void deleteArticle(Long articleId);
-
- /**
- * 上线/下线文章
- *
- * @param articleId
- * @param pushStatusEnum
- */
- void operateArticle(Long articleId, PushStatusEnum pushStatusEnum);
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/CategoryService.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/CategoryService.java
deleted file mode 100644
index 9a26e4723..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/CategoryService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.github.liuyueyi.forum.service.article.service;
-
-import com.github.liueyueyi.forum.api.model.vo.article.dto.CategoryDTO;
-
-import java.util.List;
-
-/**
- * 标签Service
- *
- * @author louzai
- * @date 2022-07-20
- */
-public interface CategoryService {
- /**
- * 查询类目名
- *
- * @param categoryId
- * @return
- */
- String queryCategoryName(Long categoryId);
-
-
- /**
- * 查询所有的分离
- *
- * @return
- */
- List loadAllCategories();
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/TagService.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/TagService.java
deleted file mode 100644
index c4d14bda6..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/TagService.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.github.liuyueyi.forum.service.article.service;
-
-import com.github.liueyueyi.forum.api.model.vo.article.dto.TagDTO;
-
-import java.util.List;
-
-/**
- * 标签Service
- *
- * @author louzai
- * @date 2022-07-20
- */
-public interface TagService {
- /**
- * 根据类目ID查询标签列表
- *
- * @param categoryId
- * @return
- */
- List queryTagsByCategoryId(Long categoryId);
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/impl/ArticleReadServiceImpl.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/impl/ArticleReadServiceImpl.java
deleted file mode 100644
index 165e6ff0e..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/impl/ArticleReadServiceImpl.java
+++ /dev/null
@@ -1,188 +0,0 @@
-package com.github.liuyueyi.forum.service.article.service.impl;
-
-import com.github.liueyueyi.forum.api.model.enums.*;
-import com.github.liueyueyi.forum.api.model.vo.PageParam;
-import com.github.liueyueyi.forum.api.model.vo.article.dto.ArticleDTO;
-import com.github.liueyueyi.forum.api.model.vo.article.dto.ArticleListDTO;
-import com.github.liueyueyi.forum.api.model.vo.article.dto.CategoryDTO;
-import com.github.liuyueyi.forum.service.article.conveter.ArticleConverter;
-import com.github.liuyueyi.forum.service.article.repository.dao.ArticleDao;
-import com.github.liuyueyi.forum.service.article.repository.dao.ArticleTagDao;
-import com.github.liuyueyi.forum.service.article.repository.entity.ArticleDO;
-import com.github.liuyueyi.forum.service.article.service.ArticleReadService;
-import com.github.liuyueyi.forum.service.article.service.CategoryService;
-import com.github.liuyueyi.forum.service.user.repository.entity.UserFootDO;
-import com.github.liuyueyi.forum.service.user.service.CountService;
-import com.github.liuyueyi.forum.service.user.service.UserFootService;
-import com.github.liuyueyi.forum.service.user.service.UserService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.util.CollectionUtils;
-
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * 文章查询相关服务类
- *
- * @author louzai
- * @date 2022-07-20
- */
-@Service
-public class ArticleReadServiceImpl implements ArticleReadService {
-
- @Autowired
- private ArticleDao articleDao;
-
- @Autowired
- private ArticleTagDao articleTagDao;
-
- @Autowired
- private CategoryService categoryService;
-
- /**
- * 在一个项目中,UserFootService 就是内部服务调用
- * 拆微服务时,这个会作为远程服务访问
- */
- @Autowired
- private UserFootService userFootService;
-
- @Autowired
- private CountService countService;
-
- @Autowired
- private UserService userService;
-
- @Override
- public ArticleDO queryBasicArticle(Long articleId) {
- return articleDao.getById(articleId);
- }
-
- @Override
- public ArticleDTO queryDetailArticleInfo(Long articleId) {
- ArticleDTO article = articleDao.queryArticleDetail(articleId);
- if (article == null) {
- throw new IllegalArgumentException("文章不存在");
- }
- // 更新分类相关信息
- CategoryDTO category = article.getCategory();
- category.setCategory(categoryService.queryCategoryName(category.getCategoryId()));
-
- // 更新标签信息
- article.setTags(articleTagDao.queryArticleTagDetails(articleId));
- return article;
- }
-
- /**
- * 查询文章所有的关联信息,正文,分类,标签,阅读计数,当前登录用户是否点赞、评论过
- *
- * @param articleId
- * @param readUser
- * @return
- */
- @Override
- public ArticleDTO queryTotalArticleInfo(Long articleId, Long readUser) {
- ArticleDTO article = queryDetailArticleInfo(articleId);
-
- // 文章阅读计数+1
- articleDao.incrReadCount(articleId);
-
- // 文章的操作标记
- if (readUser != null) {
- // 更新用于足迹,并判断是否点赞、评论、收藏
- UserFootDO foot = userFootService.saveOrUpdateUserFoot(DocumentTypeEnum.ARTICLE, articleId, article.getAuthor(), readUser, OperateTypeEnum.READ);
- article.setPraised(Objects.equals(foot.getPraiseStat(), PraiseStatEnum.PRAISE.getCode()));
- article.setCommented(Objects.equals(foot.getCommentStat(), CommentStatEnum.COMMENT.getCode()));
- article.setCollected(Objects.equals(foot.getCollectionStat(), CollectionStatEnum.COLLECTION.getCode()));
- } else {
- // 未登录,全部设置为未处理
- article.setPraised(false);
- article.setCommented(false);
- article.setCollected(false);
- }
-
- // 更新文章统计计数
- article.setCount(countService.queryArticleCountInfoByArticleId(articleId));
- return article;
- }
-
-
- @Override
- public ArticleListDTO queryArticlesByCategory(Long categoryId, PageParam page) {
- List records = articleDao.listArticlesByCategoryId(categoryId, page);
- return buildArticleListVo(records, page.getPageSize());
- }
-
- @Override
- public ArticleListDTO queryArticlesBySearchKey(String key, PageParam page) {
- List records = articleDao.listArticlesByBySearchKey(key, page);
- return buildArticleListVo(records, page.getPageSize());
- }
-
- @Override
- public ArticleListDTO queryArticlesByUserAndType(Long userId, PageParam pageParam, HomeSelectEnum select) {
- List records = null;
- if (select == HomeSelectEnum.ARTICLE) {
- // 用户的文章列表
- records = articleDao.listArticlesByUserId(userId, pageParam);
- } else if (select == HomeSelectEnum.READ) {
- // 用户的阅读记录
- List articleIds = userFootService.queryUserReadArticleList(userId, pageParam);
- records = CollectionUtils.isEmpty(articleIds) ? Collections.emptyList() : articleDao.listByIds(articleIds);
- records = sortByIds(articleIds, records);
- } else if (select == HomeSelectEnum.COLLECTION) {
- // 用户的收藏列表
- List articleIds = userFootService.queryUserCollectionArticleList(userId, pageParam);
- records = CollectionUtils.isEmpty(articleIds) ? Collections.emptyList() : articleDao.listByIds(articleIds);
- records = sortByIds(articleIds, records);
- }
-
- if (CollectionUtils.isEmpty(records)) {
- return new ArticleListDTO();
- }
- return buildArticleListVo(records, pageParam.getPageSize());
- }
-
- private List sortByIds(List articleIds, List records) {
- List articleDOS = new ArrayList<>();
- Map articleDOMap = records.stream().collect(Collectors.toMap(ArticleDO::getId, t -> t));
- articleIds.forEach(articleId -> {
- if (articleDOMap.containsKey(articleId)) {
- articleDOS.add(articleDOMap.get(articleId));
- }
- });
- return articleDOS;
- }
-
- private ArticleListDTO buildArticleListVo(List records, long pageSize) {
- List result = records.stream().map(this::fillArticleRelatedInfo).collect(Collectors.toList());
- ArticleListDTO dto = new ArticleListDTO();
- dto.setArticleList(result);
- dto.setIsMore(result.size() == pageSize);
- return dto;
- }
-
- /**
- * 补全文章的阅读计数、作者、分类、标签等信息
- *
- * @param record
- * @return
- */
- private ArticleDTO fillArticleRelatedInfo(ArticleDO record) {
- ArticleDTO dto = ArticleConverter.toDto(record);
- // 分类信息
- dto.getCategory().setCategory(categoryService.queryCategoryName(record.getCategoryId()));
- // 标签列表
- dto.setTags(articleTagDao.queryArticleTagDetails(record.getId()));
- // 阅读计数统计
- dto.setCount(countService.queryArticleCountInfoByArticleId(record.getId()));
- // 作者信息
- dto.setAuthorName(userService.queryBasicUserInfo(dto.getAuthor()).getUserName());
- return dto;
- }
-
- @Override
- public int queryArticleCount(long authorId) {
- return articleDao.countArticleByUser(authorId);
- }
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/impl/ArticleWriteServiceImpl.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/impl/ArticleWriteServiceImpl.java
deleted file mode 100644
index 6b7b64397..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/impl/ArticleWriteServiceImpl.java
+++ /dev/null
@@ -1,130 +0,0 @@
-package com.github.liuyueyi.forum.service.article.service.impl;
-
-import com.github.liueyueyi.forum.api.model.enums.DocumentTypeEnum;
-import com.github.liueyueyi.forum.api.model.enums.OperateTypeEnum;
-import com.github.liueyueyi.forum.api.model.enums.PushStatusEnum;
-import com.github.liueyueyi.forum.api.model.enums.YesOrNoEnum;
-import com.github.liueyueyi.forum.api.model.vo.article.ArticlePostReq;
-import com.github.liuyueyi.forum.core.util.NumUtil;
-import com.github.liuyueyi.forum.service.article.conveter.ArticleConverter;
-import com.github.liuyueyi.forum.service.article.repository.dao.ArticleDao;
-import com.github.liuyueyi.forum.service.article.repository.dao.ArticleTagDao;
-import com.github.liuyueyi.forum.service.article.repository.entity.ArticleDO;
-import com.github.liuyueyi.forum.service.article.service.ArticleWriteService;
-import com.github.liuyueyi.forum.service.user.service.UserFootService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.Set;
-
-/**
- * 文章操作相关服务类
- *
- * @author louzai
- * @date 2022-07-20
- */
-@Service
-public class ArticleWriteServiceImpl implements ArticleWriteService {
-
- private final ArticleDao articleDao;
-
- private final ArticleTagDao articleTagDao;
-
- @Autowired
- private UserFootService userFootService;
-
- public ArticleWriteServiceImpl(ArticleDao articleDao, ArticleTagDao articleTagDao) {
- this.articleDao = articleDao;
- this.articleTagDao = articleTagDao;
- }
-
- /**
- * 保存文章,当articleId存在时,表示更新记录; 不存在时,表示插入
- *
- * @param req
- * @return
- */
- @Transactional(rollbackFor = Exception.class)
- @Override
- public Long saveArticle(ArticlePostReq req, Long author) {
- ArticleDO article = ArticleConverter.toArticleDo(req, author);
- if (NumUtil.nullOrZero(req.getArticleId())) {
- return insertArticle(article, req.getContent(), req.getTagIds());
- } else {
- return updateArticle(article, req.getContent(), req.getTagIds());
- }
- }
-
- /**
- * 新建文章
- *
- * @param article
- * @param content
- * @param tags
- * @return
- */
- private Long insertArticle(ArticleDO article, String content, Set tags) {
- // article + article_detail + tag 三张表的数据变更
- articleDao.save(article);
- Long articleId = article.getId();
-
- articleDao.saveArticleContent(articleId, content);
-
- articleTagDao.batchSave(articleId, tags);
-
- // 发布文章,阅读计数+1
- userFootService.saveOrUpdateUserFoot(DocumentTypeEnum.ARTICLE, articleId, article.getUserId(), article.getUserId(), OperateTypeEnum.READ);
- return articleId;
- }
-
- /**
- * 更新文章
- *
- * @param article
- * @param content
- * @param tags
- * @return
- */
- private Long updateArticle(ArticleDO article, String content, Set tags) {
- // 更新文章
- articleDao.updateById(article);
-
- // 更新内容
- articleDao.updateArticleContent(article.getId(), content);
-
- // 标签更新
- articleTagDao.updateTags(article.getId(), tags);
- return article.getId();
- }
-
-
- /**
- * 删除文章
- *
- * @param articleId
- */
- @Override
- public void deleteArticle(Long articleId) {
- ArticleDO dto = articleDao.getById(articleId);
- if (dto != null && dto.getDeleted() != YesOrNoEnum.YES.getCode()) {
- dto.setDeleted(YesOrNoEnum.YES.getCode());
- articleDao.updateById(dto);
- }
- }
-
- /**
- * 文章上下线
- *
- * @param articleId
- * @param pushStatusEnum
- */
- @Override
- public void operateArticle(Long articleId, PushStatusEnum pushStatusEnum) {
- ArticleDO dto = articleDao.getById(articleId);
- if (dto != null && dto.getStatus() != pushStatusEnum.getCode()) {
- dto.setStatus(pushStatusEnum.getCode());
- articleDao.updateById(dto);
- }
- }
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/impl/CategoryServiceImpl.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/impl/CategoryServiceImpl.java
deleted file mode 100644
index 9dfd035c6..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/impl/CategoryServiceImpl.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package com.github.liuyueyi.forum.service.article.service.impl;
-
-import com.github.liueyueyi.forum.api.model.enums.YesOrNoEnum;
-import com.github.liueyueyi.forum.api.model.vo.article.dto.CategoryDTO;
-import com.github.liuyueyi.forum.service.article.conveter.ArticleConverter;
-import com.github.liuyueyi.forum.service.article.repository.dao.CategoryDao;
-import com.github.liuyueyi.forum.service.article.repository.entity.CategoryDO;
-import com.github.liuyueyi.forum.service.article.service.CategoryService;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import org.jetbrains.annotations.NotNull;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.PostConstruct;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-
-/**
- * 类目Service
- *
- * @author louzai
- * @date 2022-07-20
- */
-@Service
-public class CategoryServiceImpl implements CategoryService {
- /**
- * 分类数一般不会特别多,如编程领域可以预期的分类将不会超过30,所以可以做一个全量的内存缓存
- * todo 后续可改为Guava -> Redis
- */
- private LoadingCache categoryCaches;
-
- private CategoryDao categoryDao;
-
- public CategoryServiceImpl(CategoryDao categoryDao) {
- this.categoryDao = categoryDao;
- }
-
- @PostConstruct
- public void init() {
- categoryCaches = CacheBuilder.newBuilder().maximumSize(300).build(new CacheLoader() {
- @Override
- public CategoryDTO load(@NotNull Long categoryId) throws Exception {
- CategoryDO category = categoryDao.getById(categoryId);
- if (category == null || category.getDeleted() == YesOrNoEnum.YES.getCode()) {
- return CategoryDTO.EMPTY;
- }
- return new CategoryDTO(categoryId, category.getCategoryName());
- }
- });
- // 预热全量缓存
- refreshCache();
- }
-
- /**
- * 查询类目名
- *
- * @param categoryId
- * @return
- */
- @Override
- public String queryCategoryName(Long categoryId) {
- return categoryCaches.getUnchecked(categoryId).getCategory();
- }
-
- /**
- * 查询所有的分类
- *
- * @return
- */
- public List loadAllCategories() {
- List list = new ArrayList<>(categoryCaches.asMap().values());
- list.sort(Comparator.comparingLong(CategoryDTO::getCategoryId));
- return list;
- }
-
- /**
- * 刷新缓存
- */
- private void refreshCache() {
- List list = categoryDao.listAllCategoriesFromDb();
- categoryCaches.invalidateAll();
- categoryCaches.cleanUp();
- list.forEach(s -> categoryCaches.put(s.getId(), ArticleConverter.toDto(s)));
- }
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/impl/TagServiceImpl.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/impl/TagServiceImpl.java
deleted file mode 100644
index f3a96a9dc..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/article/service/impl/TagServiceImpl.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package com.github.liuyueyi.forum.service.article.service.impl;
-
-import com.github.liueyueyi.forum.api.model.vo.article.dto.TagDTO;
-import com.github.liuyueyi.forum.service.article.repository.dao.TagDao;
-import com.github.liuyueyi.forum.service.article.service.TagService;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * 标签Service
- *
- * @author louzai
- * @date 2022-07-20
- */
-@Service
-public class TagServiceImpl implements TagService {
- private final TagDao tagDao;
-
- public TagServiceImpl(TagDao tagDao) {
- this.tagDao = tagDao;
- }
-
- @Override
- public List queryTagsByCategoryId(Long categoryId) {
- return tagDao.listTagsByCategoryId(categoryId);
- }
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/comment/package-info.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/comment/package-info.java
deleted file mode 100644
index 0cbd61dfa..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/comment/package-info.java
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * 评论相关服务包
- *
- * @author YiHui
- * @date 2022/7/6
- */
-package com.github.liuyueyi.forum.service.comment;
\ No newline at end of file
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/comment/repository/dao/CommentDao.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/comment/repository/dao/CommentDao.java
deleted file mode 100644
index 31749c364..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/comment/repository/dao/CommentDao.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package com.github.liuyueyi.forum.service.comment.repository.dao;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.liueyueyi.forum.api.model.enums.YesOrNoEnum;
-import com.github.liueyueyi.forum.api.model.vo.PageParam;
-import com.github.liuyueyi.forum.service.comment.repository.entity.CommentDO;
-import com.github.liuyueyi.forum.service.comment.repository.mapper.CommentMapper;
-import org.springframework.stereotype.Repository;
-
-import java.util.Collection;
-import java.util.List;
-
-/**
- * @author YiHui
- * @date 2022/9/2
- */
-@Repository
-public class CommentDao extends ServiceImpl {
-
- /**
- * 获取评论列表
- *
- * @param pageParam
- * @return
- */
- public List listTopCommentList(Long articleId, PageParam pageParam) {
- return lambdaQuery()
- .eq(CommentDO::getTopCommentId, 0)
- .eq(CommentDO::getArticleId, articleId)
- .eq(CommentDO::getDeleted, YesOrNoEnum.NO.getCode())
- .last(PageParam.getLimitSql(pageParam))
- .orderByDesc(CommentDO::getId).list();
- }
-
- /**
- * 查询所有的子评论
- *
- * @param articleId
- * @return
- */
- public List listSubCommentIdMappers(Long articleId, Collection topCommentIds) {
- return lambdaQuery()
- .in(CommentDO::getTopCommentId, topCommentIds)
- .eq(CommentDO::getArticleId, articleId)
- .eq(CommentDO::getDeleted, YesOrNoEnum.NO.getCode()).list();
- }
-
-
- /**
- * 查询有效评论数
- *
- * @param articleId
- * @return
- */
- public int commentCount(Long articleId) {
- QueryWrapper queryWrapper = new QueryWrapper<>();
- queryWrapper.lambda()
- .eq(CommentDO::getArticleId, articleId)
- .eq(CommentDO::getDeleted, YesOrNoEnum.NO.getCode());
- return baseMapper.selectCount(queryWrapper).intValue();
- }
-
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/comment/repository/mapper/CommentMapper.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/comment/repository/mapper/CommentMapper.java
deleted file mode 100644
index 93e20ed96..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/comment/repository/mapper/CommentMapper.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.github.liuyueyi.forum.service.comment.repository.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.github.liuyueyi.forum.service.comment.repository.entity.CommentDO;
-
-/**
- * 评论mapper接口
- *
- * @author louzai
- * @date 2022-07-18
- */
-public interface CommentMapper extends BaseMapper {
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/comment/service/CommentReadService.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/comment/service/CommentReadService.java
deleted file mode 100644
index 80ca9e90e..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/comment/service/CommentReadService.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.github.liuyueyi.forum.service.comment.service;
-
-import com.github.liueyueyi.forum.api.model.vo.PageParam;
-import com.github.liueyueyi.forum.api.model.vo.comment.dto.TopCommentDTO;
-
-import java.util.List;
-
-/**
- * 评论Service接口
- *
- * @author louzai
- * @date 2022-07-24
- */
-public interface CommentReadService {
-
- /**
- * 查询文章评论列表
- *
- * @param articleId
- * @param page
- * @return
- */
- List getArticleComments(Long articleId, PageParam page);
-
- /**
- * 文章的有效评论数
- *
- * @param articleId
- * @return
- */
- int queryCommentCount(Long articleId);
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/comment/service/CommentWriteService.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/comment/service/CommentWriteService.java
deleted file mode 100644
index 3f8d2108f..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/comment/service/CommentWriteService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.github.liuyueyi.forum.service.comment.service;
-
-import com.github.liueyueyi.forum.api.model.vo.comment.CommentSaveReq;
-
-/**
- * 评论Service接口
- *
- * @author louzai
- * @date 2022-07-24
- */
-public interface CommentWriteService {
-
- /**
- * 更新/保存评论
- *
- * @param commentSaveReq
- * @return
- */
- Long saveComment(CommentSaveReq commentSaveReq);
-
- /**
- * 删除评论
- *
- * @param commentId
- * @throws Exception
- */
- void deleteComment(Long commentId);
-
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/comment/service/impl/CommentReadServiceImpl.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/comment/service/impl/CommentReadServiceImpl.java
deleted file mode 100644
index a39b9e5ad..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/comment/service/impl/CommentReadServiceImpl.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package com.github.liuyueyi.forum.service.comment.service.impl;
-
-import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
-import com.github.liueyueyi.forum.api.model.vo.PageParam;
-import com.github.liueyueyi.forum.api.model.vo.comment.dto.BaseCommentDTO;
-import com.github.liueyueyi.forum.api.model.vo.comment.dto.SubCommentDTO;
-import com.github.liueyueyi.forum.api.model.vo.comment.dto.TopCommentDTO;
-import com.github.liueyueyi.forum.api.model.vo.user.dto.BaseUserInfoDTO;
-import com.github.liuyueyi.forum.service.comment.converter.CommentConverter;
-import com.github.liuyueyi.forum.service.comment.repository.dao.CommentDao;
-import com.github.liuyueyi.forum.service.comment.repository.entity.CommentDO;
-import com.github.liuyueyi.forum.service.comment.service.CommentReadService;
-import com.github.liuyueyi.forum.service.user.service.CountService;
-import com.github.liuyueyi.forum.service.user.service.UserService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * 评论Service
- *
- * @author louzai
- * @date 2022-07-24
- */
-@Service
-public class CommentReadServiceImpl implements CommentReadService {
-
- @Autowired
- private CommentDao commentDao;
-
- @Autowired
- private UserService userService;
-
- @Autowired
- private CountService countService;
-
- @Override
- public List getArticleComments(Long articleId, PageParam page) {
- // 1.查询一级评论
- List comments = commentDao.listTopCommentList(articleId, page);
- if (CollectionUtils.isEmpty(comments)) {
- return Collections.emptyList();
- }
- // map 存 commentId -> 评论
- Map topComments = comments.stream().collect(Collectors.toMap(CommentDO::getId, CommentConverter::toTopDto));
-
- // 2.查询非一级评论
- List subComments = commentDao.listSubCommentIdMappers(articleId, topComments.keySet());
-
- // 3.构建一级评论的子评论
- buildCommentRelation(subComments, topComments);
-
- // 4.挑出需要返回的数据,排序,并补齐对应的用户信息,最后排序返回
- List result = new ArrayList<>();
- comments.forEach(comment -> {
- TopCommentDTO dto = topComments.get(comment.getId());
- fillCommentInfo(dto);
- dto.getChildComments().forEach(this::fillCommentInfo);
- Collections.sort(dto.getChildComments());
- result.add(dto);
- });
-
- // 返回结果根据时间进行排序
- Collections.sort(result);
- return result;
- }
-
- /**
- * 构建父子评论关系
- */
- private void buildCommentRelation(List subComments, Map topComments) {
- Map subCommentMap = subComments.stream().collect(Collectors.toMap(CommentDO::getId, CommentConverter::toSubDto));
- subComments.forEach(comment -> {
- TopCommentDTO top = topComments.get(comment.getTopCommentId());
- if (top == null) {
- return;
- }
- SubCommentDTO sub = subCommentMap.get(comment.getId());
- top.getChildComments().add(sub);
- if (Objects.equals(comment.getTopCommentId(), comment.getParentCommentId())) {
- return;
- }
-
- SubCommentDTO parent = subCommentMap.get(comment.getParentCommentId());
- sub.setParentContent(parent == null ? "~~已删除~~" : parent.getCommentContent());
- });
- }
-
- /**
- * 填充评论对应的信息,如用户信息,点赞数等
- *
- * @param comment
- */
- private void fillCommentInfo(BaseCommentDTO comment) {
- BaseUserInfoDTO userInfoDO = userService.queryBasicUserInfo(comment.getUserId());
- if (userInfoDO == null) {
- // 如果用户注销,给一个默认的用户
- comment.setUserName("默认用户");
- comment.setUserPhoto("");
- if (comment instanceof TopCommentDTO) {
- ((TopCommentDTO) comment).setCommentCount(0);
- }
- } else {
- comment.setUserName(userInfoDO.getUserName());
- comment.setUserPhoto(userInfoDO.getPhoto());
- if (comment instanceof TopCommentDTO) {
- ((TopCommentDTO) comment).setCommentCount(((TopCommentDTO) comment).getChildComments().size());
- }
- }
-
- // 查询点赞数
- Long praiseCount = countService.queryCommentPraiseCount(comment.getCommentId());
- comment.setPraiseCount(praiseCount.intValue());
- }
-
- @Override
- public int queryCommentCount(Long articleId) {
- return commentDao.commentCount(articleId);
- }
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/comment/service/impl/CommentWriteServiceImpl.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/comment/service/impl/CommentWriteServiceImpl.java
deleted file mode 100644
index c0e48600b..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/comment/service/impl/CommentWriteServiceImpl.java
+++ /dev/null
@@ -1,118 +0,0 @@
-package com.github.liuyueyi.forum.service.comment.service.impl;
-
-import com.github.liueyueyi.forum.api.model.enums.YesOrNoEnum;
-import com.github.liueyueyi.forum.api.model.exception.ExceptionUtil;
-import com.github.liueyueyi.forum.api.model.vo.article.dto.ArticleDTO;
-import com.github.liueyueyi.forum.api.model.vo.comment.CommentSaveReq;
-import com.github.liueyueyi.forum.api.model.vo.constants.StatusEnum;
-import com.github.liuyueyi.forum.core.util.NumUtil;
-import com.github.liuyueyi.forum.service.article.repository.dao.ArticleDao;
-import com.github.liuyueyi.forum.service.article.repository.entity.ArticleDO;
-import com.github.liuyueyi.forum.service.comment.converter.CommentConverter;
-import com.github.liuyueyi.forum.service.comment.repository.dao.CommentDao;
-import com.github.liuyueyi.forum.service.comment.repository.entity.CommentDO;
-import com.github.liuyueyi.forum.service.comment.service.CommentWriteService;
-import com.github.liuyueyi.forum.service.user.service.UserFootService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.Date;
-
-/**
- * 评论Service
- *
- * @author louzai
- * @date 2022-07-24
- */
-@Service
-public class CommentWriteServiceImpl implements CommentWriteService {
-
- @Autowired
- private CommentDao commentDao;
-
- @Autowired
- private ArticleDao articleDao;
-
- @Autowired
- private UserFootService userFootWriteService;
-
- @Override
- @Transactional(rollbackFor = Exception.class)
- public Long saveComment(CommentSaveReq commentSaveReq) {
- // 保存评论
- CommentDO comment;
- if (NumUtil.nullOrZero(commentSaveReq.getCommentId())) {
- comment = addComment(commentSaveReq);
- } else {
- comment = updateComment(commentSaveReq);
- }
- return comment.getId();
- }
-
- private CommentDO addComment(CommentSaveReq commentSaveReq) {
- // 0.校验父评论是否存在
- getParentCommentUser(commentSaveReq.getParentCommentId());
-
- // 1. 保存评论内容
- CommentDO commentDO = CommentConverter.toDo(commentSaveReq);
- Date now = new Date();
- commentDO.setCreateTime(now);
- commentDO.setUpdateTime(now);
- commentDao.save(commentDO);
-
- // 2. 获取文章信息
- ArticleDTO articleDTO = articleDao.queryArticleDetail(commentSaveReq.getArticleId());
- if (articleDTO == null) {
- throw ExceptionUtil.of(StatusEnum.RECORDS_NOT_EXISTS, "文章=" + commentSaveReq.getArticleId());
- }
-
- // 2. 保存足迹信息 : 文章的已评信息 + 评论的已评信息
- userFootWriteService.saveCommentFoot(commentDO, articleDTO);
- return commentDO;
- }
-
- private CommentDO updateComment(CommentSaveReq commentSaveReq) {
- // 更新评论
- CommentDO commentDO = commentDao.getById(commentSaveReq.getCommentId());
- if (commentDO == null) {
- throw new RuntimeException("未查询到该评论");
- }
- commentDO.setContent(commentSaveReq.getCommentContent());
- commentDao.updateById(commentDO);
- return commentDO;
- }
-
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void deleteComment(Long commentId) {
- CommentDO commentDO = commentDao.getById(commentId);
- if (commentDO == null) {
- throw ExceptionUtil.of(StatusEnum.RECORDS_NOT_EXISTS, "评论ID=" + commentId);
- }
- commentDO.setDeleted(YesOrNoEnum.YES.getCode());
- commentDao.updateById(commentDO);
-
- // 获取文章信息
- ArticleDTO articleDTO = articleDao.queryArticleDetail(commentDO.getArticleId());
- if (articleDTO == null) {
- throw ExceptionUtil.of(StatusEnum.RECORDS_NOT_EXISTS, "文章=" + commentDO.getArticleId());
- }
-
- userFootWriteService.removeCommentFoot(commentDO, articleDTO);
- }
-
-
- private Long getParentCommentUser(Long parentCommentId) {
- if (NumUtil.nullOrZero(parentCommentId)) {
- return null;
-
- }
- CommentDO parent = commentDao.getById(parentCommentId);
- if (parent == null) {
- throw ExceptionUtil.of(StatusEnum.RECORDS_NOT_EXISTS, "父评论=" + parentCommentId);
- }
- return parent.getUserId();
- }
-
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/converter/UserConverter.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/converter/UserConverter.java
deleted file mode 100644
index 8444ed7d1..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/converter/UserConverter.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package com.github.liuyueyi.forum.service.user.converter;
-
-import com.github.liueyueyi.forum.api.model.context.ReqInfoContext;
-import com.github.liueyueyi.forum.api.model.enums.FollowStateEnum;
-import com.github.liueyueyi.forum.api.model.vo.user.UserInfoSaveReq;
-import com.github.liueyueyi.forum.api.model.vo.user.UserRelationReq;
-import com.github.liueyueyi.forum.api.model.vo.user.UserSaveReq;
-import com.github.liueyueyi.forum.api.model.vo.user.dto.BaseUserInfoDTO;
-import com.github.liueyueyi.forum.api.model.vo.user.dto.UserStatisticInfoDTO;
-import com.github.liuyueyi.forum.service.user.repository.entity.UserDO;
-import com.github.liuyueyi.forum.service.user.repository.entity.UserInfoDO;
-import com.github.liuyueyi.forum.service.user.repository.entity.UserRelationDO;
-import org.springframework.beans.BeanUtils;
-
-/**
- * 用户转换
- *
- * @author louzai
- * @date 2022-07-20
- */
-public class UserConverter {
-
- public static UserDO toDO(UserSaveReq req) {
- if (req == null) {
- return null;
- }
- UserDO userDO = new UserDO();
- userDO.setId(req.getUserId());
- userDO.setThirdAccountId(req.getThirdAccountId());
- userDO.setLoginType(req.getLoginType());
- return userDO;
- }
-
- public static UserInfoDO toDO(UserInfoSaveReq req) {
- if (req == null) {
- return null;
- }
- UserInfoDO userInfoDO = new UserInfoDO();
- userInfoDO.setUserId(req.getUserId());
- userInfoDO.setUserName(req.getUserName());
- userInfoDO.setPhoto(req.getPhoto());
- userInfoDO.setPosition(req.getPosition());
- userInfoDO.setCompany(req.getCompany());
- userInfoDO.setProfile(req.getProfile());
- return userInfoDO;
- }
-
- public static BaseUserInfoDTO toDTO(UserInfoDO info) {
- if (info == null) {
- return null;
- }
- BaseUserInfoDTO user = new BaseUserInfoDTO();
- // todo 知识点,bean属性拷贝的几种方式, 直接get/set方式,使用BeanUtil工具类(spring, cglib, apache, objectMapper),序列化方式等
- BeanUtils.copyProperties(info, user);
- return user;
- }
-
- public static UserRelationDO toDO(UserRelationReq req) {
- if (req == null) {
- return null;
- }
- UserRelationDO userRelationDO = new UserRelationDO();
- userRelationDO.setUserId(req.getUserId());
- userRelationDO.setFollowUserId(ReqInfoContext.getReqInfo().getUserId());
- userRelationDO.setFollowState(req.getFollowed() ? FollowStateEnum.FOLLOW.getCode() : FollowStateEnum.CANCEL_FOLLOW.getCode());
- return userRelationDO;
- }
-
- public static UserStatisticInfoDTO toUserHomeDTO(BaseUserInfoDTO baseUserInfoDTO) {
- if (baseUserInfoDTO == null) {
- return null;
- }
- UserStatisticInfoDTO userHomeDTO = new UserStatisticInfoDTO();
- userHomeDTO.setUserId(baseUserInfoDTO.getUserId());
- userHomeDTO.setUserName(baseUserInfoDTO.getUserName());
- userHomeDTO.setRole(baseUserInfoDTO.getRole());
- userHomeDTO.setPhoto(baseUserInfoDTO.getPhoto());
- userHomeDTO.setProfile(baseUserInfoDTO.getProfile());
- userHomeDTO.setPosition(baseUserInfoDTO.getPosition());
- userHomeDTO.setCompany(baseUserInfoDTO.getCompany());
- userHomeDTO.setExtend(baseUserInfoDTO.getExtend());
- userHomeDTO.setDeleted(baseUserInfoDTO.getDeleted());
- userHomeDTO.setId(baseUserInfoDTO.getId());
- userHomeDTO.setCreateTime(baseUserInfoDTO.getCreateTime());
- userHomeDTO.setUpdateTime(baseUserInfoDTO.getUpdateTime());
- return userHomeDTO;
- }
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/package-info.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/package-info.java
deleted file mode 100644
index 604916fa6..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/package-info.java
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * 用户相关包
- *
- * @author YiHui
- * @date 2022/7/6
- */
-package com.github.liuyueyi.forum.service.user;
\ No newline at end of file
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/dao/UserDao.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/dao/UserDao.java
deleted file mode 100644
index dab437f2f..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/dao/UserDao.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.github.liuyueyi.forum.service.user.repository.dao;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.liueyueyi.forum.api.model.enums.YesOrNoEnum;
-import com.github.liuyueyi.forum.service.user.repository.entity.UserDO;
-import com.github.liuyueyi.forum.service.user.repository.entity.UserInfoDO;
-import com.github.liuyueyi.forum.service.user.repository.mapper.UserInfoMapper;
-import com.github.liuyueyi.forum.service.user.repository.mapper.UserMapper;
-import org.springframework.stereotype.Repository;
-
-import javax.annotation.Resource;
-
-/**
- * @author YiHui
- * @date 2022/9/2
- */
-@Repository
-public class UserDao extends ServiceImpl {
- @Resource
- private UserMapper userMapper;
-
- public UserDO getByThirdAccountId(String accountId) {
- return userMapper.getByThirdAccountId(accountId);
- }
-
- public void saveUser(UserDO user) {
- userMapper.insert(user);
- }
-
- public UserInfoDO getByUserId(Long userId) {
- LambdaQueryWrapper query = Wrappers.lambdaQuery();
- query.eq(UserInfoDO::getUserId, userId)
- .eq(UserInfoDO::getDeleted, YesOrNoEnum.NO.getCode());
- return baseMapper.selectOne(query);
- }
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/dao/UserFootDao.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/dao/UserFootDao.java
deleted file mode 100644
index f4ee6d29c..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/dao/UserFootDao.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package com.github.liuyueyi.forum.service.user.repository.dao;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.liueyueyi.forum.api.model.enums.DocumentTypeEnum;
-import com.github.liueyueyi.forum.api.model.enums.PraiseStatEnum;
-import com.github.liueyueyi.forum.api.model.vo.PageParam;
-import com.github.liueyueyi.forum.api.model.vo.user.dto.ArticleFootCountDTO;
-import com.github.liuyueyi.forum.service.user.repository.entity.UserFootDO;
-import com.github.liuyueyi.forum.service.user.repository.mapper.UserFootMapper;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-/**
- * @author YiHui
- * @date 2022/9/2
- */
-@Repository
-public class UserFootDao extends ServiceImpl {
- public UserFootDO getByDocumentAndUserId(Long documentId, Integer type, Long userId) {
- LambdaQueryWrapper query = Wrappers.lambdaQuery();
- query.eq(UserFootDO::getDocumentId, documentId)
- .eq(UserFootDO::getDocumentType, type)
- .eq(UserFootDO::getUserId, userId);
- return baseMapper.selectOne(query);
- }
-
- /**
- * 查询用户收藏的文章列表
- *
- * @param userId
- * @param pageParam
- * @return
- */
- public List listCollectedArticlesByUserId(Long userId, PageParam pageParam) {
- return baseMapper.listCollectedArticlesByUserId(userId, pageParam);
- }
-
-
- /**
- * 查询用户阅读的文章列表
- *
- * @param userId
- * @param pageParam
- * @return
- */
- public List listReadArticleByUserId(Long userId, PageParam pageParam) {
- return baseMapper.listReadArticleByUserId(userId, pageParam);
- }
-
- /**
- * 查询文章计数信息
- *
- * @param articleId
- * @return
- */
- public ArticleFootCountDTO countArticleByArticleId(Long articleId) {
- return baseMapper.countArticleByArticleId(articleId);
- }
-
- /**
- * 查询作者的文章统计
- *
- * @param author
- * @return
- */
- public ArticleFootCountDTO countArticleByUserId(Long author) {
- return baseMapper.countArticleByUserId(author);
- }
-
- /**
- * 查询评论的点赞数
- *
- * @param commentId
- * @return
- */
- public Long countCommentPraise(Long commentId) {
- return lambdaQuery()
- .eq(UserFootDO::getDocumentId, commentId)
- .eq(UserFootDO::getDocumentType, DocumentTypeEnum.COMMENT.getCode())
- .eq(UserFootDO::getPraiseStat, PraiseStatEnum.PRAISE.getCode())
- .count();
- }
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/dao/UserRelationDao.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/dao/UserRelationDao.java
deleted file mode 100644
index cab5d4236..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/dao/UserRelationDao.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package com.github.liuyueyi.forum.service.user.repository.dao;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.liueyueyi.forum.api.model.enums.FollowStateEnum;
-import com.github.liueyueyi.forum.api.model.vo.PageParam;
-import com.github.liueyueyi.forum.api.model.vo.comment.dto.UserFollowDTO;
-import com.github.liuyueyi.forum.service.user.repository.entity.UserRelationDO;
-import com.github.liuyueyi.forum.service.user.repository.mapper.UserRelationMapper;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-/**
- * 用户相关DB操作
- *
- * @author louzai
- * @date 2022-07-18
- */
-@Repository
-public class UserRelationDao extends ServiceImpl {
-
-
- public List queryUserFollowList(Long followUserId, PageParam pageParam) {
- return baseMapper.queryUserFollowList(followUserId, pageParam);
- }
-
- public List queryUserFansList(Long userId, PageParam pageParam) {
- return baseMapper.queryUserFansList(userId, pageParam);
- }
-
- public Long queryUserFollowCount(Long userId) {
- QueryWrapper queryWrapper = new QueryWrapper<>();
- queryWrapper.lambda()
- .eq(UserRelationDO::getFollowUserId, userId)
- .eq(UserRelationDO::getFollowState, FollowStateEnum.FOLLOW.getCode());
- return baseMapper.selectCount(queryWrapper);
- }
-
- public Long queryUserFansCount(Long userId) {
- QueryWrapper queryWrapper = new QueryWrapper<>();
- queryWrapper.lambda()
- .eq(UserRelationDO::getUserId, userId)
- .eq(UserRelationDO::getFollowState, FollowStateEnum.FOLLOW.getCode());
- return baseMapper.selectCount(queryWrapper);
- }
-
- /**
- * 获取关注信息
- *
- * @param userId 登录用户
- * @param followUserId 关注的用户
- * @return
- */
- public UserRelationDO getUserRelationByUserId(Long userId, Long followUserId) {
- QueryWrapper queryWrapper = new QueryWrapper<>();
- queryWrapper.lambda()
- .eq(UserRelationDO::getUserId, userId)
- .eq(UserRelationDO::getFollowUserId, followUserId)
- .eq(UserRelationDO::getFollowState, FollowStateEnum.FOLLOW.getCode());
- return baseMapper.selectOne(queryWrapper);
- }
-
- /**
- * 获取关注记录
- *
- * @param userId 登录用户
- * @param followUserId 关注的用户
- * @return
- */
- public UserRelationDO getUserRelationRecord(Long userId, Long followUserId) {
- QueryWrapper queryWrapper = new QueryWrapper<>();
- queryWrapper.lambda()
- .eq(UserRelationDO::getUserId, userId)
- .eq(UserRelationDO::getFollowUserId, followUserId);
- return baseMapper.selectOne(queryWrapper);
- }
-}
\ No newline at end of file
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/entity/UserDO.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/entity/UserDO.java
deleted file mode 100644
index 34a8201cd..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/entity/UserDO.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.github.liuyueyi.forum.service.user.repository.entity;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.github.liueyueyi.forum.api.model.entity.BaseDO;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-/**
- * 用户登录表
- *
- * @author louzai
- * @date 2022-07-18
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-@TableName("user")
-public class UserDO extends BaseDO {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * 第三方用户ID
- */
- private String thirdAccountId;
-
- /**
- * 登录方式: 0-微信登录,1-账号密码登录
- */
- private Integer loginType;
-
- /**
- * 删除标记
- */
- private Integer deleted;
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/entity/UserInfoDO.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/entity/UserInfoDO.java
deleted file mode 100644
index ebfd841a6..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/entity/UserInfoDO.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package com.github.liuyueyi.forum.service.user.repository.entity;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.github.liueyueyi.forum.api.model.entity.BaseDO;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-/**
- * 用户个人信息表
- *
- * @author louzai
- * @date 2022-07-18
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-@TableName("user_info")
-public class UserInfoDO extends BaseDO {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * 用户ID
- */
- private Long userId;
-
- /**
- * 用户名
- */
- private String userName;
-
- /**
- * 用户图像
- */
- private String photo;
-
- /**
- * 职位
- */
- private String position;
-
- /**
- * 公司
- */
- private String company;
-
- /**
- * 个人简介
- */
- private String profile;
-
- /**
- * 扩展字段
- */
- private String extend;
-
- /**
- * 删除标记
- */
- private Integer deleted;
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/mapper/UserFootMapper.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/mapper/UserFootMapper.java
deleted file mode 100644
index 71585008e..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/mapper/UserFootMapper.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package com.github.liuyueyi.forum.service.user.repository.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.github.liueyueyi.forum.api.model.vo.PageParam;
-import com.github.liueyueyi.forum.api.model.vo.user.dto.ArticleFootCountDTO;
-import com.github.liuyueyi.forum.service.article.repository.entity.ArticleDO;
-import com.github.liuyueyi.forum.service.user.repository.entity.UserFootDO;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * 用户足迹mapper接口
- *
- * @author louzai
- * @date 2022-07-18
- */
-public interface UserFootMapper extends BaseMapper {
-
- /**
- * 查询文章计数信息
- *
- * @param articleId
- * @return
- */
- ArticleFootCountDTO countArticleByArticleId(@Param("articleId") Long articleId);
-
- /**
- * 查询作者的文章统计
- *
- * @param author
- * @return
- */
- ArticleFootCountDTO countArticleByUserId(@Param("userId") Long author);
-
- /**
- * 查询用户收藏的文章列表
- *
- * @param userId
- * @param pageParam
- * @return
- */
- List listCollectedArticlesByUserId(@Param("userId") Long userId, @Param("pageParam") PageParam pageParam);
-
-
- /**
- * 查询用户阅读的文章列表
- *
- * @param userId
- * @param pageParam
- * @return
- */
- List listReadArticleByUserId(@Param("userId") Long userId, @Param("pageParam") PageParam pageParam);
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/mapper/UserInfoMapper.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/mapper/UserInfoMapper.java
deleted file mode 100644
index 4864d5849..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/mapper/UserInfoMapper.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.github.liuyueyi.forum.service.user.repository.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.github.liuyueyi.forum.service.user.repository.entity.UserInfoDO;
-
-/**
- * 用户个人信息mapper接口
- *
- * @author louzai
- * @date 2022-07-18
- */
-public interface UserInfoMapper extends BaseMapper {
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/mapper/UserMapper.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/mapper/UserMapper.java
deleted file mode 100644
index 72b1db5c5..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/mapper/UserMapper.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.github.liuyueyi.forum.service.user.repository.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.github.liuyueyi.forum.service.user.repository.entity.UserDO;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
-
-/**
- * 用户登录mapper接口
- *
- * @author louzai
- * @date 2022-07-18
- */
-public interface UserMapper extends BaseMapper {
- /**
- * 根据三方唯一id进行查询
- *
- * @param accountId
- * @return
- */
- @Select("select * from user where third_account_id = #{account_id} limit 1")
- UserDO getByThirdAccountId(@Param("account_id") String accountId);
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/mapper/UserRelationMapper.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/mapper/UserRelationMapper.java
deleted file mode 100644
index 4ce918b20..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/repository/mapper/UserRelationMapper.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package com.github.liuyueyi.forum.service.user.repository.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.github.liueyueyi.forum.api.model.vo.PageParam;
-import com.github.liueyueyi.forum.api.model.vo.comment.dto.UserFollowDTO;
-import com.github.liuyueyi.forum.service.user.repository.entity.UserRelationDO;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * 用户关系mapper接口
- *
- * @author louzai
- * @date 2022-07-18
- */
-public interface UserRelationMapper extends BaseMapper {
-
- /**
- * 我关注的用户
- * @param followUserId
- * @param pageParam
- * @return
- */
- List queryUserFollowList(@Param("followUserId") Long followUserId, @Param("pageParam") PageParam pageParam);
-
- /**
- * 关注我的粉丝
- * @param userId
- * @param pageParam
- * @return
- */
- List queryUserFansList(@Param("userId") Long userId, @Param("pageParam") PageParam pageParam);
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/CountService.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/CountService.java
deleted file mode 100644
index 4b9eff236..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/CountService.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.github.liuyueyi.forum.service.user.service;
-
-import com.github.liueyueyi.forum.api.model.vo.user.dto.ArticleFootCountDTO;
-
-/**
- * 计数统计相关
- *
- * @author YiHui
- * @date 2022/9/2
- */
-public interface CountService {
- /**
- * 根据文章ID查询文章计数
- *
- * @param articleId
- * @return
- */
- ArticleFootCountDTO queryArticleCountInfoByArticleId(Long articleId);
-
-
- /**
- * 查询做的总阅读相关计数(当前返回评论数)
- *
- * @param userId
- * @return
- */
- ArticleFootCountDTO queryArticleCountInfoByUserId(Long userId);
-
- /**
- * 获取评论点赞数量
- *
- * @param commentId
- * @return
- */
- Long queryCommentPraiseCount(Long commentId);
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/LoginService.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/LoginService.java
deleted file mode 100644
index 700e6bddd..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/LoginService.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package com.github.liuyueyi.forum.service.user.service;
-
-import com.github.liueyueyi.forum.api.model.vo.user.dto.BaseUserInfoDTO;
-import com.google.common.collect.Sets;
-
-import java.util.Set;
-
-/**
- * @author YiHui
- * @date 2022/8/15
- */
-public interface LoginService {
- String SESSION_KEY = "f-session";
- Set LOGIN_CODE_KEY = Sets.newHashSet("登录", "login");
-
-
- /**
- * 获取登录验证码
- *
- * @param uuid
- * @return
- */
- String getVerifyCode(String uuid);
-
- /**
- * 登录
- *
- * @param code
- * @return
- */
- String login(String code);
-
- /**
- * 登出
- *
- * @param session
- */
- void logout(String session);
-
-
- /**
- * 获取登录的用户信息
- *
- * @param session
- * @return
- */
- BaseUserInfoDTO getUserBySessionId(String session);
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/UserFootService.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/UserFootService.java
deleted file mode 100644
index ad373343b..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/UserFootService.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package com.github.liuyueyi.forum.service.user.service;
-
-
-import com.github.liueyueyi.forum.api.model.enums.DocumentTypeEnum;
-import com.github.liueyueyi.forum.api.model.enums.OperateTypeEnum;
-import com.github.liueyueyi.forum.api.model.vo.PageParam;
-import com.github.liueyueyi.forum.api.model.vo.article.dto.ArticleDTO;
-import com.github.liuyueyi.forum.service.comment.repository.entity.CommentDO;
-import com.github.liuyueyi.forum.service.user.repository.entity.UserFootDO;
-
-import java.util.List;
-
-/**
- * 用户足迹Service接口
- *
- * @author louzai
- * @date 2022-07-20
- */
-public interface UserFootService {
- /**
- * 保存或更新状态信息
- *
- * @param documentType 文档类型:博文 + 评论
- * @param documentId 文档id
- * @param authorId 作者
- * @param userId 操作人
- * @param operateTypeEnum 操作类型:点赞,评论,收藏等
- * @return
- */
- UserFootDO saveOrUpdateUserFoot(DocumentTypeEnum documentType, Long documentId, Long authorId, Long userId, OperateTypeEnum operateTypeEnum);
-
- /**
- * 保存评论足迹
- * 1. 用户文章记录上,设置为已评论
- * 2. 若改评论为回复别人的评论,则针对父评论设置为已评论
- *
- * @param comment 保存评论入参
- * @param article 文章信息
- */
- void saveCommentFoot(CommentDO comment, ArticleDTO article);
-
- /**
- * 删除评论足迹
- *
- * @param comment 保存评论入参
- * @param article 文章信息
- */
- void removeCommentFoot(CommentDO comment, ArticleDTO article);
-
-
- /**
- * 查询已读文章列表
- *
- * @param userId
- * @param pageParam
- * @return
- */
- List queryUserReadArticleList(Long userId, PageParam pageParam);
-
- /**
- * 查询收藏文章列表
- *
- * @param userId
- * @param pageParam
- * @return
- */
- List queryUserCollectionArticleList(Long userId, PageParam pageParam);
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/UserRelationService.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/UserRelationService.java
deleted file mode 100644
index a76dca3eb..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/UserRelationService.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package com.github.liuyueyi.forum.service.user.service;
-
-import com.github.liueyueyi.forum.api.model.vo.PageParam;
-import com.github.liueyueyi.forum.api.model.vo.comment.dto.UserFollowListDTO;
-import com.github.liueyueyi.forum.api.model.vo.user.UserRelationReq;
-
-/**
- * 用户关系Service接口
- *
- * @author louzai
- * @date 2022-07-20
- */
-public interface UserRelationService {
-
- /**
- * 我关注的用户
- *
- * @param userId
- * @param pageParam
- * @return
- */
- UserFollowListDTO getUserFollowList(Long userId, PageParam pageParam);
-
-
- /**
- * 关注我的粉丝
- *
- * @param userId
- * @param pageParam
- * @return
- */
- UserFollowListDTO getUserFansList(Long userId, PageParam pageParam);
-
-
- /**
- * 保存用户关系
- *
- * @param req
- * @throws Exception
- */
- void saveUserRelation(UserRelationReq req);
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/UserService.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/UserService.java
deleted file mode 100644
index d09e48d4c..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/UserService.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package com.github.liuyueyi.forum.service.user.service;
-
-import com.github.liueyueyi.forum.api.model.vo.user.UserInfoSaveReq;
-import com.github.liueyueyi.forum.api.model.vo.user.UserSaveReq;
-import com.github.liueyueyi.forum.api.model.vo.user.dto.BaseUserInfoDTO;
-import com.github.liueyueyi.forum.api.model.vo.user.dto.UserStatisticInfoDTO;
-
-/**
- * 用户Service接口
- *
- * @author louzai
- * @date 2022-07-20
- */
-public interface UserService {
-
- /**
- * 用户存在时,直接返回;不存在时,则初始化
- *
- * @param req
- */
- void registerOrGetUserInfo(UserSaveReq req);
-
- /**
- * 保存用户详情
- *
- * @param req
- */
- void saveUserInfo(UserInfoSaveReq req);
-
- /**
- * 查询用户基本信息
- * todo: 可以做缓存优化
- *
- * @param userId
- * @return
- */
- BaseUserInfoDTO queryBasicUserInfo(Long userId);
-
-
- /**
- * 查询用户主页信息
- *
- * @param userId
- * @return
- * @throws Exception
- */
- UserStatisticInfoDTO queryUserInfoWithStatistic(Long userId);
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/count/CountServiceImpl.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/count/CountServiceImpl.java
deleted file mode 100644
index 7c174d53d..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/count/CountServiceImpl.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package com.github.liuyueyi.forum.service.user.service.count;
-
-import com.github.liueyueyi.forum.api.model.vo.user.dto.ArticleFootCountDTO;
-import com.github.liuyueyi.forum.service.comment.service.CommentReadService;
-import com.github.liuyueyi.forum.service.user.repository.dao.UserFootDao;
-import com.github.liuyueyi.forum.service.user.service.CountService;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-
-/**
- * 计数服务,后续计数相关的可以考虑基于redis来做
- *
- * @author YiHui
- * @date 2022/9/2
- */
-@Service
-public class CountServiceImpl implements CountService {
-
- private final UserFootDao userFootDao;
-
- @Resource
- private CommentReadService commentReadService;
-
- public CountServiceImpl(UserFootDao userFootDao) {
- this.userFootDao = userFootDao;
- }
-
- @Override
- public ArticleFootCountDTO queryArticleCountInfoByArticleId(Long articleId) {
- ArticleFootCountDTO res = userFootDao.countArticleByArticleId(articleId);
- if (res == null) {
- res = new ArticleFootCountDTO();
- } else {
- res.setCommentCount(commentReadService.queryCommentCount(articleId));
- }
- return res;
- }
-
-
- @Override
- public ArticleFootCountDTO queryArticleCountInfoByUserId(Long userId) {
- return userFootDao.countArticleByUserId(userId);
- }
-
- /**
- * 查询评论的点赞数
- *
- * @param commentId
- * @return
- */
- @Override
- public Long queryCommentPraiseCount(Long commentId) {
- return userFootDao.countCommentPraise(commentId);
- }
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/relation/UserRelationServiceImpl.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/relation/UserRelationServiceImpl.java
deleted file mode 100644
index 861013b44..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/relation/UserRelationServiceImpl.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package com.github.liuyueyi.forum.service.user.service.relation;
-
-import com.github.liueyueyi.forum.api.model.context.ReqInfoContext;
-import com.github.liueyueyi.forum.api.model.enums.FollowStateEnum;
-import com.github.liueyueyi.forum.api.model.exception.ExceptionUtil;
-import com.github.liueyueyi.forum.api.model.vo.PageParam;
-import com.github.liueyueyi.forum.api.model.vo.comment.dto.UserFollowDTO;
-import com.github.liueyueyi.forum.api.model.vo.comment.dto.UserFollowListDTO;
-import com.github.liueyueyi.forum.api.model.vo.constants.StatusEnum;
-import com.github.liueyueyi.forum.api.model.vo.user.UserRelationReq;
-import com.github.liuyueyi.forum.core.util.NumUtil;
-import com.github.liuyueyi.forum.service.user.converter.UserConverter;
-import com.github.liuyueyi.forum.service.user.repository.dao.UserRelationDao;
-import com.github.liuyueyi.forum.service.user.repository.entity.UserRelationDO;
-import com.github.liuyueyi.forum.service.user.service.UserRelationService;
-import org.springframework.stereotype.Service;
-import org.springframework.util.CollectionUtils;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-/**
- * 用户关系Service
- *
- * @author louzai
- * @date 2022-07-20
- */
-@Service
-public class UserRelationServiceImpl implements UserRelationService {
- @Resource
- private UserRelationDao userRelationDao;
-
-
- @Override
- public UserFollowListDTO getUserFollowList(Long userId, PageParam pageParam) {
- List userRelationList = userRelationDao.queryUserFollowList(userId, pageParam);
- return buildRes(userRelationList, pageParam);
- }
-
- @Override
- public UserFollowListDTO getUserFansList(Long userId, PageParam pageParam) {
- List userRelationList = userRelationDao.queryUserFansList(userId, pageParam);
- return buildRes(userRelationList, pageParam);
- }
-
- private UserFollowListDTO buildRes(List records, PageParam param) {
- if (CollectionUtils.isEmpty(records)) {
- return UserFollowListDTO.emptyInstance();
- }
-
- UserFollowListDTO userFollowListDTO = new UserFollowListDTO();
- userFollowListDTO.setUserFollowList(records);
- userFollowListDTO.setIsMore(records.size() == param.getPageSize());
- return userFollowListDTO;
- }
-
- @Override
- public void saveUserRelation(UserRelationReq req) {
- // 查询是否存在
- UserRelationDO userRelationDO = userRelationDao.getUserRelationRecord(req.getUserId(), ReqInfoContext.getReqInfo().getUserId());
- if (userRelationDO == null) {
- userRelationDao.save(UserConverter.toDO(req));
- return;
- }
- userRelationDO.setFollowState(req.getFollowed() ? FollowStateEnum.FOLLOW.getCode() : FollowStateEnum.CANCEL_FOLLOW.getCode());
- userRelationDao.updateById(userRelationDO);
- }
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/user/UserServiceImpl.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/user/UserServiceImpl.java
deleted file mode 100644
index 2e80c136a..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/user/UserServiceImpl.java
+++ /dev/null
@@ -1,132 +0,0 @@
-package com.github.liuyueyi.forum.service.user.service.user;
-
-import com.github.liueyueyi.forum.api.model.context.ReqInfoContext;
-import com.github.liueyueyi.forum.api.model.exception.ExceptionUtil;
-import com.github.liueyueyi.forum.api.model.vo.constants.StatusEnum;
-import com.github.liueyueyi.forum.api.model.vo.user.UserInfoSaveReq;
-import com.github.liueyueyi.forum.api.model.vo.user.UserSaveReq;
-import com.github.liueyueyi.forum.api.model.vo.user.dto.ArticleFootCountDTO;
-import com.github.liueyueyi.forum.api.model.vo.user.dto.BaseUserInfoDTO;
-import com.github.liueyueyi.forum.api.model.vo.user.dto.UserStatisticInfoDTO;
-import com.github.liuyueyi.forum.service.article.service.ArticleReadService;
-import com.github.liuyueyi.forum.service.user.converter.UserConverter;
-import com.github.liuyueyi.forum.service.user.repository.dao.UserDao;
-import com.github.liuyueyi.forum.service.user.repository.dao.UserRelationDao;
-import com.github.liuyueyi.forum.service.user.repository.entity.UserDO;
-import com.github.liuyueyi.forum.service.user.repository.entity.UserInfoDO;
-import com.github.liuyueyi.forum.service.user.repository.entity.UserRelationDO;
-import com.github.liuyueyi.forum.service.user.service.CountService;
-import com.github.liuyueyi.forum.service.user.service.UserService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import javax.annotation.Resource;
-
-/**
- * 用户Service
- *
- * @author louzai
- * @date 2022-07-20
- */
-@Service
-public class UserServiceImpl implements UserService {
-
- @Resource
- private UserDao userDao;
-
- @Resource
- private UserRelationDao userRelationDao;
-
- @Autowired
- private ArticleReadService articleReadService;
-
- @Autowired
- private CountService countService;
-
-
- /**
- * 用户存在时,直接返回;不存在时,则初始化
- *
- * @param req
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void registerOrGetUserInfo(UserSaveReq req) {
- UserDO record = userDao.getByThirdAccountId(req.getThirdAccountId());
- if (record != null) {
- // 用户存在,不需要注册
- req.setUserId(record.getId());
- return;
- }
-
- // 用户不存在,则需要注册
- record = UserConverter.toDO(req);
- userDao.saveUser(record);
- req.setUserId(record.getId());
-
- // 初始化用户信息
- UserInfoDO userInfo = new UserInfoDO();
- userInfo.setUserId(req.getUserId());
- userInfo.setUserName(String.format("小侠%06d", (int) (Math.random() * 1000000)));
- userInfo.setPhoto("");
- userDao.save(userInfo);
- }
-
- @Override
- public void saveUserInfo(UserInfoSaveReq req) {
- UserInfoDO userInfoDO = UserConverter.toDO(req);
- userDao.updateById(userInfoDO);
- }
-
- @Override
- public BaseUserInfoDTO queryBasicUserInfo(Long userId) {
- UserInfoDO user = userDao.getByUserId(userId);
- if (user == null) {
- throw ExceptionUtil.of(StatusEnum.USER_NOT_EXISTS, "userId=" + userId);
- }
- return UserConverter.toDTO(user);
- }
-
- @Override
- public UserStatisticInfoDTO queryUserInfoWithStatistic(Long userId) {
- BaseUserInfoDTO userInfoDTO = queryBasicUserInfo(userId);
- UserStatisticInfoDTO userHomeDTO = UserConverter.toUserHomeDTO(userInfoDTO);
- userHomeDTO.setRole("normal");
-
- // 获取文章相关统计
- ArticleFootCountDTO articleFootCountDTO = countService.queryArticleCountInfoByUserId(userId);
- if (articleFootCountDTO != null) {
- userHomeDTO.setPraiseCount(articleFootCountDTO.getPraiseCount());
- userHomeDTO.setReadCount(articleFootCountDTO.getReadCount());
- userHomeDTO.setCollectionCount(articleFootCountDTO.getCollectionCount());
- } else {
- userHomeDTO.setPraiseCount(0);
- userHomeDTO.setReadCount(0);
- userHomeDTO.setCollectionCount(0);
- }
-
- // 获取发布文章总数
- int articleCount = articleReadService.queryArticleCount(userId);
- userHomeDTO.setArticleCount(articleCount);
-
- // 获取关注数
- Long followCount = userRelationDao.queryUserFollowCount(userId);
- userHomeDTO.setFollowCount(followCount.intValue());
-
- // 粉丝数
- Long fansCount = userRelationDao.queryUserFansCount(userId);
- userHomeDTO.setFansCount(fansCount.intValue());
-
- // 是否关注
- Long followUserId = ReqInfoContext.getReqInfo().getUserId();
- if (followUserId != null) {
- UserRelationDO userRelationDO = userRelationDao.getUserRelationByUserId(userId, followUserId);
- userHomeDTO.setFollowed((userRelationDO == null) ? Boolean.FALSE : Boolean.TRUE);
- } else {
- userHomeDTO.setFollowed(Boolean.FALSE);
- }
- return userHomeDTO;
- }
-
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/user/WxLoginServiceImpl.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/user/WxLoginServiceImpl.java
deleted file mode 100644
index 6e7634228..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/user/WxLoginServiceImpl.java
+++ /dev/null
@@ -1,121 +0,0 @@
-package com.github.liuyueyi.forum.service.user.service.user;
-
-import com.github.liueyueyi.forum.api.model.exception.NoVlaInGuavaException;
-import com.github.liueyueyi.forum.api.model.vo.user.UserSaveReq;
-import com.github.liueyueyi.forum.api.model.vo.user.dto.BaseUserInfoDTO;
-import com.github.liuyueyi.forum.core.util.CodeGenerateUtil;
-import com.github.liuyueyi.forum.service.user.service.LoginService;
-import com.github.liuyueyi.forum.service.user.service.UserService;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.PostConstruct;
-import java.util.UUID;
-import java.util.concurrent.TimeUnit;
-
-/**
- * 基于微信公众号的登录方式
- *
- * @author YiHui
- * @date 2022/8/15
- */
-@Service
-public class WxLoginServiceImpl implements LoginService {
- /**
- * key = userId, value = 验证码
- */
- private LoadingCache verifyCodeCache;
- /**
- * key = 验证码 value = userId
- */
- private LoadingCache codeUserIdCache;
- /**
- * key = session, value = userId
- */
- private LoadingCache sessionMap;
- @Autowired
- private UserService userService;
-
- /**
- * todo 知识点:bean完成之后的初始化方式,除了 @PostConstruct 之外还有构造方法方式、实现BeanPostProcessor接口方式
- */
- @PostConstruct
- public void init() {
- // 五分钟内,最多只支持300个用户登录;注意当服务多台机器部署时,基于本地缓存会有问题;请改成redis/memcache缓存
- verifyCodeCache = CacheBuilder.newBuilder().maximumSize(300).expireAfterWrite(5, TimeUnit.MINUTES).build(new CacheLoader() {
- @Override
- public String load(Long userId) {
- String code = CodeGenerateUtil.genCode();
- codeUserIdCache.put(code, userId);
- return code;
- }
- });
- codeUserIdCache = CacheBuilder.newBuilder().maximumSize(300).expireAfterWrite(5, TimeUnit.MINUTES).build(new CacheLoader() {
- @Override
- public Long load(String s) throws Exception {
- throw new NoVlaInGuavaException("not hit!");
- }
- });
-
- sessionMap = CacheBuilder.newBuilder().expireAfterWrite(1, TimeUnit.DAYS).build(new CacheLoader() {
- @Override
- public Long load(String userId) {
- throw new NoVlaInGuavaException("not hit!");
- }
- });
- }
-
- /**
- * 获取验证码,注意一个验证码只使用一次;每次请求验证码时,重新生成一个
- *
- * @param userId
- * @return
- */
- private String getVerifyCodeFromCache(Long userId) {
- String code = verifyCodeCache.getUnchecked(userId);
- verifyCodeCache.invalidate(userId);
- return code;
- }
-
- @Override
- public String getVerifyCode(String uuid) {
- UserSaveReq req = new UserSaveReq().setLoginType(0).setThirdAccountId(uuid);
- userService.registerOrGetUserInfo(req);
- return getVerifyCodeFromCache(req.getUserId());
- }
-
- @Override
- public String login(String code) {
- Long userId = codeUserIdCache.getIfPresent(code);
- if (userId == null) {
- return null;
- }
-
- String session = "s-" + UUID.randomUUID();
- sessionMap.put(session, userId);
- // 验证完之后,移除掉,避免重复使用
- codeUserIdCache.invalidate(code);
- return session;
- }
-
- @Override
- public void logout(String session) {
- sessionMap.invalidate(session);
- sessionMap.cleanUp();
- }
-
-
- @Override
- public BaseUserInfoDTO getUserBySessionId(String session) {
- if (StringUtils.isBlank(session)) {
- return null;
- }
-
- Long userId = sessionMap.getIfPresent(session);
- return userId == null ? null : userService.queryBasicUserInfo(userId);
- }
-}
diff --git a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/userfoot/UserFootServiceImpl.java b/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/userfoot/UserFootServiceImpl.java
deleted file mode 100644
index e70f484c0..000000000
--- a/forum-service/src/main/java/com/github/liuyueyi/forum/service/user/service/userfoot/UserFootServiceImpl.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package com.github.liuyueyi.forum.service.user.service.userfoot;
-
-import com.github.liueyueyi.forum.api.model.enums.DocumentTypeEnum;
-import com.github.liueyueyi.forum.api.model.enums.OperateTypeEnum;
-import com.github.liueyueyi.forum.api.model.vo.PageParam;
-import com.github.liueyueyi.forum.api.model.vo.article.dto.ArticleDTO;
-import com.github.liuyueyi.forum.service.comment.repository.entity.CommentDO;
-import com.github.liuyueyi.forum.service.user.repository.dao.UserFootDao;
-import com.github.liuyueyi.forum.service.user.repository.entity.UserFootDO;
-import com.github.liuyueyi.forum.service.user.service.UserFootService;
-import org.springframework.stereotype.Service;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-/**
- * 用户足迹Service
- *
- * @author louzai
- * @date 2022-07-20
- */
-@Service
-public class UserFootServiceImpl implements UserFootService {
- private final UserFootDao userFootDao;
-
- public UserFootServiceImpl(UserFootDao userFootDao) {
- this.userFootDao = userFootDao;
- }
-
- /**
- * 保存或更新状态信息
- *
- * @param documentType 文档类型:博文 + 评论
- * @param documentId 文档id
- * @param authorId 作者
- * @param userId 操作人
- * @param operateTypeEnum 操作类型:点赞,评论,收藏等
- */
- @Override
- public UserFootDO saveOrUpdateUserFoot(DocumentTypeEnum documentType, Long documentId, Long authorId, Long userId, OperateTypeEnum operateTypeEnum) {
- // 查询是否有该足迹;有则更新,没有则插入
- UserFootDO readUserFootDO = userFootDao.getByDocumentAndUserId(documentId, documentType.getCode(), userId);
- if (readUserFootDO == null) {
- readUserFootDO = new UserFootDO();
- readUserFootDO.setUserId(userId);
- readUserFootDO.setDocumentId(documentId);
- readUserFootDO.setDocumentType(documentType.getCode());
- readUserFootDO.setDocumentUserId(authorId);
- setUserFootStat(readUserFootDO, operateTypeEnum);
- userFootDao.save(readUserFootDO);
- } else if (setUserFootStat(readUserFootDO, operateTypeEnum)) {
- readUserFootDO.setUpdateTime(new Date());
- userFootDao.updateById(readUserFootDO);
- }
- return readUserFootDO;
- }
-
-
- @Override
- public void saveCommentFoot(CommentDO comment, ArticleDTO article) {
- // 保存文章对应的评论足迹
- saveOrUpdateUserFoot(DocumentTypeEnum.ARTICLE, article.getArticleId(), article.getAuthor(), comment.getUserId(), OperateTypeEnum.COMMENT);
- // 如果是子评论,则找到父评论的记录,然后设置为已评
- if (comment.getParentCommentId() != null &&comment.getParentCommentId() != 0) {
- // 如果需要展示父评论的子评论数量,authorId 需要传父评论的 userId
- saveOrUpdateUserFoot(DocumentTypeEnum.COMMENT, comment.getParentCommentId(), 0L, comment.getUserId(), OperateTypeEnum.COMMENT);
- }
- }
-
- @Override
- public void removeCommentFoot(CommentDO comment, ArticleDTO article) {
- saveOrUpdateUserFoot(DocumentTypeEnum.ARTICLE, article.getArticleId(), article.getAuthor(), comment.getUserId(), OperateTypeEnum.DELETE_COMMENT);
- if (comment.getParentCommentId() != null) {
- // 如果需要展示父评论的子评论数量,authorId 需要传父评论的 userId
- saveOrUpdateUserFoot(DocumentTypeEnum.COMMENT, comment.getParentCommentId(), 0L, comment.getUserId(), OperateTypeEnum.DELETE_COMMENT);
- }
- }
-
-
- private boolean setUserFootStat(UserFootDO userFootDO, OperateTypeEnum operate) {
- switch (operate) {
- case READ:
- return true;
- case PRAISE:
- case CANCEL_PRAISE:
- return compareAndUpdate(userFootDO::getPraiseStat, userFootDO::setPraiseStat, operate.getDbStatCode());
- case COLLECTION:
- case CANCEL_COLLECTION:
- return compareAndUpdate(userFootDO::getCollectionStat, userFootDO::setCollectionStat, operate.getDbStatCode());
- case COMMENT:
- case DELETE_COMMENT:
- return compareAndUpdate(userFootDO::getCommentStat, userFootDO::setCommentStat, operate.getDbStatCode());
- default:
- return false;
- }
- }
-
- /**
- * 相同则直接返回false不用更新;不同则更新,返回true
- *
- * @param supplier
- * @param consumer
- * @param input
- * @param
- * @return
- */
- private boolean compareAndUpdate(Supplier supplier, Consumer consumer, T input) {
- if (Objects.equals(supplier.get(), input)) {
- return false;
- }
- consumer.accept(input);
- return true;
- }
-
- @Override
- public List queryUserReadArticleList(Long userId, PageParam pageParam) {
- return userFootDao.listReadArticleByUserId(userId, pageParam);
- }
-
- @Override
- public List queryUserCollectionArticleList(Long userId, PageParam pageParam) {
- return userFootDao.listCollectedArticlesByUserId(userId, pageParam);
- }
-}
diff --git a/forum-service/src/main/resources/META-INF/spring.factories b/forum-service/src/main/resources/META-INF/spring.factories
deleted file mode 100644
index 409ca19be..000000000
--- a/forum-service/src/main/resources/META-INF/spring.factories
+++ /dev/null
@@ -1,3 +0,0 @@
-# Auto Configure
-org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
-com.github.liuyueyi.forum.service.ServiceAutoConfig
\ No newline at end of file
diff --git a/forum-service/src/main/resources/mapper/ArticleTagMapper.xml b/forum-service/src/main/resources/mapper/ArticleTagMapper.xml
deleted file mode 100644
index e60ea77e5..000000000
--- a/forum-service/src/main/resources/mapper/ArticleTagMapper.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
- select a.article_id as articleId, a.tag_id as tagId, t.tag_name as tag
- from article_tag as a
- left join tag as t on a.tag_id = t.id
- where a.article_id = #{articleId}
- and a.deleted = 0
-
-
diff --git a/forum-service/src/main/resources/mapper/UserFootMapper.xml b/forum-service/src/main/resources/mapper/UserFootMapper.xml
deleted file mode 100644
index e0e9b448d..000000000
--- a/forum-service/src/main/resources/mapper/UserFootMapper.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
- SELECT
- sum(if (f.praise_stat =${@com.github.liueyueyi.forum.api.model.enums.PraiseStatEnum@PRAISE.code}, 1, 0)) as praiseCount,
- sum(if (f.collection_stat =${@com.github.liueyueyi.forum.api.model.enums.CollectionStatEnum@COLLECTION.code}, 1, 0)) as collectionCount,
- sum(r.`cnt`) as readCount
- FROM
- read_count as r left join user_foot as f on f.document_id = r.document_id and f.document_type = r.document_type
- WHERE
- r.document_type = ${@com.github.liueyueyi.forum.api.model.enums.DocumentTypeEnum@ARTICLE.code}
- AND r.document_id = #{articleId}
-
-
-
-
-
- SELECT
- sum(if (f.praise_stat =${@com.github.liueyueyi.forum.api.model.enums.PraiseStatEnum@PRAISE.code}, 1, 0)) as praiseCount,
- sum(if (f.collection_stat =${@com.github.liueyueyi.forum.api.model.enums.CollectionStatEnum@COLLECTION.code}, 1, 0)) as collectionCount,
- sum(r.`cnt`) as readCount
- FROM
- read_count as r left join user_foot as f on f.document_id = r.document_id and f.document_type = r.document_type
- WHERE
- r.document_type = ${@com.github.liueyueyi.forum.api.model.enums.DocumentTypeEnum@ARTICLE.code}
- AND f.document_user_id = #{userId}
-
-
-
-
- SELECT
- `document_id`
- FROM user_foot
- WHERE
- user_id = #{userId} and document_type = 1 and collection_stat = 1 order by update_time desc
-
- limit #{pageParam.offset}, #{pageParam.limit}
-
-
-
-
-
- SELECT
- `document_id`
- FROM user_foot
- WHERE
- user_id = #{userId} and document_type = 1 and read_stat = 1 order by update_time desc
-
- limit #{pageParam.offset}, #{pageParam.limit}
-
-
-
-
-
diff --git a/forum-service/src/main/resources/mapper/UserRelationMapper.xml b/forum-service/src/main/resources/mapper/UserRelationMapper.xml
deleted file mode 100644
index c3ea95db4..000000000
--- a/forum-service/src/main/resources/mapper/UserRelationMapper.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
- limit #{pageParam.offset}, #{pageParam.limit}
-
-
-
-
-
- SELECT
- u.user_id as userId,
- u.user_name as userName,
- u.photo as photo,
- u.profile as profile,
- r.id as userRelationId
- FROM user_relation as r
- left join user_info as u on r.user_id = u.user_id
- WHERE
- r.follow_user_id = #{followUserId}
- and r.follow_state = ${@com.github.liueyueyi.forum.api.model.enums.FollowStateEnum@FOLLOW.code}
- ORDER BY u.id desc
-
-
-
-
-
- SELECT
- u.user_id as userId,
- u.user_name as userName,
- u.photo as photo,
- u.profile as profile,
- r.id as userRelationId
- FROM user_relation as r
- left join user_info as u on r.follow_user_id = u.user_id
- WHERE
- r.user_id = #{userId}
- and r.follow_state = ${@com.github.liueyueyi.forum.api.model.enums.FollowStateEnum@FOLLOW.code}
- ORDER BY u.id desc
-
-
-
-
-
diff --git a/forum-ui/README.md b/forum-ui/README.md
deleted file mode 100644
index 6b9e4de5e..000000000
--- a/forum-ui/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-forum-ui
-===
-
-存储前段资源文件
\ No newline at end of file
diff --git a/forum-ui/pom.xml b/forum-ui/pom.xml
deleted file mode 100644
index d0461be5b..000000000
--- a/forum-ui/pom.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
- quick-forum
- com.github.liuyueyi.quick-forum
- 0.0.1-SNAPSHOT
-
- 4.0.0
-
- forum-ui
-
-
-
- org.springframework.boot
- spring-boot-starter-thymeleaf
-
-
-
-
\ No newline at end of file
diff --git a/forum-ui/src/main/resources/static/css/content.css b/forum-ui/src/main/resources/static/css/content.css
deleted file mode 100644
index b77c4e796..000000000
--- a/forum-ui/src/main/resources/static/css/content.css
+++ /dev/null
@@ -1,315 +0,0 @@
-.article-content img {
- max-width: 100%;
- max-height: 500px;
- box-sizing: content-box;
- background-color: #fff;
- margin: 0 auto;
-}
-
-.article-content h1,
-.article-content h2,
-.article-content h3,
-.article-content h4,
-.article-content h5 {
- color: #333;
- margin-bottom: 10px;
- padding-bottom: 7px;
-}
-
-.article-content h1 {
- border-bottom: 1px solid #eaecef;
- font-size: 1.7em;
-}
-
-.article-content h2 {
- font-size: 1.5em;
-}
-
-.article-content h3 {
- font-size: 1.3em;
-}
-
-.article-content h4 {
- font-size: 1.1em;
-}
-
-.article-content h5 {
- font-size: 1em;
-}
-
-.article-content p,
-.article-content ol,
-.article-content ul,
-.article-content table,
-.article-content pre,
-.article-content blockquote {
- /* font-weight: 400; */
- line-height: 1.8;
- margin-bottom: 15px;
-}
-
-.article-content blockquote {
- padding: 0 1em;
- color: #6a737d;
- border-left: .25em solid #dfe2e5;
-}
-
-.article-content ol,
-.article-content ul {
- padding-left: 20px;
-}
-
-.article-content table {
- display: table;
- border-collapse: separate;
- border-spacing: 2px;
- border-color: grey;
- border-spacing: 0;
- border-collapse: collapse;
- font-size: 14px;
-}
-
-.article-content table th,
-.article-content table tr,
-.article-content table td {
- padding: 6px 13px;
- border: 1px solid #dfe2e5;
-}
-
-.article-content pre {
- padding: 5px;
- overflow: auto;
- font-size: 85%;
- line-height: 1.45;
- background-color: #fafafa;
- border-radius: 3px;
- word-wrap: normal;
-}
-
-.article-content pre div {
- background-color: #fafafa;
-}
-
-.article-content li {
- /* font-weight: 400; */
- line-height: 1.4;
- font-size: 15px;
- margin-bottom: 5px;
-}
-
-.article-content .hljs-center {
- text-align: center;
-}
-
-.article-content .hljs-left {
- text-align: left;
-}
-
-.article-content .hljs-right {
- text-align: right;
-}
-
-.article-suspended-panel {
- position: fixed;
- margin-left: -7rem;
- top: 140px;
- z-index: 2;
-}
-
-.panel-btn {
- position: relative;
- margin-bottom: 1.667rem;
- width: 3rem;
- height: 3rem;
- background-color: #fff;
- background-position: 50%;
- background-repeat: no-repeat;
- border-radius: 50%;
- box-shadow: 0 2px 4px 0 rgba(0,0,0,.04);
- cursor: pointer;
- text-align: center;
- font-size: 1.67rem
-}
-
-.panel-btn .sprite-icon {
- color: #8a919f;
- height: 100%
-}
-
-.panel-btn:hover .sprite-icon {
- color: #515767
-}
-
-.panel-btn:not(.share-btn).active .sprite-icon {
- color: #1e80ff
-}
-
-.panel-btn:not(.share-btn).active .sprite-icon.icon-collect {
- color: #ffb800
-}
-
-.panel-btn:not(.share-btn).active .sprite-icon {
- color: #1e80ff;
-}
-
-
-.panel-btn:not(.share-btn).active.with-badge:after {
- background-color: #1e80ff
-}
-
-.panel-btn.with-badge:after {
- content: attr(badge);
- position: absolute;
- top: 0;
- left: 75%;
- height: 17px;
- line-height: 17px;
- padding: 0 5px;
- border-radius: 9px;
- font-size: 11px;
- text-align: center;
- white-space: nowrap;
- background-color: #c2c8d1;
- color: #fff
-}
-
-.panel-btn.share-btn:after {
- display: block;
- content: " ";
- position: absolute;
- width: 100%;
- height: 100%;
- top: 0;
- left: 50%
-}
-
-.panel-btn.share-btn:hover .share-popup {
- display: flex
-}
-
-.panel-btn.share-btn .share-popup {
- display: none;
- position: absolute;
- top: 0;
- flex-direction: column;
- left: calc(100% + 14px);
- z-index: 30;
- background: #fff;
- border-radius: 4px;
- padding: 9px 0;
- width: -webkit-max-content;
- width: -moz-max-content;
- width: max-content;
- box-shadow: 0 8px 24px rgba(81,87,103,.16)
-}
-
-.panel-btn.share-btn .share-popup:after {
- position: absolute;
- width: 0;
- height: 0;
- content: " ";
- right: 100%;
- top: 14px;
- border: 12px solid transparent;
- border-right-color: #fff
-}
-
-.panel-btn.share-btn .share-popup .share-item {
- display: flex;
- align-items: center;
- height: 44px;
- padding: 0 15px
-}
-
-.panel-btn.share-btn .share-popup .share-item:hover {
- background-color: #f2f3f5
-}
-
-.panel-btn.share-btn .share-popup .share-item:hover.wechat .wechat-qrcode {
- display: flex
-}
-
-.panel-btn.share-btn .share-popup .share-item:hover .share-icon {
- color: #515767
-}
-
-.panel-btn.share-btn .share-popup .share-item .share-item-title {
- margin-left: 8px;
- font-size: 14px;
- color: #515767
-}
-
-.panel-btn.share-btn .share-popup .share-item .share-icon {
- color: #8a919f;
- width: 20px;
- height: 20px;
- font-size: 1.67rem
-}
-
-.share-title {
- margin: 2.5rem 0 1rem;
- font-size: 1rem;
- text-align: center;
- color: #c6c6c6;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none
-}
-
-.collect-popover {
- width: 200px;
- box-sizing: border-box;
- background-color: #fff;
- padding: 12px 20px;
- border-radius: 4px;
- font-size: 13px;
- color: #8a919f;
- line-height: 22px;
- text-align: left;
- position: absolute;
- left: 4rem;
- top: -10px;
- margin-left: 15px;
- box-shadow: 0 8px 24px rgba(81,87,103,.26)
-}
-
-.collect-popover:after {
- content: "";
- display: block;
- width: 0;
- height: 0;
- border-top: 12px solid #fff;
- border-left: 12px solid #fff;
- transform: rotate(45deg);
- position: absolute;
- top: 30px;
- left: -6px
-}
-
-.collect-popover-title {
- color: #252933;
- font-weight: 500;
- font-size: 14px;
- margin-bottom: 4px
-}
-
-.collect-popover-content {
- display: flex;
- flex-direction: row
-}
-
-.collect-popover-button {
- color: #1e80ff;
- font-weight: 500;
- cursor: pointer;
- margin-right: 4px
-}
-
-.sprite-icon {
- width: 1em;
- height: 1em;
- fill: currentColor;
- vertical-align: middle;
- transition: all .15s linear
-}
\ No newline at end of file
diff --git a/forum-ui/src/main/resources/static/css/global.css b/forum-ui/src/main/resources/static/css/global.css
deleted file mode 100644
index 2ea7af9ee..000000000
--- a/forum-ui/src/main/resources/static/css/global.css
+++ /dev/null
@@ -1,521 +0,0 @@
-body {
- -webkit-font-smoothing: antialiased;
-}
-
-.custom-empty {
- text-align: center;
- margin-top: 20px;
- width: 100%;
- font-size: 1rem;
-}
-
-html,
-.custom-bg-color {
- background-color: #EEEEEE;
-}
-
-.posts-comment-input-box,
-.posts-author-box,
-.posts-box,
-.page-box,
-.user-info-box {
- background-color: #fff;
-}
-
-.btn-outline-primary:hover,
-.page-item.active .page-link,
-.current-page {
- color: #fff !important;
-}
-
-.bottom-line,
-.list-group,
-.editor-title {
- border-bottom: 1px solid rgba(0, 0, 0, .125);
-}
-
-.faq-solution-box,
-.posts-comment-input-box {
- background-color: #fafbfc;
-}
-
-.posts-comment-input-box {
- margin-top: -20px;
-}
-
-.posts-comment-box,
-.posts-author-box,
-.posts-box,
-.editor-form-box,
-.editor-title,
-.card-body,
-.card-header {
- padding: 20px;
-}
-
-.type-box {
- padding: 10px;
-}
-
-.tag-box,
-.no-comment-box,
-.posts-author-box,
-.posts-box,
-.card,
-.user-info-box,
-.page-box,
-.carousel {
- margin-bottom: 0px;
-}
-
-.custom-theme-bg-color,
-.btn-outline-primary:hover,
-.page-item.active .page-link,
-.btn-primary,
-.btn-primary:active,
-.btn-primary:focus,
-.btn-primary:hover,
-.current-page {
- background-color: #007fff !important;
-}
-
-.btn-outline-primary:hover,
-.page-item.active .page-link,
-.btn-primary,
-.btn-primary:active,
-.btn-primary:focus,
-.btn-primary:hover,
-.btn-outline-primary {
- border-color: #007fff;
-}
-
-.page-link,
-.page-link:hover,
-.btn-outline-primary,
-.posts-admin-tag-official,
-a:hover,
-.custom-font-color {
- color: #007fff;
-}
-
-a {
- color: #212529;
-}
-
-.dropdown-menu,
-.card {
- border: 0;
-}
-
-.input-group-text,
-.navbar-toggler,
-.modal-content,
-.card {
- margin-bottom: 10px;
-}
-.form-control,
-.btn,
-.dropdown-menu,
-.list-group-item:first-child,
-.list-group-item:last-child,
-.pagination {
- border-radius: 0;
-}
-
-/* */
-html {
- padding-top: 82px;
-}
-
-.posts-list-desc,
-a {
- color: rgba(0, 0, 0, .87);
-}
-
-.custom-by-both {
- padding-left: 10px;
- padding-right: 10px;
-}
-
-.carousel-inner img {
- width: 100%;
- height: 100%;
-}
-
-.foot {
- height: 70px;
-}
-
-.foot-link {
- list-style: none;
- padding: 25px 0;
- width: 80%;
- margin: 0 auto;
- text-align: left;
- font-size: 0;
- border-top: 1px solid rgba(0, 0, 0, .1);
-}
-
-.foot li {
- font-size: 14px;
- padding: 0 10px;
- display: inline-block;
- vertical-align: middle;
- line-height: 1em;
-}
-
-.foot li:last-child {
- border-left: none;
- float: right;
- padding-right: 0;
-}
-
-.posts-list-desc {
- display: inline;
- max-height: 48px;
- text-overflow: -o-ellipsis-lastline;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- line-clamp: 2;
- -webkit-box-orient: vertical;
-}
-
-.posts-list-title {
- font-size: 18px;
- font-weight: 700;
- line-height: 1.5;
- margin-bottom: 5px;
- color: rgba(0, 0, 0, .85);
-}
-
-.posts-list-payload-item,
-.posts-list-payload-item a,
-.posts-list-payload-box-author {
- color: #6c757d !important;
-}
-
-.posts-list-payload-item {
- padding: 3px 8px;
-}
-
-.page-box {
- padding: 10px;
-}
-
-.faq-solution-box {
- margin-top: 10px;
- padding: 15px;
-}
-
-.faq-solution-box,
-.posts-list-desc {
- font-size: 13px;
- line-height: 24px;
-}
-
-.posts-admin-tag {
- margin-top: 4px;
- height: 16px;
- padding: 2px;
- border-radius: 2px;
- line-height: 1;
- font-size: 12px;
- margin-right: 6px;
- vertical-align: middle;
- -webkit-transform: translateY(1px);
- -ms-transform: translateY(1px);
- transform: translateY(1px);
-}
-
-.posts-admin-tag-official {
- background: rgba(101, 212, 117, 0.1);
-}
-
-.posts-admin-tag-top {
- color: #f85959;
- background: rgba(248, 89, 89, 0.1);
-}
-
-.posts-admin-tag-marrow {
- color: #3c8cff;
- background: rgba(60, 140, 255, 0.1);
-}
-
-.selected-domain {
- border-bottom: 0 solid #3973ff;
-}
-
-.selected-domain a {
- color: #3973ff;
-}
-
-.user-info-box {
- height: 200px;
- width: 100%;
- margin-left: 0;
- margin-right: 0;
-}
-
-.user-info-date-box {
- height: 80px;
- padding-top: 40px;
- padding-left: 40px;
-}
-
-.user-info-date-box > p {
- display: inline-block;
-}
-
-.user-info-desc-box {
- margin-top: 15px;
- padding-left: 40px;
- padding-right: 40px;
-}
-
-/* 覆盖框架默认样式 */
-.navbar {
- padding: .5rem 4rem;
-}
-
-.container-bg-light {
- background: #ffffff;
-}
-
-.input-icon {
- position: relative;
-}
-
-.input-icon input {
- border-radius: 26px;
-}
-
-.input-icon-addon {
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- display: flex;
- align-items: center;
- justify-content: center;
- min-width: 2.5rem;
- color: rgb(179 174 174 / 60%);
- pointer-events: none;
- font-size: 1.2em;
-}
-
-.input-icon .form-control:not(:first-child), .input-icon .form-select:not(:last-child) {
- padding-left: 2.5rem;
-}
-
-
-.list-group-item {
- border: none;
- padding: 0.75rem 1.25rem;
-}
-
-.btn {
- padding-left: 25px;
- padding-right: 25px;
-}
-
-.btn-sm {
- padding-left: 15px;
- padding-right: 15px;
-}
-
-.page-item:first-child .page-link,
-.page-item:last-child .page-link {
- border-radius: 0;
-}
-
-.comment-avatar-box {
- width: 40px;
- float: left;
-}
-
-.posts-comment-input-box-btn {
- width: 100%;
- display: none;
-}
-
-.posts-comment-input-box-textarea {
- padding: 4px 10px;
- font-size: 13px;
- line-height: 1.7;
-}
-
-.posts-comment-input-box-textarea,
-.comment-content-box {
- width: calc(100% - 40px);
- float: right;
-}
-
-.best-answer {
- margin-left: 20px;
-}
-
-.best-answer:hover,
-.reply-comment:hover {
- cursor: pointer;
-}
-
-.comment-content-box-title {
- font-size: 16px;
- color: #3d464d;
- font-weight: 300;
-}
-
-.comment-content-box-content {
- color: #505050;
- font-size: 14px;
- margin: 12px 0;
-}
-
-.comment-content-box-foot {
- color: #b2b2b2;
- font-size: 14px;
-}
-
-.navbar-count-msg-box {
- position: relative;
-}
-
-.navbar-count-msg {
- position: absolute;
- top: 8px;
- right: 0;
- width: 10px;
- height: 10px;
- border-radius: 50%;
- background-color: #f85959;
-}
-
-.nav-item {
- clear: both;
- margin: 0;
- padding: 5px 10px;
- color: rgba(0, 0, 0, .65);
- font-weight: 600;
- font-size: 1.1em;
- line-height: 22px;
- white-space: nowrap;
- cursor: pointer;
- transition: all .3s;
-}
-
-.navbar-light .navbar-nav .nav-link {
- color: rgba(0, 0, 0, .85);
-}
-
-.message-block {
- margin-right: 10px;
-}
-
-.third-oauth-login-box::before {
- content: '三方账号登录';
- position: absolute;
- left: 50%;
- bottom: 55px;
- font-size: 10px;
- transform: translateX(-50%);
- -webkit-transform: translate(-50%, -50%);
- padding: 0 10px;
- background-color: #fff;
-}
-
-.third-oauth-login-box {
- display: block;
- text-align: center;
-}
-
-/* 设备适配样式 */
-@media (max-width: 768px) {
- html {
- padding-top: 68px;
- }
-
- .navbar {
- padding: .5rem 1rem;
- }
-
- .foot-link {
- padding: 10px 0;
- }
-
- .foot li {
- display: block;
- padding: 10px 0 0 0;
- }
-
- .foot li:last-child {
- float: none;
- }
-
- .tag-box,
- .no-comment-box,
- .posts-author-box,
- .posts-box,
- .card {
- margin-bottom: 10px;
- }
- .carousel
- .page-box,
- .user-info-box {
- margin-bottom: 10px;
- }
-
- .user-info-date-box {
- display: none;
- }
-
- .user-info-desc-box {
- padding-left: 10px;
- padding-right: 0;
- }
-
- .best-answer {
- margin-left: 10px;
- }
-
- .posts-comment-box,
- .posts-box,
- .editor-form-box,
- .card-body,
- .card-header,
- .list-group-item,
- .faq-solution-box,
- .editor-title {
- padding: 10px;
- }
-
- .type-box {
- padding: 0;
- }
-
- .posts-comment-input-box {
- margin-top: -10px;
- }
-
- .user-edit-btn {
- display: none;
- }
-
- .message-block {
- margin-right: 5px;
- }
-}
-.parent-wrapper {
- display: flex;
- background: #f2f3f5;
- border: 1px solid #e4e6eb;
- box-sizing: border-box;
- border-radius: 4px;
- padding: 0 12px;
- line-height: 36px;
- height: 36px;
- font-size: 14px;
- color: #8a919f;
- margin-top: 8px;
-}
\ No newline at end of file
diff --git a/forum-ui/src/main/resources/static/js/biz/forum.js b/forum-ui/src/main/resources/static/js/biz/forum.js
deleted file mode 100644
index f188236ab..000000000
--- a/forum-ui/src/main/resources/static/js/biz/forum.js
+++ /dev/null
@@ -1,44 +0,0 @@
-const post = function (path, data, callback) {
- $.ajax({
- method: 'POST',
- url: path,
- contentType: 'application/json',
- data: JSON.stringify(data),
- success: function (data) {
- console.log("data", data);
- if (!data || !data.status || data.status.code != 0) {
- toastr.error(data.message);
- } else if (callback) {
- callback(data.result);
- }
- },
- error: function (data) {
- toastr.error(data);
- }
- });
-};
-
-const loadScript = function (url, callback) {
- const secScript = document.createElement("script");
- if (secScript.readyState) { // IE
- secScript.onreadystatechange = function () {
- if (secScript.readyState === 'loaded' || secScript.readyState === 'complete') {
- secScript.onreadystatechange = null;
- callback();
- }
- }
- } else { // 其他浏览器
- secScript.onload = function () {
- callback();
- }
- }
- secScript.setAttribute("type", "text/javascript");
- secScript.setAttribute("src", url);
- document.body.insertBefore(secScript, document.body.lastChild);
-};
-
-const loadLink = function (url) {
- let headHTML = document.getElementsByTagName('head')[0].innerHTML;
- headHTML += ' ';
- document.getElementsByTagName('head')[0].innerHTML = headHTML;
-};
diff --git a/forum-ui/src/main/resources/static/js/biz/login.js b/forum-ui/src/main/resources/static/js/biz/login.js
deleted file mode 100644
index a77c2e278..000000000
--- a/forum-ui/src/main/resources/static/js/biz/login.js
+++ /dev/null
@@ -1,37 +0,0 @@
-$('#logoutBtn').click(function () {
- $.ajax({
- url: "/logout",
- dataType: "json",
- type: "get",
- success: function (data) {
- toastr.success("已退出登录")
- window.location.href = "/";
- }
- })
-})
-
-$('#loginBtn').click(function () {
- const code = $('#loginCode').val();
- console.log("开始登录:" + code);
- $.ajax({
- url: "/login?code=" + code, //请求的url地址
- dataType: "json", //返回格式为json
- async: false,//请求是否异步,默认为异步,这也是ajax重要特性
- type: "GET", //请求方式
- success: function (data) {
- //请求成功时处理
- console.log("response data:", data);
- if (!data || !data.status || data.status.code !== 0) {
- toastr.error(data.status.msg);
- } else {
- // 登录成功,刷新
- window.location.reload();
- toastr.success("登录成功");
- }
- },
- error: function () {
- //请求出错处理
- toastr.error("登录错误");
- }
- });
-});
\ No newline at end of file
diff --git a/forum-ui/src/main/resources/static/js/biz/toolaction.js b/forum-ui/src/main/resources/static/js/biz/toolaction.js
deleted file mode 100644
index 2ddee21ed..000000000
--- a/forum-ui/src/main/resources/static/js/biz/toolaction.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// 文章点赞
-const praiseArticle = function (articleId, action, callback) {
- // 2 点赞, 4 取消点赞
- const type = action ? 2 : 4;
- $.get('/article/api/favor?articleId=' + articleId + "&type=" + type, function (data) {
- console.log("response:", data);
- if (!data || !data.status || data.status.code !== 0) {
- toastr.error(data.message);
- } else if (callback) {
- callback(data.result);
- }
- });
-}
-
-// 评论点赞
-const praiseComment = function (commentId, action, callback) {
- // 2 点赞, 4 取消点赞
- const type = action ? 2 : 4;
- $.get('/comment/api/favor?commentId=' + commentId + "&type=" + type, function (data) {
- console.log("response:", data);
- if (!data || !data.status || data.status.code !== 0) {
- toastr.error(data.message);
- } else if (callback) {
- callback(data.result);
- }
- });
-}
-
-// 文章收藏
-const collectArticle = function (articleId, action, callback) {
- // 3 收藏, 5 取消收藏
- const type = action ? 3 : 5;
- $.get('/article/api/favor?articleId=' + articleId + "&type=" + type, function (data) {
- console.log("response:", data);
- if (!data || !data.status || data.status.code !== 0) {
- toastr.error(data.message);
- } else if (callback) {
- callback(data.result);
- }
- });
-}
diff --git a/forum-ui/src/main/resources/static/js/jquery.min.js b/forum-ui/src/main/resources/static/js/jquery.min.js
deleted file mode 100644
index 644d35e27..000000000
--- a/forum-ui/src/main/resources/static/js/jquery.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */
-!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML=" ",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML=" ";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML=" ","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML=" ",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext;function B(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,D=/^.[^:#\[\.,]*$/;function E(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):D.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(E(this,a||[],!1))},not:function(a){return this.pushStack(E(this,a||[],!0))},is:function(a){return!!E(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var F,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||F,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:G.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),C.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};H.prototype=r.fn,F=r(d);var I=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function K(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return K(a,"nextSibling")},prev:function(a){return K(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return B(a,"iframe")?a.contentDocument:(B(a,"template")&&(a=a.content||a),r.merge([],a.childNodes))}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(J[a]||r.uniqueSort(e),I.test(a)&&e.reverse()),this.pushStack(e)}});var L=/[^\x20\t\r\n\f]+/g;function M(a){var b={};return r.each(a.match(L)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?M(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=e||a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function N(a){return a}function O(a){throw a}function P(a,b,c,d){var e;try{a&&r.isFunction(e=a.promise)?e.call(a).done(b).fail(c):a&&r.isFunction(e=a.then)?e.call(a,b,c):b.apply(void 0,[a].slice(d))}catch(a){c.apply(void 0,[a])}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==O&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:N,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:N)),c[2][3].add(g(0,a,r.isFunction(d)?d:O))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(P(a,g.done(h(c)).resolve,g.reject,!b),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)P(e[c],h(c),g.reject);return g.promise()}});var Q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&Q.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var R=r.Deferred();r.fn.ready=function(a){return R.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||R.resolveWith(d,[r]))}}),r.ready.then=R.then;function S(){d.removeEventListener("DOMContentLoaded",S),
-a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length\x20\t\r\n\f]+)/i,la=/^$|\/(?:java|ecma)script/i,ma={option:[1,""," "],thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};ma.optgroup=ma.option,ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead,ma.th=ma.td;function na(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&B(a,b)?r.merge([a],c):c}function oa(a,b){for(var c=0,d=a.length;c-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=na(l.appendChild(f),"script"),j&&oa(g),c){k=0;while(f=g[k++])la.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var ra=d.documentElement,sa=/^key/,ta=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ua=/^([^.]*)(?:\.(.+)|)/;function va(){return!0}function wa(){return!1}function xa(){try{return d.activeElement}catch(a){}}function ya(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ya(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=wa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(ra,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(L)||[""],j=b.length;while(j--)h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.hasData(a)&&W.get(a);if(q&&(i=q.events)){b=(b||"").match(L)||[""],j=b.length;while(j--)if(h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&W.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(W.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i\x20\t\r\n\f]*)[^>]*)\/>/gi,Aa=/
-
-
-