菜单接口修改
This commit is contained in:
@@ -44,6 +44,10 @@ public class MenuAddDTO {
|
|||||||
* 组件
|
* 组件
|
||||||
*/
|
*/
|
||||||
private String component;
|
private String component;
|
||||||
|
/**
|
||||||
|
* 组件名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
/**
|
/**
|
||||||
* 菜单排序
|
* 菜单排序
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ public class MenuEditDTO {
|
|||||||
* 组件
|
* 组件
|
||||||
*/
|
*/
|
||||||
private String component;
|
private String component;
|
||||||
|
/**
|
||||||
|
* 组件名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
/**
|
/**
|
||||||
* 菜单排序
|
* 菜单排序
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -39,12 +39,6 @@ public class ShopUserAddDTO {
|
|||||||
*/
|
*/
|
||||||
private Integer sex;
|
private Integer sex;
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户Id
|
|
||||||
*/
|
|
||||||
@NotNull(message = "用户id不为空")
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账户积分
|
* 账户积分
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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("此用户已存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user