kt http upload

back_recharge
wangyuan 2019-07-05 18:18:31 +08:00
parent 50f3127f01
commit 1108c04935
7 changed files with 33 additions and 16 deletions

View File

@ -1,7 +1,8 @@
package com.ljsd.jieling.config.json;
public class KTSDKConstans {
public static String appid = "129213";
public static String appid = "jl_test";
public static String appkey = "c0fb59eb68559b6c9c1463e4d5d0c806";
public static String md5Key = "0A008C48E74E8A399F1F80DBED71161C";
public static String appsecret = "d53b3e8ef74bf72d8aafce3a1c8671a0";
}

View File

@ -32,7 +32,7 @@ public class DataMessageUtils {
e.printStackTrace();
}
}
KTSendBody sendBody = new KTSendBody(gson.toJson(sendDataList));
// HttpPool.sendPost(sendUrl,gson.toJson(sendBody));
KTSendBody sendBody = new KTSendBody(sendDataList);
HttpPool.sendPost(sendUrl,gson.toJson(sendBody));
}
}

View File

@ -3,20 +3,32 @@ package com.ljsd.jieling.ktbeans;
import com.ljsd.jieling.config.json.KTSDKConstans;
import com.ljsd.jieling.util.MD5Util;
import java.util.List;
public class KTSendBody {
private String gid = KTSDKConstans.appid;
private String gid;
private int time;
private String sign;
private String jsonStrs;
private List<Object> jsonStrs;
public KTSendBody(){
}
public KTSendBody(String jsonStrs){
public KTSendBody(List<Object> ktParamList){
gid = KTSDKConstans.appid;
time = (int)(System.currentTimeMillis()/1000);
this.sign = MD5Util.encrypByMd5(gid + time);
this.jsonStrs = jsonStrs;
String signStr = KTSDKConstans.md5Key + gid + time;
this.sign = MD5Util.encrypByMd5(signStr);
this.jsonStrs = ktParamList;
}
public static void main(String[] args) {
System.out.println( MD5Util.encrypByMd5(KTSDKConstans.md5Key+KTSDKConstans.appid + 1562318111));
}

View File

@ -1,5 +1,7 @@
package com.ljsd.jieling.ktbeans.parmsBean;
import com.ljsd.GameApplication;
import com.ljsd.jieling.config.json.KTSDKConstans;
import com.ljsd.jieling.ktbeans.KTRequestBeans.LoginParamType;
/**
@ -83,12 +85,12 @@ public class ParamDataBean {
}
public ParamDataBean(){
this.app_id_s="game_skuld_01";
this.app_id_s= KTSDKConstans.appid;
this.category_s=LoginParamType.DATA_CATEGORY_ROLE;
this.platform_s= LoginParamType.PLATFORM_ANDRIOD;
this.region_s="1";
this.server_s="44";
this.channel_s="";
this.server_s= String.valueOf(GameApplication.serverId);
this.channel_s="pc";
this.data_unix=(int)(System.currentTimeMillis()/1000L);
}
}

View File

@ -266,7 +266,7 @@ public class MissionLoigc {
if(value.getStars().contains(MapLogic.STAR_1)){
Integer fightId = item.getKey();
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(fightId);
if(sChallengeConfig.getType() == 3 && sChallengeConfig.getDifficultType() == missionSubType[0] && sChallengeConfig.getDifficultType() == missionSubType[1]){
if(sChallengeConfig.getType() == 3 && sChallengeConfig.getDifficultType() == missionSubType[0] && sChallengeConfig.getMapId() == missionSubType[1]){
count++;
}
}

View File

@ -19,8 +19,6 @@ public class MD5Util {
if (i < 16) buf.append("0");
buf.append(Integer.toHexString(i));
}
System.out.println("32result: " + buf.toString());// 32位的加密
System.out.println("16result: " + buf.toString().substring(8, 24));// 16位的加密
return buf.toString().toLowerCase();

View File

@ -1,5 +1,7 @@
package com.ljsd.jieling.util.http;
import com.google.gson.Gson;
import com.ljsd.jieling.ktbeans.KTSendBody;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.config.RequestConfig;
@ -73,8 +75,10 @@ public class HttpPool {
}
public static void main (String [] args){
String send ="{\"gid\":\"129213\",\"time\":1562306610,\"sign\":\"10a518836c856344a00a97f0299b7cb0\",\"jsonStrs\":\"[{\\\"param_environment\\\":{},\\\"param_user\\\":{\\\"account_id_s\\\":\\\"10004165\\\"},\\\"param_role\\\":{\\\"role_id_s\\\":\\\"10004165\\\",\\\"role_name_s\\\":\\\"10004165\\\",\\\"level_i\\\":\\\"1\\\",\\\"vip_level_i\\\":0},\\\"param_event\\\":{\\\"event_s\\\":[\\\"currency_3_l\\\",\\\"source\\\",\\\"15\\\",\\\"19\\\",\\\"1\\\"]}},{\\\"param_environment\\\":{},\\\"param_user\\\":{\\\"account_id_s\\\":\\\"10004165\\\"},\\\"param_role\\\":{\\\"role_id_s\\\":\\\"10004165\\\",\\\"role_name_s\\\":\\\"10004165\\\",\\\"level_i\\\":\\\"1\\\",\\\"vip_level_i\\\":0},\\\"param_event\\\":{\\\"event_s\\\":[\\\"currency_3_l\\\",\\\"source\\\",\\\"15\\\",\\\"1001\\\",\\\"6000\\\"]}},{\\\"param_environment\\\":{},\\\"param_user\\\":{\\\"account_id_s\\\":\\\"10004165\\\"},\\\"param_role\\\":{\\\"role_id_s\\\":\\\"10004165\\\",\\\"role_name_s\\\":\\\"10004165\\\",\\\"level_i\\\":\\\"1\\\",\\\"vip_level_i\\\":0},\\\"param_event\\\":{\\\"event_s\\\":[\\\"currency_3_l\\\",\\\"source\\\",\\\"15\\\",\\\"28\\\",\\\"2\\\"]}},{\\\"param_environment\\\":{},\\\"param_user\\\":{\\\"account_id_s\\\":\\\"10004165\\\"},\\\"param_role\\\":{\\\"role_id_s\\\":\\\"10004165\\\",\\\"role_name_s\\\":\\\"10004165\\\",\\\"level_i\\\":\\\"1\\\",\\\"vip_level_i\\\":0},\\\"param_event\\\":{\\\"event_s\\\":[\\\"currency_3_l\\\",\\\"source\\\",\\\"15\\\",\\\"10046\\\",\\\"1\\\"]}},{\\\"param_environment\\\":{},\\\"param_user\\\":{\\\"account_id_s\\\":\\\"10004165\\\"},\\\"param_role\\\":{\\\"role_id_s\\\":\\\"10004165\\\",\\\"role_name_s\\\":\\\"10004165\\\",\\\"level_i\\\":\\\"1\\\",\\\"vip_level_i\\\":0},\\\"param_event\\\":{\\\"event_s\\\":[\\\"currency_3_l\\\",\\\"source\\\",\\\"29\\\",\\\"27\\\",\\\"3\\\"]}},{\\\"param_environment\\\":{},\\\"param_user\\\":{\\\"account_id_s\\\":\\\"10004165\\\"},\\\"param_role\\\":{\\\"role_id_s\\\":\\\"10004165\\\",\\\"role_name_s\\\":\\\"10004165\\\",\\\"level_i\\\":\\\"1\\\",\\\"vip_level_i\\\":0},\\\"param_event\\\":{\\\"event_s\\\":[\\\"currency_3_l\\\",\\\"source\\\",\\\"29\\\",\\\"44\\\",\\\"10\\\"]}},{\\\"param_environment\\\":{},\\\"param_user\\\":{\\\"account_id_s\\\":\\\"10004165\\\"},\\\"param_role\\\":{\\\"role_id_s\\\":\\\"10004165\\\",\\\"role_name_s\\\":\\\"10004165\\\",\\\"level_i\\\":\\\"1\\\",\\\"vip_level_i\\\":0},\\\"param_event\\\":{\\\"event_s\\\":[\\\"register_0\\\"]}},{\\\"param_environment\\\":{\\\"wifi_b\\\":false},\\\"param_user\\\":{\\\"user_id_s\\\":\\\"24324\\\",\\\"account_id_s\\\":\\\"10004165\\\"},\\\"param_role\\\":{\\\"role_id_s\\\":\\\"10004165\\\",\\\"role_name_s\\\":\\\"10004165\\\",\\\"level_i\\\":\\\"1\\\",\\\"vip_level_i\\\":0},\\\"param_event\\\":{\\\"event_s\\\":[\\\"login_1\\\",\\\"LOGOUT\\\"]}}]\"}";
Gson gson = new Gson();
String send ="{\"gid\":\"jl_test\",\"time\":1562317800,\"sign\":\"cc4c130e9c6ee66a54ed7cc380a9abbd\",\"jsonStrs\":\"[{\\\"param_data\\\":{\\\"app_id_s\\\":\\\"jl_test\\\",\\\"category_s\\\":\\\"event_app\\\",\\\"platform_s\\\":\\\"ADR\\\",\\\"region_s\\\":\\\"4\\\",\\\"server_s\\\":\\\"50215\\\",\\\"channel_s\\\":\\\"pc\\\",\\\"data_unix\\\":1562317800},\\\"param_event\\\":{\\\"event_s\\\":[\\\"online_0_unix_l\\\",\\\"1562317800\\\",\\\"0\\\"]}}]\"}";
init();
sendPost("https://gskuld.receiver.extranet.kt007.com:8081/skuld/game/common/",send);
KTSendBody sendBody = gson.fromJson(send, KTSendBody.class);
sendPost("https://gskuld.receiver.extranet.kt007.com:8081/skuld/game/common/",send);
}
}