realauth

package
v2.10.18 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNeedQuery  = fmt.Errorf("need query result")
	ErrAuthFailed = fmt.Errorf("auth failed")
)

Functions

This section is empty.

Types

type RealAuthMgr

type RealAuthMgr struct {
	AppId  string
	BizId  string
	Secret string
	// contains filtered or unexported fields
}

func NewRealAuthMgr

func NewRealAuthMgr(appId, bizId, secret string, args ...bool) *RealAuthMgr

func (*RealAuthMgr) Check

func (m *RealAuthMgr) Check(ai string, name, idNum string) (string, error)

func (*RealAuthMgr) CheckTest

func (m *RealAuthMgr) CheckTest(ai string, name, idNum, code string) (string, error)

func (*RealAuthMgr) IdDecode

func (m *RealAuthMgr) IdDecode(idcard string) (string, string, string, bool)

func (*RealAuthMgr) Query

func (m *RealAuthMgr) Query(uid int) (string, error)

func (*RealAuthMgr) QueryCheck

func (m *RealAuthMgr) QueryCheck(ai, code string) (string, error)

func (*RealAuthMgr) ReportLoginout

func (m *RealAuthMgr) ReportLoginout(item ReportItem) (*ReportResponse, error)

func (*RealAuthMgr) ReportLoginoutCheck

func (m *RealAuthMgr) ReportLoginoutCheck(item ReportItem, code string) (*ReportResponse, error)

type ReportData

type ReportData struct {
	Collections []ReportItem `json:"collections"`
}

ReportData 上报的数据

type ReportItem

type ReportItem 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"` // 已通过实名认证用户的唯一标识,已认证通过用户必填
}

ReportItem 上下线上报的项目

type ReportResponse

type ReportResponse struct {
	ErrCode int                `json:"errcode"`
	ErrMsg  string             `json:"errmsg"`
	Data    ReportResponseData `json:"data"`
}

ReportResponse 上报上下线返回的数据

type ReportResponseData

type ReportResponseData struct {
	Result []ReportResponseData `json:"result"`
}

type ReportResultData

type ReportResultData struct {
	No      int    `json:"no"`
	ErrCode int    `json:"errcode"`
	ErrMsg  string `json:"errmsg"`
}

type RequestBody

type RequestBody struct {
	Data string `json:"data"`
}

type RequestInfo

type RequestInfo struct {
	Ai    string `json:"ai"`
	Name  string `json:"name"`
	IdNum string `json:"idNum"`
}

type Response

type Response struct {
	ErrCode int          `json:"errcode"`
	ErrMsg  string       `json:"errmsg"`
	Data    ResponseData `json:"data"`
}

type ResponseData

type ResponseData struct {
	Result ResultData `json:"result"`
}

ResponseData check 和 query 返回数据

type ResultData

type ResultData struct {
	Status int    `json:"status"`
	Pi     string `json:"pi"`
}

Jump to

Keyboard shortcuts

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