Go: add context, part6 (#17399)

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-07-27 11:09:17 +08:00
committed by GitHub
parent 53afc32349
commit 9d4847beaf
14 changed files with 143 additions and 111 deletions

View File

@@ -258,8 +258,9 @@ func (h *Handler) CreateUser(c *gin.Context) {
if req.Role == "" {
req.Role = "user"
}
ctx := c.Request.Context()
userInfo, err := h.service.CreateUser(req.Username, req.Password, req.Role)
userInfo, err := h.service.CreateUser(ctx, req.Username, req.Password, req.Role)
if err != nil {
common.ErrorWithCode(c, common.CodeServerError, err.Error())
return