code

package
v0.0.0-...-41631cc Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrGoodsNotFound - 404: Goods not found.
	ErrGoodsNotFound int = iota + 100501

	// ErrCategoryNotFound - 404: Category not found.
	ErrCategoryNotFound

	// ErrEsUnmarshal - 500: ES unmarshal error.
	ErrEsUnmarshal

	// ErrElasticSearch - 500: ElasticSearch error.
	ErrElasticsearch
)
View Source
const (
	// ErrInventoryNotFound - 404: Inventory not found.
	ErrInventoryNotFound int = iota + 100701

	// ErrInvSellDetailNotFound - 400: Inventory sell detail not found.
	ErrInvSellDetailNotFound

	// ErrInvNotEnough - 400: Inventory not enough.
	ErrInvNotEnough
)
View Source
const (
	// ErrOrderNotFound - 404: Order not found.
	ErrOrderNotFound int = iota + 100801

	// ErrShopCartItemNotFound - 404: ShopCart item not found.
	ErrShopCartItemNotFound

	// ErrSubmitOrder - 500: Submit order error.
	ErrSubmitOrder

	// ErrNoGoodsSelected - 404: No goods selected.
	ErrNoGoodsSelected
)
View Source
const (
	// ErrUserNotFound - 404: User not found.
	ErrUserNotFound int = iota + 100401

	// ErrUserAlreadyExists - 400: User already exists.
	ErrUserAlreadyExists

	// ErrLoginFailed - 500: Login failed.
	ErrLoginFailed

	// ErrSmsSend - 500: Send sms error.
	ErrSmsSend

	// ErrCodeNotExist - 400: Sms code not exist.
	ErrCodeNotExist

	// ErrCodeIncorrent - 400: Sms code incorrent.
	ErrCodeIncorrent
)
View Source
const (
	// ErrGrpcConn - 500: Connect to grpc error.
	ErrGrpcConn int = iota + 100601
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrCode

type ErrCode struct {
	// 错误码
	C int

	// http 的转态码
	HTTP int

	// 扩展字段
	Ext string

	// 引用文档
	Ref string
}

func (*ErrCode) Code

func (e *ErrCode) Code() int

Code implements errors.Coder.

func (*ErrCode) HTTPStatus

func (e *ErrCode) HTTPStatus() int

HTTPStatus implements errors.Coder.

func (*ErrCode) Reference

func (e *ErrCode) Reference() string

Reference implements errors.Coder.

func (*ErrCode) String

func (e *ErrCode) String() string

String implements errors.Coder.

Jump to

Keyboard shortcuts

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