2017-04-20 22:40:52 +00:00
|
|
|
// Copyright 2017 Vector Creations Ltd
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
2017-02-20 15:41:29 +00:00
|
|
|
package routing
|
|
|
|
|
|
|
|
import (
|
2017-04-20 16:11:53 +00:00
|
|
|
"encoding/json"
|
2017-02-20 15:41:29 +00:00
|
|
|
"net/http"
|
2017-08-18 14:33:40 +00:00
|
|
|
"strings"
|
2017-02-20 15:41:29 +00:00
|
|
|
|
|
|
|
"github.com/gorilla/mux"
|
2017-05-23 16:43:05 +00:00
|
|
|
"github.com/matrix-org/dendrite/clientapi/auth/authtypes"
|
2017-05-22 18:28:26 +00:00
|
|
|
"github.com/matrix-org/dendrite/clientapi/auth/storage/accounts"
|
2017-05-23 16:43:05 +00:00
|
|
|
"github.com/matrix-org/dendrite/clientapi/auth/storage/devices"
|
2017-06-27 11:37:25 +00:00
|
|
|
"github.com/matrix-org/dendrite/clientapi/jsonerror"
|
2017-03-15 13:36:26 +00:00
|
|
|
"github.com/matrix-org/dendrite/clientapi/producers"
|
2017-04-20 16:11:53 +00:00
|
|
|
"github.com/matrix-org/dendrite/clientapi/readers"
|
2017-02-20 15:41:29 +00:00
|
|
|
"github.com/matrix-org/dendrite/clientapi/writers"
|
2017-05-23 16:43:05 +00:00
|
|
|
"github.com/matrix-org/dendrite/common"
|
2017-06-19 14:21:04 +00:00
|
|
|
"github.com/matrix-org/dendrite/common/config"
|
2017-03-15 11:22:40 +00:00
|
|
|
"github.com/matrix-org/dendrite/roomserver/api"
|
2017-05-25 15:08:28 +00:00
|
|
|
"github.com/matrix-org/gomatrixserverlib"
|
2017-02-20 15:41:29 +00:00
|
|
|
"github.com/matrix-org/util"
|
|
|
|
)
|
|
|
|
|
|
|
|
const pathPrefixR0 = "/_matrix/client/r0"
|
2017-06-27 11:37:25 +00:00
|
|
|
const pathPrefixUnstable = "/_matrix/client/unstable"
|
2017-02-20 15:41:29 +00:00
|
|
|
|
|
|
|
// Setup registers HTTP handlers with the given ServeMux. It also supplies the given http.Client
|
|
|
|
// to clients which need to make outbound HTTP requests.
|
2017-05-25 15:08:28 +00:00
|
|
|
func Setup(
|
2017-08-03 14:10:39 +00:00
|
|
|
apiMux *mux.Router, httpClient *http.Client, cfg config.Dendrite,
|
2017-05-25 15:08:28 +00:00
|
|
|
producer *producers.RoomserverProducer, queryAPI api.RoomserverQueryAPI,
|
2017-07-28 10:31:43 +00:00
|
|
|
aliasAPI api.RoomserverAliasAPI,
|
2017-05-25 15:08:28 +00:00
|
|
|
accountDB *accounts.Database,
|
|
|
|
deviceDB *devices.Database,
|
|
|
|
federation *gomatrixserverlib.FederationClient,
|
|
|
|
keyRing gomatrixserverlib.KeyRing,
|
2017-07-11 13:14:06 +00:00
|
|
|
userUpdateProducer *producers.UserUpdateProducer,
|
2017-08-02 15:21:35 +00:00
|
|
|
syncProducer *producers.SyncAPIProducer,
|
2017-05-25 15:08:28 +00:00
|
|
|
) {
|
2017-06-27 11:37:25 +00:00
|
|
|
|
|
|
|
apiMux.Handle("/_matrix/client/versions",
|
|
|
|
common.MakeAPI("versions", func(req *http.Request) util.JSONResponse {
|
|
|
|
return util.JSONResponse{
|
|
|
|
Code: 200,
|
|
|
|
JSON: struct {
|
|
|
|
Versions []string `json:"versions"`
|
|
|
|
}{[]string{
|
|
|
|
"r0.0.1",
|
|
|
|
"r0.1.0",
|
|
|
|
"r0.2.0",
|
|
|
|
}},
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
)
|
|
|
|
|
2017-02-20 15:41:29 +00:00
|
|
|
r0mux := apiMux.PathPrefix(pathPrefixR0).Subrouter()
|
2017-06-27 11:37:25 +00:00
|
|
|
unstableMux := apiMux.PathPrefix(pathPrefixUnstable).Subrouter()
|
|
|
|
|
2017-05-18 12:47:23 +00:00
|
|
|
r0mux.Handle("/createRoom",
|
2017-05-23 16:43:05 +00:00
|
|
|
common.MakeAuthAPI("createRoom", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
2017-07-25 15:10:59 +00:00
|
|
|
return writers.CreateRoom(req, device, cfg, producer, accountDB)
|
2017-05-18 12:47:23 +00:00
|
|
|
}),
|
|
|
|
)
|
2017-05-25 15:08:28 +00:00
|
|
|
r0mux.Handle("/join/{roomIDOrAlias}",
|
|
|
|
common.MakeAuthAPI("join", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
|
|
|
vars := mux.Vars(req)
|
|
|
|
return writers.JoinRoomByIDOrAlias(
|
2017-07-28 14:29:12 +00:00
|
|
|
req, device, vars["roomIDOrAlias"], cfg, federation, producer, queryAPI, aliasAPI, keyRing, accountDB,
|
2017-05-25 15:08:28 +00:00
|
|
|
)
|
|
|
|
}),
|
|
|
|
)
|
2017-08-04 15:32:10 +00:00
|
|
|
r0mux.Handle("/rooms/{roomID}/{membership:(?:join|kick|ban|unban|leave|invite)}",
|
|
|
|
common.MakeAuthAPI("membership", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
|
|
|
vars := mux.Vars(req)
|
|
|
|
return writers.SendMembership(req, accountDB, device, vars["roomID"], vars["membership"], cfg, queryAPI, producer)
|
|
|
|
}),
|
|
|
|
).Methods("POST", "OPTIONS")
|
2017-03-15 11:22:40 +00:00
|
|
|
r0mux.Handle("/rooms/{roomID}/send/{eventType}/{txnID}",
|
2017-05-23 16:43:05 +00:00
|
|
|
common.MakeAuthAPI("send_message", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
2017-02-20 15:41:29 +00:00
|
|
|
vars := mux.Vars(req)
|
2017-05-23 16:43:05 +00:00
|
|
|
return writers.SendEvent(req, device, vars["roomID"], vars["eventType"], vars["txnID"], nil, cfg, queryAPI, producer)
|
2017-05-18 12:47:23 +00:00
|
|
|
}),
|
2017-03-17 11:21:52 +00:00
|
|
|
)
|
2017-08-18 14:33:40 +00:00
|
|
|
r0mux.Handle("/rooms/{roomID}/state/{eventType:[^/]+/?}",
|
2017-05-23 16:43:05 +00:00
|
|
|
common.MakeAuthAPI("send_message", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
2017-03-17 11:21:52 +00:00
|
|
|
vars := mux.Vars(req)
|
|
|
|
emptyString := ""
|
2017-08-18 14:33:40 +00:00
|
|
|
eventType := vars["eventType"]
|
|
|
|
// If there's a trailing slash, remove it
|
|
|
|
if strings.HasSuffix(eventType, "/") {
|
|
|
|
eventType = eventType[:len(eventType)-1]
|
|
|
|
}
|
2017-08-18 15:10:28 +00:00
|
|
|
return writers.SendEvent(req, device, vars["roomID"], eventType, "", &emptyString, cfg, queryAPI, producer)
|
2017-05-18 12:47:23 +00:00
|
|
|
}),
|
2017-03-17 11:21:52 +00:00
|
|
|
)
|
|
|
|
r0mux.Handle("/rooms/{roomID}/state/{eventType}/{stateKey}",
|
2017-05-23 16:43:05 +00:00
|
|
|
common.MakeAuthAPI("send_message", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
2017-03-17 11:21:52 +00:00
|
|
|
vars := mux.Vars(req)
|
|
|
|
stateKey := vars["stateKey"]
|
2017-08-18 15:10:28 +00:00
|
|
|
return writers.SendEvent(req, device, vars["roomID"], vars["eventType"], "", &stateKey, cfg, queryAPI, producer)
|
2017-05-18 12:47:23 +00:00
|
|
|
}),
|
2017-02-20 15:41:29 +00:00
|
|
|
)
|
|
|
|
|
2017-05-23 16:43:05 +00:00
|
|
|
r0mux.Handle("/register", common.MakeAPI("register", func(req *http.Request) util.JSONResponse {
|
2017-05-30 16:51:40 +00:00
|
|
|
return writers.Register(req, accountDB, deviceDB)
|
2017-05-22 14:55:39 +00:00
|
|
|
}))
|
|
|
|
|
2017-06-27 11:37:25 +00:00
|
|
|
r0mux.Handle("/directory/room/{roomAlias}",
|
|
|
|
common.MakeAuthAPI("directory_room", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
|
|
|
vars := mux.Vars(req)
|
2017-07-28 10:31:43 +00:00
|
|
|
return readers.DirectoryRoom(req, device, vars["roomAlias"], federation, &cfg, aliasAPI)
|
2017-06-27 11:37:25 +00:00
|
|
|
}),
|
2017-07-28 10:31:43 +00:00
|
|
|
).Methods("GET")
|
|
|
|
|
|
|
|
r0mux.Handle("/directory/room/{roomAlias}",
|
|
|
|
common.MakeAuthAPI("directory_room", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
|
|
|
vars := mux.Vars(req)
|
|
|
|
return readers.SetLocalAlias(req, device, vars["roomAlias"], &cfg, aliasAPI)
|
|
|
|
}),
|
|
|
|
).Methods("PUT", "OPTIONS")
|
|
|
|
|
|
|
|
r0mux.Handle("/directory/room/{roomAlias}",
|
|
|
|
common.MakeAuthAPI("directory_room", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
|
|
|
vars := mux.Vars(req)
|
|
|
|
return readers.RemoveLocalAlias(req, device, vars["roomAlias"], &cfg, aliasAPI)
|
|
|
|
}),
|
|
|
|
).Methods("DELETE")
|
2017-06-27 11:37:25 +00:00
|
|
|
|
2017-07-11 15:04:34 +00:00
|
|
|
r0mux.Handle("/logout",
|
|
|
|
common.MakeAuthAPI("logout", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
|
|
|
return readers.Logout(req, deviceDB, device)
|
|
|
|
}),
|
|
|
|
)
|
|
|
|
|
2017-04-20 16:11:53 +00:00
|
|
|
// Stub endpoints required by Riot
|
|
|
|
|
|
|
|
r0mux.Handle("/login",
|
2017-05-23 16:43:05 +00:00
|
|
|
common.MakeAPI("login", func(req *http.Request) util.JSONResponse {
|
2017-05-30 16:51:40 +00:00
|
|
|
return readers.Login(req, accountDB, deviceDB, cfg)
|
2017-05-18 12:47:23 +00:00
|
|
|
}),
|
2017-04-20 16:11:53 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
r0mux.Handle("/pushrules/",
|
2017-05-23 16:43:05 +00:00
|
|
|
common.MakeAPI("push_rules", func(req *http.Request) util.JSONResponse {
|
2017-04-20 16:11:53 +00:00
|
|
|
// TODO: Implement push rules API
|
|
|
|
res := json.RawMessage(`{
|
|
|
|
"global": {
|
|
|
|
"content": [],
|
|
|
|
"override": [],
|
|
|
|
"room": [],
|
|
|
|
"sender": [],
|
|
|
|
"underride": []
|
|
|
|
}
|
|
|
|
}`)
|
|
|
|
return util.JSONResponse{
|
|
|
|
Code: 200,
|
|
|
|
JSON: &res,
|
|
|
|
}
|
2017-05-18 12:47:23 +00:00
|
|
|
}),
|
2017-04-20 16:11:53 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
r0mux.Handle("/user/{userID}/filter",
|
2017-05-23 16:43:05 +00:00
|
|
|
common.MakeAPI("make_filter", func(req *http.Request) util.JSONResponse {
|
2017-04-20 16:11:53 +00:00
|
|
|
// TODO: Persist filter and return filter ID
|
|
|
|
return util.JSONResponse{
|
|
|
|
Code: 200,
|
|
|
|
JSON: struct{}{},
|
|
|
|
}
|
2017-05-18 12:47:23 +00:00
|
|
|
}),
|
2017-04-20 16:11:53 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
r0mux.Handle("/user/{userID}/filter/{filterID}",
|
2017-05-23 16:43:05 +00:00
|
|
|
common.MakeAPI("filter", func(req *http.Request) util.JSONResponse {
|
2017-04-20 16:11:53 +00:00
|
|
|
// TODO: Retrieve filter based on ID
|
|
|
|
return util.JSONResponse{
|
|
|
|
Code: 200,
|
|
|
|
JSON: struct{}{},
|
|
|
|
}
|
2017-05-18 12:47:23 +00:00
|
|
|
}),
|
2017-04-20 16:11:53 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Riot user settings
|
|
|
|
|
|
|
|
r0mux.Handle("/profile/{userID}",
|
2017-05-23 16:43:05 +00:00
|
|
|
common.MakeAPI("profile", func(req *http.Request) util.JSONResponse {
|
2017-07-10 13:52:41 +00:00
|
|
|
vars := mux.Vars(req)
|
|
|
|
return readers.GetProfile(req, accountDB, vars["userID"])
|
2017-05-18 12:47:23 +00:00
|
|
|
}),
|
2017-04-20 16:11:53 +00:00
|
|
|
)
|
|
|
|
|
2017-07-10 13:52:41 +00:00
|
|
|
r0mux.Handle("/profile/{userID}/avatar_url",
|
|
|
|
common.MakeAPI("profile_avatar_url", func(req *http.Request) util.JSONResponse {
|
|
|
|
vars := mux.Vars(req)
|
|
|
|
return readers.GetAvatarURL(req, accountDB, vars["userID"])
|
|
|
|
}),
|
|
|
|
).Methods("GET")
|
|
|
|
|
|
|
|
r0mux.Handle("/profile/{userID}/avatar_url",
|
|
|
|
common.MakeAuthAPI("profile_avatar_url", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
|
|
|
vars := mux.Vars(req)
|
2017-07-25 15:10:59 +00:00
|
|
|
return readers.SetAvatarURL(req, accountDB, device, vars["userID"], userUpdateProducer, &cfg, producer, queryAPI)
|
2017-07-10 13:52:41 +00:00
|
|
|
}),
|
|
|
|
).Methods("PUT", "OPTIONS")
|
|
|
|
// Browsers use the OPTIONS HTTP method to check if the CORS policy allows
|
|
|
|
// PUT requests, so we need to allow this method
|
|
|
|
|
|
|
|
r0mux.Handle("/profile/{userID}/displayname",
|
|
|
|
common.MakeAPI("profile_displayname", func(req *http.Request) util.JSONResponse {
|
|
|
|
vars := mux.Vars(req)
|
|
|
|
return readers.GetDisplayName(req, accountDB, vars["userID"])
|
|
|
|
}),
|
|
|
|
).Methods("GET")
|
|
|
|
|
|
|
|
r0mux.Handle("/profile/{userID}/displayname",
|
|
|
|
common.MakeAuthAPI("profile_displayname", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
|
|
|
vars := mux.Vars(req)
|
2017-07-25 15:10:59 +00:00
|
|
|
return readers.SetDisplayName(req, accountDB, device, vars["userID"], userUpdateProducer, &cfg, producer, queryAPI)
|
2017-07-10 13:52:41 +00:00
|
|
|
}),
|
|
|
|
).Methods("PUT", "OPTIONS")
|
|
|
|
// Browsers use the OPTIONS HTTP method to check if the CORS policy allows
|
|
|
|
// PUT requests, so we need to allow this method
|
|
|
|
|
2017-04-20 16:11:53 +00:00
|
|
|
r0mux.Handle("/account/3pid",
|
2017-09-01 09:13:10 +00:00
|
|
|
common.MakeAuthAPI("account_3pid", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
|
|
|
return readers.GetAssociated3PIDs(req, accountDB, device)
|
2017-05-18 12:47:23 +00:00
|
|
|
}),
|
2017-09-01 09:13:10 +00:00
|
|
|
).Methods("GET")
|
|
|
|
|
|
|
|
r0mux.Handle("/account/3pid",
|
|
|
|
common.MakeAuthAPI("account_3pid", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
|
|
|
return readers.CheckAndSave3PIDAssociation(req, accountDB, device)
|
|
|
|
}),
|
|
|
|
).Methods("POST", "OPTIONS")
|
|
|
|
|
|
|
|
unstableMux.Handle("/account/3pid/delete",
|
|
|
|
common.MakeAuthAPI("account_3pid", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
|
|
|
return readers.Forget3PID(req, accountDB)
|
|
|
|
}),
|
|
|
|
).Methods("POST", "OPTIONS")
|
|
|
|
|
|
|
|
r0mux.Handle("/{path:(?:account/3pid|register)}/email/requestToken",
|
|
|
|
common.MakeAPI("account_3pid_request_token", func(req *http.Request) util.JSONResponse {
|
|
|
|
return readers.RequestEmailToken(req, accountDB)
|
|
|
|
}),
|
|
|
|
).Methods("POST", "OPTIONS")
|
2017-04-20 16:11:53 +00:00
|
|
|
|
|
|
|
// Riot logs get flooded unless this is handled
|
|
|
|
r0mux.Handle("/presence/{userID}/status",
|
2017-05-23 16:43:05 +00:00
|
|
|
common.MakeAPI("presence", func(req *http.Request) util.JSONResponse {
|
2017-04-20 16:11:53 +00:00
|
|
|
// TODO: Set presence (probably the responsibility of a presence server not clientapi)
|
|
|
|
return util.JSONResponse{
|
|
|
|
Code: 200,
|
|
|
|
JSON: struct{}{},
|
|
|
|
}
|
2017-05-18 12:47:23 +00:00
|
|
|
}),
|
2017-04-20 16:11:53 +00:00
|
|
|
)
|
|
|
|
|
2017-06-27 11:37:25 +00:00
|
|
|
r0mux.Handle("/voip/turnServer",
|
|
|
|
common.MakeAPI("turn_server", func(req *http.Request) util.JSONResponse {
|
|
|
|
// TODO: Return credentials for a turn server if one is configured.
|
|
|
|
return util.JSONResponse{
|
|
|
|
Code: 200,
|
|
|
|
JSON: struct{}{},
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
)
|
|
|
|
|
|
|
|
unstableMux.Handle("/thirdparty/protocols",
|
|
|
|
common.MakeAPI("thirdparty_protocols", func(req *http.Request) util.JSONResponse {
|
|
|
|
// TODO: Return the third party protcols
|
|
|
|
return util.JSONResponse{
|
|
|
|
Code: 200,
|
|
|
|
JSON: struct{}{},
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
)
|
|
|
|
|
|
|
|
r0mux.Handle("/rooms/{roomID}/initialSync",
|
|
|
|
common.MakeAPI("rooms_initial_sync", func(req *http.Request) util.JSONResponse {
|
|
|
|
// TODO: Allow people to peek into rooms.
|
|
|
|
return util.JSONResponse{
|
|
|
|
Code: 403,
|
|
|
|
JSON: jsonerror.GuestAccessForbidden("Guest access not implemented"),
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
)
|
|
|
|
|
|
|
|
r0mux.Handle("/user/{userID}/account_data/{type}",
|
2017-07-26 13:53:11 +00:00
|
|
|
common.MakeAuthAPI("user_account_data", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
|
|
|
vars := mux.Vars(req)
|
2017-08-02 15:21:35 +00:00
|
|
|
return readers.SaveAccountData(req, accountDB, device, vars["userID"], "", vars["type"], syncProducer)
|
2017-07-26 13:53:11 +00:00
|
|
|
}),
|
|
|
|
)
|
|
|
|
|
|
|
|
r0mux.Handle("/user/{userID}/rooms/{roomID}/account_data/{type}",
|
|
|
|
common.MakeAuthAPI("user_account_data", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
|
|
|
vars := mux.Vars(req)
|
2017-08-02 15:21:35 +00:00
|
|
|
return readers.SaveAccountData(req, accountDB, device, vars["userID"], vars["roomID"], vars["type"], syncProducer)
|
2017-06-27 11:37:25 +00:00
|
|
|
}),
|
|
|
|
)
|
|
|
|
|
2017-08-21 15:34:26 +00:00
|
|
|
r0mux.Handle("/rooms/{roomID}/members",
|
|
|
|
common.MakeAuthAPI("rooms_members", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
|
|
|
vars := mux.Vars(req)
|
2017-08-24 15:00:14 +00:00
|
|
|
return readers.GetMemberships(req, device, vars["roomID"], false, accountDB, cfg, queryAPI)
|
|
|
|
}),
|
|
|
|
)
|
|
|
|
|
|
|
|
r0mux.Handle("/rooms/{roomID}/joined_members",
|
|
|
|
common.MakeAuthAPI("rooms_members", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
|
|
|
vars := mux.Vars(req)
|
|
|
|
return readers.GetMemberships(req, device, vars["roomID"], true, accountDB, cfg, queryAPI)
|
2017-08-21 15:34:26 +00:00
|
|
|
}),
|
|
|
|
)
|
|
|
|
|
2017-06-27 11:37:25 +00:00
|
|
|
r0mux.Handle("/rooms/{roomID}/read_markers",
|
|
|
|
common.MakeAPI("rooms_read_markers", func(req *http.Request) util.JSONResponse {
|
|
|
|
// TODO: return the read_markers.
|
|
|
|
return util.JSONResponse{Code: 200, JSON: struct{}{}}
|
|
|
|
}),
|
|
|
|
)
|
|
|
|
|
|
|
|
r0mux.Handle("/rooms/{roomID}/typing/{userID}",
|
|
|
|
common.MakeAPI("rooms_typing", func(req *http.Request) util.JSONResponse {
|
|
|
|
// TODO: handling typing
|
|
|
|
return util.JSONResponse{Code: 200, JSON: struct{}{}}
|
|
|
|
}),
|
|
|
|
)
|
2017-02-20 15:41:29 +00:00
|
|
|
}
|