1.增加授权表对应实体类,第三方系统表增加授权码和秘钥字段
2.第三方系统查询和更新接口同步对本系统授权码和秘钥字段值回显和更新 授权表sql DROP TABLE IF EXISTS `auth_license`; CREATE TABLE `auth_license` ( `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, `appid` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, `apikey` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, `secretkey` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, `createDate` datetime(0) NULL DEFAULT NULL, `customerId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, `companyName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; SET FOREIGN_KEY_CHECKS = 1; 第三方系统表增加字段sql ALTER TABLE `basic_third_sys` ADD COLUMN `apikey` varchar(255) NULL COMMENT '第三方系统接口授权码' AFTER `thirdName`, ADD COLUMN `secretkey` varchar(255) NULL COMMENT '第三方系统接口秘钥' AFTER `apikey`;master
							parent
							
								
									bab023da04
								
							
						
					
					
						commit
						da7dfbcb50
					
				| @ -0,0 +1,36 @@ | |||||||
|  | package com.glxp.api.admin.dao.auth; | ||||||
|  | 
 | ||||||
|  | import com.glxp.api.admin.entity.auth.AuthLicense; | ||||||
|  | import org.apache.ibatis.annotations.Mapper; | ||||||
|  | import org.apache.ibatis.annotations.Param; | ||||||
|  | 
 | ||||||
|  | @Mapper | ||||||
|  | public interface AuthLicenseDao { | ||||||
|  | 
 | ||||||
|  |     AuthLicense get(String id); | ||||||
|  | 
 | ||||||
|  |     int save(AuthLicense authLicense); | ||||||
|  | 
 | ||||||
|  |     int update(AuthLicense authLicense); | ||||||
|  | 
 | ||||||
|  |     int remove(String appid); | ||||||
|  | 
 | ||||||
|  |     int romveByCustomerId(String customerId); | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 根据名称查询授权码和秘钥 | ||||||
|  |      * | ||||||
|  |      * @param name | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     AuthLicense selectLicenseByName(@Param("name") String name); | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 根据名称修改系统的授权码和秘钥 | ||||||
|  |      * | ||||||
|  |      * @param licenseApikey | ||||||
|  |      * @param secretkey | ||||||
|  |      * @param name | ||||||
|  |      */ | ||||||
|  |     void updateLicenseByName(@Param("apikey") String licenseApikey, @Param("secretkey") String secretkey, @Param("name") String name); | ||||||
|  | } | ||||||
| @ -0,0 +1,54 @@ | |||||||
|  | <?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.glxp.api.admin.dao.auth.AuthLicenseDao"> | ||||||
|  |     <select id="get" resultType="com.glxp.api.admin.entity.auth.AuthLicense"> | ||||||
|  |         SELECT * | ||||||
|  |         FROM auth_license | ||||||
|  |         where id = #{id} | ||||||
|  |     </select> | ||||||
|  |     <insert id="save" keyProperty="id" parameterType="com.glxp.api.admin.entity.auth.AuthLicense"> | ||||||
|  |         INSERT INTO auth_license(id, appid, name, apiKey, secretKey, createDate, customerId, companyName) | ||||||
|  |         values (#{id}, #{appid}, #{name,jdbcType=VARCHAR}, #{apiKey,jdbcType=VARCHAR}, | ||||||
|  |                 #{secretKey,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, #{customerId}, #{companyName}) | ||||||
|  |     </insert> | ||||||
|  | 
 | ||||||
|  |     <update id="update" parameterType="com.glxp.api.admin.entity.auth.AuthLicense"> | ||||||
|  |         UPDATE auth_license | ||||||
|  |         <set> | ||||||
|  |             <if test="appid != null">appid=#{appid},</if> | ||||||
|  |             <if test="name != null">name=#{name},</if> | ||||||
|  |             <if test="apiKey != null">apiKey=#{apiKey},</if> | ||||||
|  |             <if test="secretKey != null">secretKey=#{secretKey},</if> | ||||||
|  |             <if test="createDate != null">createDate=#{createDate}</if> | ||||||
|  |             <if test="customerId != null">customerId=#{customerId}</if> | ||||||
|  |             <if test="companyName != null">companyName=#{companyName}</if> | ||||||
|  |         </set> | ||||||
|  |         WHERE id=#{id} | ||||||
|  |     </update> | ||||||
|  | 
 | ||||||
|  |     <delete id="remove"> | ||||||
|  |         delete | ||||||
|  |         from auth_license | ||||||
|  |         where id = #{id} | ||||||
|  |     </delete> | ||||||
|  | 
 | ||||||
|  |     <delete id="romveByCustomerId"> | ||||||
|  |         delete | ||||||
|  |         from auth_license | ||||||
|  |         where customerId = #{customerId} | ||||||
|  |     </delete> | ||||||
|  | 
 | ||||||
|  |     <select id="selectLicenseByName" resultType="com.glxp.api.admin.entity.auth.AuthLicense"> | ||||||
|  |         select apikey, secretkey from auth_license where name = #{name} | ||||||
|  |     </select> | ||||||
|  | 
 | ||||||
|  |     <update id="updateLicenseByName"> | ||||||
|  |         update auth_license | ||||||
|  |         <set> | ||||||
|  |             <if test="apikey != null">apikey=#{apikey},</if> | ||||||
|  |             <if test="secretkey != null">secretkey=#{secretkey},</if> | ||||||
|  |         </set> | ||||||
|  |         where name = #{name} | ||||||
|  |     </update> | ||||||
|  | </mapper> | ||||||
					Loading…
					
					
				
		Reference in New Issue