contract

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CODE_OK     = 0
	CODE_BIZ    = 1
	CODE_SERVER = -1

	// 租户相关错误
	CODE_TENANCY_ERROR = 1000
	// 权限相关错误
	CODE_AUTH_ERROR = 10000
	// 参数相关错误
	CODE_PARAMS_ERROR = 20000
	// 业务相关错误
	CODE_BIZ_ERROR = 30000
	// 资源未找到
	CODE_NOTFOUND_ERROR = 40000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiResult

type ApiResult struct {
	Code    int         `json:"code"`
	Message string      `json:"message,omitempty"`
	Data    interface{} `json:"data,omitempty"`
	Stack   string      `json:"stack,omitempty"`
}

ApiResult 接口返回体

func Error

func Error(code int, msg string) *ApiResult

func NewApiResult

func NewApiResult(code int, msg string, data interface{}) *ApiResult

func OK

func OK(data interface{}) *ApiResult

type KnownError

type KnownError struct {
	ErrorCode int
	Message   string
	Err       error
}

KnownError 错误类

func (*KnownError) Error

func (se *KnownError) Error() string

type Staff

type Staff struct {
	// 通过paas、移动网关认证的用户有效
	StaffID string `json:"staff_id,omitempty"`
	// 通过paas、移动网关认证的用户有效
	StaffName string `json:"staff_name,omitempty"`

	// TODO 以下信息需要重构
	// 通过rio3 准入网关认证的用户有效
	UID string `json:"uid,omitempty"`
	// 通过rio3 准入网关认证的用户有效
	UInfo string `json:"uinfo,omitempty"`
	// 通过rio3 准入网关认证的用户有效
	Ext interface{} `json:"ext,omitempty"`
}

Staff 通过 paas、移动网关、rio3准入网关认证的用户信息

Jump to

Keyboard shortcuts

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