コード例 #1
0
// Create - create store record
func (store_c StoresController) Create(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
	store := models.Store{}

	json.NewDecoder(r.Body).Decode(&store)

	store.ID = "FakeId"

	storeJSON := store.ToJSON()
	store_c.renderJSON(w, storeJSON, 201)
}