org_season.go 4.86 KB
Newer Older
haoyanbin's avatar
1  
haoyanbin committed
1 2 3
package dto

import (
haoyanbin's avatar
1  
haoyanbin committed
4
	"go-admin/app/operate/models"
haoyanbin's avatar
1  
haoyanbin committed
5 6
	"go-admin/common/dto"
	common "go-admin/common/models"
haoyanbin's avatar
haoyanbin committed
7
	"go-admin/common/utils"
haoyanbin's avatar
1  
haoyanbin committed
8 9 10 11
	"time"
)

type OrgSeasonGetPageReq struct {
haoyanbin's avatar
haoyanbin committed
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
	dto.Pagination  `search:"-"`
	LeagueId        string `form:"leagueId"  search:"type:exact;column:league_id;table:os"`
	SeasonId        string `form:"seasonId"  search:"type:exact;column:id;table:os"`
	SeasonStartTime string `form:"seasonStartTime"  search:"type:gte;column:start_time;table:os" comment:"比赛开始时间"`
	SeasonEndTime   string `form:"seasonEndTime"  search:"type:lte;column:end_time;table:os" comment:"比赛结束时间"`
	Status          string `form:"status"  search:"type:exact;column:status;table:os"`
}

type OrgSeasonGetPageReply struct {
	Id          string `json:"id"`
	LeagueId    string `json:"leagueId"`
	LeagueName  string `json:"leagueName"`
	SeasonName  string `json:"seasonName"`
	TotalRounds string `json:"totalRounds"`
	StartTime   string `json:"startTime"`
	EndTime     string `json:"endTime"`
	Status      string `json:"status"`
haoyanbin's avatar
1  
haoyanbin committed
29 30
}

haoyanbin's avatar
haoyanbin committed
31
type OrgSeasonGetReply struct {
haoyanbin's avatar
haoyanbin committed
32 33
	OrgSeason     models.OrgSeason   `form:"orgSeason"`
	OrgLeagueList []models.OrgLeague `form:"orgLeagueList"`
haoyanbin's avatar
haoyanbin committed
34 35
}

haoyanbin's avatar
haoyanbin committed
36 37 38 39 40 41 42 43 44 45 46 47 48 49
type OrgSeasonOrder struct {
	Id          int       `form:"idOrder"  search:"type:order;column:id;table:org_season"`
	LeagueId    string    `form:"leagueIdOrder"  search:"type:order;column:league_id;table:org_season"`
	DivisionId  string    `form:"divisionIdOrder"  search:"type:order;column:division_id;table:org_season"`
	SeasonName  string    `form:"seasonNameOrder"  search:"type:order;column:season_name;table:org_season"`
	TotalRounds string    `form:"totalRoundsOrder"  search:"type:order;column:total_rounds;table:org_season"`
	StartTime   string    `form:"startTimeOrder"  search:"type:order;column:start_time;table:org_season"`
	EndTime     string    `form:"endTimeOrder"  search:"type:order;column:end_time;table:org_season"`
	Status      string    `form:"statusOrder"  search:"type:order;column:status;table:org_season"`
	CreateBy    string    `form:"createByOrder"  search:"type:order;column:create_by;table:org_season"`
	UpdateBy    string    `form:"updateByOrder"  search:"type:order;column:update_by;table:org_season"`
	CreatedAt   time.Time `form:"createdAtOrder"  search:"type:order;column:created_at;table:org_season"`
	UpdatedAt   time.Time `form:"updatedAtOrder"  search:"type:order;column:updated_at;table:org_season"`
	DeletedAt   time.Time `form:"deletedAtOrder"  search:"type:order;column:deleted_at;table:org_season"`
haoyanbin's avatar
1  
haoyanbin committed
50 51 52 53 54 55 56
}

func (m *OrgSeasonGetPageReq) GetNeedSearch() interface{} {
	return *m
}

type OrgSeasonInsertReq struct {
haoyanbin's avatar
haoyanbin committed
57 58 59 60 61 62 63 64 65
	Id          int    `json:"-" comment:""` //
	LeagueId    string `json:"leagueId" comment:"org_league表id"`
	DivisionId  string `json:"divisionId" comment:"org_division表id"`
	SeasonName  string `json:"seasonName" comment:"赛季名称"`
	TotalRounds string `json:"totalRounds" comment:"总轮次"`
	StartTime   string `json:"startTime" comment:"赛季开始时间"`
	EndTime     string `json:"endTime" comment:"赛季结束时间"`
	Status      string `json:"status" comment:"赛季开启状态 1 是 0 否"`
	common.ControlBy
haoyanbin's avatar
1  
haoyanbin committed
66 67
}

haoyanbin's avatar
haoyanbin committed
68 69 70 71 72 73 74 75
func (s *OrgSeasonInsertReq) Generate(model *models.OrgSeason) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.LeagueId = s.LeagueId
	model.DivisionId = s.DivisionId
	model.SeasonName = s.SeasonName
	model.TotalRounds = s.TotalRounds
haoyanbin's avatar
haoyanbin committed
76 77
	model.StartTime = utils.StringToTime(s.StartTime)
	model.EndTime = utils.StringToTime(s.EndTime)
haoyanbin's avatar
haoyanbin committed
78
	model.Status = s.Status
haoyanbin's avatar
1  
haoyanbin committed
79 80 81 82 83 84 85
}

func (s *OrgSeasonInsertReq) GetId() interface{} {
	return s.Id
}

type OrgSeasonUpdateReq struct {
haoyanbin's avatar
haoyanbin committed
86 87 88 89 90 91 92 93 94
	Id          int    `uri:"id" comment:""` //
	LeagueId    string `json:"leagueId" comment:"org_league表id"`
	DivisionId  string `json:"divisionId" comment:"org_division表id"`
	SeasonName  string `json:"seasonName" comment:"赛季名称"`
	TotalRounds string `json:"totalRounds" comment:"总轮次"`
	StartTime   string `json:"startTime" comment:"赛季开始时间"`
	EndTime     string `json:"endTime" comment:"赛季结束时间"`
	Status      string `json:"status" comment:"赛季开启状态 1 是 0 否"`
	common.ControlBy
haoyanbin's avatar
1  
haoyanbin committed
95 96
}

haoyanbin's avatar
haoyanbin committed
97 98 99 100 101 102 103 104
func (s *OrgSeasonUpdateReq) Generate(model *models.OrgSeason) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.LeagueId = s.LeagueId
	model.DivisionId = s.DivisionId
	model.SeasonName = s.SeasonName
	model.TotalRounds = s.TotalRounds
haoyanbin's avatar
haoyanbin committed
105 106
	model.StartTime = utils.StringToTime(s.StartTime)
	model.EndTime = utils.StringToTime(s.EndTime)
haoyanbin's avatar
haoyanbin committed
107
	model.Status = s.Status
haoyanbin's avatar
1  
haoyanbin committed
108 109 110 111 112 113 114 115
}

func (s *OrgSeasonUpdateReq) GetId() interface{} {
	return s.Id
}

// OrgSeasonGetReq 功能获取请求参数
type OrgSeasonGetReq struct {
haoyanbin's avatar
haoyanbin committed
116
	Id int `uri:"id"`
haoyanbin's avatar
1  
haoyanbin committed
117
}
haoyanbin's avatar
haoyanbin committed
118

haoyanbin's avatar
1  
haoyanbin committed
119 120 121 122 123 124 125 126 127 128 129
func (s *OrgSeasonGetReq) GetId() interface{} {
	return s.Id
}

// OrgSeasonDeleteReq 功能删除请求参数
type OrgSeasonDeleteReq struct {
	Ids []int `json:"ids"`
}

func (s *OrgSeasonDeleteReq) GetId() interface{} {
	return s.Ids
haoyanbin's avatar
haoyanbin committed
130
}