package dto

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

type OrgTeamUserGetPageReq struct {
	dto.Pagination `search:"-"`
	TeamName       string `form:"teamName"  search:"type:contains;column:team_name;table:ot" comment:"球队名称"` //球队名称
	Name           string `form:"name"  search:"type:contains;column:name;table:otu" comment:"姓名"`           //姓名
	Status         string `form:"status"  search:"type:exact;column:status;table:su" comment:"状态"`           //状态 1 离职 2 在职
}

type OrgTeamUserGetPageReply struct {
	Id       string `json:"id"`
	ClubName string `json:"clubName"`
	TeamName string `json:"teamName"`
	Name     string `json:"name"`
	Sex      string `json:"sex"`
	RoleName string `json:"roleName"`
	Status   string `json:"status"`
}

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

type OrgTeamUserInsertReq struct {
	Id       int    `json:"-" comment:""` //
	ClubId   string `json:"clubId" comment:"org_club表id"`
	TeamId   string `json:"teamId" comment:"org_team表id"`
	RoleId   string `json:"roleId" comment:"角色id"`
	UserId   string `json:"userId" comment:"用户id"`
	Name     string `json:"name" comment:"姓名"`
	NameEn   string `json:"name_en" comment:"姓名"`
	Sex      string `json:"sex" comment:"性别"`
	UserImg  string `json:"userImg" comment:"用户照片"`
	SignImg  string `json:"signImg" comment:"签名照片"`
	Username string `json:"username" comment:"账号"`
	common.ControlBy
}

func (s *OrgTeamUserInsertReq) Generate(model *models.OrgTeamUser) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.ClubId = s.ClubId
	model.TeamId = s.TeamId
	model.UserId = s.UserId
	model.Name = s.Name
	model.Sex = s.Sex
	model.UserImg = s.UserImg
	model.SignImg = s.SignImg
}

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

type OrgTeamUserUpdateReq struct {
	Id       int    `uri:"id" comment:""` //
	ClubId   string `json:"clubId" comment:"org_club表id"`
	TeamId   string `json:"teamId" comment:"org_team表id"`
	RoleId   string `json:"roleId" comment:"角色id"`
	UserId   string `json:"userId" comment:"sys_user表id"`
	Name     string `json:"name" comment:"姓名"`
	NameEn   string `json:"name_en" comment:"姓名"`
	Sex      string `json:"sex" comment:"性别"`
	UserImg  string `json:"userImg" comment:"用户照片"`
	SignImg  string `json:"signImg" comment:"签名照片"`
	UserName string `json:"userName" comment:"账号"`
	Status   string `json:"status" comment:"状态 1 离职 2 在职" default:"2"` //状态 1 离职 2 在职
	common.ControlBy
}

type OrgTeamUserUpdateStatusReq struct {
	Id     int    `json:"id" comment:""`                 //
	Status string `json:"status" comment:"状态 1 离职 2 在职"` //状态 1 离职 2 在职
	common.ControlBy
}

func (s *OrgTeamUserUpdateReq) Generate(model *models.OrgTeamUser) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.ClubId = s.ClubId
	model.TeamId = s.TeamId
	model.UserId = s.UserId
	model.Name = s.Name
	model.Sex = s.Sex
	model.UserImg = s.UserImg
	model.SignImg = s.SignImg
}

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

type OrgTeamUserGetForUserId struct {
	UserId int `json:"userId"`
}

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

type OrgTeamUserGetReply struct {
	Id       string `json:"id"`
	ClubName string `json:"clubName"`
	TeamId   string `json:"teamId"`
	TeamName string `json:"teamName"`
	Name     string `json:"name"`
	Sex      string `json:"sex"`
	UserImg  string `json:"userImg" comment:"用户照片"`
	SignImg  string `json:"signImg" comment:"签名照片"`
	RoleId   string `json:"roleId"`
	RoleName string `json:"roleName"`
	Username string `json:"username"`
	Status   string `json:"status"`
}

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

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

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