Browse Source

update agree friend

master
DengBiao 1 year ago
parent
commit
0e0d2370e4
2 changed files with 3 additions and 6 deletions
  1. +1
    -4
      internal/logic/domain/friend/friend_service.go
  2. +2
    -2
      test/tcp_conn/main.go

+ 1
- 4
internal/logic/domain/friend/friend_service.go View File

@@ -131,13 +131,10 @@ func (*friendService) AgreeAddFriend(ctx context.Context, userId, friendId int64
return err return err
} }


newFriend, err := FriendRepo.Get(friendId, userId)
newFriend, err := FriendRepo.Get(userId, friendId)
if newFriend != nil && newFriend.Status != FriendStatusAgree { if newFriend != nil && newFriend.Status != FriendStatusAgree {
newFriend.Status = FriendStatusAgree newFriend.Status = FriendStatusAgree
err = FriendRepo.Save(newFriend) err = FriendRepo.Save(newFriend)
if err != nil {
return err
}
} else { } else {
now := time.Now() now := time.Now()
err = FriendRepo.Save(&Friend{ err = FriendRepo.Save(&Friend{


+ 2
- 2
test/tcp_conn/main.go View File

@@ -67,7 +67,7 @@ func (c *TcpClient) Output(pt pb.PackageType, requestId int64, message proto.Mes
func (c *TcpClient) Start() { func (c *TcpClient) Start() {


//connect, err := net.Dial("tcp", "111.229.238.28:8080") //connect, err := net.Dial("tcp", "111.229.238.28:8080")
connect, err := net.Dial("tcp", "im-tcp-connect.zhiyingos.com:8001")
connect, err := net.Dial("tcp", "im-tcp-connect.izhyin.com:8001")
if err != nil { if err != nil {
log.Println(err) log.Println(err)
return return
@@ -87,7 +87,7 @@ func (c *TcpClient) SignIn() {
signIn := pb.SignInInput{ signIn := pb.SignInInput{
UserId: c.UserId, UserId: c.UserId,
DeviceId: c.DeviceId, DeviceId: c.DeviceId,
Token: "HBMHCHQOVQDTPUVSBBCDEWGGOVPKFRAAZGQXKJNA",
Token: "ZDNMWLHJYMDYHKBWESEVHQWXFPCLAGMIUWFOHWNI",
} }
c.Output(pb.PackageType_PT_SIGN_IN, time.Now().UnixNano(), &signIn) c.Output(pb.PackageType_PT_SIGN_IN, time.Now().UnixNano(), &signIn)
} }


Loading…
Cancel
Save