Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-cloud-account
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.account
pica-cloud-account
提交
0c9cebe2
提交
0c9cebe2
编写于
10月 22, 2019
作者:
rushui.chen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
20191022 Test类组装数据
上级
a1b4e753
流水线
#16124
已失败 于阶段
in 1 second
变更
1
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
81 行增加
和
60 行删除
+81
-60
Test.java
...main/java/com/pica/cloud/account/account/server/Test.java
+81
-60
未找到文件。
server/src/main/java/com/pica/cloud/account/account/server/Test.java
浏览文件 @
0c9cebe2
...
...
@@ -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.req.BaseRequest
;
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
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
// String json="{\"key\":\"密钥\",\"content\": {\"mobilePhone\" : \"1302412588\", \"flag\": \"1\"}}\n" +
// " }";
//获取验证码参数
BaseRequest
request
=
new
BaseRequest
();
request
.
setFlag
(
1
);
request
.
setMobile
(
"13024112588"
);
String
string
=
JSONObject
.
toJSONString
(
request
);
System
.
out
.
println
(
string
);
EncryptEntity
encryptEntity
=
new
EncryptEntity
();
encryptEntity
.
setContent
(
string
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
encryptEntity
));
System
.
out
.
println
(
"------------------------------>"
);
//
BaseRequest request = new BaseRequest();
//
request.setFlag(1);
//
request.setMobile("13024112588");
//
String string = JSONObject.toJSONString(request);
//
System.out.println(string);
//
EncryptEntity encryptEntity = new EncryptEntity();
//
encryptEntity.setContent(string);
//
System.out.println(JSONObject.toJSONString(encryptEntity));
//
System.out.println("------------------------------>");
//获取注册参数
BaseRequest
register
=
null
;
register
=
new
BaseRequest
();
register
.
setMobile
(
"13024112588"
);
register
.
setPassword
(
"qq123456"
);
register
.
setAuthCode
(
"111111"
);
String
registerString
=
JSONObject
.
toJSONString
(
register
);
System
.
out
.
println
(
registerString
);
EncryptEntity
registerEncryptEntity
=
new
EncryptEntity
();
registerEncryptEntity
.
setContent
(
registerString
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
registerEncryptEntity
));
System
.
out
.
println
(
"------------------------------>"
);
//修改用户信息接口
PatientReq
req
=
new
PatientReq
();
req
.
setAddress
(
"测试数据"
);
req
.
setEmail
(
"2586622608@qq.com"
);
req
.
setTelephone
(
"座机号码"
);
String
json
=
JSONObject
.
toJSONString
(
req
);
System
.
out
.
println
(
json
);
EncryptEntity
patientReqEncryptEntity
=
new
EncryptEntity
();
patientReqEncryptEntity
.
setContent
(
json
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
patientReqEncryptEntity
));
Doctor
doctor
=
new
Doctor
();
doctor
.
setName
(
"crs"
);
doctor
.
setMobilePhone
(
"13024112222"
);
doctor
.
setPassword
(
"qq123456"
);
doctor
.
setCard
(
"412702195468146814821"
);
doctor
.
setCityName
(
"上海市"
);
String
doctorJson
=
JSONObject
.
toJSONString
(
doctor
);
System
.
out
.
println
(
doctorJson
);
//
BaseRequest register = null;
//
register = new BaseRequest();
//
register.setMobile("13024112588");
//
register.setPassword("qq123456");
//
register.setAuthCode("111111");
//
String registerString = JSONObject.toJSONString(register);
//
System.out.println(registerString);
//
EncryptEntity registerEncryptEntity = new EncryptEntity();
//
registerEncryptEntity.setContent(registerString);
//
System.out.println(JSONObject.toJSONString(registerEncryptEntity));
//
System.out.println("------------------------------>");
//
//
//修改用户信息接口
//
PatientReq req=new PatientReq();
//
req.setAddress("测试数据");
//
req.setEmail("2586622608@qq.com");
//
req.setTelephone("座机号码");
//
String json = JSONObject.toJSONString(req);
//
System.out.println(json);
//
EncryptEntity patientReqEncryptEntity = new EncryptEntity();
//
patientReqEncryptEntity.setContent(json);
//
System.out.println(JSONObject.toJSONString(patientReqEncryptEntity));
//
Doctor doctor = new Doctor();
//
doctor.setName("crs");
//
doctor.setMobilePhone("13024112222");
//
doctor.setPassword("qq123456");
//
doctor.setCard("412702195468146814821");
//
doctor.setCityName("上海市");
//
String doctorJson = JSONObject.toJSONString(doctor);
//
System.out.println(doctorJson);
// String mobile = jsonObject.getString("mobile");
// String authCode = jsonObject.getString("authCode");
// String password = jsonObject.getString("password");
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"mobile"
,
"13024112565"
);
jsonObject
.
put
(
"authCode"
,
"13024112565"
);
jsonObject
.
put
(
"password"
,
"qq123456"
);
System
.
out
.
println
(
jsonObject
.
toJSONString
());
System
.
out
.
println
(
"--------------------》"
);
EncryptEntity
encryptEntity1
=
new
EncryptEntity
();
encryptEntity1
.
setContent
(
"content"
);
encryptEntity1
.
setKey
(
"awgvsfgwgv"
);
String
encryptEntity1Json
=
JSONObject
.
toJSONString
(
encryptEntity1
);
System
.
out
.
println
(
encryptEntity1Json
);
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("mobile","13024112565");
// jsonObject.put("authCode","13024112565");
// jsonObject.put("password","qq123456");
// System.out.println(jsonObject.toJSONString());
// System.out.println("--------------------》");
//
//
// EncryptEntity encryptEntity1 = new EncryptEntity();
// encryptEntity1.setContent("content");
// encryptEntity1.setKey("awgvsfgwgv");
// String encryptEntity1Json = JSONObject.toJSONString(encryptEntity1);
// 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
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录