接入RESTfull风格接口

This commit is contained in:
hoteas
2021-05-30 00:01:15 +08:00
parent c46fdd8985
commit 465ea889a2
4 changed files with 15 additions and 5 deletions
+8 -1
View File
@@ -2,11 +2,16 @@ package admin
import (
. "../../../hotime"
. "../../../hotime/common"
"fmt"
)
var UserCtr = Ctr{
"info": func(this *Context) {
user := this.Db.Get(this.RouterString[1], "*", Map{"uid": this.RouterString[2]})
fmt.Println(user.Get("utime"), user.GetFloat64("utime"), user.GetInt("utime"))
this.Display(0, user)
},
"add": func(this *Context) {
@@ -18,6 +23,8 @@ var UserCtr = Ctr{
},
"search": func(this *Context) {
user := this.Db.Select(this.RouterString[1], "*")
fmt.Println(user)
this.Display(0, user)
},
}