Skip to content

Commit

Permalink
Refactor: 汉化&魔法值 (#3)(#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
Planeswalker23 committed Apr 16, 2021
1 parent c4d5519 commit dfdafbe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
public interface MessageDict {

String SUCCESS = "成功";
String SYSTEM_ERROR = "系统异常,请联系管理员";
String PARAMETER_VALIDATOR_FAILED = "参数校验失败:";
String FUND_TYPE_NOT_SUPPORT = "基金类型 {%s} 不支持, 请检查基金代码是否正确";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.walkers.planes.fundhelper.entity.pojo;

import io.walkers.planes.fundhelper.entity.dict.MessageDict;
import io.walkers.planes.fundhelper.util.JacksonUtil;
import lombok.Data;

Expand All @@ -10,7 +11,6 @@
*/
@Data
public class Response<T> {
private static final String SUCCESS = "Success";
/**
* 返回结果是否成功
*/
Expand All @@ -27,14 +27,14 @@ public class Response<T> {
public static Response<String> success() {
Response<String> res = new Response<>();
res.setSuccess(true);
res.setMessage(SUCCESS);
res.setMessage(MessageDict.SUCCESS);
return res;
}

public static <T> Response<T> success(T data) {
Response<T> res = new Response<T>();
res.setSuccess(true);
res.setMessage(SUCCESS);
res.setMessage(MessageDict.SUCCESS);
res.setData(data);
return res;
}
Expand Down

0 comments on commit dfdafbe

Please sign in to comment.