-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Loïc Knuchel
committed
Jan 7, 2024
1 parent
1fe10d0
commit 4959d6e
Showing
11 changed files
with
430 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 0 additions & 39 deletions
39
backend/lib/azimutt_web/controllers/api/gallery_controller.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,9 @@ | ||
defmodule AzimuttWeb.Api.GalleryController do | ||
use AzimuttWeb, :controller | ||
use PhoenixSwagger | ||
alias Azimutt.Gallery | ||
action_fallback AzimuttWeb.Api.FallbackController | ||
|
||
swagger_path :index do | ||
get("/gallery") | ||
summary("List sample projects") | ||
description("List sample projects") | ||
produces("application/json") | ||
tag("Samples") | ||
|
||
response(200, "OK", Schema.ref(:Samples)) | ||
response(400, "Client Error") | ||
end | ||
|
||
def index(conn, _params) do | ||
conn |> render("index.json", samples: Gallery.list_samples()) | ||
end | ||
|
||
def swagger_definitions do | ||
%{ | ||
Sample: | ||
swagger_schema do | ||
title("Sample") | ||
description("A Sample project") | ||
|
||
properties do | ||
slug(:string, "Sample slug", required: true) | ||
color(:string, "Sample color", required: true) | ||
icon(:string, "Sample icon", required: true) | ||
name(:string, "Project name", required: true) | ||
description(:string, "Project description", required: true) | ||
project_id(:string, "Project id", required: true) | ||
nb_tables(:integer, "Nb project tables", required: true) | ||
end | ||
end, | ||
Samples: | ||
swagger_schema do | ||
title("Samples") | ||
description("A collection of Samples") | ||
type(:array) | ||
items(Schema.ref(:Sample)) | ||
end | ||
} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.