MMO 서버/데디케이트 서버 연동을 위한 내부 API 엔드포인트 구현: - POST /api/internal/bossraid/entry — 파티 입장 요청 (방 생성) - POST /api/internal/bossraid/start — 세션 시작 보고 - POST /api/internal/bossraid/complete — 클리어 보고 + TOL Chain 보상 지급 - POST /api/internal/bossraid/fail — 실패 보고 - GET /api/internal/bossraid/room — 방 조회 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
31
internal/bossraid/model.go
Normal file
31
internal/bossraid/model.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package bossraid
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type RoomStatus string
|
||||
|
||||
const (
|
||||
StatusWaiting RoomStatus = "waiting"
|
||||
StatusInProgress RoomStatus = "in_progress"
|
||||
StatusCompleted RoomStatus = "completed"
|
||||
StatusFailed RoomStatus = "failed"
|
||||
)
|
||||
|
||||
// BossRoom represents a boss raid session room.
|
||||
type BossRoom struct {
|
||||
ID uint `json:"id" gorm:"primaryKey"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
|
||||
SessionName string `json:"sessionName" gorm:"type:varchar(100);uniqueIndex;not null"`
|
||||
BossID int `json:"bossId" gorm:"index;not null"`
|
||||
Status RoomStatus `json:"status" gorm:"type:varchar(20);index;default:waiting;not null"`
|
||||
MaxPlayers int `json:"maxPlayers" gorm:"default:3;not null"`
|
||||
Players string `json:"players" gorm:"type:text"` // JSON array of usernames
|
||||
StartedAt *time.Time `json:"startedAt,omitempty"`
|
||||
CompletedAt *time.Time `json:"completedAt,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user