Prechádzať zdrojové kódy

增加保存时,返回id

xiewenjie 3 rokov pred
rodič
commit
b81953def4

+ 5 - 3
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/SceneLightStyleController.java

@@ -68,9 +68,11 @@ public class SceneLightStyleController extends BaseController {
             sceneLightStyleService.updateById(entity);
             return Result.success();
         }
-
-        sceneLightStyleService.save(entity);
-        return Result.success();
+        boolean save = sceneLightStyleService.save(entity);
+        if (save) {
+            return Result.success("保存成功", entity.getId());
+        }
+        return failure(4001, "保存失败");
     }
 
     /**