shanshanzhong ac3bbaf7bf feat(ticket): 添加issue_type字段支持工单分类
在工单系统中新增issue_type字段用于区分工单类型(0-普通工单,1-提现工单)
修改相关API、模型和逻辑以支持该字段的创建、查询和筛选
2025-09-15 01:42:44 -07:00

39 lines
1.3 KiB
Go

package ticket
import "time"
const (
Pending = 1 // Pending # Pending follow up
Waiting = 2 // Waiting # Waiting for user response
Processed = 3 // Processed
Closed = 4 // Closed
)
type Ticket struct {
Id int64 `gorm:"primaryKey"`
Title string `gorm:"type:varchar(255);not null;default:'';comment:Title"`
Description string `gorm:"type:longtext;comment:Description"`
UserId int64 `gorm:"type:bigint;not null;default:0;comment:UserId"`
Status uint8 `gorm:"type:tinyint(1);not null;default:1;comment:Status"`
IssueType uint8 `gorm:"type:tinyint(1);not null;default:0;comment:Issue Type: 0 ticket, 1 withdraw"`
CreatedAt time.Time `gorm:"<-:create;comment:Create Time"`
UpdatedAt time.Time `gorm:"comment:Update Time"`
}
func (Ticket) TableName() string {
return "ticket"
}
type Follow struct {
Id int64 `gorm:"primaryKey"`
TicketId int64 `gorm:"type:bigint;not null;default:0;comment:TicketId"`
From string `gorm:"type:varchar(255);not null;default:'';comment:From"`
Type uint8 `gorm:"type:tinyint(1);not null;default:1;comment:Type: 1 text, 2 image"`
Content string `gorm:"type:text;comment:Content"`
CreatedAt time.Time `gorm:"<-:create;comment:Create Time"`
}
func (Follow) TableName() string {
return "ticket_follow"
}