Search in sources :

Example 1 with ResUserRegister

use of com.bsnbase.sdk.entity.resp.xuperChain.ResUserRegister in project PCNGateway-Java-SDK by BSNDA.

the class UserService method userRegister.

/**
 * User registration
 * After a user participates in a XuperChain-based application, he/she needs to call this interface through the off-chain business system to generate the user account and account address for on-chain transaction processing.
 */
public static ResUserRegister userRegister(ReqUserRegister register) {
    String api = Config.config.getApi() + PathUtil.XUPERCHAIN_USER_REGISTER;
    BaseReqModel<ReqUserRegister> req = new BaseReqModel<>(register);
    req.setReqHeader(Config.config.getUserCode(), Config.config.getAppCode());
    HttpService<ReqUserRegister, ResUserRegister> httpService = new HttpService<ReqUserRegister, ResUserRegister>();
    BaseResModel<ResUserRegister> res = httpService.post(req, api, ResUserRegister.class);
    ResUserRegister body = res.getBody();
    return body;
}
Also used : BaseReqModel(com.bsnbase.sdk.entity.base.BaseReqModel) HttpService(com.bsnbase.sdk.util.common.HttpService) ResUserRegister(com.bsnbase.sdk.entity.resp.xuperChain.ResUserRegister) ReqUserRegister(com.bsnbase.sdk.entity.req.xuperChain.ReqUserRegister)

Aggregations

BaseReqModel (com.bsnbase.sdk.entity.base.BaseReqModel)1 ReqUserRegister (com.bsnbase.sdk.entity.req.xuperChain.ReqUserRegister)1 ResUserRegister (com.bsnbase.sdk.entity.resp.xuperChain.ResUserRegister)1 HttpService (com.bsnbase.sdk.util.common.HttpService)1