project_start.go 776 B

1234567891011121314151617181920212223
  1. package handler
  2. import (
  3. "cicv-data-closedloop/common/config/c_log"
  4. "cicv-data-closedloop/common/entity"
  5. "github.com/gin-gonic/gin"
  6. "net/http"
  7. )
  8. type StartProjectParam struct {
  9. ProjectId int `json:"projectId"`
  10. AlgorithmObjectKey int `json:"algorithmObjectKey"`
  11. }
  12. func StartProject(c *gin.Context) {
  13. projectStartParam := new(StartProjectParam)
  14. if err := c.ShouldBindJSON(&projectStartParam); err != nil {
  15. c_log.GlobalLogger.Error("项目启动接收请求参数报错:", err)
  16. c.JSON(http.StatusBadRequest, entity.HttpResult{Status: false, Code: "1003", Message: "请求参数格式错误。"})
  17. return
  18. }
  19. c.JSON(http.StatusOK, entity.HttpResult{Status: true, Code: "2000", Message: "项目启动请求已被成功接收,等待调度处理。"})
  20. }