list.jsp
4.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<%@page import="com.diligrp.mobsite.getway.web.api.base.CommonController" %>
<%@page import="com.diligrp.mobsite.getway.web.api.base.version.DeviceInfoController" %>
<%@page import="com.diligrp.mobsite.getway.web.api.base.version.VersionController" %>
<%@page import="com.diligrp.mobsite.getway.web.api.buyer.goods.GoodsController" %>
<%@page import="com.diligrp.mobsite.getway.web.api.buyer.home.MarketController" %>
<%@page import="com.diligrp.mobsite.getway.web.api.buyer.home.TopicController" %>
<%@page import="com.diligrp.mobsite.getway.web.api.buyer.priceIndex.PriceIndexController" %>
<%@page import="com.diligrp.mobsite.getway.web.api.buyer.service.ServiceController" %>
<%@page import="com.diligrp.mobsite.getway.web.api.buyer.settle.CartController" %>
<%@ page import="com.diligrp.mobsite.getway.web.api.buyer.settle.ConsigneeController" %>
<%@ page import="com.diligrp.mobsite.getway.web.api.buyer.shop.ShopController" %>
<%@ page import="com.diligrp.mobsite.getway.web.api.buyer.user.CareCategoryController" %>
<%@ page import="com.diligrp.mobsite.getway.web.api.buyer.user.OrderController" %>
<%@ page import="com.diligrp.mobsite.getway.web.api.buyer.user.UserController" %>
<%@ page import="com.diligrp.mobsite.getway.web.utils.DiligrpEndpoint" %>
<%@ page import="org.springframework.web.bind.annotation.RequestMapping" %>
<%@ page import="java.lang.reflect.Method" %>
<%@ page import="java.util.Arrays" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
<center><h2>The list of endpoint</h2></center>
<table width="80%" border="1" cellpadding="5" cellspacing="0">
<tr>
<th>Index</th>
<th>Endpoint</th>
<th>Request</th>
<th>Response</th>
<th>Description</th>
<th>javadoc</th>
</tr>
<%
String link = "http://10.28.6.104:8002/api-doc/";
Class[] apiClass = new Class[]{ShopController.class, CommonController.class,
VersionController.class, GoodsController.class, MarketController.class,
TopicController.class, DeviceInfoController.class,
CartController.class, ConsigneeController.class, UserController.class,
CareCategoryController.class, OrderController.class,
PriceIndexController.class};
int index = 1;
for (Class item : apiClass) {
Method[] methods = item.getDeclaredMethods();
RequestMapping rm = (RequestMapping) item.getAnnotation(RequestMapping.class);
if (rm == null) {
continue;
}
String prefix = Arrays.toString(rm.value());
prefix = prefix.substring(1, prefix.length() - 1);
for (Method m : methods) {
if (m.getAnnotation(Deprecated.class) != null) {
continue;
}
rm = m.getAnnotation(RequestMapping.class);
if (rm == null) {
continue;
}
DiligrpEndpoint endpoint = m.getAnnotation(DiligrpEndpoint.class);
String url = Arrays.toString(rm.value());
url = url.substring(1, url.length() - 1);
%>
<tr>
<td><%=index++%>
</td>
<td><%=prefix.endsWith("/") ? prefix : prefix + "/" %><%=url.startsWith("/") ? url.substring(1) : url %>.do</td>
<td><%=endpoint == null ? "" : endpoint.req() == null ? "" : endpoint.req().getSimpleName()%>
</td>
<td><%=endpoint == null ? "" : endpoint.resp() == null ? "" : endpoint.resp().getSimpleName()%>
</td>
<td><%=endpoint == null ? "" : endpoint.desc()%>
</td>
<td><a href="<%=link+item.getCanonicalName().replaceAll("\\.", "/")+".html#"+m.getName()+"()"%>"
target="_blank"><%=m.toGenericString() %>
</a></td>
<%
}
%></tr>
<%
}
%>
</table>
</body>
</html>