package dto

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

type OrgPlayerGetPageReq struct {
	dto.Pagination     `search:"-"`
    OrgPlayerOrder
}

type OrgPlayerOrder struct {Id int `form:"idOrder"  search:"type:order;column:id;table:org_player"`
    ClubId string `form:"clubIdOrder"  search:"type:order;column:club_id;table:org_player"`
    TeamId string `form:"teamIdOrder"  search:"type:order;column:team_id;table:org_player"`
    PlayerName string `form:"playerNameOrder"  search:"type:order;column:player_name;table:org_player"`
    IdCard string `form:"idCardOrder"  search:"type:order;column:id_card;table:org_player"`
    Sex string `form:"sexOrder"  search:"type:order;column:sex;table:org_player"`
    PlayerNumber string `form:"playerNumberOrder"  search:"type:order;column:player_number;table:org_player"`
    Position string `form:"positionOrder"  search:"type:order;column:position;table:org_player"`
    PlayerImg string `form:"playerImgOrder"  search:"type:order;column:player_img;table:org_player"`
    PlayerUserId string `form:"playerUserIdOrder"  search:"type:order;column:player_user_id;table:org_player"`
    ShareConf string `form:"shareConfOrder"  search:"type:order;column:share_conf;table:org_player"`
    CreateBy string `form:"createByOrder"  search:"type:order;column:create_by;table:org_player"`
    UpdateBy string `form:"updateByOrder"  search:"type:order;column:update_by;table:org_player"`
    CreatedAt time.Time `form:"createdAtOrder"  search:"type:order;column:created_at;table:org_player"`
    UpdatedAt time.Time `form:"updatedAtOrder"  search:"type:order;column:updated_at;table:org_player"`
    DeletedAt time.Time `form:"deletedAtOrder"  search:"type:order;column:deleted_at;table:org_player"`
    
}

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

type OrgPlayerInsertReq struct {
    Id int `json:"-" comment:""` // 
    ClubId string `json:"clubId" comment:"org_club表id"`
    TeamId string `json:"teamId" comment:"org_team表id"`
    PlayerName string `json:"playerName" comment:"球员姓名"`
    IdCard string `json:"idCard" comment:"身份证号"`
    Sex string `json:"sex" comment:"性别"`
    PlayerNumber string `json:"playerNumber" comment:"球衣号码"`
    Position string `json:"position" comment:"场上位置"`
    PlayerImg string `json:"playerImg" comment:"球员照片"`
    PlayerUserId string `json:"playerUserId" comment:"org_player_user表id"`
    ShareConf string `json:"shareConf" comment:"分享功能 1 开启 2 关闭"`
    common.ControlBy
}

func (s *OrgPlayerInsertReq) Generate(model *models.OrgPlayer)  {
    if s.Id == 0 {
        model.Model = common.Model{ Id: s.Id }
    }
    model.ClubId = s.ClubId
    model.TeamId = s.TeamId
    model.PlayerName = s.PlayerName
    model.IdCard = s.IdCard
    model.Sex = s.Sex
    model.PlayerNumber = s.PlayerNumber
    model.Position = s.Position
    model.PlayerImg = s.PlayerImg
    model.PlayerUserId = s.PlayerUserId
    model.ShareConf = s.ShareConf
}

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

type OrgPlayerUpdateReq struct {
    Id int `uri:"id" comment:""` // 
    ClubId string `json:"clubId" comment:"org_club表id"`
    TeamId string `json:"teamId" comment:"org_team表id"`
    PlayerName string `json:"playerName" comment:"球员姓名"`
    IdCard string `json:"idCard" comment:"身份证号"`
    Sex string `json:"sex" comment:"性别"`
    PlayerNumber string `json:"playerNumber" comment:"球衣号码"`
    Position string `json:"position" comment:"场上位置"`
    PlayerImg string `json:"playerImg" comment:"球员照片"`
    PlayerUserId string `json:"playerUserId" comment:"org_player_user表id"`
    ShareConf string `json:"shareConf" comment:"分享功能 1 开启 2 关闭"`
    common.ControlBy
}

func (s *OrgPlayerUpdateReq) Generate(model *models.OrgPlayer)  {
    if s.Id == 0 {
        model.Model = common.Model{ Id: s.Id }
    }
    model.ClubId = s.ClubId
    model.TeamId = s.TeamId
    model.PlayerName = s.PlayerName
    model.IdCard = s.IdCard
    model.Sex = s.Sex
    model.PlayerNumber = s.PlayerNumber
    model.Position = s.Position
    model.PlayerImg = s.PlayerImg
    model.PlayerUserId = s.PlayerUserId
    model.ShareConf = s.ShareConf
}

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

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

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

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