Skip to content

Commit

Permalink
Merge pull request #43 from AndrewZuo01/main
Browse files Browse the repository at this point in the history
Add processUserCommand and pinFriend
  • Loading branch information
FGadvancer authored Dec 8, 2023
2 parents fedc2ac + 274bf5b commit 8259bf1
Show file tree
Hide file tree
Showing 4 changed files with 1,006 additions and 140 deletions.
6 changes: 3 additions & 3 deletions friend/friend.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (x *GetDesignatedFriendsApplyReq) Check() error {
return errors.New("ownerUserID is empty")
}
if x.ToUserID == "" {
return errors.New("ownerUserID is empty")
return errors.New("toUserID is empty")
}
return nil
}
Expand All @@ -188,7 +188,7 @@ func (x *PinFriendsReq) Check() error {
return errors.New("ownerUserID is empty")
}
if x.FriendUserIDs == nil {
return errors.New("ownerUserID is empty")
return errors.New("friendUserIDs is empty")
}
return nil
}
Expand All @@ -197,7 +197,7 @@ func (x *GetSpecifiedFriendsInfoReq) Check() error {
return errors.New("ownerUserID is empty")
}
if x.UserIDList == nil {
return errors.New("ownerUserID is empty")
return errors.New("userIDList is empty")
}
return nil
}
52 changes: 52 additions & 0 deletions user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,55 @@ func (x *GetSubscribeUsersStatusReq) Check() error {
}
return nil
}

func (x *ProcessUserCommandAddReq) Check() error {
if x.UserID == "" {
return errors.New("userID is empty")
}
if x.Type == 0 {
return errors.New("type is not specified")
}
if x.Uuid == "" {
return errors.New("UUID is empty")
}
if x.Value == "" {
return errors.New("value is empty")
}
return nil
}
func (x *ProcessUserCommandDeleteReq) Check() error {
if x.UserID == "" {
return errors.New("userID is empty")
}
if x.Type == 0 {
return errors.New("type is not specified")
}
if x.Uuid == "" {
return errors.New("UUID is empty")
}
return nil
}
func (x *ProcessUserCommandUpdateReq) Check() error {
if x.UserID == "" {
return errors.New("userID is empty")
}
if x.Type == 0 {
return errors.New("type is not specified")
}
if x.Uuid == "" {
return errors.New("UUID is empty")
}
if x.Value == "" {
return errors.New("value is empty")
}
return nil
}
func (x *ProcessUserCommandGetReq) Check() error {
if x.UserID == "" {
return errors.New("userID is empty")
}
if x.Type == 0 {
return errors.New("type is not specified")
}
return nil
}
Loading

0 comments on commit 8259bf1

Please sign in to comment.