Files
xingrin/go-backend/internal/dto/directory.go
yyhuni e542633ad3 refactor(backend): consolidate migration files and restructure host port entities
- 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
2026-01-14 18:04:16 +08:00

51 lines
1.6 KiB
Go

package dto
import "time"
// DirectoryListQuery represents directory list query parameters
type DirectoryListQuery struct {
PaginationQuery
Filter string `form:"filter"`
}
// DirectoryResponse represents directory response
type DirectoryResponse struct {
ID int `json:"id"`
TargetID int `json:"targetId"`
URL string `json:"url"`
Status *int `json:"status"`
ContentLength *int `json:"contentLength"`
ContentType string `json:"contentType"`
Duration *int `json:"duration"`
CreatedAt time.Time `json:"createdAt"`
}
// BulkCreateDirectoriesRequest represents bulk create directories request
type BulkCreateDirectoriesRequest struct {
URLs []string `json:"urls" binding:"required,min=1,max=5000"`
}
// BulkCreateDirectoriesResponse represents bulk create directories response
type BulkCreateDirectoriesResponse struct {
CreatedCount int `json:"createdCount"`
}
// DirectoryUpsertItem represents a single directory for bulk upsert
type DirectoryUpsertItem struct {
URL string `json:"url" binding:"required,url"`
Status *int `json:"status"`
ContentLength *int `json:"contentLength"`
ContentType string `json:"contentType"`
Duration *int `json:"duration"`
}
// BulkUpsertDirectoriesRequest represents bulk upsert directories request
type BulkUpsertDirectoriesRequest struct {
Directories []DirectoryUpsertItem `json:"directories" binding:"required,min=1,max=5000,dive"`
}
// BulkUpsertDirectoriesResponse represents bulk upsert directories response
type BulkUpsertDirectoriesResponse struct {
AffectedCount int64 `json:"affectedCount"`
}