From 2421ab222448e9db9bba26315c2bd4b7419e7a42 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期二, 14 一月 2025 15:30:27 +0800 Subject: [PATCH] 1 --- se-modules/se-system/src/main/java/com/se/system/controller/SysSoftController.java | 52 ++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 42 insertions(+), 10 deletions(-) diff --git a/se-modules/se-system/src/main/java/com/se/system/controller/SysSoftController.java b/se-modules/se-system/src/main/java/com/se/system/controller/SysSoftController.java index 76154c2..6ff6952 100644 --- a/se-modules/se-system/src/main/java/com/se/system/controller/SysSoftController.java +++ b/se-modules/se-system/src/main/java/com/se/system/controller/SysSoftController.java @@ -5,20 +5,16 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import com.se.system.domain.vo.LicenseExtraParamVo; +import com.se.system.domain.vo.NacosConfigVo; import com.se.system.service.NacosService; -import org.omg.CORBA.ServerRequest; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import com.se.system.service.inte.IAServerInfoService; +import com.se.system.utils.CommonUtils; +import org.springframework.web.bind.annotation.*; import com.se.common.log.annotation.Log; import com.se.common.log.enums.BusinessType; import com.se.common.security.annotation.RequiresPermissions; -import com.se.system.domain.SysSoft; +import com.se.system.domain.*; import com.se.system.service.inte.ISysSoftService; import com.se.common.core.web.controller.BaseController; import com.se.common.core.web.domain.AjaxResult; @@ -103,6 +99,7 @@ return toAjax(sysSoftService.deleteSysSoftBySoftIds(softIds)); } + @Log(title = "杞欢-鑾峰彇閰嶇疆", businessType = BusinessType.OTHER) @RequiresPermissions("system:soft:query") @GetMapping(value = "getNacosConfig") public void getNacosConfig(String dataId, HttpServletRequest req, HttpServletResponse res) { @@ -116,4 +113,39 @@ } } } + + @Log(title = "杞欢-鏇存柊閰嶇疆", businessType = BusinessType.UPDATE) + @RequiresPermissions("system:soft:edit") + @PostMapping(value = "updateNacosConfig") + public void updateNacosConfig(@RequestBody NacosConfigVo vo, HttpServletRequest req, HttpServletResponse res) { + try { + nacosService.updateNacosConfig(vo, req, res); + } catch (Exception e) { + try { + res.getWriter().print(e.getMessage()); + } catch (Exception ex) { + logger.error(ex.getMessage(), ex); + } + } + } + + @GetMapping(value = "/getServerInfo") + public AjaxResult getServerInfo() { + LicenseExtraParamVo serverInfos = IAServerInfoService.getServer("").getServerInfos(); + System.out.println("serverInfos = " + serverInfos); + + return success(serverInfos); + } + + @GetMapping(value = "/getLicenseKey") + public AjaxResult getLicenseKey() throws Exception { + LicenseExtraParamVo serverInfos = IAServerInfoService.getServer("").getServerInfos(); + String jsonString = serverInfos.toJsonString(); + + System.out.println("鍘熷鏁版嵁 = " + jsonString); + String encryptedJson = CommonUtils.encrypt(jsonString); + System.out.println("鍔犲瘑鏁版嵁 = " + serverInfos); + + return success(encryptedJson); + } } -- Gitblit v1.9.3