modulepackage
0.0.0-20241218030620-c903d8b453a7
Repository: https://github.com/ateto1204/swep-user-serv.git
Documentation: pkg.go.dev
# README
Swep user service
- url path:
/user
Properties
- ID: email
- user id aka email
- Name: string
- user name
- Chats:
[]Chat.ID
- record the id of chat rooms
Chat.ID
: string
- Friends:
[]User.ID
- record the user's friends through the id of user's friends
User.ID
: string
- CreatAt: string
- record the created time of the user
API
user-01
: SaveUser(userID, name: string)- url path:
/api/user-add
- method:
POST
- request body :
{ "id": "[email protected]", "name": "demo-user" }
- response body :
{ "id": "[email protected]", "name": "demo-user", "chats": "[]", "friends": "[]", "create_at": "2024-11-10T04:59:11.461707232Z" }
- url path:
user-02
: GetUser(userID: string)- url path:
/api/user-get
- method:
POST
- request body :
{ "id": "[email protected]" }
- response body :
{ "id": "[email protected]", "name": "demo-user", "chats": [], "friends": [], "create_at": "2024-11-03T04:32:36.886643Z" }
- url path:
user-03
: AddFriend(userID, friendID: string)- url path:
/api/friend-add
- method:
PATCH
- request body :
{ "user_id": "[email protected]", "friend_id": "[email protected]" }
- response body :
{ "id": "[email protected]", "name": "demo", "chats": [], "friends": [ "[email protected]" ], "create_at": "2024-11-03T04:32:36.886643Z" }
- url path:
user-04
: RemoveFriend(userID, friendID: string)- url path:
/api/friend-remove
- method:
PATCH
- request body :
{ "user_id": "[email protected]", "friend_id": "[email protected]" }
- response body :
{ "id": "[email protected]", "name": "demo", "chats": [], "friends": [], "create_at": "2024-11-03T04:32:36.886643Z" }
- url path:
user-05
: AddNewChat(userID, chatID)- url path:
/api/chat-add
- method:
PATCH
- request body :
{ "user_id": "[email protected]", "chat_id": "demo-chat-id" }
- url path:
user-06
: RemoveChat(userID, chatID)- url path:
/api/chat-remove
- method:
PATCH
- request body :
{ "user_id": "[email protected]", "chat_id": "demo-chat-id" }
- url path:
user-07
: DeleteUser(userID)- url path:
/api/user-del
- method:
DELETE
- request body :
{ "id": "[email protected]" }
- url path:
# Packages
No description provided by the author