feat: fixing ppid data categories
This commit is contained in:
parent
66210b2eee
commit
cf2201426d
|
|
@ -2,10 +2,12 @@ package controller
|
|||
|
||||
import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/rs/zerolog"
|
||||
"go-humas-be/app/module/ppid_data_categories/request"
|
||||
"go-humas-be/app/module/ppid_data_categories/service"
|
||||
"go-humas-be/utils/paginator"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
utilRes "go-humas-be/utils/response"
|
||||
utilVal "go-humas-be/utils/validator"
|
||||
|
|
@ -13,6 +15,7 @@ import (
|
|||
|
||||
type ppidDataCategoriesController struct {
|
||||
ppidDataCategoriesService service.PpidDataCategoriesService
|
||||
Log zerolog.Logger
|
||||
}
|
||||
|
||||
type PpidDataCategoriesController interface {
|
||||
|
|
@ -57,6 +60,11 @@ func (_i *ppidDataCategoriesController) All(c *fiber.Ctx) error {
|
|||
IsOnlyTop: c.Query("isOnlyTop"),
|
||||
}
|
||||
req := reqContext.ToParamRequest()
|
||||
|
||||
_i.Log.Info().Str("timestamp", time.Now().
|
||||
Format(time.RFC3339)).Str("Service:All", "ppidDataCategoriesController").
|
||||
Interface("req", req).Msg("")
|
||||
|
||||
req.Pagination = paginate
|
||||
|
||||
ppidDataCategoriesData, paging, err := _i.ppidDataCategoriesService.All(req)
|
||||
|
|
|
|||
|
|
@ -72,8 +72,9 @@ func (req PpidDataCategoriesQueryRequestContext) ToParamRequest() PpidDataCatego
|
|||
}
|
||||
if parentIdStr := req.ParentId; parentIdStr != "" {
|
||||
parentId, err := strconv.ParseUint(parentIdStr, 10, 0)
|
||||
parentIdUint := uint(parentId)
|
||||
if err == nil {
|
||||
*request.ParentId = uint(parentId)
|
||||
request.ParentId = &parentIdUint
|
||||
}
|
||||
}
|
||||
if isOnlyTopStr := req.IsOnlyTop; isOnlyTopStr != "" {
|
||||
|
|
|
|||
Loading…
Reference in New Issue