team

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 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 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"`
	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:"-"`
}

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

type WatchStore

type WatchStore interface {
	Gets(uid string) []string
	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