20 lines
440 B
Go
20 lines
440 B
Go
package handlers_api
|
|
|
|
import (
|
|
"CatsOfMastodonBotGo/internal"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type ApiEndpointHandler struct {
|
|
AppContext *internal.AppContext
|
|
}
|
|
|
|
func NewApiEndpointHandler(appContext *internal.AppContext) *ApiEndpointHandler {
|
|
return &ApiEndpointHandler{
|
|
AppContext: appContext,
|
|
}
|
|
}
|
|
|
|
func (appContext *ApiEndpointHandler) GetRandomPost(c *gin.Context) {
|
|
c.JSON(200,appContext.AppContext.PostService.GetRandomPost())
|
|
} |