Merge #4 into master from cc_20251027_new2
fix:小程序菜单 * cc_20251027_new2: (3 commits squashed) - feat:小程序菜单配置 - Merge branch 'refs/heads/master' into cc_20251027_new2 - fix:小程序菜单 Signed-off-by: 王非凡 <accounts_67eba0c5fee9c49c80c8e2b4@mail.teambition.com> Reviewed-by: 苏竹红 <accounts_68551bf01395375227aee211@mail.teambition.com> Merged-by: 苏竹红 <accounts_68551bf01395375227aee211@mail.teambition.com> CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/4
This commit is contained in:
@@ -60,4 +60,21 @@ public class SysRoleDao {
|
||||
return sysRoleDOS.stream().collect(Collectors.toMap(k->k.getId(), v->v.getRoleName(), (k1, k2)->k1));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询优先级最高的角色
|
||||
* @param userId 用户id
|
||||
* @return 角色
|
||||
*/
|
||||
public SysRoleDO getHighestPrioritySysRoleDoByUserId(String userId) {
|
||||
return sysRoleMapper.getHighestPrioritySysRoleDoByUserId(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据角色枚举查询角色
|
||||
* @param roleEnum 角色枚举
|
||||
* @return 角色
|
||||
*/
|
||||
public SysRoleDO getRoleByRoleEnum(String roleEnum) {
|
||||
return sysRoleMapper.getRoleByRoleEnum(roleEnum);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.cool.store.dao.menu;
|
||||
|
||||
import com.cool.store.entity.menu.MiniMenuConfigDO;
|
||||
import com.cool.store.mapper.menu.MiniMenuConfigMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 小程序菜单配置
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/10/31
|
||||
*/
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class MiniMenuConfigDAO {
|
||||
private final MiniMenuConfigMapper miniMenuConfigMapper;
|
||||
|
||||
/**
|
||||
* 根据角色id查询
|
||||
* @param roleId 角色id
|
||||
* @return 菜单配置列表
|
||||
*/
|
||||
public List<MiniMenuConfigDO> getListByRoleId(Long roleId) {
|
||||
return miniMenuConfigMapper.select(MiniMenuConfigDO.builder().roleId(roleId).build());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.cool.store.dao.menu;
|
||||
|
||||
import com.cool.store.entity.menu.MiniMenuDO;
|
||||
import com.cool.store.mapper.menu.MiniMenuMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 小程序菜单DAO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/28
|
||||
*/
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class MiniMenuDAO {
|
||||
private final MiniMenuMapper miniMenuMapper;
|
||||
|
||||
public List<MiniMenuDO> getByIds(List<Long> ids) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
Example example = new Example(MiniMenuDO.class);
|
||||
example.createCriteria().andIn("id", ids);
|
||||
return miniMenuMapper.selectByExample(example);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.cool.store.mapper.menu;
|
||||
|
||||
import com.cool.store.entity.menu.MiniMenuConfigDO;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
public interface MiniMenuConfigMapper extends Mapper<MiniMenuConfigDO> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.cool.store.mapper.menu;
|
||||
|
||||
import com.cool.store.entity.menu.MiniMenuDO;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
public interface MiniMenuMapper extends Mapper<MiniMenuDO> {
|
||||
}
|
||||
Reference in New Issue
Block a user