软适配 Json 请求适配完成

yun-zuoyi
wei.peng 6 years ago
parent 4bad223c0d
commit bda52f76c6

@ -957,6 +957,78 @@ public class CommonEnumUtil {
} }
} }
/**
* HTTP
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum HTTP_METHOD_TYPE {
GET(1,"GET" ,"GET"),
POST(2, "POST","POST"),
DELETE(3, "DELETE","DELETE"),
PUT(4, "PUT","PUT");
private int value;
private String code;
private String description;
private HTTP_METHOD_TYPE(int value, String code, String description) {
this.value = value;
this.code = code;
this.description = description;
}
public int getValue() {
return value;
}
public String getCode() {
return code;
}
public String getDescription() {
return description;
}
public static String valueOfCode(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].code;
}
}
return tmp;
}
public static int codeOfValue(String code) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].code.equals(code)) {
tmp = values()[i].value;
}
}
return tmp;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
public static String codeOfDescription(String code) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].code.equals(code)) {
tmp = values()[i].description;
}
}
return tmp;
}
}
// 数据有效的静态常量 // 数据有效的静态常量

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.model.softswitch; package cn.estsh.i3plus.pojo.model.softswitch;
import cn.estsh.i3plus.pojo.base.annotation.XStreamCDATA;
import com.thoughtworks.xstream.annotations.XStreamAlias; import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute; import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamImplicit; import com.thoughtworks.xstream.annotations.XStreamImplicit;
@ -31,7 +32,14 @@ public class PojoAuth{
private String userName ="登录名称"; private String userName ="登录名称";
private String password ="登录名称"; private String password ="登录名称";
private String languageCode ="登录名称"; private String languageCode ="登录名称";
private String token ="登录名称";
// 认证令牌
private String token;
// // 认证令牌集合(复杂认证令牌)
// private List<Prop> tokenList;
// 原始认证数据
@XStreamCDATA
private String result;
public PojoAuth(Long id, Integer authType,String authPath, List<Prop> params) { public PojoAuth(Long id, Integer authType,String authPath, List<Prop> params) {
this.id = id; this.id = id;

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.model.softswitch; package cn.estsh.i3plus.pojo.model.softswitch;
import cn.estsh.i3plus.pojo.base.annotation.XStreamCDATA;
import com.thoughtworks.xstream.annotations.XStreamAlias; import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute; import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import lombok.Data; import lombok.Data;
@ -21,6 +22,9 @@ public class Request{
private Integer requestType; private Integer requestType;
private String requestPath; private String requestPath;
@XStreamCDATA
private String result;
public Request(Long id, Integer requestType,String requestPath) { public Request(Long id, Integer requestType,String requestPath) {
this.id = id; this.id = id;
this.requestType = requestType; this.requestType = requestType;

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.model.softswitch; package cn.estsh.i3plus.pojo.model.softswitch;
import cn.estsh.i3plus.pojo.base.annotation.XStreamCDATA;
import com.thoughtworks.xstream.annotations.XStreamAlias; import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute; import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import lombok.Data; import lombok.Data;
@ -13,22 +14,26 @@ import lombok.Data;
**/ **/
@Data @Data
@XStreamAlias("model") @XStreamAlias("model")
public class XmlModel { public class SuitCoreModel {
@XStreamAsAttribute @XStreamAsAttribute
private Long id; private Long id;
@XStreamAsAttribute @XStreamAsAttribute
private Integer caseType; private Integer caseType;
private String suitCaseStatus; private String suitCaseStatusCode;
private String suitCaseMessage;
private String key; private String key;
private PojoAuth auth; private PojoAuth auth;
private Request request; private Request request;
public XmlModel(Long id, Integer caseType,String suitCaseStatus, String key, PojoAuth auth,Request request) { @XStreamCDATA
private String responseResult;
public SuitCoreModel(Long id, Integer caseType, String suitCaseStatusCode, String key, PojoAuth auth, Request request) {
this.id = id; this.id = id;
this.caseType = caseType; this.caseType = caseType;
this.suitCaseStatus = suitCaseStatus; this.suitCaseStatusCode = suitCaseStatusCode;
this.key = key; this.key = key;
this.auth = auth; this.auth = auth;
this.request = request; this.request = request;

@ -36,7 +36,7 @@ public class SoftswitchHqlPack {
StringBuffer result = new StringBuffer(); StringBuffer result = new StringBuffer();
// 查询参数封装 // 查询参数封装
HqlPack.getStringLikerPack(testDataBase.getName(),"name",result); // HqlPack.getStringLikerPack(testDataBase.getName(),"name",result);
return result.toString(); return result.toString();
} }

Loading…
Cancel
Save