MCPcopy
hub / github.com/shadow1ng/fscan / Get

Method Get

web/api/project.go:241–253  ·  view source on GitHub ↗

Get 获取项目详情

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

239
240// Get 获取项目详情
241func (h *ProjectHandler) Get(w http.ResponseWriter, r *http.Request) {
242 if r.Method != http.MethodGet {
243 http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
244 return
245 }
246 id := r.URL.Query().Get("id")
247 p := h.store.Get(id)
248 if p == nil {
249 writeJSON(w, http.StatusNotFound, map[string]string{"error": "project not found"})
250 return
251 }
252 writeJSON(w, http.StatusOK, p)
253}
254
255// Delete 删除项目
256func (h *ProjectHandler) Delete(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 3

writeJSONFunction · 0.85
ErrorMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected