|
@@ -73,15 +73,20 @@ func getData() {
|
|
|
}
|
|
|
|
|
|
//获取项目详情测试用例
|
|
|
-// func Test_ProjectDetails(t *testing.T) {
|
|
|
-// data := post("http://127.0.0.1:8080/sfis/api/v1/projectDetail", map[string]string{
|
|
|
-// "projectid": "5f6b4e12499cb0822d39c68f",
|
|
|
-// })
|
|
|
-// res := map[string]interface{}{}
|
|
|
-// s, _ := json.Marshal(data)
|
|
|
-// json.Unmarshal(s, &res)
|
|
|
-// log.Println("数据:", res)
|
|
|
-// }
|
|
|
+func Test_ProjectDetails(t *testing.T) {
|
|
|
+ appID := "sfPQRYRQMAAwcGBwYBCgcA"
|
|
|
+ secretKey := "a8Iws4mE"
|
|
|
+ data := make(url.Values)
|
|
|
+ projectId := "5f6b4e12499cb0822d39c68f"
|
|
|
+ data["project_id"] = []string{projectId}
|
|
|
+ data["app_id"] = []string{appID}
|
|
|
+ now := time.Now().Unix()
|
|
|
+ bs, _ := utils.HttpPostForm("http://localhost:8080/sfis/api/v1/projectList", map[string]string{
|
|
|
+ "token": utils.MD5(fmt.Sprintf("%s%d%s", appID, now, secretKey)),
|
|
|
+ "timestamp": fmt.Sprint(now),
|
|
|
+ }, data)
|
|
|
+ log.Print(string(bs))
|
|
|
+}
|
|
|
|
|
|
func post(url string, form map[string]string) (data map[string]interface{}) {
|
|
|
str := ""
|