package dto

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

type OrgTeamUserGetPageReq struct {
	dto.Pagination     `search:"-"`
    OrgTeamUserOrder
}

type OrgTeamUserOrder struct {Id int `form:"idOrder"  search:"type:order;column:id;table:org_team_user"`
    ClubId string `form:"clubIdOrder"  search:"type:order;column:club_id;table:org_team_user"`
    TeamId string `form:"teamIdOrder"  search:"type:order;column:team_id;table:org_team_user"`
    UserId string `form:"userIdOrder"  search:"type:order;column:user_id;table:org_team_user"`
    Name string `form:"nameOrder"  search:"type:order;column:name;table:org_team_user"`
    Sex string `form:"sexOrder"  search:"type:order;column:sex;table:org_team_user"`
    UserImg string `form:"userImgOrder"  search:"type:order;column:user_img;table:org_team_user"`
    SignImg string `form:"signImgOrder"  search:"type:order;column:sign_img;table:org_team_user"`
    CreateBy string `form:"createByOrder"  search:"type:order;column:create_by;table:org_team_user"`
    UpdateBy string `form:"updateByOrder"  search:"type:order;column:update_by;table:org_team_user"`
    CreatedAt time.Time `form:"createdAtOrder"  search:"type:order;column:created_at;table:org_team_user"`
    UpdatedAt time.Time `form:"updatedAtOrder"  search:"type:order;column:updated_at;table:org_team_user"`
    DeletedAt time.Time `form:"deletedAtOrder"  search:"type:order;column:deleted_at;table:org_team_user"`
    
}

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"`
    UserId string `json:"userId" comment:"sys_user表id"`
    Name string `json:"name" comment:"姓名"`
    Sex string `json:"sex" comment:"性别"`
    UserImg string `json:"userImg" comment:"用户照片"`
    SignImg string `json:"signImg" 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"`
    UserId string `json:"userId" comment:"sys_user表id"`
    Name string `json:"name" comment:"姓名"`
    Sex string `json:"sex" comment:"性别"`
    UserImg string `json:"userImg" comment:"用户照片"`
    SignImg string `json:"signImg" comment:"签名照片"`
    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
}

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

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

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