新增: AI工单处理工作台 v1.0
- Go Gin 后端 (19个源文件): 认证、工单CRUD、GLM AI分析、状态流转、备注、操作日志 - Arco Design Vue 前端: 登录、工单列表/详情/创建、AI分析触发与确认 - MySQL 5表: ticket_user/ticket_info/ticket_ai_analysis/ticket_operation_log/ticket_note - 部署: tk.1216.top HTTPS, Nginx反代
This commit is contained in:
21
backend/internal/model/analysis.go
Normal file
21
backend/internal/model/analysis.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type TicketAiAnalysis struct {
|
||||
Analysisid int `gorm:"primaryKey;autoIncrement" json:"analysisid"`
|
||||
Ticketid int `gorm:"not null" json:"ticketid"`
|
||||
Category string `gorm:"size:32" json:"category"`
|
||||
Priority int16 `json:"priority"`
|
||||
Summary string `gorm:"type:text" json:"summary"`
|
||||
Suggestrole string `gorm:"size:64" json:"suggestrole"`
|
||||
Rawresponse string `gorm:"type:text" json:"rawresponse"`
|
||||
Confirmed int8 `gorm:"default:0" json:"confirmed"`
|
||||
Confirmedby *int `json:"confirmedby"`
|
||||
Confirmedat *time.Time `json:"confirmedat"`
|
||||
Createtime time.Time `json:"createtime"`
|
||||
}
|
||||
|
||||
func (TicketAiAnalysis) TableName() string {
|
||||
return "ticket_ai_analysis"
|
||||
}
|
||||
15
backend/internal/model/note.go
Normal file
15
backend/internal/model/note.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type TicketNote struct {
|
||||
Noteid int `gorm:"primaryKey;autoIncrement" json:"noteid"`
|
||||
Ticketid int `gorm:"not null" json:"ticketid"`
|
||||
Authorid int `json:"authorid"`
|
||||
Content string `gorm:"type:text;not null" json:"content"`
|
||||
Createtime time.Time `json:"createtime"`
|
||||
}
|
||||
|
||||
func (TicketNote) TableName() string {
|
||||
return "ticket_note"
|
||||
}
|
||||
16
backend/internal/model/operation_log.go
Normal file
16
backend/internal/model/operation_log.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type TicketOperationLog struct {
|
||||
Logid int `gorm:"primaryKey;autoIncrement" json:"logid"`
|
||||
Ticketid int `gorm:"not null" json:"ticketid"`
|
||||
Operatorid int `json:"operatorid"`
|
||||
Action string `gorm:"size:32;not null" json:"action"`
|
||||
Detail string `gorm:"type:text" json:"detail"`
|
||||
Createtime time.Time `json:"createtime"`
|
||||
}
|
||||
|
||||
func (TicketOperationLog) TableName() string {
|
||||
return "ticket_operation_log"
|
||||
}
|
||||
24
backend/internal/model/ticket.go
Normal file
24
backend/internal/model/ticket.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type TicketInfo struct {
|
||||
Ticketid int `gorm:"primaryKey;autoIncrement" json:"ticketid"`
|
||||
Ticketno string `gorm:"size:32;uniqueIndex" json:"ticketno"`
|
||||
Title string `gorm:"size:255;not null" json:"title"`
|
||||
Content string `gorm:"type:text" json:"content"`
|
||||
Contactname string `gorm:"size:64" json:"contactname"`
|
||||
Contactphone string `gorm:"size:20" json:"contactphone"`
|
||||
Source string `gorm:"size:20;default:web" json:"source"`
|
||||
Submitterid int `json:"submitterid"`
|
||||
Category string `gorm:"size:32" json:"category"`
|
||||
Priority int16 `gorm:"default:2" json:"priority"`
|
||||
Handlerid *int `json:"handlerid"`
|
||||
Status int16 `gorm:"default:0" json:"status"`
|
||||
Createtime time.Time `json:"createtime"`
|
||||
Updatetime time.Time `json:"updatetime"`
|
||||
}
|
||||
|
||||
func (TicketInfo) TableName() string {
|
||||
return "ticket_info"
|
||||
}
|
||||
19
backend/internal/model/user.go
Normal file
19
backend/internal/model/user.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type TicketUser struct {
|
||||
Userid int `gorm:"primaryKey;autoIncrement" json:"userid"`
|
||||
Username string `gorm:"size:64" json:"username"`
|
||||
Account string `gorm:"size:64;uniqueIndex" json:"account"`
|
||||
Password string `gorm:"size:64" json:"-"`
|
||||
Role int16 `gorm:"default:20" json:"role"`
|
||||
Team string `gorm:"size:32" json:"team"`
|
||||
Status int16 `gorm:"default:1" json:"status"`
|
||||
Createtime time.Time `json:"createtime"`
|
||||
Updatetime time.Time `json:"updatetime"`
|
||||
}
|
||||
|
||||
func (TicketUser) TableName() string {
|
||||
return "ticket_user"
|
||||
}
|
||||
Reference in New Issue
Block a user