API契约:统一首批错误与账号列表 DTO
This commit is contained in:
1 parent
9f99f2b78a
commit
4e7abf61be
16 files changed
+453
-75
No files matched your search
@@ -0,0 +1,14 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/go-chi/chi/v5/middleware"
|
||||
|
||||
"xianyu-go/internal/httpapi"
|
||||
)
|
||||
|
||||
// writeAuthError 输出认证中间件统一使用的错误 DTO,并关联 chi 请求追踪标识。
|
||||
func writeAuthError(w http.ResponseWriter, r *http.Request, status int, code, message string) {
|
||||
httpapi.WriteError(w, status, code, message, middleware.GetReqID(r.Context()))
|
||||
}
|
||||
Reference in new issue
Block a user