Selaa lähdekoodia

构造授权文件时预留app对象

luoshi 2 vuotta sitten
vanhempi
commit
c834c49449

+ 2 - 1
src/main/java/com/qmth/ops/api/controller/admin/DeployController.java

@@ -150,7 +150,8 @@ public class DeployController {
         }
         response.setContentType("application/octet-stream; charset=utf-8");
         response.setHeader("Content-Disposition", "attachment; filename=app.lic");
-        licenseService.buildLicense(deploy, deviceId, versionName, response.getOutputStream());
+        licenseService.buildLicense(deploy, appService.getById(deploy.getAppId()), deviceId, versionName,
+                response.getOutputStream());
     }
 
     @PostMapping("/org/list")

+ 3 - 2
src/main/java/com/qmth/ops/biz/service/LicenseService.java

@@ -9,6 +9,7 @@ import com.qmth.boot.tools.crypto.RSA;
 import com.qmth.boot.tools.crypto.RsaHelper;
 import com.qmth.boot.tools.device.DeviceInfo;
 import com.qmth.boot.tools.models.ByteArray;
+import com.qmth.ops.biz.domain.App;
 import com.qmth.ops.biz.domain.Deploy;
 import com.qmth.ops.biz.domain.Org;
 import com.qmth.ops.biz.query.OrgQuery;
@@ -44,8 +45,8 @@ public class LicenseService {
         return new ObjectMapper().readValue(privateKey.decrypt(file.getBytes()).value(), DeviceInfo.class);
     }
 
-    public void buildLicense(@NotNull Deploy deploy, String deviceId, String version, @NotNull OutputStream ous)
-            throws Exception {
+    public void buildLicense(@NotNull Deploy deploy, @NotNull App app, String deviceId, String version,
+            @NotNull OutputStream ous) throws Exception {
         //build deploy info
         AppLicense license = new AppLicense();
         license.setId(deploy.getId());