package dto

import (

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

type LineOrderTemplateLogsGetPageReq struct {
	dto.Pagination     `search:"-"`
    Name string `form:"name"  search:"type:exact;column:name;table:line_order_template_logs" comment:"模板名称"`
    UserId int64 `form:"userId"  search:"type:exact;column:user_id;table:line_order_template_logs" comment:"用户id"`
    Type int64 `form:"type"  search:"type:exact;column:type;table:line_order_template_logs" comment:"模板类型:1=单独添加;2=批量添加"`
    LineOrderTemplateLogsOrder
}

type LineOrderTemplateLogsOrder struct {
    Id string `form:"idOrder"  search:"type:order;column:id;table:line_order_template_logs"`
    Name string `form:"nameOrder"  search:"type:order;column:name;table:line_order_template_logs"`
    UserId string `form:"userIdOrder"  search:"type:order;column:user_id;table:line_order_template_logs"`
    Params string `form:"paramsOrder"  search:"type:order;column:params;table:line_order_template_logs"`
    Type string `form:"typeOrder"  search:"type:order;column:type;table:line_order_template_logs"`
    CreatedAt string `form:"createdAtOrder"  search:"type:order;column:created_at;table:line_order_template_logs"`
    UpdatedAt string `form:"updatedAtOrder"  search:"type:order;column:updated_at;table:line_order_template_logs"`
    DeletedAt string `form:"deletedAtOrder"  search:"type:order;column:deleted_at;table:line_order_template_logs"`
    Switch string `form:"switchOrder"  search:"type:order;column:switch;table:line_order_template_logs"`
    CreateBy string `form:"createByOrder"  search:"type:order;column:create_by;table:line_order_template_logs"`
    UpdateBy string `form:"updateByOrder"  search:"type:order;column:update_by;table:line_order_template_logs"`
    
}

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

type LineOrderTemplateLogsInsertReq struct {
    Id int `json:"-" comment:"id"` // id
    Name string `json:"name" comment:"模板名称"`
    UserId int64 `json:"userId" comment:"用户id"`
    Params string `json:"params" comment:"参数"`
    Type int64 `json:"type" comment:"模板类型:1=单独添加;2=批量添加"`
    Switch string `json:"switch" comment:"开关:0=关,1=开"`
    common.ControlBy
}

func (s *LineOrderTemplateLogsInsertReq) Generate(model *models.LineOrderTemplateLogs)  {
    if s.Id == 0 {
        model.Model = common.Model{ Id: s.Id }
    }
    model.Name = s.Name
    model.UserId = s.UserId
    model.Params = s.Params
    model.Type = s.Type
    model.Switch = s.Switch
    model.CreateBy = s.CreateBy // 添加这而，需要记录是被谁创建的
}

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

type LineOrderTemplateLogsUpdateReq struct {
    Id int `uri:"id" comment:"id"` // id
    Name string `json:"name" comment:"模板名称"`
    UserId int64 `json:"userId" comment:"用户id"`
    Params string `json:"params" comment:"参数"`
    Type int64 `json:"type" comment:"模板类型:1=单独添加;2=批量添加"`
    Switch string `json:"switch" comment:"开关:0=关,1=开"`
    common.ControlBy
}

func (s *LineOrderTemplateLogsUpdateReq) Generate(model *models.LineOrderTemplateLogs)  {
    if s.Id == 0 {
        model.Model = common.Model{ Id: s.Id }
    }
    model.Name = s.Name
    model.UserId = s.UserId
    model.Params = s.Params
    model.Type = s.Type
    model.Switch = s.Switch
    model.UpdateBy = s.UpdateBy // 添加这而，需要记录是被谁更新的
}

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

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

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

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