staff

package
v0.0.0-...-e518e2d Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Type_name = map[int32]string{
		0: "UNKNOWN",
		1: "UNDERGRADUATE",
		2: "POSTGRADUATE",
		3: "TEACHER",
	}
	Type_value = map[string]int32{
		"UNKNOWN":       0,
		"UNDERGRADUATE": 1,
		"POSTGRADUATE":  2,
		"TEACHER":       3,
	}
)

Enum value maps for Type.

View Source
var File_campusapis_staff_base_proto protoreflect.FileDescriptor

Functions

func GetSchool

func GetSchool(c *gin.Context) string

func GetStaffID

func GetStaffID(c *gin.Context) string

Types

type ErrInvalidStaffID

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

func (ErrInvalidStaffID) Error

func (e ErrInvalidStaffID) Error() string

type Info

type Info struct {

	// 学工号
	StaffID string `protobuf:"bytes,1,opt,name=staffID,proto3" json:"staffID,omitempty"`
	// 姓名
	StaffName string `protobuf:"bytes,2,opt,name=staffName,proto3" json:"staffName,omitempty"`
	// 人员类型
	StaffType Type `protobuf:"varint,3,opt,name=staffType,proto3,enum=campusapis.staff.Type" json:"staffType,omitempty"`
	// 人员状态
	StaffState string `protobuf:"bytes,4,opt,name=staffState,proto3" json:"staffState,omitempty"`
	// 学院编码
	UnitCode string `protobuf:"bytes,5,opt,name=unitCode,proto3" json:"unitCode,omitempty"`
	// 学院名称
	UnitName string `protobuf:"bytes,6,opt,name=unitName,proto3" json:"unitName,omitempty"`
	// contains filtered or unexported fields
}

人员信息

func (*Info) Descriptor deprecated

func (*Info) Descriptor() ([]byte, []int)

Deprecated: Use Info.ProtoReflect.Descriptor instead.

func (*Info) GetStaffID

func (x *Info) GetStaffID() string

func (*Info) GetStaffName

func (x *Info) GetStaffName() string

func (*Info) GetStaffState

func (x *Info) GetStaffState() string

func (*Info) GetStaffType

func (x *Info) GetStaffType() Type

func (*Info) GetUnitCode

func (x *Info) GetUnitCode() string

func (*Info) GetUnitName

func (x *Info) GetUnitName() string

func (*Info) ProtoMessage

func (*Info) ProtoMessage()

func (*Info) ProtoReflect

func (x *Info) ProtoReflect() protoreflect.Message

func (*Info) Reset

func (x *Info) Reset()

func (*Info) String

func (x *Info) String() string

type InfoMapList

type InfoMapList struct {
	Items map[string]*Info `` /* 151-byte string literal not displayed */
	// contains filtered or unexported fields
}

人员列表

func (*InfoMapList) Append

func (x *InfoMapList) Append(list ...*Info)

func (*InfoMapList) Descriptor deprecated

func (*InfoMapList) Descriptor() ([]byte, []int)

Deprecated: Use InfoMapList.ProtoReflect.Descriptor instead.

func (*InfoMapList) GetItems

func (x *InfoMapList) GetItems() map[string]*Info

func (*InfoMapList) MarshalJSON

func (x *InfoMapList) MarshalJSON() ([]byte, error)

func (*InfoMapList) ProtoMessage

func (*InfoMapList) ProtoMessage()

func (*InfoMapList) ProtoReflect

func (x *InfoMapList) ProtoReflect() protoreflect.Message

func (*InfoMapList) Reset

func (x *InfoMapList) Reset()

func (*InfoMapList) String

func (x *InfoMapList) String() string

func (*InfoMapList) UnmarshalJSON

func (x *InfoMapList) UnmarshalJSON(bytes []byte) error

type Staff

type Staff struct {

	// 学工号
	ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	// 人员类型
	Type Type `protobuf:"varint,2,opt,name=type,proto3,enum=campusapis.staff.Type" json:"type,omitempty"`
	// contains filtered or unexported fields
}

人员

func FromContext

func FromContext(c *gin.Context) *Staff

func FromMetadata

func FromMetadata(md metadata.MD) *Staff

func GetStaffFromGatewayGinContext

func GetStaffFromGatewayGinContext(c *gin.Context) *Staff

func Postgraduate

func Postgraduate(staffID string) *Staff

func Teacher

func Teacher(staffID string) *Staff

func Undergraduate

func Undergraduate(staffID string) *Staff

func (*Staff) Descriptor deprecated

func (*Staff) Descriptor() ([]byte, []int)

Deprecated: Use Staff.ProtoReflect.Descriptor instead.

func (*Staff) GetID

func (x *Staff) GetID() string

func (*Staff) GetType

func (x *Staff) GetType() Type

func (*Staff) ProtoMessage

func (*Staff) ProtoMessage()

func (*Staff) ProtoReflect

func (x *Staff) ProtoReflect() protoreflect.Message

func (*Staff) Reset

func (x *Staff) Reset()

func (*Staff) String

func (x *Staff) String() string

type StaffID

type StaffID struct {
	Raw    string
	Number string
	Unit   string
	Grade  string
	Type   Type
}

func ParseStaffID

func ParseStaffID(str string) (StaffID, error)

func (StaffID) MarshalJSON

func (i StaffID) MarshalJSON() ([]byte, error)

func (*StaffID) Scan

func (i *StaffID) Scan(src interface{}) error

func (*StaffID) UnmarshalJSON

func (i *StaffID) UnmarshalJSON(bytes []byte) error

func (StaffID) Valid

func (i StaffID) Valid() error

func (*StaffID) Value

func (i *StaffID) Value() (driver.Value, error)

type Type

type Type int32

人员类型

const (
	// 未知
	Type_UNKNOWN Type = 0
	// 本科生
	Type_UNDERGRADUATE Type = 1
	// 研究生
	Type_POSTGRADUATE Type = 2
	// 教职工
	Type_TEACHER Type = 3
)

func GetStaffType

func GetStaffType(c *gin.Context) Type

func (Type) Descriptor

func (Type) Descriptor() protoreflect.EnumDescriptor

func (Type) Enum

func (x Type) Enum() *Type

func (Type) EnumDescriptor deprecated

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

Deprecated: Use Type.Descriptor instead.

func (Type) Number

func (x Type) Number() protoreflect.EnumNumber

func (Type) String

func (x Type) String() string

func (Type) Type

func (Type) Type() protoreflect.EnumType

Directories

Path Synopsis
Package staffv1 is a reverse proxy.
Package staffv1 is a reverse proxy.

Jump to

Keyboard shortcuts

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