package dto

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

type OrgTeamGetPageReq struct {
	dto.Pagination  `search:"-"`
	TeamName        string `form:"teamName" json:"teamName" search:"type:contains;column:team_name;table:ot" comment:"球队名称"` //球队名称
	CreateStartTime string `form:"createStartTime"  search:"type:gte;column:created_at;table:ot" comment:"开始时间"`             //开始时间
	CreateEndTime   string `form:"createEndTime"  search:"type:lte;column:created_at;table:ot" comment:"结束时间"`               //结束时间
	OrgTeamOrder
}

type OrgTeamGetPageReply struct {
	Id        string `json:"id" comment:"球队id"` //球队id
	ClubId    string `json:"clubId" comment:"俱乐部id"`
	ClubName  string `json:"clubName" comment:"俱乐部名称"`
	TeamName  string `json:"teamName" comment:"球队名称"`
	CreatedAt string `json:"createdAt" comment:"球队创建时间"`
}

type OrgTeamOrder struct {
	Id        int       `form:"idOrder"  search:"type:order;column:id;table:org_team"`
	ClubId    string    `form:"clubIdOrder"  search:"type:order;column:club_id;table:org_team"`
	TeamName  string    `form:"teamNameOrder"  search:"type:order;column:team_name;table:org_team"`
	CreateBy  string    `form:"createByOrder"  search:"type:order;column:create_by;table:org_team"`
	UpdateBy  string    `form:"updateByOrder"  search:"type:order;column:update_by;table:org_team"`
	CreatedAt time.Time `form:"createdAtOrder"  search:"type:order;column:created_at;table:org_team"`
	UpdatedAt time.Time `form:"updatedAtOrder"  search:"type:order;column:updated_at;table:org_team"`
	DeletedAt time.Time `form:"deletedAtOrder"  search:"type:order;column:deleted_at;table:org_team"`
}

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

type OrgTeamInsertReq struct {
	Id       int    `json:"-" comment:""` //
	ClubId   string `json:"clubId" comment:"org_club表id"`
	TeamName string `json:"teamName" comment:"球队名称"`
	common.ControlBy
}

func (s *OrgTeamInsertReq) Generate(model *models.OrgTeam) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.ClubId = s.ClubId
	model.TeamName = s.TeamName
}

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

type OrgTeamUpdateReq struct {
	Id       int    `uri:"id" comment:""` //
	ClubId   string `json:"clubId" comment:"org_club表id"`
	TeamName string `json:"teamName" comment:"球队名称"`
	common.ControlBy
}

func (s *OrgTeamUpdateReq) Generate(model *models.OrgTeam) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.ClubId = s.ClubId
	model.TeamName = s.TeamName
}

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

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

type OrgTeamGetReply struct {
	ClubId   string `json:"club_id"`
	ClubName string `json:"club_name"`
	TeamName string `json:"team_name"`
}

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

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

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

type Dept struct {
	Id     int `json:"id"`
	DeptId int `json:"deptId"`
}
