提交 0c9cebe2 编写于 作者: rushui.chen's avatar rushui.chen

20191022 Test类组装数据

上级 a1b4e753
流水线 #16124 已失败 于阶段
in 1 second
...@@ -5,80 +5,101 @@ import com.pica.cloud.account.account.server.entity.Doctor; ...@@ -5,80 +5,101 @@ import com.pica.cloud.account.account.server.entity.Doctor;
import com.pica.cloud.account.account.server.entity.EncryptEntity; import com.pica.cloud.account.account.server.entity.EncryptEntity;
import com.pica.cloud.account.account.server.req.BaseRequest; import com.pica.cloud.account.account.server.req.BaseRequest;
import com.pica.cloud.account.account.server.req.PatientReq; import com.pica.cloud.account.account.server.req.PatientReq;
import com.pica.cloud.account.account.server.util.AESUtil;
import com.pica.cloud.account.account.server.util.RSAUtil;
public class Test { public class Test {
public static void main(String[] args) { public static void main(String[] args) throws Exception {
// String json="{\"key\":\"密钥\",\"content\": {\"mobilePhone\" : \"1302412588\", \"flag\": \"1\"}}\n" + // String json="{\"key\":\"密钥\",\"content\": {\"mobilePhone\" : \"1302412588\", \"flag\": \"1\"}}\n" +
// " }"; // " }";
//获取验证码参数 //获取验证码参数
BaseRequest request = new BaseRequest(); // BaseRequest request = new BaseRequest();
request.setFlag(1); // request.setFlag(1);
request.setMobile("13024112588"); // request.setMobile("13024112588");
String string = JSONObject.toJSONString(request); // String string = JSONObject.toJSONString(request);
System.out.println(string); // System.out.println(string);
EncryptEntity encryptEntity = new EncryptEntity(); // EncryptEntity encryptEntity = new EncryptEntity();
encryptEntity.setContent(string); // encryptEntity.setContent(string);
System.out.println(JSONObject.toJSONString(encryptEntity)); // System.out.println(JSONObject.toJSONString(encryptEntity));
System.out.println("------------------------------>"); // System.out.println("------------------------------>");
//获取注册参数 //获取注册参数
BaseRequest register = null; // BaseRequest register = null;
register = new BaseRequest(); // register = new BaseRequest();
register.setMobile("13024112588"); // register.setMobile("13024112588");
register.setPassword("qq123456"); // register.setPassword("qq123456");
register.setAuthCode("111111"); // register.setAuthCode("111111");
String registerString = JSONObject.toJSONString(register); // String registerString = JSONObject.toJSONString(register);
System.out.println(registerString); // System.out.println(registerString);
EncryptEntity registerEncryptEntity = new EncryptEntity(); // EncryptEntity registerEncryptEntity = new EncryptEntity();
registerEncryptEntity.setContent(registerString); // registerEncryptEntity.setContent(registerString);
System.out.println(JSONObject.toJSONString(registerEncryptEntity)); // System.out.println(JSONObject.toJSONString(registerEncryptEntity));
System.out.println("------------------------------>"); // System.out.println("------------------------------>");
//
//修改用户信息接口 // //修改用户信息接口
PatientReq req=new PatientReq(); // PatientReq req=new PatientReq();
req.setAddress("测试数据"); // req.setAddress("测试数据");
req.setEmail("2586622608@qq.com"); // req.setEmail("2586622608@qq.com");
req.setTelephone("座机号码"); // req.setTelephone("座机号码");
String json = JSONObject.toJSONString(req); // String json = JSONObject.toJSONString(req);
System.out.println(json); // System.out.println(json);
EncryptEntity patientReqEncryptEntity = new EncryptEntity(); // EncryptEntity patientReqEncryptEntity = new EncryptEntity();
patientReqEncryptEntity.setContent(json); // patientReqEncryptEntity.setContent(json);
System.out.println(JSONObject.toJSONString(patientReqEncryptEntity)); // System.out.println(JSONObject.toJSONString(patientReqEncryptEntity));
Doctor doctor = new Doctor(); // Doctor doctor = new Doctor();
doctor.setName("crs"); // doctor.setName("crs");
doctor.setMobilePhone("13024112222"); // doctor.setMobilePhone("13024112222");
doctor.setPassword("qq123456"); // doctor.setPassword("qq123456");
doctor.setCard("412702195468146814821"); // doctor.setCard("412702195468146814821");
doctor.setCityName("上海市"); // doctor.setCityName("上海市");
String doctorJson = JSONObject.toJSONString(doctor); // String doctorJson = JSONObject.toJSONString(doctor);
System.out.println(doctorJson); // System.out.println(doctorJson);
// String mobile = jsonObject.getString("mobile"); // String mobile = jsonObject.getString("mobile");
// String authCode = jsonObject.getString("authCode"); // String authCode = jsonObject.getString("authCode");
// String password = jsonObject.getString("password"); // String password = jsonObject.getString("password");
JSONObject jsonObject = new JSONObject(); // JSONObject jsonObject = new JSONObject();
jsonObject.put("mobile","13024112565"); // jsonObject.put("mobile","13024112565");
jsonObject.put("authCode","13024112565"); // jsonObject.put("authCode","13024112565");
jsonObject.put("password","qq123456"); // jsonObject.put("password","qq123456");
System.out.println(jsonObject.toJSONString()); // System.out.println(jsonObject.toJSONString());
System.out.println("--------------------》"); // System.out.println("--------------------》");
//
//
EncryptEntity encryptEntity1 = new EncryptEntity(); // EncryptEntity encryptEntity1 = new EncryptEntity();
encryptEntity1.setContent("content"); // encryptEntity1.setContent("content");
encryptEntity1.setKey("awgvsfgwgv"); // encryptEntity1.setKey("awgvsfgwgv");
String encryptEntity1Json = JSONObject.toJSONString(encryptEntity1); // String encryptEntity1Json = JSONObject.toJSONString(encryptEntity1);
System.out.println(encryptEntity1Json); // System.out.println(encryptEntity1Json);
System.out.println("--------------------登录接口-------------");
String publicKey="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCa6j3SJwXr/pLLwb6Pq8pi9StPq+Wvm6vu+LWQB1hNqClWk0jQm5GnF6Kj0ac2gqgsMsutc3hhMaaX2QZvLX+gFQHC/ufGBdBbpPtDeGWsQItsMf/xqqlkLPkc7eVTyfsmrpQM7BG9LVvaPVXPVUcZfJNBaYuR4+Sf6Zi2ayI/hQIDAQAB";
BaseRequest login = new BaseRequest();
login.setMobile("13024112062");
login.setPassword("D0DCBF0D12A6B1E7FBFA2CE5848F3EFF");
String con = JSONObject.toJSONString(login);
String contentResult = AESUtil.aesEncrypt(con, "YCPQPx4qpQjEjDea");
String keyResult = RSAUtil.encrypt("YCPQPx4qpQjEjDea",publicKey);
EncryptEntity encryptTest = new EncryptEntity();
encryptTest.setContent(contentResult);
encryptTest.setKey(keyResult);
System.out.println(JSONObject.toJSONString(encryptTest));
System.out.println("--------------------修改密码接口-------------");
BaseRequest changePwd = new BaseRequest();
changePwd.setOldPwd("D0DCBF0D12A6B1E7FBFA2CE5848F3EFF");
changePwd.setPassword("0B9A75D6A88721A4BCF94F0FD668C56B");
String changePwdStr = JSONObject.toJSONString(changePwd);
String contentResult1 = AESUtil.aesEncrypt(changePwdStr, "YCPQPx4qpQjEjDea");
String keyResult1 = RSAUtil.encrypt("YCPQPx4qpQjEjDea",publicKey);
EncryptEntity encryptTest1 = new EncryptEntity();
encryptTest1.setContent(contentResult1);
encryptTest1.setKey(keyResult1);
System.out.println(JSONObject.toJSONString(encryptTest1));
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册