Skip to content

Commit 4f6fee6

Browse files
Rodrigo Dos SantosRodrigo Dos Santos
authored andcommitted
Fixed web app, fixed go service - build go-service, build react-webapp
1 parent 8131382 commit 4f6fee6

File tree

18 files changed

+23919
-40686
lines changed

18 files changed

+23919
-40686
lines changed

go-service/posts-api/model/model.go

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,43 @@ import (
77
)
88

99
type (
10+
Pagination struct {
11+
Page int64 `json:"page"`
12+
Size int64 `json:"size"`
13+
TotalPages int64 `json:"totalPages"`
14+
TotalElements int64 `json:"totalElements"`
15+
Post []PostDto `json:"content"`
16+
}
17+
18+
PageTaskDto struct {
19+
Page int64 `json:"page"`
20+
Size int64 `json:"size"`
21+
TotalPages int64 `json:"totalPages"`
22+
TotalElements int64 `json:"totalElements"`
23+
Task []TaskDto `json:"content"`
24+
}
25+
26+
PostDto struct {
27+
ID string `json:"id,omitempty" form:"id" query:"id"`
28+
Name string `json:"name,omitempty" form:"name" query:"name" validate:"required,gte=5,lte=255"`
29+
CreatedDate string `json:"createdDate,omitempty" form:"createDate" query:"createDate"`
30+
LastModifiedDate string `json:"lastModifiedDate,omitempty"`
31+
CreatedByUser string `json:"createdByUser,omitempty"`
32+
LastModifiedByUser string `json:"lastModifiedByUser,omitempty"`
33+
Tasks []TaskDto `json:"tasks,omitempty"`
34+
}
35+
1036
Post struct {
1137
ID primitive.ObjectID `bson:"_id" json:"id,omitempty" form:"id" query:"id"`
1238
Name string `json:"name,omitempty" form:"name" query:"name" validate:"required,gte=5,lte=255"`
1339
CreatedDate time.Time `json:"createdDate,omitempty" form:"createDate" query:"createDate"`
14-
LastModifiedDate time.Time `json:"lastModifiedDate,omitempty"`
40+
LastModifiedDate *time.Time `json:"lastModifiedDate,omitempty"`
1541
CreatedByUser string `json:"createdByUser,omitempty"`
1642
LastModifiedByUser string `json:"lastModifiedByUser,omitempty"`
17-
Tasks []Task `json:"tasks,omitempty"`
43+
Tasks []TaskDto `json:"tasks,omitempty"`
1844
}
1945

20-
Task struct {
46+
TaskDto struct {
2147
ID primitive.ObjectID `bson:"_id" json:"id,omitempty" form:"id" query:"id"`
2248
Name string `json:"name,omitempty" form:"name" query:"name" validate:"required,gte=5,lte=255"`
2349
CreatedDate time.Time `json:"createdDate,omitempty" form:"createDate" query:"createDate"`

go-service/posts-api/rest/rest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func GetAllPosts(c echo.Context) error {
163163
size, _ = strconv.Atoi(c)
164164
}
165165
var searchByText string
166-
if strings.Contains(c.QueryString(), "&") {
166+
if strings.HasPrefix(c.QueryString(), "&") {
167167
searchByText = c.QueryString()
168168
searchByText = searchByText[0:strings.Index(searchByText, "&")]
169169
}

0 commit comments

Comments
 (0)