菜单接口修改

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 component;
/**
* 组件名称
*/
private String name;
/** /**
* 菜单排序 * 菜单排序
*/ */

View File

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

View File

@@ -39,12 +39,6 @@ public class ShopUserAddDTO {
*/ */
private Integer sex; 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 @Override
public Boolean add(Long shopId, ShopUserAddDTO shopUserAddDTO) { public Boolean add(Long shopId, ShopUserAddDTO shopUserAddDTO) {
long userCount = userInfoService.queryChain().eq(UserInfo::getId, shopUserAddDTO.getUserId()).count(); UserInfo userInfo = userInfoService.queryChain().eq(UserInfo::getPhone, shopUserAddDTO.getPhone()).one();
if (userCount == 0) { if (userInfo == null) {
throw new ApiNotPrintException("用户信息不存在"); userInfo = BeanUtil.copyProperties(shopUserAddDTO, UserInfo.class);
} userInfoService.save(userInfo);
long count = queryChain().eq(ShopUser::getShopId, shopId).eq(ShopUser::getUserId, shopUserAddDTO.getUserId()).count(); }else {
if (count > 0) {
throw new ApiNotPrintException("此用户已存在"); throw new ApiNotPrintException("此用户已存在");
} }