Skip to content

Commit bc6da00

Browse files
committed
update_ctx
1 parent 5bb3223 commit bc6da00

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

contracts/http_result.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package contracts
22

33
import "github.com/goravel/framework/contracts/http"
4-
import HttpResultIns "github.com/hulutech-web/http_result"
4+
55
type HttpResult interface {
66
Success(message string, data interface{}) http.Response
77
Error(code int, message string, data interface{}) http.Response
88
ValidError(message string, errors map[string]map[string]string) http.Response
9-
ResultPagination(ctx http.Context, dest any) (http.Response, error)
9+
ResultPagination(dest any) (http.Response, error)
1010
SearchByParams(params map[string]string, excepts ...string) *HttpResultIns
1111
}

http_result.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type Instance interface {
1616
Error(code int, message string, data interface{}) http.Response
1717
ValidError(message string, errors map[string]map[string]string) http.Response
1818
SearchByParams(params map[string]string, excepts ...string) *HttpResult
19-
ResultPagination(ctx http.Context, dest any) (http.Response, error)
19+
ResultPagination(dest any) (http.Response, error)
2020
}
2121

2222
type HttpResult struct {

paginator.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ func (h *HttpResult) SearchByParams(params map[string]string, excepts ...string)
5050
return h
5151
}
5252

53-
func (r *HttpResult) ResultPagination(ctx http.Context, dest any) (http.Response, error) {
54-
r.Context = ctx
55-
request := ctx.Request()
53+
func (r *HttpResult) ResultPagination(dest any) (http.Response, error) {
54+
request := r.Context.Request()
55+
ctx:=r.Context
5656
pageSize := request.Query("pageSize", "10")
5757
pageSizeInt := cast.ToInt(pageSize)
5858
currentPage := request.Query("currentPage", "1")

0 commit comments

Comments
 (0)