Version:0.0.3.dev.260203
feat: ✨ 新增任务队列任务获取与创建接口 - 编写获取任务队列中任务的接口 - 编写新增任务接口 - 完成相关测试并验证通过 ✅
This commit is contained in:
36
backend/model/task.go
Normal file
36
backend/model/task.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type Task struct {
|
||||
ID int `gorm:"primaryKey;autoIncrement"`
|
||||
UserID int `gorm:"column:user_id;index"`
|
||||
Title string `gorm:"type:varchar(255)"`
|
||||
Priority int `gorm:"not null"`
|
||||
IsCompleted bool `gorm:"column:is_completed;default:false"`
|
||||
DeadlineAt time.Time `gorm:"column:deadline_at"`
|
||||
}
|
||||
|
||||
type UserAddTaskResponse struct {
|
||||
ID int `json:"id"`
|
||||
Title string `json:"title"`
|
||||
PriorityGroup int `json:"priority_group"`
|
||||
DeadlineAt time.Time `json:"deadline_at"`
|
||||
Status string `json:"status"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
type UserAddTaskRequest struct {
|
||||
Title string `json:"title"`
|
||||
PriorityGroup int `json:"priority_group"`
|
||||
DeadlineAt time.Time `json:"deadline_at"`
|
||||
}
|
||||
type GetUserTaskResp struct {
|
||||
ID int `json:"id"`
|
||||
UserID int `json:"user_id"`
|
||||
Title string `json:"title"`
|
||||
PriorityGroup int `json:"priority_group"`
|
||||
Status string `json:"status"`
|
||||
Deadline string `json:"deadline"`
|
||||
IsCompleted bool `json:"is_completed"`
|
||||
}
|
||||
Reference in New Issue
Block a user