Esempio n. 1
0
func (r *HostClient) UpdateUnDeployList(list *JSON.Type) error {
	db.Orm().Read(r.WebServer)
	newList := JSON.Extend(r.WebServer.UnDeployList, list)
	r.WebServer.UnDeployList = JSON.Stringify(newList)
	_, err := db.Orm().Update(r.WebServer, "UnDeployList")
	if err != nil {
		return err
	}
	return nil
}
Esempio n. 2
0
func Success(data ...interface{}) JSON.Type {
	res := make(JSON.Type)
	res["code"] = "success"
	if len(data) > 0 {
		switch reflect.TypeOf(data[0]).Kind() {
		case reflect.String:
			res["message"] = data[0].(string)
		default:
			res["result"] = data[0]
			if len(data) > 1 {
				res = JSON.Extend(res, data[1:]...)
			}
		}
	}
	return res
}