All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nextpls.sdk.request.NextPlsGetExRateRequest Maven / Gradle / Ivy

The newest version!
package com.nextpls.sdk.request;

import com.alibaba.fastjson.JSONObject;
import com.nextpls.sdk.NextPlsRequest;
import com.nextpls.sdk.constants.ApiNameConst;
import com.nextpls.sdk.pojo.request.NextPlsBaseRequest;
import com.nextpls.sdk.pojo.request.NextPlsExRateRequestDto;
import com.nextpls.sdk.pojo.response.NextPlsExRateResponse;
import org.apache.http.client.methods.HttpPost;

/**
 * @author zhangchao
 * @create 2020-01-08-14:47
 */
public class NextPlsGetExRateRequest implements NextPlsRequest {
    private static final String API_METHOD_NAME = ApiNameConst.GET_EX_RATE;

    private NextPlsBaseRequest baseRequest = new NextPlsBaseRequest<>();

    private String bizContents;

    @Override
    public String getApiMethodName() {
        return API_METHOD_NAME;
    }

    @Override
    public String getRequestMethod() {
        return HttpPost.METHOD_NAME;
    }

    @Override
    public boolean isNeedEncrypt() {
        return true;
    }

    @Override
    public String getBizContents() {
        return this.bizContents;
    }

    @Override
    public Class getResponseClass() {
        return NextPlsExRateResponse.class;
    }

    public void setRequestDto(NextPlsExRateRequestDto requestDto) {
        this.baseRequest.setEntity(requestDto);
        this.baseRequest.setApiName(API_METHOD_NAME);
        this.bizContents = JSONObject.toJSONString(this.baseRequest);
    }

    public static NextPlsGetExRateRequest build(NextPlsExRateRequestDto requestDto) {
        NextPlsGetExRateRequest request = new NextPlsGetExRateRequest();
        request.setRequestDto(requestDto);
        return request;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy