package cn.stylefeng.roses.kernel.customer.modular.controller;
|
|
import cn.stylefeng.roses.kernel.customer.api.pojo.CustomerInfoChangeAvatarPasswordRequest;
|
import cn.stylefeng.roses.kernel.customer.modular.service.CustomerService;
|
import cn.stylefeng.roses.kernel.rule.annotation.BusinessLog;
|
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
|
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
|
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.validation.annotation.Validated;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import javax.annotation.Resource;
|
|
/**
|
* C端用户个人信息修改
|
*
|
* @author fengshuonan
|
* @date 2021/6/18 16:28
|
*/
|
@Api(tags = "C端用户")
|
@RestController
|
@ApiResource(name = "C端用户个人信息修改")
|
public class CustomerInfoController {
|
|
@Resource
|
private CustomerService customerService;
|
|
/**
|
* 修改个人密码
|
*
|
* @author fengshuonan
|
* @date 2021/6/18 16:29
|
*/
|
@ApiOperation("修改个人密码")
|
@PostResource(name = "修改个人密码", path = "/customerInfo/updatePassword", requiredPermission = false)
|
@BusinessLog
|
public ResponseData<?> updatePassword(@RequestBody @Validated(CustomerInfoChangeAvatarPasswordRequest.changePassword.class) CustomerInfoChangeAvatarPasswordRequest req) {
|
this.customerService.updatePassword(req);
|
return new SuccessResponseData<>();
|
}
|
|
/**
|
* 修改个人头像
|
*
|
* @author fengshuonan
|
* @date 2021/6/18 16:29
|
*/
|
@PostResource(name = "修改个人头像", path = "/customerInfo/updateAvatar", requiredPermission = false)
|
@BusinessLog
|
public ResponseData<?> updateAvatar(@RequestBody @Validated(CustomerInfoChangeAvatarPasswordRequest.changeAvatar.class) CustomerInfoChangeAvatarPasswordRequest customerInfoRequest) {
|
this.customerService.updateAvatar(customerInfoRequest);
|
return new SuccessResponseData<>();
|
}
|
|
/**
|
* 重置个人秘钥
|
*
|
* @author fengshuonan
|
* @date 2021/7/20 10:44
|
*/
|
@PostResource(name = "重置个人秘钥", path = "/customerInfo/resetPersonalSecret", requiredPermission = false)
|
@BusinessLog
|
public ResponseData<String> resetPersonalSecret() {
|
String secret = customerService.updateSecret();
|
return new SuccessResponseData<>(secret);
|
}
|
|
}
|