Search in sources :

Example 1 with ResUserRegister

use of com.bsnbase.sdk.entity.resp.fabric.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 is participating in the Fabric application and 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 user in this city node, and the user's username is name@appCode in the call parameter.
 */
public static ResUserRegister userRegister(ReqUserRegister register) throws IOException {
    String api = Config.config.getApi() + PathUtil.FABRIC_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.fabric.ResUserRegister) ReqUserRegister(com.bsnbase.sdk.entity.req.fabric.ReqUserRegister)

Aggregations

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