Skip to content

Commit

Permalink
edit: edit server.go
Browse files Browse the repository at this point in the history
修改超大圈复杂度
  • Loading branch information
Zherphy committed Dec 10, 2024
1 parent 9467e86 commit 5da0f02
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ func (s *server) handleBatch(w http.ResponseWriter, r *http.Request) {
return
}
}

resp := s.handleRequestObject(req)
must(json.NewEncoder(w).Encode(resp))
}

func (s *server) handleRequestObject(req batch.Request) batch.Response {
var resp batch.Response
for i := 0; i < len(req.Objects); i++ {
in := req.Objects[i]
Expand All @@ -174,7 +180,7 @@ func (s *server) handleBatch(w http.ResponseWriter, r *http.Request) {
continue
}
}
must(json.NewEncoder(w).Encode(resp))
return resp
}

func (s *server) dealWithAuthError(userInRepo auth.UserInRepo, w http.ResponseWriter, r *http.Request) error {
Expand Down

0 comments on commit 5da0f02

Please sign in to comment.