Merge remote-tracking branch 'origin/andy/routingall'

This commit is contained in:
Sas Andy
2024-05-10 14:48:40 +07:00
47 changed files with 2862 additions and 3 deletions

View File

@@ -0,0 +1,26 @@
package client_handlers
import (
"cpone/utils"
client_dashboard "cpone/views/client/dashboard"
"github.com/labstack/echo/v4"
)
type ClientDashboardService interface {
}
func NewClientDashboardHandler(us ClientDashboardService) *ClientDashboardHandler {
return &ClientDashboardHandler{
ClientDashboardService: us,
}
}
type ClientDashboardHandler struct {
ClientDashboardService ClientDashboardService
}
func (uh *ClientDashboardHandler) ShowClientDashboard(c echo.Context) error {
helo := client_dashboard.Show()
return utils.View(c, helo)
}

View File

@@ -0,0 +1,26 @@
package client_handlers
import (
"cpone/utils"
client_mcupreregister "cpone/views/client/mcupreregister"
"github.com/labstack/echo/v4"
)
type MCUPreregisterService interface {
}
func NewMCUPreregisterHandler(us MCUPreregisterService) *MCUPreregisterHandler {
return &MCUPreregisterHandler{
MCUPreregisterService: us,
}
}
type MCUPreregisterHandler struct {
MCUPreregisterService MCUPreregisterService
}
func (uh *MCUPreregisterHandler) ShowMCUPreregister(c echo.Context) error {
helo := client_mcupreregister.Show()
return utils.View(c, helo)
}

View File

@@ -0,0 +1,26 @@
package client_handlers
import (
"cpone/utils"
client_mcusetup "cpone/views/client/mcusetup"
"github.com/labstack/echo/v4"
)
type MCUSetupService interface {
}
func NewMCUSetupHandler(us MCUSetupService) *MCUSetupHandler {
return &MCUSetupHandler{
MCUSetupService: us,
}
}
type MCUSetupHandler struct {
MCUSetupService MCUSetupService
}
func (uh *MCUSetupHandler) ShowMCUSetup(c echo.Context) error {
helo := client_mcusetup.Show()
return utils.View(c, helo)
}

View File

@@ -0,0 +1,26 @@
package client_handlers
import (
"cpone/utils"
client_mdcorp "cpone/views/client/mdcorp"
"github.com/labstack/echo/v4"
)
type MdCorpService interface {
}
func NewMdCorpHandler(us MdCorpService) *MdCorpHandler {
return &MdCorpHandler{
MdCorpService: us,
}
}
type MdCorpHandler struct {
MdCorpService MdCorpService
}
func (uh *MdCorpHandler) ShowMdCorp(c echo.Context) error {
helo := client_mdcorp.Show()
return utils.View(c, helo)
}

View File

@@ -0,0 +1,26 @@
package client_handlers
import (
"cpone/utils"
client_mdprofile "cpone/views/client/mdprofile"
"github.com/labstack/echo/v4"
)
type MdProfileService interface {
}
func NewMdProfileHandler(us MdProfileService) *MdProfileHandler {
return &MdProfileHandler{
MdProfileService: us,
}
}
type MdProfileHandler struct {
MdProfileService MdProfileService
}
func (uh *MdProfileHandler) ShowMdProfile(c echo.Context) error {
helo := client_mdprofile.Show()
return utils.View(c, helo)
}

View File

@@ -0,0 +1,26 @@
package client_handlers
import (
"cpone/utils"
client_mdtest "cpone/views/client/mdtest"
"github.com/labstack/echo/v4"
)
type MdTestService interface {
}
func NewMdTestHandler(us MdTestService) *MdTestHandler {
return &MdTestHandler{
MdTestService: us,
}
}
type MdTestHandler struct {
MdTestService MdTestService
}
func (uh *MdTestHandler) ShowMdTest(c echo.Context) error {
helo := client_mdtest.Show()
return utils.View(c, helo)
}

View File

@@ -0,0 +1,26 @@
package client_handlers
import (
"cpone/utils"
client_mduser "cpone/views/client/mduser"
"github.com/labstack/echo/v4"
)
type MdUserService interface {
}
func NewMdUserHandler(us MdUserService) *MdUserHandler {
return &MdUserHandler{
MdUserService: us,
}
}
type MdUserHandler struct {
MdUserService MdUserService
}
func (uh *MdUserHandler) ShowMdUser(c echo.Context) error {
helo := client_mduser.Show()
return utils.View(c, helo)
}

View File

@@ -0,0 +1,26 @@
package client_handlers
import (
"cpone/utils"
client_mdusergroup "cpone/views/client/mdusergroup"
"github.com/labstack/echo/v4"
)
type MdUserGroupService interface {
}
func NewMdUserGroupHandler(us MdUserGroupService) *MdUserGroupHandler {
return &MdUserGroupHandler{
MdUserGroupService: us,
}
}
type MdUserGroupHandler struct {
MdUserGroupService MdUserGroupService
}
func (uh *MdUserGroupHandler) ShowMdUserGroup(c echo.Context) error {
helo := client_mdusergroup.Show()
return utils.View(c, helo)
}

View File

@@ -0,0 +1,26 @@
package client_handlers
import (
"cpone/utils"
client_transaksisamplestation "cpone/views/client/TransaksiSampleStation"
"github.com/labstack/echo/v4"
)
type TransaksiSampleStationService interface {
}
func NewTransaksiSampleStationHandler(us TransaksiSampleStationService) *TransaksiSampleStationHandler {
return &TransaksiSampleStationHandler{
TransaksiSampleStationService: us,
}
}
type TransaksiSampleStationHandler struct {
TransaksiSampleStationService TransaksiSampleStationService
}
func (uh *TransaksiSampleStationHandler) ShowTransaksiSampleStation(c echo.Context) error {
helo := client_transaksisamplestation.Show()
return utils.View(c, helo)
}

View File

@@ -0,0 +1,26 @@
package corporate_handlers
import (
"cpone/utils"
corporate_patient "cpone/views/corporate/Patient"
"github.com/labstack/echo/v4"
)
type PatientService interface {
}
func NewPatientHandler(us PatientService) *PatientHandler {
return &PatientHandler{
PatientService: us,
}
}
type PatientHandler struct {
PatientService PatientService
}
func (uh *PatientHandler) ShowPatient(c echo.Context) error {
helo := corporate_patient.Show()
return utils.View(c, helo)
}

View File

@@ -0,0 +1,33 @@
package public_handlers
import (
"cpone/utils"
public_login "cpone/views/public/login"
"github.com/labstack/echo/v4"
)
type LoginService interface {
}
func NewLoginHandler(us LoginService) *LoginHandler {
return &LoginHandler{
LoginService: us,
}
}
type LoginHandler struct {
LoginService LoginService
}
// func (uh *LoginHandler) ShowLogin(c echo.Context) error {
// helo := client_Login.Show()
// return utils.View(c, helo)
// }
func (lh *LoginHandler) HandlerShowLogin(c echo.Context) error {
si := public_login.ShowLogin("Login ", public_login.MainLogin(), public_login.CssLogin(), public_login.JsLogin())
return utils.View(c, si)
}

View File

@@ -67,19 +67,20 @@ func SetupRoutesPublic(app *echo.Echo, appStore db.AppStore) {
l := public_services.NewServicesLandingPage(public_services.LandingPage{}, appStore)
lh := public_handlers.NewLandingPageHandler(l)
public.GET("landingpage", lh.ShowLandingPage)
loginHdr := public_handlers.NewLoginHandler(l)
public.GET("login", loginHdr.HandlerShowLogin)
}
func SetupRoutesCorporate(app *echo.Echo, appStore db.AppStore) {
public := app.Group("/corp")
l := corporate_services.NewServicesCompany(appStore)
lh := corporate_handlers.NewCompanyHandler(l)
public.GET("/company", lh.ShowCompany)
patientHandler := corporate_handlers.NewPatientHandler(l)
public.GET("/patient", patientHandler.ShowPatient)
}
func SetupRoutesClient(app *echo.Echo, appStore db.AppStore) {
public := app.Group("/client")
l := client_services.NewServicesMdBahan(appStore)
lh := client_handlers.NewMdBahanHandler(l)
public.GET("/md/bahan", lh.ShowMdBahan)
lpanel := client_services.NewServicesMdPanel(appStore)
lhpanel := client_handlers.NewMdPanelHandler(lpanel)
@@ -124,4 +125,53 @@ func SetupRoutesClient(app *echo.Echo, appStore db.AppStore) {
lsampletype := client_services.NewServicesMdSampleType(appStore)
lhsampletype := client_handlers.NewMdSampleTypeHandler(lsampletype)
public.GET("/md/sampletype", lhsampletype.ShowMdSampleType)
//MD BAHAN
mdBahanService := client_services.NewServicesMdBahan(appStore)
mdbahanHandler := client_handlers.NewMdBahanHandler(mdBahanService)
public.GET("/md/bahan", mdbahanHandler.ShowMdBahan)
//Client Dahboard
clientDashboardService := client_services.NewServicesClientDashboard(appStore)
clientdshbrdHandler := client_handlers.NewClientDashboardHandler(clientDashboardService)
public.GET("", clientdshbrdHandler.ShowClientDashboard)
//MD User
mdUserService := client_services.NewServicesMdUser(appStore)
mdUserHandler := client_handlers.NewMdUserHandler(mdUserService)
public.GET("/md/user", mdUserHandler.ShowMdUser)
// MD Corp
mdCorpService := client_services.NewServicesMdCorp(appStore)
mdCorpHandler := client_handlers.NewMdCorpHandler(mdCorpService)
public.GET("/md/corp", mdCorpHandler.ShowMdCorp)
// Md User Group
mdUserGroupService := client_services.NewServicesMdUserGroup(appStore)
mdUserGroupHandler := client_handlers.NewMdUserGroupHandler(mdUserGroupService)
public.GET("/md/usergroup", mdUserGroupHandler.ShowMdUserGroup)
//MD Test
mdTestService := client_services.NewServicesMdTest(appStore)
mdTestHandler := client_handlers.NewMdTestHandler(mdTestService)
public.GET("/md/test", mdTestHandler.ShowMdTest)
//MD Profile
mdProfileService := client_services.NewServicesMdProfile(appStore)
mdProfileHandler := client_handlers.NewMdProfileHandler(mdProfileService)
public.GET("/md/profile", mdProfileHandler.ShowMdProfile)
//MCU Setup
mcuSetupService := client_services.NewServicesMCUSetup(appStore)
mcuSetupHandler := client_handlers.NewMCUSetupHandler(mcuSetupService)
public.GET("/mcu/setup", mcuSetupHandler.ShowMCUSetup)
//MCU Preregister
mcuPreregisterService := client_services.NewServicesMCUPreregister(appStore)
mcuPreregisterHandler := client_handlers.NewMCUPreregisterHandler(mcuPreregisterService)
public.GET("/mcu/preregister", mcuPreregisterHandler.ShowMCUPreregister)
//Transaksi Sample Station
txSampleStationService := client_services.NewServicesTransaksiSampleStation(appStore)
txSampleStationHandler := client_handlers.NewTransaksiSampleStationHandler(txSampleStationService)
public.GET("/transaksi/samplestation", txSampleStationHandler.ShowTransaksiSampleStation)
}