Skip to content

Commit b383d2d

Browse files
moving query param model
1 parent 2b00ea1 commit b383d2d

File tree

6 files changed

+32
-38
lines changed

6 files changed

+32
-38
lines changed

app/domain/homeapp/filter.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ import (
1010
"github.com/google/uuid"
1111
)
1212

13+
type queryParams struct {
14+
Page string
15+
Rows string
16+
OrderBy string
17+
ID string
18+
UserID string
19+
Type string
20+
StartCreatedDate string
21+
EndCreatedDate string
22+
}
23+
1324
func parseQueryParams(r *http.Request) queryParams {
1425
values := r.URL.Query()
1526

app/domain/homeapp/model.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,6 @@ import (
1212
"github.com/ardanlabs/service/business/types/hometype"
1313
)
1414

15-
type queryParams struct {
16-
Page string
17-
Rows string
18-
OrderBy string
19-
ID string
20-
UserID string
21-
Type string
22-
StartCreatedDate string
23-
EndCreatedDate string
24-
}
25-
26-
// =============================================================================
27-
2815
// Address represents information about an individual address.
2916
type Address struct {
3017
Address1 string `json:"address1"`

app/domain/productapp/filter.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ import (
1010
"github.com/google/uuid"
1111
)
1212

13+
type queryParams struct {
14+
Page string
15+
Rows string
16+
OrderBy string
17+
ID string
18+
Name string
19+
Cost string
20+
Quantity string
21+
}
22+
1323
func parseQueryParams(r *http.Request) queryParams {
1424
values := r.URL.Query()
1525

app/domain/productapp/model.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,6 @@ import (
1414
"github.com/ardanlabs/service/business/types/quantity"
1515
)
1616

17-
type queryParams struct {
18-
Page string
19-
Rows string
20-
OrderBy string
21-
ID string
22-
Name string
23-
Cost string
24-
Quantity string
25-
}
26-
27-
// =============================================================================
28-
2917
// Product represents information about an individual product.
3018
type Product struct {
3119
ID string `json:"id"`

app/domain/userapp/filter.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ import (
1111
"github.com/google/uuid"
1212
)
1313

14+
type queryParams struct {
15+
Page string
16+
Rows string
17+
OrderBy string
18+
ID string
19+
Name string
20+
Email string
21+
StartCreatedDate string
22+
EndCreatedDate string
23+
}
24+
1425
func parseQueryParams(r *http.Request) (queryParams, error) {
1526
values := r.URL.Query()
1627

app/domain/userapp/model.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,6 @@ import (
1212
"github.com/ardanlabs/service/business/types/role"
1313
)
1414

15-
type queryParams struct {
16-
Page string
17-
Rows string
18-
OrderBy string
19-
ID string
20-
Name string
21-
Email string
22-
StartCreatedDate string
23-
EndCreatedDate string
24-
}
25-
26-
// =============================================================================
27-
2815
// User represents information about an individual user.
2916
type User struct {
3017
ID string `json:"id"`

0 commit comments

Comments
 (0)