Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 ReportStatParam ¶
周报统计参数
type ReportStatResponse ¶
type ReportStatResponse struct {
Commited []*ReportStat `json:"commited"`
All []*ReportUser `json:"all"`
Ignores []*ReportUser `json:"ignores"`
}
周报统计返回数据
type ReportUser ¶
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 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 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 周报存取接口
Click to show internal directories.
Click to hide internal directories.