package dto

import (

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

type LineUduncoinGetPageReq struct {
	dto.Pagination     `search:"-"`
    LineUduncoinOrder
}

type LineUduncoinOrder struct {
    Id string `form:"idOrder"  search:"type:order;column:id;table:line_uduncoin"`
    TokenStatus string `form:"tokenStatusOrder"  search:"type:order;column:token_status;table:line_uduncoin"`
    Decimals string `form:"decimalsOrder"  search:"type:order;column:decimals;table:line_uduncoin"`
    MainCoinType string `form:"mainCoinTypeOrder"  search:"type:order;column:main_coin_type;table:line_uduncoin"`
    CoinType string `form:"coinTypeOrder"  search:"type:order;column:coin_type;table:line_uduncoin"`
    Symbol string `form:"symbolOrder"  search:"type:order;column:symbol;table:line_uduncoin"`
    Name string `form:"nameOrder"  search:"type:order;column:name;table:line_uduncoin"`
    Logo string `form:"logoOrder"  search:"type:order;column:logo;table:line_uduncoin"`
    CoinName string `form:"coinNameOrder"  search:"type:order;column:coin_name;table:line_uduncoin"`
    MainSymbol string `form:"mainSymbolOrder"  search:"type:order;column:main_symbol;table:line_uduncoin"`
    CreateBy string `form:"createByOrder"  search:"type:order;column:create_by;table:line_uduncoin"`
    UpdateBy string `form:"updateByOrder"  search:"type:order;column:update_by;table:line_uduncoin"`
    CreatedAt string `form:"createdAtOrder"  search:"type:order;column:created_at;table:line_uduncoin"`
    UpdatedAt string `form:"updatedAtOrder"  search:"type:order;column:updated_at;table:line_uduncoin"`
    
}

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

type LineUduncoinInsertReq struct {
    Id int `json:"-" comment:"主键ID"` // 主键ID
    TokenStatus int64 `json:"tokenStatus" comment:"0： 主幣 1：代幣"`
    Decimals int64 `json:"decimals" comment:"幣種精度,8"`
    MainCoinType string `json:"mainCoinType" comment:"主幣種類型"`
    CoinType string `json:"coinType" comment:"幣種類型"`
    Symbol string `json:"symbol" comment:"幣種symbol"`
    Name string `json:"name" comment:"幣種別名,BTC"`
    Logo string `json:"logo" comment:"幣種logo地址"`
    CoinName string `json:"coinName" comment:"幣種全稱,Bitcoin"`
    MainSymbol string `json:"mainSymbol" comment:"主幣種symbol"`
    common.ControlBy
}

func (s *LineUduncoinInsertReq) Generate(model *models.LineUduncoin)  {
    if s.Id == 0 {
        model.Model = common.Model{ Id: s.Id }
    }
    model.TokenStatus = s.TokenStatus
    model.Decimals = s.Decimals
    model.MainCoinType = s.MainCoinType
    model.CoinType = s.CoinType
    model.Symbol = s.Symbol
    model.Name = s.Name
    model.Logo = s.Logo
    model.CoinName = s.CoinName
    model.MainSymbol = s.MainSymbol
    model.CreateBy = s.CreateBy // 添加这而，需要记录是被谁创建的
}

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

type LineUduncoinUpdateReq struct {
    Id int `uri:"id" comment:"主键ID"` // 主键ID
    TokenStatus int64 `json:"tokenStatus" comment:"0： 主幣 1：代幣"`
    Decimals int64 `json:"decimals" comment:"幣種精度,8"`
    MainCoinType string `json:"mainCoinType" comment:"主幣種類型"`
    CoinType string `json:"coinType" comment:"幣種類型"`
    Symbol string `json:"symbol" comment:"幣種symbol"`
    Name string `json:"name" comment:"幣種別名,BTC"`
    Logo string `json:"logo" comment:"幣種logo地址"`
    CoinName string `json:"coinName" comment:"幣種全稱,Bitcoin"`
    MainSymbol string `json:"mainSymbol" comment:"主幣種symbol"`
    common.ControlBy
}

func (s *LineUduncoinUpdateReq) Generate(model *models.LineUduncoin)  {
    if s.Id == 0 {
        model.Model = common.Model{ Id: s.Id }
    }
    model.TokenStatus = s.TokenStatus
    model.Decimals = s.Decimals
    model.MainCoinType = s.MainCoinType
    model.CoinType = s.CoinType
    model.Symbol = s.Symbol
    model.Name = s.Name
    model.Logo = s.Logo
    model.CoinName = s.CoinName
    model.MainSymbol = s.MainSymbol
    model.UpdateBy = s.UpdateBy // 添加这而，需要记录是被谁更新的
}

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

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

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

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