8. removeIssuerFromIssuerType
基本信息
- 接口名称: com.webank.weid.rpc.AuthorityIssuerService.removeIssuerFromIssuerType
- 接口定义: ResponseData<Boolean> removeIssuerFromIssuerType(WeIdAuthentication callerAuth, String issuerType, String targetIssuerWeId)
- 接口描述: 移除指定issuerType里面的WeId成员。
接口入参:
名称 | 类型 | 非空 | 说明 | 备注 |
---|---|---|---|---|
callerAuth | WeIdAuthentication | Y | weId身份信息 | |
issuerType | String | Y | 机构类型 | |
targetIssuerWeId | String | Y | issuer的WeIdentity DID |
com.webank.weid.protocol.base.WeIdAuthentication
名称 | 类型 | 非空 | 说明 | 备注 |
---|---|---|---|---|
weId | String | Y | WeIdentity DID | WeIdentity DID的格式传入 |
weIdPublicKeyId | String | N | 公钥Id | |
weIdPrivateKey | WeIdPrivateKey | Y | 交易私钥,见下 |
接口返回: com.webank.weid.protocol.response.ResponseData<Boolean>;
名称 | 类型 | 说明 | 备注 |
---|---|---|---|
errorCode | Integer | 返回结果码 | |
errorMessage | String | 返回结果描述 | |
result | Boolean | 是否移除成功 | |
transactionInfo | TransactionInfo | 交易信息 |
com.webank.weid.protocol.response.TransactionInfo
名称 | 类型 | 说明 | 备注 |
---|---|---|---|
blockNumber | BigInteger | 交易块高 | |
transactionHash | String | 交易hash | |
transactionIndex | BigInteger | 交易索引 |
此方法返回code
enum | code | desc |
---|---|---|
SUCCESS | 0 | 成功 |
WEID_DOES_NOT_EXIST | 100104 | WeIdentity DID不存在 |
AUTHORITY_ISSUER_ERROR | 100200 | 授权标准异常 |
WEID_INVALID | 100201 | 无效的WeIdentity DID |
AUTHORITY_ISSUER_PRIVATE_KEY_ILLEGAL | 100202 | 私钥格式非法 |
SPECIFIC_ISSUER_TYPE_ILLEGAL | 100208 | 机构类型非法 |
TRANSACTION_TIMEOUT | 160001 | 超时 |
TRANSACTION_EXECUTE_ERROR | 160002 | 交易错误 |
UNKNOW_ERROR | 160003 | 未知异常 |
ILLEGAL_INPUT | 160004 | 参数为空 |
调用示例
- WeIdAuthentication weIdAuthentication = new WeIdAuthentication();
- weIdAuthentication.setWeId("did:weid:101:0x39e5e6f663ef77409144014ceb063713b65600e7");
- WeIdPrivateKey weIdPrivateKey = new WeIdPrivateKey();
- weIdPrivateKey.setPrivateKey("60866441986950167911324536025850958917764441489874006048340539971987791929772");
- weIdAuthentication.setWeIdPrivateKey(weIdPrivateKey);
- weIdAuthentication.setWeIdPublicKeyId("did:weid:101:0x39e5e6f663ef77409144014ceb063713b65600e7#key0");
- AuthorityIssuerService authorityIssuerService = new AuthorityIssuerServiceImpl();
- ResponseData<List<AuthorityIssuer>> response = authorityIssuerService.removeIssuerFromIssuerType(weIdAuthentication, "College", "did:weid:101:0x39e5e6f663ef77409144014ceb063713b65600e7");
- 返回数据如:
- result: true
- errorCode: 0
- errorMessage: success
- transactionInfo: (com.webank.weid.protocol.response.TransactionInfo)
- blockNumber: 29950
- transactionHash: 0xe3f48648beee61d17de609d32af36ac0bf4d68a9352890b04d53841c4949bd13
- transactionIndex: 0
时序图
sequenceDiagramparticipant 调用者participant AuthorityIssuerServiceparticipant 区块链节点调用者->>AuthorityIssuerService: removeIssuerIntoIssuerType()AuthorityIssuerService->>AuthorityIssuerService: 入参非空、格式及合法性检查opt 入参校验失败AuthorityIssuerService—>>调用者: 报错,提示参数不合法并退出endAuthorityIssuerService->>区块链节点: 调用移除授权机构合约区块链节点->>区块链节点: 执行合约移除授权机构区块链节点—>>AuthorityIssuerService: 返回执行结果AuthorityIssuerService—>>调用者: 返回执行结果