clear store

This commit is contained in:
Sas Andy
2024-05-13 14:35:40 +07:00
parent 1a4f1ee2d6
commit 93186320d7
13 changed files with 22 additions and 145 deletions

View File

@@ -1,30 +0,0 @@
package db
import (
"cpone/package/database"
"database/sql"
_ "github.com/glebarez/go-sqlite"
)
type PieChartStore struct {
Db *sql.DB
}
type BarChartStore struct {
Db *sql.DB
}
func NewPieChartStore(dbName string) (PieChartStore, error) {
Db := database.Handle
return PieChartStore{
Db,
}, nil
}
func NewBarChartStore(dbName string) (BarChartStore, error) {
Db := database.Handle
return BarChartStore{
Db,
}, nil
}

View File

@@ -1,20 +0,0 @@
package db
import (
"cpone/package/database"
"database/sql"
_ "github.com/glebarez/go-sqlite"
)
type EmployeeStore struct {
Db *sql.DB
}
func NewEmployeeStore(dbName string) (EmployeeStore, error) {
Db := database.Handle
return EmployeeStore{
Db,
}, nil
}

View File

@@ -1,20 +0,0 @@
package db
import (
"cpone/package/database"
"database/sql"
_ "github.com/glebarez/go-sqlite"
)
type LandingPageStore struct {
Db *sql.DB
}
func NewLandingPageStore(dbName string) (LandingPageStore, error) {
Db := database.Handle
return LandingPageStore{
Db,
}, nil
}

View File

@@ -1,20 +0,0 @@
package db
import (
"cpone/package/database"
"database/sql"
_ "github.com/glebarez/go-sqlite"
)
type LoginStore struct {
Db *sql.DB
}
func NewLoginStore(dbName string) (LoginStore, error) {
Db := database.Handle
return LoginStore{
Db,
}, nil
}

View File

@@ -1,20 +0,0 @@
package db
import (
"cpone/package/database"
"database/sql"
_ "github.com/glebarez/go-sqlite"
)
type MasterMenuUserGroupStore struct {
Db *sql.DB
}
func NewMasterMenuUserGroupStore(dbName string) (MasterMenuUserGroupStore, error) {
Db := database.Handle
return MasterMenuUserGroupStore{
Db,
}, nil
}

View File

@@ -1,20 +0,0 @@
package db
import (
"cpone/package/database"
"database/sql"
_ "github.com/glebarez/go-sqlite"
)
type XsampleStore struct {
Db *sql.DB
}
func NewXsampleStore(dbName string) (XsampleStore, error) {
Db := database.Handle
return XsampleStore{
Db,
}, nil
}

View File

@@ -7,6 +7,7 @@ import (
public_handlers "cpone/handlers/public"
client_services "cpone/services/client"
corporate_services "cpone/services/corporate"
dev_services "cpone/services/dev"
public_services "cpone/services/public"
"cpone/db"
@@ -176,4 +177,10 @@ func SetupRoutesClient(app *echo.Echo, appStore db.AppStore) {
public.GET("/transaksi/samplestation", txSampleStationHandler.ShowTransaksiSampleStation)
}
func SetupRoutesDev(app *echo.Echo, appStore db.AppStore) {}
func SetupRoutesDev(app *echo.Echo, appStore db.AppStore) {
dev := app.Group("/dev")
dvlpserv := dev_services.NewServicesLandingPage(appStore)
devlphan := dev_handlers.NewLandingPageHandler(dvlpserv)
dev.GET("/landingpage", devlphan.ShowLandingPage)
}

View File

@@ -6,7 +6,7 @@ import (
"cpone/db"
)
func NewServicesPiechart(u Piechart, b Barchart, uStore db.PieChartStore, bStore db.BarChartStore) *ServicesPiechart {
func NewServicesPiechart(u Piechart, b Barchart, uStore db.AppStore, bStore db.AppStore) *ServicesPiechart {
return &ServicesPiechart{
Piechart: u,
@@ -126,8 +126,8 @@ type Piechart struct {
type ServicesPiechart struct {
Piechart Piechart
Barchart Barchart
BarChartStore db.BarChartStore
PieChartStore db.PieChartStore
BarChartStore db.AppStore
PieChartStore db.AppStore
}
// func (su *ServicesPiechart) GetAllXsamples() ([]Piechart, error) {

View File

@@ -6,7 +6,7 @@ import (
"cpone/db"
)
func NewServicesEmployee(u Employee, uStore db.EmployeeStore) *ServicesEmployee {
func NewServicesEmployee(u Employee, uStore db.AppStore) *ServicesEmployee {
return &ServicesEmployee{
Employee: u,
@@ -31,7 +31,7 @@ type EmployeeService struct {
type ServicesEmployee struct {
Employee Employee
EmployeeStore db.EmployeeStore
EmployeeStore db.AppStore
}
func (se *ServicesEmployee) GetEmployeeService() ([]EmployeeService, error) {

View File

@@ -6,10 +6,10 @@ import (
"cpone/db"
)
func NewServicesLandingPage(u LandingPage, uStore db.LandingPageStore) *ServicesLandingPage {
func NewServicesLandingPage(uStore db.AppStore) *ServicesLandingPage {
return &ServicesLandingPage{
LandingPage: u,
LandingPageStore: uStore,
}
}
@@ -54,7 +54,7 @@ type FooterNav struct {
type ServicesLandingPage struct {
LandingPage LandingPage
LandingPageStore db.LandingPageStore
LandingPageStore db.AppStore
}
func (su *ServicesLandingPage) GetAllLandingPages() ([]LandingPage, error) {

View File

@@ -6,7 +6,7 @@ import (
"cpone/db"
)
func NewServicesLogin(u Login, uStore db.LoginStore) *ServicesLogin {
func NewServicesLogin(u Login, uStore db.AppStore) *ServicesLogin {
return &ServicesLogin{
Login: u,
@@ -24,7 +24,7 @@ type Login struct {
type ServicesLogin struct {
Login Login
LoginStore db.LoginStore
LoginStore db.AppStore
}
func (su *ServicesLogin) GetLogin(Email string, Password string) (Login, error) {

View File

@@ -9,7 +9,7 @@ import (
"cpone/utils"
)
func NewServicesMasterMenuUserGroup(u MasterMenu, uStore db.MasterMenuUserGroupStore) *ServicesMasterMenuUserGroup {
func NewServicesMasterMenuUserGroup(u MasterMenu, uStore db.AppStore) *ServicesMasterMenuUserGroup {
return &ServicesMasterMenuUserGroup{
MasterMenu: u,
@@ -43,7 +43,7 @@ type MasterMenu struct {
type ServicesMasterMenuUserGroup struct {
MasterMenu MasterMenu
MasterMenuUserGroupStore db.MasterMenuUserGroupStore
MasterMenuUserGroupStore db.AppStore
}
type AutoComplete struct {

View File

@@ -6,7 +6,7 @@ import (
"cpone/db"
)
func NewServicesXsample(u Xsample, uStore db.XsampleStore) *ServicesXsample {
func NewServicesXsample(u Xsample, uStore db.AppStore) *ServicesXsample {
return &ServicesXsample{
Xsample: u,
@@ -23,7 +23,7 @@ type Xsample struct {
type ServicesXsample struct {
Xsample Xsample
XsampleStore db.XsampleStore
XsampleStore db.AppStore
}
func (su *ServicesXsample) GetAllXsamples() ([]Xsample, error) {