企點第三方介面呼叫備忘

2021-10-05 06:49:32 字數 3062 閱讀 4084

1.首先獲取accesstoken(根據aid 和secret)

2.根據文件中的url,傳送對應請求到這個url,獲取返回結果

2.解析結果並封裝到自己**中的物件裡

public

class

qidiancustinfocontroller

if(maptype1identfy.

containskey

("birthday"))

if(maptype1identfy.

containskey

("education"))

}if(maptype1identfy.

containskey

("comment"))

}if(maptype1identfy.

containskey

("location"))

}//獲取職位資訊

list

titlelist =

(list

)maptype1identfy.

get(

"company");

mapmaptype2 = json.

parseobject

(titlelist.

get(0)

.tostring()

, map.

class);

if(null != maptype2 && maptype2.

containskey

("title"))

// system.out.

println

(titlelist.

get(0)

);//客戶contact資訊

mapmaptype1contact =

(map

)maptype1sub.

get(

"contact");

if(maptype1contact.

containskey

("telephone"

)&& null != maptype1contact.

get(

"telephone"))

//telephoneinfo

if(maptype1contact.

containskey

("telephoneinfo"

)&& null != maptype1contact.

get(

"telephoneinfo"))

"))"

);string telephoneinfosrt = telephoneinfosr.

substring

(start,end+1)

; jsonobject object = json.

parseobject

(telephoneinfosrt)

; system.out.

println

("object==="

+object)

; map

maptype3 = json.

parseobject

(object.

tostring()

, map.

class);

long fid = long.

valueof

(maptype3.

get(

"fid").

tostring()

);crmqidiancust.

setfid

(fid);}

}if(null != maptype1contact.

get(

"email"))

//wxaccount

if(null != maptype1contact.

get(

"wxaccount"))

crmqidiancust.

setenable(1

);crmqidiancust.

setdeleteflag(0

);//controlinfo

mapmaptype1controlinfo =

(map

)maptype1sub.

get(

"controlinfo");

if(maptype1controlinfo.

containskey

("createdtime"

)&&null != maptype1controlinfo.

get(

"createdtime"))

crmqidiancustlist.

add(crmqidiancust)

; system.out.

println

("crmqidiancust*****="

+crmqidiancust);}

system.out.

println

("crmqidiancustlist*****="

+crmqidiancustlist);}

private

static string getstrint

(string result01)

//unicode轉中文

public

static string decodeunicode

(final string datastr)

else

char letter =

(char

) integer.

parseint

(charstr,16)

;//16進製制parse整形字串。

buffer.

(new

character

(letter)

.tostring()

);start = end;

}return buffer.

tostring()

;}}

Feign呼叫第三方http介面

我們平常在開發的時候,經常會碰到呼叫第三方的介面,這個時候我們可以使用httpclient或者resttemplate,但是這兩種方式相比較與feign呼叫,都會麻煩一點兒。feign是宣告式服務呼叫客戶端,既規範又簡潔,幫我們遮蔽了http呼叫的複雜性,而且完美切入springcloud技術體系。...

rest呼叫第三方介面以及給第三方推送資料

1,rest呼叫第三方介面 第三方傳送post請求,json物件 如果有引數可以放進map裡 jsonobject body entity.getbody 2,rest呼叫第三方介面 第三方傳送get請求,json串 string url resttemplate resttemplate new ...

第三方支付介面

第三方支付介面 簽約入口 4.郵局支付 網匯通 7.免手續費自助整合 10.nps網上支付系統 contact contact.jsp 程式參考文件 見附件nps支付系統介面 特點 1.支援國內銀行支付 2.支援國外銀行支付 3.支援神州行充值卡支付 product payment easyown....