| | |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | public class MsgAccountDetailFactory {
|
| | | public final static int TYPE_WX = 1;// 微信
|
| | | public final static int TYPE_TB = 2;// 淘宝
|
| | |
| | | return detail;
|
| | | }
|
| | |
|
| | | // TODO 账号等级
|
| | | // 账号等级
|
| | | public static MsgAccountDetail createUserRank(Long uid, String orderType, int orderCount, String rankName) {
|
| | | if (uid == null || rankName == null)
|
| | | return null;
|
| | |
|
| | | String msg = String.format(
|
| | | "恭喜你,上月<highlight>%s</highlight>订单达到<highlight>%s</highlight>单,已为你升级为<highlight>%s</highlight>用户,将会获得对应的福利和特权。",
|
| | | orderType, orderCount + "", rankName);
|
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setBeiZhu("无");
|
| | | detail.setContent(msg);
|
| | | detail.setTitle("账号等级");
|
| | | detail.setType(MsgTypeAccountTypeEnum.level);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | return detail;
|
| | | }
|
| | |
|
| | | // 淘宝授权失败
|
| | | public static MsgAccountDetail createTaoBaoAuthFail(Long uid, String taoBaoNickName, String reason) {
|
| | | if (uid == null || reason == null)
|
| | | return null;
|
| | |
|
| | | JSONArray msg = new JSONArray();
|
| | | JSONObject item = new JSONObject();
|
| | | item.put("name", "账号");
|
| | | item.put("content", String.format("淘宝昵称[%s]", taoBaoNickName));
|
| | | msg.add(item);
|
| | |
|
| | | item = new JSONObject();
|
| | | item.put("name", "原因");
|
| | | item.put("content", reason);
|
| | | msg.add(item);
|
| | |
|
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setBeiZhu("无");
|
| | | detail.setContent(msg.toString());
|
| | | detail.setTitle("淘宝账号授权失败");
|
| | | detail.setType(MsgTypeAccountTypeEnum.taoBaoAuthFail);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | return detail;
|
| | | }
|
| | |
|
| | | }
|