Skip to content

Commit 8a95e0f

Browse files
add search swagger
1 parent 411dd83 commit 8a95e0f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

internal/handlers/location.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@ func NewLocationHandler(locationService *services.LocationService, locationCache
2525
}
2626
}
2727

28+
// @Summary Search locations
29+
// @Description Search for Turkish cities and districts with autocomplete
30+
// @Tags Locations
31+
// @Produce json
32+
// @Param q query string true "Search query (minimum 1 character)"
33+
// @Param type query string false "Search type" Enums(city, district, all) default(all)
34+
// @Param limit query int false "Maximum results to return" default(10)
35+
// @Success 200 {object} map[string]interface{} "Search results"
36+
// @Failure 400 {object} map[string]string "Bad request"
37+
// @Failure 500 {object} map[string]string "Internal server error"
38+
// @Router /api/v1/locations/search [get]
2839
func (h *LocationHandler) SearchLocations(c *gin.Context) {
2940
var req models.LocationSearchRequest
3041
if err := c.ShouldBindQuery(&req); err != nil {

0 commit comments

Comments
 (0)