package dto

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

type OrgMatchEvaluateGetPageReq struct {
	dto.Pagination `search:"-"`
	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:omtp" comment:""`
	PlayerName     string `form:"playerName"  search:"type:exact;column:player_name;table:omtp" comment:""`
	MvStatus       string `form:"mvStatus"  search:"type:exact;column:mv_status;table:ome" comment:"视频维护状态 1 待维护 2 维护完成 3 驳回 4 维护完成"`
	Status         string `form:"status"  search:"type:exact;column:status;table:ome" comment:"发布状态 1 待审核 3 驳回 4 发布完成"`
	OrgMatchEvaluateOrder
}

type OrgMatchEvaluateGetPageReply 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 `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"`
	MvStatus       string    `json:"mvStatus" gorm:"type:bigint(20);comment:视频维护状态 1 待维护 2 维护完成 3 驳回 4 维护完成"`
	Status         string    `json:"status" gorm:"type:bigint(20);comment:发布状态 1 待审核 3 驳回 4 发布完成"`
}

//ol.league_name, od.division_name, os.season_name, om.rounds, omtp.player_name, om.match_start_time, om.match_end_time, ome.mv_status, ome.status, ome.remark
type OrgMatchEvaluateOrder struct {
	Id                      int       `form:"idOrder"  search:"type:order;column:id;table:org_match_evaluate"`
	Rounds                  string    `form:"roundsOrder"  search:"type:order;column:rounds;table:org_match_evaluate"`
	TeamUserId              string    `form:"teamUserIdOrder"  search:"type:order;column:team_user_id;table:org_match_evaluate"`
	PlayerId                string    `form:"playerIdOrder"  search:"type:order;column:player_id;table:org_match_evaluate"`
	Content                 string    `form:"contentOrder"  search:"type:order;column:content;table:org_match_evaluate"`
	WonderfulMomentImg      string    `form:"wonderfulMomentImgOrder"  search:"type:order;column:wonderful_moment_img;table:org_match_evaluate"`
	WonderfulMomentMv       string    `form:"wonderfulMomentMvOrder"  search:"type:order;column:wonderful_moment_mv;table:org_match_evaluate"`
	WonderfulMomentImgTitle string    `form:"wonderfulMomentImgTitleOrder"  search:"type:order;column:wonderful_moment_img_title;table:org_match_evaluate"`
	WonderfulMomentMvTitle  string    `form:"wonderfulMomentMvTitleOrder"  search:"type:order;column:wonderful_moment_mv_title;table:org_match_evaluate"`
	MvStatus                string    `form:"mvStatusOrder"  search:"type:order;column:mv_status;table:org_match_evaluate"`
	Status                  string    `form:"statusOrder"  search:"type:order;column:status;table:org_match_evaluate"`
	Remark                  string    `form:"remarkOrder"  search:"type:order;column:remark;table:org_match_evaluate"`
	CreateBy                string    `form:"createByOrder"  search:"type:order;column:create_by;table:org_match_evaluate"`
	UpdateBy                string    `form:"updateByOrder"  search:"type:order;column:update_by;table:org_match_evaluate"`
	CreatedAt               time.Time `form:"createdAtOrder"  search:"type:order;column:created_at;table:org_match_evaluate"`
	UpdatedAt               time.Time `form:"updatedAtOrder"  search:"type:order;column:updated_at;table:org_match_evaluate"`
	DeletedAt               time.Time `form:"deletedAtOrder"  search:"type:order;column:deleted_at;table:org_match_evaluate"`
}

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

type OrgMatchEvaluateInsertReq struct {
	Id                      int    `json:"-" 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:"教练评价内容"`
	WonderfulMomentImg      string `json:"wonderfulMomentImg" comment:"精彩时刻图"`
	WonderfulMomentMv       string `json:"wonderfulMomentMv" comment:"精彩时刻视频"`
	WonderfulMomentImgTitle string `json:"wonderfulMomentImgTitle" comment:"精彩时刻图标题"`
	WonderfulMomentMvTitle  string `json:"wonderfulMomentMvTitle" comment:"精彩时刻视频标题"`
	MvStatus                string `json:"mvStatus" comment:"视频维护状态 1 待维护 2 维护完成 3 驳回 4 维护完成"`
	Status                  string `json:"status" comment:"发布状态 1 待审核 3 驳回 4 发布完成"`
	Remark                  string `json:"remark" comment:"驳回原因"`
	common.ControlBy
}

func (s *OrgMatchEvaluateInsertReq) Generate(model *models.OrgMatchEvaluate) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.Rounds = s.Rounds
	model.TeamUserId = s.TeamUserId
	model.PlayerId = s.PlayerId
	model.Content = s.Content
	model.WonderfulMomentImg = s.WonderfulMomentImg
	model.WonderfulMomentMv = s.WonderfulMomentMv
	model.WonderfulMomentImgTitle = s.WonderfulMomentImgTitle
	model.WonderfulMomentMvTitle = s.WonderfulMomentMvTitle
	model.MvStatus = s.MvStatus
	model.Status = s.Status
	model.Remark = s.Remark
}

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

type OrgMatchEvaluateUpdateReq struct {
	Id                      int    `uri:"id" 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:"教练评价内容"`
	WonderfulMomentImg      string `json:"wonderfulMomentImg" comment:"精彩时刻图"`
	WonderfulMomentMv       string `json:"wonderfulMomentMv" comment:"精彩时刻视频"`
	WonderfulMomentImgTitle string `json:"wonderfulMomentImgTitle" comment:"精彩时刻图标题"`
	WonderfulMomentMvTitle  string `json:"wonderfulMomentMvTitle" comment:"精彩时刻视频标题"`
	MvStatus                string `json:"mvStatus" comment:"视频维护状态 1 待维护 2 维护完成 3 驳回 4 维护完成"`
	Status                  string `json:"status" comment:"发布状态 1 待审核 3 驳回 4 发布完成"`
	Remark                  string `json:"remark" comment:"驳回原因"`
	common.ControlBy
}

func (s *OrgMatchEvaluateUpdateReq) Generate(model *models.OrgMatchEvaluate) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.Rounds = s.Rounds
	model.TeamUserId = s.TeamUserId
	model.PlayerId = s.PlayerId
	model.Content = s.Content
	model.WonderfulMomentImg = s.WonderfulMomentImg
	model.WonderfulMomentMv = s.WonderfulMomentMv
	model.WonderfulMomentImgTitle = s.WonderfulMomentImgTitle
	model.WonderfulMomentMvTitle = s.WonderfulMomentMvTitle
	model.MvStatus = s.MvStatus
	model.Status = s.Status
	model.Remark = s.Remark
}

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

// OrgMatchEvaluateGetReq 功能获取请求参数
type OrgMatchEvaluateGetReq struct {
	Id int `uri:"id"`
}

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

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

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