package dto

import (
	"go-admin/app/admin/models"
	"go-admin/common/dto"
	common "go-admin/common/models"
	"time"
)

type OrgMatchGetPageReq struct {
	dto.Pagination     `search:"-"`
    OrgMatchOrder
}

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"`
    
}

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

type OrgMatchInsertReq struct {
    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 time.Time `json:"matchStartTime" comment:"比赛开始时间"`
    MatchEndTime time.Time `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队积分"`
    common.ControlBy
}

func (s *OrgMatchInsertReq) 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
    model.MatchStartTime = s.MatchStartTime
    model.MatchEndTime = s.MatchEndTime
    model.TeamAId = s.TeamAId
    model.TeamBId = s.TeamBId
    model.TeamAScore = s.TeamAScore
    model.TeamBScore = s.TeamBScore
    model.TeamAIntegral = s.TeamAIntegral
    model.TeamBIntegral = s.TeamBIntegral
}

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

type OrgMatchUpdateReq struct {
    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 time.Time `json:"matchStartTime" comment:"比赛开始时间"`
    MatchEndTime time.Time `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队积分"`
    common.ControlBy
}

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
    model.MatchStartTime = s.MatchStartTime
    model.MatchEndTime = s.MatchEndTime
    model.TeamAId = s.TeamAId
    model.TeamBId = s.TeamBId
    model.TeamAScore = s.TeamAScore
    model.TeamBScore = s.TeamBScore
    model.TeamAIntegral = s.TeamAIntegral
    model.TeamBIntegral = s.TeamBIntegral
}

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

// OrgMatchGetReq 功能获取请求参数
type OrgMatchGetReq struct {
     Id int `uri:"id"`
}
func (s *OrgMatchGetReq) GetId() interface{} {
	return s.Id
}

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

func (s *OrgMatchDeleteReq) GetId() interface{} {
	return s.Ids
}