add seeder

This commit is contained in:
vanilia
2025-12-09 19:20:58 +07:00
parent 69b38865a6
commit 4bbde1867a
9 changed files with 656 additions and 1 deletions
@@ -39,5 +39,4 @@ func getEntities(input string) []any {
func Migrate(input string) {
loader(input)
}
@@ -0,0 +1,18 @@
package doctor
import (
"net/http"
"simrs-vx/internal/use-case/simgos-sync-use-case/seeder/doctor"
rw "github.com/karincake/risoles"
)
type myBase struct{}
var O myBase
func (obj myBase) Seeder(w http.ResponseWriter, r *http.Request) {
err := doctor.SeedDoctor()
rw.DataResponse(w, nil, err)
}
@@ -30,6 +30,8 @@ import (
"simrs-vx/internal/interface/simgos-sync-handler/new/subspecialist"
"simrs-vx/internal/interface/simgos-sync-handler/new/unit"
ds "simrs-vx/internal/interface/simgos-sync-handler/seeder/doctor"
oldpatient "simrs-vx/internal/interface/simgos-sync-handler/old/patient"
oauth "simrs-vx/internal/interface/simgos-sync-handler/old/authentication" // just a reminder, an openauth
@@ -76,6 +78,12 @@ func SetRoutes() http.Handler {
})
hc.SyncCrud(r, prefixnew+"/v1/soapi", soapi.O)
/******************** SvcToNew ******************/
prefixseeder := "/new-seeder"
hk.GroupRoutes(prefixseeder+"/v1", r, hk.MapHandlerFunc{
"POST /doctor": ds.O.Seeder,
})
/******************** SvcToNew ******************/
prefixold := "/old-to-new"
hk.GroupRoutes(prefixold+"/v1/patient", r, oauth.OldGuardMW, hk.MapHandlerFunc{