feat: 新增养成管理后台
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/api/admin/cultivateflower"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
|
||||
var CultivateFlower = cCultivateFlower{}
|
||||
|
||||
type cCultivateFlower struct{}
|
||||
|
||||
func (*cCultivateFlower) List(ctx context.Context, req *cultivateflower.ListReq) (res *cultivateflower.ListRes, err error) {
|
||||
list, total, err := service.SysCultivateFlower().List(ctx, &req.CultivateFlowerListInp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if list == nil {
|
||||
list = []*sysin.CultivateFlowerListModel{}
|
||||
}
|
||||
res = &cultivateflower.ListRes{List: list}
|
||||
res.PageRes.Pack(req, total)
|
||||
return
|
||||
}
|
||||
func (*cCultivateFlower) View(ctx context.Context, req *cultivateflower.ViewReq) (res *cultivateflower.ViewRes, err error) {
|
||||
data, err := service.SysCultivateFlower().View(ctx, &req.CultivateFlowerViewInp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &cultivateflower.ViewRes{CultivateFlowerViewModel: data}, nil
|
||||
}
|
||||
func (*cCultivateFlower) Edit(ctx context.Context, req *cultivateflower.EditReq) (res *cultivateflower.EditRes, err error) {
|
||||
err = service.SysCultivateFlower().Edit(ctx, &req.CultivateFlowerEditInp)
|
||||
return
|
||||
}
|
||||
func (*cCultivateFlower) Status(ctx context.Context, req *cultivateflower.StatusReq) (res *cultivateflower.StatusRes, err error) {
|
||||
err = service.SysCultivateFlower().Status(ctx, &req.CultivateFlowerStatusInp)
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user