3. isAuthorityIssuer

基本信息

  1. 接口名称:com.webank.weid.rpc.AuthorityIssuerService.isAuthorityIssuer
  2. 接口定义:ResponseData<Boolean> isAuthorityIssuer(String weId)
  3. 接口描述: 根据WeIdentity DID判断是否为权威机构。

接口入参: String

名称类型非空说明备注
weIdStringYWeIdentity DID用于搜索权限发布者

接口返回: com.webank.weid.protocol.response.ResponseData<Boolean>;

名称类型说明备注
errorCodeInteger返回结果码
errorMessageString返回结果描述
resultBoolean返回结果值
transactionInfoTransactionInfo交易信息

com.webank.weid.protocol.response.TransactionInfo

名称类型说明备注
blockNumberBigInteger交易块高
transactionHashString交易hash
transactionIndexBigInteger交易索引

此方法返回code

enumcodedesc
SUCCESS0成功
WEID_INVALID100101无效的WeIdentity DID
AUTHORITY_ISSUER_ERROR100200授权标准异常
TRANSACTION_TIMEOUT160001超时
TRANSACTION_EXECUTE_ERROR160002交易错误
AUTHORITY_ISSUER_CONTRACT_ERROR_NOT_EXISTS500202实体不存在

调用示例

  1. AuthorityIssuerService authorityIssuerService = new AuthorityIssuerServiceImpl();
  2. String weId = "did:weid:101:0x39e5e6f663ef77409144014ceb063713b65600e7";
  3. ResponseData<Boolean> response = authorityIssuerService.isAuthorityIssuer(weId);
  1. 返回结果如:
  2. result: true
  3. errorCode: 0
  4. errorMessage: success
  5. transactionInfo:null

时序图

sequenceDiagramparticipant 调用者participant AuthorityIssuerServiceparticipant 区块链节点调用者->>AuthorityIssuerService: 调用IsAuthorityIssuer()AuthorityIssuerService->>AuthorityIssuerService: 入参非空、格式及合法性检查opt 入参校验失败AuthorityIssuerService—>>调用者: 报错,提示参数不合法并退出endAuthorityIssuerService->>区块链节点: 调用查询是否为授权机构合约区块链节点->>区块链节点: 执行合约通过WeIdentity DID查询区块链节点—>>AuthorityIssuerService: 返回查询结果AuthorityIssuerService—>>调用者: 返回是/否