Files
eth_transfer_go/app/admin/service/dto/wm_wallet_info.go

118 lines
3.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package dto
import (
"errors"
"go-admin/app/admin/models"
"go-admin/common/dto"
common "go-admin/common/models"
"strings"
)
type WmWalletInfoGetPageReq struct {
dto.Pagination `search:"-"`
PrivateKey string `form:"privateKey" search:"-" comment:"钱包私钥"`
WmWalletInfoOrder
}
type WmWalletInfoOrder struct {
Id string `form:"idOrder" search:"type:order;column:id;table:wm_wallet_info"`
PrivateKey string `form:"privateKeyOrder" search:"type:order;column:private_key;table:wm_wallet_info"`
Address string `form:"addressOrder" search:"type:order;column:address;table:wm_wallet_info"`
CreateBy string `form:"createByOrder" search:"type:order;column:create_by;table:wm_wallet_info"`
UpdateBy string `form:"updateByOrder" search:"type:order;column:update_by;table:wm_wallet_info"`
CreatedAt string `form:"createdAtOrder" search:"type:order;column:created_at;table:wm_wallet_info"`
UpdatedAt string `form:"updatedAtOrder" search:"type:order;column:updated_at;table:wm_wallet_info"`
DeletedAt string `form:"deletedAtOrder" search:"type:order;column:deleted_at;table:wm_wallet_info"`
}
func (m *WmWalletInfoGetPageReq) GetNeedSearch() interface{} {
return *m
}
type WmWalletInfoBatchInsertReq struct {
Keys string `json:"keys"`
Remark string `json:"remark"`
common.ControlBy
}
func (s *WmWalletInfoBatchInsertReq) Valid() error {
s.Keys = strings.ReplaceAll(s.Keys, " ", "")
s.Keys = strings.ReplaceAll(s.Keys, ",", "\n")
s.Keys = strings.ReplaceAll(s.Keys, "", "\n")
if s.Keys == "" {
return errors.New("请至少输入一条数据")
}
return nil
}
type WmWalletInfoInsertReq struct {
Id int `json:"-" comment:"主键Id"` // 主键Id
PrivateKey string `json:"privateKey" comment:"钱包私钥"`
Address string `json:"address" comment:"钱包地址"`
common.ControlBy
}
func (s *WmWalletInfoInsertReq) Generate(model *models.WmWalletInfo) {
if s.Id == 0 {
model.Model = common.Model{Id: s.Id}
}
model.PrivateKey = s.PrivateKey
model.Address = s.Address
model.CreateBy = s.CreateBy // 添加这而,需要记录是被谁创建的
}
func (s *WmWalletInfoInsertReq) GetId() interface{} {
return s.Id
}
type WmWalletInfoUpdateReq struct {
Id int `uri:"id" comment:"主键Id"` // 主键Id
PrivateKey string `json:"privateKey" comment:"钱包私钥"`
Address string `json:"address" comment:"钱包地址"`
common.ControlBy
}
func (s *WmWalletInfoUpdateReq) Generate(model *models.WmWalletInfo) {
if s.Id == 0 {
model.Model = common.Model{Id: s.Id}
}
model.PrivateKey = s.PrivateKey
model.Address = s.Address
model.UpdateBy = s.UpdateBy // 添加这而,需要记录是被谁更新的
}
func (s *WmWalletInfoUpdateReq) GetId() interface{} {
return s.Id
}
// WmWalletInfoGetReq 功能获取请求参数
type WmWalletInfoGetReq struct {
Id int `uri:"id"`
}
func (s *WmWalletInfoGetReq) GetId() interface{} {
return s.Id
}
// WmWalletInfoDeleteReq 功能删除请求参数
type WmWalletInfoDeleteReq struct {
Ids []int `json:"ids"`
}
func (s *WmWalletInfoDeleteReq) GetId() interface{} {
return s.Ids
}
type WmWalletExcelImportReq struct {
PrivateKey string `json:"privateKey" excel:"钱包私钥"`
Remark string `json:"remark" excel:"备注"`
}
type WmWalletInfoBatchUpdateReq struct {
Ids []int `json:"ids" form:"ids"`
Remark string `json:"remark" form:"remark"`
common.ControlBy
}