refactor(backend): split project write responsibilities
This commit is contained in:
39
backend/internal/logic/tasks/dto.go
Normal file
39
backend/internal/logic/tasks/dto.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package tasks
|
||||
|
||||
import "time"
|
||||
|
||||
// TaskDTO 是任务写接口的稳定响应,所有关联 ID 都使用公开 identity。
|
||||
type TaskDTO struct {
|
||||
ID string `json:"id"`
|
||||
ProjectID string `json:"projectId"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Status string `json:"status"`
|
||||
Completed bool `json:"completed"`
|
||||
DueAt *time.Time `json:"dueAt"`
|
||||
AssigneeID *string `json:"assigneeId"`
|
||||
TagID *string `json:"tagId"`
|
||||
Tag string `json:"tag"`
|
||||
SourceInboxItemID *string `json:"sourceInboxItemId"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// CreateTaskInput 描述创建任务时允许写入的项目内字段。
|
||||
type CreateTaskInput struct {
|
||||
Title string
|
||||
Description string
|
||||
Status string
|
||||
DueAt *time.Time
|
||||
Tag string
|
||||
}
|
||||
|
||||
// UpdateTaskInput 使用目标项目 identity 表达移动,避免 API 接触内部自增 ID。
|
||||
type UpdateTaskInput struct {
|
||||
Title string
|
||||
Description string
|
||||
Status string
|
||||
Completed bool
|
||||
NextProjectIdentity string
|
||||
Tag string
|
||||
}
|
||||
Reference in New Issue
Block a user