Files
aggregate_translate_server/app/admin/service/dto/tm_platform.go
hucan 68f3105dff
Some checks failed
Build / build (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
build / Build (push) Has been cancelled
GitHub Actions Mirror / mirror_to_gitee (push) Has been cancelled
GitHub Actions Mirror / mirror_to_gitlab (push) Has been cancelled
Issue Close Require / issue-close-require (push) Has been cancelled
1临时提交 生成订单
2025-07-04 19:59:06 +08:00

126 lines
4.9 KiB
Go

package dto
import (
"go-admin/app/admin/models"
"go-admin/common/dto"
common "go-admin/common/models"
"github.com/shopspring/decimal"
)
type TmPlatformGetPageReq struct {
dto.Pagination `search:"-"`
Name string `form:"name" search:"type:contains;column:name;table:tm_platform" comment:"平台名称"`
ShowName string `form:"showName" search:"type:contains;column:show_name;table:tm_platform" comment:"展示名称"`
ApiBaseUrl string `form:"apiBaseUrl" search:"type:exact;column:api_base_url;table:tm_platform" comment:"平台接口地址"`
Code string `form:"code" search:"type:exact;column:code;table:tm_platform" comment:"平台编码(字典 tm_platform)"`
Character string `form:"character" search:"type:exact;column:character;table:tm_platform" comment:"字符数"`
Price string `form:"price" search:"type:exact;column:price;table:tm_platform" comment:"单价"`
TmPlatformOrder
}
type TmPlatformOrder struct {
Id string `form:"idOrder" search:"type:order;column:id;table:tm_platform"`
Name string `form:"nameOrder" search:"type:order;column:name;table:tm_platform"`
ShowName string `form:"showNameOrder" search:"type:order;column:show_name;table:tm_platform"`
ApiBaseUrl string `form:"apiBaseUrlOrder" search:"type:order;column:api_base_url;table:tm_platform"`
Description string `form:"descriptionOrder" search:"type:order;column:description;table:tm_platform"`
Code string `form:"codeOrder" search:"type:order;column:code;table:tm_platform"`
Character string `form:"characterOrder" search:"type:order;column:character;table:tm_platform"`
Price string `form:"priceOrder" search:"type:order;column:price;table:tm_platform"`
CreatedAt string `form:"createdAtOrder" search:"type:order;column:created_at;table:tm_platform"`
UpdatedAt string `form:"updatedAtOrder" search:"type:order;column:updated_at;table:tm_platform"`
DeletedAt string `form:"deletedAtOrder" search:"type:order;column:deleted_at;table:tm_platform"`
CreateBy string `form:"createByOrder" search:"type:order;column:create_by;table:tm_platform"`
UpdateBy string `form:"updateByOrder" search:"type:order;column:update_by;table:tm_platform"`
}
func (m *TmPlatformGetPageReq) GetNeedSearch() interface{} {
return *m
}
type TmPlatformInsertReq struct {
Id int `json:"-" comment:"平台id"` // 平台id
Name string `json:"name" comment:"平台名称"`
ShowName string `json:"showName" comment:"展示名称"`
ApiBaseUrl string `json:"apiBaseUrl" comment:"平台接口地址"`
Description string `json:"description" comment:"描述"`
Code string `json:"code" comment:"平台编码(字典 tm_platform)"`
Character int `json:"character" comment:"字符数"`
Price decimal.Decimal `json:"price" comment:"单价"`
common.ControlBy
}
func (s *TmPlatformInsertReq) Generate(model *models.TmPlatform) {
if s.Id == 0 {
model.Model = common.Model{Id: s.Id}
}
model.Name = s.Name
model.ShowName = s.ShowName
model.ApiBaseUrl = s.ApiBaseUrl
model.Description = s.Description
model.Code = s.Code
model.Character = s.Character
model.Price = s.Price
model.CreateBy = s.CreateBy // 添加这而,需要记录是被谁创建的
}
func (s *TmPlatformInsertReq) GetId() interface{} {
return s.Id
}
type TmPlatformListResp struct {
Id int `json:"id"`
ShowName string `json:"showName"`
Code string `json:"code"`
Price decimal.Decimal `json:"price"`
}
type TmPlatformUpdateReq struct {
Id int `uri:"id" comment:"平台id"` // 平台id
Name string `json:"name" comment:"平台名称"`
ShowName string `json:"showName" comment:"展示名称"`
ApiBaseUrl string `json:"apiBaseUrl" comment:"平台接口地址"`
Description string `json:"description" comment:"描述"`
Code string `json:"code" comment:"平台编码(字典 tm_platform)"`
Character int `json:"character" comment:"字符数"`
Price decimal.Decimal `json:"price" comment:"单价"`
common.ControlBy
}
func (s *TmPlatformUpdateReq) Generate(model *models.TmPlatform) {
if s.Id == 0 {
model.Model = common.Model{Id: s.Id}
}
model.Name = s.Name
model.ShowName = s.ShowName
model.ApiBaseUrl = s.ApiBaseUrl
model.Description = s.Description
model.Code = s.Code
model.Character = s.Character
model.Price = s.Price
model.UpdateBy = s.UpdateBy // 添加这而,需要记录是被谁更新的
}
func (s *TmPlatformUpdateReq) GetId() interface{} {
return s.Id
}
// TmPlatformGetReq 功能获取请求参数
type TmPlatformGetReq struct {
Id int `uri:"id"`
}
func (s *TmPlatformGetReq) GetId() interface{} {
return s.Id
}
// TmPlatformDeleteReq 功能删除请求参数
type TmPlatformDeleteReq struct {
Ids []int `json:"ids"`
}
func (s *TmPlatformDeleteReq) GetId() interface{} {
return s.Ids
}