package dto

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

type OrgPlayerUserGetPageReq struct {
	dto.Pagination     `search:"-"`
    OrgPlayerUserOrder
}

type OrgPlayerUserOrder struct {Id int `form:"idOrder"  search:"type:order;column:id;table:org_player_user"`
    Username string `form:"usernameOrder"  search:"type:order;column:username;table:org_player_user"`
    Password string `form:"passwordOrder"  search:"type:order;column:password;table:org_player_user"`
    Nickname string `form:"nicknameOrder"  search:"type:order;column:nickname;table:org_player_user"`
    Headimg string `form:"headimgOrder"  search:"type:order;column:headimg;table:org_player_user"`
    OpenId string `form:"openIdOrder"  search:"type:order;column:open_id;table:org_player_user"`
    Phone string `form:"phoneOrder"  search:"type:order;column:phone;table:org_player_user"`
    CreateBy string `form:"createByOrder"  search:"type:order;column:create_by;table:org_player_user"`
    UpdateBy string `form:"updateByOrder"  search:"type:order;column:update_by;table:org_player_user"`
    CreatedAt time.Time `form:"createdAtOrder"  search:"type:order;column:created_at;table:org_player_user"`
    UpdatedAt time.Time `form:"updatedAtOrder"  search:"type:order;column:updated_at;table:org_player_user"`
    DeletedAt time.Time `form:"deletedAtOrder"  search:"type:order;column:deleted_at;table:org_player_user"`
    
}

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

type OrgPlayerUserInsertReq struct {
    Id int `json:"-" comment:""` // 
    Username string `json:"username" comment:"登录账号（手机号）"`
    Password string `json:"password" comment:"密码"`
    Nickname string `json:"nickname" comment:"昵称"`
    Headimg string `json:"headimg" comment:"头像"`
    OpenId string `json:"openId" comment:"小程序唯一id"`
    Phone string `json:"phone" comment:"小程序手机号"`
    common.ControlBy
}

func (s *OrgPlayerUserInsertReq) Generate(model *models.OrgPlayerUser)  {
    if s.Id == 0 {
        model.Model = common.Model{ Id: s.Id }
    }
    model.Username = s.Username
    model.Password = s.Password
    model.Nickname = s.Nickname
    model.Headimg = s.Headimg
    model.OpenId = s.OpenId
    model.Phone = s.Phone
}

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

type OrgPlayerUserUpdateReq struct {
    Id int `uri:"id" comment:""` // 
    Username string `json:"username" comment:"登录账号（手机号）"`
    Password string `json:"password" comment:"密码"`
    Nickname string `json:"nickname" comment:"昵称"`
    Headimg string `json:"headimg" comment:"头像"`
    OpenId string `json:"openId" comment:"小程序唯一id"`
    Phone string `json:"phone" comment:"小程序手机号"`
    common.ControlBy
}

func (s *OrgPlayerUserUpdateReq) Generate(model *models.OrgPlayerUser)  {
    if s.Id == 0 {
        model.Model = common.Model{ Id: s.Id }
    }
    model.Username = s.Username
    model.Password = s.Password
    model.Nickname = s.Nickname
    model.Headimg = s.Headimg
    model.OpenId = s.OpenId
    model.Phone = s.Phone
}

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

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

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

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