Skip to content

Commit bab785d

Browse files
committed
feat: wrap pagination detail into one object
1 parent c3cd6bd commit bab785d

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

app/blog_post/delivery/http/http.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func (h Handler) GetAllBlogPosts(w http.ResponseWriter, r *http.Request) {
149149
Code: http.StatusOK,
150150
Message: "Blog posts retrieved successfully",
151151
Data: responseDTO,
152-
Pagination: paginationResponse,
152+
Pagination: &paginationResponse,
153153
}, w)
154154
}
155155

app/events/delivery/http/event.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ func (h Handler) List(w http.ResponseWriter, r *http.Request) {
286286
Code: http.StatusOK,
287287
Message: "success",
288288
Data: data,
289-
Pagination: pagination,
289+
Pagination: &pagination,
290290
}, w)
291291
}
292292

@@ -341,6 +341,6 @@ func (h Handler) GetEvents(w http.ResponseWriter, r *http.Request) {
341341
Code: http.StatusOK,
342342
Message: "success",
343343
Data: data,
344-
Pagination: pagination,
344+
Pagination: &pagination,
345345
}, w)
346346
}

app/events/delivery/http/list_event_pay.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@ func (h Handler) ListEventPay(w http.ResponseWriter, r *http.Request) {
7373
Code: http.StatusOK,
7474
Message: "success",
7575
Data: data,
76-
Pagination: pagination,
76+
Pagination: &pagination,
7777
}, w)
7878
}

app/events/delivery/http/list_registration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ func (h Handler) ListRegistration(w http.ResponseWriter, r *http.Request) {
5555
Code: http.StatusOK,
5656
Message: "success",
5757
Data: data,
58-
Pagination: pagination,
58+
Pagination: &pagination,
5959
}, w)
6060
}

domain/base_model.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package domain
22

33
type (
44
HttpResponse struct {
5-
Code int `json:"code"`
6-
Message string `json:"message"`
7-
Data interface{} `json:"data"`
8-
Pagination
5+
Code int `json:"code"`
6+
Message string `json:"message"`
7+
Data interface{} `json:"data"`
8+
Pagination *Pagination `json:"pagination,omitempty"`
99
}
1010
)

0 commit comments

Comments
 (0)