| | |
| | | bossData = new JSONObject();
|
| | | UserInfo boss = threeSale.getBoss();
|
| | | if (boss != null) {
|
| | | bossData.put("bossId", boss.getId());
|
| | | bossData.put("nickName", boss.getNickName());
|
| | | bossData.put("portrait", boss.getPortrait());
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(boss.getId());
|
| | | if (userInfoExtra != null) |
| | | bossData.put("weiXin", userInfoExtra.getWeiXin());
|
| | | }
|
| | |
|
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
|
| | | Long createTime = threeSale.getCreateTime();
|
| | | Date inviteTime = new Date(createTime);
|
| | |
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("user", JsonUtil.getConvertBigDecimalToStringBuilder(gsonBuilder).create().toJson(userInfo));
|
| | |
|
| | | // 界面状态
|
| | | UserSettingsVO mySettings = null;
|
| | | try {
|
| | |
| | | userInfo.setRankNamePicture(null);
|
| | | userInfo.setRankIcon(null);
|
| | | }
|
| | | |
| | | userInfo.setSex(userInfoExtra.getSex());
|
| | | userInfo.setWeiXin(userInfoExtra.getWeiXin());
|
| | | }
|
| | |
|
| | | |
| | | |
| | | |
| | | data.put("user", JsonUtil.getConvertBigDecimalToStringBuilder(gsonBuilder).create().toJson(userInfo));
|
| | | data.put("invitCode", invitCode); // 邀请码
|
| | | data.put("welfareCenterNews", welfareCenterNews);// 福利中心消息
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 更换昵称
|
| | | * 更换基础信息
|
| | | *
|
| | | * @param acceptData
|
| | | * @param nickName
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveInfo")
|
| | | public void saveInfo(AcceptData acceptData, String nickName, Long uid, PrintWriter out) {
|
| | | public void saveInfo(AcceptData acceptData, String nickName, String weiXin, Integer sex, Long uid, PrintWriter out) {
|
| | | try {
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | | if (StringUtil.isNullOrEmpty(nickName)) {
|
| | | out.print(JsonUtil.loadFalseResult("昵称不能为空"));
|
| | | return;
|
| | | }
|
| | | if (nickName.length() > 200) {
|
| | | out.print(JsonUtil.loadFalseResult("昵称过长"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (maskKeyService.examineContent(nickName)) {
|
| | | out.print(JsonUtil.loadFalseResult("不能包含敏感词汇"));
|
| | | return;
|
| | | // 修改昵称
|
| | | if (!StringUtil.isNullOrEmpty(nickName)) {
|
| | | if (nickName.length() > 200) {
|
| | | out.print(JsonUtil.loadFalseResult("昵称过长"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (maskKeyService.examineContent(nickName)) {
|
| | | out.print(JsonUtil.loadFalseResult("不能包含敏感词汇"));
|
| | | return;
|
| | | }
|
| | | userInfoService.saveUserInfo(nickName, uid);
|
| | | }
|
| | |
|
| | | userInfoService.saveUserInfo(nickName, uid);
|
| | |
|
| | | |
| | | // 修改微信号
|
| | | if (!StringUtil.isNullOrEmpty(weiXin)) {
|
| | | if (weiXin.length() > 32) {
|
| | | out.print(JsonUtil.loadFalseResult("微信号过长"));
|
| | | return;
|
| | | }
|
| | | |
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra != null) {
|
| | | UserInfoExtra extra = new UserInfoExtra();
|
| | | extra.setId(userInfoExtra.getId());
|
| | | extra.setWeiXin(weiXin);
|
| | | userInfoExtraService.saveUserInfoExtra(extra);
|
| | | }
|
| | | }
|
| | | |
| | | // 修改性别
|
| | | if (sex != null && sex > 0 && sex < 3) {
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra != null) {
|
| | | UserInfoExtra extra = new UserInfoExtra();
|
| | | extra.setId(userInfoExtra.getId());
|
| | | extra.setSex(sex);
|
| | | userInfoExtraService.saveUserInfoExtra(extra);
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult("保存成功"));
|
| | | } catch (UserInfoException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|