Browse Source

调整生成代码

zhangweixin 4 years ago
parent
commit
125b7b364e
2 changed files with 11 additions and 6 deletions
  1. 10 5
      docs/.vuepress/components/TableDesig.vue
  2. 1 1
      docs/README.md

+ 10 - 5
docs/.vuepress/components/TableDesig.vue

@@ -155,6 +155,11 @@ open class ${className} {
         private val logger = LoggerFactory.getLogger(${className}::class.java)
     } // Companion object
 
+
+    /** 服务 */
+    val service = SBaseService(SMybatisDao(${this.toHump(this.table)}::class.java))
+
+
      /**
      * 创建${this.tableName}
      *
@@ -167,7 +172,7 @@ open class ${className} {
       this.table
     )}>): SCreateResponse<${this.toHump(this.table)}> {
 
-        return ${this.toHump(this.table)}Service.createList( request)
+        return service.createList( request)
     } // Function create()
 
     /**
@@ -181,7 +186,7 @@ open class ${className} {
     fun delete(@RequestBody idList: ArrayList<${this.toHump(
       this.table
     )}>): SBaseResponse {
-        return ${this.toHump(this.table)}Service.deleteByKeysList(idList)
+        return service.deleteByKeysList(idList)
     } // Function delete()
 
     /**
@@ -195,7 +200,7 @@ open class ${className} {
     fun update(@RequestBody request: SUpdateRequest<${this.toHump(
       this.table
     )}>): SBaseResponse {
-        return ${this.toHump(this.table)}Service.updateList(request)
+        return service.updateList(request)
     } // Function update()
 
     /**
@@ -209,7 +214,7 @@ open class ${className} {
     fun query(@RequestBody request: SQueryRequest): SQueryResponse<${this.toHump(
       this.table
     )}> {
-        return ${this.toHump(this.table)}Service.pageQuery(request)
+        return service.pageQuery(request)
     } // Function query()
 
     /**
@@ -218,7 +223,7 @@ open class ${className} {
     @ApiOperation(value = "根据条件查询统计数量", notes = "")
     @PostMapping(value = ["/count"])
     fun count(@RequestBody request: SCountRequest): SCountResponse {
-        return ${this.toHump(this.table)}Service.count(request)
+        return servicee.count(request)
     } // Function count()
     `);
       strBuild.append(`} // Class ${className}`);

+ 1 - 1
docs/README.md

@@ -11,4 +11,4 @@ footer: MIT Licensed | Copyright © 2009-present 北京博锐尚格科技有限
 
 # 参考文档
 
-
+<-----ServiceApi sys="datacenter"/>