service

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Unlicense Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompleteTaskWithTimelog

func CompleteTaskWithTimelog(taskID uint, createTimelog bool, timelogData *model.TimeLog) error

CompleteTaskWithTimelog 完成任务并创建时间记录 这是一个组合操作,将任务标记为完成,并可选地创建关联的时间记录

func CreateConstraint

func CreateConstraint(constraint *model.Constraint) error

CreateConstraint 创建约束

func CreateTag

func CreateTag(tag *model.Tag) error

CreateTag 新增一个标签

func CreateTask

func CreateTask(task *model.Task) error

CreateTask 创建任务

func CreateTimeLog

func CreateTimeLog(tl *model.TimeLog) error

CreateTimeLog 新增一条时间日志

func DeleteConstraint

func DeleteConstraint(id uint) error

DeleteConstraint 删除约束

func DeleteTag

func DeleteTag(id uint) error

DeleteTag 删除一个标签

func DeleteTask

func DeleteTask(id uint) error

DeleteTask 删除任务

func DeleteTimeLog

func DeleteTimeLog(id uint) error

DeleteTimeLog 删除一条时间日志

func GetActiveConstraints

func GetActiveConstraints() ([]model.Constraint, error)

GetActiveConstraints 获取活跃的约束

func GetAllConstraints

func GetAllConstraints() ([]model.Constraint, error)

GetAllConstraints 获取所有约束

func GetAllTasks

func GetAllTasks(includeSuspended bool, includeCompleted bool) ([]model.Task, error)

GetAllTasks 获取所有任务 includeSuspended: 是否包含暂停的任务 includeCompleted: 是否包含已完成的任务

func GetCompletedTasksInDateRange

func GetCompletedTasksInDateRange(startDate, endDate time.Time) ([]model.Task, error)

GetCompletedTasksInDateRange 获取指定日期范围内的已完成任务

func GetConstraintByID

func GetConstraintByID(id uint) (*model.Constraint, error)

GetConstraintByID 根据ID获取约束

func GetConstraintsByDateRange

func GetConstraintsByDateRange(startDate, endDate time.Time) ([]model.Constraint, error)

GetConstraintsByDateRange 根据日期范围获取约束

func GetTagByID

func GetTagByID(id uint) (*model.Tag, error)

GetTagByID 根据ID获取标签

func GetTagByName

func GetTagByName(name string) (*model.Tag, error)

GetTagByName 根据名称获取标签

func GetTaskByID

func GetTaskByID(id uint) (*model.Task, error)

GetTaskByID 根据ID获取任务

func GetTaskStats

func GetTaskStats(date time.Time) (map[string]interface{}, error)

GetTaskStats 获取任务统计信息

func GetTasksByDate

func GetTasksByDate(date time.Time, includeSuspended bool, includeCompleted bool) ([]model.Task, error)

GetTasksByDate 根据日期获取任务 includeSuspended: 是否包含暂停的任务 includeCompleted: 是否包含已完成的任务

func GetTasksByDateRange

func GetTasksByDateRange(startDate, endDate time.Time) ([]model.Task, error)

GetTasksByDateRange 根据日期范围获取任务

func GetTimeLogByID

func GetTimeLogByID(id uint) (*model.TimeLog, error)

GetTimeLogByID 根据ID获取时间日志

func InitService

func InitService(loggerInstance logger.Logger, config *config.Config)

func ListTags

func ListTags(conds ...interface{}) ([]model.Tag, error)

ListTags 查询标签列表

func ListTimeLogs

func ListTimeLogs(conds ...interface{}) ([]model.TimeLog, error)

ListTimeLogs 查询时间日志(可扩展条件)

func ListTimeLogsWithOptions

func ListTimeLogsWithOptions(limit int, orderBy string, conds ...interface{}) ([]model.TimeLog, error)

ListTimeLogsWithOptions 查询时间日志(支持排序和限制)

func MarkConstraintAsActive

func MarkConstraintAsActive(constraintID uint) error

MarkConstraintAsActive 重新激活约束

func MarkConstraintAsCompleted

func MarkConstraintAsCompleted(constraintID uint, endReason string) error

MarkConstraintAsCompleted 标记约束为完成

func MarkTaskAsCompleted

func MarkTaskAsCompleted(taskID uint) error

MarkTaskAsCompleted 标记任务为完成

func MarkTaskAsIncomplete

func MarkTaskAsIncomplete(taskID uint) error

MarkTaskAsIncomplete 标记任务为未完成

func SuspendTask

func SuspendTask(taskID uint) error

SuspendTask 暂停任务

func UnsuspendTask

func UnsuspendTask(taskID uint) error

UnsuspendTask 取消暂停任务

func UpdateConstraint

func UpdateConstraint(constraint *model.Constraint) error

UpdateConstraint 更新约束

func UpdateTag

func UpdateTag(tag *model.Tag) error

UpdateTag 更新一个标签

func UpdateTask

func UpdateTask(task *model.Task) error

UpdateTask 更新任务

func UpdateTimeLog

func UpdateTimeLog(tl *model.TimeLog) error

UpdateTimeLog 更新一条时间日志

Types

type Pages

type Pages struct {
	Page  int `form:"page" json:"page"`
	Size  int `form:"size" json:"size"`
	Total int `form:"total" json:"total"`
}

type Response

type Response struct {
	Items []any `json:"items"`
	Pages
}

Jump to

Keyboard shortcuts

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