56 lines
1.5 KiB
Go
56 lines
1.5 KiB
Go
package controller
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gitee.com/red-future---jilin-g/common/http"
|
|
|
|
"cidservice/model/dto"
|
|
"cidservice/service"
|
|
)
|
|
|
|
type report struct{}
|
|
|
|
var Report = &report{}
|
|
|
|
// Create 创建报表
|
|
func (c *report) Create(ctx context.Context, req *dto.CreateReportReq) (res *dto.CreateReportRes, err error) {
|
|
return service.Report.Create(ctx, req)
|
|
}
|
|
|
|
// GetOne 获取报表详情
|
|
func (c *report) GetOne(ctx context.Context, req *dto.GetReportReq) (res *dto.GetReportRes, err error) {
|
|
return service.Report.GetOne(ctx, req)
|
|
}
|
|
|
|
// List 获取报表列表
|
|
func (c *report) List(ctx context.Context, req *dto.ListReportReq) (res *dto.ListReportRes, err error) {
|
|
return service.Report.List(ctx, req)
|
|
}
|
|
|
|
// Update 更新报表
|
|
func (c *report) Update(ctx context.Context, req *dto.UpdateReportReq) (res *http.ResponseEmpty, err error) {
|
|
err = service.Report.Update(ctx, req)
|
|
res = &http.ResponseEmpty{}
|
|
return
|
|
}
|
|
|
|
// Delete 删除报表
|
|
func (c *report) Delete(ctx context.Context, req *dto.DeleteReportReq) (res *http.ResponseEmpty, err error) {
|
|
err = service.Report.Delete(ctx, req)
|
|
res = &http.ResponseEmpty{}
|
|
return
|
|
}
|
|
|
|
// Download 下载报表
|
|
func (c *report) Download(ctx context.Context, req *dto.DownloadReportReq) (res *dto.DownloadReportRes, err error) {
|
|
return service.Report.Download(ctx, req)
|
|
}
|
|
|
|
// Generate 生成报表
|
|
func (c *report) Generate(ctx context.Context, req *dto.GenerateReportReq) (res *http.ResponseEmpty, err error) {
|
|
err = service.Report.Generate(ctx, req)
|
|
res = &http.ResponseEmpty{}
|
|
return
|
|
}
|