90a96b4125
- Remove api_es service, Dockerfile, all Go source files - Remove api_es from docker-compose.yml, nginx-ssl.conf, .env, Makefile - Replace nginx /api/ proxy with /api/v1/ → api_yal:8787 - Add amenity/upload domains, AuthResponse, GET /auth/me, GET /objects/my to api_yal - Rewrite easysite frontend: types, composables, and all 5 pages to use api_yal DTOs - Wire nuxt.config public.apiBase, add useObjects CRUD composable - Update docs references from api_es to api_yal
36 lines
901 B
Go
36 lines
901 B
Go
package amenity
|
|
|
|
import "api_yal/internal/models"
|
|
|
|
type CreateAmenityRequest struct {
|
|
Name string `json:"name" validate:"required"`
|
|
Category string `json:"category"`
|
|
Icon string `json:"icon"`
|
|
Description string `json:"description"`
|
|
}
|
|
|
|
type UpdateAmenityRequest struct {
|
|
Name *string `json:"name"`
|
|
Category *string `json:"category"`
|
|
Icon *string `json:"icon"`
|
|
Description *string `json:"description"`
|
|
}
|
|
|
|
type AmenityResponse struct {
|
|
ID uint `json:"id"`
|
|
Name string `json:"name"`
|
|
Category string `json:"category,omitempty"`
|
|
Icon string `json:"icon,omitempty"`
|
|
Description string `json:"description,omitempty"`
|
|
}
|
|
|
|
func ToAmenityResponse(a *models.Amenity) AmenityResponse {
|
|
return AmenityResponse{
|
|
ID: a.ID,
|
|
Name: a.Name,
|
|
Category: a.Category,
|
|
Icon: a.Icon,
|
|
Description: a.Description,
|
|
}
|
|
}
|