From 3c12e7490c443f6d7e594098d24309aa56ccd515 Mon Sep 17 00:00:00 2001 From: caiyuchao Date: Fri, 6 Jun 2025 10:45:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0mesh=E5=92=8Croaming?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/controller/SysSiteController.java | 23 ++++++++++++ .../wfc/system/service/ISysSiteService.java | 10 +++++ .../service/impl/SysSiteServiceImpl.java | 37 +++++++++++++++++++ 3 files changed, 70 insertions(+) diff --git a/wfc-modules/wfc-system/src/main/java/org/wfc/system/controller/SysSiteController.java b/wfc-modules/wfc-system/src/main/java/org/wfc/system/controller/SysSiteController.java index 9aa48a4..0fd07ac 100644 --- a/wfc-modules/wfc-system/src/main/java/org/wfc/system/controller/SysSiteController.java +++ b/wfc-modules/wfc-system/src/main/java/org/wfc/system/controller/SysSiteController.java @@ -16,6 +16,8 @@ import org.wfc.common.core.web.page.TableDataInfo; import org.wfc.omada.api.organization.model.CreateSiteEntity; import org.wfc.omada.api.organization.model.SiteEntity; import org.wfc.omada.api.organization.model.UpdateSiteEntity; +import org.wfc.omada.api.sitesetting.model.SiteMeshSetting; +import org.wfc.omada.api.sitesetting.model.SiteRoamingSetting; import org.wfc.system.service.ISysSiteService; /** @@ -54,4 +56,25 @@ public class SysSiteController extends BaseController { public R deleteSite(@PathVariable(required = true) String siteId) { return R.ok(siteService.deleteSite(siteId)); } + + @GetMapping("/{siteId}/mesh") + public R getMeshSetting(@PathVariable(required = true) String siteId) { + return R.ok(siteService.getMeshSetting(siteId)); + } + + @GetMapping("/{siteId}/roaming") + public R getRoamingSetting(@PathVariable(required = true) String siteId) { + return R.ok(siteService.getRoamingSetting(siteId)); + } + + @PostMapping("/{siteId}/mesh") + public R updateMeshSetting(@PathVariable(required = true) String siteId, @RequestBody(required = false) SiteMeshSetting siteMeshSetting) { + return R.ok(siteService.updateMeshSetting(siteId, siteMeshSetting)); + } + + @PostMapping("/{siteId}/roaming") + public R updateRoamingSetting(@PathVariable(required = true) String siteId, @RequestBody(required = false) SiteRoamingSetting siteRoamingSetting) { + return R.ok(siteService.updateRoamingSetting(siteId, siteRoamingSetting)); + } + } diff --git a/wfc-modules/wfc-system/src/main/java/org/wfc/system/service/ISysSiteService.java b/wfc-modules/wfc-system/src/main/java/org/wfc/system/service/ISysSiteService.java index b6024f5..fb9ec7a 100644 --- a/wfc-modules/wfc-system/src/main/java/org/wfc/system/service/ISysSiteService.java +++ b/wfc-modules/wfc-system/src/main/java/org/wfc/system/service/ISysSiteService.java @@ -4,6 +4,8 @@ import org.wfc.common.core.web.page.TableDataInfo; import org.wfc.omada.api.organization.model.CreateSiteEntity; import org.wfc.omada.api.organization.model.SiteEntity; import org.wfc.omada.api.organization.model.UpdateSiteEntity; +import org.wfc.omada.api.sitesetting.model.SiteMeshSetting; +import org.wfc.omada.api.sitesetting.model.SiteRoamingSetting; /** * @description: site service @@ -21,4 +23,12 @@ public interface ISysSiteService { boolean updateSiteEntity(String siteId, UpdateSiteEntity updateSiteEntity); boolean deleteSite(String siteId); + + SiteMeshSetting getMeshSetting(String siteId); + + boolean updateMeshSetting(String siteId, SiteMeshSetting siteMeshSetting); + + SiteRoamingSetting getRoamingSetting(String siteId); + + boolean updateRoamingSetting(String siteId, SiteRoamingSetting siteRoamingSetting); } diff --git a/wfc-modules/wfc-system/src/main/java/org/wfc/system/service/impl/SysSiteServiceImpl.java b/wfc-modules/wfc-system/src/main/java/org/wfc/system/service/impl/SysSiteServiceImpl.java index f9f7c9c..8543baf 100644 --- a/wfc-modules/wfc-system/src/main/java/org/wfc/system/service/impl/SysSiteServiceImpl.java +++ b/wfc-modules/wfc-system/src/main/java/org/wfc/system/service/impl/SysSiteServiceImpl.java @@ -14,6 +14,11 @@ import org.wfc.omada.api.organization.model.OperationResponseSiteEntity; import org.wfc.omada.api.organization.model.OperationResponseWithoutResult; import org.wfc.omada.api.organization.model.SiteEntity; import org.wfc.omada.api.organization.model.UpdateSiteEntity; +import org.wfc.omada.api.sitesetting.OmadaSiteConfigurationApi; +import org.wfc.omada.api.sitesetting.model.OperationResponseSiteMeshSetting; +import org.wfc.omada.api.sitesetting.model.OperationResponseSiteRoamingSetting; +import org.wfc.omada.api.sitesetting.model.SiteMeshSetting; +import org.wfc.omada.api.sitesetting.model.SiteRoamingSetting; import org.wfc.system.service.ISysSiteService; import java.util.Objects; @@ -29,6 +34,9 @@ public class SysSiteServiceImpl implements ISysSiteService { @Autowired private OmadaSiteApi omadaSiteApi; + @Autowired + private OmadaSiteConfigurationApi omadaSiteConfigurationApi; + @Override public TableDataInfo getSiteList(Integer pageNum, Integer pageSize) { ResponseEntity response = omadaSiteApi.getSiteList(pageNum, pageSize); @@ -63,4 +71,33 @@ public class SysSiteServiceImpl implements ISysSiteService { ResponseUtils.checkResponse(Objects.requireNonNull(response.getBody()).getErrorCode(), response.getBody().getMsg()); return true; } + + @Override + public SiteMeshSetting getMeshSetting(String siteId) { + ResponseEntity response = omadaSiteConfigurationApi.getMeshSetting(siteId); + ResponseUtils.checkResponse(Objects.requireNonNull(response.getBody()).getErrorCode(), response.getBody().getMsg()); + return response.getBody().getResult(); + } + + @Override + public boolean updateMeshSetting(String siteId, SiteMeshSetting siteMeshSetting) { + ResponseEntity response = omadaSiteConfigurationApi.updateMeshSetting(siteId, siteMeshSetting); + ResponseUtils.checkResponse(Objects.requireNonNull(response.getBody()).getErrorCode(), response.getBody().getMsg()); + return true; + } + + @Override + public SiteRoamingSetting getRoamingSetting(String siteId) { + ResponseEntity response = omadaSiteConfigurationApi.getRoamingSetting(siteId); + ResponseUtils.checkResponse(Objects.requireNonNull(response.getBody()).getErrorCode(), response.getBody().getMsg()); + return response.getBody().getResult(); + } + + @Override + public boolean updateRoamingSetting(String siteId, SiteRoamingSetting siteRoamingSetting) { + ResponseEntity response = omadaSiteConfigurationApi.updateRoamingSetting(siteId, siteRoamingSetting); + ResponseUtils.checkResponse(Objects.requireNonNull(response.getBody()).getErrorCode(), response.getBody().getMsg()); + return true; + } + }