isuports

package module
v0.0.0-...-bbab4e5 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoleAdmin     = "admin"
	RoleOrganizer = "organizer"
	RolePlayer    = "player"
	RoleNone      = "none"
)

Variables

This section is empty.

Functions

func Run

func Run()

Run は cmd/isuports/main.go から呼ばれるエントリーポイントです

func SetCacheControlPrivate

func SetCacheControlPrivate(next echo.HandlerFunc) echo.HandlerFunc

全APIにCache-Control: privateを設定する

Types

type BillingHandlerResult

type BillingHandlerResult struct {
	Reports []BillingReport `json:"reports"`
}

type BillingReport

type BillingReport struct {
	CompetitionID     string `json:"competition_id" db:"competition_id"`
	CompetitionTitle  string `json:"competition_title" db:"competition_title"`
	PlayerCount       int64  `json:"player_count" db:"player_count"`               // スコアを登録した参加者数
	VisitorCount      int64  `json:"visitor_count" db:"visitor_count"`             // ランキングを閲覧だけした(スコアを登録していない)参加者数
	BillingPlayerYen  int64  `json:"billing_player_yen" db:"billing_player_yen"`   // 請求金額 スコアを登録した参加者分
	BillingVisitorYen int64  `json:"billing_visitor_yen" db:"billing_visitor_yen"` // 請求金額 ランキングを閲覧だけした(スコアを登録していない)参加者分
	BillingYen        int64  `json:"billing_yen" db:"billing_yen"`                 // 合計請求金額
}

type CompetitionDetail

type CompetitionDetail struct {
	ID         string `json:"id"`
	Title      string `json:"title"`
	IsFinished bool   `json:"is_finished"`
}

type CompetitionRank

type CompetitionRank struct {
	CompetitionID     string `json:"-" db:"competition_id"`
	Rank              int64  `json:"rank" db:"rank"`
	Score             int64  `json:"score" db:"score"`
	PlayerID          string `json:"player_id" db:"player_id"`
	PlayerDisplayName string `json:"player_display_name" db:"player_display_name"`
	RowNum            int64  `json:"-"` // APIレスポンスのJSONには含まれない
}

type CompetitionRankingHandlerResult

type CompetitionRankingHandlerResult struct {
	Competition CompetitionDetail `json:"competition"`
	Ranks       []CompetitionRank `json:"ranks"`
}

type CompetitionRow

type CompetitionRow struct {
	TenantID   int64         `db:"tenant_id"`
	ID         string        `db:"id"`
	Title      string        `db:"title"`
	FinishedAt sql.NullInt64 `db:"finished_at"`
	CreatedAt  int64         `db:"created_at"`
	UpdatedAt  int64         `db:"updated_at"`
}

type CompetitionsAddHandlerResult

type CompetitionsAddHandlerResult struct {
	Competition CompetitionDetail `json:"competition"`
}

type CompetitionsHandlerResult

type CompetitionsHandlerResult struct {
	Competitions []CompetitionDetail `json:"competitions"`
}

type FailureResult

type FailureResult struct {
	Status  bool   `json:"status"`
	Message string `json:"message"`
}

type InitializeHandlerResult

type InitializeHandlerResult struct {
	Lang string `json:"lang"`
}

type JSONSerializer

type JSONSerializer struct{}

func (*JSONSerializer) Deserialize

func (j *JSONSerializer) Deserialize(c echo.Context, i interface{}) error

func (*JSONSerializer) Serialize

func (j *JSONSerializer) Serialize(c echo.Context, i interface{}, indent string) error

type MeHandlerResult

type MeHandlerResult struct {
	Tenant   *TenantDetail `json:"tenant"`
	Me       *PlayerDetail `json:"me"`
	Role     string        `json:"role"`
	LoggedIn bool          `json:"logged_in"`
}

type PlayerDetail

type PlayerDetail struct {
	ID             string `json:"id"`
	DisplayName    string `json:"display_name"`
	IsDisqualified bool   `json:"is_disqualified"`
}

type PlayerDisqualifiedHandlerResult

type PlayerDisqualifiedHandlerResult struct {
	Player PlayerDetail `json:"player"`
}

type PlayerHandlerResult

type PlayerHandlerResult struct {
	Player PlayerDetail        `json:"player"`
	Scores []PlayerScoreDetail `json:"scores"`
}

type PlayerRow

type PlayerRow struct {
	TenantID       int64  `db:"tenant_id"`
	ID             string `db:"id"`
	DisplayName    string `db:"display_name"`
	IsDisqualified bool   `db:"is_disqualified"`
	CreatedAt      int64  `db:"created_at"`
	UpdatedAt      int64  `db:"updated_at"`
}

type PlayerScoreDetail

type PlayerScoreDetail struct {
	CompetitionTitle string `json:"competition_title" db:"competition_title"`
	Score            int64  `json:"score" db:"score"`
}

type PlayerScoreRow

type PlayerScoreRow struct {
	//TenantID      int64  `db:"tenant_id"`
	//ID            string `db:"id"`
	PlayerID      string `db:"player_id"`
	CompetitionID string `db:"competition_id"`
	Score         int64  `db:"score"`
	RowNum        int64  `db:"row_num"`
	CreatedAt     int64  `db:"created_at"`
	UpdatedAt     int64  `db:"updated_at"`
}

type PlayersAddHandlerResult

type PlayersAddHandlerResult struct {
	Players []PlayerDetail `json:"players"`
}

type PlayersListHandlerResult

type PlayersListHandlerResult struct {
	Players []PlayerDetail `json:"players"`
}

type ScoreHandlerResult

type ScoreHandlerResult struct {
	Rows int64 `json:"rows"`
}

type SuccessResult

type SuccessResult struct {
	Status bool `json:"status"`
	Data   any  `json:"data,omitempty"`
}

type TenantDetail

type TenantDetail struct {
	Name        string `json:"name"`
	DisplayName string `json:"display_name"`
}

type TenantRow

type TenantRow struct {
	ID          int64  `db:"id"`
	Name        string `db:"name"`
	DisplayName string `db:"display_name"`
	CreatedAt   int64  `db:"created_at"`
	UpdatedAt   int64  `db:"updated_at"`
}

type TenantWithBilling

type TenantWithBilling struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	DisplayName string `json:"display_name"`
	BillingYen  int64  `json:"billing"`
}

type TenantsAddHandlerResult

type TenantsAddHandlerResult struct {
	Tenant TenantWithBilling `json:"tenant"`
}

type TenantsBillingHandlerResult

type TenantsBillingHandlerResult struct {
	Tenants []TenantWithBilling `json:"tenants"`
}

type Viewer

type Viewer struct {
	// contains filtered or unexported fields
}

アクセスしてきた人の情報

type VisitHistoryRow

type VisitHistoryRow struct {
	PlayerID      string `db:"player_id"`
	TenantID      int64  `db:"tenant_id"`
	CompetitionID string `db:"competition_id"`
	CreatedAt     int64  `db:"created_at"`
	UpdatedAt     int64  `db:"updated_at"`
}

type VisitHistorySummaryRow

type VisitHistorySummaryRow struct {
	PlayerID     string `db:"player_id"`
	MinCreatedAt int64  `db:"min_created_at"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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