package dto

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

type OrgTeamMatchEvaluateGetPageReq struct {
	dto.Pagination `search:"-"`
	TeamId         string `form:"teamId"  search:"-"`                                                                                 //联赛级别id
	LeagueId       string `form:"leagueId"  search:"type:exact;column:league_id;table:om" comment:"联赛级别id"`                           //联赛级别id
	DivisionId     string `form:"divisionId"  search:"type:exact;column:division_id;table:om" comment:"赛区id"`                         //赛区id
	SeasonId       string `form:"seasonId"  search:"type:exact;column:season_id;table:om" comment:"赛季id"`                             //赛季id
	Rounds         string `form:"rounds"  search:"type:exact;column:rounds;table:omtp" comment:"轮次"`                                  //轮次
	PlayerName     string `form:"playerName"  search:"type:contains;column:player_name;table:omtp" comment:"球员名称"`                    //球员名称
	ContentStatus  string `form:"contentStatus"  search:"type:exact;column:content_status;table:ome" comment:"教练评价状态 1 待评价 2 评价完成"`   //教练评价状态 1 待评价 2 评价完成
	MvStatus       string `form:"mvStatus"  search:"type:exact;column:mv_status;table:ome" comment:"视频维护状态 1 待维护 2 维护完成 3 驳回 4 维护完成"` //视频维护状态 1 待维护 2 维护完成 3 驳回 4 维护完成
	Status         string `form:"status"  search:"type:exact;column:status;table:ome" comment:"发布状态 0 保存 1 待审核 3 驳回 4 发布完成"`          //发布状态 0 保存 1 待审核 3 驳回 4 发布完成
}

type OrgTeamMatchEvaluateGetPageReply struct {
	Id             string    `json:"id"`
	LeagueName     string    `json:"leagueName"`
	DivisionName   string    `json:"divisionName"`
	SeasonName     string    `json:"seasonName"`
	Rounds         string    `json:"rounds"`
	PlayerName     string    `json:"playerName"`
	MatchStartTime time.Time `json:"matchStartTimeOrder"`
	MatchEndTime   time.Time `json:"matchEndTimeOrder"`
	ContentStatus  string    `json:"contentStatus"`
	MvStatus       string    `json:"mvStatus"`
	Status         string    `json:"status"`
}

type GetPageTeamMatchReq struct {
	Id string `form:"id" json:"id"`
}
type GetPageTeamMatchReply struct {
	MatchInfo     dto.PageMatchInfo   `json:"matchInfo"`
	TotalScoring  []dto.TotalScoring  `json:"totalScoring"`
	RoundsScoring []dto.RoundsScoring `json:"roundsScoring"`
}

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

type OrgTeamMatchEvaluateUpdateReq struct {
	Id            int    `uri:"id" comment:""` //
	MatchId       string `json:"matchId" comment:""`
	Rounds        string `json:"rounds" comment:""`
	TeamUserId    string `json:"teamUserId" comment:"org_team_user表id（教练id）"`
	PlayerId      string `json:"playerId" comment:"org_player表id（球员id）"`
	Content       string `json:"content" comment:"教练评价内容"`
	ContentStatus string `json:"contentStatus" comment:"教练评价状态 1 待评价 2 评价完成"`
	common.ControlBy
}

func (s *OrgTeamMatchEvaluateUpdateReq) Generate(model *models.OrgMatchEvaluate) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.MatchId = s.MatchId
	model.Rounds = s.Rounds
	model.TeamUserId = s.TeamUserId
	model.PlayerId = s.PlayerId
	model.Content = s.Content
	model.ContentStatus = s.ContentStatus
}

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