jiaojiao7 4 年 前
コミット
8ffa3e7aa3

+ 45 - 0
api/v1/projects.go

@@ -23,6 +23,9 @@ func ProjectApiRegister(router *gin.Engine) {
 		routerGroup.POST("/projectDetail", getProjectDetail)
 		routerGroup.POST("/projectListDetail", getProjectsListDetail)
 		routerGroup.POST("/callLog", callLog)
+		routerGroup.POST("/biddingInfoList", biddingInfoList)
+		routerGroup.POST("/healthInfoList", healthInfoList)
+		routerGroup.POST("/healthinfo", healthinfo)
 	}
 }
 
@@ -111,3 +114,45 @@ func callLog(c *gin.Context) {
 		response.FailWithDetailed(response.QueryError, datas, "系统查询异常", c)
 	}
 }
+
+func biddingInfoList(c *gin.Context) {
+	productID := c.MustGet("productID").(int)
+	appID := c.MustGet("appID").(string)
+	requestIP := c.MustGet("requestIP").(string)
+	p := gin.H{
+
+	}
+	bs, _ := json.Marshal(p)
+	param := string(bs)
+	utils.Check(appID, productID, c, func() ([]map[string]interface{}, int, error) {
+		return service.ProjectInfo()
+	}, param, requestIP, false)
+}
+
+func healthInfoList(c *gin.Context) {
+	productID := c.MustGet("productID").(int)
+	appID := c.MustGet("appID").(string)
+	requestIP := c.MustGet("requestIP").(string)
+	p := gin.H{
+
+	}
+	bs, _ := json.Marshal(p)
+	param := string(bs)
+	utils.Check(appID, productID, c, func() ([]map[string]interface{}, int, error) {
+		return service.ProjectInfo()
+	}, param, requestIP, false)
+}
+
+func healthinfo(c *gin.Context) {
+	productID := c.MustGet("productID").(int)
+	appID := c.MustGet("appID").(string)
+	requestIP := c.MustGet("requestIP").(string)
+	p := gin.H{
+
+	}
+	bs, _ := json.Marshal(p)
+	param := string(bs)
+	utils.Check(appID, productID, c, func() ([]map[string]interface{}, int, error) {
+		return service.ProjectInfo()
+	}, param, requestIP, false)
+}

+ 5 - 0
router/pageRouter.go

@@ -18,6 +18,7 @@ func pageRouterRegister(router *gin.Engine) {
 		pageRouterGroup.GET("/interfaceListPage", interfaceListPage)
 		pageRouterGroup.GET("/moneyRechargePage", moneyRechargePage)
 		pageRouterGroup.GET("/callLogPage", callLogPage)
+		pageRouterGroup.GET("/projectDetailSearchPage", projectDetailSearchPage)
 	}
 }
 
@@ -60,3 +61,7 @@ func moneyRechargePage(context *gin.Context) {
 func callLogPage(context *gin.Context) {
 	context.HTML(200, "callLog.html", nil)
 }
+
+func projectDetailSearchPage(context *gin.Context) {
+	context.HTML(200, "projectDetailSearch.html", nil)
+}

+ 4 - 0
service/projectDetail.go

@@ -90,3 +90,7 @@ func ProjectDetailData(id string) (data []map[string]interface{}, httpStatus int
 	}
 	return data, httpStatus, nil
 }
+
+func ProjectInfo() (data []map[string]interface{}, httpStatus int, err error) {
+	return nil, 200, nil
+}

+ 8 - 3
static/templates/login.html

@@ -185,15 +185,17 @@
                                 }
                                 str += "<td>" + item.call_times_limit_day + "</td>";
                                 str += "<td>" + item.data_num_limit_one_times + "</td>";
-                                if (item.product_id === 1000 || item.product_id === 1001) {
+                                if (item.product_id === 1000) {
                                     str += "<td class='handle' style='width: 100px ;'><a href=\"/page/projectListPage?appId=" + appId + "&key=" + key + "\" >测试接口</a>";
-                                } else {
+                                } else if (item.product_id === 1001) {
+                                    str += "<td class='handle' style='width: 100px ;'><a target=\"_blank\" href=\"/page/projectDetailSearchPage?projectId=1001&appId=" + appId + "&key=" + key + "\" >测试接口</a>";
+                                } else if (item.product_id === 1002) {
                                     str += "<td class='handle' style='width: 100px;'><a href=\"/page/projectListDetail?appId=" + appId + "&key=" + key + "\"  >测试接口</a>";
                                 }
                                 if (item.cost_model == 0) {
                                     str += "<a href=\"/page/userRecharge?appId=" + appId + "\"  >剩余量充值</a>"
                                 }
-                                str += "<a href=\"/page/callLogPage?appId=" + appId + "&key=" + key + "&product_id=" + item.product_id +  "\"  >调用记录</a>";
+                                str += "<a href=\"/page/callLogPage?appId=" + appId + "&key=" + key + "&product_id=" + item.product_id + "\"  >调用记录</a>";
                                 str += "<a onclick=\"myFunction('" + appId + "','" + key + "','" + item.product_id + "')\"  href='javascript:void(0);' style='pointer:hand;'>并发测试</a>"
                                 // else {
                                 //
@@ -226,6 +228,9 @@
                     "appid": appId,
                     "productId": productId,
                     "count": num,
+                };
+                if (productId === 1001) {
+
                 }
                 $.ajax({
                     url: "/manage/user/concurrentTest",

+ 93 - 0
static/templates/projectDetailSearch.html

@@ -0,0 +1,93 @@
+{{define "projectDetailSearch.html"}}
+    <!DOCTYPE html>
+    <html lang="en">
+    <head>
+        <meta charset="UTF-8">
+        <title>项目详情</title>
+        <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
+        <script src="https://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.js"></script>
+    </head>
+    <body>
+    <div id="projectList">
+        <input type="text" id="projectId" placeholder="请输入项目标识">
+        <button type="button" onclick="details()" id="projectListBtn">提交</button>
+    </div>
+    <div id="resultContent">
+
+
+    </div>
+
+    </body>
+    </html>
+    <script>
+        var LocString = String(window.document.location.href);
+
+        // 获取页面跳转传过来的参数
+        function GetQueryString(name) {
+            var rs = new RegExp("(^|)" + name + "=([^&]*)(&|$)", "gi").exec(LocString);
+            var tmp;
+            if (tmp = rs) {
+                return decodeURI(tmp[2])
+            }
+            return "";
+        }
+
+        var appid = GetQueryString("appId");
+        var key = GetQueryString("key");
+
+        function details() {
+            $("#resultContent").text("查询中。。。。");
+            var projectId = $("#projectId").val();
+            var param = {
+                "app_id": appid,
+                "project_id": projectId,
+            };
+            var url = "/sfis/api/v1/projectDetail";
+            var rType = "post";
+            var now = new Date().getTime();
+            var token = md5(appid + Math.round(now / 1000) + key);
+            var hearders = {
+                "timestamp": "" + Math.round(now / 1000),
+                "token": token
+            };
+            console.log(param)
+            $.ajax({
+                url: url,
+                type: rType,
+                headers: hearders,
+                data: param,
+                success: function (r) {
+                    if (r.code == 0) {
+                        $("#resultContent").text("");
+                        var str = "";
+                        console.log(r.data[0]);
+                        var html = `
+                        <div>
+                            <p>项目标识: ${r.data[0]["projectId"]}</p>
+                            <p>项目名称: ${r.data[0]["projectName"]}</p>
+                            <p>项目代码: ${r.data[0]["projectCode"]}</p>
+                            <p>中标单位: ${r.data[0]["winner"]}</p>
+                            <p>采购单位: ${r.data[0]["buyer"]}</p>
+                            <p>采购单位电话: ${r.data[0]["buyerTel"]}</p>
+                            <p>采购单位联系人: ${r.data[0]["buyerPerson"]}</p>
+                            <p>采购单位行业: ${r.data[0]["buyerClass"]}</p>
+                            <p>招标日期: ${r.data[0]["tenderDate"]}</p>
+                            <p>中标日期: ${r.data[0]["bidDate"]}</p>
+                            <p>中标金额(元): ${r.data[0]["bidAmount"]}</p>
+                            <p>预算金额(元): ${r.data[0]["budget"]}</p>
+                            <p>省份: ${r.data[0]["province"]}</p>
+                            <p>城市: ${r.data[0]["city"]}</p>
+                            <p>中标信息列表: ${JSON.stringify(r.data[0]["package"])}</p>
+                            <p>原链接: ${r.data[0]["url"]}</p>
+                            <p>剑鱼标讯链接: ${r.data[0]["jyUrl"]}</p>
+                        </div>
+                        `
+                        $("#resultContent").append(html);
+                    } else {
+                        $("#resultContent").text(r.msg);
+                    }
+                }
+            })
+        }
+    </script>
+{{end}}