新增通过手机号获取排队信息的内部接口

This commit is contained in:
2026-07-22 12:19:38 +08:00
parent de8e09f7c5
commit 32decdb15c
6 changed files with 114 additions and 1 deletions

View File

@@ -85,7 +85,11 @@ func (s *Server) publicStatusByPhone(w http.ResponseWriter, r *http.Request) {
writeError(w, &apiError{Status: http.StatusNotFound, Code: "STATUS_NOT_FOUND", Message: "排队状态不存在或链接已失效"})
return
}
if s.publicQueryLimiter != nil {
s.statusByPhone(w, r, true)
}
func (s *Server) statusByPhone(w http.ResponseWriter, r *http.Request, limitByClientIP bool) {
if limitByClientIP && s.publicQueryLimiter != nil {
if allowed, retry := s.publicQueryLimiter.allow("ip:" + publicQueryClientKey(r)); !allowed {
writePublicQueryRateLimit(w, retry)
return