feat:(feature/REQ-2750) 增加统一的菜单查询接口

This commit is contained in:
lilong 2024-09-10 15:55:54 +08:00
parent d246b08585
commit 4d26aa22b3
4 changed files with 26 additions and 0 deletions

View File

@ -1,11 +1,14 @@
package cn.axzo.tyr.client.feign;
import cn.axzo.foundation.page.PageResp;
import cn.axzo.framework.domain.web.result.ApiResult;
import cn.axzo.tyr.client.model.req.DeleteFeatureResourceReq;
import cn.axzo.tyr.client.model.req.FeatureResourceTreeSaveReq;
import cn.axzo.tyr.client.model.req.GetFeatureResourceTreeReq;
import cn.axzo.tyr.client.model.req.PageSaasFeatureResourceReq;
import cn.axzo.tyr.client.model.req.ResourceSyncReq;
import cn.axzo.tyr.client.model.res.FeatureResourceTreeNode;
import cn.axzo.tyr.client.model.res.SaasFeatureResourceResp;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
@ -64,4 +67,10 @@ public interface FeatureResourceApi {
/** 通过featureResourceIds查询对应的featureCode **/
@PostMapping("/api/featureResource/listFeatureCodeByFeatureResourceIds")
ApiResult<Map<Long, String>> listFeatureCodeByFeatureResourceIds(@RequestParam List<Long> featureResourceIds);
@PostMapping("/api/featureResource/list")
ApiResult<List<SaasFeatureResourceResp>> list(@Validated @RequestParam PageSaasFeatureResourceReq param);
@PostMapping("/api/featureResource/page")
ApiResult<PageResp<SaasFeatureResourceResp>> page(@Validated @RequestParam PageSaasFeatureResourceReq param);
}

View File

@ -156,6 +156,7 @@ public interface ProductApi {
* @param terminal 政务端
* @return {@link GovernmentTerminalResp}
*/
@Deprecated
@GetMapping("api/auth/product/getGovernmentTerminal")
ApiResult<List<GovernmentTerminalResp>> getGovernmentTerminal(@RequestParam @NotNull(message = "terminal不能为空") String terminal);

View File

@ -70,6 +70,9 @@ public class PageSaasFeatureResourceReq implements IPageReq {
@CriteriaField(ignore = true)
private Set<String> paths;
@CriteriaField(field = "terminal", operator = Operator.IN)
private Set<String> terminals;
public PageResp toEmpty() {
return PageResp.builder()
.current(this.getPage())

View File

@ -1,12 +1,15 @@
package cn.axzo.tyr.server.controller.permission;
import cn.axzo.foundation.page.PageResp;
import cn.axzo.framework.domain.web.result.ApiResult;
import cn.axzo.tyr.client.feign.FeatureResourceApi;
import cn.axzo.tyr.client.model.req.DeleteFeatureResourceReq;
import cn.axzo.tyr.client.model.req.FeatureResourceTreeSaveReq;
import cn.axzo.tyr.client.model.req.GetFeatureResourceTreeReq;
import cn.axzo.tyr.client.model.req.PageSaasFeatureResourceReq;
import cn.axzo.tyr.client.model.req.ResourceSyncReq;
import cn.axzo.tyr.client.model.res.FeatureResourceTreeNode;
import cn.axzo.tyr.client.model.res.SaasFeatureResourceResp;
import cn.axzo.tyr.server.service.FeatureResourceSyncService;
import cn.axzo.tyr.server.service.SaasFeatureResourceService;
import cn.hutool.core.collection.CollectionUtil;
@ -92,4 +95,14 @@ public class FeatureResourceController implements FeatureResourceApi {
public ApiResult<Map<Long, String>> listFeatureCodeByFeatureResourceIds(List<Long> featureResourceIds) {
return ApiResult.ok(featureResourceSyncService.listFeatureCodeByFeatureResourceIds(featureResourceIds));
}
@Override
public ApiResult<List<SaasFeatureResourceResp>> list(PageSaasFeatureResourceReq param) {
return ApiResult.ok(featureResourceService.list(param));
}
@Override
public ApiResult<PageResp<SaasFeatureResourceResp>> page(PageSaasFeatureResourceReq param) {
return ApiResult.ok(featureResourceService.page(param));
}
}