Refactor ScrapePortalsResponse structure and update API documentation
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
- Changed the ScrapePortalsResponse type to return a slice of strings representing portal identifiers instead of a structured object. - Updated the Swagger documentation for the GetScrapePortals endpoint to reflect the new response format, ensuring clarity in API usage. This update simplifies the response structure for the scraping portals, enhancing the API's usability and consistency.
This commit is contained in:
@@ -83,7 +83,7 @@ func (h *Handler) ScrapeDocumentsBatch(c echo.Context) error {
|
||||
// @Description Retrieve the list of document scraping portals supported by the Opplens AI service
|
||||
// @Tags Admin-AI-Pipeline
|
||||
// @Produce json
|
||||
// @Success 200 {object} response.APIResponse{data=ai_summarizer.ScrapePortalsResponse} "Scrape portals retrieved successfully"
|
||||
// @Success 200 {object} response.APIResponse{data=[]string} "Scrape portals retrieved successfully"
|
||||
// @Failure 401 {object} response.APIResponse
|
||||
// @Failure 500 {object} response.APIResponse
|
||||
// @Failure 503 {object} response.APIResponse
|
||||
|
||||
@@ -173,18 +173,8 @@ type ScrapeDocumentsBatchRequest struct {
|
||||
Tenders []TenderRef `json:"tenders"`
|
||||
}
|
||||
|
||||
// ScrapePortal describes one document scraping portal supported by the AI service.
|
||||
type ScrapePortal struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
CountryCode string `json:"country_code,omitempty"`
|
||||
Countries []string `json:"countries,omitempty"`
|
||||
}
|
||||
|
||||
// ScrapePortalsResponse is returned by GET /scrape/portals.
|
||||
type ScrapePortalsResponse struct {
|
||||
Portals []ScrapePortal `json:"portals"`
|
||||
}
|
||||
// ScrapePortalsResponse is returned by GET /scrape/portals — portal identifiers.
|
||||
type ScrapePortalsResponse []string
|
||||
|
||||
// SummarizeBatchRequest is the payload for POST /ai/summarize/batch.
|
||||
type SummarizeBatchRequest struct {
|
||||
|
||||
Reference in New Issue
Block a user