feat: CI/CD pipeline + Learning/Medicine/Travel services
- Add Gitea Actions workflow for automated build & deploy - Add K8s manifests: webui, travel-svc, medicine-svc, sandbox-svc - Update kustomization for localhost:5000 registry - Add ingress for gooseek.ru and api.gooseek.ru - Learning cabinet with onboarding, courses, sandbox integration - Medicine service with symptom analysis and doctor matching - Travel service with itinerary planning - Server setup scripts (NVIDIA/CUDA, K3s, Gitea runner) Made-with: Cursor
This commit is contained in:
@@ -121,6 +121,7 @@ func main() {
|
||||
api.Get("/poi", middleware.JWT(jwtOptional), handleSearchPOI(svc))
|
||||
api.Post("/poi", middleware.JWT(jwtOptional), handleSearchPOIPost(svc))
|
||||
api.Post("/places", middleware.JWT(jwtOptional), handleSearchPlaces(svc))
|
||||
api.Post("/validate-itinerary", middleware.JWT(jwtOptional), handleValidateItinerary(svc))
|
||||
|
||||
port := getEnvInt("PORT", 3035)
|
||||
log.Printf("travel-svc listening on :%d", port)
|
||||
@@ -522,6 +523,28 @@ func handleSearchPlaces(svc *travel.Service) fiber.Handler {
|
||||
}
|
||||
}
|
||||
|
||||
func handleValidateItinerary(svc *travel.Service) fiber.Handler {
|
||||
return func(c *fiber.Ctx) error {
|
||||
var req travel.ValidateItineraryRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return c.Status(400).JSON(fiber.Map{"error": "Invalid request body"})
|
||||
}
|
||||
if len(req.Days) == 0 {
|
||||
return c.Status(400).JSON(fiber.Map{"error": "days required"})
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(c.Context(), 30*time.Second)
|
||||
defer cancel()
|
||||
|
||||
result, err := svc.ValidateItinerary(ctx, req)
|
||||
if err != nil {
|
||||
return c.Status(500).JSON(fiber.Map{"error": err.Error()})
|
||||
}
|
||||
|
||||
return c.JSON(result)
|
||||
}
|
||||
}
|
||||
|
||||
func getEnv(key, defaultValue string) string {
|
||||
if val := os.Getenv(key); val != "" {
|
||||
return val
|
||||
|
||||
Reference in New Issue
Block a user