basePath: / definitions: model.AcceptFriendRequestInput: properties: request_id: type: string user_accept_id: type: string type: object model.AddMemberToChatInput: properties: admin_chat_id: type: string chat_id: type: string user_add_id: type: string type: object model.ChangeAdminGroupChatInput: properties: group_chat_id: type: string new_admin_id: type: string old_admin_id: type: string type: object model.CreateChatGroupInput: properties: group_name: type: string list_id: items: type: string type: array user_id_create: type: string type: object model.CreateChatPrivateInput: properties: user1: type: string user2: type: string type: object model.CreateFriendRequestInput: properties: email_friend: type: string user_id: type: string type: object model.JwtInput: properties: data: type: string user_id: type: string type: object model.JwtValidateInput: properties: data: type: string type: object model.LoginInput: properties: user_account: type: string user_password: type: string type: object model.LogoutInput: properties: access_token: type: string refresh_token: type: string user_id: type: string type: object model.RefreshTokenInput: properties: access_token: type: string refresh_token: type: string type: object model.RegisterInput: properties: verify_key: type: string verify_purpose: type: string verify_type: type: integer type: object model.RejectFriendRequestInput: properties: request_id: type: string user_accept_id: type: string type: object model.UpdateAvatarUserInput: properties: avatar_url: type: string user_id: type: string type: object model.UpdateNameAndAvatarRegisterInput: properties: mail: type: string token: type: string url_avatar: type: string user_name: type: string type: object model.UpdatePasswordInput: properties: password: type: string token: type: string type: object model.UpdateUserInfoInput: properties: user_birthday: type: string user_gender: type: string user_id: type: string user_nickname: type: string type: object model.UpgradeChatInfoInput: properties: group_avatar: type: string group_chat_id: type: string group_name_update: type: string user_admin_id: type: string type: object model.UserChangePasswordInput: properties: new_password: type: string old_password: type: string user_id: type: string type: object model.VerifyInput: properties: verify_code: type: string verify_key: type: string type: object response.ErrResponseData: properties: code: description: Ma status code type: integer detail: description: Thong bao loi error: type: string type: object response.ResponseData: properties: code: description: Ma status code type: integer data: description: Du lieu duoc return message: description: Thong bao loi type: string type: object externalDocs: description: OpenAPI url: https://swagger.io/resources/open-api/ host: localhost:8082 info: contact: email: lytranvinh.work@gmail.com name: TEAM V url: example.com/be/ description: This is a sample server celler server. license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html termsOfService: example.com/be/ title: API Documentation Chat App version: 1.0.0 paths: /api/v1/chat/add-member-to-chat: post: consumes: - application/json description: Add member to chat by admin group member parameters: - description: Authorization Bearer token in: header name: Authorization required: true type: string - description: payload in: body name: payload required: true schema: $ref: '#/definitions/model.AddMemberToChatInput' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Add member to chat tags: - Chat /api/v1/chat/change-admin-group-chat: put: consumes: - application/json description: Change admin chat status from old admin to new admin parameters: - description: Authorization Bearer token in: header name: Authorization required: true type: string - description: payload in: body name: payload required: true schema: $ref: '#/definitions/model.ChangeAdminGroupChatInput' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Change admin chat status tags: - Chat /api/v1/chat/create-chat-group: post: consumes: - application/json description: Create a chat group with user after auth, user create is admin and others users are members parameters: - description: Authorization Bearer token in: header name: Authorization required: true type: string - description: payload in: body name: payload required: true schema: $ref: '#/definitions/model.CreateChatGroupInput' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Create a chat group with user after auth tags: - Chat /api/v1/chat/create-chat-private: post: consumes: - application/json description: Create a chat private both user parameters: - description: Authorization Bearer token in: header name: Authorization required: true type: string - description: payload in: body name: payload required: true schema: $ref: '#/definitions/model.CreateChatPrivateInput' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Create a chat private tags: - Chat /api/v1/chat/del-chat: delete: consumes: - application/json description: Delete chat by admin group chat parameters: - description: Authorization Bearer token in: header name: Authorization required: true type: string - description: Chat ID in: query name: chat_id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Delete chat tags: - Chat /api/v1/chat/del-men-from-chat: delete: consumes: - application/json description: Delete member from chat by admin group chat parameters: - description: Authorization Bearer token in: header name: Authorization required: true type: string - description: Chat ID in: query name: chat_id required: true type: string - description: User ID delete in: query name: del_user_id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Delete member from chat tags: - Chat /api/v1/chat/get-chat-info: get: consumes: - application/json description: Get chat information by chat id parameters: - description: Authorization Bearer token in: header name: Authorization required: true type: string - description: Chat ID in: query name: chat_id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Get chat information tags: - Chat /api/v1/chat/get-list-chat-for-user: get: consumes: - application/json description: Get list chat from user parameters: - description: Authorization Bearer token in: header name: Authorization required: true type: string - description: limit number of chat in: query name: limit required: true type: string - description: page number in: query name: page required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Get list of chat tags: - Chat /api/v1/chat/get-list-chat-group-for-user: get: consumes: - application/json description: Get list chat group from user parameters: - description: Authorization Bearer token in: header name: Authorization required: true type: string - description: limit number of chat in: query name: limit required: true type: string - description: page number in: query name: page required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Get list of chat group tags: - Chat /api/v1/chat/get-list-chat-private-for-user: get: consumes: - application/json description: Get list chat private from user parameters: - description: Authorization Bearer token in: header name: Authorization required: true type: string - description: limit number of chat in: query name: limit required: true type: string - description: page number in: query name: page required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Get list of chat private tags: - Chat /api/v1/chat/get-user-in-chat: get: consumes: - application/json description: Get information user in chat with chat id parameters: - description: Authorization Bearer token in: header name: Authorization required: true type: string - description: Chat ID in: query name: chat_id required: true type: string - description: limit number of chat in: query name: limit required: true type: string - description: page number in: query name: page required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Hanlde get infomation user in chat tags: - Chat /api/v1/chat/upgrade-chat-info: put: consumes: - application/json description: Update chat info by admin group chat parameters: - description: Authorization Bearer token in: header name: Authorization required: true type: string - description: payload in: body name: payload required: true schema: $ref: '#/definitions/model.UpgradeChatInfoInput' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Update chat info tags: - Chat /api/v1/mservice/get-chats-group-user: get: consumes: - application/json description: Get list chat group of user with user id parameters: - description: 'Authorization Bearer token microservice (Eg: Bearer 123456)' in: header name: Authorization required: true type: string - description: user ID in: query name: user_id required: true type: string - description: limit number of chat in: query name: limit required: true type: string - description: page number in: query name: page required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Hanlde get list chat group of user tags: - Microservice /api/v1/mservice/get-chats-private-user: get: consumes: - application/json description: Get list chat private of user with user id parameters: - description: 'Authorization Bearer token microservice (Eg: Bearer 123456)' in: header name: Authorization required: true type: string - description: user ID in: query name: user_id required: true type: string - description: limit number of chat in: query name: limit required: true type: string - description: page number in: query name: page required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Hanlde get list chat private of user tags: - Microservice /api/v1/mservice/get-chats-user: get: consumes: - application/json description: Get list chat of user with user id parameters: - description: 'Authorization Bearer token microservice (Eg: Bearer 123456)' in: header name: Authorization required: true type: string - description: user ID in: query name: user_id required: true type: string - description: limit number of chat in: query name: limit required: true type: string - description: page number in: query name: page required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Hanlde get list chat of user tags: - Microservice /api/v1/mservice/get-detail-friend-req: get: consumes: - application/json description: Get detail friend request with user id parameters: - description: 'Authorization Bearer token microservice (Eg: Bearer 123456)' in: header name: Authorization required: true type: string - description: user 1 in: query name: user1 required: true type: string - description: user 2 in: query name: user2 required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Show detail friend request tags: - Microservice /api/v1/mservice/get-user-in-chat: get: consumes: - application/json description: Get information user in chat with chat id parameters: - description: 'Authorization Bearer token microservice (Eg: Bearer 123456)' in: header name: Authorization required: true type: string - description: Chat ID in: query name: chat_id required: true type: string - description: limit number of chat in: query name: limit required: true type: string - description: page number in: query name: page required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Hanlde get infomation user in chat tags: - Microservice /api/v1/token/create_refresh_token: post: consumes: - application/json description: Testing create a new refresh JWT token parameters: - description: payload in: body name: payload required: true schema: $ref: '#/definitions/model.JwtInput' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Create a new JWT token test tags: - Token /api/v1/token/create_token: post: consumes: - application/json description: Testing create a new JWT token parameters: - description: payload in: body name: payload required: true schema: $ref: '#/definitions/model.JwtInput' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Create a new JWT token test tags: - Token /api/v1/token/valid_token: post: consumes: - application/json description: Validate token for access token and refresh token parameters: - description: payload in: body name: payload required: true schema: $ref: '#/definitions/model.JwtValidateInput' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Validate token for access token and refresh token tags: - Token /api/v1/user/accept_friend_request: post: consumes: - application/json description: Accept friend request from another user parameters: - description: Bearer token in: header name: Authorization required: true type: string - description: Accept friend request in: body name: body required: true schema: $ref: '#/definitions/model.AcceptFriendRequestInput' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Accept friend request tags: - User Info /api/v1/user/check-friend: get: consumes: - application/json description: Check if user is friend with another user - Show details friends parameters: - description: Bearer token in: header name: Authorization required: true type: string - description: mail user in: query name: user required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Check friend user tags: - User Info /api/v1/user/create_friend_request: post: consumes: - application/json description: Create friend request to another user parameters: - description: Bearer token in: header name: Authorization required: true type: string - description: Create friend request in: body name: body required: true schema: $ref: '#/definitions/model.CreateFriendRequestInput' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Create friend request tags: - User Info /api/v1/user/delete_friend: delete: consumes: - application/json description: Delete friend user information from the service parameters: - description: Bearer token in: header name: Authorization required: true type: string - description: friend mail in: query name: friend_mail required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Delete friend user tags: - User Info /api/v1/user/end_friend_request: delete: consumes: - application/json description: End friend request to another user parameters: - description: Bearer token in: header name: Authorization required: true type: string - description: request id in: query name: request_id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: End friend request tags: - User Info /api/v1/user/find_user: get: consumes: - application/json description: Find a user by mail address parameters: - description: Bearer token in: header name: Authorization required: true type: string - description: Email of user in: query name: email required: true type: string - description: limit number in: query name: limit required: true type: string - description: page number in: query name: page required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Find user tags: - User Info /api/v1/user/forgot_password: post: consumes: - application/json description: Forgot Password parameters: - description: Mail address in: query name: mail required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Forgot Password tags: - accounts management /api/v1/user/get_friend_request_send: get: consumes: - application/json description: Get List Friend Request Send Output parameters: - description: Bearer token in: header name: Authorization required: true type: string - description: Limit number in: query name: limit required: true type: integer - description: Page number in: query name: page required: true type: integer produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Get List Friend Request Send Output tags: - User Info /api/v1/user/get_list_friend: get: consumes: - application/json description: Get list user friend parameters: - description: Bearer token in: header name: Authorization required: true type: string - description: Limit number in: query name: limit required: true type: integer - description: Page number in: query name: page required: true type: integer produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Get list user friend tags: - User Info /api/v1/user/get_list_friend_request: get: consumes: - application/json description: Get list friend request of user parameters: - description: Bearer token in: header name: Authorization required: true type: string - description: Limit number in: query name: limit required: true type: integer - description: Page number in: query name: page required: true type: integer produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Get list friend request tags: - User Info /api/v1/user/get_user_info: get: consumes: - application/json description: Get user information after login parameters: - description: Bearer token in: header name: Authorization required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Get user info tags: - User Info /api/v1/user/login: post: consumes: - application/json description: Login user by account and password parameters: - description: payload in: body name: payload required: true schema: $ref: '#/definitions/model.LoginInput' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Login user tags: - accounts management /api/v1/user/logout: post: consumes: - application/json description: Logout parameters: - description: payload in: body name: payload required: true schema: $ref: '#/definitions/model.LogoutInput' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Logout tags: - accounts management /api/v1/user/refresh_token: post: consumes: - application/json description: Refresh token for user parameters: - description: payload in: body name: payload required: true schema: $ref: '#/definitions/model.RefreshTokenInput' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Refresh token tags: - accounts management /api/v1/user/register: post: consumes: - application/json description: When user register, system will send OTP to user's phone number or email address parameters: - description: payload in: body name: payload required: true schema: $ref: '#/definitions/model.RegisterInput' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Register a new account tags: - accounts management /api/v1/user/reject_friend_request: post: consumes: - application/json description: Reject friend request from another user parameters: - description: Bearer token in: header name: Authorization required: true type: string - description: request id in: body name: body required: true schema: $ref: '#/definitions/model.RejectFriendRequestInput' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Reject friend request tags: - User Info /api/v1/user/update_password: put: consumes: - application/json description: Update password user for user parameters: - description: Bearer token in: header name: Authorization required: true type: string - description: Update password user for user in: body name: body required: true schema: $ref: '#/definitions/model.UserChangePasswordInput' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Update password user for user tags: - User Info /api/v1/user/update_user_avatar: post: consumes: - application/json description: Update avatar user parameters: - description: Bearer token in: header name: Authorization required: true type: string - description: 'Update user avatar ' in: body name: body required: true schema: $ref: '#/definitions/model.UpdateAvatarUserInput' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Update avatar user tags: - User Info /api/v1/user/update_user_info: put: consumes: - application/json description: Update nick name, ... information user parameters: - description: Bearer token in: header name: Authorization required: true type: string - description: Update user info input date format dd-MM-yyyy HH:mm:ss in: body name: body required: true schema: $ref: '#/definitions/model.UpdateUserInfoInput' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Update user info tags: - User Info /api/v1/user/update_user_name_and_avatar: post: consumes: - application/json description: Update name and avatar when register parameters: - description: payload in: body name: body required: true schema: $ref: '#/definitions/model.UpdateNameAndAvatarRegisterInput' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Update name and avatar when register tags: - accounts management /api/v1/user/upgrade_password_register: post: consumes: - application/json description: after verification otp can be updated password parameters: - description: payload in: body name: payload required: true schema: $ref: '#/definitions/model.UpdatePasswordInput' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: update password when register tags: - accounts management /api/v1/user/verify_account: post: consumes: - application/json description: Verify OTP bu user when register parameters: - description: payload in: body name: payload required: true schema: $ref: '#/definitions/model.VerifyInput' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Verify OTP bu user when register tags: - accounts management /api/v1/user/verify_forgot_password/{email}/{token}: get: consumes: - application/json description: Verify Forgot Password with token parameters: - description: token in: path name: token required: true type: string - description: email in: path name: email required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/response.ResponseData' "500": description: Internal Server Error schema: $ref: '#/definitions/response.ErrResponseData' summary: Verify Forgot Password tags: - accounts management securityDefinitions: BasicAuth: type: basic swagger: "2.0"