Authored by zhaoyue

Modify to make better

git add --all src/*
git add push.sh
git add pom.xml
git commit -m "Add jar packages"
git commit -m "Modify to make better"
git push origin master
git status
git pull
... ...
... ... @@ -5,9 +5,11 @@ package com.xkl;
*/
public interface Constants {
// String URL_PREFIX = "http://127.0.0.1:8090";
// String URL_PREFIX = "http://127.0.0.1:8090";
// String URL_PREFIX = "http://139.129.166.85:8090";
String URL_PREFIX = "https://www.hanhezy.com:8090/";
String KEY = "weixin";
String KEY_ID = "1";
}
... ...
... ... @@ -27,9 +27,8 @@ public class OpenIdTest {
params.put("password",EncodeTools.encode("MD5","pass1"));
params.put("openId","abcdefghijklmnopqrstuvwxyz123456");
params.put("openIdType","0");
params.put("t",HttpTools.getNow());
params.put("type","1");
params.put("type",Constants.KEY_ID);
params.put("sign",HttpTools.getSign(params));
String response = HttpTools.requestByMap(URL_OPEN_ID,"POST",params);
return response;
... ... @@ -47,7 +46,7 @@ public class OpenIdTest {
params.put("openIdType","0");
params.put("t",HttpTools.getNow());
params.put("type","1");
params.put("type",Constants.KEY_ID);
params.put("sign",HttpTools.getSign(params));
String response = HttpTools.requestByMap(URL_OPEN_ID,"DELETE",params);
System.out.println(response);
... ... @@ -68,7 +67,7 @@ public class OpenIdTest {
params.put("openIdType",openIdType);
params.put("t",HttpTools.getNow());
params.put("type","1");
params.put("type",Constants.KEY_ID);
params.put("sign",HttpTools.getSign(params));
String response = HttpTools.requestByMap(URL_LOGIN,"POST",params);
... ...
... ... @@ -34,7 +34,7 @@ public class ReportTest {
public void testList(){
Map<String,String> params = new HashMap<String, String>();
params.put("t",HttpTools.getNow());
params.put("type","1");
params.put("type",Constants.KEY_ID);
params.put("sign",HttpTools.getSign(params));
String response = HttpTools.requestByMapWithToken(URL_REPORT_LIST,"GET",params,token);
System.out.println(response);
... ... @@ -46,39 +46,25 @@ public class ReportTest {
@Test
public void testDetail(){
Map<String,String> params = new HashMap<String, String>();
params.put("report_id","77");
params.put("report_id","141");
params.put("t",HttpTools.getNow());
params.put("type","1");
params.put("type",Constants.KEY_ID);
params.put("sign",HttpTools.getSign(params));
String response = HttpTools.requestByMapWithToken(URL_REPORT_DETAIL,"GET",params,token);
System.out.println(response);
}
/**
* 健康评分接口
*/
@Test
public void testScore(){
Map<String,String> params = new HashMap<String, String>();
params.put("report_id","77");
params.put("t",HttpTools.getNow());
params.put("type","1");
params.put("sign",HttpTools.getSign(params));
String response = HttpTools.requestByMap(URL_REPORT_SCORE,"GET",params);
System.out.println(response);
}
/**
* 体检报告指标解释查询接口
*/
@Test
public void testItemInfo(){
Map<String,String> params = new HashMap<String, String>();
params.put("itemId","10");
params.put("status","0");
params.put("status","2");
params.put("isPureHtml","false");
params.put("t",HttpTools.getNow());
params.put("type","1");
params.put("type",Constants.KEY_ID);
params.put("sign",HttpTools.getSign(params));
String response = HttpTools.requestByMapWithToken(URL_ITEM_INFO,"GET",params,token);
System.out.println(response);
... ... @@ -94,7 +80,7 @@ public class ReportTest {
params.put("status","1");
params.put("isPureHtml","true");
params.put("t",HttpTools.getNow());
params.put("type","1");
params.put("type",Constants.KEY_ID);
params.put("sign",HttpTools.getSign(params));
String response = HttpTools.requestByMapWithToken(URL_ITEM_INFO,"GET",params,token);
System.out.println(response);
... ... @@ -110,7 +96,7 @@ public class ReportTest {
params.put("stime","2010-01-01 10:32:00");
params.put("etime","2019-12-22 10:32:00");
params.put("t",HttpTools.getNow());
params.put("type","1");
params.put("type",Constants.KEY_ID);
params.put("sign",HttpTools.getSign(params));
String response = HttpTools.requestByMapWithToken(URL_ITEM_GRAPH,"GET",params,token);
System.out.println(response);
... ... @@ -124,7 +110,7 @@ public class ReportTest {
Map<String,String> params = new HashMap<String, String>();
params.put("report_id","77");
params.put("t",HttpTools.getNow());
params.put("type","1");
params.put("type",Constants.KEY_ID);
params.put("sign",HttpTools.getSign(params));
String response = HttpTools.requestByMapWithToken(URL_COMPARE,"POST",params,token);
System.out.println(response);
... ...
... ... @@ -18,7 +18,7 @@ public class TokenTest {
params.put("username",user);
params.put("password",EncodeTools.encode("MD5",pass));
params.put("t",HttpTools.getNow());
params.put("type","1");
params.put("type",Constants.KEY_ID);
params.put("sign",HttpTools.getSign(params));
String response = HttpTools.requestByMap(URL_LOGIN,"POST",params);
System.out.println("response:"+ response);
... ... @@ -43,7 +43,7 @@ public class TokenTest {
String token = loginAndGetToken("user1","pass1");
Map<String,String> params = new HashMap<String, String>();
params.put("t",HttpTools.getNow());
params.put("type","1");
params.put("type",Constants.KEY_ID);
params.put("sign",HttpTools.getSign(params));
String response = HttpTools.requestByMapWithToken(URL_LOGIN,"DELETE",params,token);
System.out.println(response);
... ...
... ... @@ -32,7 +32,7 @@ public class UserInfoTest {
Map<String,String> params = new HashMap<String, String>();
params.put("password",EncodeTools.encode("MD5","pass152_new"));
params.put("t",HttpTools.getNow());
params.put("type","1");
params.put("type",Constants.KEY_ID);
params.put("sign",HttpTools.getSign(params));
//获取token
String token = loginAndGetToken("15211112222","pass152");
... ... @@ -48,7 +48,7 @@ public class UserInfoTest {
public void testGetUserInfo(){
Map<String,String> params = new HashMap<String, String>();
params.put("t",HttpTools.getNow());
params.put("type","1");
params.put("type",Constants.KEY_ID);
params.put("sign",HttpTools.getSign(params));
//获取token
String token = loginAndGetToken("user1","pass1");
... ... @@ -62,7 +62,7 @@ public class UserInfoTest {
params.put("username",user);
params.put("password",EncodeTools.encode("MD5",pass));
params.put("t",HttpTools.getNow());
params.put("type","1");
params.put("type",Constants.KEY_ID);
params.put("sign",HttpTools.getSign(params));
String response = HttpTools.requestByMap(URL_USER,"POST",params);
System.out.println(response);
... ... @@ -77,7 +77,7 @@ public class UserInfoTest {
params.put("username","15211112222");
params.put("password",EncodeTools.encode("MD5","pass152"));
params.put("t",HttpTools.getNow());
params.put("type","1");
params.put("type",Constants.KEY_ID);
params.put("sign","nosign");
String response = HttpTools.requestByMap(URL_USER,"POST",params);
System.out.println(response);
... ... @@ -92,7 +92,7 @@ public class UserInfoTest {
params.put("username","15211112222");
params.put("password",EncodeTools.encode("MD5","pass152"));
params.put("t",HttpTools.getNow()+100000);
params.put("type","1");
params.put("type",Constants.KEY_ID);
params.put("sign",HttpTools.getSign(params));
String response = HttpTools.requestByMap(URL_USER,"POST",params);
System.out.println(response);
... ...
package com.xkl.inneruse;
import com.xkl.Constants;
import com.xkl.HttpTools;
import org.junit.BeforeClass;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
import static com.xkl.TokenTest.loginAndGetToken;
/**
* Created by win7 on 2016/12/26.
* 报告相关
*/
public class ReportTest {
private static final String URL_REPORT_LIST = Constants.URL_PREFIX + "/report/list";
private static final String URL_REPORT_DETAIL = Constants.URL_PREFIX + "/report/detail";
private static final String URL_REPORT_SCORE = Constants.URL_PREFIX + "/report/score";
private static final String URL_ITEM_INFO = Constants.URL_PREFIX + "/report/itemInfo";
private static final String URL_ITEM_GRAPH = Constants.URL_PREFIX + "/report/itemGraph";
private static final String URL_COMPARE = Constants.URL_PREFIX + "/report/compare";
private static String token;
@BeforeClass
public static void init(){
token = loginAndGetToken("user1","pass1");
// String token =OpenIdTest.bindWithOpenIdAndLoginAndGetToken("abcdefghijklmnopqrstuvwxyz123456","0");
}
/**
* 健康评分接口
*/
@Test
public void testScore(){
Map<String,String> params = new HashMap<String, String>();
params.put("report_id","77");
params.put("t",HttpTools.getNow());
params.put("type",Constants.KEY_ID);
params.put("sign",HttpTools.getSign(params));
String response = HttpTools.requestByMap(URL_REPORT_SCORE,"GET",params);
System.out.println(response);
}
}
\ No newline at end of file
... ...
... ... @@ -45,7 +45,7 @@ public class ReportTest {
public void testDelReport() {
String token = loginAndGetToken(Data.ADMIN_ACCOUNT, Data.ADMIN_PWD);
Map<String, String> params = new HashMap<String, String>();
params.put("report_id", "107");
params.put("report_id", "143");
String response = HttpTools.requestByMapWithToken(URL_REPORT, "DELETE", params, token);
System.out.println("delete report:" + response);
}
... ...