LingxinMeng vor 10 Monaten
Ursprung
Commit
1ae8944a1b
1 geänderte Dateien mit 11 neuen und 0 gelöschten Zeilen
  1. 11 0
      src/package/handler/start_project.go

+ 11 - 0
src/package/handler/start_project.go

@@ -6,6 +6,7 @@ import (
 	"dcl_dispatch_server/src/package/global"
 	"dcl_dispatch_server/src/package/global"
 	"dcl_dispatch_server/src/package/infra"
 	"dcl_dispatch_server/src/package/infra"
 	"github.com/gin-gonic/gin"
 	"github.com/gin-gonic/gin"
+	"io"
 	"net/http"
 	"net/http"
 )
 )
 
 
@@ -117,8 +118,18 @@ import (
 */
 */
 
 
 func StartProject(c *gin.Context) {
 func StartProject(c *gin.Context) {
+
 	projectStartParam := new(entity.Project)
 	projectStartParam := new(entity.Project)
 	if err := c.ShouldBindJSON(&projectStartParam); err != nil {
 	if err := c.ShouldBindJSON(&projectStartParam); err != nil {
+		// 读取请求体
+		bodyBytes, err := io.ReadAll(c.Request.Body)
+		if err != nil {
+			c.String(500, "Error reading request body")
+			return
+		}
+		// 将请求体转换为字符串
+		bodyString := string(bodyBytes)
+		infra.GlobalLogger.Error("项目启动接收请求参数为:", bodyString)
 		infra.GlobalLogger.Error("项目启动接收请求参数报错:", err)
 		infra.GlobalLogger.Error("项目启动接收请求参数报错:", err)
 		c.JSON(http.StatusBadRequest, entity.HttpResult{Status: false, Code: "1003", Message: "请求参数格式错误。"})
 		c.JSON(http.StatusBadRequest, entity.HttpResult{Status: false, Code: "1003", Message: "请求参数格式错误。"})
 		return
 		return