gofcm

package module
v0.0.0-...-18ce366 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

README

更新时间 2021 年 05 月 26 日

版本号: v1.8.0 网络游戏防沉迷实名认证系统 接口对接技术规范

网络游戏防沉迷实名认证系统测试系统说明

安装

go get -u github.com/ixugo/gofcm

通过测试用例

image-20210526204814544

测试文件中有 9 个测试函数,前 8 个用于通过接口测试。 需要更改 TestMain 函数中的参数 AppId,bizId,secretKey

将官网获取的测试码一次写入 code 数组 执行测试

如何使用

import "github.com/ixugo/gofcm"

func main(){
    gofcm.New(appId,bitId,secretKey)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckReqBody

type CheckReqBody struct {
	AI    string `json:"ai,omitempty"`    // 游戏内部成员标识
	Name  string `json:"name,omitempty"`  // 姓名
	IdNum string `json:"idNum,omitempty"` // 身份证
}

CheckReqBody 请求体

type CheckRespBody

type CheckRespBody struct {
	ErrCode int           `json:"errcode,omitempty"` // 状态码 0:成功; x>1000:失败;
	ErrMsg  string        `json:"errmsg,omitempty"`  // 状态描述
	Data    checkRespBody `json:"data,omitempty"`
}

CheckRespBody check 和 query 的响应内容

type Collection

type Collection struct {
	No int    `json:"no"` // 条码编码
	Si string `json:"si"` // 游戏内部会话标识
	Bt int    `json:"bt"` // 用户行为类型  0:下线; 1:上线;
	Ot int64  `json:"ot"` // 行为发生时间,单位秒
	Ct int    `json:"ct"` // 上报类型 0:已认证用户; 2: 游客用户
	Di string `json:"di"` // 设备标识,游客用户必填
	Pi string `json:"pi"` // 用户唯一标识 已认证用户必填
}

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

func New

func New(appId, bizId, secretKey string) *Engine

func (*Engine) Check

func (e *Engine) Check(c CheckReqBody) (*CheckRespBody, error)

Check 实名认证接口

func (*Engine) GetCNErrMsg

func (e *Engine) GetCNErrMsg(state int) string

GetCNErrMsg 获取中文错误消息,仅包含 check 与 query 业务异常

func (*Engine) Loginout

func (e *Engine) Loginout(l LoginoutReqBody) (*LoginoutRespBody, error)

Loginout 游戏用户行为数据上报接口

func (*Engine) Query

func (e *Engine) Query(ai string) (*CheckRespBody, error)

Query 实名认证结果查询接口

type LoginoutReqBody

type LoginoutReqBody struct {
	Collections []Collection `json:"collections,omitempty"`
}

type LoginoutRespBody

type LoginoutRespBody struct {
	ErrCode int               `json:"errcode,omitempty"` // 状态码 0:成功; x>1000:失败;
	ErrMsg  string            `json:"errmsg,omitempty"`  // 状态描述
	Data    *loginoutRespBody `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL