generated from root/miduo_server
用户查询,充值发货,发送奖励
parent
286b12942d
commit
bd378026ea
|
@ -1,5 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="Spring" name="Spring">
|
||||
<configuration />
|
||||
</facet>
|
||||
<facet type="web" name="Web">
|
||||
<configuration>
|
||||
<webroots />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
|
@ -54,7 +64,7 @@
|
|||
<orderEntry type="library" name="Maven: net.jpountz.lz4:lz4:1.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.resource:connector-api:1.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-io:commons-io:1.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.thrift:libthrift:0.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.10" level="project" />
|
||||
|
@ -66,5 +76,12 @@
|
|||
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.sf.ezmorph:ezmorph:1.0.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.json:json:20150729" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:1.5.2.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:1.8.7.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:1.2.7.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:4.3.11.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:4.3.11.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: redis.clients:jedis:2.9.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.2.4" level="project" />
|
||||
</component>
|
||||
</module>
|
|
@ -0,0 +1,86 @@
|
|||
package com.jmfy.controller;
|
||||
|
||||
import com.jmfy.dto.CPayOrder;
|
||||
import com.jmfy.dto.CUserDao;
|
||||
import com.jmfy.dto.CUserInfo;
|
||||
import com.jmfy.dto.ResultVo;
|
||||
import com.jmfy.thrift.idl.RPCRequestIFace;
|
||||
import com.jmfy.thrift.pool.ClientAdapterPo;
|
||||
import com.jmfy.thrift.pool.ServiceKey;
|
||||
import com.jmfy.util.JsonUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.net.URLDecoder;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class GetOrderController {
|
||||
@Resource
|
||||
private CUserDao cuserDao;
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(GetOrderController.class);
|
||||
@RequestMapping(value = "/getorder")
|
||||
public String deliveryGoods(HttpServletRequest request) {
|
||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
||||
String date = parameterMap.get("date");
|
||||
String agoDate = JsonUtil.getSpecifiedDayBefore(date);
|
||||
LOGGER.info("GetOrderController==>date={},agoDate={}",date,agoDate);
|
||||
List<CPayOrder> orderInfoBydate = cuserDao.getOrderInfoBydate(agoDate);
|
||||
StringBuilder result = new StringBuilder();
|
||||
for (CPayOrder cPayOrder :orderInfoBydate){
|
||||
if (result.length() == 0){
|
||||
result = new StringBuilder()
|
||||
.append(cPayOrder.getDelivery_time())
|
||||
.append("|")
|
||||
.append(cPayOrder.getServerId())
|
||||
.append("|")
|
||||
.append(cPayOrder.getUserId())
|
||||
.append("|")
|
||||
.append(cPayOrder.getOrderId())
|
||||
.append("|")
|
||||
.append(cPayOrder.getCpOrderId())
|
||||
.append("|")
|
||||
.append(cPayOrder.getCurrency())
|
||||
.append("|")
|
||||
.append(cPayOrder.getAmount())
|
||||
.append("|")
|
||||
.append(cPayOrder.getGameCurrency())
|
||||
.append("|")
|
||||
.append(cPayOrder.getPayType())
|
||||
.append("|")
|
||||
.append(cPayOrder.getCreditId());
|
||||
}else{
|
||||
result.append( "\r\n")
|
||||
.append(cPayOrder.getDelivery_time())
|
||||
.append("|")
|
||||
.append(cPayOrder.getServerId())
|
||||
.append("|")
|
||||
.append(cPayOrder.getUserId())
|
||||
.append("|")
|
||||
.append(cPayOrder.getOrderId())
|
||||
.append("|")
|
||||
.append(cPayOrder.getCpOrderId())
|
||||
.append("|")
|
||||
.append(cPayOrder.getCurrency())
|
||||
.append("|")
|
||||
.append(cPayOrder.getAmount())
|
||||
.append("|")
|
||||
.append(cPayOrder.getGameCurrency())
|
||||
.append("|")
|
||||
.append(cPayOrder.getPayType())
|
||||
.append("|")
|
||||
.append(cPayOrder.getCreditId());
|
||||
}
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
package com.jmfy.controller;
|
||||
|
||||
import com.jmfy.dto.FindPlayerResult;
|
||||
import com.jmfy.dto.JsonResult;
|
||||
import com.jmfy.dto.PlayerInfo;
|
||||
import com.jmfy.util.JsonUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class HealthController {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(HealthController.class);
|
||||
@RequestMapping(value = "/health")
|
||||
public String deliveryGoods(HttpServletRequest request){
|
||||
JsonResult jsonResult = new JsonResult();
|
||||
jsonResult.setRet(1000);
|
||||
jsonResult.setMsg("ok");
|
||||
LOGGER.info("======> end midas request...");
|
||||
|
||||
List<PlayerInfo> playerInfos = new ArrayList<>();
|
||||
playerInfos.add(new PlayerInfo("阿斯蒂芬",12,"1000001","1"));
|
||||
|
||||
FindPlayerResult findPlayerResult = new FindPlayerResult("1000","success",playerInfos);
|
||||
|
||||
String result = JsonUtil.getInstence().getGson().toJson(findPlayerResult);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
|
@ -6,6 +6,7 @@ import com.jmfy.thrift.idl.RPCRequestIFace;
|
|||
import com.jmfy.thrift.idl.Result;
|
||||
import com.jmfy.thrift.pool.ClientAdapterPo;
|
||||
import com.jmfy.thrift.pool.ServiceKey;
|
||||
import com.jmfy.util.JsonUtil;
|
||||
import com.jmfy.util.YsjConstant;
|
||||
import com.jmfy.util.tencentutil.SnsSigCheck;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -28,15 +29,7 @@ public class IAPManagerController {
|
|||
public JsonResult deliveryGoods(HttpServletRequest request){
|
||||
try {
|
||||
LOGGER.info("======>iap start midas request...");
|
||||
HashMap<String, String> map = new HashMap();
|
||||
Enumeration paramNames = request.getParameterNames();
|
||||
while (paramNames.hasMoreElements()) {
|
||||
String paramName = (String) paramNames.nextElement();
|
||||
String[] paramValues = request.getParameterValues(paramName);
|
||||
String paramValue = paramValues[0];
|
||||
map.put(paramName, paramValue);
|
||||
LOGGER.info("parameter : " + paramName + "=" + paramValue);
|
||||
}
|
||||
HashMap<String, String> map = JsonUtil.getInstence().getParameterMap(request);
|
||||
|
||||
String sig = map.get("sig");
|
||||
String[] serverParam = map.get("channel_id").split("-");
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.jmfy.thrift.idl.RPCRequestIFace;
|
|||
import com.jmfy.thrift.idl.Result;
|
||||
import com.jmfy.thrift.pool.ClientAdapterPo;
|
||||
import com.jmfy.thrift.pool.ServiceKey;
|
||||
import com.jmfy.util.JsonUtil;
|
||||
import com.jmfy.util.YsjConstant;
|
||||
import com.jmfy.util.tencentutil.SnsSigCheck;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -28,15 +29,7 @@ public class ManagerController {
|
|||
public JsonResult deliveryGoods(HttpServletRequest request){
|
||||
try {
|
||||
LOGGER.info("======> start midas request...");
|
||||
HashMap<String, String> map = new HashMap();
|
||||
Enumeration paramNames = request.getParameterNames();
|
||||
while (paramNames.hasMoreElements()) {
|
||||
String paramName = (String) paramNames.nextElement();
|
||||
String[] paramValues = request.getParameterValues(paramName);
|
||||
String paramValue = paramValues[0];
|
||||
map.put(paramName, paramValue);
|
||||
LOGGER.info("parameter : " + paramName + "=" + paramValue);
|
||||
}
|
||||
HashMap<String, String> map = JsonUtil.getInstence().getParameterMap(request);
|
||||
|
||||
// String app_metadata = new StringBuffer()
|
||||
// // ios 0/android 1
|
||||
|
|
|
@ -0,0 +1,96 @@
|
|||
package com.jmfy.controller;
|
||||
|
||||
import com.jmfy.dto.*;
|
||||
import com.jmfy.thrift.idl.RPCRequestIFace;
|
||||
import com.jmfy.thrift.idl.Result;
|
||||
import com.jmfy.thrift.pool.ClientAdapterPo;
|
||||
import com.jmfy.thrift.pool.ServiceKey;
|
||||
import com.jmfy.util.JsonUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
@RestController
|
||||
public class RechargeController {
|
||||
@Resource
|
||||
private CUserDao cuserDao;
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(RechargeController.class);
|
||||
@RequestMapping(value = "/recharge")
|
||||
public String deliveryGoods(HttpServletRequest request) throws Exception {
|
||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
||||
String pOrderId = parameterMap.get("pOrderId");
|
||||
String userId = parameterMap.get("userId");
|
||||
String creditId = parameterMap.get("creditId");
|
||||
String currency = parameterMap.get("currency");
|
||||
String amount = parameterMap.get("amount");
|
||||
String rCurrency = parameterMap.get("RCurrency");
|
||||
String rAmount = parameterMap.get("RAmount");
|
||||
String gameCode = parameterMap.get("gameCode");
|
||||
String serverCode = parameterMap.get("serverCode");
|
||||
String stone = parameterMap.get("stone");
|
||||
String stoneType = parameterMap.get("stoneType");
|
||||
String activityExtra = parameterMap.get("activityExtra");
|
||||
String sign = parameterMap.get("sign");
|
||||
String time = parameterMap.get("time");
|
||||
String remark = parameterMap.get("remark");
|
||||
String productId = parameterMap.get("productId");
|
||||
String payType = parameterMap.get("payType");
|
||||
CUserInfo cUserInfo = cuserDao.getUserInfobyNameAndServerId(userId, Integer.parseInt(serverCode));
|
||||
if (Integer.parseInt(userId) != cUserInfo.getUserId()){
|
||||
ResultVo resultVo = new ResultVo("1038", "该用户无此角色");
|
||||
return JsonUtil.getInstence().getGson().toJson(resultVo);
|
||||
}
|
||||
String payitem = "1002#"+activityExtra + stone +"#1";
|
||||
// DateFormat dateTimeformat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
||||
// String date = dateTimeformat.format(new Date());
|
||||
// CPayOrder cPayOrder = new CPayOrder();
|
||||
// cPayOrder.setOrderId(pOrderId);
|
||||
// cPayOrder.setDelivery_time(date);
|
||||
// cPayOrder.setUserId(userId);
|
||||
// cPayOrder.setCpOrderId(remark);
|
||||
// cPayOrder.setCurrency(currency);
|
||||
// cPayOrder.setAmount(amount);
|
||||
// cPayOrder.setGameCurrency(stone);
|
||||
// cPayOrder.setPayType(payType);
|
||||
// cPayOrder.setCreditId(creditId);
|
||||
// cuserDao.get
|
||||
Result result = null;
|
||||
String userAddress = cuserDao.findUserInfo(Integer.parseInt(serverCode), Integer.parseInt(userId));
|
||||
LOGGER.info("userAddress : " + userAddress);
|
||||
if (userAddress != null) {
|
||||
String[] split = userAddress.split(":");
|
||||
String ip = split[0];
|
||||
String port = split[1];
|
||||
LOGGER.info("RPC address --> IP : " + ip + "; PORT : " + port);
|
||||
ClientAdapterPo<RPCRequestIFace.Client> rPCClient;
|
||||
String serviceKey = JsonUtil.getServiceKey(ServiceKey.RPCCore, ip, port);
|
||||
LOGGER.info("serviceKey : " + serviceKey);
|
||||
try {
|
||||
rPCClient = ClientAdapterPo.getClientAdapterPo(serviceKey);
|
||||
result = rPCClient.getClient().sendReward(Integer.parseInt(userId), payitem,"","",0);//0 充值 1: 邮件奖励
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
LOGGER.info("RPC result : ResultCode : "+ result.getResultCode()+"; ResultMsg : "+ result.getResultMsg());
|
||||
ResultVo resultVo;
|
||||
if (result.getResultCode() != 0){
|
||||
resultVo = new ResultVo("0000", "发币成功");
|
||||
}else{
|
||||
resultVo = new ResultVo("1008", "发币失败");
|
||||
}
|
||||
return JsonUtil.getInstence().getGson().toJson(resultVo);
|
||||
}
|
||||
public static void main (String [] args){
|
||||
DateFormat dateTimeformat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String format = dateTimeformat.format(new Date());
|
||||
System.out.println(format);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
package com.jmfy.controller;
|
||||
|
||||
import com.jmfy.dto.*;
|
||||
import com.jmfy.thrift.idl.RPCRequestIFace;
|
||||
import com.jmfy.thrift.idl.Result;
|
||||
import com.jmfy.thrift.pool.ClientAdapterPo;
|
||||
import com.jmfy.thrift.pool.ServiceKey;
|
||||
import com.jmfy.util.JsonUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class SendMailController {
|
||||
@Resource
|
||||
private CUserDao cuserDao;
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SendMailController.class);
|
||||
@RequestMapping(value = "/efun_reward")
|
||||
public String deliveryGoods(HttpServletRequest request) throws Exception {
|
||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
||||
String userId = parameterMap.get("userId");
|
||||
String roleId = parameterMap.get("roleId");
|
||||
String serialNo = parameterMap.get("serialNo");
|
||||
String gameCode = parameterMap.get("gameCode");
|
||||
String serverCode = parameterMap.get("serverCode");
|
||||
String packageId = parameterMap.get("packageId");
|
||||
String activityCode = parameterMap.get("activityCode");
|
||||
String title = parameterMap.get("title");
|
||||
String content = parameterMap.get("content");
|
||||
LOGGER.info("SendMailController=>userId={},roleId={},serialNo={},gameCode={},serverCode={},packageId={},activityCode={},title={},content={}",
|
||||
userId,roleId, serialNo,gameCode,serverCode,packageId,activityCode,title,content);
|
||||
//Md5(userId+roleId+serverCode+gameCode+serialNo+packageId+key)发奖key 由efun提供
|
||||
String sign = parameterMap.get("sign");
|
||||
CUserInfo cUserInfo = cuserDao.getUserInfobyNameAndServerId(userId, Integer.parseInt(serverCode));
|
||||
if (Integer.parseInt(roleId) != cUserInfo.getUserId()){
|
||||
ResultVo resultVo = new ResultVo("1038", "该用户无此角色");
|
||||
return JsonUtil.getInstence().getGson().toJson(resultVo);
|
||||
}
|
||||
String rewardItems = packageId.replaceAll(",","#").replaceAll(";","|");
|
||||
String userAddress = cuserDao.findUserInfo(Integer.parseInt(serverCode), cUserInfo.getUserId());
|
||||
LOGGER.info("userAddress : "+ userAddress);
|
||||
if (userAddress != null){
|
||||
String[] split = userAddress.split(":");
|
||||
String ip = split[0];
|
||||
String port = split[1];
|
||||
LOGGER.info("RPC address --> IP : "+ ip + "; PORT : "+ port);
|
||||
ClientAdapterPo<RPCRequestIFace.Client> rPCClient;
|
||||
String serviceKey = JsonUtil.getServiceKey(ServiceKey.RPCCore,ip,port);
|
||||
LOGGER.info("serviceKey : "+ serviceKey);
|
||||
try {
|
||||
rPCClient = ClientAdapterPo.getClientAdapterPo(serviceKey);
|
||||
rPCClient.getClient().sendReward(cUserInfo.getUserId(), rewardItems,URLDecoder.decode(title, "UTF-8"),URLDecoder.decode(content, "UTF-8"),1);//0 充值 1: 邮件奖励
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
ResultVo resultVo = new ResultVo("0000", "发币成功");
|
||||
return JsonUtil.getInstence().getGson().toJson(resultVo);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package com.jmfy.controller;
|
||||
|
||||
import com.jmfy.dto.*;
|
||||
import com.jmfy.util.JsonUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class UserController {
|
||||
@Resource
|
||||
private CUserDao cuserDao;
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(UserController.class);
|
||||
@RequestMapping(value = "/findUserInfo")
|
||||
public String deliveryGoods(HttpServletRequest request) throws Exception {
|
||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
||||
String userName = parameterMap.get("userId");
|
||||
String serverId = parameterMap.get("serverCode");
|
||||
String sign = parameterMap.get("sign");
|
||||
LOGGER.info("UserController=>userName={},serverId={},sign={}",userName,serverId,sign);
|
||||
CUserInfo cUserInfo = cuserDao.getUserInfobyNameAndServerId(userName, Integer.parseInt(serverId));
|
||||
String result;
|
||||
if (null == cUserInfo){
|
||||
LOGGER.info("UserController=>userName={},serverId={},cUserInfo is null",userName,serverId);
|
||||
FindPlayerResult findPlayerResult = new FindPlayerResult("1038","success",null);
|
||||
result = JsonUtil.getInstence().getGson().toJson(findPlayerResult);
|
||||
}else {
|
||||
List<PlayerInfo> playerInfos = new ArrayList<>();
|
||||
CUser cUser = cuserDao.getCUser(cUserInfo.getUserId(), cUserInfo.getServerid());
|
||||
playerInfos.add(new PlayerInfo(cUser.getUserName(),cUser.getLevel(),String.valueOf(cUser.getId()),serverId));
|
||||
FindPlayerResult findPlayerResult = new FindPlayerResult("1000","success",playerInfos);
|
||||
result = JsonUtil.getInstence().getGson().toJson(findPlayerResult);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
|
@ -10,67 +10,34 @@ import org.springframework.data.mongodb.core.mapping.Field;
|
|||
@Document(collection = "c_pay_order")
|
||||
public class CPayOrder {
|
||||
@Id
|
||||
private String orderId;//orderId
|
||||
|
||||
@Field(value = "openid")
|
||||
private String openid;//用户ID
|
||||
|
||||
@Field(value = "role_id")
|
||||
private String role_id;//角色ID
|
||||
|
||||
@Field(value = "channel")
|
||||
private String channel;//渠道平台
|
||||
|
||||
@Field(value = "sub_channel")
|
||||
private String sub_channel;//平台子渠道
|
||||
|
||||
@Field(value = "plat")
|
||||
private String plat;//设备平台
|
||||
|
||||
@Field(value = "server_id")
|
||||
private String server_id;//所在服务器id
|
||||
|
||||
@Field(value = "role_name")
|
||||
private String role_name;//角色名称
|
||||
|
||||
@Field(value = "pay_time")
|
||||
private String pay_time;//充值时间
|
||||
private String orderId;//充值回调中的pOrderId
|
||||
|
||||
@Field(value = "delivery_time")
|
||||
private String delivery_time;//发货时间
|
||||
|
||||
@Field(value = "role_lv")
|
||||
private String role_lv;//角色当时等级
|
||||
@Field(value = "serverId")
|
||||
private String serverId;// 充值回调中的serverCode
|
||||
|
||||
@Field(value = "money")
|
||||
private String money ;//消费金额
|
||||
@Field(value = "userId")
|
||||
private String userId;//充值回调中的userId
|
||||
|
||||
@Field(value = "pay_channel")
|
||||
private String pay_channel;//充值渠道
|
||||
@Field(value = "cpOrderId")
|
||||
private String cpOrderId;//原厂订单号,通常为google或者ios充值才有,充值回调中的remark
|
||||
|
||||
@Field(value = "channel_orderid")
|
||||
private String channel_orderid;//渠道订单号
|
||||
@Field(value = "currency")
|
||||
private String currency;//币种
|
||||
|
||||
@Field(value = "product_id")
|
||||
private String product_id ;//商品ID
|
||||
@Field(value = "amount")
|
||||
private String amount;// 充值回调中的amount,通常为美金
|
||||
|
||||
@Field(value = "product_num")
|
||||
private String product_num ;//商品num
|
||||
@Field(value = "gameCurrency")
|
||||
private String gameCurrency ;//充值回调中的stone, 不包含赠送部分 游戏币
|
||||
|
||||
@Field(value = "token")
|
||||
private String token ;//作为本次交易的标识,有效期5分钟
|
||||
@Field(value = "payType")
|
||||
private String payType ;//充值类型
|
||||
|
||||
@Field(value = "is_card")
|
||||
private boolean isCard ;//是否是周卡月卡
|
||||
|
||||
@Field(value = "is_done")
|
||||
private String is_done ;//是否完成
|
||||
|
||||
@Field(value = "extras_1")
|
||||
private String extras_1 ;//附加1
|
||||
|
||||
@Field(value = "extras_2")
|
||||
private String extras_2 ;//附加2
|
||||
@Field(value = "creditId")
|
||||
private String creditId ;//充值回调中的creditId
|
||||
|
||||
public String getOrderId() {
|
||||
return orderId;
|
||||
|
@ -80,70 +47,6 @@ public class CPayOrder {
|
|||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getOpenid() {
|
||||
return openid;
|
||||
}
|
||||
|
||||
public void setOpenid(String openid) {
|
||||
this.openid = openid;
|
||||
}
|
||||
|
||||
public String getRole_id() {
|
||||
return role_id;
|
||||
}
|
||||
|
||||
public void setRole_id(String role_id) {
|
||||
this.role_id = role_id;
|
||||
}
|
||||
|
||||
public String getChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
||||
public void setChannel(String channel) {
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
public String getSub_channel() {
|
||||
return sub_channel;
|
||||
}
|
||||
|
||||
public void setSub_channel(String sub_channel) {
|
||||
this.sub_channel = sub_channel;
|
||||
}
|
||||
|
||||
public String getPlat() {
|
||||
return plat;
|
||||
}
|
||||
|
||||
public void setPlat(String plat) {
|
||||
this.plat = plat;
|
||||
}
|
||||
|
||||
public String getServer_id() {
|
||||
return server_id;
|
||||
}
|
||||
|
||||
public void setServer_id(String server_id) {
|
||||
this.server_id = server_id;
|
||||
}
|
||||
|
||||
public String getRole_name() {
|
||||
return role_name;
|
||||
}
|
||||
|
||||
public void setRole_name(String role_name) {
|
||||
this.role_name = role_name;
|
||||
}
|
||||
|
||||
public String getPay_time() {
|
||||
return pay_time;
|
||||
}
|
||||
|
||||
public void setPay_time(String pay_time) {
|
||||
this.pay_time = pay_time;
|
||||
}
|
||||
|
||||
public String getDelivery_time() {
|
||||
return delivery_time;
|
||||
}
|
||||
|
@ -152,91 +55,82 @@ public class CPayOrder {
|
|||
this.delivery_time = delivery_time;
|
||||
}
|
||||
|
||||
public String getRole_lv() {
|
||||
return role_lv;
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setRole_lv(String role_lv) {
|
||||
this.role_lv = role_lv;
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getMoney() {
|
||||
return money;
|
||||
public String getCpOrderId() {
|
||||
return cpOrderId;
|
||||
}
|
||||
|
||||
public void setMoney(String money) {
|
||||
this.money = money;
|
||||
public void setCpOrderId(String cpOrderId) {
|
||||
this.cpOrderId = cpOrderId;
|
||||
}
|
||||
|
||||
public String getPay_channel() {
|
||||
return pay_channel;
|
||||
public String getCurrency() {
|
||||
return currency;
|
||||
}
|
||||
|
||||
public void setPay_channel(String pay_channel) {
|
||||
this.pay_channel = pay_channel;
|
||||
public void setCurrency(String currency) {
|
||||
this.currency = currency;
|
||||
}
|
||||
|
||||
public String getChannel_orderid() {
|
||||
return channel_orderid;
|
||||
public String getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setChannel_orderid(String channel_orderid) {
|
||||
this.channel_orderid = channel_orderid;
|
||||
public void setAmount(String amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public String getProduct_id() {
|
||||
return product_id;
|
||||
public String getGameCurrency() {
|
||||
return gameCurrency;
|
||||
}
|
||||
|
||||
public void setProduct_id(String product_id) {
|
||||
this.product_id = product_id;
|
||||
public void setGameCurrency(String gameCurrency) {
|
||||
this.gameCurrency = gameCurrency;
|
||||
}
|
||||
|
||||
public String getProduct_num() {
|
||||
return product_num;
|
||||
public String getPayType() {
|
||||
return payType;
|
||||
}
|
||||
|
||||
public void setProduct_num(String product_num) {
|
||||
this.product_num = product_num;
|
||||
public void setPayType(String payType) {
|
||||
this.payType = payType;
|
||||
}
|
||||
|
||||
public boolean isCard() {
|
||||
return isCard;
|
||||
public String getCreditId() {
|
||||
return creditId;
|
||||
}
|
||||
|
||||
public void setCard(boolean card) {
|
||||
isCard = card;
|
||||
public void setCreditId(String creditId) {
|
||||
this.creditId = creditId;
|
||||
}
|
||||
|
||||
public String getIs_done() {
|
||||
return is_done;
|
||||
public String getServerId() {
|
||||
return serverId;
|
||||
}
|
||||
|
||||
public void setIs_done(String is_done) {
|
||||
this.is_done = is_done;
|
||||
public void setServerId(String serverId) {
|
||||
this.serverId = serverId;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public String getExtras_1() {
|
||||
return extras_1;
|
||||
}
|
||||
|
||||
public void setExtras_1(String extras_1) {
|
||||
this.extras_1 = extras_1;
|
||||
}
|
||||
|
||||
public String getExtras_2() {
|
||||
return extras_2;
|
||||
}
|
||||
|
||||
public void setExtras_2(String extras_2) {
|
||||
this.extras_2 = extras_2;
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CPayOrder{" +
|
||||
"orderId='" + orderId + '\'' +
|
||||
", delivery_time='" + delivery_time + '\'' +
|
||||
", userId='" + userId + '\'' +
|
||||
", cpOrderId='" + cpOrderId + '\'' +
|
||||
", currency='" + currency + '\'' +
|
||||
", amount='" + amount + '\'' +
|
||||
", gameCurrency='" + gameCurrency + '\'' +
|
||||
", payType='" + payType + '\'' +
|
||||
", creditId='" + creditId + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,648 @@
|
|||
package com.jmfy.dto;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* Created by justin on 14-7-28.
|
||||
* 用户信息实例化
|
||||
* 对应mongodb中的Document
|
||||
*/
|
||||
@Document(collection = "c_user")
|
||||
public class CUser implements java.io.Serializable {
|
||||
@Id
|
||||
private int id;
|
||||
|
||||
@Field(value = "userName")
|
||||
private String userName;
|
||||
|
||||
@Field(value = "sUserId")
|
||||
private int sUserId;//模板id
|
||||
|
||||
@Field(value = "permission")
|
||||
private int permission;
|
||||
/**
|
||||
* 玩家的权限
|
||||
*/
|
||||
|
||||
@Field(value = "level")
|
||||
private int level;//用户等级
|
||||
|
||||
@Field(value = "exp")
|
||||
private int exp;//当前经验
|
||||
|
||||
@Field(value = "vipLevel")
|
||||
private int vipLevel; //用户vip等级
|
||||
|
||||
@Field(value = "img")
|
||||
private String img;//头像
|
||||
|
||||
@Field(value = "createTime")
|
||||
private long createTime; //创建时间
|
||||
|
||||
@Field(value = "lastLoginTime")
|
||||
private long lastLoginTime; //最近一次登录
|
||||
|
||||
@Field(value = "outLineTime")
|
||||
private long outLineTime; //离线时间
|
||||
|
||||
@Field(value = "cumulative_online_time")
|
||||
private long cumulativeOnlineTime; //总累计时间
|
||||
|
||||
|
||||
@Field(value = "curStamina")
|
||||
private int curStamina;//体力
|
||||
|
||||
@Field(value = "maxStamina")
|
||||
private int maxStamina;//体力
|
||||
|
||||
@Field(value = "gold")
|
||||
private int gold;//金币
|
||||
|
||||
@Field(value = "gem")
|
||||
private int gem;//宝石
|
||||
|
||||
@Field(value = "sys_gem")
|
||||
private int sysGem;//宝石
|
||||
|
||||
@Field(value = "honorPoint")
|
||||
private int honorPoint; // 荣誉点
|
||||
|
||||
@Field(value = "mHonorPoint")
|
||||
private int mHonorPoint; // 中级荣誉点
|
||||
|
||||
@Field(value = "hHonorPoint")
|
||||
private int hHonorPoint; // 高级荣誉点
|
||||
|
||||
@Field(value = "friendHeart")
|
||||
private int friendHeart;//友情点
|
||||
|
||||
@Field(value = "banTime")
|
||||
private long banTime;//禁言时间
|
||||
|
||||
@Field(value = "banReason")
|
||||
private String banReason;//禁言原因
|
||||
|
||||
@Field(value = "vip_flush_time")
|
||||
private long vipFlushTime;
|
||||
|
||||
@Field(value = "zero_flush_time")
|
||||
private long zeroFlushTime;
|
||||
|
||||
@Field(value = "systemSetting") // 保存系统设置
|
||||
private String systemSetting;
|
||||
|
||||
@Field(value = "totalForces")
|
||||
private int totalForces; // 总战斗力
|
||||
|
||||
@Field(value = "award_level_set")
|
||||
private Set<Integer> awardLevelSet;
|
||||
|
||||
@Field(value = "area_id")
|
||||
private int areaId;
|
||||
|
||||
@Field(value = "award_stamina_time")
|
||||
private long awardStaminaTime;//获取体力值得最后时间
|
||||
|
||||
@Field(value = "population_upper_limit")
|
||||
private int populationUpperLimit;//关卡人口上限
|
||||
|
||||
@Field(value = "is_first_fail")
|
||||
private int isFirstFail; //0:未触发 1:已触发
|
||||
|
||||
@Field(value = "novice_guide_id")
|
||||
private String noviceGuideId; //新手引导BI记录Id
|
||||
|
||||
@Field(value = "danmu")
|
||||
private String danmu; // 是否显示弹幕 "1" 显示, "0"不显示
|
||||
|
||||
@Field(value = "take_stamina_map")
|
||||
private Map<Integer, Integer> takeStaminaMap = new ConcurrentHashMap<>();
|
||||
|
||||
@Field(value = "captain_id")
|
||||
private String captainId; // 设为队长的英雄id
|
||||
|
||||
@Field(value = "skip_newer")
|
||||
private int skipNewer; // 跳过剧情==1
|
||||
|
||||
@Field(value = "cum_login_time")
|
||||
private int CumLoginTime;
|
||||
|
||||
@Field(value = "draw_daily_time")
|
||||
private int drawDailyTime;//每日抽签累计领取次数
|
||||
|
||||
@Field(value = "draw_daily_state")
|
||||
private int drawDailyState;//每日抽签1可领取 0不可领取
|
||||
|
||||
@Field(value = "is_privilege")
|
||||
private int isPrivilege; //特权登录 0否 1是
|
||||
|
||||
@Field(value = "privilegedLoginTime")
|
||||
private long privilegedLoginTime;
|
||||
|
||||
@Field(value = "recall")
|
||||
private int recall;
|
||||
|
||||
@Field(value = "cumulative_recharge")
|
||||
private int cumulativeRecharge;
|
||||
|
||||
@Field(value = "skinGold")
|
||||
private int skinGold;
|
||||
|
||||
@Field(value = "head")
|
||||
private int head;
|
||||
|
||||
@Field(value = "headFrame")
|
||||
private int headFrame;
|
||||
|
||||
@Field(value = "clientVersion")
|
||||
private String clientVersion;
|
||||
|
||||
@Field(value = "recNoticeTime")
|
||||
private long recNoticeTime;
|
||||
|
||||
@Field(value = "core_address")
|
||||
private String coreAddress;
|
||||
|
||||
@Field(value = "mission")
|
||||
private UserMission mission;
|
||||
|
||||
@Field(value = "firstLogin")
|
||||
private boolean firstLogin;
|
||||
|
||||
@Field(value = "friendTip")
|
||||
private boolean friendTip;
|
||||
|
||||
@Field(value = "qq_vip")
|
||||
private int qq_vip;//0不是会员,1qq会员,2超级会员
|
||||
|
||||
@Field(value = "error_gem")
|
||||
private int errorGem;
|
||||
|
||||
@Field(value = "online")//1在线 0不在线
|
||||
private int online;
|
||||
|
||||
@Field(value = "QQ_Group")//会长绑定QQ群号
|
||||
private String QQGroup;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public int getsUserId() {
|
||||
return sUserId;
|
||||
}
|
||||
|
||||
public void setsUserId(int sUserId) {
|
||||
this.sUserId = sUserId;
|
||||
}
|
||||
|
||||
public int getPermission() {
|
||||
return permission;
|
||||
}
|
||||
|
||||
public void setPermission(int permission) {
|
||||
this.permission = permission;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public int getExp() {
|
||||
return exp;
|
||||
}
|
||||
|
||||
public void setExp(int exp) {
|
||||
this.exp = exp;
|
||||
}
|
||||
|
||||
public int getVipLevel() {
|
||||
return vipLevel;
|
||||
}
|
||||
|
||||
public void setVipLevel(int vipLevel) {
|
||||
this.vipLevel = vipLevel;
|
||||
}
|
||||
|
||||
public String getImg() {
|
||||
return img;
|
||||
}
|
||||
|
||||
public void setImg(String img) {
|
||||
this.img = img;
|
||||
}
|
||||
|
||||
public long getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(long createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public long getLastLoginTime() {
|
||||
return lastLoginTime;
|
||||
}
|
||||
|
||||
public void setLastLoginTime(long lastLoginTime) {
|
||||
this.lastLoginTime = lastLoginTime;
|
||||
}
|
||||
|
||||
public long getOutLineTime() {
|
||||
return outLineTime;
|
||||
}
|
||||
|
||||
public void setOutLineTime(long outLineTime) {
|
||||
this.outLineTime = outLineTime;
|
||||
}
|
||||
|
||||
public long getCumulativeOnlineTime() {
|
||||
return cumulativeOnlineTime;
|
||||
}
|
||||
|
||||
public void setCumulativeOnlineTime(long cumulativeOnlineTime) {
|
||||
this.cumulativeOnlineTime = cumulativeOnlineTime;
|
||||
}
|
||||
|
||||
public int getCurStamina() {
|
||||
return curStamina;
|
||||
}
|
||||
|
||||
public void setCurStamina(int curStamina) {
|
||||
this.curStamina = curStamina;
|
||||
}
|
||||
|
||||
public int getMaxStamina() {
|
||||
return maxStamina;
|
||||
}
|
||||
|
||||
public void setMaxStamina(int maxStamina) {
|
||||
this.maxStamina = maxStamina;
|
||||
}
|
||||
|
||||
public int getGold() {
|
||||
return gold;
|
||||
}
|
||||
|
||||
public void setGold(int gold) {
|
||||
this.gold = gold;
|
||||
}
|
||||
|
||||
public int getGem() {
|
||||
return gem;
|
||||
}
|
||||
|
||||
public void setGem(int gem) {
|
||||
this.gem = gem;
|
||||
}
|
||||
|
||||
public int getSysGem() {
|
||||
return sysGem;
|
||||
}
|
||||
|
||||
public void setSysGem(int sysGem) {
|
||||
this.sysGem = sysGem;
|
||||
}
|
||||
|
||||
public int getHonorPoint() {
|
||||
return honorPoint;
|
||||
}
|
||||
|
||||
public void setHonorPoint(int honorPoint) {
|
||||
this.honorPoint = honorPoint;
|
||||
}
|
||||
|
||||
public int getmHonorPoint() {
|
||||
return mHonorPoint;
|
||||
}
|
||||
|
||||
public void setmHonorPoint(int mHonorPoint) {
|
||||
this.mHonorPoint = mHonorPoint;
|
||||
}
|
||||
|
||||
public int gethHonorPoint() {
|
||||
return hHonorPoint;
|
||||
}
|
||||
|
||||
public void sethHonorPoint(int hHonorPoint) {
|
||||
this.hHonorPoint = hHonorPoint;
|
||||
}
|
||||
|
||||
public int getFriendHeart() {
|
||||
return friendHeart;
|
||||
}
|
||||
|
||||
public void setFriendHeart(int friendHeart) {
|
||||
this.friendHeart = friendHeart;
|
||||
}
|
||||
|
||||
public long getBanTime() {
|
||||
return banTime;
|
||||
}
|
||||
|
||||
public void setBanTime(long banTime) {
|
||||
this.banTime = banTime;
|
||||
}
|
||||
|
||||
public String getBanReason() {
|
||||
return banReason;
|
||||
}
|
||||
|
||||
public void setBanReason(String banReason) {
|
||||
this.banReason = banReason;
|
||||
}
|
||||
|
||||
public long getVipFlushTime() {
|
||||
return vipFlushTime;
|
||||
}
|
||||
|
||||
public void setVipFlushTime(long vipFlushTime) {
|
||||
this.vipFlushTime = vipFlushTime;
|
||||
}
|
||||
|
||||
public long getZeroFlushTime() {
|
||||
return zeroFlushTime;
|
||||
}
|
||||
|
||||
public void setZeroFlushTime(long zeroFlushTime) {
|
||||
this.zeroFlushTime = zeroFlushTime;
|
||||
}
|
||||
|
||||
public String getSystemSetting() {
|
||||
return systemSetting;
|
||||
}
|
||||
|
||||
public void setSystemSetting(String systemSetting) {
|
||||
this.systemSetting = systemSetting;
|
||||
}
|
||||
|
||||
public int getTotalForces() {
|
||||
return totalForces;
|
||||
}
|
||||
|
||||
public void setTotalForces(int totalForces) {
|
||||
this.totalForces = totalForces;
|
||||
}
|
||||
|
||||
public Set<Integer> getAwardLevelSet() {
|
||||
return awardLevelSet;
|
||||
}
|
||||
|
||||
public void setAwardLevelSet(Set<Integer> awardLevelSet) {
|
||||
this.awardLevelSet = awardLevelSet;
|
||||
}
|
||||
|
||||
public int getAreaId() {
|
||||
return areaId;
|
||||
}
|
||||
|
||||
public void setAreaId(int areaId) {
|
||||
this.areaId = areaId;
|
||||
}
|
||||
|
||||
public long getAwardStaminaTime() {
|
||||
return awardStaminaTime;
|
||||
}
|
||||
|
||||
public void setAwardStaminaTime(long awardStaminaTime) {
|
||||
this.awardStaminaTime = awardStaminaTime;
|
||||
}
|
||||
|
||||
public int getPopulationUpperLimit() {
|
||||
return populationUpperLimit;
|
||||
}
|
||||
|
||||
public void setPopulationUpperLimit(int populationUpperLimit) {
|
||||
this.populationUpperLimit = populationUpperLimit;
|
||||
}
|
||||
|
||||
public int getIsFirstFail() {
|
||||
return isFirstFail;
|
||||
}
|
||||
|
||||
public void setIsFirstFail(int isFirstFail) {
|
||||
this.isFirstFail = isFirstFail;
|
||||
}
|
||||
|
||||
public String getNoviceGuideId() {
|
||||
return noviceGuideId;
|
||||
}
|
||||
|
||||
public void setNoviceGuideId(String noviceGuideId) {
|
||||
this.noviceGuideId = noviceGuideId;
|
||||
}
|
||||
|
||||
public String getDanmu() {
|
||||
return danmu;
|
||||
}
|
||||
|
||||
public void setDanmu(String danmu) {
|
||||
this.danmu = danmu;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getTakeStaminaMap() {
|
||||
return takeStaminaMap;
|
||||
}
|
||||
|
||||
public void setTakeStaminaMap(Map<Integer, Integer> takeStaminaMap) {
|
||||
this.takeStaminaMap = takeStaminaMap;
|
||||
}
|
||||
|
||||
public String getCaptainId() {
|
||||
return captainId;
|
||||
}
|
||||
|
||||
public void setCaptainId(String captainId) {
|
||||
this.captainId = captainId;
|
||||
}
|
||||
|
||||
public int getSkipNewer() {
|
||||
return skipNewer;
|
||||
}
|
||||
|
||||
public void setSkipNewer(int skipNewer) {
|
||||
this.skipNewer = skipNewer;
|
||||
}
|
||||
|
||||
public int getCumLoginTime() {
|
||||
return CumLoginTime;
|
||||
}
|
||||
|
||||
public void setCumLoginTime(int cumLoginTime) {
|
||||
CumLoginTime = cumLoginTime;
|
||||
}
|
||||
|
||||
public int getDrawDailyTime() {
|
||||
return drawDailyTime;
|
||||
}
|
||||
|
||||
public void setDrawDailyTime(int drawDailyTime) {
|
||||
this.drawDailyTime = drawDailyTime;
|
||||
}
|
||||
|
||||
public int getDrawDailyState() {
|
||||
return drawDailyState;
|
||||
}
|
||||
|
||||
public void setDrawDailyState(int drawDailyState) {
|
||||
this.drawDailyState = drawDailyState;
|
||||
}
|
||||
|
||||
public int getIsPrivilege() {
|
||||
return isPrivilege;
|
||||
}
|
||||
|
||||
public void setIsPrivilege(int isPrivilege) {
|
||||
this.isPrivilege = isPrivilege;
|
||||
}
|
||||
|
||||
public long getPrivilegedLoginTime() {
|
||||
return privilegedLoginTime;
|
||||
}
|
||||
|
||||
public void setPrivilegedLoginTime(long privilegedLoginTime) {
|
||||
this.privilegedLoginTime = privilegedLoginTime;
|
||||
}
|
||||
|
||||
public int getRecall() {
|
||||
return recall;
|
||||
}
|
||||
|
||||
public void setRecall(int recall) {
|
||||
this.recall = recall;
|
||||
}
|
||||
|
||||
public int getCumulativeRecharge() {
|
||||
return cumulativeRecharge;
|
||||
}
|
||||
|
||||
public void setCumulativeRecharge(int cumulativeRecharge) {
|
||||
this.cumulativeRecharge = cumulativeRecharge;
|
||||
}
|
||||
|
||||
public int getSkinGold() {
|
||||
return skinGold;
|
||||
}
|
||||
|
||||
public void setSkinGold(int skinGold) {
|
||||
this.skinGold = skinGold;
|
||||
}
|
||||
|
||||
public int getHead() {
|
||||
return head;
|
||||
}
|
||||
|
||||
public void setHead(int head) {
|
||||
this.head = head;
|
||||
}
|
||||
|
||||
public int getHeadFrame() {
|
||||
return headFrame;
|
||||
}
|
||||
|
||||
public void setHeadFrame(int headFrame) {
|
||||
this.headFrame = headFrame;
|
||||
}
|
||||
|
||||
public String getClientVersion() {
|
||||
return clientVersion;
|
||||
}
|
||||
|
||||
public void setClientVersion(String clientVersion) {
|
||||
this.clientVersion = clientVersion;
|
||||
}
|
||||
|
||||
public long getRecNoticeTime() {
|
||||
return recNoticeTime;
|
||||
}
|
||||
|
||||
public void setRecNoticeTime(long recNoticeTime) {
|
||||
this.recNoticeTime = recNoticeTime;
|
||||
}
|
||||
|
||||
public String getCoreAddress() {
|
||||
return coreAddress;
|
||||
}
|
||||
|
||||
public void setCoreAddress(String coreAddress) {
|
||||
this.coreAddress = coreAddress;
|
||||
}
|
||||
|
||||
public UserMission getMission() {
|
||||
return mission;
|
||||
}
|
||||
|
||||
public void setMission(UserMission mission) {
|
||||
this.mission = mission;
|
||||
}
|
||||
|
||||
public boolean isFirstLogin() {
|
||||
return firstLogin;
|
||||
}
|
||||
|
||||
public void setFirstLogin(boolean firstLogin) {
|
||||
this.firstLogin = firstLogin;
|
||||
}
|
||||
|
||||
public boolean isFriendTip() {
|
||||
return friendTip;
|
||||
}
|
||||
|
||||
public void setFriendTip(boolean friendTip) {
|
||||
this.friendTip = friendTip;
|
||||
}
|
||||
|
||||
public int getQq_vip() {
|
||||
return qq_vip;
|
||||
}
|
||||
|
||||
public void setQq_vip(int qq_vip) {
|
||||
this.qq_vip = qq_vip;
|
||||
}
|
||||
|
||||
public int getErrorGem() {
|
||||
return errorGem;
|
||||
}
|
||||
|
||||
public void setErrorGem(int errorGem) {
|
||||
this.errorGem = errorGem;
|
||||
}
|
||||
|
||||
public int getOnline() {
|
||||
return online;
|
||||
}
|
||||
|
||||
public void setOnline(int online) {
|
||||
this.online = online;
|
||||
}
|
||||
|
||||
public String getQQGroup() {
|
||||
return QQGroup;
|
||||
}
|
||||
|
||||
public void setQQGroup(String QQGroup) {
|
||||
this.QQGroup = QQGroup;
|
||||
}
|
||||
}
|
|
@ -1,6 +1,15 @@
|
|||
package com.jmfy.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CUserDao {
|
||||
|
||||
String findUserInfo(int serverId, int userId);
|
||||
|
||||
CUserInfo getUserInfobyNameAndServerId(String name,int serverId) throws Exception;
|
||||
|
||||
CUser getCUser(int userId, int serverid);
|
||||
|
||||
List<CPayOrder> getOrderInfoBydate(String agoDate);
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,157 @@
|
|||
package com.jmfy.dto;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Document(collection="c_user_info")
|
||||
public class CUserInfo {
|
||||
|
||||
@Id
|
||||
private String id;
|
||||
|
||||
@Field(value = "channel")
|
||||
|
||||
private String channel;
|
||||
|
||||
@Field(value = "sub_channel")
|
||||
private String sub_channel;
|
||||
|
||||
@Field(value = "platform")
|
||||
private String platform;
|
||||
|
||||
@Field(value = "openId")
|
||||
private String openId;
|
||||
|
||||
@Field(value = "userId")
|
||||
private int userId;
|
||||
|
||||
@Field(value = "serverid")
|
||||
private int serverid;
|
||||
|
||||
@Field(value = "time")
|
||||
private String time;
|
||||
|
||||
@Field(value = "invent_code")
|
||||
private boolean invent_code;
|
||||
|
||||
@Field(value = "utoken")
|
||||
private String utoken;
|
||||
|
||||
@Field(value = "agreement")
|
||||
private int agreement;
|
||||
//key->0:游戏封号 ,1:安全封号 ,2 守护封号 value:封号截止时间|封号原因
|
||||
@Field(value = "black_list_map")
|
||||
private Map<Integer,String> blackListMap;
|
||||
|
||||
//key->0:游戏封号 ,1:安全封号 ,2 守护封号 value:封号时长
|
||||
@Field(value = "sealTime_length")
|
||||
private Map<Integer,Integer> sealTimeLength ;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
||||
public void setChannel(String channel) {
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
public String getSub_channel() {
|
||||
return sub_channel;
|
||||
}
|
||||
|
||||
public void setSub_channel(String sub_channel) {
|
||||
this.sub_channel = sub_channel;
|
||||
}
|
||||
|
||||
public String getPlatform() {
|
||||
return platform;
|
||||
}
|
||||
|
||||
public void setPlatform(String platform) {
|
||||
this.platform = platform;
|
||||
}
|
||||
|
||||
public String getOpenId() {
|
||||
return openId;
|
||||
}
|
||||
|
||||
public void setOpenId(String openId) {
|
||||
this.openId = openId;
|
||||
}
|
||||
|
||||
public int getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(int userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public int getServerid() {
|
||||
return serverid;
|
||||
}
|
||||
|
||||
public void setServerid(int serverid) {
|
||||
this.serverid = serverid;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public boolean isInvent_code() {
|
||||
return invent_code;
|
||||
}
|
||||
|
||||
public void setInvent_code(boolean invent_code) {
|
||||
this.invent_code = invent_code;
|
||||
}
|
||||
|
||||
public String getUtoken() {
|
||||
return utoken;
|
||||
}
|
||||
|
||||
public void setUtoken(String utoken) {
|
||||
this.utoken = utoken;
|
||||
}
|
||||
|
||||
public int getAgreement() {
|
||||
return agreement;
|
||||
}
|
||||
|
||||
public void setAgreement(int agreement) {
|
||||
this.agreement = agreement;
|
||||
}
|
||||
|
||||
public Map<Integer, String> getBlackListMap() {
|
||||
return blackListMap;
|
||||
}
|
||||
|
||||
public void setBlackListMap(Map<Integer, String> blackListMap) {
|
||||
this.blackListMap = blackListMap;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getSealTimeLength() {
|
||||
return sealTimeLength;
|
||||
}
|
||||
|
||||
public void setSealTimeLength(Map<Integer, Integer> sealTimeLength) {
|
||||
this.sealTimeLength = sealTimeLength;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,336 @@
|
|||
package com.jmfy.dto;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
//累计数据
|
||||
public class CumulationData {
|
||||
//消耗金币总数
|
||||
protected int consumeGold = 0;
|
||||
//消耗体力
|
||||
protected int consumeStrength = 0;
|
||||
//消耗妖晶
|
||||
protected int consumeGem = 0;
|
||||
|
||||
//获得荣誉点
|
||||
protected int getHonor = 0;
|
||||
|
||||
//通关困难关卡
|
||||
protected int finishDiffFightCount = 0;
|
||||
|
||||
//通关普通关卡
|
||||
protected int finishGeneralFightCount = 0;
|
||||
|
||||
//通关天幻圣境
|
||||
protected int finishSacredFightCount = 0;
|
||||
|
||||
//助战次数
|
||||
protected int fightassist = 0;
|
||||
|
||||
|
||||
//参与天才战
|
||||
protected int participateArenaCount = 0;
|
||||
|
||||
protected int winArenaCount = 0;
|
||||
|
||||
//通过妖神假期日常
|
||||
protected int finishHoliday = 0;
|
||||
|
||||
//妖神假期积分
|
||||
protected int holidayScore = 0;
|
||||
|
||||
|
||||
//友情抽卡次数
|
||||
protected int friendcallTime = 0;
|
||||
|
||||
//高级聚灵次数
|
||||
protected int callTime = 0;
|
||||
|
||||
//日常任务完成次数
|
||||
protected int dailyCount = 0;
|
||||
//许愿
|
||||
protected int wishCount = 0;
|
||||
//捐赠
|
||||
protected int wishDonationCount = 0;
|
||||
//天道酬勤
|
||||
protected int godhelps = 0;
|
||||
|
||||
|
||||
//强化英雄次数
|
||||
protected int strHeroCount = 0;
|
||||
|
||||
//周任务完成次数
|
||||
protected int weekCount = 0;
|
||||
|
||||
|
||||
//最大段位
|
||||
protected int maxParagraph = 6;
|
||||
|
||||
//没有抽到SSR次数
|
||||
protected int noSSRCount = 0;
|
||||
|
||||
//队伍等级
|
||||
protected int userLevel = 0;
|
||||
|
||||
//领取体力
|
||||
protected int getStengin = 0;
|
||||
|
||||
//战力
|
||||
protected int teamPower = 0;
|
||||
|
||||
//皮肤个数
|
||||
protected int skinCount = 0;
|
||||
|
||||
//通关心海试炼X次
|
||||
protected int xinhanTimes = 0;
|
||||
|
||||
//通关唤醒副本X次
|
||||
protected int wakecopyTimes = 0;
|
||||
|
||||
//强化心魂X次
|
||||
protected int strXinhun = 0;
|
||||
|
||||
//唤醒完成X个妖灵师
|
||||
protected int wakeHeroTimes = 0;
|
||||
|
||||
|
||||
//N R SR SSR
|
||||
protected int[] heroByRarityCounts = new int[5];
|
||||
|
||||
//xx星级妖灵师个数
|
||||
//索引为星级 key star value count
|
||||
protected Map<Integer, Integer> heroByStartCounts = new ConcurrentHashMap<>();
|
||||
|
||||
//key 妖灵师品质 {key start value count}
|
||||
protected Map<Integer, Map<Integer, Integer>> heroByStartCountsQuality = new ConcurrentHashMap<>();
|
||||
|
||||
//key 妖符品质 {key start value count}
|
||||
protected Map<Integer, Map<Integer, Integer>> yaofuByStartCountsQuality = new ConcurrentHashMap<>();
|
||||
|
||||
//key 妖灵师品质 {key waketimes value count}
|
||||
protected Map<Integer, Map<Integer, Integer>> heroWakeTimesQuality = new ConcurrentHashMap<>();
|
||||
|
||||
|
||||
//key level value count
|
||||
protected Map<Integer, Integer> heroLevel = new ConcurrentHashMap<>();
|
||||
|
||||
//key 妖灵师品质 {key skillLevel value count}
|
||||
protected Map<Integer, Map<Integer, Integer>> heroSkillQuality = new ConcurrentHashMap<>();
|
||||
|
||||
//key 妖灵师品质 {key level value count}
|
||||
protected Map<Integer, Map<Integer, Integer>> heroLevelQuality = new ConcurrentHashMap<>();
|
||||
|
||||
//key 妖符品质 {key level value count}
|
||||
protected Map<Integer, Map<Integer, Integer>> yaofuLevelQuality = new ConcurrentHashMap<>();
|
||||
|
||||
protected Set<Integer> heroId = new HashSet<>();
|
||||
|
||||
protected Set<Integer> yaofuId = new HashSet<>();
|
||||
|
||||
//装备品质 1:白,2:绿,3:蓝,4:紫,5:橙
|
||||
protected int[] equipQuality = new int[6];
|
||||
|
||||
//领取状态0不可领取 1可领取 2已领取 key type
|
||||
private int totalRewardStatus = 0;
|
||||
|
||||
//邮件发送奖励 1已领取奖励 0为领取奖励
|
||||
private int mailReward = 0;
|
||||
|
||||
//全目标奖励积分
|
||||
private int score = 0;
|
||||
|
||||
//全目标奖励可领任务数量
|
||||
private int canReward = 0;
|
||||
|
||||
private int activity = 0;
|
||||
|
||||
public int getConsumeGold() {
|
||||
return consumeGold;
|
||||
}
|
||||
|
||||
public int getConsumeStrength() {
|
||||
return consumeStrength;
|
||||
}
|
||||
|
||||
public int getConsumeGem() {
|
||||
return consumeGem;
|
||||
}
|
||||
|
||||
public int getGetHonor() {
|
||||
return getHonor;
|
||||
}
|
||||
|
||||
public int getFinishDiffFightCount() {
|
||||
return finishDiffFightCount;
|
||||
}
|
||||
|
||||
public int getFinishGeneralFightCount() {
|
||||
return finishGeneralFightCount;
|
||||
}
|
||||
|
||||
public int getFinishSacredFightCount() {
|
||||
return finishSacredFightCount;
|
||||
}
|
||||
|
||||
public int getFightassist() {
|
||||
return fightassist;
|
||||
}
|
||||
|
||||
public int getParticipateArenaCount() {
|
||||
return participateArenaCount;
|
||||
}
|
||||
|
||||
public int getWinArenaCount() {
|
||||
return winArenaCount;
|
||||
}
|
||||
|
||||
public int getFinishHoliday() {
|
||||
return finishHoliday;
|
||||
}
|
||||
|
||||
public int getHolidayScore() {
|
||||
return holidayScore;
|
||||
}
|
||||
|
||||
public int getFriendcallTime() {
|
||||
return friendcallTime;
|
||||
}
|
||||
|
||||
public int getCallTime() {
|
||||
return callTime;
|
||||
}
|
||||
|
||||
public int getDailyCount() {
|
||||
return dailyCount;
|
||||
}
|
||||
|
||||
public int getWishCount() {
|
||||
return wishCount;
|
||||
}
|
||||
|
||||
public int getWishDonationCount() {
|
||||
return wishDonationCount;
|
||||
}
|
||||
|
||||
public int getGodhelps() {
|
||||
return godhelps;
|
||||
}
|
||||
|
||||
public int getStrHeroCount() {
|
||||
return strHeroCount;
|
||||
}
|
||||
|
||||
public int getWeekCount() {
|
||||
return weekCount;
|
||||
}
|
||||
|
||||
public int getMaxParagraph() {
|
||||
return maxParagraph;
|
||||
}
|
||||
|
||||
public int getNoSSRCount() {
|
||||
return noSSRCount;
|
||||
}
|
||||
|
||||
public int getUserLevel() {
|
||||
return userLevel;
|
||||
}
|
||||
|
||||
public int getGetStengin() {
|
||||
return getStengin;
|
||||
}
|
||||
|
||||
public int getTeamPower() {
|
||||
return teamPower;
|
||||
}
|
||||
|
||||
public int getSkinCount() {
|
||||
return skinCount;
|
||||
}
|
||||
|
||||
public int getXinhanTimes() {
|
||||
return xinhanTimes;
|
||||
}
|
||||
|
||||
public int getWakecopyTimes() {
|
||||
return wakecopyTimes;
|
||||
}
|
||||
|
||||
public int getStrXinhun() {
|
||||
return strXinhun;
|
||||
}
|
||||
|
||||
public int getWakeHeroTimes() {
|
||||
return wakeHeroTimes;
|
||||
}
|
||||
|
||||
public int[] getHeroByRarityCounts() {
|
||||
return heroByRarityCounts;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getHeroByStartCounts() {
|
||||
return heroByStartCounts;
|
||||
}
|
||||
|
||||
public Map<Integer, Map<Integer, Integer>> getHeroByStartCountsQuality() {
|
||||
return heroByStartCountsQuality;
|
||||
}
|
||||
|
||||
public Map<Integer, Map<Integer, Integer>> getYaofuByStartCountsQuality() {
|
||||
return yaofuByStartCountsQuality;
|
||||
}
|
||||
|
||||
public Map<Integer, Map<Integer, Integer>> getHeroWakeTimesQuality() {
|
||||
return heroWakeTimesQuality;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getHeroLevel() {
|
||||
return heroLevel;
|
||||
}
|
||||
|
||||
public Map<Integer, Map<Integer, Integer>> getHeroSkillQuality() {
|
||||
return heroSkillQuality;
|
||||
}
|
||||
|
||||
public Map<Integer, Map<Integer, Integer>> getHeroLevelQuality() {
|
||||
return heroLevelQuality;
|
||||
}
|
||||
|
||||
public Map<Integer, Map<Integer, Integer>> getYaofuLevelQuality() {
|
||||
return yaofuLevelQuality;
|
||||
}
|
||||
|
||||
public Set<Integer> getHeroId() {
|
||||
return heroId;
|
||||
}
|
||||
|
||||
public Set<Integer> getYaofuId() {
|
||||
return yaofuId;
|
||||
}
|
||||
|
||||
public int[] getEquipQuality() {
|
||||
return equipQuality;
|
||||
}
|
||||
|
||||
public int getTotalRewardStatus() {
|
||||
return totalRewardStatus;
|
||||
}
|
||||
|
||||
public int getMailReward() {
|
||||
return mailReward;
|
||||
}
|
||||
|
||||
public int getScore() {
|
||||
return score;
|
||||
}
|
||||
|
||||
public int getCanReward() {
|
||||
return canReward;
|
||||
}
|
||||
|
||||
public int getActivity() {
|
||||
return activity;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.jmfy.dto;
|
||||
|
||||
|
||||
public class ResultVo {
|
||||
|
||||
private String code;
|
||||
|
||||
private String message;
|
||||
|
||||
public ResultVo(String code, String message){
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.jmfy.dto;
|
||||
|
||||
|
||||
public class UserMission {
|
||||
//数据累加项
|
||||
private CumulationData cumulationData = new CumulationData();
|
||||
|
||||
public CumulationData getCumulationData() {
|
||||
return cumulationData;
|
||||
}
|
||||
}
|
|
@ -1,11 +1,23 @@
|
|||
package com.jmfy.dto.impl;
|
||||
|
||||
import com.jmfy.dto.CPayOrder;
|
||||
import com.jmfy.dto.CUser;
|
||||
import com.jmfy.dto.CUserDao;
|
||||
import com.jmfy.dto.CUserInfo;
|
||||
import com.jmfy.util.Connect;
|
||||
import com.jmfy.util.RedisUtil;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class CUserDaoImpl implements CUserDao {
|
||||
@Resource
|
||||
private Connect connect ;
|
||||
@Override
|
||||
public String findUserInfo(int serverId, int userId) {
|
||||
String userInfo = RedisUtil.getInstence().getObject(serverId+":CUser_ServerInfo", Integer.toString(userId),String.class, -1);
|
||||
|
@ -14,4 +26,28 @@ public class CUserDaoImpl implements CUserDao {
|
|||
}
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CUserInfo getUserInfobyNameAndServerId(String name, int serverId) throws Exception {
|
||||
Query query = new Query();
|
||||
Criteria cr = new Criteria();
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete("ysj_core");
|
||||
cr.andOperator(Criteria.where("serverid").is(serverId), Criteria.where("openId").is(name));
|
||||
query.addCriteria(cr);
|
||||
CUserInfo cUserInfo = mongoTemplate.findOne(query, CUserInfo.class);
|
||||
return cUserInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CUser getCUser(int userId, int serverid) {
|
||||
CUser user = RedisUtil.getInstence().getObject(serverid+":CUser_Key",
|
||||
Integer.toString(userId), CUser.class, 7 * 24 * 3600);
|
||||
return user;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CPayOrder> getOrderInfoBydate(String agoDate) {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,37 +1,42 @@
|
|||
package com.jmfy.util;
|
||||
|
||||
import com.mongodb.MongoClient;
|
||||
import com.mongodb.WriteConcern;
|
||||
import com.mongodb.MongoClientURI;
|
||||
import com.mongodb.client.MongoIterable;
|
||||
import org.springframework.data.mongodb.MongoDbFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.SimpleMongoDbFactory;
|
||||
import org.springframework.data.mongodb.core.convert.MongoConverter;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
//@Component
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Component
|
||||
public class Connect {
|
||||
//
|
||||
// @Resource
|
||||
// private MongoClient mongo;
|
||||
// @Resource
|
||||
// private MongoConverter mongoConverter;
|
||||
//
|
||||
// private Map<String,MongoTemplate> mongoMaps= new HashMap<>();
|
||||
//
|
||||
// @PostConstruct
|
||||
// public void init(){
|
||||
// MongoIterable<String> databases = mongo.listDatabaseNames();
|
||||
// for(String dbName:databases){
|
||||
// MongoDbFactory simpleMongoDbFactory = new SimpleMongoDbFactory(mongo,dbName);
|
||||
// MongoTemplate mongoTemplate = new MongoTemplate(simpleMongoDbFactory, mongoConverter);
|
||||
// mongoMaps.put(dbName,mongoTemplate);
|
||||
// }
|
||||
// }
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(Connect.class);
|
||||
@Value("${spring.data.mongodb.uri}")
|
||||
private String mongoClientUrl;
|
||||
private Map<String, MongoTemplate> mongoTemplateMap = new ConcurrentHashMap<>();
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
MongoClient mongoClient = new MongoClient(new MongoClientURI(mongoClientUrl));
|
||||
MongoIterable<String> databaseNames = mongoClient.listDatabaseNames();
|
||||
for (String dbName : databaseNames) {
|
||||
LOGGER.info("oldMongomaps-->dbName={}", dbName);
|
||||
MongoTemplate mongoTemplate = new MongoTemplate(mongoClient, dbName);
|
||||
mongoTemplateMap.put(dbName, mongoTemplate);
|
||||
}
|
||||
}
|
||||
public MongoTemplate getMongoTemplete(String dbName) throws Exception {
|
||||
if (!mongoTemplateMap.containsKey(dbName)) {
|
||||
throw new Exception(dbName + " does not exist");
|
||||
}
|
||||
MongoTemplate mongoTemplate = mongoTemplateMap.get(dbName);
|
||||
return mongoTemplate;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,21 @@
|
|||
package com.jmfy.util;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.jmfy.controller.RechargeController;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class JsonUtil {
|
||||
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(JsonUtil.class);
|
||||
private static JsonUtil jsonUtil;
|
||||
|
||||
private Gson gson = new Gson();
|
||||
|
@ -23,4 +34,46 @@ public class JsonUtil {
|
|||
public Gson getGson() {
|
||||
return gson;
|
||||
}
|
||||
|
||||
public HashMap<String, String> getParameterMap(HttpServletRequest request) {
|
||||
HashMap<String, String> map = new HashMap();
|
||||
Enumeration paramNames = request.getParameterNames();
|
||||
while (paramNames.hasMoreElements()) {
|
||||
String paramName = (String) paramNames.nextElement();
|
||||
String[] paramValues = request.getParameterValues(paramName);
|
||||
String paramValue = paramValues[0];
|
||||
map.put(paramName, paramValue);
|
||||
LOGGER.info("parameter : " + paramName + "=" + paramValue);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static String getServiceKey(String serviceName, String host, String port) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
return sb.append(serviceName).append("|")
|
||||
.append(host).append("|")
|
||||
.append(port).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取日期前一天
|
||||
* @param specifiedDay
|
||||
* @return
|
||||
*/
|
||||
public static String getSpecifiedDayBefore(String specifiedDay){
|
||||
//SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Calendar c = Calendar.getInstance();
|
||||
Date date=null;
|
||||
try {
|
||||
date = new SimpleDateFormat("yy-MM-dd").parse(specifiedDay);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
c.setTime(date);
|
||||
int day=c.get(Calendar.DATE);
|
||||
c.set(Calendar.DATE,day-1);
|
||||
|
||||
String dayBefore=new SimpleDateFormat("yyyy-MM-dd").format(c.getTime());
|
||||
return dayBefore;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,12 +3,13 @@ server.port=9991
|
|||
##contextPath
|
||||
server.context-path=/delivery
|
||||
|
||||
|
||||
# redis config
|
||||
spring.redis.host = 192.168.0.169
|
||||
spring.redis.host = 60.1.1.14
|
||||
spring.redis.port = 6379
|
||||
spring.redis.password =
|
||||
spring.redis.expireTime = -1
|
||||
|
||||
spring.data.mongodb.uri = mongodb://60.1.1.14:27017/ysj_core
|
||||
#
|
||||
#spring.data.mongodb.host=192.168.0.170
|
||||
#spring.data.mongodb.port=27017
|
||||
|
|
|
@ -15,4 +15,6 @@ service RPCRequestIFace{
|
|||
6:string channel_id, 7:string token) throws (1:common.InvalidOperException ouch);
|
||||
|
||||
Result testdeliveryGood(1:i32 userId, 2:string payitem) throws (1:common.InvalidOperException ouch);
|
||||
|
||||
Result sendReward(1:i32 userId, 2:string rewardItems,3:string title,4:string content,5:i32 type) throws (1:common.InvalidOperException ouch);
|
||||
}
|
Loading…
Reference in New Issue