feat: 添加批量生成CDK功能
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -3,6 +3,9 @@ package admin
|
||||
import (
|
||||
"blazing/cool"
|
||||
"blazing/modules/config/service"
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
type CdkController struct {
|
||||
@@ -20,3 +23,16 @@ func init() {
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
type BatchGenerateReq struct {
|
||||
g.Meta `path:"/batchGenerate" method:"POST"`
|
||||
Count int `json:"count" v:"required|min:1#请输入正确的生成数量"`
|
||||
}
|
||||
|
||||
func (c *CdkController) BatchGenerate(ctx context.Context, req *BatchGenerateReq) (res *cool.BaseRes, err error) {
|
||||
data, err := service.NewCdkService().BatchGenerate(ctx, req.Count)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return cool.Ok(data), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user