merge: 合并feature-ip-location分支到master

This commit is contained in:
bao
2026-01-09 09:40:39 +08:00
18 changed files with 382 additions and 1 deletions

View File

@@ -69,3 +69,11 @@ aliyun:
region-id: cn-hangzhou
sign-name: 速通互联验证码
template-code: 100001
# ip2location.io 相关配置
ip2location:
api:
key: 95F4AB991174E296AFD5AD0EF927B2ED # ip2location.io API密钥
url: https://api.ip2location.io/
timeout: 5000 # 请求超时时间(毫秒)

View File

@@ -24,4 +24,8 @@
</foreach>
</delete>
<!-- 查询所有收藏动态 -->
<select id="showAllFavorites" resultType="com.bao.dating.pojo.entity.Post">
SELECT * FROM post WHERE post_id IN (SELECT post_id FROM post_favorite WHERE user_id = #{userid})
</select>
</mapper>

View File

@@ -3,6 +3,10 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bao.dating.mapper.UserMapper">
<!-- 向数据库中添加用户 -->
<insert id="saveUser">
insert into user(user_id,user_name,password_hash,salt,created_at,updated_at) values (#{userId},#{userName},#{passwordHash},#{salt},#{createdAt},#{updatedAt})
</insert>
<!--根据用户名查询用户-->
<select id="getByUsername" resultType="com.bao.dating.pojo.entity.User">
@@ -45,6 +49,16 @@
FROM user WHERE user_id = #{userId}
</select>
<!-- 查询最大用户id -->
<select id="selectMaxId" resultType="java.lang.Long">
SELECT MAX(user_id) FROM user
</select>
<!-- 根据邮箱查询用户信息 -->
<select id="selectByUserEmailUser" resultType="com.bao.dating.pojo.entity.User">
select * from user where user_email = #{userEmail}
</select>
<!--根据ID更新动态-->
<update id="updateUserInfoByUserId">
UPDATE user