Esempio n. 1
0
func (p *LoginAccountRequestHandler) ContentTypesProvided(req wm.Request, cxt wm.Context) ([]wm.MediaTypeHandler, wm.Request, wm.Context, int, error) {
	genFunc := func() (jsonhelper.JSONObject, time.Time, string, int, http.Header) {
		lac := cxt.(LoginAccountContext)
		jsonObj := lac.Result()
		headers := apiutil.AddNoCacheHeaders(nil)
		return jsonObj, time.Time{}, "", http.StatusOK, headers
	}
	return []wm.MediaTypeHandler{apiutil.NewJSONMediaTypeHandlerWithGenerator(genFunc, time.Time{}, "")}, req, cxt, 0, nil
}
Esempio n. 2
0
func (p *ViewContactRequestHandler) ContentTypesProvided(req wm.Request, cxt wm.Context) ([]wm.MediaTypeHandler, wm.Request, wm.Context, int, error) {
	genFunc := func() (jsonhelper.JSONObject, time.Time, string, int, http.Header) {
		vcc := cxt.(ViewContactContext)
		jsonObj := vcc.Result()
		headers := apiutil.AddNoCacheHeaders(nil)
		return jsonObj, vcc.LastModified(), vcc.ETag(), http.StatusOK, headers
	}
	return []wm.MediaTypeHandler{apiutil.NewJSONMediaTypeHandlerWithGenerator(genFunc, time.Time{}, "")}, req, cxt, 0, nil
}