coba pagination

This commit is contained in:
Sas Andy
2024-05-14 09:01:27 +07:00
parent 49c80c912b
commit 0af34a2e33
4 changed files with 109 additions and 40 deletions

View File

@@ -17,6 +17,7 @@ import (
"github.com/a-h/templ"
"github.com/labstack/echo/v4"
"go.uber.org/zap"
)
type MasterMenuUserGroupService interface {
@@ -52,8 +53,7 @@ func (lh *MasterMenuUserGroupHandler) HandlerShowMasterMenuUserGroup(c echo.Cont
return err
}
dataUserGroup, err := lh.MasterMenuUserGroupService.GetUserGroup()
fmt.Println(dataUserGroup)
fmt.Println(err)
if err != nil {
fmt.Println(dataUserGroup)
return err
@@ -61,6 +61,13 @@ func (lh *MasterMenuUserGroupHandler) HandlerShowMasterMenuUserGroup(c echo.Cont
contentID := utils.GenerateRandomID("tablebody")
logger, _ := zap.NewProduction()
defer logger.Sync()
logger.Info("LOAD USER GROUP DEV",
zap.String("id", contentID),
zap.Any("data", dataUserGroup),
)
si := mastermenuusergroup.ShowMasterMenuUserGroup(
"Master Menu",
mastermenuusergroup.ContentMasterMenuUserGroup(dataUserGroup, contentID),
@@ -273,6 +280,12 @@ func (lh *MasterMenuUserGroupHandler) HandleChangePage(c echo.Context) error {
fmt.Println("currpage err")
return err
}
logger, _ := zap.NewProduction()
defer logger.Sync()
logger.Info("CHANGE PAGE USER GROUP DEV",
zap.String("id", contentID),
zap.Any("data", dataUserGroup),
)
time.Sleep(3 * time.Second)
// time.Sleep(5 * time.Second)
vw := tablecomponent.Table([]string{"KODE", "USERGROUP", "AKSI"},

View File

@@ -183,6 +183,8 @@ func SetupRoutesDev(app *echo.Echo, appStore db.AppStore) {
dvlpserv := dev_services.NewServicesLandingPage(appStore)
devlphan := dev_handlers.NewLandingPageHandler(dvlpserv)
dev.GET("/landingpage", devlphan.ShowLandingPage)
//DEV USERGROUP
devUGServices := dev_services.NewServicesMasterMenuUserGroup(appStore)
devUGhandlers := dev_handlers.NewMasterMenuUserGroupHandler(devUGServices)
dev.GET("/usergroup", devUGhandlers.HandlerShowMasterMenuUserGroup)