增加西游长尾渠道ios和安卓渠道code转换

master
DESKTOP-C3M45P4\dengdan 2026-03-11 17:30:24 +08:00
parent 349d4f3929
commit 6306f50e36
2 changed files with 65 additions and 6 deletions

View File

@ -1,5 +1,6 @@
package com.ljsd.controller;
import com.ljsd.pojo.XyDcCwChannel;
import com.ljsd.redis.RedisKey;
import com.ljsd.service.*;
import com.ljsd.util.AppConstans;
@ -149,6 +150,21 @@ public class GetUserController extends HttpServlet {
returnErrorToFront(res,response, "openId is empty");
return;
}
//平台类型
String platform = request.getParameter("platform");
if (platform == null || platform.isEmpty()) {
returnErrorToFront(res,response,"platform is empty");
return;
}
//西游冲破长尾渠道需要转换ios的platform为安卓的
if("XY_CHONGPO_CW".equals(channel)){
if(XyDcCwChannel.cwChannelCodeMap.containsKey(platform)){
String code = XyDcCwChannel.cwChannelCodeMap.get(platform);
if(code != null){
platform = code;
}
}
}
try {
String banInfo = BaseGlobal.getInstance().redisApp.get(RedisKey.Ban_Open_Id, openId, String.class, -1);
if (banInfo != null) {
@ -176,12 +192,6 @@ public class GetUserController extends HttpServlet {
return;
}
//平台类型
String platform = request.getParameter("platform");
if (platform == null || platform.isEmpty()) {
returnErrorToFront(res,response,"platform is empty");
return;
}
//平台类型
String admin = request.getParameter("admin");
if(admin == null){
admin = "";;

View File

@ -0,0 +1,49 @@
package com.ljsd.pojo;
import java.util.HashMap;
import java.util.Map;
/**
* ios,ioscode
*/
public class XyDcCwChannel {
public static Map<String, String> cwChannelCodeMap = new HashMap<>();
static{
//初始化西游大臣长尾channelCode映射
cwChannelCodeMap.put("27629","27628");
cwChannelCodeMap.put("27559","27560");
cwChannelCodeMap.put("26594","26593");
cwChannelCodeMap.put("9999","0");
cwChannelCodeMap.put("2473","2472");
cwChannelCodeMap.put("2452","2451");
cwChannelCodeMap.put("2387","2312");
cwChannelCodeMap.put("2343","1544");
cwChannelCodeMap.put("2327","2326");
cwChannelCodeMap.put("2209","2208");
cwChannelCodeMap.put("2156","605");
cwChannelCodeMap.put("2150","2149");
cwChannelCodeMap.put("2147","531");
cwChannelCodeMap.put("2137","1957");
cwChannelCodeMap.put("2131","2130");
cwChannelCodeMap.put("2033","2032");
cwChannelCodeMap.put("1948","1649");
cwChannelCodeMap.put("1936","1935");
cwChannelCodeMap.put("1790","1789");
cwChannelCodeMap.put("1779","1778");
cwChannelCodeMap.put("1662","1661");
cwChannelCodeMap.put("1519","1518");
cwChannelCodeMap.put("1504","1484");
cwChannelCodeMap.put("1493","1492");
cwChannelCodeMap.put("1034","386");
cwChannelCodeMap.put("956","664");
cwChannelCodeMap.put("713","390");
cwChannelCodeMap.put("525","524");
cwChannelCodeMap.put("426","425");
cwChannelCodeMap.put("240","259");
cwChannelCodeMap.put("156","4");
cwChannelCodeMap.put("51","52");
cwChannelCodeMap.put("27647","1964");
}
}