コード例 #1
0
ファイル: services.go プロジェクト: radhikapc/open311_gateway
// Area returns a list of services for the specifed city.
func (c *Services) Area(rqst *structs.NServiceRequest, resp *structs.NServicesResponse) error {
	fmt.Println(rqst)

	x, err := data.ServicesArea(rqst.Area)
	if err == nil {
		fmt.Printf("  resp: %p", resp)
		resp.AdpID = data.AdapterName()
		resp.Message = "OK"
		resp.Services = *x
		fmt.Printf("%s\n", spew.Sdump(resp))
	} else {
		fmt.Printf("[Area]: error: %s\n", err)
	}
	return err
}
コード例 #2
0
ファイル: services.go プロジェクト: radhikapc/open311_gateway
// All fills resp with a list of services for the specifed city.
func (c *Services) All(rqst *structs.NServiceRequest, resp *structs.NServicesResponse) error {
	fmt.Println(rqst)

	x, err := data.ServicesAll()
	if err == nil {
		fmt.Printf("  resp: %p", resp)
		resp.AdpID = data.AdapterName()
		resp.Message = "OK"
		resp.Services = *x
		// time.Sleep(time.Second * 4)
		fmt.Printf("%s\n", spew.Sdump(resp))
	} else {
		fmt.Printf("[All]: error: %s\n", err)
	}
	return err
}