package models import ( "gorm.io/gorm" "time" ) // UserFeedback 用户反馈模型 type UserFeedback struct { ID int64 `gorm:"primaryKey;autoIncrement" json:"id"` UID uint64 `gorm:"column:uid;not null;index;comment:用户ID" json:"user_id"` Content string `gorm:"type:text;not null;comment:反馈内容" json:"content"` FileKeys string `gorm:"column:file_keys;type:json;not null;comment:关联文件Key列表" json:"file_keys"` Status int `gorm:"default:0;comment:0未处理 1已处理" json:"status"` HandledBy *int `gorm:"column:handled_by;comment:处理人" json:"handled_by"` HandledAt *time.Time `gorm:"column:handled_at;comment:处理时间" json:"handled_at"` CreatedAt time.Time `gorm:"column:created_at;autoCreateTime" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime" json:"updated_at"` DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index" json:"-"` } // TableName 指定数据库表名 func (UserFeedback) TableName() string { return "m_problem_feedbacks" } // UserFeedbackListRequest 用户反馈列表请求 type UserFeedbackListRequest struct { Page int `json:"page" form:"page" binding:"min=1"` PageSize int `json:"page_size" form:"page_size" binding:"min=1,max=100"` Status *int `json:"status" form:"status"` UserID *int `json:"user_id" form:"user_id"` Keyword string `json:"keyword" form:"keyword"` StartTime string `json:"start_time" form:"start_time"` EndTime string `json:"end_time" form:"end_time"` } // UserFeedbackListResponse 用户反馈列表响应 type UserFeedbackListResponse struct { List []UserFeedbackItem `json:"list"` Total int64 `json:"total"` Page int `json:"page"` PageSize int `json:"page_size"` } // UserFeedbackItem 列表项(扩展返回可访问URL) type UserFeedbackItem struct { ID int64 `json:"id"` UserID uint64 `json:"user_id"` Content string `json:"content"` FileKeys []string `json:"file_keys"` FileContents []string `json:"file_contents"` // Base64编码的图片内容 Status int `json:"status"` HandledBy *int `json:"handled_by"` HandledAt *time.Time `json:"handled_at"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } // UserFeedbackMarkRequest 标记处理请求 type UserFeedbackMarkRequest struct { Note string `json:"note" form:"note"` }