Dockerfile
This commit is contained in:
47
controller/data/api_interface_controller.go
Normal file
47
controller/data/api_interface_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 apiInterfaceController struct{}
|
||||
|
||||
// ApiInterface 接口控制器
|
||||
var ApiInterface = new(apiInterfaceController)
|
||||
|
||||
// CreateApiInterface 创建接口
|
||||
func (c *apiInterfaceController) CreateApiInterface(ctx context.Context, req *dto.CreateApiInterfaceReq) (res *dto.CreateApiInterfaceRes, err error) {
|
||||
return service.ApiInterface.Create(ctx, req)
|
||||
}
|
||||
|
||||
// ListApiInterface 获取接口列表
|
||||
func (c *apiInterfaceController) ListApiInterface(ctx context.Context, req *dto.ListApiInterfaceReq) (res *dto.ListApiInterfaceRes, err error) {
|
||||
return service.ApiInterface.List(ctx, req)
|
||||
}
|
||||
|
||||
// GetApiInterface 获取接口详情
|
||||
func (c *apiInterfaceController) GetApiInterface(ctx context.Context, req *dto.GetApiInterfaceReq) (res *dto.GetApiInterfaceRes, err error) {
|
||||
return service.ApiInterface.GetOne(ctx, req)
|
||||
}
|
||||
|
||||
// UpdateApiInterface 更新接口
|
||||
func (c *apiInterfaceController) UpdateApiInterface(ctx context.Context, req *dto.UpdateApiInterfaceReq) (res *beans.ResponseEmpty, err error) {
|
||||
err = service.ApiInterface.Update(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateApiInterfaceStatus 更新接口状态
|
||||
func (c *apiInterfaceController) UpdateApiInterfaceStatus(ctx context.Context, req *dto.UpdateApiInterfaceStatusReq) (res *beans.ResponseEmpty, err error) {
|
||||
err = service.ApiInterface.UpdateStatus(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// DeleteApiInterface 删除接口
|
||||
func (c *apiInterfaceController) DeleteApiInterface(ctx context.Context, req *dto.DeleteApiInterfaceReq) (res *beans.ResponseEmpty, err error) {
|
||||
err = service.ApiInterface.Delete(ctx, req)
|
||||
return
|
||||
}
|
||||
37
controller/data/data_fetch_controller.go
Normal file
37
controller/data/data_fetch_controller.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
dto "cid/model/dto/data"
|
||||
service "cid/service/data"
|
||||
"context"
|
||||
)
|
||||
|
||||
type dataFetchController struct{}
|
||||
|
||||
// DataFetch 数据获取控制器
|
||||
var DataFetch = new(dataFetchController)
|
||||
|
||||
// ExecuteDataFetch 执行数据获取
|
||||
func (c *dataFetchController) ExecuteDataFetch(ctx context.Context, req *dto.ExecuteDataFetchReq) (res *dto.ExecuteDataFetchRes, err error) {
|
||||
return service.DataFetch.Execute(ctx, req)
|
||||
}
|
||||
|
||||
// BatchExecuteDataFetch 批量执行数据获取
|
||||
func (c *dataFetchController) BatchExecuteDataFetch(ctx context.Context, req *dto.BatchExecuteDataFetchReq) (res *dto.BatchExecuteDataFetchRes, err error) {
|
||||
return service.DataFetch.BatchExecute(ctx, req)
|
||||
}
|
||||
|
||||
// ListDataFetchLog 获取数据获取日志列表
|
||||
func (c *dataFetchController) ListDataFetchLog(ctx context.Context, req *dto.ListDataFetchLogReq) (res *dto.ListDataFetchLogRes, err error) {
|
||||
return service.DataFetch.List(ctx, req)
|
||||
}
|
||||
|
||||
// GetDataFetchLog 获取数据获取日志详情
|
||||
func (c *dataFetchController) GetDataFetchLog(ctx context.Context, req *dto.GetDataFetchLogReq) (res *dto.GetDataFetchLogRes, err error) {
|
||||
return service.DataFetch.GetOne(ctx, req)
|
||||
}
|
||||
|
||||
// ReExecuteDataFetch 重新执行数据获取
|
||||
func (c *dataFetchController) ReExecuteDataFetch(ctx context.Context, req *dto.ReExecuteDataFetchReq) (res *dto.ReExecuteDataFetchRes, err error) {
|
||||
return service.DataFetch.ReExecute(ctx, req)
|
||||
}
|
||||
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