我的--新增关注--修改--添加数据库查询字段

This commit is contained in:
haotian 2025-02-13 15:57:53 +08:00
parent 1ea386d6c9
commit cefd1adb20
2 changed files with 8 additions and 2 deletions

View File

@ -1462,6 +1462,8 @@ public class AppSystemController extends BaseController {
{
Long userId = getUserId();
System.out.println("userId: "+userId+" followedUserId: "+followedUserId);
// 删除关注数据
userFollowService.deleteSysUserFollowByUserIdAndFollowedUserId(userId, followedUserId);
@ -1510,6 +1512,10 @@ public class AppSystemController extends BaseController {
sysUserFollow1.setFollowedUserId(userId);
List<SysUserFollow> userFollowList1 = userFollowService.selectSysUserFollowList(sysUserFollow1);
System.out.println("userFollowList1: "+userFollowList1.size());
SysUserFollow userFollow = userFollowList1.get(0);
System.out.println("userFollow: "+userFollow + "status"+ userFollow.getFollowStatus());
if(userFollowList1.size() > 0 && userFollowList1.get(0).getFollowStatus().equals("0")){
// 互相关注
sysUserFollow.setFollowStatus("1");

View File

@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectSysUserFollowVo">
select id, user_id, followed_user_id, status, create_time, update_time from sys_user_follow
select id, user_id, followed_user_id, status, follow_status,create_time, update_time from sys_user_follow
</sql>
<select id="selectSysUserFollowList" parameterType="SysUserFollow" resultMap="SysUserFollowResult">
@ -34,7 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null "> and user_id = #{userId}</if>
<if test="followedUserId != null "> and followed_user_id = #{followedUserId}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="followStatus != null and followStatus != ''"> and follow_status = #{followStatus}</if>
<if test="followStatus != null and followStatus != ''"> and follow_status = #{followStatus}</if>
</where>
</select>