|
@@ -10,9 +10,7 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.security.KeyFactory;
|
|
|
import java.security.PrivateKey;
|
|
@@ -59,10 +57,26 @@ public class UserInfoController extends BaseController{
|
|
|
UserVipInfoVO userVipInfoVO = new UserVipInfoVO();
|
|
|
userVipInfoVO.setIsVip(dbUserInfo.getIsVip());
|
|
|
userVipInfoVO.setOpenid(dbUserInfo.getOpenid());
|
|
|
+ userVipInfoVO.setHeadImage(dbUserInfo.getHeadImage());
|
|
|
+ userVipInfoVO.setNickName(dbUserInfo.getNickName());
|
|
|
userVipInfoVO.setSign(getSign(dbUserInfo.getIsVip(),dbUserInfo.getOpenid()));
|
|
|
return Response.success(userVipInfoVO);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取用户详细信息
|
|
|
+ */
|
|
|
+ @PutMapping(value = "/userInfo")
|
|
|
+ @ApiOperation("更新用户头像和昵称")
|
|
|
+ public Response updateInfo(String headImage,String nickName
|
|
|
+ ) throws Exception {
|
|
|
+ Long id = SecurityUtils.getLoginUser().getStudent().getId();
|
|
|
+ UserInfo dbUserInfo = userInfoService.getById(id);
|
|
|
+ dbUserInfo.setHeadImage(nickName);
|
|
|
+ dbUserInfo.setHeadImage(headImage);
|
|
|
+ return Response.success(userInfoService.updateById(dbUserInfo));
|
|
|
+ }
|
|
|
+
|
|
|
private String getSign(Integer isVip, String openid) throws Exception {
|
|
|
String str = openid+isVip;
|
|
|
// 进行签名服务
|