// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.

package model

import (
	"time"
)

const TableNameKnowledgeUnit = "knowledge_unit"

// KnowledgeUnit mapped from table <knowledge_unit>
type KnowledgeUnit struct {
	ID          int64     `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键" json:"id"`   // 主键
	KnowledgeID int64     `gorm:"column:knowledge_id;not null;comment:知识库ID" json:"knowledge_id"` // 知识库ID
	Name        string    `gorm:"column:name;not null;comment:知识单元名称" json:"name"`                // 知识单元名称
	Type        string    `gorm:"column:type;not null;comment:知识单元类型(txt)" json:"type"`           // 知识单元类型(txt)
	Source      string    `gorm:"column:source;not null;comment:知识单元来源" json:"source"`            // 知识单元来源
	HitCounts   int32     `gorm:"column:hit_counts;not null;comment:命中次数" json:"hit_counts"`      // 命中次数
	Enable      bool      `gorm:"column:enable;not null;default:true;comment:是否启用" json:"enable"` // 是否启用
	CreatedAt   time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt   time.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP" json:"updated_at"`
}

// TableName KnowledgeUnit's table name
func (*KnowledgeUnit) TableName() string {
	return TableNameKnowledgeUnit
}
