Files
zmkgC/internal/app/system/controller/plant.go

54 lines
1.6 KiB
Go
Raw Normal View History

2025-07-07 20:11:59 +08:00
// ==========================================================================
// GFast自动生成controller操作代码。
// 生成日期2024-04-12 10:38:43
// 生成路径: internal/app/system/controller/plant.go
// 生成人gfast
// desc:电站信息
// company:云南奇讯科技有限公司
// ==========================================================================
package controller
import (
"context"
"github.com/tiger1103/gfast/v3/api/v1/system"
"github.com/tiger1103/gfast/v3/internal/app/system/service"
)
type plantController struct {
BaseController
}
var Plant = new(plantController)
// List 列表
func (c *plantController) List(ctx context.Context, req *system.PlantSearchReq) (res *system.PlantSearchRes, err error) {
res, err = service.Plant().List(ctx, req)
return
}
// Get 获取电站信息
func (c *plantController) Get(ctx context.Context, req *system.PlantGetReq) (res *system.PlantGetRes, err error) {
res = new(system.PlantGetRes)
res.PlantInfoRes, err = service.Plant().GetById(ctx, req.Id)
return
}
// Add 添加电站信息
func (c *plantController) Add(ctx context.Context, req *system.PlantAddReq) (res *system.PlantAddRes, err error) {
err = service.Plant().Add(ctx, req)
return
}
// Edit 修改电站信息
func (c *plantController) Edit(ctx context.Context, req *system.PlantEditReq) (res *system.PlantEditRes, err error) {
err = service.Plant().Edit(ctx, req)
return
}
// Delete 删除电站信息
func (c *plantController) Delete(ctx context.Context, req *system.PlantDeleteReq) (res *system.PlantDeleteRes, err error) {
err = service.Plant().Delete(ctx, req.Ids)
return
}