完成剩余模块 Context 超时控制改造
This commit is contained in:
@@ -30,7 +30,7 @@ func (h *Handler) Create(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
withdrawal, err := h.service.Create(userID, req)
|
||||
withdrawal, err := h.service.Create(c.Request.Context(), userID, req)
|
||||
if err != nil {
|
||||
writeError(c, err)
|
||||
return
|
||||
@@ -49,7 +49,7 @@ func (h *Handler) List(c *gin.Context) {
|
||||
page, _ := strconv.Atoi(c.DefaultQuery("page", "1"))
|
||||
pageSize, _ := strconv.Atoi(c.DefaultQuery("page_size", "20"))
|
||||
|
||||
result, err := h.service.List(userID, page, pageSize)
|
||||
result, err := h.service.List(c.Request.Context(), userID, page, pageSize)
|
||||
if err != nil {
|
||||
writeError(c, err)
|
||||
return
|
||||
@@ -70,7 +70,7 @@ func (h *Handler) FindByID(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
withdrawal, err := h.service.FindByID(userID, id)
|
||||
withdrawal, err := h.service.FindByID(c.Request.Context(), userID, id)
|
||||
if err != nil {
|
||||
writeError(c, err)
|
||||
return
|
||||
@@ -91,7 +91,7 @@ func (h *Handler) Cancel(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if err := h.service.Cancel(userID, id); err != nil {
|
||||
if err := h.service.Cancel(c.Request.Context(), userID, id); err != nil {
|
||||
writeError(c, err)
|
||||
return
|
||||
}
|
||||
@@ -108,7 +108,7 @@ func (h *Handler) AdminList(c *gin.Context) {
|
||||
query.Size = 20
|
||||
}
|
||||
|
||||
result, err := h.service.AdminList(query)
|
||||
result, err := h.service.AdminList(c.Request.Context(), query)
|
||||
if err != nil {
|
||||
writeError(c, err)
|
||||
return
|
||||
@@ -123,7 +123,7 @@ func (h *Handler) AdminFindByID(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
withdrawal, err := h.service.AdminFindByID(id)
|
||||
withdrawal, err := h.service.AdminFindByID(c.Request.Context(), id)
|
||||
if err != nil {
|
||||
writeError(c, err)
|
||||
return
|
||||
@@ -150,7 +150,7 @@ func (h *Handler) Review(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
withdrawal, err := h.service.Review(adminID, id, req)
|
||||
withdrawal, err := h.service.Review(c.Request.Context(), adminID, id, req)
|
||||
if err != nil {
|
||||
writeError(c, err)
|
||||
return
|
||||
@@ -177,7 +177,7 @@ func (h *Handler) ConfirmPayment(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
withdrawal, err := h.service.ConfirmPayment(adminID, id, req)
|
||||
withdrawal, err := h.service.ConfirmPayment(c.Request.Context(), adminID, id, req)
|
||||
if err != nil {
|
||||
writeError(c, err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user