Merge pull request #114 from ronger-x/master

🎨 update README.md
This commit is contained in:
ronger 2022-11-16 10:16:13 +08:00 committed by GitHub
commit 9874c0c1fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
164 changed files with 5017 additions and 4273 deletions

View File

@ -1,8 +1,10 @@
# forest
![forest](src/main/resources/static/logo_size.jpg) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Frymcu%2Fforest.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Frymcu%2Fforest?ref=badge_shield)
![forest](src/main/resources/static/logo_size.jpg)
下一代的知识社区系统,为未来而建
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Frymcu%2Fforest.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Frymcu%2Fforest?ref=badge_shield)
## 💡 简介
forest[ˈfôrəst]n.森林)是一款现代化的知识社区项目,使用 SpringBoot + Shiro + MyBatis + JWT + Redis 实现。
@ -96,6 +98,12 @@ forest[ˈfôrəst]n.森林)是一款现代化的知识社区项目,使
在提功能建议前可以先看一下 [计划表](https://rymcu.com/article/29) ,避免重复提议
## 鸣谢
- 感谢以下开发者对 Forest 作出的贡献:
<a href="https://github.com/rymcu/forest/graphs/contributors">
<img src="https://contrib.rocks/image?repo=rymcu/forest&max=1000" />
</a>
- 感谢 `JetBrains` 对本项目的帮助,为作者提供了开源许可版 `JetBrains` 全家桶
![JetBrains](src/main/resources/static/jb_beam.svg)

View File

@ -25,7 +25,7 @@ public class AnswerController {
@GetMapping("/today")
public GlobalResult today() {
User user = UserUtils.getCurrentUserByToken();
String result = HttpUtils.sendGet(ANSWER_API_URL + "/record/" + user.getIdUser() );
String result = HttpUtils.sendGet(ANSWER_API_URL + "/record/" + user.getIdUser());
return JSONObject.parseObject(result, GlobalResult.class);
}
@ -43,7 +43,7 @@ public class AnswerController {
@GetMapping("/get-answer")
public GlobalResult getAnswer(Integer idSubjectQuestion) {
String result = HttpUtils.sendGet(ANSWER_API_URL + "/show-answer/" + idSubjectQuestion );
String result = HttpUtils.sendGet(ANSWER_API_URL + "/show-answer/" + idSubjectQuestion);
return JSONObject.parseObject(result, GlobalResult.class);
}
}

View File

@ -6,7 +6,6 @@ package com.rymcu.forest.auth;
public class JwtConstants {
/**
* 上线需要变更
*/

View File

@ -17,6 +17,7 @@ import java.util.concurrent.TimeUnit;
/**
* 通过Redis存储和验证token的实现类
*
* @author ScienJus
* @date 2015/7/31.
*/

View File

@ -2,6 +2,7 @@ package com.rymcu.forest.auth;
/**
* 对token进行操作的接口
*
* @author ScienJus
* @date 2015/7/31.
*/
@ -9,6 +10,7 @@ public interface TokenManager {
/**
* 创建一个token关联上指定用户
*
* @param id
* @return 生成的token
*/
@ -16,6 +18,7 @@ public interface TokenManager {
/**
* 检查token是否有效
*
* @param model token
* @return 是否有效
*/
@ -23,6 +26,7 @@ public interface TokenManager {
/**
* 从字符串中解析token
*
* @param token
* @param account
* @return
@ -31,6 +35,7 @@ public interface TokenManager {
/**
* 清除token
*
* @param account 登录用户账号
*/
public void deleteToken(String account);

View File

@ -4,6 +4,7 @@ import org.apache.shiro.authc.AuthenticationToken;
/**
* Token的Model类可以增加字段提高安全性例如时间戳url签名
*
* @author ScienJus
* @date 2015/7/31.
*/

View File

@ -6,10 +6,8 @@ import com.rymcu.forest.core.exception.ServiceException;
import com.rymcu.forest.core.exception.TransactionException;
import com.rymcu.forest.core.result.GlobalResult;
import com.rymcu.forest.core.result.ResultCode;
import com.rymcu.forest.enumerate.TransactionCode;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authc.AccountException;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.UnknownAccountException;
import org.apache.shiro.authz.UnauthenticatedException;
import org.apache.shiro.authz.UnauthorizedException;

View File

@ -17,6 +17,7 @@ import static com.rymcu.forest.core.constant.ProjectConstant.*;
/**
* Mybatis & Mapper & PageHelper 配置
*
* @author ronger
*/
@Configuration

View File

@ -82,7 +82,7 @@ public class ShiroConfig {
* Shiro生命周期处理器
*/
@Bean
public LifecycleBeanPostProcessor lifecycleBeanPostProcessor(){
public LifecycleBeanPostProcessor lifecycleBeanPostProcessor() {
return new LifecycleBeanPostProcessor();
}

View File

@ -1,7 +1,9 @@
package com.rymcu.forest.config;
import com.alibaba.fastjson.serializer.SerializeConfig;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.alibaba.fastjson.support.config.FastJsonConfig;
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
import org.slf4j.Logger;
@ -40,6 +42,11 @@ public class WebMvcConfigurer extends WebMvcConfigurationSupport {
// SerializerFeature.WriteNullNumberAsZero);//Number null -> 0
//关闭循环引用
config.setSerializerFeatures(SerializerFeature.DisableCircularReferenceDetect);
// 设置 Long 类型转为 String
SerializeConfig serializeConfig = new SerializeConfig();
serializeConfig.put(Long.class, ToStringSerializer.instance);
serializeConfig.put(Long.TYPE, ToStringSerializer.instance);
config.setSerializeConfig(serializeConfig);
converter.setFastJsonConfig(config);
converter.setSupportedMediaTypes(Arrays.asList(MediaType.APPLICATION_JSON));
converter.setDefaultCharset(Charset.forName("UTF-8"));

View File

@ -14,6 +14,7 @@ import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerCo
public class WebSocketStompConfig implements WebSocketMessageBrokerConfigurer {
/**
* 注册stomp端点
*
* @param registry
*/
@Override
@ -25,6 +26,7 @@ public class WebSocketStompConfig implements WebSocketMessageBrokerConfigurer {
/**
* 配置信息代理
*
* @param registry
*/
@Override

View File

@ -2,6 +2,7 @@ package com.rymcu.forest.core.constant;
/**
* 消息通知类型
*
* @author ronger
*/
public class NotificationConstant {

View File

@ -2,25 +2,44 @@ package com.rymcu.forest.core.constant;
/**
* 项目常量
*
* @author ronger
*/
public final class ProjectConstant {
/**当前环境*/
/**
* 当前环境
*/
public static final String ENV = "dev";
/**项目基础包名称,根据自己公司的项目修改*/
/**
* 项目基础包名称根据自己公司的项目修改
*/
public static final String BASE_PACKAGE = "com.rymcu.forest";
/**DTO所在包*/
/**
* DTO所在包
*/
public static final String DTO_PACKAGE = BASE_PACKAGE + ".dto";
/**Model所在包*/
/**
* Model所在包
*/
public static final String MODEL_PACKAGE = BASE_PACKAGE + ".entity";
/**Mapper所在包*/
/**
* Mapper所在包
*/
public static final String MAPPER_PACKAGE = BASE_PACKAGE + ".mapper";
/**Service所在包*/
/**
* Service所在包
*/
public static final String SERVICE_PACKAGE = BASE_PACKAGE + ".service";
/**ServiceImpl所在包*/
/**
* ServiceImpl所在包
*/
public static final String SERVICE_IMPL_PACKAGE = SERVICE_PACKAGE + ".impl";
/**Controller所在包*/
/**
* Controller所在包
*/
public static final String CONTROLLER_PACKAGE = BASE_PACKAGE + ".web";
/**Mapper插件基础接口的完全限定名*/
/**
* Mapper插件基础接口的完全限定名
*/
public static final String MAPPER_INTERFACE_REFERENCE = BASE_PACKAGE + ".core.mapper.Mapper";
}

View File

@ -7,12 +7,10 @@ import org.apache.shiro.authc.AuthenticationException;
*
* @author ronger
*/
public class CaptchaException extends AuthenticationException
{
public class CaptchaException extends AuthenticationException {
private static final long serialVersionUID = 1L;
public CaptchaException()
{
public CaptchaException() {
super("验证码不正确");
}
}

View File

@ -5,6 +5,7 @@ import com.rymcu.forest.core.result.ResultCode;
/**
* 服务业务异常如 账号或密码错误 该异常只做INFO级别的日志记录 @see WebMvcConfigurer
*
* @author ronger
*/
public class ServiceException extends RuntimeException {
@ -13,27 +14,27 @@ public class ServiceException extends RuntimeException {
public ServiceException(ResultCode resultCode) {
super(resultCode.getMessage());
this.code=resultCode.getCode();
this.code = resultCode.getCode();
}
public ServiceException(String message, Throwable cause) {
}
public ServiceException(int code, String message, String extraMessage, Throwable cause){
super(message,cause);
this.code=code;
this.extraMessage=extraMessage;
public ServiceException(int code, String message, String extraMessage, Throwable cause) {
super(message, cause);
this.code = code;
this.extraMessage = extraMessage;
}
public ServiceException(ResultCode resultCode, String extraMessage){
this(resultCode.getCode(),resultCode.getMessage(),extraMessage,null);
public ServiceException(ResultCode resultCode, String extraMessage) {
this(resultCode.getCode(), resultCode.getMessage(), extraMessage, null);
}
public ServiceException(String extraMessage){
this(ResultCode.INVALID_PARAM,extraMessage);
public ServiceException(String extraMessage) {
this(ResultCode.INVALID_PARAM, extraMessage);
}

View File

@ -6,6 +6,7 @@ public interface TreeMapper<T> extends Mapper<T> {
/**
* 找到所有子节点
*
* @param entity
* @return
*/
@ -13,6 +14,7 @@ public interface TreeMapper<T> extends Mapper<T> {
/**
* 更新所有父节点字段
*
* @param entity
* @return
*/

View File

@ -9,6 +9,7 @@ public class GlobalResultGenerator {
/**
* normal
*
* @param success
* @param data
* @param message
@ -28,6 +29,7 @@ public class GlobalResultGenerator {
/**
* success
*
* @param data
* @param <T>
* @return
@ -39,6 +41,7 @@ public class GlobalResultGenerator {
/**
* error message
*
* @param message error message
* @param <T>
* @return
@ -50,6 +53,7 @@ public class GlobalResultGenerator {
/**
* error
*
* @param error error enum
* @param <T>
* @return
@ -61,6 +65,7 @@ public class GlobalResultGenerator {
/**
* success no message
*
* @return
*/
public static GlobalResult genSuccessResult() {
@ -69,6 +74,7 @@ public class GlobalResultGenerator {
/**
* success
*
* @param <T>
* @return
*/

View File

@ -12,7 +12,7 @@ public enum GlobalResultMessage {
private String message;
GlobalResultMessage(String message){
GlobalResultMessage(String message) {
this.message = message;
}
}

View File

@ -20,7 +20,6 @@ import java.util.Objects;
/**
* @author ronger
*
*/
@Aspect
@Component
@ -32,7 +31,9 @@ public class TransactionAspect {
private TransactionRecordService transactionRecordService;
@Pointcut("@annotation(com.rymcu.forest.core.service.log.annotation.TransactionLogger)")
public void pointCut() {}
public void pointCut() {
}
/**
* 保存交易操作日志
*
@ -40,7 +41,7 @@ public class TransactionAspect {
* @return 方法执行结果
* @throws Throwable 调用出错
*/
@AfterReturning(value = "pointCut()", returning="obj")
@AfterReturning(value = "pointCut()", returning = "obj")
public void save(JoinPoint joinPoint, Object obj) throws Exception {
logger.info("保存交易记录 start ...");
/**

View File

@ -5,6 +5,7 @@ import java.lang.annotation.RetentionPolicy;
/**
* 浏览记录器
*
* @author ronger
*/
@Retention(RetentionPolicy.RUNTIME)

View File

@ -61,6 +61,7 @@ public class RedisResult<T> extends BaseDO {
public void setKeyExists(boolean keyExists) {
this.keyExists = keyExists;
}
public boolean isKeyExists() {
return keyExists;
}

View File

@ -7,6 +7,7 @@ import java.util.Set;
/**
* Redis 服务接口
*
* @author Jimersy Lee
* 2017-09-18 14:58:21
*/

View File

@ -547,29 +547,32 @@ public class RedisServiceImpl implements RedisService {
public String put(String cacheName, String key, Object value) {
String result = get(cacheName);
Map map = new HashMap();
if (StringUtils.isNotBlank(result)){
map = JSON.parseObject(result, new TypeReference<Map>() {});
if (StringUtils.isNotBlank(result)) {
map = JSON.parseObject(result, new TypeReference<Map>() {
});
}
map.put(key,value);
return set(cacheName,map);
map.put(key, value);
return set(cacheName, map);
}
@Override
public String put(String cacheName, String key, Object value, int expireTime) {
String result = get(cacheName);
Map map = new HashMap();
if (StringUtils.isNotBlank(result)){
map = JSON.parseObject(result, new TypeReference<Map>() {});
if (StringUtils.isNotBlank(result)) {
map = JSON.parseObject(result, new TypeReference<Map>() {
});
}
map.put(key,value);
return set(cacheName,map,expireTime);
map.put(key, value);
return set(cacheName, map, expireTime);
}
@Override
public Object get(String cacheName, String key){
public Object get(String cacheName, String key) {
String result = get(cacheName);
if (StringUtils.isNotBlank(result)){
Map map = JSON.parseObject(result, new TypeReference<Map>() {});
if (StringUtils.isNotBlank(result)) {
Map map = JSON.parseObject(result, new TypeReference<Map>() {
});
return map.get(key);
}
return null;

View File

@ -5,6 +5,7 @@ import java.lang.annotation.RetentionPolicy;
/**
* 安全拦截器
*
* @author ronger
*/
@Retention(RetentionPolicy.RUNTIME)

View File

@ -1,7 +1,6 @@
package com.rymcu.forest.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -18,42 +17,74 @@ import java.util.List;
@NoArgsConstructor
@AllArgsConstructor
public class ArticleDTO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idArticle;
/** 文章标题 */
/**
* 文章标题
*/
private String articleTitle;
/** 文章缩略图 */
/**
* 文章缩略图
*/
private String articleThumbnailUrl;
/** 文章作者id */
@JsonFormat(shape = JsonFormat.Shape.STRING)
/**
* 文章作者id
*/
private Long articleAuthorId;
/** 文章作者 */
/**
* 文章作者
*/
private String articleAuthorName;
/** 文章作者头像 */
/**
* 文章作者头像
*/
private String articleAuthorAvatarUrl;
/** 文章类型 */
/**
* 文章类型
*/
private String articleType;
/** 文章标签 */
/**
* 文章标签
*/
private String articleTags;
/** 浏览总数 */
/**
* 浏览总数
*/
private Integer articleViewCount;
/** 预览内容 */
/**
* 预览内容
*/
private String articlePreviewContent;
/** 文章内容 */
/**
* 文章内容
*/
private String articleContent;
/** 文章内容html */
/**
* 文章内容html
*/
private String articleContentHtml;
/** 评论总数 */
/**
* 评论总数
*/
private Integer articleCommentCount;
/** 过去时长 */
/**
* 过去时长
*/
private String timeAgo;
/** 文章永久链接 */
/**
* 文章永久链接
*/
private String articlePermalink;
/** 站内链接 */
/**
* 站内链接
*/
private String articleLink;
/** 文章状态 */
/**
* 文章状态
*/
private String articleStatus;
/** 更新时间 */
/**
* 更新时间
*/
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date updatedTime;
@ -64,11 +95,17 @@ public class ArticleDTO {
private List<PortfolioArticleDTO> portfolios;
private Integer sortNo;
/** 0:非优选1优选;0 */
/**
* 0:非优选1优选;0
*/
private String articlePerfect;
/** 点赞总数 */
/**
* 点赞总数
*/
private Integer articleThumbsUpCount;
/** 赞赏总数 */
/**
* 赞赏总数
*/
private Integer articleSponsorCount;
private Boolean canSponsor;

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -14,12 +14,10 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
@AllArgsConstructor
public class ArticleTagDTO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idArticleTag;
private Integer idTag;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idArticle;
private String tagTitle;
@ -30,6 +28,5 @@ public class ArticleTagDTO {
private String tagIconPath;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long tagAuthorId;
}

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -15,7 +15,6 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
public class Author {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
private String userNickname;

View File

@ -14,19 +14,33 @@ import java.util.List;
public class BankAccountDTO {
private Integer idBankAccount;
/** 所属银行 */
/**
* 所属银行
*/
private Integer idBank;
/** 所属银行名称 */
/**
* 所属银行名称
*/
private String bankName;
/** 银行账户 */
/**
* 银行账户
*/
private String bankAccount;
/** 账户余额 */
/**
* 账户余额
*/
private BigDecimal accountBalance;
/** 账户所有者 */
/**
* 账户所有者
*/
private Integer accountOwner;
/** 账户所有者姓名 */
/**
* 账户所有者姓名
*/
private String accountOwnerName;
/** 创建时间 */
/**
* 创建时间
*/
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;

View File

@ -7,11 +7,17 @@ import lombok.Data;
*/
@Data
public class BankAccountSearchDTO {
/** 所属银行名称 */
/**
* 所属银行名称
*/
private String bankName;
/** 银行账户 */
/**
* 银行账户
*/
private String bankAccount;
/** 账户所有者姓名 */
/**
* 账户所有者姓名
*/
private String accountOwnerName;
}

View File

@ -13,21 +13,37 @@ import java.util.Date;
public class BankDTO {
private Integer idBank;
/** 银行名称 */
/**
* 银行名称
*/
private String bankName;
/** 银行负责人 */
/**
* 银行负责人
*/
private Integer bankOwner;
/** 银行负责人 */
/**
* 银行负责人
*/
private String bankOwnerName;
/** 银行账户 */
/**
* 银行账户
*/
private String bankAccount;
/** 账户余额 */
/**
* 账户余额
*/
private BigDecimal accountBalance;
/** 银行描述 */
/**
* 银行描述
*/
private String bankDescription;
/** 创建人 */
/**
* 创建人
*/
private Integer createdBy;
/** 创建时间 */
/**
* 创建时间
*/
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;
}

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/**
@ -9,7 +9,6 @@ import lombok.Data;
@Data
public class ChangeEmailDTO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
private String email;

View File

@ -11,31 +11,57 @@ import java.util.Date;
@Data
public class CommentDTO {
private Integer idComment;
/** 评论内容 */
/**
* 评论内容
*/
private String commentContent;
/** 作者 id */
/**
* 作者 id
*/
private Integer commentAuthorId;
/** 文章 id */
/**
* 文章 id
*/
private Integer commentArticleId;
/** 锚点 url */
/**
* 锚点 url
*/
private String commentSharpUrl;
/** 父评论 id */
/**
* 父评论 id
*/
private Integer commentOriginalCommentId;
/** 父评论作者头像 */
/**
* 父评论作者头像
*/
private String commentOriginalAuthorThumbnailURL;
/** 父评论作者昵称 */
/**
* 父评论作者昵称
*/
private String commentOriginalAuthorNickname;
/** 父评论作者昵称 */
/**
* 父评论作者昵称
*/
private String commentOriginalContent;
/** 状态 */
/**
* 状态
*/
private String commentStatus;
/** 0公开回帖1匿名回帖 */
/**
* 0公开回帖1匿名回帖
*/
private String commentAnonymous;
/** 回帖计数 */
/**
* 回帖计数
*/
private Integer commentReplyCount;
/** 0所有人可见1仅楼主和自己可见 */
/**
* 0所有人可见1仅楼主和自己可见
*/
private String commentVisible;
/** 创建时间 */
/**
* 创建时间
*/
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.rymcu.forest.entity.Notification;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -12,7 +12,6 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = false)
public class NotificationDTO extends Notification {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idNotification;
private String dataTitle;

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.List;
@ -11,13 +11,10 @@ import java.util.List;
@Data
public class PortfolioArticleDTO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idPortfolio;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idArticle;
private String headImgUrl;

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
@ -11,24 +11,38 @@ import java.util.Date;
@Data
public class PortfolioDTO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idPortfolio;
/** 作品集头像 */
/**
* 作品集头像
*/
private String headImgUrl;
/** 作品集作者 */
@JsonFormat(shape = JsonFormat.Shape.STRING)
/**
* 作品集作者
*/
private Long portfolioAuthorId;
/** 作品集作者 */
/**
* 作品集作者
*/
private String portfolioAuthorName;
/** 作品集作者头像 */
/**
* 作品集作者头像
*/
private String portfolioAuthorAvatarUrl;
/** 作品集名称 */
/**
* 作品集名称
*/
private String portfolioTitle;
/** 作品集介绍 */
/**
* 作品集介绍
*/
private String portfolioDescription;
/** 更新时间 */
/**
* 更新时间
*/
private Date updatedTime;
/** 过去时长 */
/**
* 过去时长
*/
private String timeAgo;
private Author portfolioAuthor;

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Set;
@ -11,7 +11,6 @@ import java.util.Set;
@Data
public class TokenUser {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
private String account;

View File

@ -13,23 +13,41 @@ import java.util.Date;
public class TransactionRecordDTO {
private Integer idTransactionRecord;
/** 交易流水号 */
/**
* 交易流水号
*/
private String transactionNo;
/** 款项 */
/**
* 款项
*/
private String funds;
/** 交易发起方 */
/**
* 交易发起方
*/
private String formBankAccount;
/** 交易发起方 */
/**
* 交易发起方
*/
private BankAccountDTO formBankAccountInfo;
/** 交易收款方 */
/**
* 交易收款方
*/
private String toBankAccount;
/** 交易收款方 */
/**
* 交易收款方
*/
private BankAccountDTO toBankAccountInfo;
/** 交易金额 */
/**
* 交易金额
*/
private BigDecimal money;
/** 交易类型 */
/**
* 交易类型
*/
private String transactionType;
/** 交易时间 */
/**
* 交易时间
*/
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date transactionTime;

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/**
@ -9,7 +9,6 @@ import lombok.Data;
@Data
public class UpdatePasswordDTO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
private String password;

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/**
@ -9,7 +9,6 @@ import lombok.Data;
@Data
public class UserDTO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
private String account;

View File

@ -1,7 +1,6 @@
package com.rymcu.forest.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
@ -13,7 +12,6 @@ import java.util.Date;
@Data
public class UserInfoDTO implements Serializable {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
private String account;

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.dto.admin;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/**
@ -9,9 +9,7 @@ import lombok.Data;
@Data
public class TopicTagDTO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idTopic;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idTag;
}

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.dto.admin;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/**
@ -9,9 +9,7 @@ import lombok.Data;
@Data
public class UserRoleDTO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idRole;
}

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -15,44 +15,76 @@ import java.util.Date;
*/
@Data
@Table(name = "forest_article")
public class Article implements Serializable,Cloneable {
/** 主键 */
public class Article implements Serializable, Cloneable {
/**
* 主键
*/
@Id
@GeneratedValue(generator = "JDBC")
@Column(name = "id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idArticle;
/** 文章标题 */
/**
* 文章标题
*/
private String articleTitle;
/** 文章缩略图 */
/**
* 文章缩略图
*/
private String articleThumbnailUrl;
/** 文章作者id */
@JsonFormat(shape = JsonFormat.Shape.STRING)
/**
* 文章作者id
*/
private Long articleAuthorId;
/** 文章类型 */
/**
* 文章类型
*/
private String articleType;
/** 文章标签 */
/**
* 文章标签
*/
private String articleTags;
/** 浏览总数 */
/**
* 浏览总数
*/
private Integer articleViewCount;
/** 预览内容 */
/**
* 预览内容
*/
private String articlePreviewContent;
/** 评论总数 */
/**
* 评论总数
*/
private Integer articleCommentCount;
/** 0:非优选1优选; */
/**
* 0:非优选1优选;
*/
private String articlePerfect;
/** 文章永久链接 */
/**
* 文章永久链接
*/
private String articlePermalink;
/** 站内链接 */
/**
* 站内链接
*/
private String articleLink;
/** 创建时间 */
/**
* 创建时间
*/
private Date createdTime;
/** 更新时间 */
/**
* 更新时间
*/
private Date updatedTime;
/** 文章状态 */
/**
* 文章状态
*/
private String articleStatus;
/** 点赞总数 */
/**
* 点赞总数
*/
private Integer articleThumbsUpCount;
/** 赞赏总数 */
/**
* 赞赏总数
*/
private Integer articleSponsorCount;
}

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -19,7 +19,6 @@ public class ArticleContent {
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idArticle;
private String articleContent;

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -14,7 +14,7 @@ import java.util.Date;
* @author ronger
*/
@Data
@Table(name="forest_article_thumbs_up")
@Table(name = "forest_article_thumbs_up")
public class ArticleThumbsUp implements Serializable, Cloneable {
/**
* 主键
@ -22,17 +22,14 @@ public class ArticleThumbsUp implements Serializable, Cloneable {
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idArticleThumbsUp;
/**
* 文章表主键
*/
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idArticle;
/**
* 用户表主键
*/
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
/**
* 点赞时间

View File

@ -1,7 +1,6 @@
package com.rymcu.forest.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -12,28 +11,39 @@ import java.util.Date;
/**
* 银行
*
* @author ronger
*/
@Table(name = "forest_bank")
@Data
public class Bank {
/** 主键 */
/**
* 主键
*/
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idBank;
/** 银行名称 */
/**
* 银行名称
*/
private String bankName;
/** 银行负责人 */
/**
* 银行负责人
*/
private Long bankOwner;
/** 银行描述 */
/**
* 银行描述
*/
private String bankDescription;
/** 创建人 */
@JsonFormat(shape = JsonFormat.Shape.STRING)
/**
* 创建人
*/
private Long createdBy;
/** 创建时间 */
/**
* 创建时间
*/
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;

View File

@ -1,7 +1,6 @@
package com.rymcu.forest.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -13,30 +12,42 @@ import java.util.Date;
/**
* 银行账户
*
* @author ronger
*/
@Table(name = "forest_bank_account")
@Data
public class BankAccount {
/** 主键 */
/**
* 主键
*/
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idBankAccount;
/** 所属银行 */
@JsonFormat(shape = JsonFormat.Shape.STRING)
/**
* 所属银行
*/
private Long idBank;
/** 银行账户 */
/**
* 银行账户
*/
private String bankAccount;
/** 账户余额 */
/**
* 账户余额
*/
private BigDecimal accountBalance;
/** 账户所有者 */
@JsonFormat(shape = JsonFormat.Shape.STRING)
/**
* 账户所有者
*/
private Long accountOwner;
/** 创建时间 */
/**
* 创建时间
*/
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;
/** 账户类型 */
/**
* 账户类型
*/
private String accountType;
}

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -14,51 +14,73 @@ import java.util.Date;
* @author ronger
*/
@Data
@Table(name="forest_comment")
public class Comment implements Serializable,Cloneable {
/** 主键 */
@Table(name = "forest_comment")
public class Comment implements Serializable, Cloneable {
/**
* 主键
*/
@Id
@GeneratedValue(generator = "JDBC")
@Column(name = "id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idComment;
/** 评论内容 */
/**
* 评论内容
*/
@Column(name = "comment_content")
private String commentContent;
/** 作者 id */
/**
* 作者 id
*/
@Column(name = "comment_author_id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long commentAuthorId;
/** 文章 id */
/**
* 文章 id
*/
@Column(name = "comment_article_id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long commentArticleId;
/** 锚点 url */
/**
* 锚点 url
*/
@Column(name = "comment_sharp_url")
private String commentSharpUrl;
/** 父评论 id */
/**
* 父评论 id
*/
@Column(name = "comment_original_comment_id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long commentOriginalCommentId;
/** 状态 */
/**
* 状态
*/
@Column(name = "comment_status")
private String commentStatus;
/** 评论 IP */
/**
* 评论 IP
*/
@Column(name = "comment_ip")
private String commentIP;
/** User-Agent */
/**
* User-Agent
*/
@Column(name = "comment_ua")
private String commentUA;
/** 0公开回帖1匿名回帖 */
/**
* 0公开回帖1匿名回帖
*/
@Column(name = "comment_anonymous")
private String commentAnonymous;
/** 回帖计数 */
/**
* 回帖计数
*/
@Column(name = "comment_reply_count")
private Integer commentReplyCount;
/** 0所有人可见1仅楼主和自己可见 */
/**
* 0所有人可见1仅楼主和自己可见
*/
@Column(name = "comment_visible")
private String commentVisible;
/** 创建时间 */
/**
* 创建时间
*/
@Column(name = "created_time")
private Date createdTime;
}

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.GeneratedValue;
@ -11,22 +11,29 @@ import java.util.Date;
/**
* 货币发行记录
*
* @author ronger
*/
@Table(name = "forest_currency_issue")
@Data
public class CurrencyIssue {
/** 主键 */
/**
* 主键
*/
@Id
@GeneratedValue(generator = "JDBC")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;
/** 发行数额 */
/**
* 发行数额
*/
private BigDecimal issueValue;
/** 发行人 */
@JsonFormat(shape = JsonFormat.Shape.STRING)
/**
* 发行人
*/
private Long createdBy;
/** 发行时间 */
/**
* 发行时间
*/
private Date createdTime;
}

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -13,7 +13,7 @@ import java.math.BigDecimal;
/**
* @author ronger
*/
@Table(name="forest_currency_rule")
@Table(name = "forest_currency_rule")
@Data
public class CurrencyRule implements Serializable, Cloneable {
/**
@ -22,7 +22,6 @@ public class CurrencyRule implements Serializable, Cloneable {
@Id
@GeneratedValue(generator = "JDBC")
@Column(name = "id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idCurrencyRule;
/**
* 规则名称

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -13,23 +13,28 @@ import java.io.Serializable;
* @author ronger
*/
@Data
@Table(name="forest_follow")
public class Follow implements Serializable,Cloneable {
/** 主键 */
@Table(name = "forest_follow")
public class Follow implements Serializable, Cloneable {
/**
* 主键
*/
@Id
@GeneratedValue(generator = "JDBC")
@Column(name = "id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idFollow;
/** 关注者 id */
/**
* 关注者 id
*/
@Column(name = "follower_id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long followerId;
/** 关注数据 id */
/**
* 关注数据 id
*/
@Column(name = "following_id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long followingId;
/** 0用户1标签2帖子收藏3帖子关注 */
/**
* 0用户1标签2帖子收藏3帖子关注
*/
@Column(name = "following_type")
private String followingType;
}

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -22,14 +22,12 @@ public class ForestFile {
@Id
@GeneratedValue(generator = "JDBC")
@Column(name = "id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;
/**
* 文件大小
*/
@Column(name = "file_size")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long fileSize;
/**
@ -71,7 +69,6 @@ public class ForestFile {
* 创建人
*/
@Column(name = "created_by")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long createdBy;

View File

@ -1,7 +1,6 @@
package com.rymcu.forest.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -13,41 +12,58 @@ import java.util.Date;
/**
* 登录记录表
*
* @author ronger
*/
@Data
@Table(name="forest_login_record")
public class LoginRecord implements Serializable,Cloneable {
@Table(name = "forest_login_record")
public class LoginRecord implements Serializable, Cloneable {
/** 主键 */
/**
* 主键
*/
@Id
@GeneratedValue(generator = "JDBC")
@Column(name = "id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;
/** IP */
/**
* IP
*/
@Column(name = "login_ip")
private String loginIp;
/** User-Agent */
/**
* User-Agent
*/
@Column(name = "login_ua")
private String loginUa;
/** 城市 */
/**
* 城市
*/
@Column(name = "login_city")
private String loginCity;
/** 设备唯一标识 */
/**
* 设备唯一标识
*/
@Column(name = "login_device_id")
private String loginDeviceId;
/** 设备操作系统 */
/**
* 设备操作系统
*/
@Column(name = "login_os")
private String loginOS;
/** 设备浏览器 */
/**
* 设备浏览器
*/
@Column(name = "login_browser")
private String loginBrowser;
/** 用户 id */
/**
* 用户 id
*/
@Column(name = "id_user")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
/** 创建时间 */
/**
* 创建时间
*/
@Column(name = "created_time")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;

View File

@ -1,7 +1,6 @@
package com.rymcu.forest.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -16,21 +15,19 @@ import java.util.Date;
* @author ronger
*/
@Data
@Table(name="forest_notification")
public class Notification implements Serializable,Cloneable {
@Table(name = "forest_notification")
public class Notification implements Serializable, Cloneable {
/**
* 主键
*/
@Id
@GeneratedValue(generator = "JDBC")
@Column(name = "id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idNotification;
/**
* 用户id
*/
@Column(name = "id_user")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
/**
* 数据类型
@ -41,7 +38,6 @@ public class Notification implements Serializable,Cloneable {
* 数据id
*/
@Column(name = "data_id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long dataId;
/**
* 数据摘要

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import tk.mybatis.mapper.annotation.ColumnType;
@ -15,17 +15,16 @@ import java.io.Serializable;
*/
@Data
@Table(name = "forest_permission")
public class Permission implements Serializable,Cloneable {
public class Permission implements Serializable, Cloneable {
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idPermission;
/**
* 权限标识
* */
*/
@ColumnType(column = "permission_category")
private String permissionCategory;
}

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.*;
@ -12,27 +12,41 @@ import java.util.Date;
@Data
@Table(name = "forest_portfolio")
public class Portfolio {
/** 主键 */
/**
* 主键
*/
@Id
@GeneratedValue(generator = "JDBC")
@Column(name = "id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idPortfolio;
/** 作品集头像 */
/**
* 作品集头像
*/
@Column(name = "portfolio_head_img_url")
private String headImgUrl;
/** 作品集名称 */
/**
* 作品集名称
*/
private String portfolioTitle;
/** 作品集作者 */
@JsonFormat(shape = JsonFormat.Shape.STRING)
/**
* 作品集作者
*/
private Long portfolioAuthorId;
/** 作品集介绍 */
/**
* 作品集介绍
*/
private String portfolioDescription;
/** 作品集介绍 Html */
/**
* 作品集介绍 Html
*/
private String portfolioDescriptionHtml;
/** 创建时间 */
/**
* 创建时间
*/
private Date createdTime;
/** 更新时间 */
/**
* 更新时间
*/
private Date updatedTime;
@Transient
private String headImgType;

View File

@ -1,7 +1,6 @@
package com.rymcu.forest.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -27,7 +26,6 @@ public class Product implements Serializable, Cloneable {
@Id
@GeneratedValue(generator = "JDBC")
@Column(name = "id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idProduct;
/**
* 产品名

View File

@ -1,7 +1,6 @@
package com.rymcu.forest.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Table;
@ -21,7 +20,6 @@ public class ProductContent implements Serializable, Cloneable {
/**
* 产品表主键
*/
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idProduct;
/**
* 产品详情原文

View File

@ -1,7 +1,6 @@
package com.rymcu.forest.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -16,47 +15,46 @@ import java.util.Date;
*/
@Data
@Table(name = "forest_role")
public class Role implements Serializable,Cloneable {
public class Role implements Serializable, Cloneable {
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idRole;
/**
* 角色名称
* */
*/
@Column(name = "name")
private String name;
/**
* 拼音码
* */
*/
@Column(name = "input_code")
private String inputCode;
/**
* 权重
* */
*/
@Column(name = "weights")
private Integer weights;
/**
* 状态
* */
*/
@Column(name = "status")
private String status;
/**
* 创建时间
* */
*/
@Column(name = "created_time")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;
/**
* 更新时间
* */
*/
@Column(name = "updated_time")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date updatedTime;

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -14,33 +14,54 @@ import java.util.Date;
* @author ronger
*/
@Data
@Table(name="forest_special_day")
public class SpecialDay implements Serializable,Cloneable{
/** */
@Table(name = "forest_special_day")
public class SpecialDay implements Serializable, Cloneable {
/**
*
*/
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idSpecialDay;
/** 名称 */
/**
* 名称
*/
private String specialDayName;
/** 权重/优先级,小数优秀 */
/**
* 权重/优先级,小数优秀
*/
private Integer weights;
/** 开始时间 */
/**
* 开始时间
*/
private Date startTime;
/** 过期时间 */
/**
* 过期时间
*/
private Date expirationTime;
/** 是否重复 */
/**
* 是否重复
*/
private Integer repeat;
/** 重复周期 */
/**
* 重复周期
*/
private Integer repeatCycle;
/** 0:天1:周2:月3:年 */
/**
* 0:天1:周2:月3:
*/
private Integer repeatCycleUnit;
/** 创建时间 */
/**
* 创建时间
*/
private Date createdTime;
/** 图片路径 */
/**
* 图片路径
*/
private String imgUrl;
/** 执行全局样式 */
/**
* 执行全局样式
*/
private String cssStyle;
}

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.GeneratedValue;
@ -14,14 +14,13 @@ import java.util.Date;
* @author ronger
*/
@Data
@Table(name="forest_sponsor")
@Table(name = "forest_sponsor")
public class Sponsor implements Serializable, Cloneable {
/**
* 主键
*/
@Id
@GeneratedValue(generator = "JDBC")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;
/**
* 数据类型
@ -30,12 +29,10 @@ public class Sponsor implements Serializable, Cloneable {
/**
* 数据主键
*/
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long dataId;
/**
* 赞赏人
*/
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long sponsor;
/**
* 赞赏日期

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -15,37 +15,64 @@ import java.util.Date;
*/
@Data
@Table(name = "forest_tag")
public class Tag implements Serializable,Cloneable {
/** 主键 */
public class Tag implements Serializable, Cloneable {
/**
* 主键
*/
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idTag;
/** 标签名 */
/**
* 标签名
*/
private String tagTitle;
/** 标签图标 */
/**
* 标签图标
*/
private String tagIconPath;
/** 标签uri */
/**
* 标签uri
*/
private String tagUri;
/** 描述 */
/**
* 描述
*/
private String tagDescription;
/** 浏览量 */
/**
* 浏览量
*/
private Integer tagViewCount;
/** 关联文章总数 */
/**
* 关联文章总数
*/
private Integer tagArticleCount;
/** 标签广告 */
/**
* 标签广告
*/
private String tagAd;
/** 是否显示全站侧边栏广告 */
/**
* 是否显示全站侧边栏广告
*/
private String tagShowSideAd;
/** 标签状态 */
/**
* 标签状态
*/
private String tagStatus;
/** 创建时间 */
/**
* 创建时间
*/
private Date createdTime;
/** 更新时间 */
/**
* 更新时间
*/
private Date updatedTime;
/** 保留标签 */
/**
* 保留标签
*/
private String tagReservation;
/** 描述 */
/**
* 描述
*/
private String tagDescriptionHtml;
}

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -16,35 +16,60 @@ import java.util.Date;
@Table(name = "forest_topic")
public class Topic {
/** 主键 */
/**
* 主键
*/
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idTopic;
/** 专题标题 */
/**
* 专题标题
*/
private String topicTitle;
/** 专题路径 */
/**
* 专题路径
*/
private String topicUri;
/** 专题描述 */
/**
* 专题描述
*/
private String topicDescription;
/** 专题类型 */
/**
* 专题类型
*/
private String topicType;
/** 专题序号;10 */
/**
* 专题序号;10
*/
private Integer topicSort;
/** 专题图片路径 */
/**
* 专题图片路径
*/
private String topicIconPath;
/** 0作为导航1不作为导航;0 */
/**
* 0作为导航1不作为导航;0
*/
private String topicNva;
/** 专题下标签总数;0 */
/**
* 专题下标签总数;0
*/
private Integer topicTagCount;
/** 0正常1禁用;0 */
/**
* 0正常1禁用;0
*/
private String topicStatus;
/** 创建时间 */
/**
* 创建时间
*/
private Date createdTime;
/** 更新时间 */
/**
* 更新时间
*/
private Date updatedTime;
/** 专题描述 Html */
/**
* 专题描述 Html
*/
private String topicDescriptionHtml;
}

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -12,29 +12,45 @@ import java.util.Date;
/**
* 交易记录
*
* @author ronger
*/
@Table(name = "forest_transaction_record")
@Data
public class TransactionRecord {
/** 主键 */
/**
* 主键
*/
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idTransactionRecord;
/** 交易流水号 */
/**
* 交易流水号
*/
private String transactionNo;
/** 款项 */
/**
* 款项
*/
private String funds;
/** 交易发起方 */
/**
* 交易发起方
*/
private String formBankAccount;
/** 交易收款方 */
/**
* 交易收款方
*/
private String toBankAccount;
/** 交易金额 */
/**
* 交易金额
*/
private BigDecimal money;
/** 交易类型 */
/**
* 交易类型
*/
private String transactionType;
/** 交易时间 */
/**
* 交易时间
*/
private Date transactionTime;
}

View File

@ -1,7 +1,6 @@
package com.rymcu.forest.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.ibatis.type.JdbcType;
import tk.mybatis.mapper.annotation.ColumnType;
@ -18,114 +17,113 @@ import java.util.Date;
*/
@Table(name = "forest_user")
@Data
public class User implements Serializable,Cloneable {
public class User implements Serializable, Cloneable {
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
/**
* 登录账号
* */
*/
@Column(name = "account")
private String account;
/**
* 密码
* */
*/
@Column(name = "password")
@JSONField(serialize=false)
@JSONField(serialize = false)
private String password;
/**
* 昵称
* */
*/
@Column(name = "nickname")
private String nickname;
/**
* 真实姓名
* */
*/
@Column(name = "real_name")
private String realName;
/**
* 性别 1:男性 2:女性
* */
*/
@Column(name = "sex")
private String sex;
/**
* 头像文件类型
* */
*/
@Column(name = "avatar_type")
private String avatarType;
/**
* 头像路径
* */
*/
@Column(name = "avatar_url")
private String avatarUrl;
/**
* 邮箱地址
* */
*/
@ColumnType(column = "email",
jdbcType = JdbcType.VARCHAR)
private String email;
/**
* 手机号码
* */
*/
@ColumnType(column = "phone",
jdbcType = JdbcType.VARCHAR)
private String phone;
/**
* 签名
* */
*/
@ColumnType(column = "signature",
jdbcType = JdbcType.VARCHAR)
private String signature;
/**
* 状态
* */
*/
@Column(name = "status")
private String status;
/**
* 最后登录时间
* */
*/
@Column(name = "last_login_time")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date lastLoginTime;
/**
* 创建时间
* */
*/
@Column(name = "created_time")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;
/**
* 更新时间
* */
*/
@Column(name = "updated_time")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date updatedTime;
/**
* 最后在线时间
* */
*/
@Column(name = "last_online_time")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date lastOnlineTime;
/**
* 个人中心背景图片
* */
*/
@Column(name = "bg_img_url")
private String bgImgUrl;
}

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Id;
@ -14,7 +14,6 @@ import javax.persistence.Table;
public class UserExtend {
@Id
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
private String github;

View File

@ -1,7 +1,6 @@
package com.rymcu.forest.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -13,45 +12,64 @@ import java.util.Date;
/**
* 浏览表
*
* @author ronger
*/
@Data
@Table(name="forest_visit")
public class Visit implements Serializable,Cloneable {
@Table(name = "forest_visit")
public class Visit implements Serializable, Cloneable {
/** 主键 */
/**
* 主键
*/
@Id
@GeneratedValue(generator = "JDBC")
@Column(name = "id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;
/** 浏览链接 */
/**
* 浏览链接
*/
@Column(name = "visit_url")
private String visitUrl;
/** IP */
/**
* IP
*/
@Column(name = "visit_ip")
private String visitIp;
/** User-Agent */
/**
* User-Agent
*/
@Column(name = "visit_ua")
private String visitUa;
/** 城市 */
/**
* 城市
*/
@Column(name = "visit_city")
private String visitCity;
/** 设备唯一标识 */
/**
* 设备唯一标识
*/
@Column(name = "visit_device_id")
private String visitDeviceId;
/** 浏览者 id */
/**
* 浏览者 id
*/
@Column(name = "visit_user_id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long visitUserId;
/** 上游链接 */
/**
* 上游链接
*/
@Column(name = "visit_referer_url")
private String visitRefererUrl;
/** 创建时间 */
/**
* 创建时间
*/
@Column(name = "created_time")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;
/** 过期时间 */
/**
* 过期时间
*/
@Column(name = "expired_time")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date expiredTime;

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -18,7 +18,6 @@ public class WxUser {
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idWxUser;
private Boolean subscribe;

View File

@ -24,7 +24,8 @@ import java.util.Map;
@RequestMapping("/api/v1/lucene/dic")
public class UserDicController {
@Resource private UserDicService dicService;
@Resource
private UserDicService dicService;
@GetMapping("/getAll")
public GlobalResult getAll(

View File

@ -1,26 +1,25 @@
/**
* IK 中文分词 版本 5.0
* IK Analyzer release 5.0
*
* <p>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* <p>
* 源代码由林良益(linliangyi2005@gmail.com)提供
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
*/
package com.rymcu.forest.lucene.cfg;

View File

@ -24,22 +24,36 @@ import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
/** Configuration 默认实现 2012-5-8 */
/**
* Configuration 默认实现 2012-5-8
*/
@Component
public class DefaultConfig implements Configuration {
/** 分词器默认字典路径 */
/**
* 分词器默认字典路径
*/
private static final String PATH_DIC_MAIN = "lucene/main2012.dic";
/** 题词字典路径 */
/**
* 题词字典路径
*/
private static final String PATH_DIC_QUANTIFIER = "lucene/quantifier.dic";
/** 用户自定义字典路径 */
/**
* 用户自定义字典路径
*/
private static final String PATH_USER_DIC =
System.getProperty("user.dir") + "/lucene/userDic/userDic.dic";
/** 配置属性——扩展字典 */
/**
* 配置属性扩展字典
*/
private String extDic = "lucene/ext.dic;" + PATH_USER_DIC;
/** 配置属性——扩展停止词典 */
/**
* 配置属性扩展停止词典
*/
private String extStopword = "lucene/stopword.dic";
/** 是否使用smart方式分词 */
/**
* 是否使用smart方式分词
*/
private boolean useSmart;
/**

View File

@ -26,32 +26,58 @@ import java.io.IOException;
import java.io.Reader;
import java.util.*;
/** 分词器上下文状态 */
/**
* 分词器上下文状态
*/
class AnalyzeContext {
/** 默认缓冲区大小 */
/**
* 默认缓冲区大小
*/
private static final int BUFF_SIZE = 4096;
/** 缓冲区耗尽的临界值 */
/**
* 缓冲区耗尽的临界值
*/
private static final int BUFF_EXHAUST_CRITICAL = 100;
/** 字符窜读取缓冲 */
/**
* 字符窜读取缓冲
*/
private char[] segmentBuff;
/** 字符类型数组 */
/**
* 字符类型数组
*/
private int[] charTypes;
/** 记录Reader内已分析的字串总长度 在分多段分析词元时该变量累计当前的segmentBuff相对于reader起始位置的位移 */
/**
* 记录Reader内已分析的字串总长度 在分多段分析词元时该变量累计当前的segmentBuff相对于reader起始位置的位移
*/
private int buffOffset;
/** 当前缓冲区位置指针 */
/**
* 当前缓冲区位置指针
*/
private int cursor;
/** 最近一次读入的,可处理的字串长度 */
/**
* 最近一次读入的,可处理的字串长度
*/
private int available;
/** 子分词器锁, 该集合非空说明有子分词器在占用segmentBuff */
/**
* 子分词器锁 该集合非空说明有子分词器在占用segmentBuff
*/
private final Set<String> buffLocker;
/** 原始分词结果集合,未经歧义处理 */
/**
* 原始分词结果集合未经歧义处理
*/
private QuickSortSet orgLexemes;
/** LexemePath位置索引表 */
/**
* LexemePath位置索引表
*/
private final Map<Integer, LexemePath> pathMap;
/** 最终分词结果集 */
/**
* 最终分词结果集
*/
private final LinkedList<Lexeme> results;
/** 分词器配置项 */
/**
* 分词器配置项
*/
private final Configuration cfg;
public AnalyzeContext(Configuration cfg) {
@ -113,14 +139,18 @@ class AnalyzeContext {
return readCount;
}
/** 初始化buff指针处理第一个字符 */
/**
* 初始化buff指针处理第一个字符
*/
void initCursor() {
this.cursor = 0;
this.segmentBuff[this.cursor] = CharacterUtil.regularize(this.segmentBuff[this.cursor]);
this.charTypes[this.cursor] = CharacterUtil.identifyCharType(this.segmentBuff[this.cursor]);
}
/** 指针+1 成功返回 true 指针已经到了buff尾部不能前进返回false 并处理当前字符 */
/**
* 指针+1 成功返回 true 指针已经到了buff尾部不能前进返回false 并处理当前字符
*/
boolean moveCursor() {
if (this.cursor < this.available - 1) {
this.cursor++;
@ -184,7 +214,9 @@ class AnalyzeContext {
&& !this.isBufferLocked();
}
/** 累计当前的segmentBuff相对于reader起始位置的位移 */
/**
* 累计当前的segmentBuff相对于reader起始位置的位移
*/
void markBufferOffset() {
this.buffOffset += this.cursor;
}
@ -298,7 +330,9 @@ class AnalyzeContext {
return result;
}
/** 重置分词上下文状态 */
/**
* 重置分词上下文状态
*/
void reset() {
this.buffLocker.clear();
this.orgLexemes = new QuickSortSet();
@ -311,7 +345,9 @@ class AnalyzeContext {
this.pathMap.clear();
}
/** 组合词元 */
/**
* 组合词元
*/
private void compound(Lexeme result) {
if (!this.cfg.useSmart()) {
return;

View File

@ -25,12 +25,18 @@ import com.rymcu.forest.lucene.dic.Hit;
import java.util.LinkedList;
import java.util.List;
/** 中文-日韩文子分词器 */
/**
* 中文-日韩文子分词器
*/
class CJKSegmenter implements ISegmenter {
/** 子分词器标签 */
/**
* 子分词器标签
*/
static final String SEGMENTER_NAME = "CJK_SEGMENTER";
/** 待处理的分词hit队列 */
/**
* 待处理的分词hit队列
*/
private List<Hit> tmpHits;
CJKSegmenter() {

View File

@ -27,13 +27,19 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Set;
/** 中文数量词子分词器 */
/**
* 中文数量词子分词器
*/
class CN_QuantifierSegmenter implements ISegmenter {
/** 子分词器标签 */
/**
* 子分词器标签
*/
static final String SEGMENTER_NAME = "QUAN_SEGMENTER";
/** 中文数词 */
/**
* 中文数词
*/
private static String Chn_Num = "一二两三四五六七八九十零壹贰叁肆伍陆柒捌玖拾百千万亿拾佰仟萬億兆卅廿";
private static Set<Character> ChnNumberChars = new HashSet<>();
@ -45,12 +51,18 @@ class CN_QuantifierSegmenter implements ISegmenter {
}
}
/** 词元的开始位置, 同时作为子分词器状态标识 当start > -1 时,标识当前的分词器正在处理字符 */
/**
* 词元的开始位置 同时作为子分词器状态标识 当start > -1 标识当前的分词器正在处理字符
*/
private int nStart;
/** 记录词元结束位置 end记录的是在词元中最后一个出现的合理的数词结束 */
/**
* 记录词元结束位置 end记录的是在词元中最后一个出现的合理的数词结束
*/
private int nEnd;
/** 待处理的量词hit队列 */
/**
* 待处理的量词hit队列
*/
private final List<Hit> countHits;
CN_QuantifierSegmenter() {
@ -59,7 +71,9 @@ class CN_QuantifierSegmenter implements ISegmenter {
this.countHits = new LinkedList<Hit>();
}
/** 分词 */
/**
* 分词
*/
@Override
public void analyze(AnalyzeContext context) {
// 处理中文数词
@ -75,7 +89,9 @@ class CN_QuantifierSegmenter implements ISegmenter {
}
}
/** 重置子分词器状态 */
/**
* 重置子分词器状态
*/
@Override
public void reset() {
nStart = -1;
@ -83,7 +99,9 @@ class CN_QuantifierSegmenter implements ISegmenter {
countHits.clear();
}
/** 处理数词 */
/**
* 处理数词
*/
private void processCNumber(AnalyzeContext context) {
if (nStart == -1 && nEnd == -1) { // 初始状态
if (CharacterUtil.CHAR_CHINESE == context.getCurrentCharType()

View File

@ -21,7 +21,9 @@
*/
package com.rymcu.forest.lucene.core;
/** 字符集识别工具类 */
/**
* 字符集识别工具类
*/
class CharacterUtil {
public static final int CHAR_USELESS = 0;

View File

@ -22,10 +22,13 @@ package com.rymcu.forest.lucene.core;
import java.util.Stack;
import java.util.TreeSet;
/** IK分词歧义裁决器 */
/**
* IK分词歧义裁决器
*/
class IKArbitrator {
IKArbitrator() {}
IKArbitrator() {
}
/**
* 分词歧义处理

View File

@ -28,18 +28,30 @@ import java.io.Reader;
import java.util.ArrayList;
import java.util.List;
/** IK分词器主类 */
/**
* IK分词器主类
*/
public final class IKSegmenter {
/** 字符窜reader */
/**
* 字符窜reader
*/
private Reader input;
/** 分词器配置项 */
/**
* 分词器配置项
*/
private Configuration cfg;
/** 分词器上下文 */
/**
* 分词器上下文
*/
private AnalyzeContext context;
/** 分词处理器列表 */
/**
* 分词处理器列表
*/
private List<ISegmenter> segmenters;
/** 分词歧义裁决器 */
/**
* 分词歧义裁决器
*/
private IKArbitrator arbitrator;
/**
@ -68,7 +80,9 @@ public final class IKSegmenter {
this.init();
}
/** 初始化 */
/**
* 初始化
*/
private void init() {
// 初始化词典单例
Dictionary.initial(this.cfg);

View File

@ -1,26 +1,25 @@
/**
* IK 中文分词 版本 5.0
* IK Analyzer release 5.0
*
* <p>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* <p>
* 源代码由林良益(linliangyi2005@gmail.com)提供
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
*/
package com.rymcu.forest.lucene.core;

View File

@ -21,26 +21,46 @@ package com.rymcu.forest.lucene.core;
import java.util.Arrays;
/** 英文字符及阿拉伯数字子分词器 */
/**
* 英文字符及阿拉伯数字子分词器
*/
class LetterSegmenter implements ISegmenter {
/** 子分词器标签 */
/**
* 子分词器标签
*/
static final String SEGMENTER_NAME = "LETTER_SEGMENTER";
/** 链接符号 */
private static final char[] Letter_Connector = new char[] {'#', '&', '+', '-', '.', '@', '_'};
/** 数字符号 */
private static final char[] Num_Connector = new char[] {',', '.'};
/** 词元的开始位置, 同时作为子分词器状态标识 当start > -1 时,标识当前的分词器正在处理字符 */
/**
* 链接符号
*/
private static final char[] Letter_Connector = new char[]{'#', '&', '+', '-', '.', '@', '_'};
/**
* 数字符号
*/
private static final char[] Num_Connector = new char[]{',', '.'};
/**
* 词元的开始位置 同时作为子分词器状态标识 当start > -1 标识当前的分词器正在处理字符
*/
private int start;
/** 记录词元结束位置 end记录的是在词元中最后一个出现的Letter但非Sign_Connector的字符的位置 */
/**
* 记录词元结束位置 end记录的是在词元中最后一个出现的Letter但非Sign_Connector的字符的位置
*/
private int end;
/** 字母起始位置 */
/**
* 字母起始位置
*/
private int englishStart;
/** 字母结束位置 */
/**
* 字母结束位置
*/
private int englishEnd;
/** 阿拉伯数字起始位置 */
/**
* 阿拉伯数字起始位置
*/
private int arabicStart;
/** 阿拉伯数字结束位置 */
/**
* 阿拉伯数字结束位置
*/
private int arabicEnd;
LetterSegmenter() {

View File

@ -1,26 +1,25 @@
/**
* IK 中文分词 版本 5.0
* IK Analyzer release 5.0
*
* <p>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* <p>
* 源代码由林良益(linliangyi2005@gmail.com)提供
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
*/
package com.rymcu.forest.lucene.core;

View File

@ -1,26 +1,25 @@
/**
* IK 中文分词 版本 5.0
* IK Analyzer release 5.0
*
* <p>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* <p>
* 源代码由林良益(linliangyi2005@gmail.com)提供
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
*/
package com.rymcu.forest.lucene.core;

View File

@ -1,26 +1,25 @@
/**
* IK 中文分词 版本 5.0
* IK Analyzer release 5.0
*
* <p>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* <p>
* 源代码由林良益(linliangyi2005@gmail.com)提供
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
*/
package com.rymcu.forest.lucene.core;

View File

@ -1,27 +1,25 @@
/**
*
* IK 中文分词 版本 5.0
* IK Analyzer release 5.0
*
* <p>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* <p>
* 源代码由林良益(linliangyi2005@gmail.com)提供
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
*/
package com.rymcu.forest.lucene.dic;

View File

@ -28,21 +28,35 @@ import java.nio.charset.StandardCharsets;
import java.util.Collection;
import java.util.List;
/** 词典管理类,单例模式 */
/**
* 词典管理类,单例模式
*/
public class Dictionary {
/** 词典单例 */
/**
* 词典单例
*/
private static Dictionary singleton;
/** 主词典对象 */
/**
* 主词典对象
*/
private DictSegment _MainDict;
/** 停止词词典 */
/**
* 停止词词典
*/
private DictSegment _StopWordDict;
/** 量词词典 */
/**
* 量词词典
*/
private DictSegment _QuantifierDict;
/** 用户自定义词典路径 */
/**
* 用户自定义词典路径
*/
private static final String PATH_USER_DIC =
System.getProperty("user.dir") + "/lucene/userDic/userDic.dic";
/** 配置对象 */
/**
* 配置对象
*/
private final Configuration cfg;
private Dictionary(Configuration cfg) {
@ -169,7 +183,9 @@ public class Dictionary {
return singleton._StopWordDict.match(charArray, begin, length).isMatch();
}
/** 加载主词典及扩展词典 */
/**
* 加载主词典及扩展词典
*/
private void loadMainDict() {
// 建立一个主词典实例
_MainDict = new DictSegment((char) 0);
@ -194,7 +210,9 @@ public class Dictionary {
this.loadExtDict();
}
/** 加载用户配置的扩展词典到主词库表 */
/**
* 加载用户配置的扩展词典到主词库表
*/
private void loadExtDict() {
// 加载扩展词典配置
List<String> extDictFiles = cfg.getExtDictionary();
@ -238,7 +256,9 @@ public class Dictionary {
}
}
/** 加载用户扩展的停止词词典 */
/**
* 加载用户扩展的停止词词典
*/
private void loadStopWordDict() {
// 建立一个主词典实例
_StopWordDict = new DictSegment((char) 0);
@ -278,7 +298,9 @@ public class Dictionary {
}
}
/** 加载量词词典 */
/**
* 加载量词词典
*/
private void loadQuantifierDict() {
// 建立一个量词典实例
_QuantifierDict = new DictSegment((char) 0);
@ -310,7 +332,9 @@ public class Dictionary {
}
}
/** 加载用户配置的自定义扩展词典到主词库表 */
/**
* 加载用户配置的自定义扩展词典到主词库表
*/
public void updateUserDict() {
// 加载扩展词典配置
InputStream is;

View File

@ -1,27 +1,25 @@
/**
*
* IK 中文分词 版本 5.0
* IK Analyzer release 5.0
*
* <p>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* <p>
* 源代码由林良益(linliangyi2005@gmail.com)提供
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
*/
package com.rymcu.forest.lucene.dic;

View File

@ -16,17 +16,27 @@ import java.util.concurrent.CountDownLatch;
* @date 2021/2/2 14:14
*/
public abstract class BaseIndex<T> implements Runnable {
/** 父级索引路径 */
/**
* 父级索引路径
*/
private String parentIndexPath;
/** 索引编写器 */
/**
* 索引编写器
*/
private IndexWriter writer;
private int subIndex;
/** 主线程 */
/**
* 主线程
*/
private final CountDownLatch countDownLatch1;
/** 工作线程 */
/**
* 工作线程
*/
private final CountDownLatch countDownLatch2;
/** 对象列表 */
/**
* 对象列表
*/
private List<T> list;
public BaseIndex(String parentIndexPath, int subIndex) {
@ -106,6 +116,7 @@ public abstract class BaseIndex<T> implements Runnable {
* @throws ParseException
*/
public abstract void indexDoc(IndexWriter writer, T t) throws Exception;
/**
* 批量索引创建
*

View File

@ -1,26 +1,25 @@
/**
* IK 中文分词 版本 5.0.1
* IK Analyzer release 5.0.1
*
* <p>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* <p>
* 源代码由林良益(linliangyi2005@gmail.com)提供
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
*/
package com.rymcu.forest.lucene.lucene;

View File

@ -55,6 +55,7 @@ public final class IKTokenizer extends Tokenizer {
/**
* Lucene 6.0 Tokenizer适配器类构造函数
*
* @param useSmart
*/
public IKTokenizer(boolean useSmart) {
@ -70,6 +71,7 @@ public final class IKTokenizer extends Tokenizer {
/**
* lucene 6.0 新增
* 方便创建 工厂类
*
* @param factory
* @param useSmart
*/

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.lucene.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -18,16 +18,23 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
public class ArticleLucene {
/** 文章编号 */
@JsonFormat(shape = JsonFormat.Shape.STRING)
/**
* 文章编号
*/
private Long idArticle;
/** 文章标题 */
/**
* 文章标题
*/
private String articleTitle;
/** 文章内容 */
/**
* 文章内容
*/
private String articleContent;
/** 相关度评分 */
/**
* 相关度评分
*/
private String score;
}

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.lucene.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -18,16 +18,23 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
public class PortfolioLucene {
/** 作品集编号 */
@JsonFormat(shape = JsonFormat.Shape.STRING)
/**
* 作品集编号
*/
private Long idPortfolio;
/** 作品集名称 */
/**
* 作品集名称
*/
private String portfolioTitle;
/** 作品集介绍 */
/**
* 作品集介绍
*/
private String portfolioDescription;
/** 相关度评分 */
/**
* 相关度评分
*/
private String score;
}

View File

@ -15,11 +15,15 @@ import javax.persistence.Table;
@Data
@Table(name = "forest_lucene_user_dic")
public class UserDic {
/** 主键 */
/**
* 主键
*/
@Id
@GeneratedValue(generator = "JDBC")
private Integer id;
/** 字典 */
/**
* 字典
*/
private String dic;
}

View File

@ -1,6 +1,6 @@
package com.rymcu.forest.lucene.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -18,16 +18,23 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
public class UserLucene {
/** 用户编号 */
@JsonFormat(shape = JsonFormat.Shape.STRING)
/**
* 用户编号
*/
private Long idUser;
/** 昵称 */
/**
* 昵称
*/
private String nickname;
/** 签名 */
/**
* 签名
*/
private String signature;
/** 相关度评分 */
/**
* 相关度评分
*/
private String score;
}

View File

@ -50,7 +50,6 @@ public interface UserDicService {
/**
* 写入字典至内存
*
*/
void writeUserDic() throws FileNotFoundException;
}

View File

@ -20,7 +20,8 @@ import java.util.List;
@Service
public class UserDicServiceImpl implements UserDicService {
@Resource private UserDicMapper userDicMapper;
@Resource
private UserDicMapper userDicMapper;
@Override
public List<String> getAllDic() {

View File

@ -41,7 +41,8 @@ import java.util.concurrent.Executors;
@Service
public class UserLuceneServiceImpl implements UserLuceneService {
@Resource private UserLuceneMapper userLuceneMapper;
@Resource
private UserLuceneMapper userLuceneMapper;
/**

View File

@ -22,12 +22,13 @@ import java.nio.file.Paths;
public class IndexUtil {
/**
* 创建索引写入器
*
* @param indexPath
* @param create
* @return
* @throws IOException
*/
public static IndexWriter getIndexWriter(String indexPath,boolean create) throws IOException{
public static IndexWriter getIndexWriter(String indexPath, boolean create) throws IOException {
Directory dir = FSDirectory.open(Paths.get(indexPath));
Analyzer analyzer = new IKAnalyzer();
IndexWriterConfig iwc = new IndexWriterConfig(analyzer);
@ -40,9 +41,9 @@ public class IndexUtil {
//值较小有利于追加索引的速度
//值较大,适合批量建立索引和更快的搜索
mergePolicy.setMaxMergeDocs(5000);
if (create){
if (create) {
iwc.setOpenMode(IndexWriterConfig.OpenMode.CREATE);
}else {
} else {
iwc.setOpenMode(IndexWriterConfig.OpenMode.CREATE_OR_APPEND);
}
return new IndexWriter(dir, iwc);

View File

@ -7,27 +7,41 @@ package com.rymcu.forest.lucene.util;
*/
public final class LucenePath {
/** lucene 目录 */
/**
* lucene 目录
*/
public static final String INDEX_PATH = "/lucene/index";
/** 文章 lucene 目录 */
/**
* 文章 lucene 目录
*/
public static final String ARTICLE_INDEX_PATH = INDEX_PATH + "/article";
/** 文章增量 lucene 目录 */
/**
* 文章增量 lucene 目录
*/
public static final String ARTICLE_INCREMENT_INDEX_PATH =
System.getProperty("user.dir") + ARTICLE_INDEX_PATH + "/index777";
/** 用户 lucene 目录 */
/**
* 用户 lucene 目录
*/
public static final String USER_PATH = INDEX_PATH + "/user";
/** 用户增量 lucene 目录 */
/**
* 用户增量 lucene 目录
*/
public static final String USER_INCREMENT_INDEX_PATH =
System.getProperty("user.dir") + USER_PATH + "/index777";
/** 作品集 lucene 目录 */
/**
* 作品集 lucene 目录
*/
public static final String PORTFOLIO_PATH = INDEX_PATH + "/portfolio";
/** 作品集增量 lucene 目录 */
/**
* 作品集增量 lucene 目录
*/
public static final String PORTFOLIO_INCREMENT_INDEX_PATH =
System.getProperty("user.dir") + PORTFOLIO_PATH + "/index777";
}

View File

@ -20,11 +20,15 @@ import java.util.Arrays;
*/
public class PortfolioIndexUtil {
/** lucene索引保存目录 */
/**
* lucene索引保存目录
*/
private static final String PATH =
System.getProperty("user.dir") + StrUtil.SLASH + LucenePath.PORTFOLIO_PATH;
/** 删除所有运行中保存的索引 */
/**
* 删除所有运行中保存的索引
*/
public static void deleteAllIndex() {
if (FileUtil.exist(LucenePath.PORTFOLIO_INCREMENT_INDEX_PATH)) {
FileUtil.del(LucenePath.PORTFOLIO_INCREMENT_INDEX_PATH);
@ -62,7 +66,9 @@ public class PortfolioIndexUtil {
}
}
/** 删除单个索引 */
/**
* 删除单个索引
*/
public static synchronized void deleteIndex(Long id) {
Arrays.stream(FileUtil.ls(PATH))
.forEach(

View File

@ -47,6 +47,7 @@ public class SearchUtil {
}
return new IndexSearcher(reader, service);
}
/**
* 根据索引路径获取IndexReader
*
@ -57,6 +58,7 @@ public class SearchUtil {
public static DirectoryReader getIndexReader(String indexPath) throws IOException {
return DirectoryReader.open(FSDirectory.open(Paths.get(indexPath)));
}
/**
* 根据索引路径获取IndexSearcher
*
@ -98,6 +100,7 @@ public class SearchUtil {
throws IOException {
return searcher.doc(docID);
}
/**
* 根据IndexSearcher和docID
*
@ -145,6 +148,7 @@ public class SearchUtil {
TopDocs docs = searcher.search(query, getMaxDocId(searcher));
return docs;
}
/**
* 统计document的数量,此方法等同于matchAllDocsQuery查询
*

View File

@ -17,6 +17,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 获取文章列表
*
* @param searchText
* @param tag
* @param topicUri
@ -26,6 +27,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 根据文章 ID 查询文章
*
* @param id
* @param type
* @return
@ -34,6 +36,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 保存文章内容
*
* @param idArticle
* @param articleContent
* @param articleContentHtml
@ -43,6 +46,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 更新文章内容
*
* @param idArticle
* @param articleContent
* @param articleContentHtml
@ -52,6 +56,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 获取文章正文内容
*
* @param idArticle
* @return
*/
@ -59,6 +64,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 获取主题下文章列表
*
* @param topicName
* @return
*/
@ -66,6 +72,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 获取标签下文章列表
*
* @param tagName
* @return
*/
@ -73,6 +80,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 获取用户文章列表
*
* @param idUser
* @return
*/
@ -80,6 +88,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 删除文章标签
*
* @param id
* @return
*/
@ -87,6 +96,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 获取文章标签列表
*
* @param idArticle
* @return
*/
@ -94,6 +104,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 更新文章浏览数
*
* @param id
* @param articleViewCount
* @return
@ -102,6 +113,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 获取草稿列表
*
* @param idUser
* @return
*/
@ -109,6 +121,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 删除未使用的文章标签
*
* @param idArticleTag
* @return
*/
@ -116,6 +129,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 查询作品集下文章
*
* @param idPortfolio
* @return
*/
@ -123,6 +137,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 查询作品集未绑定文章
*
* @param idPortfolio
* @param searchText
* @param idUser
@ -132,6 +147,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 查询文章所属作品集列表
*
* @param idArticle
* @return
*/
@ -139,6 +155,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 更新文章标签
*
* @param idArticle
* @param tags
* @return
@ -147,6 +164,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 判断是否有评论
*
* @param id
* @return
*/
@ -154,6 +172,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 删除关联作品集数据
*
* @param id
* @return
*/
@ -161,6 +180,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 更新文章连接及预览内容
*
* @param idArticle
* @param articleLink
* @param articlePermalink
@ -171,6 +191,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 根据专题主键及当前文章排序号获取专题下文章大纲
*
* @param idPortfolio
* @param sortNo
* @return
@ -179,6 +200,7 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 更新文章优选状态
*
* @param idArticle
* @param articlePerfect
* @return
@ -187,12 +209,14 @@ public interface ArticleMapper extends Mapper<Article> {
/**
* 删除文章关联文章内容表信息
*
* @param idArticle
*/
void deleteArticleContent(@Param("idArticle") Long idArticle);
/**
* 获取公告
*
* @return
*/
List<ArticleDTO> selectAnnouncements();

Some files were not shown because too many files have changed in this diff Show More