54 lines
2.0 KiB
Go
54 lines
2.0 KiB
Go
|
// ==========================================================================
|
|||
|
// GFast自动生成controller操作代码。
|
|||
|
// 生成日期:2024-03-13 17:36:45
|
|||
|
// 生成路径: internal/app/system/controller/construction_project.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 constructionProjectController struct {
|
|||
|
BaseController
|
|||
|
}
|
|||
|
|
|||
|
var ConstructionProject = new(constructionProjectController)
|
|||
|
|
|||
|
// List 列表
|
|||
|
func (c *constructionProjectController) List(ctx context.Context, req *system.ConstructionProjectSearchReq) (res *system.ConstructionProjectSearchRes, err error) {
|
|||
|
res, err = service.ConstructionProject().List(ctx, req)
|
|||
|
return
|
|||
|
}
|
|||
|
|
|||
|
// Get 获取施工项目
|
|||
|
func (c *constructionProjectController) Get(ctx context.Context, req *system.ConstructionProjectGetReq) (res *system.ConstructionProjectGetRes, err error) {
|
|||
|
res = new(system.ConstructionProjectGetRes)
|
|||
|
res.ConstructionProjectInfoRes, err = service.ConstructionProject().GetByConstructionId(ctx, req.ConstructionId)
|
|||
|
return
|
|||
|
}
|
|||
|
|
|||
|
// Add 添加施工项目
|
|||
|
func (c *constructionProjectController) Add(ctx context.Context, req *system.ConstructionProjectAddReq) (res *system.ConstructionProjectAddRes, err error) {
|
|||
|
err = service.ConstructionProject().Add(ctx, req)
|
|||
|
return
|
|||
|
}
|
|||
|
|
|||
|
// Edit 修改施工项目
|
|||
|
func (c *constructionProjectController) Edit(ctx context.Context, req *system.ConstructionProjectEditReq) (res *system.ConstructionProjectEditRes, err error) {
|
|||
|
err = service.ConstructionProject().Edit(ctx, req)
|
|||
|
return
|
|||
|
}
|
|||
|
|
|||
|
// Delete 删除施工项目
|
|||
|
func (c *constructionProjectController) Delete(ctx context.Context, req *system.ConstructionProjectDeleteReq) (res *system.ConstructionProjectDeleteRes, err error) {
|
|||
|
err = service.ConstructionProject().Delete(ctx, req.ConstructionIds)
|
|||
|
return
|
|||
|
}
|