This commit is contained in:
2023-08-05 15:12:20 -05:00
parent af416e2e73
commit 6f6872eaba
8 changed files with 166 additions and 45 deletions

View File

@@ -12,12 +12,12 @@ import (
// GetDadJoke godoc
//
// @Summary Get dadjoke
// @Description get a dad joke
// @Description get a dad joke
// @Tags DadJoke
// @Accept json
// @Produce application/json
// @Success 200 {object} model.Message "response"
// @failure 500 {object} model.Message "error"
// @failure 500 {object} model.Message "error"
// @Router /jokes/dadjoke [get]
func (c *Controller) GetDadJoke(ctx *gin.Context) {
joke, err := service.GetRandomDadJoke(c.Db.DB)
@@ -32,13 +32,13 @@ func (c *Controller) GetDadJoke(ctx *gin.Context) {
// PostDadJoke godoc
//
// @Summary Generate dadjoke
// @Description create a dad joke
// @Description create a dad joke
// @Tags DadJoke
// @Accept json
// @Produce application/json
// @Param joke query string true "Dad Joke you wish to enter into database"
// @Success 200 {object} model.Message "response"
// @failure 500 {object} model.Message "error"
// @Param joke query string true "Dad Joke you wish to enter into database"
// @Success 200 {object} model.Message "response"
// @failure 500 {object} model.Message "error"
// @Router /jokes/dadjoke [post]
func (c *Controller) PostDadJoke(ctx *gin.Context) {
var req model.DadJoke
@@ -58,13 +58,13 @@ func (c *Controller) PostDadJoke(ctx *gin.Context) {
// DeleteDadJoke godoc
//
// @Summary Generate dadjoke
// @Description create a dad joke
// @Description create a dad joke
// @Tags DadJoke
// @Accept json
// @Produce application/json
// @Param joke query string true "Dad joke you wish to delete from the database"
// @Success 200 {object} model.Message "response"
// @failure 500 {object} model.Message "error"
// @Param joke query string true "Dad joke you wish to delete from the database"
// @Success 200 {object} model.Message "response"
// @failure 500 {object} model.Message "error"
// @Router /jokes/dadjoke [delete]
func (c *Controller) DeleteDadJoke(ctx *gin.Context) {
var req model.DadJoke

View File

@@ -14,7 +14,7 @@ import (
// @Accept json
// @Produce application/json
// @Success 200 {object} model.Message "response"
// @failure 400 {object} model.Message "error"
// @failure 400 {object} model.Message "error"
// @Router /health/getHealth [get]
func (c *Controller) GetHealth(ctx *gin.Context) {
ctx.JSON(http.StatusOK, gin.H{"message": "OK"})

View File

@@ -20,10 +20,10 @@ type ChatRequest struct {
// @Tags openai
// @Accept json
// @Produce application/json
// @Param message query string true "Ask ChatGPT a general question"
// @Success 200 {object} model.Message "response"
// @Param message query string true "Ask ChatGPT a general question"
// @Success 200 {object} model.Message "response"
//
// @failure 400 {object} model.Message "error"
// @failure 400 {object} model.Message "error"
//
// @Router /openai/general [get]
func (c *Controller) GeneralOpenAI(ctx *gin.Context) {
@@ -51,9 +51,9 @@ func (c *Controller) GeneralOpenAI(ctx *gin.Context) {
// @Tags openai
// @Accept json
// @Produce application/json
// @Param message query string true "Ask ChatGPT for suggestions as a travel agent"
// @Success 200 {object} model.Message "response"
// @failure 400 {object} model.Message "error"
// @Param message query string true "Ask ChatGPT for suggestions as a travel agent"
// @Success 200 {object} model.Message "response"
// @failure 400 {object} model.Message "error"
// @Router /openai/travelagent [get]
func (c *Controller) TravelAgentOpenAI(ctx *gin.Context) {
var req ChatRequest

View File

@@ -19,7 +19,7 @@ import (
// @Accept json
// @Produce json
// @Success 200 {object} model.PowerSupply "response"
// @failure 412 {object} model.Message "error"
// @failure 412 {object} model.Message "error"
// @Router /unraid/powerusage [get]
func (c *Controller) UnraidPowerUsage(ctx *gin.Context) {
jar, err := cookiejar.New(nil)