chat

package
v0.0.0-...-d6be14c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(c *gin.Context)

@Summary 建立 Chat Websocket 連線 (HTTP) @Description HTTP GET 方法,在處理請求時會切換協議由 HTTP -> Websocket @Tags chat @Accept json @Produce json @Security ApiKeyAuth @Param token path string true "Chat Room Connection Token" @Success 200 {object} controllers.JSONResponse @Failure 401 {object} controllers.JSONResponse @Failure 500 {object} controllers.JSONResponse @Router /chat/ws/:token [get]

func CreateRoom

func CreateRoom(c *gin.Context)

@Summary 建立聊天室 @Description 建立聊天室,若為個人聊天室則只需帶 invitedUserEmail,群組聊天室則帶 avatar, name @Tags chat @Accept json @Produce json @Security ApiKeyAuth @Param type body string true "聊天室類型 (personal or group)" @Param name body string false "Chat Room Name" @Param avatar body string false "Chat Room Avatar" @Param invitedUserEmail body string false "為個人聊天室受邀成員之 email" @Success 200 {object} controllers.JSONResponse{data=creatRoomResponse} @Failure 400 {object} controllers.JSONResponse @Failure 500 {object} controllers.JSONResponse @Router /chat/room [post]

func GetRoomInviteCode

func GetRoomInviteCode(c *gin.Context)

@Summary 取得聊天室邀請碼 @Description 取得聊天室邀請碼 @Tags chat @Accept json @Produce json @Security ApiKeyAuth @Param chatRoomID path uint true "Chat Room ID" @Success 200 {object} controllers.JSONResponse{data=getRoomInviteCodeResponse} @Failure 403 {object} controllers.JSONResponse @Failure 500 {object} controllers.JSONResponse @Router /chat/room/:chatRoomID/invite/code [get]

func PingHandler

func PingHandler(msg message)

@Summary 心跳包 @Description 心跳包 @Tags chat - websocket @Accept json @Produce json @Security ApiKeyAuth @Param seq body uint true "使用 timestamp 以此表示個別 message 的辨識 id" @Param cmd body string true "該 websocket 的操作 [ping]" @Success 200 {object} message @Router /chat/ws/cmd:ping [get]

func UpdateRoomMemberByInviteCode

func UpdateRoomMemberByInviteCode(c *gin.Context)

@Summary 藉由邀請碼加入聊天室 @Description 藉由邀請碼加入聊天室 @Tags chat @Accept json @Produce json @Security ApiKeyAuth @Param chatRoomID path uint true "Chat Room ID" @Param inviteCode path string true "Chat Room Invite Code" @Success 200 {object} controllers.JSONResponse @Failure 400 {object} controllers.JSONResponse @Failure 500 {object} controllers.JSONResponse @Router /chat/room/:chatRoomID/invite/code/:inviteCode [patch]

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL