team

package
v0.12.4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Butt added in v0.10.5

type Butt struct {
	UID    string `json:"uid" db:"watching"`
	Name   string `json:"name" db:"-"`
	Avatar string `json:"avatar" db:"-"`

	Created *time.Time `json:"created,omitempty" db:"created"`
}

Butt 关注的对象

type Butts added in v0.10.5

type Butts []Butt

Butts ..

func (Butts) UIDs added in v0.10.5

func (z Butts) UIDs() []string

UIDs ...

type RoleType

type RoleType int

RoleType ...

const (
	RoleNothing RoleType = iota
	RoleMember
	RoleManager
)

type Store

type Store interface {
	// Get 取一个
	Get(id int) (*Team, error)
	// All 查询全部数据
	All(role RoleType) (data Teams, err error)
	// Store 保存
	Store(t *Team) error
	// Add members
	AddMember(id int, uids ...string) error
	// Remove members
	RemoveMember(id int, uids ...string) error
	// Delete 删除 Team
	Delete(id int) error
	// Add Manager
	AddManager(id int, uid string) error
	// Remove Manager
	RemoveManager(id int, uid string) error
	// GetWithMember
	GetWithMember(uid string) (*Team, error)
}

Store interface of team storage

type StringSlice

type StringSlice = types.StringSlice

type Team

type Team struct {
	ID        int         `json:"id"`
	Name      string      `json:"name"`
	OrigName  string      `json:"orgname,omitempty" db:"-"`
	EngName   string      `json:"engname,omitempty" db:"-"`
	ParentID  int         `json:"parentID,omitempty" db:"parent_id"`
	Leaders   StringSlice `json:"leaders,omitempty"`
	Members   StringSlice `json:"members"`
	Created   time.Time   `json:"created,omitempty" db:"created"`
	Updated   *time.Time  `json:"updated,omitempty" db:"updated,omitempty"`
	StaffUID  string      `json:"staff_uid,omitempty" db:"staff_uid"`
	StaffName string      `json:"staff_name,omitempty" db:"-"`
	OrderNo   int         `json:"orderNo,omitempty" db:"-"`
}

Team work group

type TeamOpParam

type TeamOpParam struct {
	Op     TeamOpType `json:"op" binding:"required" valid:"[1:2]"`
	TeamID int        `json:"team_id" binding:"required" valid:"required"`
	UIDs   []string   `json:"staff_uids" binding:"required" valid:"required"`
}

type TeamOpType

type TeamOpType int
const (
	TeamOpAdd    TeamOpType = 1 + iota // add
	TeamOpRemove                       // remove
)

type Teams

type Teams []Team

Teams ...

func (Teams) UIDs added in v0.10.5

func (z Teams) UIDs() []string

UIDs return slice of staff uids

type WatchStore

type WatchStore interface {
	Gets(uid string) Butts
	Watch(uid, target string) error
	Unwatch(uid, target string) error
}

WatchStore interface of watch 关注

Jump to

Keyboard shortcuts

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