Files
gochat/internal/canned/model.go
T
2026-06-04 15:44:48 +08:00

18 lines
721 B
Go

package canned
import (
"github.com/gochat/gochat/internal/model"
)
// CannedResponse represents a pre-written message template for quick replies.
// Reference: Chatwoot CannedResponse model — account_id, content (text),
// short_code (string, unique scope account_id).
// Has order_by_search scope that ranks by short_code match then content match.
type CannedResponse struct {
model.Base
AccountID uint `gorm:"index;not null;uniqueIndex:idx_canned_short_code" json:"account_id"`
Content string `gorm:"type:text;not null" json:"content"`
ShortCode string `gorm:"size:255;not null;uniqueIndex:idx_canned_short_code" json:"short_code"`
}
func (CannedResponse) TableName() string { return "canned_responses" }