package dto

import (

	"go-admin/app/admin/models"
	"go-admin/common/dto"
	common "go-admin/common/models"
)

type LineAccountSettingGetPageReq struct {
	dto.Pagination     `search:"-"`
    LineAccountSettingOrder
}

type LineAccountSettingOrder struct {
    Id string `form:"idOrder"  search:"type:order;column:id;table:line_account_setting"`
    UserName string `form:"userNameOrder"  search:"type:order;column:user_name;table:line_account_setting"`
    Password string `form:"passwordOrder"  search:"type:order;column:password;table:line_account_setting"`
    CreatedAt string `form:"createdAtOrder"  search:"type:order;column:created_at;table:line_account_setting"`
    UpdatedAt string `form:"updatedAtOrder"  search:"type:order;column:updated_at;table:line_account_setting"`
    DeletedAt string `form:"deletedAtOrder"  search:"type:order;column:deleted_at;table:line_account_setting"`
    CreateBy string `form:"createByOrder"  search:"type:order;column:create_by;table:line_account_setting"`
    UpdateBy string `form:"updateByOrder"  search:"type:order;column:update_by;table:line_account_setting"`
    
}

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

type LineAccountSettingInsertReq struct {
    Id int `json:"-" comment:"id"` // id
    UserName string `json:"userName" comment:"用户"`
    Password string `json:"password" comment:"密码"`
    common.ControlBy
}

func (s *LineAccountSettingInsertReq) Generate(model *models.LineAccountSetting)  {
    if s.Id == 0 {
        model.Model = common.Model{ Id: s.Id }
    }
    model.UserName = s.UserName
    model.Password = s.Password
    model.CreateBy = s.CreateBy // 添加这而，需要记录是被谁创建的
}

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

type LineAccountSettingUpdateReq struct {
    Id int `uri:"id" comment:"id"` // id
    UserName string `json:"userName" comment:"用户"`
    Password string `json:"password" comment:"密码"`
    common.ControlBy
}

func (s *LineAccountSettingUpdateReq) Generate(model *models.LineAccountSetting)  {
    if s.Id == 0 {
        model.Model = common.Model{ Id: s.Id }
    }
    model.UserName = s.UserName
    model.Password = s.Password
    model.UpdateBy = s.UpdateBy // 添加这而，需要记录是被谁更新的
}

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

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

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

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