This commit is contained in:
2023-06-23 12:21:35 -04:00
parent 612feee721
commit b01b26b12d
13 changed files with 290 additions and 144 deletions

33
controller/dadjoke.go Normal file
View File

@@ -0,0 +1,33 @@
package controller
import (
"net/http"
"github.com/gin-gonic/gin"
"gitlab.com/DeveloperDurp/DurpAPI/model"
)
// GetDadJoke godoc
//
// @Summary Generate dadjoke
// @Description get a dad joke
// @Tags DadJoke
// @Accept json
// @Produce application/json
// @Success 200 {object} model.Message "response"
// @failure 400 {object} model.Message "error"
// @Router /jokes/dadjoke [get]
func (c *Controller) GetDadJoke(ctx *gin.Context) {
var req model.DadJoke
if err := ctx.ShouldBindJSON(&req); err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{"message": err})
}
message := "test"
// message, err := service.GetDadJoke(req)
// if err != nil {
// ctx.JSON(http.StatusInternalServerError, gin.H{"message": err})
// }
ctx.JSON(http.StatusOK, gin.H{"message": message})
}