Added imagekit optimization support
This commit is contained in:
@@ -16,9 +16,14 @@ func InitApiEndpointHandler() {
|
||||
ApiEndpointHandlerInstance = &ApiEndpointHandler{
|
||||
PostService: *services.PostServiceInstance,
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
func (ps *ApiEndpointHandler) GetRandomPost(c *gin.Context) {
|
||||
c.JSON(200,ps.PostService.GetRandomPost())
|
||||
}
|
||||
post := ps.PostService.GetRandomPost()
|
||||
for _, attachment := range post.Attachments {
|
||||
attachment.RemoteUrl = services.GetRemoteUrl(attachment.RemoteUrl)
|
||||
attachment.PreviewUrl = services.GetPreviewUrl(attachment.RemoteUrl)
|
||||
}
|
||||
c.JSON(200, post)
|
||||
}
|
||||
|
Reference in New Issue
Block a user