菜单接口修改

This commit is contained in:
张松 2025-02-17 10:53:10 +08:00
parent 1daef6efba
commit 26a3aab8cb
4 changed files with 13 additions and 12 deletions

View File

@ -44,6 +44,10 @@ public class MenuAddDTO {
* 组件
*/
private String component;
/**
* 组件名称
*/
private String name;
/**
* 菜单排序
*/

View File

@ -38,6 +38,10 @@ public class MenuEditDTO {
* 组件
*/
private String component;
/**
* 组件名称
*/
private String name;
/**
* 菜单排序
*/

View File

@ -39,12 +39,6 @@ public class ShopUserAddDTO {
*/
private Integer sex;
/**
* 用户Id
*/
@NotNull(message = "用户id不为空")
private Long userId;
/**
* 账户积分
*/

View File

@ -109,12 +109,11 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
@Override
public Boolean add(Long shopId, ShopUserAddDTO shopUserAddDTO) {
long userCount = userInfoService.queryChain().eq(UserInfo::getId, shopUserAddDTO.getUserId()).count();
if (userCount == 0) {
throw new ApiNotPrintException("用户信息不存在");
}
long count = queryChain().eq(ShopUser::getShopId, shopId).eq(ShopUser::getUserId, shopUserAddDTO.getUserId()).count();
if (count > 0) {
UserInfo userInfo = userInfoService.queryChain().eq(UserInfo::getPhone, shopUserAddDTO.getPhone()).one();
if (userInfo == null) {
userInfo = BeanUtil.copyProperties(shopUserAddDTO, UserInfo.class);
userInfoService.save(userInfo);
}else {
throw new ApiNotPrintException("此用户已存在");
}