Пользователи в незаменяемой часть
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
Ymnuk 2023-09-01 13:59:59 +03:00
parent 741a468941
commit 6e1fd8bfa9
2 changed files with 48 additions and 36 deletions

View File

@ -136,7 +136,7 @@ func generateModelBase() {
}
// db
if err := templ.PrepareTmplFile("tmpl/backend/db/model/user.tmpl", Project, filepath.Join(AppConfig.OutdirBackend, "db", "model", "user.go")); err != nil {
if err := templ.PrepareTmplIsNotExists("tmpl/backend/db/model/user.tmpl", Project, filepath.Join(AppConfig.OutdirBackend, "db", "model", "user.go")); err != nil {
log.Fatal(err)
}
if err := templ.PrepareTmplFile("tmpl/backend/db/db.tmpl", Project, filepath.Join(AppConfig.OutdirBackend, "db", "db.go")); err != nil {
@ -180,33 +180,47 @@ func generateModelBase() {
}
// route/api/user
if err := templ.PrepareTmplFile("tmpl/backend/route/api/user/index.tmpl", Project, filepath.Join(AppConfig.OutdirBackend, "route", "api", "user", "index.go")); err != nil {
log.Fatal(err)
}
if err := templ.PrepareTmplFile("tmpl/backend/route/api/user/ldap-search.tmpl", Project, filepath.Join(AppConfig.OutdirBackend, "route", "api", "user", "ldap-search.go")); err != nil {
log.Fatal(err)
}
if err := templ.PrepareTmplFile("tmpl/backend/route/api/user/get.tmpl", Project, filepath.Join(AppConfig.OutdirBackend, "route", "api", "user", "get.go")); err != nil {
log.Fatal(err)
}
if err := templ.PrepareTmplFile("tmpl/backend/route/api/user/list-users.tmpl", Project, filepath.Join(AppConfig.OutdirBackend, "route", "api", "user", "list-users.go")); err != nil {
log.Fatal(err)
}
if err := templ.PrepareTmplFile("tmpl/backend/route/api/user/post.tmpl", Project, filepath.Join(AppConfig.OutdirBackend, "route", "api", "user", "post.go")); err != nil {
log.Fatal(err)
}
if err := templ.PrepareTmplFile("tmpl/backend/route/api/user/lock.tmpl", Project, filepath.Join(AppConfig.OutdirBackend, "route", "api", "user", "lock.go")); err != nil {
log.Fatal(err)
}
if err := templ.PrepareTmplFile("tmpl/backend/route/api/user/unlock.tmpl", Project, filepath.Join(AppConfig.OutdirBackend, "route", "api", "user", "unlock.go")); err != nil {
log.Fatal(err)
}
if err := templ.PrepareTmplFile("tmpl/backend/route/api/user/put.tmpl", Project, filepath.Join(AppConfig.OutdirBackend, "route", "api", "user", "put.go")); err != nil {
log.Fatal(err)
}
if err := templ.PrepareTmplFile("tmpl/backend/route/api/user/delete.tmpl", Project, filepath.Join(AppConfig.OutdirBackend, "route", "api", "user", "delete.go")); err != nil {
log.Fatal(err)
}
staticTmpls := []structs.TmplInOut{
{
FileIn: "tmpl/backend/route/api/user/get.tmpl",
FileOut: filepath.Join(AppConfig.OutdirBackend, "route", "api", "user", "get.go"),
},
{
FileIn: "tmpl/backend/route/api/user/post.tmpl",
FileOut: filepath.Join(AppConfig.OutdirBackend, "route", "api", "user", "post.go"),
},
{
FileIn: "tmpl/backend/route/api/user/put.tmpl",
FileOut: filepath.Join(AppConfig.OutdirBackend, "route", "api", "user", "put.go"),
},
}
for _, item := range staticTmpls {
if err := templ.PrepareTmplIsNotExists(item.FileIn, Project, item.FileOut); err != nil {
log.Fatal(err)
}
}
// route/api/user/role
if err := templ.PrepareTmplFile("tmpl/backend/route/api/user/role/index.tmpl", Project, filepath.Join(AppConfig.OutdirBackend, "route", "api", "user", "role", "index.go")); err != nil {

View File

@ -74,31 +74,6 @@ func generateFrontendAngularTmpl() {
FileIn: "tmpl/frontend/angular/src/app/page/login/login.component.scss.tmpl",
FileOut: filepath.Join(AppConfig.OutdirFrontend, "src", "app", "page", "login", "login.component.scss"),
},
{
FileIn: "tmpl/frontend/angular/src/app/page/user/user-form/user-form.component.html.tmpl",
FileOut: filepath.Join(AppConfig.OutdirFrontend, "src", "app", "page", "user", "user-form", "user-form.component.html"),
},
{
FileIn: "tmpl/frontend/angular/src/app/page/user/user-form/user-form.component.scss.tmpl",
FileOut: filepath.Join(AppConfig.OutdirFrontend, "src", "app", "page", "user", "user-form", "user-form.component.scss"),
},
{
FileIn: "tmpl/frontend/angular/src/app/page/user/user-form/user-form.component.ts.tmpl",
FileOut: filepath.Join(AppConfig.OutdirFrontend, "src", "app", "page", "user", "user-form", "user-form.component.ts"),
},
{
FileIn: "tmpl/frontend/angular/src/app/page/user/user.component.html.tmpl",
FileOut: filepath.Join(AppConfig.OutdirFrontend, "src", "app", "page", "user", "user.component.html"),
},
{
FileIn: "tmpl/frontend/angular/src/app/page/user/user.component.scss.tmpl",
FileOut: filepath.Join(AppConfig.OutdirFrontend, "src", "app", "page", "user", "user.component.scss"),
},
{
FileIn: "tmpl/frontend/angular/src/app/page/user/user.component.ts.tmpl",
FileOut: filepath.Join(AppConfig.OutdirFrontend, "src", "app", "page", "user", "user.component.ts"),
},
{
FileIn: "tmpl/frontend/angular/src/app/app.component.html.tmpl",
FileOut: filepath.Join(AppConfig.OutdirFrontend, "src", "app", "app.component.html"),
@ -159,7 +134,6 @@ func generateFrontendAngularTmpl() {
FileIn: "tmpl/frontend/angular/tsconfig.spec.json.tmpl",
FileOut: filepath.Join(AppConfig.OutdirFrontend, "tsconfig.spec.json"),
},
{
FileIn: "tmpl/frontend/angular/options.json.tmpl",
FileOut: filepath.Join(AppConfig.OutdirFrontend, "options.json"),
@ -181,6 +155,30 @@ func generateFrontendAngularTmpl() {
}
staticTmpls = []structs.TmplInOut{
{
FileIn: "tmpl/frontend/angular/src/app/page/user/user-form/user-form.component.html.tmpl",
FileOut: filepath.Join(AppConfig.OutdirFrontend, "src", "app", "page", "user", "user-form", "user-form.component.html"),
},
{
FileIn: "tmpl/frontend/angular/src/app/page/user/user-form/user-form.component.scss.tmpl",
FileOut: filepath.Join(AppConfig.OutdirFrontend, "src", "app", "page", "user", "user-form", "user-form.component.scss"),
},
{
FileIn: "tmpl/frontend/angular/src/app/page/user/user-form/user-form.component.ts.tmpl",
FileOut: filepath.Join(AppConfig.OutdirFrontend, "src", "app", "page", "user", "user-form", "user-form.component.ts"),
},
{
FileIn: "tmpl/frontend/angular/src/app/page/user/user.component.html.tmpl",
FileOut: filepath.Join(AppConfig.OutdirFrontend, "src", "app", "page", "user", "user.component.html"),
},
{
FileIn: "tmpl/frontend/angular/src/app/page/user/user.component.scss.tmpl",
FileOut: filepath.Join(AppConfig.OutdirFrontend, "src", "app", "page", "user", "user.component.scss"),
},
{
FileIn: "tmpl/frontend/angular/src/app/page/user/user.component.ts.tmpl",
FileOut: filepath.Join(AppConfig.OutdirFrontend, "src", "app", "page", "user", "user.component.ts"),
},
{
FileIn: "tmpl/frontend/angular/package-lock.json.tmpl",
FileOut: filepath.Join(AppConfig.OutdirFrontend, "package-lock.json"),