organization

package
v0.0.0-...-d9cd954 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OrganizationID primitive.ObjectID

Functions

This section is empty.

Types

type Department

type Department struct {
	DepartmentID       string    `bson:"department_id"`
	FaceURL            string    `bson:"face_url"`
	Name               string    `bson:"name"`
	ParentDepartmentID string    `bson:"parent_department_id"`
	Order              int32     `bson:"order"`
	CreateTime         time.Time `bson:"create_time"`
}

type DepartmentInterface

type DepartmentInterface interface {
	IncrOrder(ctx context.Context, parentDepartmentID string, order int32) error
	Create(ctx context.Context, department ...*Department) error
	FindOne(ctx context.Context, departmentID string) (*Department, error)
	Update(ctx context.Context, departmentID string, data map[string]any) error
	GetParent(ctx context.Context, id string) ([]*Department, error)
	GetList(ctx context.Context, departmentIdList []string) ([]*Department, error)
	UpdateParentID(ctx context.Context, oldParentID, newParentID string) error
	Delete(ctx context.Context, departmentIDList []string) error
	GetDepartment(ctx context.Context, departmentID string) (*Department, error)
	GetMaxOrder(ctx context.Context, parentID string) (int32, error)
	GetByName(ctx context.Context, name string, id string) (*Department, error)
	InitUngroupedName(ctx context.Context, id string, name string) error
	Search(ctx context.Context, keyword string) ([]string, error)
}

type DepartmentMember

type DepartmentMember struct {
	UserID          string     `bson:"user_id"`
	DepartmentID    string     `bson:"department_id"`
	Position        string     `bson:"position"`
	Station         string     `bson:"station"`
	Order           int32      `bson:"order"`
	EntryTime       time.Time  `bson:"entry_time"`
	TerminationTime *time.Time `bson:"termination_time"`
	CreateTime      time.Time  `bson:"create_time"`
}

type DepartmentMemberInterface

type DepartmentMemberInterface interface {
	FindByDepartmentID(ctx context.Context, departmentIDList []string) ([]*DepartmentMember, error)
	DeleteDepartmentIDList(ctx context.Context, departmentIDList []string) error
	Create(ctx context.Context, m *DepartmentMember) error
	Creates(ctx context.Context, m []*DepartmentMember) error
	Get(ctx context.Context, userID string) ([]*DepartmentMember, error)
	DeleteByKey(ctx context.Context, userID string, departmentID string) error
	Update(ctx context.Context, departmentID string, userID string, update map[string]any) error
	FindByUserID(ctx context.Context, userIDList []string) ([]*DepartmentMember, error)
	GetByDepartmentID(ctx context.Context, departmentID string) ([]*DepartmentMember, error)
	GetByKey(ctx context.Context, userID, departmentID string) (*DepartmentMember, error)
	Move(ctx context.Context, userID string, oldDepartmentID string, newDepartmentID string) error
	Search(ctx context.Context, keyword string, departmentIDs []string) ([]string, error)
	GetMaxOrder(ctx context.Context, departmentID string) (int32, error)
	IncrOrder(ctx context.Context, departmentID string, order int32) error
	GetNum(ctx context.Context, departmentIDs []string) (int64, error)
}

type Organization

type Organization struct {
	ID           primitive.ObjectID `bson:"_id"`
	LogoURL      string             `bson:"logo_url"`
	Name         string             `bson:"name"`
	Homepage     string             `bson:"homepage"`
	Introduction string             `bson:"introduction"`
	CreateTime   time.Time          `bson:"create_time"`
}

type OrganizationInterface

type OrganizationInterface interface {
	Set(ctx context.Context, update map[string]any) error
	Get(ctx context.Context) (*Organization, error)
	Init(ctx context.Context) error
}

Jump to

Keyboard shortcuts

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