| | |
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.NumberUtil;
|
| | | import org.yeshi.utils.wx.WXUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.user.ScanHistoryService;
|
| | | import com.yeshi.fanli.service.inter.user.ShamUserService;
|
| | | import com.yeshi.fanli.service.inter.user.ShareManageService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.AESUtil;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | @Resource
|
| | | private ShareManageService shareManageService;
|
| | |
|
| | | |
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | |
|
| | |
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "shareSubmit", method = RequestMethod.POST)
|
| | | public void getShareSubmit(long uid, String share, PrintWriter out) {
|
| | | String uidStr = StringUtil.getFromBase64(share);
|
| | | boolean b = NumberUtil.isNumeric(uidStr);
|
| | | if (!b) {
|
| | | out.print(JsonUtil.loadTrueResult("0")); // 不存在该邀请码
|
| | | return;
|
| | | }
|
| | | long inviterId = Long.parseLong(uidStr);
|
| | | int type = shareManageService.addShareManage(inviterId, uid);
|
| | | if (type == -1) {
|
| | | out.print(JsonUtil.loadTrueResult("-1")); // 邀请者与被邀请者不能相同
|
| | | return;
|
| | | } else if (type == 0) {
|
| | | out.print(JsonUtil.loadTrueResult("0")); // 不存在该邀请码
|
| | | return;
|
| | | } else if (type == 2) {
|
| | | out.print(JsonUtil.loadTrueResult("2")); // 被邀请者不是新用户
|
| | | return;
|
| | | } else if (type == 3) {
|
| | | out.print(JsonUtil.loadTrueResult("3")); // 被邀请者已存在
|
| | | return;
|
| | | } else {
|
| | | out.print(JsonUtil.loadTrueResult("1")); // 添加成功
|
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping("details")
|