提交 f6b5db30 authored 作者: hzh's avatar hzh

旅游卫士增加菜单接口

上级 eb611c92
......@@ -17,7 +17,11 @@ public enum AuthApiEnum implements ApiEnum {
/**
* 刷新AccessToken接口
*/
REFRESH("/api/v1/account/refresh", "刷新AccessToken接口");
REFRESH("/api/v1/account/refresh", "刷新AccessToken接口"),
/**
* 获取登录用户的菜单
*/
MENUS("/api/v1/meta/menus", "获取登录用户的菜单");
/**
* 接口URL
......
package org.dromara.common.weishi.model.res;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
import java.util.Map;
/**
* @author wenhe
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MenusResponse {
/**
* maps
*/
private Map<String,Object> Maps;
/**
* 菜单
*/
private List<Map<String,Object>> Menus;
}
......@@ -15,14 +15,24 @@ public interface WeishiService {
/**
* 认证
*
* @param request 请求参数
* @return 响应参数
*/
AuthResponse authorize(AuthRequest request);
/**
* 获取菜单
*
* @param token token
* @return 响应数据
*/
MenusResponse menus(String token);
/**
* 保险下单接口
*
* @param token token
* @param request 请求参数
* @return 响应数据
*/
......@@ -31,6 +41,7 @@ public interface WeishiService {
/**
* 核保接口
*
* @param token token
* @param request 请求参数
* @return 响应数据
*/
......@@ -39,6 +50,7 @@ public interface WeishiService {
/**
* 签单接口
*
* @param token token
* @param orderNum 订单号
* @return 数据
*/
......@@ -46,6 +58,7 @@ public interface WeishiService {
/**
* 作废接口
*
* @param token token
* @param orderId 订单id
*/
......@@ -72,6 +85,7 @@ public interface WeishiService {
/**
* 订单撤单接口
*
* @param token token
* @param orderNum 订单号
*/
void insureCancel(String token, String orderNum);
......@@ -79,6 +93,7 @@ public interface WeishiService {
/**
* 保单撤单接口
*
* @param token token
* @param policyNum 保单号
*/
void policyCancel(String token, String policyNum);
......@@ -86,6 +101,7 @@ public interface WeishiService {
/**
* 产品列表接口
*
* @param token token
* @return 产品列表
*/
List<ProductsResponse> productList(String token);
......@@ -93,6 +109,7 @@ public interface WeishiService {
/**
* 产品详情
*
* @param token token
* @param productId 产品id
* @return 产品详情
*/
......@@ -101,6 +118,7 @@ public interface WeishiService {
/**
* 获取保险公司相关文档接口
*
* @param token token
* @param productId 产品id
* @param annexTp annexTp
* @return 数据
......
......@@ -41,6 +41,19 @@ public class WeishiServiceImpl implements WeishiService {
return JSON.parseObject(res.getData(), AuthResponse.class);
}
@Override
public MenusResponse menus(String token) {
ApiHttpResponse res = Api.v1(RequestMethodEnum.POST,
DomainEnum.PROD.getDomain(),
AuthApiEnum.MENUS.getUrl(),
token,
null);
if (!Objects.equals(res.getResultTp(), Code.SUCCESS.getCode())) {
throw new WeishiException(res.getResultMsg());
}
return JSON.parseObject(res.getData(), MenusResponse.class);
}
@Override
public ApplyResponse insureApply(String token, ApplyRequest request) {
ApplyResponse res = Api.v1(RequestMethodEnum.POST,
......
......@@ -68,6 +68,16 @@ public class WeishiController {
return R.ok(weishiService.annex(getToken(), productId, annexTp));
}
/**
* 获取菜单列表
*
* @return 菜单列表
*/
@GetMapping("/menus")
public R<MenusResponse> menus() {
return R.ok(weishiService.menus(getToken()));
}
/**
* 承保接口
*
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论