package dto

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

type OrgClubGetPageReq struct {
	dto.Pagination  `search:"-"`
	ClubName        string `form:"clubName" json:"clubName" search:"type:contains;column:club_name;table:org_club" comment:"俱乐部名称"` //俱乐部名称
	CreateStartTime string `form:"createStartTime"  search:"type:gte;column:create_at;table:org_club" comment:"开始时间"`               //开始时间
	CreateEndTime   string `form:"createEndTime"  search:"type:lte;column:create_at;table:org_club" comment:"结束时间"`                 //结束时间
}

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

type OrgClubInsertReq struct {
	Id             int    `json:"-" comment:""` //
	ClubName       string `json:"clubName" comment:"俱乐部名称"`
	ClubUsername   string `json:"clubUsername" comment:"俱乐部账号"`
	ClubContacts   string `json:"clubContacts" comment:"俱乐部联系人"`
	ClubContactsEn string `json:"clubContactsEn" comment:"俱乐部联系人"`
	ClubMobile     string `json:"clubMobile" comment:"俱乐部联系电话"`
	ClubLogo       string `json:"clubLogo" comment:"俱乐部logo"`
	ClubQrcode     string `json:"clubQrcode" comment:"俱乐部二维码"`
	common.ControlBy
}

func (s *OrgClubInsertReq) Generate(model *models.OrgClub) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.ClubName = s.ClubName
	model.ClubUsername = s.ClubUsername
	model.ClubContacts = s.ClubContacts
	model.ClubContactsEn = s.ClubContactsEn
	model.ClubMobile = s.ClubMobile
	model.ClubLogo = s.ClubLogo
	model.ClubQrcode = s.ClubQrcode
}

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

type OrgClubUpdateReq struct {
	Id             int    `uri:"id" comment:""` //
	ClubName       string `json:"clubName" comment:"俱乐部名称"`
	ClubUsername   string `json:"clubUsername" comment:"俱乐部账号"`
	ClubContacts   string `json:"clubContacts" comment:"俱乐部联系人"`
	ClubContactsEn string `json:"clubContactsEn" comment:"俱乐部联系人"`
	ClubMobile     string `json:"clubMobile" comment:"俱乐部联系电话"`
	ClubLogo       string `json:"clubLogo" comment:"俱乐部logo"`
	ClubQrcode     string `json:"clubQrcode" comment:"俱乐部二维码"`
	common.ControlBy
}

func (s *OrgClubUpdateReq) Generate(model *models.OrgClub) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.ClubName = s.ClubName
	model.ClubUsername = s.ClubUsername
	model.ClubContacts = s.ClubContacts
	model.ClubContactsEn = s.ClubContactsEn
	model.ClubMobile = s.ClubMobile
	model.ClubLogo = s.ClubLogo
	model.ClubQrcode = s.ClubQrcode
}

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

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

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

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

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