weekly

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListPager

type ListPager struct {
	Size   int `json:"size" `
	Offset int `json:"offset" `
}

func (*ListPager) Sql

func (this *ListPager) Sql() string

type ListSort

type ListSort []*SortField

func (*ListSort) Check

func (this *ListSort) Check(fields []string) bool

func (*ListSort) Sql

func (this *ListSort) Sql() string

type Report

type Report struct {
	Id      int             `json:"id"`
	Uid     string          `json:"uid"`
	Name    string          `json:"name,omitempty" db:"-"`   // staff name
	Avatar  string          `json:"avatar,omitempty" db:"-"` // staff name
	Year    int             `json:"year" db:"iso_year"`
	Week    int             `json:"week" db:"iso_week"`
	Status  Status          `json:"status"` // 0代表正常,1代表休假
	Content json.RawMessage `json:"content"`
	UpCount int             `json:"upCount" db:"up_count"`

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

Report 周报

type ReportStat

type ReportStat struct {
	Id     int    `json:"id,omitempty"`
	Uid    string `json:"uid,omitempty"`
	Year   int    `json:"year" db:"iso_year"`
	Week   int    `json:"week" db:"iso_week"`
	Status Status `json:"status"` //0正常,1休假,2表示忽略该用户所有或特定周报

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

type ReportStatParam

type ReportStatParam struct {
	Start string `json:"start"`
	End   string `json:"end"`
}

周报统计参数

type ReportStatResponse

type ReportStatResponse struct {
	Commited []*ReportStat `json:"commited"`
	All      []*ReportUser `json:"all"`
	Ignores  []*ReportUser `json:"ignores"`
}

周报统计返回数据

type ReportUser

type ReportUser struct {
	Id   int    `json:"id,omitempty"`
	Uid  string `json:"uid"`
	Name string `json:"name"`

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

type ReportWithProblem

type ReportWithProblem struct {
	Id   int `json:"id"`
	Year int `json:"year" db:"iso_year"`
	Week int `json:"week" db:"iso_week"`
	// Status    int64  `json:"status"` // 0代表正常,1代表休假
	Content   string `json:"content"`
	ProblemId int    `json:"problem_id"`
	Problem   string `json:"problem"`

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

type Reports added in v0.8.15

type Reports []Report

type ReportsSpec added in v0.8.15

type ReportsSpec struct {
	UID    string     `json:"uid"`
	UIDs   []string   `json:"uids"`
	TeamID int        `json:"team_id"`
	Pager  *ListPager `json:"pager" valid:"required"`
	Sort   *ListSort  `json:"sort" valid:"required"` // weekly_report.id,work_group_id
}

ReportsSpec 查询周报参数

type SortField

type SortField struct {
	Field   string `json:"field" `
	Reverse bool   `json:"reverse" `
}

type Status

type Status int
const (
	WRNormal Status = iota
	WRVacation
	WRIgnore
)

type Store added in v0.10.3

type Store interface {
	// Get
	Get(id int) (*Report, error)
	// 查询
	All(spec ReportsSpec) (data Reports, total int, err error)
	// 添加
	Add(uid string, content string) error
	// 更新
	Update(id int, content string) error
	// 赞
	Applaud(id int, uid string) error
	// 统计
	Stat(start, end time.Time) (stat *ReportStatResponse, err error)
	// AllStatus
	StatusRecords(status Status) (data []*ReportUser, err error)
	// AddStatus
	AddStatus(uid string, status Status, year int, weeks ...int) error
	// RemoveStatus
	RemoveStatus(ids ...int) error
	// StatusRecordsWithUser
	StatusRecordsWithUser(status Status, uid string) (data []*ReportStat, err error)
}

Store 周报存取接口

Jump to

Keyboard shortcuts

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