org_match.go 8.68 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 7 8 9 10
	"go-admin/common/dto"
	common "go-admin/common/models"
	"time"
)

type OrgMatchGetPageReq struct {
haoyanbin's avatar
haoyanbin committed
11
	dto.Pagination `search:"-"`
haoyanbin's avatar
haoyanbin committed
12 13 14 15 16 17 18 19
	LeagueId       string `form:"leagueId"  search:"type:exact;column:league_id;table:om" comment:""`
	DivisionId     string `form:"divisionId"  search:"type:exact;column:division_id;table:om" comment:""`
	SeasonId       string `form:"seasonId"  search:"type:exact;column:season_id;table:om" comment:""`
	Rounds         string `form:"rounds"  search:"type:exact;column:rounds;table:om" comment:""`
	Grouping       string `form:"grouping"  search:"type:exact;column:grouping;table:om" comment:""`
	Status         string `form:"status"  search:"type:exact;column:status;table:om" comment:"比赛状态 1 未开始 2 比赛中 3 已结束"`
	MatchStartTime string `form:"matchStartTime"  search:"type:gte;column:match_start_time;table:om" comment:"比赛开始时间"`
	MatchEndTime   string `form:"matchEndTime"  search:"type:lte;column:match_end_time;table:om" comment:"比赛结束时间"`
haoyanbin's avatar
1  
haoyanbin committed
20 21
}

haoyanbin's avatar
haoyanbin committed
22 23 24 25 26 27 28 29 30
type OrgMatchGetPageReply struct {
	Id             string    `json:"id"`
	LeagueName     string    `json:"leagueName"`
	DivisionName   string    `json:"divisionName"`
	SeasonName     string    `json:"seasonName"`
	Rounds         string    `json:"rounds"`
	Grouping       string    `json:"grouping"`
	TeamAName      string    `json:"team_a_name"`
	TeamBName      string    `json:"team_b_name"`
haoyanbin's avatar
haoyanbin committed
31 32
	TeamAId        string    `json:"teamAId"`
	TeamBId        string    `json:"teamBId"`
haoyanbin's avatar
haoyanbin committed
33 34
	MatchStartTime time.Time `json:"matchStartTime"`
	MatchEndTime   time.Time `json:"matchEndTime"`
haoyanbin's avatar
haoyanbin committed
35 36 37 38 39 40 41 42
	Status         string    `json:"status"`
}

type OrgMatchGetInfoReq struct {
	Id int `form:"id" json:"id"`
}

type OrgMatchGetInfoReply struct {
haoyanbin's avatar
haoyanbin committed
43 44 45 46 47
	OrgMatch        models.OrgMatch         `form:"orgMatch"`
	OrgLeagueList   []models.OrgLeague      `form:"orgLeagueList"`
	OrgSeasonList   []OrgSeasonGetPageReply `form:"orgSeasonList"`
	OrgDivisionList []models.OrgDivision    `form:"orgDivisionList"`
	OrgTeamList     []OrgTeamGetPageReply   `form:"orgTeamList"`
haoyanbin's avatar
haoyanbin committed
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
}

type OrgMatchOrder struct {
	Id             int       `form:"idOrder"  search:"type:order;column:id;table:org_match"`
	LeagueId       string    `form:"leagueIdOrder"  search:"type:order;column:league_id;table:org_match"`
	DivisionId     string    `form:"divisionIdOrder"  search:"type:order;column:division_id;table:org_match"`
	SeasonId       string    `form:"seasonIdOrder"  search:"type:order;column:season_id;table:org_match"`
	ClubId         string    `form:"clubIdOrder"  search:"type:order;column:club_id;table:org_match"`
	TeamId         string    `form:"teamIdOrder"  search:"type:order;column:team_id;table:org_match"`
	Status         string    `form:"statusOrder"  search:"type:order;column:status;table:org_match"`
	Rounds         string    `form:"roundsOrder"  search:"type:order;column:rounds;table:org_match"`
	Grouping       string    `form:"groupingOrder"  search:"type:order;column:grouping;table:org_match"`
	MatchStartTime time.Time `form:"matchStartTimeOrder"  search:"type:order;column:match_start_time;table:org_match"`
	MatchEndTime   time.Time `form:"matchEndTimeOrder"  search:"type:order;column:match_end_time;table:org_match"`
	TeamAId        string    `form:"teamAIdOrder"  search:"type:order;column:team_a_id;table:org_match"`
	TeamBId        string    `form:"teamBIdOrder"  search:"type:order;column:team_b_id;table:org_match"`
	TeamAScore     string    `form:"teamAScoreOrder"  search:"type:order;column:team_a_score;table:org_match"`
	TeamBScore     string    `form:"teamBScoreOrder"  search:"type:order;column:team_b_score;table:org_match"`
	TeamAIntegral  string    `form:"teamAIntegralOrder"  search:"type:order;column:team_a_integral;table:org_match"`
	TeamBIntegral  string    `form:"teamBIntegralOrder"  search:"type:order;column:team_b_integral;table:org_match"`
	CreateBy       string    `form:"createByOrder"  search:"type:order;column:create_by;table:org_match"`
	UpdateBy       string    `form:"updateByOrder"  search:"type:order;column:update_by;table:org_match"`
	CreatedAt      time.Time `form:"createdAtOrder"  search:"type:order;column:created_at;table:org_match"`
	UpdatedAt      time.Time `form:"updatedAtOrder"  search:"type:order;column:updated_at;table:org_match"`
	DeletedAt      time.Time `form:"deletedAtOrder"  search:"type:order;column:deleted_at;table:org_match"`
haoyanbin's avatar
1  
haoyanbin committed
73 74 75 76 77 78 79
}

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

type OrgMatchInsertReq struct {
haoyanbin's avatar
haoyanbin committed
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
	Id             int    `json:"-" comment:""` //
	LeagueId       string `json:"leagueId" comment:""`
	DivisionId     string `json:"divisionId" comment:""`
	SeasonId       string `json:"seasonId" comment:""`
	ClubId         string `json:"clubId" comment:""`
	TeamId         string `json:"teamId" comment:""`
	Status         string `json:"status" comment:"比赛状态 1 未开始 2 比赛中 3 已结束"`
	Rounds         string `json:"rounds" comment:"轮次"`
	Grouping       string `json:"grouping" comment:"分组"`
	MatchStartTime string `json:"matchStartTime" comment:"比赛开始时间"`
	MatchEndTime   string `json:"matchEndTime" comment:"比赛结束时间"`
	TeamAId        string `json:"teamAId" comment:"a队id"`
	TeamBId        string `json:"teamBId" comment:"b队id"`
	TeamAScore     string `json:"teamAScore" comment:"a队比分"`
	TeamBScore     string `json:"teamBScore" comment:"b队比分"`
	TeamAIntegral  string `json:"teamAIntegral" comment:"a队积分"`
	TeamBIntegral  string `json:"teamBIntegral" comment:"a队积分"`
haoyanbin's avatar
haoyanbin committed
97
	common.ControlBy
haoyanbin's avatar
1  
haoyanbin committed
98 99
}

haoyanbin's avatar
haoyanbin committed
100 101 102 103
func (s *OrgMatchInsertReq) Generate(model *models.OrgMatch) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
haoyanbin's avatar
haoyanbin committed
104

haoyanbin's avatar
haoyanbin committed
105 106 107 108 109 110 111 112
	model.LeagueId = s.LeagueId
	model.DivisionId = s.DivisionId
	model.SeasonId = s.SeasonId
	model.ClubId = s.ClubId
	model.TeamId = s.TeamId
	model.Status = s.Status
	model.Rounds = s.Rounds
	model.Grouping = s.Grouping
haoyanbin's avatar
haoyanbin committed
113 114
	model.MatchStartTime, _ = time.Parse("2006-01-02 15:04:05", s.MatchStartTime)
	model.MatchEndTime, _ = time.Parse("2006-01-02 15:04:05", s.MatchEndTime)
haoyanbin's avatar
haoyanbin committed
115 116 117 118 119 120
	model.TeamAId = s.TeamAId
	model.TeamBId = s.TeamBId
	model.TeamAScore = s.TeamAScore
	model.TeamBScore = s.TeamBScore
	model.TeamAIntegral = s.TeamAIntegral
	model.TeamBIntegral = s.TeamBIntegral
haoyanbin's avatar
1  
haoyanbin committed
121 122 123 124 125 126 127
}

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

type OrgMatchUpdateReq struct {
haoyanbin's avatar
haoyanbin committed
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
	Id             int    `uri:"id" comment:""` //
	LeagueId       string `json:"leagueId" comment:""`
	DivisionId     string `json:"divisionId" comment:""`
	SeasonId       string `json:"seasonId" comment:""`
	ClubId         string `json:"clubId" comment:""`
	TeamId         string `json:"teamId" comment:""`
	Status         string `json:"status" comment:"比赛状态 1 未开始 2 比赛中 3 已结束"`
	Rounds         string `json:"rounds" comment:"轮次"`
	Grouping       string `json:"grouping" comment:"分组"`
	MatchStartTime string `json:"matchStartTime" comment:"比赛开始时间"`
	MatchEndTime   string `json:"matchEndTime" comment:"比赛结束时间"`
	TeamAId        string `json:"teamAId" comment:"a队id"`
	TeamBId        string `json:"teamBId" comment:"b队id"`
	TeamAScore     string `json:"teamAScore" comment:"a队比分"`
	TeamBScore     string `json:"teamBScore" comment:"b队比分"`
	TeamAIntegral  string `json:"teamAIntegral" comment:"a队积分"`
	TeamBIntegral  string `json:"teamBIntegral" comment:"a队积分"`
haoyanbin's avatar
haoyanbin committed
145
	common.ControlBy
haoyanbin's avatar
1  
haoyanbin committed
146 147
}

haoyanbin's avatar
haoyanbin committed
148 149 150 151 152 153 154 155 156 157 158 159
func (s *OrgMatchUpdateReq) Generate(model *models.OrgMatch) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.LeagueId = s.LeagueId
	model.DivisionId = s.DivisionId
	model.SeasonId = s.SeasonId
	model.ClubId = s.ClubId
	model.TeamId = s.TeamId
	model.Status = s.Status
	model.Rounds = s.Rounds
	model.Grouping = s.Grouping
haoyanbin's avatar
haoyanbin committed
160 161
	model.MatchStartTime, _ = time.Parse("2006-01-02 15:04:05", s.MatchStartTime)
	model.MatchEndTime, _ = time.Parse("2006-01-02 15:04:05", s.MatchEndTime)
haoyanbin's avatar
haoyanbin committed
162 163 164 165 166 167
	model.TeamAId = s.TeamAId
	model.TeamBId = s.TeamBId
	model.TeamAScore = s.TeamAScore
	model.TeamBScore = s.TeamBScore
	model.TeamAIntegral = s.TeamAIntegral
	model.TeamBIntegral = s.TeamBIntegral
haoyanbin's avatar
1  
haoyanbin committed
168 169 170 171 172 173 174 175
}

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

// OrgMatchGetReq 功能获取请求参数
type OrgMatchGetReq struct {
haoyanbin's avatar
haoyanbin committed
176
	Id int `uri:"id"`
haoyanbin's avatar
1  
haoyanbin committed
177
}
haoyanbin's avatar
haoyanbin committed
178 179 180 181 182
type OrgMatchGetReply struct {
	OrgMatch            models.OrgMatch             `form:"orgMatch" json:"orgMatch"`
	OrgMatchTeamAPlayer []models.OrgMatchTeamPlayer `form:"orgMatchTeamAPlayer" json:"orgMatchTeamAPlayer"`
	OrgMatchTeamBPlayer []models.OrgMatchTeamPlayer `form:"orgMatchTeamBPlayer" json:"orgMatchTeamBPlayer"`
}
haoyanbin's avatar
haoyanbin committed
183

haoyanbin's avatar
1  
haoyanbin committed
184 185 186 187 188 189 190 191 192 193 194
func (s *OrgMatchGetReq) GetId() interface{} {
	return s.Id
}

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

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