mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-10 03:03:44 +08:00
发布v2.15.1版本,更新内容请查看:https://github.com/bufanyun/hotgo/blob/v2.0/docs/guide-zh-CN/start-update-log.md
This commit is contained in:
80
server/internal/controller/admin/sys/option_tree_demo.go
Normal file
80
server/internal/controller/admin/sys/option_tree_demo.go
Normal file
@@ -0,0 +1,80 @@
|
||||
// Package sys
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// @AutoGenerate Version 2.13.1
|
||||
package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/api/admin/optiontreedemo"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
|
||||
var (
|
||||
OptionTreeDemo = cOptionTreeDemo{}
|
||||
)
|
||||
|
||||
type cOptionTreeDemo struct{}
|
||||
|
||||
// List 查看选项树表列表
|
||||
func (c *cOptionTreeDemo) List(ctx context.Context, req *optiontreedemo.ListReq) (res *optiontreedemo.ListRes, err error) {
|
||||
list, totalCount, err := service.SysOptionTreeDemo().List(ctx, &req.OptionTreeDemoListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if list == nil {
|
||||
list = []*sysin.OptionTreeDemoListModel{}
|
||||
}
|
||||
|
||||
res = new(optiontreedemo.ListRes)
|
||||
res.List = list
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 更新选项树表
|
||||
func (c *cOptionTreeDemo) Edit(ctx context.Context, req *optiontreedemo.EditReq) (res *optiontreedemo.EditRes, err error) {
|
||||
err = service.SysOptionTreeDemo().Edit(ctx, &req.OptionTreeDemoEditInp)
|
||||
return
|
||||
}
|
||||
|
||||
// MaxSort 获取选项树表最大排序
|
||||
func (c *cOptionTreeDemo) MaxSort(ctx context.Context, req *optiontreedemo.MaxSortReq) (res *optiontreedemo.MaxSortRes, err error) {
|
||||
data, err := service.SysOptionTreeDemo().MaxSort(ctx, &req.OptionTreeDemoMaxSortInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(optiontreedemo.MaxSortRes)
|
||||
res.OptionTreeDemoMaxSortModel = data
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定选项树表信息
|
||||
func (c *cOptionTreeDemo) View(ctx context.Context, req *optiontreedemo.ViewReq) (res *optiontreedemo.ViewRes, err error) {
|
||||
data, err := service.SysOptionTreeDemo().View(ctx, &req.OptionTreeDemoViewInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(optiontreedemo.ViewRes)
|
||||
res.OptionTreeDemoViewModel = data
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除选项树表
|
||||
func (c *cOptionTreeDemo) Delete(ctx context.Context, req *optiontreedemo.DeleteReq) (res *optiontreedemo.DeleteRes, err error) {
|
||||
err = service.SysOptionTreeDemo().Delete(ctx, &req.OptionTreeDemoDeleteInp)
|
||||
return
|
||||
}
|
||||
|
||||
// TreeOption 获取选项树表关系树选项
|
||||
func (c *cOptionTreeDemo) TreeOption(ctx context.Context, req *optiontreedemo.TreeOptionReq) (res *optiontreedemo.TreeOptionRes, err error) {
|
||||
data, err := service.SysOptionTreeDemo().TreeOption(ctx)
|
||||
res = (*optiontreedemo.TreeOptionRes)(&data)
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user