mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-03-25 10:33:43 +08:00
添加知识库权限控制功能
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package org.ruoyi.mapper;
|
||||
|
||||
import org.ruoyi.core.mapper.BaseMapperPlus;
|
||||
import org.ruoyi.domain.KnowledgeRoleGroup;
|
||||
import org.ruoyi.domain.vo.KnowledgeRoleGroupVo;
|
||||
|
||||
/**
|
||||
* 知识库角色组Mapper接口
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-07-19
|
||||
*/
|
||||
public interface KnowledgeRoleGroupMapper extends BaseMapperPlus<KnowledgeRoleGroup, KnowledgeRoleGroupVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.ruoyi.mapper;
|
||||
|
||||
import org.ruoyi.core.mapper.BaseMapperPlus;
|
||||
import org.ruoyi.domain.KnowledgeRole;
|
||||
import org.ruoyi.domain.vo.KnowledgeRoleVo;
|
||||
|
||||
/**
|
||||
* 知识库角色Mapper接口
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-07-19
|
||||
*/
|
||||
public interface KnowledgeRoleMapper extends BaseMapperPlus<KnowledgeRole, KnowledgeRoleVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package org.ruoyi.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.ruoyi.core.mapper.BaseMapperPlus;
|
||||
import org.ruoyi.domain.KnowledgeRoleRelation;
|
||||
import org.ruoyi.domain.vo.KnowledgeRoleRelationVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 知识库角色与知识库关联Mapper接口
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-07-19
|
||||
*/
|
||||
public interface KnowledgeRoleRelationMapper extends BaseMapperPlus<KnowledgeRoleRelation, KnowledgeRoleRelationVo> {
|
||||
@Select("SELECT knowledge_id FROM knowledge_role_relation WHERE knowledge_role_id = #{knowledgeRoleId}")
|
||||
List<Long> selectKnowledgeIdsByRoleId(@Param("knowledgeRoleId") Long knowledgeRoleId);
|
||||
|
||||
/**
|
||||
* 根据 roleId 删除所有关联
|
||||
*/
|
||||
@Delete("DELETE FROM knowledge_role_relation WHERE knowledge_role_id = #{knowledgeRoleId}")
|
||||
void deleteByRoleId(@Param("knowledgeRoleId") Long knowledgeRoleId);
|
||||
|
||||
@Delete({
|
||||
"<script>",
|
||||
"DELETE FROM knowledge_role_relation",
|
||||
"WHERE knowledge_role_id IN",
|
||||
"<foreach collection='knowledgeRoleIds' item='id' open='(' separator=',' close=')'>",
|
||||
"#{id}",
|
||||
"</foreach>",
|
||||
"</script>"
|
||||
})
|
||||
void deleteByRoleIds(@Param("knowledgeRoleIds") List<Long> knowledgeRoleIds);
|
||||
}
|
||||
Reference in New Issue
Block a user