feat: fixing ppid data categories
This commit is contained in:
parent
fbe60ee30e
commit
66210b2eee
|
|
@ -9,8 +9,10 @@ import (
|
||||||
func PpidDataCategoriesResponseMapper(ppidDataCategoriesReq *entity.PpidDataCategories, childPpidDataCategoriesReq []*entity.PpidDataCategories) (ppidDataCategoriesRes *res.PpidDataCategoriesResponse) {
|
func PpidDataCategoriesResponseMapper(ppidDataCategoriesReq *entity.PpidDataCategories, childPpidDataCategoriesReq []*entity.PpidDataCategories) (ppidDataCategoriesRes *res.PpidDataCategoriesResponse) {
|
||||||
if ppidDataCategoriesReq != nil {
|
if ppidDataCategoriesReq != nil {
|
||||||
var childPpidDataCategoriesRes []*res.PpidDataCategoriesResponse
|
var childPpidDataCategoriesRes []*res.PpidDataCategoriesResponse
|
||||||
for _, item := range childPpidDataCategoriesReq {
|
if childPpidDataCategoriesReq != nil && len(childPpidDataCategoriesReq) > 0 {
|
||||||
childPpidDataCategoriesRes = append(childPpidDataCategoriesRes, PpidDataCategoriesResponseMapper(item, nil))
|
for _, item := range childPpidDataCategoriesReq {
|
||||||
|
childPpidDataCategoriesRes = append(childPpidDataCategoriesRes, PpidDataCategoriesResponseMapper(item, nil))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ppidDataCategoriesRes = &res.PpidDataCategoriesResponse{
|
ppidDataCategoriesRes = &res.PpidDataCategoriesResponse{
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ func (_i *ppidDataCategoriesRepository) GetAll(req request.PpidDataCategoriesQue
|
||||||
var count int64
|
var count int64
|
||||||
|
|
||||||
_i.Log.Info().Str("timestamp", time.Now().
|
_i.Log.Info().Str("timestamp", time.Now().
|
||||||
Format(time.RFC3339)).Str("Service:GetAll", "Interface:ppidDataCategoriesRepository").
|
Format(time.RFC3339)).Str("Service:GetAlls", "Interface:ppidDataCategoriesRepository").
|
||||||
Interface("req", req).Msg("")
|
Interface("req", req).Msg("")
|
||||||
|
|
||||||
query := _i.DB.DB.Model(&entity.PpidDataCategories{})
|
query := _i.DB.DB.Model(&entity.PpidDataCategories{})
|
||||||
|
|
@ -134,6 +134,10 @@ func (_i *ppidDataCategoriesRepository) FindOneBySlug(slug string) (ppidDataCate
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_i.Log.Info().Str("timestamp", time.Now().
|
||||||
|
Format(time.RFC3339)).Str("Service:FindOneBySlug", "Interface:FindOneBySlug").
|
||||||
|
Interface("ppidDataCategories", ppidDataCategories).Msg("")
|
||||||
|
|
||||||
return ppidDataCategories, nil
|
return ppidDataCategories, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,10 @@ func (_i *ppidDataCategoriesService) ShowBySlug(slug string) (ppidDataCategories
|
||||||
}
|
}
|
||||||
|
|
||||||
req := request.PpidDataCategoriesQueryRequest{
|
req := request.PpidDataCategoriesQueryRequest{
|
||||||
ParentId: result.ParentId,
|
ParentId: &result.ID,
|
||||||
|
Pagination: &paginator.Pagination{
|
||||||
|
Limit: 20,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
subResult, _, _ := _i.Repo.GetAll(req)
|
subResult, _, _ := _i.Repo.GetAll(req)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue