Categorygithub.com/Ateto1204/swep-user-serv
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"
      }
      
  • 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"
      }
      
  • user-03 : AddFriend(userID, friendID: string)
  • user-04 : RemoveFriend(userID, friendID: string)
  • user-05 : AddNewChat(userID, chatID)
    • url path: /api/chat-add
    • method: PATCH
    • request body :
      {
          "user_id": "[email protected]",
          "chat_id": "demo-chat-id"
      }
      
  • user-06 : RemoveChat(userID, chatID)
    • url path: /api/chat-remove
    • method: PATCH
    • request body :
      {
          "user_id": "[email protected]",
          "chat_id": "demo-chat-id"
      }
      
  • user-07 : DeleteUser(userID)

# Packages

No description provided by the author