package dto

import (

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

type LineSymbolBlackGetPageReq struct {
	dto.Pagination     `search:"-"`
    Symbol string `form:"symbol"  search:"type:exact;column:symbol;table:line_symbol_black" comment:"交易对"`
    Type string `form:"type"  search:"type:exact;column:type;table:line_symbol_black" comment:"类型:1=现货,2=合约"`
    LineSymbolBlackOrder
}

type LineSymbolBlackOrder struct {
    Id string `form:"idOrder"  search:"type:order;column:id;table:line_symbol_black"`
    Symbol string `form:"symbolOrder"  search:"type:order;column:symbol;table:line_symbol_black"`
    Type string `form:"typeOrder"  search:"type:order;column:type;table:line_symbol_black"`
    CreatedAt string `form:"createdAtOrder"  search:"type:order;column:created_at;table:line_symbol_black"`
    UpdatedAt string `form:"updatedAtOrder"  search:"type:order;column:updated_at;table:line_symbol_black"`
    DeletedAt string `form:"deletedAtOrder"  search:"type:order;column:deleted_at;table:line_symbol_black"`
    CreateBy string `form:"createByOrder"  search:"type:order;column:create_by;table:line_symbol_black"`
    UpdateBy string `form:"updateByOrder"  search:"type:order;column:update_by;table:line_symbol_black"`
    
}

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

type LineSymbolBlackInsertReq struct {
    Id int `json:"-" comment:"id"` // id
    Symbol string `json:"symbol" comment:"交易对"`
    Type string `json:"type" comment:"类型:1=现货,2=合约"`
    common.ControlBy
}

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

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

type LineSymbolBlackUpdateReq struct {
    Id int `uri:"id" comment:"id"` // id
    Symbol string `json:"symbol" comment:"交易对"`
    Type string `json:"type" comment:"类型:1=现货,2=合约"`
    common.ControlBy
}

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

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

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

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

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