不同專案,根據介面呼叫訪問,httpclient使用
####介面部分:使用框架springboot:
**附上:
@restcontroller
@autowired
return list; }}
###@restcontroller 類前加上restcontroller 則表示返回json格式資料,如不需要json,則@controller###
###其他專案則使用httpclient呼叫
//post接收帶引數的json資料
public static void getpost()
urlencodedformentity entity = null;
string result = null;
try ]";
// system.out.println("frit.."+frit);
jsonarray jsonarray=jsonarray.fromobject(frit);
jsonobject object=(jsonobject)jsonarray.get(0);
system.out.println("object.."+object);
//將jsonobject格式轉換為map鍵值對
}//後部分是projpromotenew表的集合
string str=result.substring(index+16);
//獲取最後乙個「}」
int index1 = str.lastindexof("}");
str=str.substring(0,index1);
system.out.println("str.."+str);
jsonarray jsonarray1=jsonarray.fromobject(str);
if(jsonarray1.size() > 0)
}system.out.println("list1.size():"+list1.size());
for (mapmap1: list1)
}} catch (ioexception e) }}
jar包需要
springCloud 不同專案互相呼叫介面
a專案 1.呼叫介面類 public static string defaultconnection string method,string path,int timeout,int readtimeout,string data throws exception catch exception ...
不同專案配置不同的 Git 賬號
遇到 在一台電腦裡,通常會遇到這種情況。有公司的 git 賬號提交公司的 gitlab,有自己的 github 賬號提交 github 倉庫。比如像我的公司 git 賬號為 xiaojia,但我的 github 賬號為 linda0821,並且郵件也不一樣。當我設定 git 全域性 name 和 e...
Nginx 配置不同網域名稱訪問不同專案
訪問 www.test1.com 預設解析到 http ip test1 專案 server error page 500 502 503 504 50x.html location 50x.html 訪問 www.test2.com 預設解析到 http ip test2 專案 server er...