搜索服务完成

This commit is contained in:
xiongxiaoyang
2020-05-28 09:48:46 +08:00
parent c6e6a1df9f
commit a310512221
35 changed files with 4546 additions and 24 deletions

View File

@ -116,4 +116,6 @@
</dependencies>
</project>

View File

@ -12,7 +12,7 @@ import java.util.concurrent.TimeUnit;
/**
* @author xxy
*/
@ConditionalOnProperty(prefix = "cache", name = "type", havingValue = "redis")
@ConditionalOnProperty(prefix = "spring.redis", name = "host", matchIfMissing = false)
@RequiredArgsConstructor
@Service
public class RedisServiceImpl implements CacheService {

View File

@ -37,7 +37,7 @@ public enum ResponseStatus {
/**
* 用户相关错误
* */
NO_LOGIN(1001, "未登录或登陆失效!"),
NO_LOGIN(1001, "未登录或登陆失效!"),
VEL_CODE_ERROR(1002, "验证码错误!"),
USERNAME_EXIST(1003,"该手机号已注册!"),
USERNAME_PASS_ERROR(1004,"手机号或密码错误!"),
@ -58,13 +58,16 @@ public enum ResponseStatus {
, BOOKNAME_EXISTS(4003,"已发布过同名小说!")
,
/**
* 搜索引擎相关错误
* */
ES_SEARCH_FAIL(9001,"密码错误!"),
/**
* 其他通用错误
* */
PASSWORD_ERROR(88001,"密码错误!");
private int code;
private String msg;

View File

@ -8,6 +8,7 @@ import io.jsonwebtoken.SignatureAlgorithm;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
import java.util.Date;
@ -18,6 +19,7 @@ import java.util.Map;
* @author 11797
*/
@Component
@ConditionalOnProperty(prefix = "jwt", name = "secret")
@Slf4j
public class JwtTokenUtil {

View File

@ -14,9 +14,7 @@ mybatis:
logging:
config: classpath:logback-boot.xml
jwt:
secret: novel!1025
expiration: 604800