mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-18 10:27:30 -06:00
phew
This commit is contained in:
parent
82437a768b
commit
ba84852d3e
19 changed files with 999 additions and 262 deletions
|
|
@ -21,7 +21,9 @@ package status
|
|||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/apimodule"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
|
|
@ -77,7 +79,7 @@ func New(config *config.Config, db db.DB, oauthServer oauth.Server, mediaHandler
|
|||
// Route attaches all routes from this module to the given router
|
||||
func (m *statusModule) Route(r router.Router) error {
|
||||
r.AttachHandler(http.MethodPost, basePath, m.statusCreatePOSTHandler)
|
||||
// r.AttachHandler(http.MethodGet, basePathWithID, m.muxHandler)
|
||||
r.AttachHandler(http.MethodGet, basePathWithID, m.muxHandler)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -89,6 +91,10 @@ func (m *statusModule) CreateTables(db db.DB) error {
|
|||
>smodel.Follow{},
|
||||
>smodel.FollowRequest{},
|
||||
>smodel.Status{},
|
||||
>smodel.StatusFave{},
|
||||
>smodel.StatusBookmark{},
|
||||
>smodel.StatusMute{},
|
||||
>smodel.StatusPin{},
|
||||
>smodel.Application{},
|
||||
>smodel.EmailDomainBlock{},
|
||||
>smodel.MediaAttachment{},
|
||||
|
|
@ -105,13 +111,14 @@ func (m *statusModule) CreateTables(db db.DB) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// func (m *statusModule) muxHandler(c *gin.Context) {
|
||||
// ru := c.Request.RequestURI
|
||||
// if strings.HasPrefix(ru, verifyPath) {
|
||||
// m.accountVerifyGETHandler(c)
|
||||
// } else if strings.HasPrefix(ru, updateCredentialsPath) {
|
||||
// m.accountUpdateCredentialsPATCHHandler(c)
|
||||
// } else {
|
||||
// m.accountGETHandler(c)
|
||||
// }
|
||||
// }
|
||||
func (m *statusModule) muxHandler(c *gin.Context) {
|
||||
m.log.Debug("entering mux handler")
|
||||
ru := c.Request.RequestURI
|
||||
if strings.HasPrefix(ru, contextPath) {
|
||||
// TODO
|
||||
} else if strings.HasPrefix(ru, rebloggedPath) {
|
||||
// TODO
|
||||
} else {
|
||||
m.statusGETHandler(c)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue