subhub/handlers/status/get.go
2019-09-19 10:14:22 +03:00

45 lines
1.0 KiB
Go

package status
import (
"github.com/gin-gonic/gin"
_ "github.com/gorilla/mux"
)
// Get returns a Note
//
// Expects a `{statusid}` url variable
// in the route: `/status/{statusid}`
func Get(c *gin.Context) {
/*
statusId := c.Param("statusid")
if statusId == "" {
c.String(http.StatusInternalServerError, "Bad request, no status id in url")
return
}
// Attempt to grab the Activity
status, err := models.GetActivity(data.GetDB(), statusId)
// 500 because something went wrong with the database
if err != nil {
c.String(http.StatusInternalServerError, err.Error())
return
}
// 404 because something we couldn't find the status
if status == nil {
c.String(http.StatusNotFound, statusId+" does not exist on this server")
return
}
// Convert to an ActivityPub object
url, err := url.Parse(handlers.GetFullHostName() + "/status/" + statusId)
o := activitypub.NewAnounceObject()
activity := activitypub.NewCreateActivity(0)
c.JSON(http.StatusOK, activity)
//w.Write(bytes)
*/
}