Exemple #1
0
func GetRequestChildren(w http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	uuid := vars["uuid"]

	conditions := make([]*model.Condition, 0)
	conditions = append(conditions, model.NewCondition("parent_uuid", "=", uuid))
	rs := model.ListRequest(conditions, nil, nil)
	json.NewEncoder(w).Encode(rs)
}
Exemple #2
0
func MainLoop() {
	for {
		conditions := make([]*model.Condition, 0)
		conditions = append(conditions, model.NewCondition("group_uuid", "=", ""))
		conditions = append(conditions, model.NewCondition("end_ts", "!=", "0"))
		order := model.NewOrder("begin_ts", "asc")
		process(model.ListRequest(conditions, order, nil))
		time.Sleep(5 * time.Second)
	}
}
Exemple #3
0
func GetRequests(w http.ResponseWriter, r *http.Request) {
	rs := model.ListRequest(nil, nil, nil)
	json.NewEncoder(w).Encode(rs)
}