giip

API 公共结果代码 (RstVal)

本文档介绍 GIIP 平台 API 公共响应字段

RstVal
RstMsg
的标准定义。

📋 概述

为了跟踪执行结果,所有 GIIP API 都会在响应数据的最顶层包含

RstVal
(整型代码)和
RstMsg
(描述性消息)。这些值遵循数据库中
tDefRst
(结果定义)表的标准。

用户提到的 tRstVal 指的是 tDefRst 表中的 drRstVal 列。开发者在进行 API 对接和开发时,可以参考以下定义的代码来实现异常处理。


📡 主要结果代码 (Major Codes)

RstValRstMsg含义备注
200Process has done successfully成功标准成功响应
400No data found请求错误缺少参数或数据为空
401Unauthorized认证失败凭据错误或会话已过期
403Forbidden无权限访问权限不足
404No data found未找到资源不存在
500System error系统错误服务器内部逻辑或数据库错误

🔍 详细结果代码列表 (tDefRst)

系统内部使用的详细结果代码列表,包含针对积分、注册、外部对接等特定领域的详细消息。

drRstValdrRstMsg类别
100Starting Stored Procedure...系统
102Data is not match校验
201Created successfully创建
204No content available数据
211It is clean email. go next...注册
212Already registered user.注册
220Charge process has done successfully支付/积分
221Point process has done successfully积分
230Buying process has done successfully购买
250Prayed successfully其他
300Permission error权限
301Not enough point积分
302Already data exists.重复
312Pre-registered but not have User data.注册状态
313Input status is lower than dbStatus.一致性
320It cannot be processed point processing积分
330You have NFT Token already.资产
332Already sold out.购买
333Event item limit reached.活动
390Already registered this wallet.认证/钱包
405Method not allowed服务器/HTTP
409Conflict: Resource already exists状态冲突
410Gone: Resource no longer available已失效/已删除
420You don't have enough point积分
421Not same point and point history.数据一致性
502Bad Gateway: Upstream error网络

💡 开发者建议

  • 判定成功: 建议仅在
    RstVal
    200
    时继续执行业务逻辑。
  • 错误处理:
    400
    系列代码通常表示客户端需要修正请求,而
    500
    系列代码则需要系统管理员介入检查。
  • 消息使用:
    RstMsg
    主要用于开发者调试。对于最终用户,建议根据其语言环境实现对应的提示逻辑。

故障排除

症状原因解决
API 响应返回
RstVal
401
凭据错误或会话已过期重新确认认证密钥并刷新会话后重新发送请求。
RstVal
400
404
且数据为空
缺少必填参数或请求的资源不存在检查请求参数,并使用有效且存在的资源标识符重新请求。
RstVal
301
/
420
导致处理中断
未满足积分不足等业务条件查看
RstMsg
(如 Not enough point),满足前置条件后重试。
RstVal
返回
500
/
502
服务器内部逻辑/数据库错误或上游网关错误请勿在客户端重试,携带
RstMsg
联系系统管理员。

相关文档: