mirror of
https://github.com/yyhuni/xingrin.git
synced 2026-01-31 11:46:16 +08:00
- Remove seed data generation command (cmd/seed/main.go) - Consolidate database migrations into single init schema file - Rename ip_address DTO to host_port for consistency - Add host_port_snapshot DTO and model for snapshot tracking - Rename host_port handler and repository files for clarity - Implement host_port_snapshot service layer with CRUD operations - Update website_snapshot service to work with new host_port structure - Enhance terminal login UI with focus state tracking and Tab key navigation - Update docker-compose configuration for development environment - Refactor directory and website snapshot DTOs for improved data structure - Add comprehensive test coverage for model and handler changes - Simplify database schema by consolidating related migrations into single initialization file
26 lines
1.1 KiB
Go
26 lines
1.1 KiB
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// Directory represents a directory asset
|
|
type Directory struct {
|
|
ID int `gorm:"primaryKey;autoIncrement" json:"id"`
|
|
TargetID int `gorm:"column:target_id;not null;index:idx_directory_target;uniqueIndex:unique_directory_url_target,priority:1" json:"targetId"`
|
|
URL string `gorm:"column:url;size:2000;not null;index:idx_directory_url;uniqueIndex:unique_directory_url_target,priority:2" json:"url"`
|
|
Status *int `gorm:"column:status;index:idx_directory_status" json:"status"`
|
|
ContentLength *int `gorm:"column:content_length" json:"contentLength"`
|
|
ContentType string `gorm:"column:content_type;size:200" json:"contentType"`
|
|
Duration *int `gorm:"column:duration" json:"duration"`
|
|
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime;index:idx_directory_created_at" json:"createdAt"`
|
|
|
|
// Relationships
|
|
Target *Target `gorm:"foreignKey:TargetID" json:"target,omitempty"`
|
|
}
|
|
|
|
// TableName returns the table name for Directory
|
|
func (Directory) TableName() string {
|
|
return "directory"
|
|
}
|