Files
cid/controller/data/platform_controller.go
2026-03-23 14:08:11 +08:00

48 lines
1.5 KiB
Go

package data
import (
dto "cid/model/dto/data"
service "cid/service/data"
"context"
"gitea.com/red-future/common/beans"
)
type platformController struct{}
// Platform 平台控制器
var Platform = new(platformController)
// CreatePlatform 创建平台
func (c *platformController) CreatePlatform(ctx context.Context, req *dto.CreatePlatformReq) (res *dto.CreatePlatformRes, err error) {
return service.Platform.Create(ctx, req)
}
// ListPlatform 获取平台列表
func (c *platformController) ListPlatform(ctx context.Context, req *dto.ListPlatformReq) (res *dto.ListPlatformRes, err error) {
return service.Platform.List(ctx, req)
}
// GetPlatform 获取平台详情
func (c *platformController) GetPlatform(ctx context.Context, req *dto.GetPlatformReq) (res *dto.GetPlatformRes, err error) {
return service.Platform.GetOne(ctx, req)
}
// UpdatePlatform 更新平台
func (c *platformController) UpdatePlatform(ctx context.Context, req *dto.UpdatePlatformReq) (res *beans.ResponseEmpty, err error) {
err = service.Platform.Update(ctx, req)
return
}
// UpdatePlatformStatus 更新平台状态
func (c *platformController) UpdatePlatformStatus(ctx context.Context, req *dto.UpdatePlatformStatusReq) (res *beans.ResponseEmpty, err error) {
err = service.Platform.UpdateStatus(ctx, req)
return
}
// DeletePlatform 删除平台
func (c *platformController) DeletePlatform(ctx context.Context, req *dto.DeletePlatformReq) (res *beans.ResponseEmpty, err error) {
err = service.Platform.Delete(ctx, req)
return
}