team

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadTeam

func LoadTeam() gin.HandlerFunc

func RegisterRouter

func RegisterRouter(g *gin.RouterGroup)

Types

type Handler

type Handler struct {
}

func (*Handler) AdminAdd

func (*Handler) AdminAdd() gin.HandlerFunc

func (*Handler) AdminDelete

func (*Handler) AdminDelete() gin.HandlerFunc

func (*Handler) AdminList

func (*Handler) AdminList() gin.HandlerFunc

func (*Handler) ApplicationAccept

func (*Handler) ApplicationAccept() gin.HandlerFunc

func (*Handler) ApplicationCancel

func (*Handler) ApplicationCancel() gin.HandlerFunc

func (*Handler) ApplicationList

func (*Handler) ApplicationList() gin.HandlerFunc

func (*Handler) ApplicationNew

func (*Handler) ApplicationNew() gin.HandlerFunc

func (*Handler) ApplicationReject

func (*Handler) ApplicationReject() gin.HandlerFunc

func (*Handler) Create

func (*Handler) Create() gin.HandlerFunc

func (*Handler) InvitationAccept

func (*Handler) InvitationAccept() gin.HandlerFunc

func (*Handler) InvitationAcceptByToken

func (*Handler) InvitationAcceptByToken() gin.HandlerFunc

func (*Handler) InvitationCancel

func (*Handler) InvitationCancel() gin.HandlerFunc

func (*Handler) InvitationList

func (*Handler) InvitationList() gin.HandlerFunc

func (*Handler) InvitationNew

func (*Handler) InvitationNew() gin.HandlerFunc

func (*Handler) InvitationReject

func (*Handler) InvitationReject() gin.HandlerFunc

func (*Handler) InvitationTokenRefresh

func (*Handler) InvitationTokenRefresh() gin.HandlerFunc

func (*Handler) InvitationTokenShow

func (*Handler) InvitationTokenShow() gin.HandlerFunc

func (*Handler) List

func (*Handler) List() gin.HandlerFunc

func (*Handler) Modify

func (*Handler) Modify() gin.HandlerFunc

func (*Handler) Show

func (*Handler) Show() gin.HandlerFunc

func (*Handler) SingleDelete

func (*Handler) SingleDelete() gin.HandlerFunc

func (*Handler) StatisticShow

func (*Handler) StatisticShow() gin.HandlerFunc

func (*Handler) UserAdd

func (*Handler) UserAdd() gin.HandlerFunc

func (*Handler) UserDelete

func (*Handler) UserDelete() gin.HandlerFunc

func (*Handler) UserList

func (*Handler) UserList() gin.HandlerFunc

type RApplication

type RApplication struct {
	UserID    uint      `json:"user_id"`
	ApplyTime time.Time `json:"apply_time"`
	Status    uint      `json:"status"`
}

func BindApplication

func BindApplication(app *cpt.TeamApplication) *RApplication

func BindApplicationList

func BindApplicationList(applications []cpt.TeamApplication) []*RApplication

type RInvitation

type RInvitation struct {
	ToUser     uint      `json:"to_user"`
	FromUser   uint      `json:"from_user"`
	InviteTime time.Time `json:"invite_time"`
	Status     uint      `json:"status"`
}

func BindInvitation

func BindInvitation(inv *cpt.TeamInvitation) *RInvitation

func BindInvitationList

func BindInvitationList(invitations []cpt.TeamInvitation) []*RInvitation

type RStatisticContest

type RStatisticContest struct {
	ID     uint   `json:"id"`
	Name   string `json:"name"`
	Points uint   `json:"points"`
	Rank   uint   `json:"rank"`
}

type RTeam

type RTeam struct {
	TeamID      uint      `json:"team_id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	MemberCount uint      `json:"member_count"`
	CreateAt    time.Time `json:"create_at"`
}

func BindList

func BindList(db *gorm.DB, teams []cpt.Team) []*RTeam

func BindTeam

func BindTeam(db *gorm.DB, t *cpt.Team) *RTeam

type RTeamUser

type RTeamUser struct {
	ID        uint   `json:"id"`
	Username  string `json:"username"`
	EmailHash string `json:"email_hash"`
	Nickname  string `json:"nickname"`
}

func BindUser

func BindUser(u *cpt.User) *RTeamUser

func BindUserList

func BindUserList(users []cpt.User) []*RTeamUser

type ReqApplicationAcceptAndReject

type ReqApplicationAcceptAndReject struct {
	UserID uint `json:"user_id" validate:"required" binding:"required"`
}

type ReqCreate

type ReqCreate struct {
	Name        string `json:"name" validate:"max=50,min=1,keyword" binding:"max=50,min=1,keyword"`
	Description string `json:"description"`
}

type ReqInvitationAcceptByToken

type ReqInvitationAcceptByToken struct {
	Token string `json:"token"`
}

type ReqInvitationNewAndCancel

type ReqInvitationNewAndCancel struct {
	UserID uint `json:"user_id" validate:"required" binding:"required"`
}

type ReqModify

type ReqModify struct {
	Name        *string `json:"name" validate:"omitempty,max=50,min=1,keyword" binding:"omitempty,max=50,min=1,keyword"`
	Description *string `json:"description"`
}

func (*ReqModify) Bind

func (r *ReqModify) Bind(t *cpt.Team)

type ReqUserAdd

type ReqUserAdd struct {
	UsersID []uint `json:"users_id"`
}

type ReqUserDelete

type ReqUserDelete struct {
	UsersID []uint `json:"users_id"`
}

type RespApplicationList

type RespApplicationList struct {
	Response
	Applications []*RApplication `json:"applications"`
}

type RespCreate

type RespCreate struct {
	Response
	TeamID uint `json:"team_id,omitempty"`
}

type RespInvitationList

type RespInvitationList struct {
	Response
	Invitations []*RInvitation `json:"invitations"`
}

type RespInvitationToken

type RespInvitationToken struct {
	Response
	Token string `json:"token"`
}

type RespList

type RespList struct {
	Response
	Teams []*RTeam `json:"teams"`
}

type RespShow

type RespShow struct {
	Response
	Team *RTeam `json:"team"`
}

type RespStatisticShow

type RespStatisticShow struct {
	Response
	Contests []*RStatisticContest `json:"contests"`
}

type RespUserAdd

type RespUserAdd struct {
	Response
	Details []*RespUserAddDeleteDetail `json:"details"`
}

type RespUserAddDeleteDetail

type RespUserAddDeleteDetail struct {
	Response
	UserID uint `json:"user_id"`
}

type RespUserDelete

type RespUserDelete struct {
	Response
	Details []*RespUserAddDeleteDetail `json:"details"`
}

type RespUserList

type RespUserList struct {
	Response
	Members []*RTeamUser `json:"members"`
}

Jump to

Keyboard shortcuts

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