From f6d177f2f13662b0f7ffa1bbb82c3d16390fd899 Mon Sep 17 00:00:00 2001 From: Sas Andy Date: Fri, 10 May 2024 09:23:40 +0700 Subject: [PATCH] patient underdev --- handlers/corporate/patient.handlers.go | 26 +++++ handlers/routes.go | 2 + services/corporate/patient.services.go | 15 +++ views/corporate/patient/patient.templ | 40 +++++++ views/corporate/patient/patient_templ.go | 131 +++++++++++++++++++++++ 5 files changed, 214 insertions(+) create mode 100644 handlers/corporate/patient.handlers.go create mode 100644 services/corporate/patient.services.go create mode 100644 views/corporate/patient/patient.templ create mode 100644 views/corporate/patient/patient_templ.go diff --git a/handlers/corporate/patient.handlers.go b/handlers/corporate/patient.handlers.go new file mode 100644 index 0000000..47dcdf5 --- /dev/null +++ b/handlers/corporate/patient.handlers.go @@ -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) +} diff --git a/handlers/routes.go b/handlers/routes.go index c0947c2..4c328ef 100644 --- a/handlers/routes.go +++ b/handlers/routes.go @@ -75,6 +75,8 @@ func SetupRoutesCorporate(app *echo.Echo, appStore db.AppStore) { 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) { diff --git a/services/corporate/patient.services.go b/services/corporate/patient.services.go new file mode 100644 index 0000000..7d22b22 --- /dev/null +++ b/services/corporate/patient.services.go @@ -0,0 +1,15 @@ +package corporate_services + +import "cpone/db" + +type ServicesPatient struct { + PatientStore db.AppStore +} + +func NewServicesPatient(uStore db.AppStore) *ServicesPatient { + + return &ServicesPatient{ + + PatientStore: uStore, + } +} diff --git a/views/corporate/patient/patient.templ b/views/corporate/patient/patient.templ new file mode 100644 index 0000000..b2dfa42 --- /dev/null +++ b/views/corporate/patient/patient.templ @@ -0,0 +1,40 @@ +package corporate_company + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +templ Content() { +
+ @under_development.UnderDevelopment() +
+} + +templ Css() { + +} + +templ Js() { +} + +templ Show() { + @layout.PlaygroundLayout("Corp Patient", Css(), Js()) { + @Content() + } +} diff --git a/views/corporate/patient/patient_templ.go b/views/corporate/patient/patient_templ.go new file mode 100644 index 0000000..ae0cfb4 --- /dev/null +++ b/views/corporate/patient/patient_templ.go @@ -0,0 +1,131 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package corporate_company + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +func Content() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = under_development.UnderDevelopment().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Css() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Js() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Show() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var4 := templ.GetChildren(ctx) + if templ_7745c5c3_Var4 == nil { + templ_7745c5c3_Var4 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var5 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + templ_7745c5c3_Err = Content().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = layout.PlaygroundLayout("Corp Patient", Css(), Js()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +}