Przeglądaj źródła

:recycle: 重构代码.完善代码生成格式
:heavy_minus_sign: 移除依赖UPMS 的分布式事务依赖

冷冷 7 lat temu
rodzic
commit
af319bec48

+ 0 - 6
pigx-upms/pigx-upms-biz/pom.xml

@@ -102,12 +102,6 @@
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter-undertow</artifactId>
 		</dependency>
-		<!--分布式事务依赖-->
-		<dependency>
-			<groupId>com.pig4cloud</groupId>
-			<artifactId>pigx-common-transaction</artifactId>
-			<version>${pigx.version}</version>
-		</dependency>
 	</dependencies>
 
 	<build>

+ 4 - 5
pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/controller/SysSocialDetailsController.java

@@ -97,13 +97,12 @@ public class SysSocialDetailsController {
 	/**
 	 * 删除
 	 *
-	 * @param ids
+	 * @param id
 	 * @return R
 	 */
-	@DeleteMapping
-	public R delete(@RequestBody Integer[] ids) {
-		sysSocialDetailsService.deleteBatchIds(Arrays.asList(ids));
-		return new R<>(Boolean.TRUE);
+	@DeleteMapping("/{id}")
+	public R delete(@PathVariable Integer id ) {
+		return new R<>(sysSocialDetailsService.deleteById(id));
 	}
 
 	/**

+ 5 - 7
pigx-visual/pigx-codegen/src/main/resources/template/Controller.java.vm

@@ -56,8 +56,7 @@ public class ${className}Controller {
      */
     @PostMapping
     public R save(@RequestBody ${className} ${classname}){
-			${classname}Service.insert(${classname});
-			return new R<>(Boolean.TRUE);
+			return new R<>(${classname}Service.insert(${classname}));
     }
 
     /**
@@ -73,13 +72,12 @@ public class ${className}Controller {
 
     /**
      * 删除
-     * @param ${pk.lowerAttrName}s
+     * @param ${pk.lowerAttrName}
      * @return R
      */
-    @DeleteMapping
-    public R delete(@RequestBody ${pk.attrType}[] ${pk.lowerAttrName}s){
-			${classname}Service.deleteBatchIds(Arrays.asList(${pk.lowerAttrName}s));
-      return new R<>(Boolean.TRUE);
+    @DeleteMapping("/{${pk.lowerAttrName}}")
+    public R delete(@PathVariable ${pk.attrType} ${pk.lowerAttrName}){
+      return new R<>(${classname}Service.deleteById(${pk.lowerAttrName}));
     }
 
 }

+ 1 - 1
pigx-visual/pigx-codegen/src/main/resources/template/index.vue.vm

@@ -126,7 +126,7 @@
         type: 'warning'
       })
         .then(function() {
-          return delObj(row.clientId)
+          return delObj(row.$pk.lowerAttrName)
         })
         .then(data => {
         _this.tableData.splice(index, 1)