mirror of
https://github.com/beego/bee.git
synced 2024-11-29 11:41:28 +00:00
commit
d54ba3291b
@ -255,7 +255,7 @@ func (c *{{controllerName}}Controller) GetAll() {
|
|||||||
// query: k:v,k:v
|
// query: k:v,k:v
|
||||||
if v := c.GetString("query"); v != "" {
|
if v := c.GetString("query"); v != "" {
|
||||||
for _, cond := range strings.Split(v, ",") {
|
for _, cond := range strings.Split(v, ",") {
|
||||||
kv := strings.Split(cond, ":")
|
kv := strings.SplitN(cond, ":", 2)
|
||||||
if len(kv) != 2 {
|
if len(kv) != 2 {
|
||||||
c.Data["json"] = errors.New("Error: invalid query key/value pair")
|
c.Data["json"] = errors.New("Error: invalid query key/value pair")
|
||||||
c.ServeJSON()
|
c.ServeJSON()
|
||||||
|
Loading…
Reference in New Issue
Block a user