20 lines
706 B
Go
20 lines
706 B
Go
|
|
package repository
|
|||
|
|
|
|||
|
|
import "context"
|
|||
|
|
|
|||
|
|
// MatchmakingRepository 定義配對相關的資料存取介面
|
|||
|
|
type MatchmakingRepository interface {
|
|||
|
|
// JoinQueue 加入配對佇列,返回狀態和房間ID(如果配對成功)
|
|||
|
|
JoinQueue(ctx context.Context, uid string) (status string, roomID string, err error)
|
|||
|
|
|
|||
|
|
// GetMatchStatus 查詢使用者的配對狀態
|
|||
|
|
GetMatchStatus(ctx context.Context, uid string) (status string, roomID string, err error)
|
|||
|
|
|
|||
|
|
// CreateRoom 建立房間並添加成員
|
|||
|
|
CreateRoom(ctx context.Context, roomID string, members []string) error
|
|||
|
|
|
|||
|
|
// IsRoomMember 檢查使用者是否為房間成員
|
|||
|
|
IsRoomMember(ctx context.Context, roomID string, uid string) (bool, error)
|
|||
|
|
}
|
|||
|
|
|