Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ListPager ¶
type ListParam ¶
type ListParam struct { Uid string `json:"uid"` GroupId int `json:"group_id"` Pager *ListPager `json:"pager" valid:"required"` Sort *ListSort `json:"sort" valid:"required"` // weekly_report.id,work_group_id }
查询周报参数
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"` }
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 Team ¶
type Team struct { ID int64 `json:"id"` Name string `json:"name"` Leader string `json:"leader"` Members json.RawMessage `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:"group_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 TeamRoleType ¶
type TeamRoleType int
const ( RoleNothing TeamRoleType = iota RoleMember RoleManager )
type TeamStore ¶
type TeamStore interface { // Get 取一个 Get(id int) (*Team, error) // All 查询全部数据 All(role TeamRoleType) (data []*Team, err error) // Store 保存 Store(id int, name, leader string, members []string) 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 }
TeamStore interface of team storage
type WeeklyStore ¶
type WeeklyStore interface { // Get Get(id int) (*Report, error) // 查询 All(param ListParam) (data []*Report, 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) }
Click to show internal directories.
Click to hide internal directories.