@@ -12,9 +12,9 @@ import (
1212type (
1313 PostService interface {
1414 CreatePost (ctx context.Context , userId string , req dto.PostCreateRequest ) (dto.PostResponse , error )
15- GetPostById (ctx context.Context , postId uuid. UUID ) (dto.PostRepliesResponse , error )
16- DeletePostById (ctx context.Context , postId uuid. UUID ) error
17- UpdatePostById (ctx context.Context , userId string , postId uuid. UUID , req dto.PostUpdateRequest ) (dto.PostResponse , error )
15+ GetPostById (ctx context.Context , postId uint64 ) (dto.PostRepliesResponse , error )
16+ DeletePostById (ctx context.Context , postId uint64 ) error
17+ UpdatePostById (ctx context.Context , userId string , postId uint64 , req dto.PostUpdateRequest ) (dto.PostResponse , error )
1818 GetAllPosts (ctx context.Context , req dto.PaginationRequest ) (dto.PostPaginationResponse , error )
1919 }
2020
@@ -58,7 +58,7 @@ func (s *postService) CreatePost(ctx context.Context, userId string, req dto.Pos
5858 }
5959
6060 return dto.PostResponse {
61- ID : result .ID . String () ,
61+ ID : result .ID ,
6262 Text : result .Text ,
6363 ParentID : req .ParentID ,
6464 User : dto.UserResponse {
@@ -71,7 +71,7 @@ func (s *postService) CreatePost(ctx context.Context, userId string, req dto.Pos
7171 }, nil
7272}
7373
74- func (s * postService ) GetPostById (ctx context.Context , postId uuid. UUID ) (dto.PostRepliesResponse , error ) {
74+ func (s * postService ) GetPostById (ctx context.Context , postId uint64 ) (dto.PostRepliesResponse , error ) {
7575 post , err := s .postRepo .GetPostById (ctx , nil , postId )
7676 if err != nil {
7777 return dto.PostRepliesResponse {}, dto .ErrGetPostById
@@ -85,7 +85,7 @@ func (s *postService) GetPostById(ctx context.Context, postId uuid.UUID) (dto.Po
8585 var data []dto.PostResponse
8686 for _ , reply := range replies .Replies {
8787 datum := dto.PostResponse {
88- ID : reply .ID . String () ,
88+ ID : reply .ID ,
8989 Text : reply .Text ,
9090 ParentID : reply .ParentID ,
9191 User : dto.UserResponse {
@@ -102,7 +102,7 @@ func (s *postService) GetPostById(ctx context.Context, postId uuid.UUID) (dto.Po
102102
103103 return dto.PostRepliesResponse {
104104 PostResponse : dto.PostResponse {
105- ID : post .ID . String () ,
105+ ID : post .ID ,
106106 Text : post .Text ,
107107 ParentID : post .ParentID ,
108108 User : dto.UserResponse {
@@ -124,7 +124,7 @@ func (s *postService) GetPostById(ctx context.Context, postId uuid.UUID) (dto.Po
124124 nil
125125}
126126
127- func (s * postService ) DeletePostById (ctx context.Context , postId uuid. UUID ) error {
127+ func (s * postService ) DeletePostById (ctx context.Context , postId uint64 ) error {
128128 _ , err := s .postRepo .GetPostById (ctx , nil , postId )
129129 if err != nil {
130130 return dto .ErrGetPostById
@@ -137,7 +137,7 @@ func (s *postService) DeletePostById(ctx context.Context, postId uuid.UUID) erro
137137 return nil
138138}
139139
140- func (s * postService ) UpdatePostById (ctx context.Context , userId string , postId uuid. UUID , req dto.PostUpdateRequest ) (dto.PostResponse , error ) {
140+ func (s * postService ) UpdatePostById (ctx context.Context , userId string , postId uint64 , req dto.PostUpdateRequest ) (dto.PostResponse , error ) {
141141 post , err := s .postRepo .GetPostById (ctx , nil , postId )
142142 if err != nil {
143143 return dto.PostResponse {}, dto .ErrGetPostById
@@ -155,7 +155,7 @@ func (s *postService) UpdatePostById(ctx context.Context, userId string, postId
155155 }
156156
157157 return dto.PostResponse {
158- ID : result .ID . String () ,
158+ ID : result .ID ,
159159 Text : result .Text ,
160160 ParentID : result .ParentID ,
161161 User : dto.UserResponse {
@@ -177,7 +177,7 @@ func (s *postService) GetAllPosts(ctx context.Context, req dto.PaginationRequest
177177 var data []dto.PostResponse
178178 for _ , post := range dataWithPaginate .Posts {
179179 datum := dto.PostResponse {
180- ID : post .ID . String () ,
180+ ID : post .ID ,
181181 Text : post .Text ,
182182 ParentID : post .ParentID ,
183183 User : dto.UserResponse {
0 commit comments