app

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCompetitionService

func NewCompetitionService(
	repo repository.Competition,
	workRepo repository.Work,
	playerRepo repository.Player,
	producer message.MessageProducer,
	uploader uploader.SubmissionFileUploader,
	userCli user.User,
	user userrepo.User,
) *competitionService

Types

type CmdToChangeCompetitionTeamName

type CmdToChangeCompetitionTeamName = CompetitionTeamCreateCmd

type CmdToDeleteTeamMember

type CmdToDeleteTeamMember = CompetitionTeamJoinCmd

type CmdToTransferTeamLeader

type CmdToTransferTeamLeader = CompetitionTeamJoinCmd

type CompetitionAddRelatedProjectCMD added in v1.3.1

type CompetitionAddRelatedProjectCMD struct {
	Id      string
	User    types.Account
	Project types.ResourceSummary
	Lang    domain.Language
}

type CompetitionDTO

type CompetitionDTO struct {
	CompetitionSummaryDTO

	Type       string `json:"type"`
	Phase      string `json:"phase"`
	Doc        string `json:"doc"`
	Forum      string `json:"forum"`
	Winners    string `json:"winners"`
	DatasetDoc string `json:"dataset_doc"`
	DatasetURL string `json:"dataset_url"`
}

type CompetitionGetCmd

type CompetitionGetCmd struct {
	CompetitionId string
	Lang          domain.Language
	User          types.Account
}

type CompetitionGetSubmissionCmd

type CompetitionGetSubmissionCmd struct {
	Id      string
	User    types.Account
	Project types.ResourceSummary
}

type CompetitionInternalService

type CompetitionInternalService interface {
	UpdateSubmission(*CompetitionSubmissionUpdateCmd) error
}

Internal Service

func NewCompetitionInternalService

func NewCompetitionInternalService(repo repository.Work) CompetitionInternalService

type CompetitionListCMD

type CompetitionListCMD struct {
	Status domain.CompetitionStatus
	User   types.Account
	Tag    domain.CompetitionTag
	Lang   domain.Language
}

type CompetitionRankingDTO added in v1.3.1

type CompetitionRankingDTO struct {
	Final       []RankingDTO `json:"final"`
	Preliminary []RankingDTO `json:"preliminary"`
}

ranking

type CompetitionService

type CompetitionService interface {
	// player
	Apply(string, *CompetitorApplyCmd) (string, error)
	CreateTeam(cid string, cmd *CompetitionTeamCreateCmd) (string, error)
	JoinTeam(cid string, cmd *CompetitionTeamJoinCmd) (string, error)
	GetMyTeam(cid string, competitor types.Account) (CompetitionTeamDTO, string, error)
	ChangeTeamName(cid string, cmd *CmdToChangeCompetitionTeamName) error
	TransferLeader(cid string, cmd *CmdToTransferTeamLeader) error
	QuitTeam(cid string, competitor types.Account) error
	DeleteMember(cid string, cmd *CmdToDeleteTeamMember) error
	DissolveTeam(cid string, leader types.Account) error

	// competition
	Get(*CompetitionGetCmd) (UserCompetitionDTO, error)
	List(*CompetitionListCMD) ([]CompetitionSummaryDTO, error)

	// work
	Submit(*CompetitionSubmitCMD) (CompetitionSubmissionDTO, string, error)
	GetSubmissions(*CompetitionGetCmd) (CompetitionSubmissionsDTO, error)
	GetRankingList(string) (CompetitionRankingDTO, error)
	AddRelatedProject(*CompetitionAddRelatedProjectCMD) (string, error)
}

type CompetitionSubmissionDTO

type CompetitionSubmissionDTO struct {
	SubmitAt string  `json:"submit_at"`
	FileName string  `json:"file_name"`
	Status   string  `json:"status"`
	Score    float32 `json:"score"`
}

type CompetitionSubmissionUpdateCmd

type CompetitionSubmissionUpdateCmd = domain.SubmissionUpdatingInfo

type CompetitionSubmissionsDTO

type CompetitionSubmissionsDTO struct {
	RelatedProject string                     `json:"project"`
	Details        []CompetitionSubmissionDTO `json:"details"`
}

result

type CompetitionSubmitCMD

type CompetitionSubmitCMD struct {
	CompetitionId string
	FileName      string
	Data          io.Reader
	User          types.Account
	Lang          domain.Language
}

func (*CompetitionSubmitCMD) Validate

func (cmd *CompetitionSubmitCMD) Validate() error

type CompetitionSummaryDTO

type CompetitionSummaryDTO struct {
	CompetitorCount int      `json:"count"`
	Bonus           int      `json:"bonus"`
	Id              string   `json:"id"`
	Name            string   `json:"name"`
	Host            string   `json:"host"`
	Desc            string   `json:"desc"`
	Status          string   `json:"status"`
	Poster          string   `json:"poster"`
	Duration        string   `json:"duration"`
	Tags            []string `json:"tags"`
	Lang            string   `json:"lang"`
}

type CompetitionTeamCreateCmd

type CompetitionTeamCreateCmd struct {
	User types.Account
	Name domain.TeamName
}

team

type CompetitionTeamDTO

type CompetitionTeamDTO struct {
	Name    string                     `json:"name"`
	Members []CompetitionTeamMemberDTO `json:"members"`
}

type CompetitionTeamJoinCmd

type CompetitionTeamJoinCmd struct {
	User   types.Account
	Leader types.Account
}

type CompetitionTeamMemberDTO

type CompetitionTeamMemberDTO struct {
	Name    string `json:"name"`
	Role    string `json:"role"`
	Email   string `json:"email"`
	Account string `json:"account"`
}

type CompetitorApplyCmd

type CompetitorApplyCmd struct {
	domain.Competitor
	Lang domain.Language
}

func (*CompetitorApplyCmd) Validate

func (cmd *CompetitorApplyCmd) Validate() error

type RankingDTO

type RankingDTO struct {
	Score    float32 `json:"score"`
	TeamName string  `json:"team_name"`
	SubmitAt string  `json:"submit_at"`
}

type UserCompetitionDTO

type UserCompetitionDTO struct {
	TeamId       string `json:"team_id"`
	TeamRole     string `json:"team_role"`
	IsFinalist   bool   `json:"is_finalist"`
	IsCompetitor bool   `json:"is_competitor"`

	CompetitionDTO
}

Jump to

Keyboard shortcuts

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