List 列出所有项目
(w http.ResponseWriter, r *http.Request)
| 209 | |
| 210 | // List 列出所有项目 |
| 211 | func (h *ProjectHandler) List(w http.ResponseWriter, r *http.Request) { |
| 212 | if r.Method != http.MethodGet { |
| 213 | http.Error(w, "Method not allowed", http.StatusMethodNotAllowed) |
| 214 | return |
| 215 | } |
| 216 | writeJSON(w, http.StatusOK, h.store.List()) |
| 217 | } |
| 218 | |
| 219 | // Create 创建项目 |
| 220 | func (h *ProjectHandler) Create(w http.ResponseWriter, r *http.Request) { |