Browse Source

update

master
DengBiao 8 months ago
parent
commit
21976ba3ef
2 changed files with 4 additions and 0 deletions
  1. +3
    -0
      internal/logic/domain/friend/friend_service.go
  2. +1
    -0
      pkg/gerrors/define.go

+ 3
- 0
internal/logic/domain/friend/friend_service.go View File

@@ -67,6 +67,9 @@ func (*friendService) DeleteFriend(ctx context.Context, userId, friendId int64)

// AddFriend 添加好友
func (*friendService) AddFriend(ctx context.Context, userId, friendId int64, remarks, description string) error {
if userId == friendId {
return gerrors.ErrNotAllowAddSelf
}
masterId, _ := grpclib.GetCtxMasterId(ctx)
isAutoAddFriends := svc.SysCfgGet(masterId, "is_auto_add_friends")



+ 1
- 0
pkg/gerrors/define.go View File

@@ -18,6 +18,7 @@ var (
ErrAlreadyIsFriend = newError(10015, "对方已经是好友了")
ErrUserNotFound = newError(10016, "用户找不到")
ErrNotIsFriend = newError(10017, "对方暂不是好友")
ErrNotAllowAddSelf = newError(10018, "不允许添加自己为好友")
)

func newError(code int, message string) error {


Loading…
Cancel
Save