修复关注功能

This commit is contained in:
abu 2025-03-11 12:08:01 +08:00
parent 3a965937ab
commit 4a0f5bbe89
4 changed files with 29 additions and 12 deletions

View File

@ -18,17 +18,17 @@ spring:
max-lifetime: 18000000 # 连接池的最大生命时长毫秒超时则会被释放retired max-lifetime: 18000000 # 连接池的最大生命时长毫秒超时则会被释放retired
connection-test-query: SELECT 1 connection-test-query: SELECT 1
redis: redis:
host: 182.92.182.217 host: 82.156.121.2
port: 6379 port: 26379
password: '!aw5)lJf' password: e4ea0caebfd2
database: 1 # 使用的数据库编号 database: 1 # 使用的数据库编号
jedis: jedis:
pool: pool:
max-idle: 6 # 最大空闲连接 max-idle: 200 # 最大空闲连接
max-active: 32 # 连接池最大连接数 max-active: 200 # 连接池最大连接数
max-wait: 100 # 连接池最大阻塞等待时间, -1表示没有限制 max-wait: 100 # 连接池最大阻塞等待时间, -1表示没有限制
min-idle: 4 # 最小空闲连接 min-idle: 4 # 最小空闲连接
timeout: 50000 timeout: 5000
data: data:
mongodb: mongodb:
# uri: mongodb://root:root@192.168.1.202:27017 # uri: mongodb://root:root@192.168.1.202:27017

View File

@ -18,14 +18,14 @@ spring:
max-lifetime: 18000000 # 连接池的最大生命时长毫秒超时则会被释放retired max-lifetime: 18000000 # 连接池的最大生命时长毫秒超时则会被释放retired
connection-test-query: SELECT 1 connection-test-query: SELECT 1
redis: redis:
host: 182.92.182.217 host: 82.156.121.2
port: 6379 port: 26379
password: '!aw5)lJf' password: e4ea0caebfd2
database: 1 # 使用的数据库编号 database: 1 # 使用的数据库编号
jedis: jedis:
pool: pool:
max-idle: 6 # 最大空闲连接 max-idle: 200 # 最大空闲连接
max-active: 32 # 连接池最大连接数 max-active: 200 # 连接池最大连接数
max-wait: 100 # 连接池最大阻塞等待时间, -1表示没有限制 max-wait: 100 # 连接池最大阻塞等待时间, -1表示没有限制
min-idle: 4 # 最小空闲连接 min-idle: 4 # 最小空闲连接
timeout: 50000 timeout: 50000

View File

@ -3,6 +3,7 @@ package com.imooc.pojo;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import javax.persistence.Column; import javax.persistence.Column;
import java.util.Date;
public class Fans { public class Fans {
@Id @Id
@ -14,6 +15,10 @@ public class Fans {
@Column(name = "vloger_id") @Column(name = "vloger_id")
private String vlogerId; private String vlogerId;
@Column(name = "created_time")
private Date createdTime;
/** /**
* 粉丝用户id * 粉丝用户id
*/ */
@ -93,4 +98,15 @@ public class Fans {
public void setIsFanFriendOfMine(Integer isFanFriendOfMine) { public void setIsFanFriendOfMine(Integer isFanFriendOfMine) {
this.isFanFriendOfMine = isFanFriendOfMine; this.isFanFriendOfMine = isFanFriendOfMine;
} }
public void setCreateTime() {
}
public Date getCreatedTime() {
return createdTime;
}
public void setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
}
} }

View File

@ -23,6 +23,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example; import tk.mybatis.mapper.entity.Example;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -54,7 +55,7 @@ public class FansServiceImpl extends BaseInfoProperties implements FansService {
fans.setId(fid); fans.setId(fid);
fans.setFanId(myId); fans.setFanId(myId);
fans.setVlogerId(vlogerId); fans.setVlogerId(vlogerId);
fans.setCreatedTime(new Date());
// 判断对方是否关注我如果关注我那么双方都要互为朋友关系 // 判断对方是否关注我如果关注我那么双方都要互为朋友关系
Fans vloger = queryFansRelationship(vlogerId, myId); Fans vloger = queryFansRelationship(vlogerId, myId);
if (vloger != null) { if (vloger != null) {