|
@@ -4,6 +4,7 @@ import com.miaxis.common.core.controller.BaseController;
|
|
|
import com.miaxis.common.core.domain.Response;
|
|
|
import com.miaxis.common.core.domain.entity.UserInfo;
|
|
|
import com.miaxis.common.utils.SecurityUtils;
|
|
|
+import com.miaxis.common.utils.StringUtils;
|
|
|
import com.miaxis.user.service.IUserInfoService;
|
|
|
import com.miaxis.user.vo.UserVipInfoVO;
|
|
|
import io.swagger.annotations.Api;
|
|
@@ -67,19 +68,25 @@ public class UserInfoController extends BaseController{
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 获取用户详细信息
|
|
|
+ * 更新昵称、手机号码、头像
|
|
|
*/
|
|
|
@PutMapping(value = "/userInfo")
|
|
|
- @ApiOperation("更新用户头像和昵称")
|
|
|
- public Response updateInfo(String headImage,String nickName
|
|
|
- ) throws Exception {
|
|
|
+ @ApiOperation("更新昵称、手机号码、头像")
|
|
|
+ public Response updateInfo(String nickName,String phone,String headImage) {
|
|
|
Long id = SecurityUtils.getLoginUser().getStudent().getId();
|
|
|
UserInfo dbUserInfo = userInfoService.getById(id);
|
|
|
dbUserInfo.setNickName(nickName);
|
|
|
- dbUserInfo.setHeadImage(headImage);
|
|
|
+ dbUserInfo.setPhone(phone);
|
|
|
+ if(!StringUtils.isEmpty(headImage)) {
|
|
|
+ dbUserInfo.setHeadImage(headImage);
|
|
|
+ }
|
|
|
return Response.success(userInfoService.updateById(dbUserInfo));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
private String getSign(Integer isVip, String unionId) throws Exception {
|
|
|
String str = unionId+isVip;
|
|
|
// 进行签名服务
|