package dto

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

type OrgLeagueGetPageReq struct {
	PlayerId string `form:"playerId" json:"playerId" comment:""` //
}

type OrgLeagueGetPageReply struct {
	Id         string `json:"id" comment:""` //
	LeagueName string `json:"leagueName" comment:"联赛级别"`
}

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

type OrgLeagueInsertReq struct {
	Id         int    `json:"-" comment:""` //
	LeagueName string `json:"leagueName" comment:"联赛级别"`
	Status     string `json:"status" comment:"联赛开启状态 1 是 0 否"`
	common.ControlBy
}

func (s *OrgLeagueInsertReq) Generate(model *models.OrgLeague) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.LeagueName = s.LeagueName
	model.Status = s.Status
}

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

type OrgLeagueUpdateReq struct {
	Id         int    `uri:"id" comment:""` //
	LeagueName string `json:"leagueName" comment:"联赛级别"`
	Status     string `json:"status" comment:"联赛开启状态 1 是 0 否"`
	common.ControlBy
}

func (s *OrgLeagueUpdateReq) Generate(model *models.OrgLeague) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.LeagueName = s.LeagueName
	model.Status = s.Status
}

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

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

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

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

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