65 lines
2.2 KiB
Go
65 lines
2.2 KiB
Go
// ==========================================================================
|
||
// GFast自动生成controller操作代码。
|
||
// 生成日期:2023-07-31 11:09:26
|
||
// 生成路径: internal/app/system/controller/qianqi_moxing.go
|
||
// 生成人:gfast
|
||
// desc:倾斜模型
|
||
// company:云南奇讯科技有限公司
|
||
// ==========================================================================
|
||
|
||
package controller
|
||
|
||
import (
|
||
"context"
|
||
"github.com/tiger1103/gfast/v3/api/v1/common/coryCommon"
|
||
"github.com/tiger1103/gfast/v3/api/v1/system"
|
||
"github.com/tiger1103/gfast/v3/internal/app/system/service"
|
||
)
|
||
|
||
type qianqiMoxingController struct {
|
||
BaseController
|
||
}
|
||
|
||
var QianqiMoxing = new(qianqiMoxingController)
|
||
|
||
// List 列表
|
||
func (c *qianqiMoxingController) List(ctx context.Context, req *system.QianqiMoxingSearchReq) (res *system.QianqiMoxingSearchRes, err error) {
|
||
res, err = service.QianqiMoxing().List(ctx, req)
|
||
return
|
||
}
|
||
|
||
// Get 获取倾斜模型
|
||
func (c *qianqiMoxingController) Get(ctx context.Context, req *system.QianqiMoxingGetReq) (res *system.QianqiMoxingGetRes, err error) {
|
||
res = new(system.QianqiMoxingGetRes)
|
||
res.QianqiMoxingInfoRes, err = service.QianqiMoxing().GetById(ctx, req.Id)
|
||
return
|
||
}
|
||
|
||
// Add 添加倾斜模型
|
||
func (c *qianqiMoxingController) Add(ctx context.Context, req *system.QianqiMoxingAddReq) (res *system.QianqiMoxingAddRes, err error) {
|
||
err = service.QianqiMoxing().Add(ctx, req)
|
||
return
|
||
}
|
||
|
||
// Edit 修改倾斜模型
|
||
func (c *qianqiMoxingController) Edit(ctx context.Context, req *system.QianqiMoxingEditReq) (res *system.QianqiMoxingEditRes, err error) {
|
||
err = service.QianqiMoxing().Edit(ctx, req)
|
||
return
|
||
}
|
||
|
||
// Delete 删除倾斜模型
|
||
func (c *qianqiMoxingController) Delete(ctx context.Context, req *system.QianqiMoxingDeleteReq) (res *system.QianqiMoxingDeleteRes, err error) {
|
||
err = service.QianqiMoxing().Delete(ctx, req.Ids)
|
||
return
|
||
}
|
||
|
||
func (c *qianqiMoxingController) MxUpload(ctx context.Context, req *system.UploadFileReq) (res *system.UploadFileRes, err error) {
|
||
// 初始化 res 变量
|
||
res = &system.UploadFileRes{}
|
||
file := req.File
|
||
str, err := coryCommon.UploadFile(ctx, file, coryCommon.LargeFileClt)
|
||
res.FileName = file.Filename
|
||
res.FilePath = str
|
||
return
|
||
}
|