mirror of
https://gitee.com/bookshelfplus/bookshelfplus
synced 2025-09-17 23:46:12 +08:00
第三方快捷登录前端按钮;后端跳转逻辑;数据库映射完成
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<?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="plus.bookshelf.Dao.Mapper.ThirdPartyUserAuthDOMapper">
|
||||
<resultMap id="BaseResultMap" type="plus.bookshelf.Dao.DO.ThirdPartyUserAuthDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<result column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
<result column="third_party_user_id" jdbcType="VARCHAR" property="thirdPartyUserId" />
|
||||
</resultMap>
|
||||
<insert id="insert" parameterType="plus.bookshelf.Dao.DO.ThirdPartyUserAuthDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
insert into third_party_user_auth_relation (id, user_id, third_party_user_id
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR}, #{thirdPartyUserId,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="plus.bookshelf.Dao.DO.ThirdPartyUserAuthDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
insert into third_party_user_auth_relation
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="thirdPartyUserId != null">
|
||||
third_party_user_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="thirdPartyUserId != null">
|
||||
#{thirdPartyUserId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
</mapper>
|
@@ -0,0 +1,280 @@
|
||||
<?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="plus.bookshelf.Dao.Mapper.ThirdPartyUserDOMapper">
|
||||
<resultMap id="BaseResultMap" type="plus.bookshelf.Dao.DO.ThirdPartyUserDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="uuid" jdbcType="VARCHAR" property="uuid" />
|
||||
<result column="source" jdbcType="VARCHAR" property="source" />
|
||||
<result column="access_token" jdbcType="VARCHAR" property="accessToken" />
|
||||
<result column="expire_in" jdbcType="INTEGER" property="expireIn" />
|
||||
<result column="refresh_token" jdbcType="VARCHAR" property="refreshToken" />
|
||||
<result column="open_id" jdbcType="VARCHAR" property="openId" />
|
||||
<result column="uid" jdbcType="VARCHAR" property="uid" />
|
||||
<result column="access_code" jdbcType="VARCHAR" property="accessCode" />
|
||||
<result column="union_id" jdbcType="VARCHAR" property="unionId" />
|
||||
<result column="scope" jdbcType="VARCHAR" property="scope" />
|
||||
<result column="token_type" jdbcType="VARCHAR" property="tokenType" />
|
||||
<result column="id_token" jdbcType="VARCHAR" property="idToken" />
|
||||
<result column="mac_algorithm" jdbcType="VARCHAR" property="macAlgorithm" />
|
||||
<result column="mac_key" jdbcType="VARCHAR" property="macKey" />
|
||||
<result column="code" jdbcType="VARCHAR" property="code" />
|
||||
<result column="oauth_token" jdbcType="VARCHAR" property="oauthToken" />
|
||||
<result column="oauth_token_secret" jdbcType="VARCHAR" property="oauthTokenSecret" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
id, uuid, `source`, access_token, expire_in, refresh_token, open_id, `uid`, access_code,
|
||||
union_id, `scope`, token_type, id_token, mac_algorithm, mac_key, code, oauth_token,
|
||||
oauth_token_secret
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from third_party_user_info
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
delete from third_party_user_info
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="plus.bookshelf.Dao.DO.ThirdPartyUserDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
insert into third_party_user_info (id, uuid, `source`,
|
||||
access_token, expire_in, refresh_token,
|
||||
open_id, `uid`, access_code,
|
||||
union_id, `scope`, token_type,
|
||||
id_token, mac_algorithm, mac_key,
|
||||
code, oauth_token, oauth_token_secret
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER}, #{uuid,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR},
|
||||
#{accessToken,jdbcType=VARCHAR}, #{expireIn,jdbcType=INTEGER}, #{refreshToken,jdbcType=VARCHAR},
|
||||
#{openId,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{accessCode,jdbcType=VARCHAR},
|
||||
#{unionId,jdbcType=VARCHAR}, #{scope,jdbcType=VARCHAR}, #{tokenType,jdbcType=VARCHAR},
|
||||
#{idToken,jdbcType=VARCHAR}, #{macAlgorithm,jdbcType=VARCHAR}, #{macKey,jdbcType=VARCHAR},
|
||||
#{code,jdbcType=VARCHAR}, #{oauthToken,jdbcType=VARCHAR}, #{oauthTokenSecret,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="plus.bookshelf.Dao.DO.ThirdPartyUserDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
insert into third_party_user_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="uuid != null">
|
||||
uuid,
|
||||
</if>
|
||||
<if test="source != null">
|
||||
`source`,
|
||||
</if>
|
||||
<if test="accessToken != null">
|
||||
access_token,
|
||||
</if>
|
||||
<if test="expireIn != null">
|
||||
expire_in,
|
||||
</if>
|
||||
<if test="refreshToken != null">
|
||||
refresh_token,
|
||||
</if>
|
||||
<if test="openId != null">
|
||||
open_id,
|
||||
</if>
|
||||
<if test="uid != null">
|
||||
`uid`,
|
||||
</if>
|
||||
<if test="accessCode != null">
|
||||
access_code,
|
||||
</if>
|
||||
<if test="unionId != null">
|
||||
union_id,
|
||||
</if>
|
||||
<if test="scope != null">
|
||||
`scope`,
|
||||
</if>
|
||||
<if test="tokenType != null">
|
||||
token_type,
|
||||
</if>
|
||||
<if test="idToken != null">
|
||||
id_token,
|
||||
</if>
|
||||
<if test="macAlgorithm != null">
|
||||
mac_algorithm,
|
||||
</if>
|
||||
<if test="macKey != null">
|
||||
mac_key,
|
||||
</if>
|
||||
<if test="code != null">
|
||||
code,
|
||||
</if>
|
||||
<if test="oauthToken != null">
|
||||
oauth_token,
|
||||
</if>
|
||||
<if test="oauthTokenSecret != null">
|
||||
oauth_token_secret,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="uuid != null">
|
||||
#{uuid,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="source != null">
|
||||
#{source,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="accessToken != null">
|
||||
#{accessToken,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="expireIn != null">
|
||||
#{expireIn,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="refreshToken != null">
|
||||
#{refreshToken,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="openId != null">
|
||||
#{openId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="uid != null">
|
||||
#{uid,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="accessCode != null">
|
||||
#{accessCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="unionId != null">
|
||||
#{unionId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="scope != null">
|
||||
#{scope,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tokenType != null">
|
||||
#{tokenType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="idToken != null">
|
||||
#{idToken,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="macAlgorithm != null">
|
||||
#{macAlgorithm,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="macKey != null">
|
||||
#{macKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="code != null">
|
||||
#{code,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="oauthToken != null">
|
||||
#{oauthToken,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="oauthTokenSecret != null">
|
||||
#{oauthTokenSecret,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="plus.bookshelf.Dao.DO.ThirdPartyUserDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update third_party_user_info
|
||||
<set>
|
||||
<if test="uuid != null">
|
||||
uuid = #{uuid,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="source != null">
|
||||
`source` = #{source,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="accessToken != null">
|
||||
access_token = #{accessToken,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="expireIn != null">
|
||||
expire_in = #{expireIn,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="refreshToken != null">
|
||||
refresh_token = #{refreshToken,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="openId != null">
|
||||
open_id = #{openId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="uid != null">
|
||||
`uid` = #{uid,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="accessCode != null">
|
||||
access_code = #{accessCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="unionId != null">
|
||||
union_id = #{unionId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="scope != null">
|
||||
`scope` = #{scope,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tokenType != null">
|
||||
token_type = #{tokenType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="idToken != null">
|
||||
id_token = #{idToken,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="macAlgorithm != null">
|
||||
mac_algorithm = #{macAlgorithm,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="macKey != null">
|
||||
mac_key = #{macKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="code != null">
|
||||
code = #{code,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="oauthToken != null">
|
||||
oauth_token = #{oauthToken,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="oauthTokenSecret != null">
|
||||
oauth_token_secret = #{oauthTokenSecret,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="plus.bookshelf.Dao.DO.ThirdPartyUserDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update third_party_user_info
|
||||
set uuid = #{uuid,jdbcType=VARCHAR},
|
||||
`source` = #{source,jdbcType=VARCHAR},
|
||||
access_token = #{accessToken,jdbcType=VARCHAR},
|
||||
expire_in = #{expireIn,jdbcType=INTEGER},
|
||||
refresh_token = #{refreshToken,jdbcType=VARCHAR},
|
||||
open_id = #{openId,jdbcType=VARCHAR},
|
||||
`uid` = #{uid,jdbcType=VARCHAR},
|
||||
access_code = #{accessCode,jdbcType=VARCHAR},
|
||||
union_id = #{unionId,jdbcType=VARCHAR},
|
||||
`scope` = #{scope,jdbcType=VARCHAR},
|
||||
token_type = #{tokenType,jdbcType=VARCHAR},
|
||||
id_token = #{idToken,jdbcType=VARCHAR},
|
||||
mac_algorithm = #{macAlgorithm,jdbcType=VARCHAR},
|
||||
mac_key = #{macKey,jdbcType=VARCHAR},
|
||||
code = #{code,jdbcType=VARCHAR},
|
||||
oauth_token = #{oauthToken,jdbcType=VARCHAR},
|
||||
oauth_token_secret = #{oauthTokenSecret,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
@@ -76,9 +76,6 @@
|
||||
<!--<table tableName="book_info" domainObjectName="BookDO" enableCountByExample="false"-->
|
||||
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="true"-->
|
||||
<!-- selectByExampleQueryId="false"></table>-->
|
||||
<!--<table tableName="book_thumbnail_info" domainObjectName="ThumbnailDO" enableCountByExample="false"-->
|
||||
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
|
||||
<!-- selectByExampleQueryId="false"></table>-->
|
||||
<!--<table tableName="category_info" domainObjectName="CategoryDO" enableCountByExample="false"-->
|
||||
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
|
||||
<!-- selectByExampleQueryId="false"></table>-->
|
||||
@@ -91,5 +88,11 @@
|
||||
<!--<table tableName="user_info" domainObjectName="UserDO" enableCountByExample="false"-->
|
||||
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
|
||||
<!-- selectByExampleQueryId="false"></table>-->
|
||||
<!--<table tableName="third_party_user_info" domainObjectName="ThirdPartyUserDO" enableCountByExample="false"-->
|
||||
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
|
||||
<!-- selectByExampleQueryId="false"></table>-->
|
||||
<!--<table tableName="third_party_user_auth_relation" domainObjectName="ThirdPartyUserAuthDO" enableCountByExample="false"-->
|
||||
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
|
||||
<!-- selectByExampleQueryId="false"></table>-->
|
||||
</context>
|
||||
</generatorConfiguration>
|
@@ -0,0 +1,15 @@
|
||||
# 第三方登录 Client ID 和 Client Secret
|
||||
# Gitee
|
||||
thirdparty.gitee.clientid=
|
||||
thirdparty.gitee.clientsecret=
|
||||
thirdparty.gitee.redirecturi=
|
||||
|
||||
# GitHub
|
||||
thirdparty.github.clientid=
|
||||
thirdparty.github.clientsecret=
|
||||
thirdparty.github.redirecturi=
|
||||
|
||||
# QQ
|
||||
thirdparty.qq.clientid=
|
||||
thirdparty.qq.clientsecret=
|
||||
thirdparty.qq.redirecturi=
|
Reference in New Issue
Block a user