Пример #1
0
//锁定
func (c *User) Lock(user *models.User) revel.Result {

	var ids string = c.Params.Get("ids")

	data := make(map[string]string)

	if len(ids) <= 0 {
		data["status"] = "0"
		data["message"] = "请至少选择一个!"
		return c.RenderJson(data)
	}

	if user.Lock(ids) {
		data["status"] = "1"
		data["message"] = "锁定成功!"
		return c.RenderJson(data)
	} else {
		data["status"] = "0"
		data["message"] = "锁定失败!"
		return c.RenderJson(data)
	}
}