Commit 716063ae authored by qinxunjia's avatar qinxunjia

修改返回值

parent 3e4de28d
...@@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory; ...@@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@SuppressWarnings("Duplicates")
@RestController @RestController
@RequestMapping() @RequestMapping()
public class DmHubApi { public class DmHubApi {
...@@ -75,6 +76,4 @@ public class DmHubApi { ...@@ -75,6 +76,4 @@ public class DmHubApi {
log.info("**********单条发送出参*******:{}", JSONObject.toJSONString(response)); log.info("**********单条发送出参*******:{}", JSONObject.toJSONString(response));
return response; return response;
} }
} }
...@@ -9,7 +9,6 @@ public class DmHubSendResponse implements Serializable { ...@@ -9,7 +9,6 @@ public class DmHubSendResponse implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String code; private String code;
private String msg;
public DmHubSendResponse() { public DmHubSendResponse() {
...@@ -17,12 +16,10 @@ public class DmHubSendResponse implements Serializable { ...@@ -17,12 +16,10 @@ public class DmHubSendResponse implements Serializable {
public DmHubSendResponse(String code, String msg) { public DmHubSendResponse(String code, String msg) {
this.code = code; this.code = code;
this.msg = msg;
} }
public DmHubSendResponse(ResponseCode responseCode) { public DmHubSendResponse(ResponseCode responseCode) {
this.code = responseCode.getCode(); this.code = responseCode.getCode();
this.msg = responseCode.getMsg();
} }
public String getCode() { public String getCode() {
...@@ -33,19 +30,11 @@ public class DmHubSendResponse implements Serializable { ...@@ -33,19 +30,11 @@ public class DmHubSendResponse implements Serializable {
this.code = code; this.code = code;
} }
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
@Override @Override
public String toString() { public String toString() {
return "DmHubSendResponse{" + return "DmHubSendResponse{" +
"code='" + code + '\'' + "code='" + code + '\'' +
", msg='" + msg + '\'' +
'}'; '}';
} }
} }
...@@ -10,23 +10,19 @@ public class DmHubTemplateResponse implements Serializable { ...@@ -10,23 +10,19 @@ public class DmHubTemplateResponse implements Serializable {
private String code; private String code;
private String msg;
public DmHubTemplateResponse() { public DmHubTemplateResponse() {
} }
public DmHubTemplateResponse(String code, String msg) { public DmHubTemplateResponse(String code, String msg) {
this.code = code; this.code = code;
this.msg = msg;
} }
public DmHubTemplateResponse(ResponseCode responseCode) { public DmHubTemplateResponse(ResponseCode responseCode) {
this.code = responseCode.getCode(); this.code = responseCode.getCode();
this.msg = responseCode.getMsg();
} }
public String getCode() { public String getCode() {
return code; return code;
} }
...@@ -34,12 +30,4 @@ public class DmHubTemplateResponse implements Serializable { ...@@ -34,12 +30,4 @@ public class DmHubTemplateResponse implements Serializable {
public void setCode(String code) { public void setCode(String code) {
this.code = code; this.code = code;
} }
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
} }
...@@ -2,7 +2,7 @@ package com.bgy.sms.config; ...@@ -2,7 +2,7 @@ package com.bgy.sms.config;
public enum ResponseCode { public enum ResponseCode {
// 系统判断错误 // 系统判断错误
SUCCESS("200", "处理成功"), SUCCESS("SUCCESS", "处理成功"),
UNKNOWN_TEMPLATE_TYPE("500", "未知模板类型"), UNKNOWN_TEMPLATE_TYPE("500", "未知模板类型"),
TEMPLATE_ALREADY_EXISTED("500", "DM Hub模板ID冲突"), TEMPLATE_ALREADY_EXISTED("500", "DM Hub模板ID冲突"),
SYSTEM_ERROR("99", "系统异常:"), SYSTEM_ERROR("99", "系统异常:"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment