Standardise function names (Ping -> PingGET, SurpriseMe -> SurpriseMeGET)
This commit is contained in:
parent
6bae1e2390
commit
851c90764a
|
@ -19,8 +19,8 @@ func Start(conf common.Conf, db *sql.DB) {
|
||||||
gv1 := api.Group("/v1")
|
gv1 := api.Group("/v1")
|
||||||
{
|
{
|
||||||
// Auth-free API endpoints
|
// Auth-free API endpoints
|
||||||
gv1.GET("/ping", Method(v1.Ping, db))
|
gv1.GET("/ping", Method(v1.PingGET, db))
|
||||||
gv1.GET("/surprise_me", Method(v1.SurpriseMe, db))
|
gv1.GET("/surprise_me", Method(v1.SurpriseMeGET, db))
|
||||||
gv1.GET("/privileges", Method(v1.PrivilegesGET, db))
|
gv1.GET("/privileges", Method(v1.PrivilegesGET, db))
|
||||||
|
|
||||||
// Read privilege required
|
// Read privilege required
|
||||||
|
|
|
@ -87,8 +87,8 @@ type pingData struct {
|
||||||
Privileges int `json:"privileges"`
|
Privileges int `json:"privileges"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ping is a message to check with the API that we are logged in, and know what are our privileges.
|
// PingGET is a message to check with the API that we are logged in, and know what are our privileges.
|
||||||
func Ping(md common.MethodData) (r common.Response) {
|
func PingGET(md common.MethodData) (r common.Response) {
|
||||||
r.Code = 200
|
r.Code = 200
|
||||||
if md.User.UserID == 0 {
|
if md.User.UserID == 0 {
|
||||||
r.Message = "You have not given us a token, so we don't know who you are! But you can still login with /api/v1/login " + kaomojis[rn.Intn(len(kaomojis))]
|
r.Message = "You have not given us a token, so we don't know who you are! But you can still login with /api/v1/login " + kaomojis[rn.Intn(len(kaomojis))]
|
||||||
|
@ -102,10 +102,10 @@ func Ping(md common.MethodData) (r common.Response) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// SurpriseMe generates cute cats.
|
// SurpriseMeGET generates cute cats.
|
||||||
//
|
//
|
||||||
// ... Yes.
|
// ... Yes.
|
||||||
func SurpriseMe(md common.MethodData) (r common.Response) {
|
func SurpriseMeGET(md common.MethodData) (r common.Response) {
|
||||||
r.Code = 200
|
r.Code = 200
|
||||||
cats := make([]string, 100)
|
cats := make([]string, 100)
|
||||||
for i := 0; i < 100; i++ {
|
for i := 0; i < 100; i++ {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user