Revert "feat: 批量设置用户最大连接数"

This reverts commit 28568244bb.
This commit is contained in:
sagitchu
2026-04-25 22:45:23 +08:00
parent 28568244bb
commit 325baa8adc
6 changed files with 1 additions and 175 deletions
@@ -138,7 +138,6 @@ func (h *Handler) Register(mux *http.ServeMux) {
mux.HandleFunc("/api/v1/user/update", h.userUpdate)
mux.HandleFunc("/api/v1/user/delete", h.userDelete)
mux.HandleFunc("/api/v1/user/reset", h.userResetFlow)
mux.HandleFunc("/api/v1/user/batch-set-max-conn", h.userBatchSetMaxConn)
mux.HandleFunc("/api/v1/user/quota/reset", h.userQuotaReset)
mux.HandleFunc("/api/v1/user/groups", h.userGroups)
mux.HandleFunc("/api/v1/config/get", h.getConfigByName)
@@ -214,26 +214,6 @@ func (h *Handler) userUpdate(w http.ResponseWriter, r *http.Request) {
response.WriteJSON(w, response.OKEmpty())
}
func (h *Handler) userBatchSetMaxConn(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodPost {
response.WriteJSON(w, response.ErrDefault("请求失败"))
return
}
var req struct {
UserIDs []int64 `json:"userIds"`
MaxConn int `json:"maxConn"`
}
if err := decodeJSON(r.Body, &req); err != nil || len(req.UserIDs) == 0 {
response.WriteJSON(w, response.ErrDefault("请求参数错误"))
return
}
s, f := h.repo.BatchUpdateUserMaxConn(req.UserIDs, req.MaxConn)
response.WriteJSON(w, response.OK(map[string]interface{}{
"success": s,
"failed": f,
}))
}
func (h *Handler) userGroups(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodPost {
response.WriteJSON(w, response.ErrDefault("请求失败"))