This commit is contained in:
2025-05-13 15:44:44 +08:00
parent 20a741ae11
commit 8e2324df0e
32 changed files with 2840 additions and 44 deletions

View File

@ -0,0 +1,105 @@
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:"type:exact;column:private_key;table:wm_wallet_info" 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"`
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
}