调整
This commit is contained in:
parent
50ff791d56
commit
f150854ab2
@ -0,0 +1,22 @@
|
|||||||
|
package me.zhengjie.modules.front.domain.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel(value="LoginVo", description="用户登录返回数据")
|
||||||
|
public class BusUserVo implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户昵称")
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户头像")
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手机号码")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
}
|
@ -3,8 +3,10 @@ package me.zhengjie.modules.front.domain.dto;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class DeviceLogCriteria {
|
public class DeviceLogCriteria implements Serializable {
|
||||||
|
|
||||||
@ApiModelProperty(value = "页码", example = "1")
|
@ApiModelProperty(value = "页码", example = "1")
|
||||||
private Integer page = 1;
|
private Integer page = 1;
|
||||||
|
@ -4,9 +4,11 @@ import io.swagger.annotations.ApiModel;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ApiModel(value="LoginVo", description="用户登录返回数据")
|
@ApiModel(value="LoginVo", description="用户登录返回数据")
|
||||||
public class LoginVo {
|
public class LoginVo implements Serializable {
|
||||||
|
|
||||||
@ApiModelProperty(value = "用户登录密钥")
|
@ApiModelProperty(value = "用户登录密钥")
|
||||||
private String token;
|
private String token;
|
||||||
|
@ -3,8 +3,10 @@ package me.zhengjie.modules.front.domain.dto;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class MyDeviceCriteria {
|
public class MyDeviceCriteria implements Serializable {
|
||||||
|
|
||||||
@ApiModelProperty(value = "页码", example = "1")
|
@ApiModelProperty(value = "页码", example = "1")
|
||||||
private Integer page = 1;
|
private Integer page = 1;
|
||||||
|
@ -4,8 +4,10 @@ import com.alibaba.fastjson2.annotation.JSONField;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class WeChatMiniAuthorizeVo {
|
public class WeChatMiniAuthorizeVo implements Serializable {
|
||||||
|
|
||||||
@ApiModelProperty(value = "会话密钥")
|
@ApiModelProperty(value = "会话密钥")
|
||||||
@JSONField(name = "session_key")
|
@JSONField(name = "session_key")
|
||||||
|
@ -8,6 +8,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import me.zhengjie.annotation.Log;
|
import me.zhengjie.annotation.Log;
|
||||||
import me.zhengjie.config.properties.FileProperties;
|
import me.zhengjie.config.properties.FileProperties;
|
||||||
import me.zhengjie.exception.BadRequestException;
|
import me.zhengjie.exception.BadRequestException;
|
||||||
|
import me.zhengjie.modules.front.domain.dto.BusUserVo;
|
||||||
import me.zhengjie.modules.front.domain.dto.LoginVo;
|
import me.zhengjie.modules.front.domain.dto.LoginVo;
|
||||||
import me.zhengjie.modules.front.domain.dto.MyDeviceCriteria;
|
import me.zhengjie.modules.front.domain.dto.MyDeviceCriteria;
|
||||||
import me.zhengjie.modules.security.service.dto.JwtUserDto;
|
import me.zhengjie.modules.security.service.dto.JwtUserDto;
|
||||||
@ -21,6 +22,7 @@ import me.zhengjie.utils.SecurityUtils;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
@ -63,13 +65,13 @@ public class BusUserController {
|
|||||||
@Log("信息修改")
|
@Log("信息修改")
|
||||||
@ApiOperation("修改用户信息")
|
@ApiOperation("修改用户信息")
|
||||||
@PostMapping(value = "/update")
|
@PostMapping(value = "/update")
|
||||||
public ResponseEntity<String> updateInfo() {
|
public ResponseEntity<String> updateInfo(@Validated @RequestBody BusUserVo user) {
|
||||||
JwtUserDto jwtUser = (JwtUserDto) SecurityUtils.getCurrentUser();
|
JwtUserDto jwtUser = (JwtUserDto) SecurityUtils.getCurrentUser();
|
||||||
BusUser upd = new BusUser();
|
BusUser upd = new BusUser();
|
||||||
upd.setId(jwtUser.getUser().getId());
|
upd.setId(jwtUser.getUser().getId());
|
||||||
upd.setAvatar(jwtUser.getUser().getAvatarPath());
|
upd.setAvatar(user.getAvatar());
|
||||||
upd.setNickname(jwtUser.getUser().getNickName());
|
upd.setNickname(user.getNickname());
|
||||||
upd.setPhone(jwtUser.getUser().getPhone());
|
upd.setPhone(user.getPhone());
|
||||||
busUserService.updateById(upd);
|
busUserService.updateById(upd);
|
||||||
return new ResponseEntity<>("修改成功", HttpStatus.OK);
|
return new ResponseEntity<>("修改成功", HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user