Esempio n. 1
0
//解锁
func (c *User) Unlock(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.Unlock(ids) {
		data["status"] = "1"
		data["message"] = "解锁成功!"
		return c.RenderJson(data)
	} else {
		data["status"] = "0"
		data["message"] = "解锁失败!"
		return c.RenderJson(data)
	}
}