| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- // Package models
- package models
- import "time"
- type Service struct {
- ID string `json:"id"`
- ExecutorID string `json:"executor_id"`
- Title string `json:"title"`
- Description *string `json:"description"`
- Price int `json:"price"`
- Currency string `json:"currency"`
- DurationMinutes *int `json:"duration_minutes"`
- Status string `json:"status"`
- Rating float64 `json:"rating"`
- ReviewsCount int `json:"reviews_count"`
- Tags []Tag `json:"tags"`
- PortfolioImages []ServiceImage `json:"portfolio_images,omitempty"`
- CreatedAt time.Time `json:"created_at"`
- UpdatedAt time.Time `json:"updated_at"`
- DeletedAt *time.Time `json:"-"`
- }
- type ServiceImage struct {
- ID string `json:"id"`
- ServiceID string `json:"service_id"`
- URL string `json:"url"`
- Alt string `json:"alt"`
- SortOrder int `json:"sort_order"`
- }
- type ServiceFilter struct {
- Tags []string
- MinRating float64
- PriceMin *int
- PriceMax *int
- Status string
- Limit_ int
- }
- func (f ServiceFilter) Limit() int {
- if f.Limit_ <= 0 || f.Limit_ > 100 {
- return 20
- }
- return f.Limit_
- }
|