|
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.qmth.boot.api.annotation.Aac;
|
|
|
import com.qmth.boot.api.exception.ApiException;
|
|
|
import com.qmth.boot.core.exception.ParameterException;
|
|
|
+import com.qmth.boot.core.solar.crypto.AppLicenseUtil;
|
|
|
import com.qmth.boot.tools.device.DeviceInfo;
|
|
|
import com.qmth.ops.api.constants.OpsApiConstants;
|
|
|
import com.qmth.ops.api.dto.DeployForm;
|
|
@@ -158,6 +159,21 @@ public class DeployController {
|
|
|
response.getOutputStream());
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/license/decrypt")
|
|
|
+ @Aac(auth = false)
|
|
|
+ public Object decryptLicense(@RequestParam MultipartFile file, @RequestParam(required = false) String version)
|
|
|
+ throws Exception {
|
|
|
+ return AppLicenseUtil.parseLicense(file.getBytes(), version);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/license/encrypt")
|
|
|
+ @Aac(auth = false)
|
|
|
+ public void encryptLicense(HttpServletResponse response, @RequestBody Object body) throws Exception {
|
|
|
+ response.setContentType("application/octet-stream; charset=utf-8");
|
|
|
+ response.setHeader("Content-Disposition", "attachment; filename=app.lic");
|
|
|
+ licenseService.encrypt(body, null, null, response.getOutputStream());
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping("/org/list")
|
|
|
public List<OrgVO> listOrg(@RequestParam Long id) {
|
|
|
OrgQuery query = new OrgQuery();
|
|
@@ -170,8 +186,11 @@ public class DeployController {
|
|
|
|
|
|
@PostMapping("/org/update")
|
|
|
public Object updateOrg(@RequestAttribute AdminSession adminSession, @RequestParam Long id,
|
|
|
- @RequestParam Long[] orgId) {
|
|
|
+ @RequestParam(required = false) Long[] orgId) {
|
|
|
adminSession.hasPermission(Permission.DEPLOY_ORG_EDIT, id);
|
|
|
+ if (orgId == null) {
|
|
|
+ orgId = new Long[] {};
|
|
|
+ }
|
|
|
Deploy deploy = deployService.findById(id);
|
|
|
if (deploy != null) {
|
|
|
deployService.updateOrg(deploy, orgId);
|