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.

32 lines
886 B

  1. package v1
  2. import (
  3. "gin-vue-admin/global"
  4. "gin-vue-admin/model"
  5. "gin-vue-admin/model/response"
  6. "gin-vue-admin/service"
  7. "gin-vue-admin/utils"
  8. "github.com/gin-gonic/gin"
  9. "go.uber.org/zap"
  10. )
  11. // @Tags workflow
  12. // @Summary 注册工作流
  13. // @Produce application/json
  14. // @Param data body model.SysWorkflow true "注册工作流接口"
  15. // @Success 200 {string} string "{"success":true,"data":{},"msg":"注册成功"}"
  16. // @Router /workflow/createWorkFlow [post]
  17. func CreateWorkFlow(c *gin.Context) {
  18. var wk model.SysWorkflow
  19. _ = c.ShouldBindJSON(&wk)
  20. if err := utils.Verify(wk, utils.WorkFlowVerify); err != nil {
  21. response.FailWithMessage(err.Error(), c)
  22. return
  23. }
  24. if err := service.Create(wk); err != nil {
  25. global.GVA_LOG.Error("注册失败!", zap.Any("err", err))
  26. response.FailWithMessage("注册失败", c)
  27. } else {
  28. response.OkWithMessage("注册成功", c)
  29. }
  30. }