generated from root/miduo_server
返利道具修改
parent
b687f6363f
commit
2a7469dd60
|
@ -5,8 +5,8 @@ import com.google.gson.reflect.TypeToken;
|
|||
import com.jmfy.dto.CPayOrder;
|
||||
import com.jmfy.dto.CUserDao;
|
||||
import com.jmfy.paramBean.CMail;
|
||||
import com.jmfy.paramBean.MailCache;
|
||||
import com.jmfy.paramBean.PaySdkEnum;
|
||||
import com.jmfy.paramBean.YouGuProp;
|
||||
import com.jmfy.redisProperties.RedisUserKey;
|
||||
import com.jmfy.util.JsonUtil;
|
||||
import com.jmfy.util.RedisUtil;
|
||||
|
@ -25,10 +25,7 @@ import java.lang.reflect.Type;
|
|||
import java.net.URLEncoder;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.*;
|
||||
|
||||
@RestController
|
||||
public class ItemSendController {
|
||||
|
@ -119,8 +116,9 @@ public class ItemSendController {
|
|||
int time = (int) (System.currentTimeMillis() / 1000);
|
||||
String props = params.get("props");
|
||||
Gson gson = new Gson();
|
||||
Map<String, String> item = gson.fromJson(props, Map.class);
|
||||
String reward = ToolUtils.getMailReward(item);
|
||||
Type listType = new TypeToken<List<YouGuProp>>() {}.getType();
|
||||
List<YouGuProp> list = gson.fromJson(props, listType);
|
||||
String reward = ToolUtils.getMailReward(list);
|
||||
sendMailToRedis(Integer.parseInt(uid), title, content, reward, time, 2592000);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,63 +0,0 @@
|
|||
package com.jmfy.paramBean;
|
||||
|
||||
|
||||
public class MailCache {
|
||||
private String title;
|
||||
private String content;
|
||||
private String from;
|
||||
private String reward;
|
||||
private int time;
|
||||
private int validTime;
|
||||
|
||||
public MailCache() {
|
||||
from = "Rebates";
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getFrom() {
|
||||
return from;
|
||||
}
|
||||
|
||||
public void setFrom(String from) {
|
||||
this.from = from;
|
||||
}
|
||||
|
||||
public int getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(int time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public String getReward() {
|
||||
return reward;
|
||||
}
|
||||
|
||||
public void setReward(String reward) {
|
||||
this.reward = reward;
|
||||
}
|
||||
|
||||
public int getValidTime() {
|
||||
return validTime;
|
||||
}
|
||||
|
||||
public void setValidTime(int validTime) {
|
||||
this.validTime = validTime;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.jmfy.paramBean;
|
||||
|
||||
public class YouGuProp {
|
||||
private String cpid;
|
||||
private int num;
|
||||
|
||||
public YouGuProp() {
|
||||
}
|
||||
|
||||
public YouGuProp(String cpid, int num) {
|
||||
this.cpid = cpid;
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public String getCpid() {
|
||||
return cpid;
|
||||
}
|
||||
|
||||
public void setCpid(String cpid) {
|
||||
this.cpid = cpid;
|
||||
}
|
||||
|
||||
public int getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(int num) {
|
||||
this.num = num;
|
||||
}
|
||||
}
|
|
@ -1,12 +1,14 @@
|
|||
package com.jmfy.util;
|
||||
|
||||
import com.jmfy.paramBean.PaySdkEnum;
|
||||
import com.jmfy.paramBean.YouGuProp;
|
||||
import com.jmfy.redisProperties.RedisUserKey;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
@ -31,6 +33,17 @@ public class ToolUtils {
|
|||
return reward.toString();
|
||||
}
|
||||
|
||||
public static String getMailReward(List<YouGuProp> list){
|
||||
StringBuilder reward = new StringBuilder();
|
||||
for (YouGuProp prop : list) {
|
||||
reward.append(prop.getCpid()).append("#").append(prop.getNum()).append("|");
|
||||
}
|
||||
if (String.valueOf(reward).endsWith("|")) {
|
||||
reward.deleteCharAt(reward.length() - 1);
|
||||
}
|
||||
return reward.toString();
|
||||
}
|
||||
|
||||
public synchronized static String produceIdByModuleNew(UUIDEnum uuidEnum, int userId){
|
||||
StringBuilder stringBuffer = new StringBuilder();
|
||||
stringBuffer.append(userId);
|
||||
|
|
Loading…
Reference in New Issue