diff --git a/jtt_tool/jtt_client.go b/jtt_tool/jtt_client.go index 628ece6..563b943 100644 --- a/jtt_tool/jtt_client.go +++ b/jtt_tool/jtt_client.go @@ -50,7 +50,7 @@ func (j *JttClient) FindUserForTokenMessage(address string) (res *FindUserForTok paramMap["publicKey"] = j.PublicKey paramMap["address"] = address - postRes, err := j.JttPost(paramMap) + postRes, err := j.JttPost("/findUserForTokenMessage", paramMap) if err != nil { return } @@ -71,6 +71,7 @@ func (j *JttClient) FindUserForTokenMessage(address string) (res *FindUserForTok } type FindUserForTokenMessageRes struct { + Code int `json:"code"` Data *Data `json:"data"` } @@ -85,11 +86,11 @@ type UserToken struct { WalletAddress string `json:"walletAddress"` } -func (j *JttClient) JttPost(paramMap map[string]any) (res []byte, err error) { +func (j *JttClient) JttPost(url string, paramMap map[string]any) (res []byte, err error) { bodyByte, _ := json.Marshal(paramMap) - req, err := http.NewRequest(http.MethodPost, j.ApiUrl+"/findUserForTokenMessage", bytes.NewBuffer(bodyByte)) + req, err := http.NewRequest(http.MethodPost, j.ApiUrl+url, bytes.NewBuffer(bodyByte)) if err != nil { return }