Search in sources :

Example 11 with HttpService

use of com.bsnbase.sdk.util.common.HttpService in project PCNGateway-Java-SDK by BSNDA.

the class UserService method userRegister.

/**
 * User registration
 * After a user participates in a CITA application service successfully, 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) throws IOException {
    String api = Config.config.getApi() + PathUtil.CITA_USER_REGISTER;
    BaseReqModel<ReqUserRegister> req = new BaseReqModel<ReqUserRegister>();
    req.setReqHeader(Config.config.getUserCode(), Config.config.getAppCode());
    req.setBody(register);
    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.cita.ResUserRegister) ReqUserRegister(com.bsnbase.sdk.entity.req.cita.ReqUserRegister)

Aggregations

BaseReqModel (com.bsnbase.sdk.entity.base.BaseReqModel)11 HttpService (com.bsnbase.sdk.util.common.HttpService)11 ResGetBlockHeight (com.bsnbase.sdk.entity.resp.cita.ResGetBlockHeight)2 GlobalException (com.bsnbase.sdk.util.exception.GlobalException)2 ReqKeyUploadBody (com.bsnbase.sdk.entity.req.cita.ReqKeyUploadBody)1 ReqUserRegister (com.bsnbase.sdk.entity.req.cita.ReqUserRegister)1 ReqKeyEscrowEnroll (com.bsnbase.sdk.entity.req.fabric.ReqKeyEscrowEnroll)1 ReqKeyEscrowNo (com.bsnbase.sdk.entity.req.fabric.ReqKeyEscrowNo)1 ReqUserRegister (com.bsnbase.sdk.entity.req.fabric.ReqUserRegister)1 ReqTrans (com.bsnbase.sdk.entity.req.fiscobcos.ReqTrans)1 ReqUserRegister (com.bsnbase.sdk.entity.req.fiscobcos.ReqUserRegister)1 ReqUserRegister (com.bsnbase.sdk.entity.req.xuperChain.ReqUserRegister)1 ResKeyEscrow (com.bsnbase.sdk.entity.resp.cita.ResKeyEscrow)1 ResUserRegister (com.bsnbase.sdk.entity.resp.cita.ResUserRegister)1 ResKeyEscrowEnroll (com.bsnbase.sdk.entity.resp.fabric.ResKeyEscrowEnroll)1 ResKeyEscrowNo (com.bsnbase.sdk.entity.resp.fabric.ResKeyEscrowNo)1 ResUserRegister (com.bsnbase.sdk.entity.resp.fabric.ResUserRegister)1 ResTrans (com.bsnbase.sdk.entity.resp.fiscobcos.ResTrans)1 ResUserRegister (com.bsnbase.sdk.entity.resp.fiscobcos.ResUserRegister)1 ResUserRegister (com.bsnbase.sdk.entity.resp.xuperChain.ResUserRegister)1