greetUser(@RequestParam @NotBlank String code) t
/**
* 签名
*
- * @param url
- *1
+ * @param url 1
* @return
* @throws WxErrorException
*/
diff --git a/tduck-api/src/main/java/com/tduck/cloud/api/web/filter/HTMLFilter.java b/tduck-api/src/main/java/com/tduck/cloud/api/web/filter/HTMLFilter.java
index e57485d..94a1717 100644
--- a/tduck-api/src/main/java/com/tduck/cloud/api/web/filter/HTMLFilter.java
+++ b/tduck-api/src/main/java/com/tduck/cloud/api/web/filter/HTMLFilter.java
@@ -8,30 +8,29 @@
import java.util.regex.Pattern;
/**
- *
* HTML filtering utility for protecting against XSS (Cross Site Scripting).
- *
+ *
* This code is licensed LGPLv3
- *
+ *
* This code is a Java port of the original work interceptor PHP by Cal Hendersen.
* http://code.iamcal.com/php/lib_filter/
- *
+ *
* The trickiest part of the translation was handling the differences interceptor regex handling
* between PHP and Java. These resources were helpful interceptor the process:
- *
+ *
* http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html
* http://us2.php.net/manual/en/reference.pcre.pattern.modifiers.php
* http://www.regular-expressions.info/modifiers.html
- *
+ *
* A note on naming conventions: instance variables are prefixed with a "v"; global
* constant are interceptor all caps.
- *
+ *
* Sample use:
* String input = ...
* String clean = new HTMLFilter().filter( input );
- *
+ *
* The class is not thread safe. Create a new instance if interceptor doubt.
- *
+ *
* If you find bugs or have suggestions on improvement (especially regarding
* performance), please contact us. The latest version of this
* source, and our contact details, can be found at http://xss-html-filter.sf.net
@@ -42,7 +41,9 @@
*/
public final class HTMLFilter {
- /** regex flag union representing /si modifiers interceptor php **/
+ /**
+ * regex flag union representing /si modifiers interceptor php
+ **/
private static final int REGEX_FLAGS_SI = Pattern.CASE_INSENSITIVE | Pattern.DOTALL;
private static final Pattern P_COMMENTS = Pattern.compile("", Pattern.DOTALL);
private static final Pattern P_COMMENT = Pattern.compile("^!--(.*)--$", REGEX_FLAGS_SI);
@@ -69,41 +70,61 @@ public final class HTMLFilter {
private static final Pattern P_BOTH_ARROWS = Pattern.compile("<>");
// @xxx could grow large... maybe use sesat's ReferenceMap
- private static final ConcurrentMap P_REMOVE_PAIR_BLANKS = new ConcurrentHashMap();
- private static final ConcurrentMap P_REMOVE_SELF_BLANKS = new ConcurrentHashMap();
+ private static final ConcurrentMap P_REMOVE_PAIR_BLANKS = new ConcurrentHashMap();
+ private static final ConcurrentMap P_REMOVE_SELF_BLANKS = new ConcurrentHashMap();
- /** set of allowed html elements, along with allowed attributes for each element **/
+ /**
+ * set of allowed html elements, along with allowed attributes for each element
+ **/
private final Map> vAllowed;
- /** counts of open tags for each (allowable) html element **/
+ /**
+ * counts of open tags for each (allowable) html element
+ **/
private final Map vTagCounts = new HashMap();
- /** html elements which must always be self-closing (e.g. "
") **/
+ /**
+ * html elements which must always be self-closing (e.g. "
")
+ **/
private final String[] vSelfClosingTags;
- /** html elements which must always have separate opening and closing tags (e.g. "") **/
+ /**
+ * html elements which must always have separate opening and closing tags (e.g. "")
+ **/
private final String[] vNeedClosingTags;
- /** set of disallowed html elements **/
+ /**
+ * set of disallowed html elements
+ **/
private final String[] vDisallowed;
- /** attributes which should be checked for valid protocols **/
+ /**
+ * attributes which should be checked for valid protocols
+ **/
private final String[] vProtocolAtts;
- /** allowed protocols **/
+ /**
+ * allowed protocols
+ **/
private final String[] vAllowedProtocols;
- /** tags which should be removed if they contain no content (e.g. "" or "") **/
+ /**
+ * tags which should be removed if they contain no content (e.g. "" or "")
+ **/
private final String[] vRemoveBlanks;
- /** entities allowed within html markup **/
+ /**
+ * entities allowed within html markup
+ **/
private final String[] vAllowedEntities;
- /** flag determining whether comments are allowed interceptor input String. */
+ /**
+ * flag determining whether comments are allowed interceptor input String.
+ */
private final boolean stripComment;
private final boolean encodeQuotes;
- private boolean vDebug = false;
/**
* flag determining whether to try to make tags when presented with "unbalanced"
* angle brackets (e.g. "" becomes " text "). If set to false,
* unbalanced angle brackets will be html escaped.
*/
private final boolean alwaysMakeTags;
+ private boolean vDebug = false;
- /** Default constructor.
- *
+ /**
+ * Default constructor.
*/
public HTMLFilter() {
vAllowed = new HashMap<>();
@@ -138,7 +159,8 @@ public HTMLFilter() {
alwaysMakeTags = true;
}
- /** Set debug flag to true. Otherwise use default settings. See the default constructor.
+ /**
+ * Set debug flag to true. Otherwise use default settings. See the default constructor.
*
* @param debug turn debug on with a true argument
*/
@@ -148,11 +170,12 @@ public HTMLFilter(final boolean debug) {
}
- /** Map-parameter configurable constructor.
+ /**
+ * Map-parameter configurable constructor.
*
* @param conf map containing configuration. keys match field names.
*/
- public HTMLFilter(final Map conf) {
+ public HTMLFilter(final Map conf) {
assert conf.containsKey("vAllowed") : "configuration requires vAllowed";
assert conf.containsKey("vSelfClosingTags") : "configuration requires vSelfClosingTags";
@@ -171,21 +194,11 @@ public HTMLFilter(final Map conf) {
vProtocolAtts = (String[]) conf.get("vProtocolAtts");
vRemoveBlanks = (String[]) conf.get("vRemoveBlanks");
vAllowedEntities = (String[]) conf.get("vAllowedEntities");
- stripComment = conf.containsKey("stripComment") ? (Boolean) conf.get("stripComment") : true;
+ stripComment = conf.containsKey("stripComment") ? (Boolean) conf.get("stripComment") : true;
encodeQuotes = conf.containsKey("encodeQuotes") ? (Boolean) conf.get("encodeQuotes") : true;
alwaysMakeTags = conf.containsKey("alwaysMakeTags") ? (Boolean) conf.get("alwaysMakeTags") : true;
}
- private void reset() {
- vTagCounts.clear();
- }
-
- private void debug(final String msg) {
- if (vDebug) {
- Logger.getAnonymousLogger().info(msg);
- }
- }
-
//---------------------------------------------------------------
// my versions of some PHP library functions
public static String chr(final int decimal) {
@@ -201,7 +214,32 @@ public static String htmlSpecialChars(final String s) {
return result;
}
+ private static String regexReplace(final Pattern regex_pattern, final String replacement, final String s) {
+ Matcher m = regex_pattern.matcher(s);
+ return m.replaceAll(replacement);
+ }
+
+ private static boolean inArray(final String s, final String[] array) {
+ for (String item : array) {
+ if (item != null && item.equals(s)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
//---------------------------------------------------------------
+
+ private void reset() {
+ vTagCounts.clear();
+ }
+
+ private void debug(final String msg) {
+ if (vDebug) {
+ Logger.getAnonymousLogger().info(msg);
+ }
+ }
+
/**
* given a user submitted input String, filter out any invalid or restricted
* html.
@@ -235,11 +273,11 @@ public String filter(final String input) {
return s;
}
- public boolean isAlwaysMakeTags(){
+ public boolean isAlwaysMakeTags() {
return alwaysMakeTags;
}
- public boolean isStripComments(){
+ public boolean isStripComments() {
return stripComment;
}
@@ -309,11 +347,11 @@ private String checkTags(String s) {
private String processRemoveBlanks(final String s) {
String result = s;
for (String tag : vRemoveBlanks) {
- if(!P_REMOVE_PAIR_BLANKS.containsKey(tag)){
+ if (!P_REMOVE_PAIR_BLANKS.containsKey(tag)) {
P_REMOVE_PAIR_BLANKS.putIfAbsent(tag, Pattern.compile("<" + tag + "(\\s[^>]*)?>"));
}
result = regexReplace(P_REMOVE_PAIR_BLANKS.get(tag), "", result);
- if(!P_REMOVE_SELF_BLANKS.containsKey(tag)){
+ if (!P_REMOVE_SELF_BLANKS.containsKey(tag)) {
P_REMOVE_SELF_BLANKS.putIfAbsent(tag, Pattern.compile("<" + tag + "(\\s[^>]*)?/>"));
}
result = regexReplace(P_REMOVE_SELF_BLANKS.get(tag), "", result);
@@ -322,11 +360,6 @@ private String processRemoveBlanks(final String s) {
return result;
}
- private static String regexReplace(final Pattern regex_pattern, final String replacement, final String s) {
- Matcher m = regex_pattern.matcher(s);
- return m.replaceAll(replacement);
- }
-
private String processTag(final String s) {
// ending tags
Matcher m = P_END_TAG.matcher(s);
@@ -409,7 +442,7 @@ private String processTag(final String s) {
// comments
m = P_COMMENT.matcher(s);
if (!stripComment && m.find()) {
- return "<" + m.group() + ">";
+ return "<" + m.group() + ">";
}
return "";
@@ -483,8 +516,8 @@ private String validateEntities(final String s) {
return encodeQuotes(buf.toString());
}
- private String encodeQuotes(final String s){
- if(encodeQuotes){
+ private String encodeQuotes(final String s) {
+ if (encodeQuotes) {
StringBuffer buf = new StringBuffer();
Matcher m = P_VALID_QUOTES.matcher(s);
while (m.find()) {
@@ -495,7 +528,7 @@ private String encodeQuotes(final String s){
}
m.appendTail(buf);
return buf.toString();
- }else{
+ } else {
return s;
}
}
@@ -511,15 +544,6 @@ private boolean isValidEntity(final String entity) {
return inArray(entity, vAllowedEntities);
}
- private static boolean inArray(final String s, final String[] array) {
- for (String item : array) {
- if (item != null && item.equals(s)) {
- return true;
- }
- }
- return false;
- }
-
private boolean allowed(final String name) {
return (vAllowed.isEmpty() || vAllowed.containsKey(name)) && !inArray(name, vDisallowed);
}
diff --git a/tduck-api/src/main/java/com/tduck/cloud/api/web/filter/SignAuthFilter.java b/tduck-api/src/main/java/com/tduck/cloud/api/web/filter/SignAuthFilter.java
index 0f30337..8b84d60 100644
--- a/tduck-api/src/main/java/com/tduck/cloud/api/web/filter/SignAuthFilter.java
+++ b/tduck-api/src/main/java/com/tduck/cloud/api/web/filter/SignAuthFilter.java
@@ -28,15 +28,12 @@
@Data
public class SignAuthFilter implements Filter {
- private PlatformSignProperties platformSignProperties;
-
private final static String TIMESTAMP_KEY_NAME = "timestamp";
-
/**
* 最大有效时间 默认 10秒钟失效 超出10s失效
*/
private final static Long MAX_EFFECTIVE_TIMESTAMP = 10L * 1000;
-
+ private PlatformSignProperties platformSignProperties;
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
diff --git a/tduck-api/src/main/java/com/tduck/cloud/api/web/interceptor/AuthorizationInterceptor.java b/tduck-api/src/main/java/com/tduck/cloud/api/web/interceptor/AuthorizationInterceptor.java
index 3528004..0284428 100644
--- a/tduck-api/src/main/java/com/tduck/cloud/api/web/interceptor/AuthorizationInterceptor.java
+++ b/tduck-api/src/main/java/com/tduck/cloud/api/web/interceptor/AuthorizationInterceptor.java
@@ -5,7 +5,6 @@
import com.tduck.cloud.api.annotation.Login;
import com.tduck.cloud.api.exception.AuthorizationException;
import io.jsonwebtoken.Claims;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
@@ -18,9 +17,8 @@
*/
@Component
public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
- private final JwtUtils jwtUtils;
-
public static final String USER_KEY = "userId";
+ private final JwtUtils jwtUtils;
public AuthorizationInterceptor(JwtUtils jwtUtils) {
this.jwtUtils = jwtUtils;
diff --git a/tduck-api/src/main/java/com/tduck/cloud/api/web/resolver/LoginUserHandlerMethodArgumentResolver.java b/tduck-api/src/main/java/com/tduck/cloud/api/web/resolver/LoginUserHandlerMethodArgumentResolver.java
index 99ec0c6..847d3e0 100644
--- a/tduck-api/src/main/java/com/tduck/cloud/api/web/resolver/LoginUserHandlerMethodArgumentResolver.java
+++ b/tduck-api/src/main/java/com/tduck/cloud/api/web/resolver/LoginUserHandlerMethodArgumentResolver.java
@@ -14,6 +14,7 @@
/**
* 有@LoginUser注解的方法参数,注入当前登录用户
+ *
* @author qing
*/
@Component
@@ -34,12 +35,12 @@ public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer c
NativeWebRequest request, WebDataBinderFactory factory) throws Exception {
//获取用户ID
Object object = request.getAttribute(AuthorizationInterceptor.USER_KEY, RequestAttributes.SCOPE_REQUEST);
- if(object == null){
+ if (object == null) {
return null;
}
//获取用户信息
- UserEntity user = userService.getById((Long)object);
+ UserEntity user = userService.getById((Long) object);
return user;
}
}
diff --git a/tduck-api/src/main/java/com/tduck/cloud/api/web/wrapper/BodyReaderHttpServletRequestWrapper.java b/tduck-api/src/main/java/com/tduck/cloud/api/web/wrapper/BodyReaderHttpServletRequestWrapper.java
index e42f686..3ebabaf 100644
--- a/tduck-api/src/main/java/com/tduck/cloud/api/web/wrapper/BodyReaderHttpServletRequestWrapper.java
+++ b/tduck-api/src/main/java/com/tduck/cloud/api/web/wrapper/BodyReaderHttpServletRequestWrapper.java
@@ -22,11 +22,10 @@
* @author
*/
public class BodyReaderHttpServletRequestWrapper extends HttpServletRequestWrapper {
- //没被包装过的HttpServletRequest(特殊场景,需要自己过滤)
- HttpServletRequest orgRequest;
//html过滤
private final static HTMLFilter htmlFilter = new HTMLFilter();
-
+ //没被包装过的HttpServletRequest(特殊场景,需要自己过滤)
+ HttpServletRequest orgRequest;
@Getter
private String bodyJson;
@@ -35,13 +34,23 @@ public BodyReaderHttpServletRequestWrapper(HttpServletRequest request) throws IO
orgRequest = request;
}
+ /**
+ * 获取最原始的request
+ */
+ public static HttpServletRequest getOrgRequest(HttpServletRequest request) {
+ if (request instanceof BodyReaderHttpServletRequestWrapper) {
+ return ((BodyReaderHttpServletRequestWrapper) request).getOrgRequest();
+ }
+
+ return request;
+ }
@Override
public ServletInputStream getInputStream() throws IOException {
- if(!MediaType.APPLICATION_JSON_VALUE.equalsIgnoreCase(super.getHeader(HttpHeaders.CONTENT_TYPE))){
+ if (!MediaType.APPLICATION_JSON_VALUE.equalsIgnoreCase(super.getHeader(HttpHeaders.CONTENT_TYPE))) {
return super.getInputStream();
}
- if(StrUtil.isBlank(bodyJson)){
+ if (StrUtil.isBlank(bodyJson)) {
bodyJson = IOUtils.toString(super.getInputStream(), "utf-8");
}
final ByteArrayInputStream bis = new ByteArrayInputStream(bodyJson.getBytes("utf-8"));
@@ -124,15 +133,4 @@ public HttpServletRequest getOrgRequest() {
return orgRequest;
}
- /**
- * 获取最原始的request
- */
- public static HttpServletRequest getOrgRequest(HttpServletRequest request) {
- if (request instanceof BodyReaderHttpServletRequestWrapper) {
- return ((BodyReaderHttpServletRequestWrapper) request).getOrgRequest();
- }
-
- return request;
- }
-
}
diff --git a/tduck-api/src/main/resources/application-prod1.yml b/tduck-api/src/main/resources/application-prod1.yml
new file mode 100644
index 0000000..a60724a
--- /dev/null
+++ b/tduck-api/src/main/resources/application-prod1.yml
@@ -0,0 +1,69 @@
+spring:
+ datasource:
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ url: mpw:KgK8kYuLFIT6b38+H+cB2E0GrL/C825hS6MlTg/E1/OcM4OMb/QFCldOmz3WjLYrr3LMk/6L7jajw0Bkgm0934e1p36Ta0gd9oYG+dWzBNc9Wto8+Asb1nZPGRm3Bu/oxCszzI5m7lzhc/WniWnWQErooPUGkjRn+KeQT0sFd7irBgFCweQnR4Xh6CqpCreajKEFDCJ3+unEtJHDZEsNY0gCeEE0odBH+zKRH1BpgKg=
+ username: mpw:7mG/EMKw74oyiB/LMzqIqg==
+ password: mpw:PABnKNLVmn27Oo362cuTtw==
+ type: com.zaxxer.hikari.HikariDataSource
+ hikari:
+ minimum-idle: 5
+ maximum-pool-size: 15
+ auto-commit: true
+ idle-timeout: 30000
+ pool-name: DatebookHikariCP
+ max-lifetime: 1800000
+ connection-test-query: SELECT 1 FROM DUAL
+ redis:
+ database: 8
+ host: mpw:YzdftpXBBgLy7VmokWdrK4hjKB8WCW7bwcnfV6nB7t/xo2muj30soiTGS4XKPhAU
+ port: 6379
+ password: mpw:bZqFg950btNM/dsR0vycDA==
+ timeout: 6000ms # 连接超时时长(毫秒)
+ jedis:
+ pool:
+ max-active: 1000 # 连接池最大连接数(使用负值表示没有限制)
+ max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
+ max-idle: 10 # 连接池中的最大空闲连接
+ min-idle: 5 # 连接池中的最小空闲连接
+ mail:
+ host: smtp.exmail.qq.com
+ username: server@tduckapp.com
+ password: 8rH69a47pV2qynVE
+
+logging:
+ level:
+ com.tduck.cloud: debug
+ config: classpath:logback-spring.xml
+
+# 请求日志是否打印
+platform:
+ qq:
+ oauth:
+ appId: mpw:rk3097HYqXT7Vi2G2FviZg==
+ secret: mpw:GMhX2wUES+IEzN7ew5tsNBnfn7qnYAwd4yboiePZJY7bvn26Pxo3P1BlbAkazhk/
+ oss:
+ ossType: 1
+ endpoint: 12
+ accessKeyId: mpw:WOF+Vhv3nd9ToNO8rR5IhV9HOk413qQnioFfywJxM+IIQ4mrgDdYwMKsnvbG3FQR
+ accessKeySecret: mpw:5EqsGyYp3MbnnIf1xGKUCz2PK6LlkQ0udZBrT4CfQOAfxcHt+NsbLc8+vp7vscF1
+ bucketName: tduck-cloud
+ domain: https://qiniu.smileyi.top
+ sms:
+ secretId: mpw:W+RKqswyYOtgpv6UOni0TqBLkjsoOaXnHAgiXBZjiutn7r5TAwBJlJ48wA6bBilO
+ secretKey: mpw:5zzzynMufvVYi34OmI9mQH07HtTLg3R7YTuil3DS+bNw9uIodim2pw5qkK9lNish
+ appId: 1400461467
+ sign: smileyi知识分享
+ validateCodeTemplateId: 808150
+ retrievePwdValidateCodeTemplateId: 809014
+ front:
+ baseUrl: https://demo.tduckapp.com/
+ resetPwdUrl: https://demo.tduckapp.com//forget/password?code={}&email={}
+ updateEmailUrl: https://demo.tduckapp.com/forget/validate?type=updateEmail&code={}&email={}
+
+wx:
+ mp:
+ configs:
+ - appId: mpw:IgmCUt6NlcOhudRzHINgCJkgssnDCnslYwtjhGhfbmU=
+ secret: mpw:C1IFFy1OS1kSw3PYQFebqVBS9GCbWEpR++3Wk7uIjEwCIIBwdVth9P27dJgOQynX
+ token: mpw:KvJQe4MSJ1ngbKSryGmFe2k/dGlQ3Aoqpm1GK7Q4JZxYHTAUzUt5AFf0midIOB17
+ aesKey: mpw:LPii9VslV/UE8UFfsK24EbR9reriiaDS0vW+by5705LWo1znd+P+DlxuEE1vXCmO
\ No newline at end of file
diff --git a/tduck-api/src/main/resources/templates/mail/reg-code.html b/tduck-api/src/main/resources/templates/mail/reg-code.html
index ad91804..7767c46 100644
--- a/tduck-api/src/main/resources/templates/mail/reg-code.html
+++ b/tduck-api/src/main/resources/templates/mail/reg-code.html
@@ -5,7 +5,7 @@
注册验证码
-
欢迎您注册TDuck,验证码五分钟内有效。
+欢迎您注册TDuck,验证码五分钟内有效。
您的验证码为:
diff --git a/tduck-api/src/main/resources/templates/mail/reset-password.html b/tduck-api/src/main/resources/templates/mail/reset-password.html
index 5195615..d4e820f 100644
--- a/tduck-api/src/main/resources/templates/mail/reset-password.html
+++ b/tduck-api/src/main/resources/templates/mail/reset-password.html
@@ -5,7 +5,7 @@
重置密码
-
@@ -17,13 +17,13 @@
-
+
+ src="http://tduck.smileyi.top/img/indexLogo.372abcee.png"
+ style="width: 186px; height: 54px;"/>
请点击下面链接重置密码:
-
+
如果以上链接无法点击,请将上面的地址复制到你的浏览器(如IE)的地址栏进入问卷网。
diff --git a/tduck-api/src/main/resources/templates/mail/update-account-email.html b/tduck-api/src/main/resources/templates/mail/update-account-email.html
index a9ca24f..74c6f80 100644
--- a/tduck-api/src/main/resources/templates/mail/update-account-email.html
+++ b/tduck-api/src/main/resources/templates/mail/update-account-email.html
@@ -5,7 +5,7 @@
重置密码
-
@@ -17,13 +17,13 @@
-
+
+ src="http://tduck.smileyi.top/img/indexLogo.372abcee.png"
+ style="width: 186px; height: 54px;"/>
-
+
如果以上链接无法点击,请将上面的地址复制到你的浏览器(如IE)的地址栏进入TDUCK。
diff --git a/tduck-common/pom.xml b/tduck-common/pom.xml
index 54be371..bbb9058 100644
--- a/tduck-common/pom.xml
+++ b/tduck-common/pom.xml
@@ -1,6 +1,6 @@
-
com.tduck
diff --git a/tduck-common/src/main/java/com/tduck/cloud/common/constant/CommonConstants.java b/tduck-common/src/main/java/com/tduck/cloud/common/constant/CommonConstants.java
index c6b7348..9f4637f 100644
--- a/tduck-common/src/main/java/com/tduck/cloud/common/constant/CommonConstants.java
+++ b/tduck-common/src/main/java/com/tduck/cloud/common/constant/CommonConstants.java
@@ -17,6 +17,10 @@ public interface CommonConstants {
* 1:正常 0 :禁用
*/
Integer USER_NORMAL_STATUS = 1;
+ /**
+ * 文件下载content_type
+ */
+ String FILE_DOWNLOAD_CONTENT_TYPE = "application/octet-stream;charset=UTF-8";
/**
@@ -86,10 +90,4 @@ interface ConstantNumber {
}
-
- /**
- * 文件下载content_type
- */
- String FILE_DOWNLOAD_CONTENT_TYPE = "application/octet-stream;charset=UTF-8";
-
}
diff --git a/tduck-common/src/main/java/com/tduck/cloud/common/email/MailService.java b/tduck-common/src/main/java/com/tduck/cloud/common/email/MailService.java
index fa65df3..c629565 100644
--- a/tduck-common/src/main/java/com/tduck/cloud/common/email/MailService.java
+++ b/tduck-common/src/main/java/com/tduck/cloud/common/email/MailService.java
@@ -29,7 +29,7 @@ public interface MailService {
* @param toAddr
* @param title
* @param template 模板
- * @param params 参数
+ * @param params 参数
*/
void sendTemplateHtmlMail(String toAddr, String title, String template, Map params);
diff --git a/tduck-common/src/main/java/com/tduck/cloud/common/email/MailServiceImpl.java b/tduck-common/src/main/java/com/tduck/cloud/common/email/MailServiceImpl.java
index 541ec47..727e22b 100644
--- a/tduck-common/src/main/java/com/tduck/cloud/common/email/MailServiceImpl.java
+++ b/tduck-common/src/main/java/com/tduck/cloud/common/email/MailServiceImpl.java
@@ -27,9 +27,9 @@
@RequiredArgsConstructor
public class MailServiceImpl implements MailService {
- private final TemplateEngine templateEngine;
+ private final TemplateEngine templateEngine;
- private final JavaMailSender mailSender;
+ private final JavaMailSender mailSender;
/**
* 注入常量
diff --git a/tduck-common/src/main/java/com/tduck/cloud/common/mybatis/handler/JacksonTypeHandler.java b/tduck-common/src/main/java/com/tduck/cloud/common/mybatis/handler/JacksonTypeHandler.java
index 181c9f9..7ad650d 100644
--- a/tduck-common/src/main/java/com/tduck/cloud/common/mybatis/handler/JacksonTypeHandler.java
+++ b/tduck-common/src/main/java/com/tduck/cloud/common/mybatis/handler/JacksonTypeHandler.java
@@ -34,6 +34,11 @@ public JacksonTypeHandler(Class type) {
this.type = type;
}
+ public static void setObjectMapper(ObjectMapper objectMapper) {
+ Assert.notNull(objectMapper, "ObjectMapper should not be null");
+ JacksonTypeHandler.objectMapper = objectMapper;
+ }
+
@Override
protected Object parse(String json) {
try {
@@ -56,9 +61,4 @@ protected String toJson(Object obj) {
throw new RuntimeException(e);
}
}
-
- public static void setObjectMapper(ObjectMapper objectMapper) {
- Assert.notNull(objectMapper, "ObjectMapper should not be null");
- JacksonTypeHandler.objectMapper = objectMapper;
- }
}
diff --git a/tduck-common/src/main/java/com/tduck/cloud/common/util/RedisUtils.java b/tduck-common/src/main/java/com/tduck/cloud/common/util/RedisUtils.java
index c9601c6..9f11cde 100644
--- a/tduck-common/src/main/java/com/tduck/cloud/common/util/RedisUtils.java
+++ b/tduck-common/src/main/java/com/tduck/cloud/common/util/RedisUtils.java
@@ -10,7 +10,6 @@
import java.util.concurrent.TimeUnit;
/**
- *
* @author smalljop
* @date 23/09/2018
*/
@@ -18,12 +17,6 @@
@Slf4j
public class RedisUtils {
- private final RedisTemplate redisTemplate;
-
- public RedisUtils(RedisTemplate redisTemplate) {
- this.redisTemplate = redisTemplate;
- }
-
/**
* 默认过期时长,单位:秒 一天
*/
@@ -32,8 +25,10 @@ public RedisUtils(RedisTemplate redisTemplate) {
* 不设置过期时长
*/
public final static long NOT_EXPIRE = -1;
-
-
+ private final RedisTemplate redisTemplate;
+ public RedisUtils(RedisTemplate redisTemplate) {
+ this.redisTemplate = redisTemplate;
+ }
/**
* 写入缓存
diff --git a/tduck-common/src/main/java/com/tduck/cloud/common/util/Result.java b/tduck-common/src/main/java/com/tduck/cloud/common/util/Result.java
index 55c867b..79f33ef 100644
--- a/tduck-common/src/main/java/com/tduck/cloud/common/util/Result.java
+++ b/tduck-common/src/main/java/com/tduck/cloud/common/util/Result.java
@@ -83,7 +83,6 @@ public static Result restResult(T data, int code, String msg) {
}
-
@JsonIgnore
public Boolean isDataNull() {
return ObjectUtil.isNull(data);
diff --git a/tduck-project/pom.xml b/tduck-project/pom.xml
index 84da641..4146dd2 100644
--- a/tduck-project/pom.xml
+++ b/tduck-project/pom.xml
@@ -1,6 +1,6 @@
- | |