campusapis

package
v0.0.0-...-a9153d3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// optional string staff_id_needed = 50001;
	E_StaffIdNeeded = &file_campusapis_option_proto_extTypes[0]
	// optional string staff_type_needed = 50002;
	E_StaffTypeNeeded = &file_campusapis_option_proto_extTypes[1]
)

Extension fields to descriptorpb.MessageOptions.

View Source
var (
	Status_name = map[int32]string{
		0:     "UNSPECIFIED",
		20000: "OK",
		40000: "INVALID_ARGUMENT",
		40001: "STAFF_TYPE_NOT_FOUND",
		40003: "UNSUPPORTED_STAFF_TYPE",
		40004: "STAFF_ID_CANNOT_BE_EMPTY",
		40400: "NOT_FOUND",
		40401: "STAFF_NOT_FOUND",
		50000: "SERVICE_ERROR",
	}
	Status_value = map[string]int32{
		"UNSPECIFIED":              0,
		"OK":                       20000,
		"INVALID_ARGUMENT":         40000,
		"STAFF_TYPE_NOT_FOUND":     40001,
		"UNSUPPORTED_STAFF_TYPE":   40003,
		"STAFF_ID_CANNOT_BE_EMPTY": 40004,
		"NOT_FOUND":                40400,
		"STAFF_NOT_FOUND":          40401,
		"SERVICE_ERROR":            50000,
	}
)

Enum value maps for Status.

View Source
var File_campusapis_option_proto protoreflect.FileDescriptor
View Source
var File_campusapis_status_proto protoreflect.FileDescriptor

Functions

func Require

func Require(req any, list ...string) error

Require 判断入参是否为空值

func RequireWarped

func RequireWarped(req any, list ...string) error

func WarpCode

func WarpCode(code codes.Code, errorCode int32) codes.Code

Types

type Codes

type Codes struct {
	Status   Status
	GrpcCode codes.Code
}

func Unwarp

func Unwarp(err error) (codes Codes, msg string)

func UnwarpCode

func UnwarpCode(code codes.Code) Codes

type RequiredButEmpty

type RequiredButEmpty struct {
	Values []string
}

func (RequiredButEmpty) Error

func (e RequiredButEmpty) Error() string

type Status

type Status int32

请求状态 错误定义

const (
	Status_UNSPECIFIED Status = 0
	// 成功
	Status_OK Status = 20000
	// 通用参数错误
	Status_INVALID_ARGUMENT Status = 40000
	// 人员类型参数缺失
	Status_STAFF_TYPE_NOT_FOUND Status = 40001
	// 不支持的人员类型
	Status_UNSUPPORTED_STAFF_TYPE Status = 40003
	// 人员工号缺失
	Status_STAFF_ID_CANNOT_BE_EMPTY Status = 40004
	// 通用无法找到
	Status_NOT_FOUND Status = 40400
	// 未找到人员
	Status_STAFF_NOT_FOUND Status = 40401
	// 服务错误
	Status_SERVICE_ERROR Status = 50000
)

func (Status) Descriptor

func (Status) Descriptor() protoreflect.EnumDescriptor

func (Status) Enum

func (x Status) Enum() *Status

func (Status) EnumDescriptor deprecated

func (Status) EnumDescriptor() ([]byte, []int)

Deprecated: Use Status.Descriptor instead.

func (Status) Message

func (x Status) Message() string

func (Status) Number

func (x Status) Number() protoreflect.EnumNumber

func (Status) String

func (x Status) String() string

func (Status) Type

func (Status) Type() protoreflect.EnumType

func (Status) Warp

func (x Status) Warp(status codes.Code) codes.Code

func (Status) With

func (x Status) With(c codes.Code, msg string) error

Directories

Path Synopsis
Package backup is a reverse proxy.
Package backup is a reverse proxy.
card
v1
Package cardv1 is a reverse proxy.
Package cardv1 is a reverse proxy.
gate
v1
Package gatev1 is a reverse proxy.
Package gatev1 is a reverse proxy.
health
v1
Package healthv1 is a reverse proxy.
Package healthv1 is a reverse proxy.
library
v1
Package libraryv1 is a reverse proxy.
Package libraryv1 is a reverse proxy.
needy
v1
Package needyv1 is a reverse proxy.
Package needyv1 is a reverse proxy.
v1
Package schoolTimev1 is a reverse proxy.
Package schoolTimev1 is a reverse proxy.
v1
Package staffv1 is a reverse proxy.
Package staffv1 is a reverse proxy.
teaching
v1
Package teachingv1 is a reverse proxy.
Package teachingv1 is a reverse proxy.
third
v1
Package thirdv1 is a reverse proxy.
Package thirdv1 is a reverse proxy.

Jump to

Keyboard shortcuts

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