小程序用户信息修改接口
This commit is contained in:
@@ -54,9 +54,14 @@ public class UShopUserController {
|
||||
return shopUserService.getCode(StpKit.USER.getLoginIdAsLong(), shopId == null ? StpKit.USER.getShopId() : shopId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加入会员
|
||||
* @param shopUserAddDTO 会员信息
|
||||
* @return 是否成功
|
||||
*/
|
||||
@PostMapping
|
||||
public CzgResult<Boolean> join(@RequestBody @Validated ShopUserAddDTO shopUserAddDTO) {
|
||||
return shopUserService.join(StpKit.USER.getShopId(), StpKit.USER.getLoginIdAsLong(), shopUserAddDTO);
|
||||
return CzgResult.success(shopUserService.join(StpKit.USER.getShopId(), StpKit.USER.getLoginIdAsLong(), shopUserAddDTO));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class UserAuthorizationController {
|
||||
*/
|
||||
@PostMapping("/test")
|
||||
public CzgResult<String> login() {
|
||||
StpKit.USER.login(1L, "2342", null, MyStpLogic.LoginType.USER, false);
|
||||
StpKit.USER.login(103L, "2342", null, MyStpLogic.LoginType.USER, false);
|
||||
return CzgResult.success(StpKit.USER.getTokenValue());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.czg.account.dto.user.userinfo.UserInfoDTO;
|
||||
import com.czg.account.dto.user.userinfo.UserInfoEditDTO;
|
||||
import com.czg.account.dto.user.userinfo.UserInfoPwdEditDTO;
|
||||
import com.czg.account.entity.UserInfo;
|
||||
import com.czg.account.service.UserInfoService;
|
||||
import com.czg.resp.CzgResult;
|
||||
@@ -37,9 +38,28 @@ public class UserController {
|
||||
*/
|
||||
@PutMapping
|
||||
public CzgResult<Boolean> update(@RequestBody UserInfoEditDTO userInfoEditDTO) {
|
||||
return CzgResult.success(userInfoService.update(BeanUtil.copyProperties(userInfoEditDTO, UserInfo.class),
|
||||
new QueryWrapper().eq(UserInfo::getId, StpKit.USER.getLoginIdAsLong())));
|
||||
return CzgResult.success(userInfoService.updateInfo( StpKit.USER.getLoginIdAsLong(), userInfoEditDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户密码修改
|
||||
* @return 是否成功
|
||||
*/
|
||||
@PutMapping("/pwd")
|
||||
public CzgResult<Boolean> updatePwd(@RequestBody UserInfoPwdEditDTO userInfoPwdEditDTO) {
|
||||
return CzgResult.success(userInfoService.updatePwd(StpKit.USER.getLoginIdAsLong(), userInfoPwdEditDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证码获取
|
||||
* @return 是否获取成功
|
||||
*/
|
||||
@GetMapping("/code")
|
||||
public CzgResult<Boolean> sendSmsCode() {
|
||||
return CzgResult.success(userInfoService.getCode(StpKit.USER.getLoginIdAsLong(), "wxMiniPwd"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user