Search in sources :

Example 1 with ResUserRegister

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

the class UserService method userRegister.

/**
 * User registration
 * <p>
 * In both key trust mode and public key upload mode, when the user participated in the FISCO BCOS application needs to create a separate user transaction certificate for the sub-user of the off-chain system, it is necessary to call this interface first to register the sub-user in this city node, and the sub-user's username is name@appCode in the call parameter.
 */
public static ResUserRegister userRegister(ReqUserRegister register) throws IOException {
    String api = Config.config.getApi() + PathUtil.FISCOBCOS_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.fiscobcos.ResUserRegister) ReqUserRegister(com.bsnbase.sdk.entity.req.fiscobcos.ReqUserRegister)

Aggregations

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