init
This commit is contained in:
@@ -36,46 +36,46 @@ public class CurrentUserManager {
|
||||
|
||||
public CurrentUserInfoVo currentInfo() {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
CaiUser user = userService.getById(userId);
|
||||
User user = userService.getById(userId);
|
||||
CurrentUserInfoVo res = BeanConvertUtil.convertTo(user, CurrentUserInfoVo::new);
|
||||
CaiAnchor anchor = anchorService.getByUserId(userId);
|
||||
Anchor anchor = anchorService.getByUserId(userId);
|
||||
res.setOpenVideoStatus(anchor.getOpenVideoStatus());
|
||||
CaiUserCount userCount = userCountService.getByUserId(userId);
|
||||
UserCount userCount = userCountService.getByUserId(userId);
|
||||
res.setUserCount(BeanConvertUtil.convertTo(userCount, UserCountVo::new));
|
||||
CaiAccount account = accountService.getByUserId(userId);
|
||||
Account account = accountService.getByUserId(userId);
|
||||
res.setUserAccount(BeanConvertUtil.convertTo(account, UserAccountVo::new));
|
||||
List<CaiUserAlbum> userAlbums = userAlbumService.listByUserId(userId);
|
||||
List<UserAlbum> userAlbums = userAlbumService.listByUserId(userId);
|
||||
res.setUserAlbumList(BeanConvertUtil.convertListTo(userAlbums, UserAlbumDTO::new));
|
||||
return res;
|
||||
}
|
||||
|
||||
public UserAccountVo currentAccount(){
|
||||
Long userId = LoginHelper.getUserId();
|
||||
CaiAccount account = accountService.getByUserId(userId);
|
||||
Account account = accountService.getByUserId(userId);
|
||||
return BeanConvertUtil.convertTo(account,UserAccountVo::new);
|
||||
}
|
||||
|
||||
public AnchorVo anchorInfo() {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
CaiAnchor anchor = anchorService.getByUserId(userId);
|
||||
Anchor anchor = anchorService.getByUserId(userId);
|
||||
return BeanConvertUtil.convertTo(anchor,AnchorVo::new);
|
||||
}
|
||||
|
||||
public boolean anchorUpdate(AnchorUpdateReq anchorUpdate) {
|
||||
anchorUpdate.setUserId(LoginHelper.getUserId());
|
||||
boolean updateFlag = false;
|
||||
LambdaUpdateWrapper<CaiAnchor> update =
|
||||
Wrappers.lambdaUpdate(CaiAnchor.class).eq(CaiAnchor::getUserId, anchorUpdate.getUserId());
|
||||
LambdaUpdateWrapper<Anchor> update =
|
||||
Wrappers.lambdaUpdate(Anchor.class).eq(Anchor::getUserId, anchorUpdate.getUserId());
|
||||
if(anchorUpdate.getPrice() != null){
|
||||
update.set(CaiAnchor::getPrice,anchorUpdate.getPrice());
|
||||
update.set(Anchor::getPrice,anchorUpdate.getPrice());
|
||||
updateFlag=true;
|
||||
}
|
||||
if(anchorUpdate.getOrderSwitch() != null){
|
||||
update.set(CaiAnchor::getOrderSwitch,anchorUpdate.getOrderSwitch());
|
||||
update.set(Anchor::getOrderSwitch,anchorUpdate.getOrderSwitch());
|
||||
updateFlag=true;
|
||||
}
|
||||
if(anchorUpdate.getOpenVideoStatus() != null){
|
||||
update.set(CaiAnchor::getOpenVideoStatus,anchorUpdate.getOpenVideoStatus());
|
||||
update.set(Anchor::getOpenVideoStatus,anchorUpdate.getOpenVideoStatus());
|
||||
updateFlag=true;
|
||||
}
|
||||
if(updateFlag){
|
||||
@@ -87,23 +87,23 @@ public class CurrentUserManager {
|
||||
public boolean userUpdate(UserUpdateReq res) {
|
||||
res.setUserId(LoginHelper.getUserId());
|
||||
boolean updateFlag = false;
|
||||
LambdaUpdateWrapper<CaiUser> update =
|
||||
Wrappers.lambdaUpdate(CaiUser.class).eq(CaiUser::getId, res.getUserId());
|
||||
LambdaUpdateWrapper<User> update =
|
||||
Wrappers.lambdaUpdate(User.class).eq(User::getId, res.getUserId());
|
||||
if(StringUtils.isNotEmpty(res.getNickname())){
|
||||
update.set(CaiUser::getNickname,res.getNickname());
|
||||
update.set(User::getNickname,res.getNickname());
|
||||
updateFlag=true;
|
||||
}
|
||||
if(res.getBirthday() != null){
|
||||
update.set(CaiUser::getBirthday,res.getBirthday());
|
||||
update.set(User::getBirthday,res.getBirthday());
|
||||
updateFlag=true;
|
||||
}
|
||||
if(res.getCity() != null){
|
||||
update.set(CaiUser::getCity,res.getCity());
|
||||
update.set(User::getCity,res.getCity());
|
||||
updateFlag=true;
|
||||
}
|
||||
if(StringUtils.isNotEmpty(res.getAvatar())){
|
||||
update.set(CaiUser::getAvatar,res.getAvatar());
|
||||
update.set(CaiUser::getAvatarState,1);
|
||||
update.set(User::getAvatar,res.getAvatar());
|
||||
update.set(User::getAvatarState,1);
|
||||
updateFlag=true;
|
||||
}
|
||||
if(updateFlag){
|
||||
@@ -115,14 +115,14 @@ public class CurrentUserManager {
|
||||
return true;
|
||||
}
|
||||
|
||||
public CaiAccountBankcard aliInfo() {
|
||||
return accountBankcardService.getOne(Wrappers.lambdaQuery(CaiAccountBankcard.class)
|
||||
.eq(CaiAccountBankcard::getUserId, LoginHelper.getUserId())
|
||||
public AccountBankcard aliInfo() {
|
||||
return accountBankcardService.getOne(Wrappers.lambdaQuery(AccountBankcard.class)
|
||||
.eq(AccountBankcard::getUserId, LoginHelper.getUserId())
|
||||
.last("limit 1"));
|
||||
}
|
||||
|
||||
public void saveOrUpdateAliInfo(AccountAliBankCardRes res) {
|
||||
CaiAccountBankcard bankcard = new CaiAccountBankcard();
|
||||
AccountBankcard bankcard = new AccountBankcard();
|
||||
bankcard.setId(res.getId());
|
||||
if(bankcard.getId() == null){
|
||||
bankcard.setType(1);
|
||||
|
||||
Reference in New Issue
Block a user