工作流重新定义 以及create路由开发

This commit is contained in:
pixel
2019-11-20 15:45:07 +08:00
parent 6008ab01d5
commit a58e3d6801
10 changed files with 319 additions and 28 deletions

View File

@@ -0,0 +1,25 @@
package api
import (
"fmt"
"github.com/gin-gonic/gin"
"main/controller/servers"
"main/model/dbModel"
)
// @Tags workflow
// @Summary 注册工作流
// @Produce application/json
// @Param data body dbModel.Workflow true "注册工作流接口"
// @Success 200 {string} json "{"success":true,"data":{},"msg":"注册成功"}"
// @Router /workflow/createWorkFlow [post]
func CreateWorkFlow(c *gin.Context) {
var wk dbModel.Workflow
_ = c.ShouldBind(&wk)
err := wk.Create()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("获取失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "获取成功", gin.H{})
}
}