Dockerfile
This commit is contained in:
47
controller/data/platform_controller.go
Normal file
47
controller/data/platform_controller.go
Normal file
@@ -0,0 +1,47 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user