示例#1
0
文件: api_name.go 项目: neoduan/yj
//curl 'localhost:8083/Api_name/Get?fd=123'
func (this *Api_nameREST) Get(c *hera.Context) error {
	params := c.Params
	var data string = ""
	for p_key, p_value := range params {
		if "1" == p_value {
			return c.Error("key has error", 1001, 400)
		} else {
			data += "key[" + p_key + "]=" + p_value + " " + hera.SERVER["LOG_PATH"]
		}
	}

	hera.Logger.Info("have sucess vistited Hello::Get() interface")
	return c.Success("access-data:" + data)
}
示例#2
0
文件: api.go 项目: dengzhi007/hera
func (this *ApiREST) GetHello(c *hera.Context) error {
	return c.Success("Hello")
}
示例#3
0
文件: api.go 项目: dengzhi007/hera
func (this *ApiREST) GetWorld(c *hera.Context) error {
	return c.Error("GetWorld has error", 1001, 400)
}