Documentation
¶
Index ¶
- func NewCompetitionService(repo repository.Competition, workRepo repository.Work, ...) *competitionService
- type CmdToChangeCompetitionTeamName
- type CmdToDeleteTeamMember
- type CmdToTransferTeamLeader
- type CompetitionAddRelatedProjectCMD
- type CompetitionDTO
- type CompetitionGetCmd
- type CompetitionGetSubmissionCmd
- type CompetitionInternalService
- type CompetitionListCMD
- type CompetitionRankingDTO
- type CompetitionService
- type CompetitionSubmissionDTO
- type CompetitionSubmissionUpdateCmd
- type CompetitionSubmissionsDTO
- type CompetitionSubmitCMD
- type CompetitionSummaryDTO
- type CompetitionTeamCreateCmd
- type CompetitionTeamDTO
- type CompetitionTeamJoinCmd
- type CompetitionTeamMemberDTO
- type CompetitorApplyCmd
- type RankingDTO
- type UserCompetitionDTO
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 CompetitionDTO ¶
type CompetitionGetCmd ¶
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 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 ¶
team
type CompetitionTeamDTO ¶
type CompetitionTeamDTO struct {
Name string `json:"name"`
Members []CompetitionTeamMemberDTO `json:"members"`
}
type CompetitionTeamJoinCmd ¶
type CompetitorApplyCmd ¶
type CompetitorApplyCmd struct {
domain.Competitor
Lang domain.Language
}
func (*CompetitorApplyCmd) Validate ¶
func (cmd *CompetitorApplyCmd) Validate() error
type RankingDTO ¶
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
}
Click to show internal directories.
Click to hide internal directories.