@@ -42,8 +42,8 @@ const SQLServiceFile = "sqls-service.go.tmpl"
42
42
const MySQLDaoFile = "mysql-dao.go.tmpl"
43
43
const SQLModelFile = "sqls-model.go.tmpl"
44
44
45
- // utils file for common functions in controllers
46
- const UtilsControllerFile = "common.go.tmpl"
45
+ // common file for common utility functions in controllers
46
+ const ControllersCommonFile = "common.go.tmpl"
47
47
48
48
const DaoFile = "dao.go.tmpl"
49
49
const SQLiteDaoFile = "sqlite-dao.go.tmpl"
@@ -476,13 +476,13 @@ func (c *Copier) copyNoSQLDBResourceFiles(resourceName string, filePaths []*stri
476
476
filePaths = append (filePaths , & targetResourceControllerFileName )
477
477
478
478
// copy controller common file to a generated project
479
- targetResourceControllerUtilsFileName := c .NodeDirectoryName + ControllersPath + "/" + UtilsControllerFile
480
- _ , err = utils .CopyFile (targetResourceControllerUtilsFileName , c .TemplatesRootPath + ControllersPath + "/" + UtilsControllerFile )
479
+ targetResourceControllerCommonFileName := c .NodeDirectoryName + ControllersPath + "/" + ControllersCommonFile
480
+ _ , err = utils .CopyFile (targetResourceControllerCommonFileName , c .TemplatesRootPath + ControllersPath + "/" + ControllersCommonFile )
481
481
if err != nil {
482
482
log .Debugf ("error copying controller utils file: %v" , err )
483
483
return nil , err
484
484
}
485
- filePaths = append (filePaths , & targetResourceControllerUtilsFileName )
485
+ filePaths = append (filePaths , & targetResourceControllerCommonFileName )
486
486
487
487
// copy model files to a generated project
488
488
targetResourceModelFileName := c .NodeDirectoryName + ModelsPath + "/" + resourceName + "-" + strings .Replace (NoSQLModelFile , "nosqls-" , "" , 1 )
@@ -528,13 +528,13 @@ func (c *Copier) copySQLDBResourceFiles(resourceName string, filePaths []*string
528
528
filePaths = append (filePaths , & targetResourceControllerFileName )
529
529
530
530
// copy controller common file to a generated project
531
- targetResourceControllerUtilsFileName := c .NodeDirectoryName + ControllersPath + "/" + UtilsControllerFile
532
- _ , err = utils .CopyFile (targetResourceControllerUtilsFileName , c .TemplatesRootPath + ControllersPath + "/" + UtilsControllerFile )
531
+ targetResourceControllerCommonFileName := c .NodeDirectoryName + ControllersPath + "/" + ControllersCommonFile
532
+ _ , err = utils .CopyFile (targetResourceControllerCommonFileName , c .TemplatesRootPath + ControllersPath + "/" + ControllersCommonFile )
533
533
if err != nil {
534
534
log .Debugf ("error copying controller utils file: %v" , err )
535
535
return nil , err
536
536
}
537
- filePaths = append (filePaths , & targetResourceControllerUtilsFileName )
537
+ filePaths = append (filePaths , & targetResourceControllerCommonFileName )
538
538
539
539
// copy service files to a generated project
540
540
targetResourceServiceFileName := c .NodeDirectoryName + ServicesPath + "/" + resourceName + "-" + strings .Replace (SQLServiceFile , "sqls-" , "" , 1 )
0 commit comments