Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmd/api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/acmcsufoss/api.acmcsuf.com/internal/api/services"
"github.com/acmcsufoss/api.acmcsuf.com/internal/db"
"github.com/acmcsufoss/api.acmcsuf.com/internal/db/models"
"github.com/acmcsufoss/api.acmcsuf.com/utils"
"github.com/gin-gonic/gin"
_ "modernc.org/sqlite"

Expand Down Expand Up @@ -64,11 +65,11 @@ func main() {

// Setup swagger
docs.SwaggerInfo.Title = "ACM CSUF API"
docs.SwaggerInfo.Description = "This is a documentation of current API available."
docs.SwaggerInfo.Version = "1.0"
docs.SwaggerInfo.Host = "localhost:8080"
docs.SwaggerInfo.BasePath = "/"
docs.SwaggerInfo.Schemes = []string{"http", "https"}
docs.SwaggerInfo.Description = utils.SwaggerDescription
router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))

port := os.Getenv("PORT")
Expand Down
109 changes: 109 additions & 0 deletions utils/swagger_helper.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
package utils

// giant bara description, and by bara I mean capybara

// Description for swagger documentation.
var SwaggerDescription string = "This is a documentation of the **acmcsuf API**.\n\n" +
"---\n" +
"# **acmcsuf-cli**\n" +
"The command line interface tools provide a quick and easy way to test out the currently implemented routes.\n\n" +
"## **csuf events [command]**\n" +
"Use this command to interact with event-related features.\n\n" +
"<h3>Available Commands</h3>\n" +
"<ul>\n" +
" <li><strong>create</strong> – Create a new event</li>\n" +
" <li><strong>delete</strong> – Delete an event by ID</li>\n" +
" <li><strong>list</strong> – List all events</li>\n" +
" <li><strong>update</strong> – Update an event by ID</li>\n" +
"</ul>\n\n" +
"<h3>Flags</h3>\n" +
"<ul>\n" +
" <li><code>-h</code>, <code>--help</code> – Show help for events</li>\n" +
"</ul>\n\n" +
"<h3>Available Commands & Flags</h3>\n" +
"<ul>\n" +
" <li><strong>post</strong> – Post a new event\n" +
" <ul>\n" +
" <li><code>-d, --duration &lt;string&gt;</code> – Duration (03:04:05)</li>\n" +
" <li><code>-H, --host &lt;string&gt;</code> – Host</li>\n" +
" <li><code>-a, --isallday</code> – All-day event</li>\n" +
" <li><code>-l, --location &lt;string&gt;</code> – Location</li>\n" +
" <li><code>--port &lt;string&gt;</code> – Port (default 8080)</li>\n" +
" <li><code>-s, --startat &lt;string&gt;</code> – Start time</li>\n" +
" <li><code>--urlhost &lt;string&gt;</code> – URL host (default 127.0.0.1)</li>\n" +
" <li><code>-u, --uuid &lt;string&gt;</code> – UUID</li>\n" +
" </ul>\n" +
" </li>\n" +
" <li><strong>get</strong> – Get events\n" +
" <ul>\n" +
" <li><code>--host &lt;string&gt;</code> – Host (default 127.0.0.1)</li>\n" +
" <li><code>--id &lt;string&gt;</code> – Specific event ID</li>\n" +
" <li><code>--port &lt;string&gt;</code> – Port (default 8080)</li>\n" +
" </ul>\n" +
" </li>\n" +
" <li><strong>put</strong> – Update an event\n" +
" <ul>\n" +
" <li><code>--id &lt;string&gt;</code> – <strong>[REQUIRED]</strong> Event ID to update</li>\n" +
" <li><code>-d, --duration &lt;string&gt;</code> – End time</li>\n" +
" <li><code>-H, --host &lt;string&gt;</code> – Host</li>\n" +
" <li><code>-a, --isallday</code> – All-day event</li>\n" +
" <li><code>-l, --location &lt;string&gt;</code> – Location</li>\n" +
" <li><code>--port &lt;string&gt;</code> – Port (default 8080)</li>\n" +
" <li><code>-s, --startat &lt;string&gt;</code> – Start time</li>\n" +
" <li><code>--urlhost &lt;string&gt;</code> – URL host (default 127.0.0.1)</li>\n" +
" <li><code>-u, --uuid &lt;string&gt;</code> – UUID</li>\n" +
" </ul>\n" +
" </li>\n" +
" <li><strong>delete</strong> – Delete an event\n" +
" <ul>\n" +
" <li><code>--id &lt;string&gt;</code> – <strong>[REQUIRED]</strong> Event ID</li>\n" +
" <li><code>--host &lt;string&gt;</code> – Host (default 127.0.0.1)</li>\n" +
" <li><code>--port &lt;string&gt;</code> – Port (default 8080)</li>\n" +
" </ul>\n" +
" </li>\n" +
"</ul>\n" +
"<p><code>-h, --help</code> – Show help for events</p>\n\n" +
"---\n" +
"<h2><strong>csuf announcements [command]</strong></h2>\n" +
"<p>Manage ACM CSUF's announcements through the CLI. Use <code>csuf announcements [command] --help</code> for more info on a specific command.</p>\n\n" +
"<h3>Available Commands & Flags</h3>\n" +
"<ul>\n" +
" <li><strong>post</strong> – Post a new announcement\n" +
" <ul>\n" +
" <li><code>-a, --announceat &lt;string&gt;</code> – Set this announcement's announce at</li>\n" +
" <li><code>-c, --channelid &lt;string&gt;</code> – Set this announcement's channel id</li>\n" +
" <li><code>--host &lt;string&gt;</code> – Custom host (default \"127.0.0.1\")</li>\n" +
" <li><code>-m, --messageid &lt;string&gt;</code> – Set this announcement's message id</li>\n" +
" <li><code>--port &lt;string&gt;</code> – Custom port (default \"8080\")</li>\n" +
" <li><code>--uuid &lt;string&gt;</code> – Set this announcement's id</li>\n" +
" <li><code>-v, --visibility &lt;string&gt;</code> – Set this announcement's visibility</li>\n" +
" </ul>\n" +
" </li>\n" +
" <li><strong>get</strong> – Get an announcement\n" +
" <ul>\n" +
" <li><code>--host &lt;string&gt;</code> – Custom host (default \"127.0.0.1\")</li>\n" +
" <li><code>--id &lt;string&gt;</code> – Get a specific announcement by its id</li>\n" +
" <li><code>--port &lt;string&gt;</code> – Custom port (default \"8080\")</li>\n" +
" </ul>\n" +
" </li>\n" +
" <li><strong>put</strong> – Update an existing announcement by its id\n" +
" <ul>\n" +
" <li><code>--id &lt;string&gt;</code> – <strong>[REQUIRED]</strong> Announcement id to update</li>\n" +
" <li><code>-a, --announceat &lt;string&gt;</code> – Change this announcement's announce at</li>\n" +
" <li><code>-c, --channelid &lt;string&gt;</code> – Change this announcement's discord channel id</li>\n" +
" <li><code>--host &lt;string&gt;</code> – Custom host (default \"127.0.0.1\")</li>\n" +
" <li><code>-m, --messageid &lt;string&gt;</code> – Change this announcement's discord message id</li>\n" +
" <li><code>--port &lt;string&gt;</code> – Custom port (default \"8080\")</li>\n" +
" <li><code>--uuid &lt;string&gt;</code> – Change this announcement's uuid</li>\n" +
" <li><code>-v, --visibility &lt;string&gt;</code> – Change this announcement's visibility</li>\n" +
" </ul>\n" +
" </li>\n" +
" <li><strong>delete</strong> – Delete an announcement\n" +
" <ul>\n" +
" <li><code>--id &lt;string&gt;</code> – <strong>[REQUIRED]</strong> Delete an announcement by its id</li>\n" +
" <li><code>--host &lt;string&gt;</code> – Custom host (default \"127.0.0.1\")</li>\n" +
" <li><code>--port &lt;string&gt;</code> – Custom port (default \"8080\")</li>\n" +
" </ul>\n" +
" </li>\n" +
"</ul>\n" +
"<p><code>-h, --help</code> – Show help for announcements</p>"
Loading