some fix
This commit is contained in:
parent
61b976259a
commit
d6387c3528
9 changed files with 69 additions and 81 deletions
44
handlers/status/get.go
Normal file
44
handlers/status/get.go
Normal file
|
@ -0,0 +1,44 @@
|
|||
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)
|
||||
*/
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue