You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
659 B

  1. package api
  2. import (
  3. "fmt"
  4. "github.com/gin-gonic/gin"
  5. "main/controller/servers"
  6. "main/model/sysModel"
  7. )
  8. // @Tags workflow
  9. // @Summary 注册工作流
  10. // @Produce application/json
  11. // @Param data body sysModel.SysWorkflow true "注册工作流接口"
  12. // @Success 200 {string} json "{"success":true,"data":{},"msg":"注册成功"}"
  13. // @Router /workflow/createWorkFlow [post]
  14. func CreateWorkFlow(c *gin.Context) {
  15. var wk sysModel.SysWorkflow
  16. _ = c.ShouldBind(&wk)
  17. err := wk.Create()
  18. if err != nil {
  19. servers.ReportFormat(c, false, fmt.Sprintf("获取失败:%v", err), gin.H{})
  20. } else {
  21. servers.ReportFormat(c, true, "获取成功", gin.H{})
  22. }
  23. }