xuzhiheng пре 4 година
родитељ
комит
de80e3d4a8
3 измењених фајлова са 14 додато и 22 уклоњено
  1. 12 18
      api/v1/projects.go
  2. 0 2
      manage/user/concurrentTest.go
  3. 2 2
      service/concurrentTest.go

+ 12 - 18
api/v1/projects.go

@@ -38,9 +38,9 @@ func getProjectsList(c *gin.Context) {
 	winner := c.PostForm("winner")
 	bidTime := c.PostForm("bid_time")
 	p := gin.H{
-		"projectName": projectName,
-		"winner":      winner,
-		"bidTime":     bidTime,
+		"project_name": projectName,
+		"winner":       winner,
+		"bid_time":     bidTime,
 	}
 	bs, _ := json.Marshal(p)
 	param := string(bs)
@@ -81,7 +81,7 @@ func getProjectDetail(c *gin.Context) {
 	_id := c.PostForm("project_id")
 	id := service.SE.DecodeString(_id)
 	p := gin.H{
-		"id": id,
+		"project_id": _id,
 	}
 	bs, _ := json.Marshal(p)
 	param := string(bs)
@@ -107,11 +107,11 @@ func callLog(c *gin.Context) {
 	datas := []map[string]interface{}{}
 	var err error
 	p := gin.H{
-		"appID":     appID,
-		"startTime": startTime,
-		"endTime":   endTime,
-		"productId": productId,
-		"isSelf":    isSelf,
+		"app_id":     appID,
+		"start_time": startTime,
+		"end_time":   endTime,
+		"product_id": productId,
+		"isSelf":     isSelf,
 	}
 	global.Logger.Info("api callLog:", zap.Any("param:", p))
 	datas, err = service.CallLog(appID, productId, startTime, endTime, isSelfs)
@@ -126,9 +126,7 @@ func biddingInfoList(c *gin.Context) {
 	productID := c.MustGet("productID").(int)
 	appID := c.MustGet("appID").(string)
 	requestIP := c.MustGet("requestIP").(string)
-	p := gin.H{
-
-	}
+	p := gin.H{}
 	bs, _ := json.Marshal(p)
 	param := string(bs)
 	utils.Check(appID, productID, c, func() ([]map[string]interface{}, int, error) {
@@ -140,9 +138,7 @@ func healthInfoList(c *gin.Context) {
 	productID := c.MustGet("productID").(int)
 	appID := c.MustGet("appID").(string)
 	requestIP := c.MustGet("requestIP").(string)
-	p := gin.H{
-
-	}
+	p := gin.H{}
 	bs, _ := json.Marshal(p)
 	param := string(bs)
 	utils.Check(appID, productID, c, func() ([]map[string]interface{}, int, error) {
@@ -154,9 +150,7 @@ func healthinfo(c *gin.Context) {
 	productID := c.MustGet("productID").(int)
 	appID := c.MustGet("appID").(string)
 	requestIP := c.MustGet("requestIP").(string)
-	p := gin.H{
-
-	}
+	p := gin.H{}
 	bs, _ := json.Marshal(p)
 	param := string(bs)
 	utils.Check(appID, productID, c, func() ([]map[string]interface{}, int, error) {

+ 0 - 2
manage/user/concurrentTest.go

@@ -2,7 +2,6 @@ package user
 
 import (
 	"log"
-	"sfis/model/response"
 	"sfis/service"
 	"strconv"
 	"sync"
@@ -30,5 +29,4 @@ func concurrentTest(c *gin.Context) {
 		}(i)
 	}
 	wg.Wait()
-	response.Ok(c)
 }

+ 2 - 2
service/concurrentTest.go

@@ -13,8 +13,8 @@ func GetConcurrentData(appid string, productId int, c *gin.Context) {
 		}, `{"bidTime":"","projectName":"河南大学","winner":""}`, "127.0.0.1", true)
 	} else if productId == 1001 {
 		utils.Check(appid, productId, c, func() ([]map[string]interface{}, int, error) {
-			return ProjectDetailData("5f6bc00c499cb0822d7e3842")
-		}, `{"id":"5f6bc00c499cb0822d7e3842"}`, "127.0.0.1", true)
+			return ProjectDetailData("QQlGKDskaAIECAAXDUBya3A8BVQIC0wK")
+		}, `{"id":"QQlGKDskaAIECAAXDUBya3A8BVQIC0wK"}`, "127.0.0.1", true)
 	} else if productId == 1002 {
 		utils.Check(appid, productId, c, func() ([]map[string]interface{}, int, error) {
 			return ProjectListData(productId, appid, "", "中铁十五局集团有限公司", "", true)