From 4b8c23acbc429e899a9e7d2b89b9d5945d9cbb9e Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期三, 26 六月 2024 16:33:12 +0800 Subject: [PATCH] 删除原来设计的权限相关部分 --- /dev/null | 61 ------------------------------ pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaUser.java | 8 ---- pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaBlockMapper.java | 3 - pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoSv.java | 19 +-------- 4 files changed, 2 insertions(+), 89 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaBlockMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaBlockMapper.java index 6316a23..6c4af43 100644 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaBlockMapper.java +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaBlockMapper.java @@ -2,10 +2,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.dy.pipIrrGlobal.pojoBa.BaBlock; -import com.dy.pipIrrGlobal.pojoBa.BaClientType; -import com.dy.pipIrrGlobal.pojoBa.BaPrivilege; import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaPrivilegeMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaPrivilegeMapper.java deleted file mode 100644 index 9c9cca4..0000000 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaPrivilegeMapper.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.dy.pipIrrGlobal.daoBa; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.dy.pipIrrGlobal.pojoBa.BaPrivilege; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface BaPrivilegeMapper extends BaseMapper<BaPrivilege> { - - /** - * 鏌ヨ鍏ㄩ儴 - * @return List<BaPrivilege> - */ - List<BaPrivilege> selectAll() ; - - /** - * 鏌ヨ鏌愪釜鐢ㄦ埛鎵�闅跺睘鎵�鏈夎鑹茬殑鎵�鏈夋潈闄� - * @param userId 鐢ㄦ埛ID - * @return List<Integer> - */ - List<Integer> selectPrivilegeByUserId(@Param("userId") Long userId) ; - - /** - * 鏌ヨ鏌愪釜瑙掕壊鎵�闅跺睘浜庤瑙掕壊鐨勬墍鏈夋潈闄� - * @param roleId 鐢ㄦ埛ID - * @return List<Integer> - */ - List<Integer> selectPrivilegeByRoleId(@Param("roleId") Long roleId) ; - - /** - * insert record to table - * @param record the record - * @return insert count - */ - int putin(BaPrivilege record); - - /** - * insert record to table selective - * @param record the record - * @return insert count - */ - int insertSelective(BaPrivilege record); - -} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaRolePrivilegeMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaRolePrivilegeMapper.java deleted file mode 100644 index ea41c94..0000000 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaRolePrivilegeMapper.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.dy.pipIrrGlobal.daoBa; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.dy.pipIrrGlobal.pojoBa.BaRolePrivilege; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -@Mapper -public interface BaRolePrivilegeMapper extends BaseMapper<BaRolePrivilege> { - - /** - * insert record to table - * @param record the record - * @return insert count - */ - int putin(BaRolePrivilege record); - - /** - * insert record to table selective - * @param record the record - * @return insert count - */ - int insertSelective(BaRolePrivilege record); - - /** - * delete by primary key - * @param roleId primaryKey - * @param privilegeId primaryKey - * @return deleteCount - */ - int deleteByPrimaryKey(@Param("roleId") Long roleId, @Param("privilegeId") Long privilegeId); - - /** - * delete by roleId - * @param roleId 瑙掕壊ID - * @return deleteCount - */ - int deleteByRoleId(@Param("roleId") Long roleId); - - /** - * delete by roleId - * @param privilegeId 鏉冮檺ID - * @return deleteCount - */ - int deleteByPrivilegeId(@Param("privilegeId") Long privilegeId); - -} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaPrivilege.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaPrivilege.java deleted file mode 100644 index bbedf86..0000000 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaPrivilege.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.dy.pipIrrGlobal.pojoBa; - -import com.alibaba.fastjson2.annotation.JSONField; -import com.alibaba.fastjson2.writer.ObjectWriterImplToString; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.dy.common.po.BaseEntity; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; - -/** - * 鏉冮檺瀹炰綋 - */ -@TableName(value="ba_privilege", autoResultMap = true) -@Data -@Builder -@ToString -@NoArgsConstructor -@AllArgsConstructor -@Schema(name = "鏉冮檺瀹炰綋") -public class BaPrivilege implements BaseEntity { - - public static final long serialVersionUID = 202310211551001L; - - @JSONField(serializeUsing= ObjectWriterImplToString.class) - @TableId(type = IdType.INPUT) - private Long id; - /** - * 鏉冮檺缂栧彿 - */ - public Integer num; - /** - * 鏉冮檺鍚嶇О - */ - public String name; - /** - * 鏉冮檺绫诲埆 - */ - public String type; - -} diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaRolePrivilege.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaRolePrivilege.java deleted file mode 100644 index ccf3c1a..0000000 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaRolePrivilege.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.dy.pipIrrGlobal.pojoBa; - -import com.alibaba.fastjson2.annotation.JSONField; -import com.alibaba.fastjson2.writer.ObjectWriterImplToString; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.dy.common.po.BaseEntity; -import lombok.*; -/** - * 瑙掕壊涓庢潈闄愬叧绯诲疄浣� - */ -@TableName(value="ba_role_privilege", autoResultMap = true) -@Data -@Builder -@ToString -@NoArgsConstructor -@AllArgsConstructor -public class BaRolePrivilege implements BaseEntity { - - public static final long serialVersionUID = 202311062027001L; - - @JSONField(serializeUsing= ObjectWriterImplToString.class) - @TableField(value = "roleId") - public Long roleId; - - @JSONField(serializeUsing= ObjectWriterImplToString.class) - @TableField(value = "privilegeId") - public Long privilegeId; - -} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaUser.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaUser.java index a5bdf48..7f54c34 100644 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaUser.java +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaUser.java @@ -127,14 +127,6 @@ public List<?> roleList ; /** - * 鐢ㄦ埛鎵�鎷ユ湁鐨勬潈闄愶紝閽堝鐧诲綍搴旂敤 - */ - @Schema(hidden = true) - @TableField(exist = false) - @JSONField(serialize = false) - public List<Integer> privileges; - - /** * 鎵�灞炵墖鍖哄悕绉� */ @Schema(description = "鎵�灞炵墖鍖哄悕绉帮紝鐢ㄤ簬鏄剧ず锛岃〃鍗曚笉鐢ㄥ~鍐�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaPrivilegeMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaPrivilegeMapper.xml deleted file mode 100644 index 6af6bd3..0000000 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaPrivilegeMapper.xml +++ /dev/null @@ -1,88 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> -<mapper namespace="com.dy.pipIrrGlobal.daoBa.BaPrivilegeMapper"> - - <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoBa.BaPrivilege"> - <!--@mbg.generated--> - <!--@Table ba_privilege--> - <result column="id" jdbcType="BIGINT" property="id" /> - <result column="num" jdbcType="INTEGER" property="num" /> - <result column="name" jdbcType="VARCHAR" property="name" /> - <result column="type" jdbcType="VARCHAR" property="type" /> - </resultMap> - - <sql id="Base_Column_List"> - <!--@mbg.generated--> - id, num, name, type - </sql> - - <select id="selectAll" resultMap="BaseResultMap"> - select - <include refid="Base_Column_List" /> - from ba_privilege - </select> - - <select id="selectPrivilegeByUserId" resultType="Integer"> - select p.num - from ba_privilege p - inner join ba_role_privilege rp on p.id = rp.privilegeId - inner join ba_user_role ur on rp.roleId = ur.roleId - inner join ba_role r on ur.roleId = r.id - where r.deleted != 1 - <if test="userId != null"> - and ur.userId = #{userId, jdbcType=BIGINT} - </if> - </select> - - <select id="selectPrivilegeByRoleId" resultType="Integer"> - select p.num - from ba_privilege p - inner join ba_role_privilege rp on p.id = rp.privilegeId - <if test="roleId != null"> - where rp.roleId = #{roleId, jdbcType=BIGINT} - </if> - </select> - - <insert id="putin" parameterType="com.dy.pipIrrGlobal.pojoBa.BaPrivilege"> - <!--@mbg.generated--> - insert into ba_privilege (<include refid="Base_Column_List" />) - values (#{id,jdbcType=BIGINT}, - #{num,jdbcType=INTEGER}, - #{name,jdbcType=VARCHAR}, - #{type, jdbcType=VARCHAR} - ) - </insert> - - <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoBa.BaPrivilege"> - <!--@mbg.generated--> - insert into ba_privilege - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="id != null"> - id, - </if> - <if test="num != null"> - id, - </if> - <if test="name != null"> - name, - </if> - <if test="type != null"> - type, - </if> - </trim> - <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="id != null"> - #{id,jdbcType=BIGINT}, - </if> - <if test="num != null"> - #{name,jdbcType=INTEGER}, - </if> - <if test="name != null"> - #{name,jdbcType=VARCHAR}, - </if> - <if test="type != null"> - #{type,jdbcType=VARCHAR}, - </if> - </trim> - </insert> -</mapper> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaRolePrivilegeMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaRolePrivilegeMapper.xml deleted file mode 100644 index b90a5e9..0000000 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaRolePrivilegeMapper.xml +++ /dev/null @@ -1,61 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> -<mapper namespace="com.dy.pipIrrGlobal.daoBa.BaRolePrivilegeMapper"> - - <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoBa.BaRolePrivilege"> - <!--@mbg.generated--> - <!--@Table ba_role_privilege--> - <id column="roleId" jdbcType="BIGINT" property="roleId" /> - <id column="privilegeId" jdbcType="BIGINT" property="privilegeId" /> - </resultMap> - - <sql id="Base_Column_List"> - <!--@mbg.generated--> - roleId, privilegeId - </sql> - - <insert id="putin" parameterType="com.dy.pipIrrGlobal.pojoBa.BaRolePrivilege"> - <!--@mbg.generated--> - insert into ba_role_privilege (roleId, privilegeId) - values (#{roleId,jdbcType=BIGINT}, #{privilegeId,jdbcType=BIGINT}) - </insert> - - <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoBa.BaRolePrivilege"> - <!--@mbg.generated--> - insert into ba_role_privilege - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="roleId != null"> - roleId, - </if> - <if test="privilegeId != null"> - privilegeId, - </if> - </trim> - <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="roleId != null"> - #{roleId,jdbcType=BIGINT}, - </if> - <if test="privilegeId != null"> - #{privilegeId,jdbcType=BIGINT}, - </if> - </trim> - </insert> - - <delete id="deleteByPrimaryKey" parameterType="map"> - <!--@mbg.generated--> - delete from ba_role_privilege - where roleId = #{roleId,jdbcType=BIGINT} - and privilegeId = #{privilegeId,jdbcType=BIGINT} - </delete> - - <delete id="deleteByRoleId" parameterType="long"> - delete from ba_role_privilege - where roleId = #{roleId,jdbcType=BIGINT} - </delete> - - <delete id="deleteByPrivilegeId" parameterType="long"> - delete from ba_role_privilege - where privilegeId = #{privilegeId,jdbcType=BIGINT} - </delete> - -</mapper> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoSv.java index 52c1c6a..9dd39b3 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoSv.java @@ -1,7 +1,6 @@ package com.dy.sso.busi; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.dy.pipIrrGlobal.daoBa.BaPrivilegeMapper; import com.dy.pipIrrGlobal.daoBa.BaUserMapper; import com.dy.pipIrrGlobal.pojoBa.BaUser; import lombok.extern.slf4j.Slf4j; @@ -16,16 +15,10 @@ public class SsoSv { private BaUserMapper baUserMapper; - private BaPrivilegeMapper baPrivilegeMapper; @Autowired private void setBaUserMapper(BaUserMapper baUserMapper){ this.baUserMapper = baUserMapper ; - } - - @Autowired - private void setBaPrivilegeMapper(BaPrivilegeMapper baPrivilegeMapper){ - this.baPrivilegeMapper = baPrivilegeMapper ; } @@ -40,11 +33,7 @@ @Transactional @Cacheable(cacheNames=CacheConstants.cacheNames, key="'" + CacheConstants.loginUserKeyPrefix + "' + #uuid", sync=true) public BaUser loginWithMapperXml(String uuid, String phone, String password){ - BaUser baUser = this.baUserMapper.login(phone, password) ; - if(baUser != null && baUser.id != null){ - baUser.privileges = this.baPrivilegeMapper.selectPrivilegeByUserId(baUser.id) ; - } - return baUser; + return this.baUserMapper.login(phone, password) ; } /** @@ -65,11 +54,7 @@ .eq("deleted", 0) .eq("phone", phone) .eq("password", password); - BaUser baUser = this.baUserMapper.selectOne(qw) ; - if(baUser != null && baUser.id != null){ - baUser.privileges = this.baPrivilegeMapper.selectPrivilegeByUserId(baUser.id) ; - } - return baUser; + return this.baUserMapper.selectOne(qw) ; } @CacheEvict(cacheNames=CacheConstants.cacheNames, key="'" + CacheConstants.loginUserKeyPrefix + "' + #uuid") -- Gitblit v1.8.0