mirror of
https://github.com/signaller-matrix/signaller.git
synced 2024-11-22 02:12:20 +00:00
Move versions method to separate model
This commit is contained in:
parent
c084dce5ec
commit
f07dfc3a33
@ -14,6 +14,7 @@ import (
|
||||
login "github.com/nxshock/signaller/internal/models/login"
|
||||
register "github.com/nxshock/signaller/internal/models/register"
|
||||
mSync "github.com/nxshock/signaller/internal/models/sync"
|
||||
"github.com/nxshock/signaller/internal/models/versions"
|
||||
)
|
||||
|
||||
func RootHandler(w http.ResponseWriter, r *http.Request) {
|
||||
@ -27,7 +28,7 @@ func VersionHandler(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
response := models.VersionsReply{Versions: []string{Version}}
|
||||
response := versions.Reply{Versions: []string{Version}}
|
||||
sendJsonResponse(w, http.StatusOK, response)
|
||||
}
|
||||
|
||||
|
@ -4,12 +4,6 @@ import (
|
||||
common "github.com/nxshock/signaller/internal/models/common"
|
||||
)
|
||||
|
||||
// https://matrix.org/docs/spec/client_server/r0.4.0.html#get-matrix-client-versions
|
||||
type VersionsReply struct {
|
||||
Versions []string `json:"versions"` // The supported versions.
|
||||
UnstableFeatures map[string]bool `json:"unstable_features,omitempty"`
|
||||
}
|
||||
|
||||
// https://matrix.org/docs/spec/client_server/r0.4.0.html#get-matrix-client-r0-account-whoami
|
||||
type WhoAmIReply struct {
|
||||
UserID string `json:"user_id"` // Required. The user id that owns the access token.
|
||||
|
7
internal/models/versions/reply.go
Normal file
7
internal/models/versions/reply.go
Normal file
@ -0,0 +1,7 @@
|
||||
package versions
|
||||
|
||||
// https://matrix.org/docs/spec/client_server/latest#get-matrix-client-versions
|
||||
type Reply struct {
|
||||
Versions []string `json:"versions"` // The supported versions.
|
||||
UnstableFeatures map[string]bool `json:"unstable_features,omitempty"` // Experimental features the server supports. Features not listed here, or the lack of this property all together, indicate that a feature is not supported.
|
||||
}
|
Loading…
Reference in New Issue
Block a user