完善接口文档导出功能,处理文件上传报错问题,完善钉钉组织用户同步逻辑

This commit is contained in:
wanggeng 2021-08-14 20:53:41 +08:00
parent 469d237bd3
commit ea58e18596
19 changed files with 653 additions and 561 deletions

View File

@ -0,0 +1,35 @@
package com.cm.common.dingding.dao;
import com.cm.common.dingding.pojo.pos.DingDingDepartmentPO;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import org.springframework.stereotype.Repository;
import java.util.Map;
/**
* @ClassName: IDingDingDepartmentDao
* @Description: 钉钉部门
* @Author: wanggeng
* @Date: 2021/8/12 4:40 下午
* @Version: 1.0
*/
@Repository
public interface IDingDingDepartmentDao {
/**
* 新增
*
* @param params
* @throws SaveException
*/
void save(Map<String, Object> params) throws SaveException;
/**
* 详情
*
* @param params
* @return
* @throws SearchException
*/
DingDingDepartmentPO getPO(Map<String, Object> params) throws SearchException;
}

View File

@ -0,0 +1,36 @@
package com.cm.common.dingding.dao;
import com.cm.common.dingding.pojo.pos.DingDingUserPO;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import org.springframework.stereotype.Repository;
import java.util.Map;
/**
* @ClassName: IDingDingUserDao
* @Description: 钉钉用户
* @Author: wanggeng
* @Date: 2021/8/12 4:40 下午
* @Version: 1.0
*/
@Repository
public interface IDingDingUserDao {
/**
* 保存
*
* @param params
* @throws SaveException
*/
void save(Map<String, Object> params) throws SaveException;
/**
* 详情
*
* @param params
* @return
* @throws SearchException
*/
DingDingUserPO getPO(Map<String, Object> params) throws SearchException;
}

View File

@ -0,0 +1,75 @@
package com.cm.common.dingding.pojo.pos;
/**
* @ClassName: DingDingDepartmentPO
* @Description: 钉钉部门
* @Author: wanggeng
* @Date: 2021/8/12 10:54 下午
* @Version: 1.0
*/
public class DingDingDepartmentPO {
private String dingDingDepartmentId;
private String dingDingDepartmentParentId;
private String departmentId;
private String departmentParentId;
private String departmentName;
private String gmtCreate;
private String gmtModified;
public String getDingDingDepartmentId() {
return dingDingDepartmentId == null ? "" : dingDingDepartmentId.trim();
}
public void setDingDingDepartmentId(String dingDingDepartmentId) {
this.dingDingDepartmentId = dingDingDepartmentId;
}
public String getDingDingDepartmentParentId() {
return dingDingDepartmentParentId == null ? "" : dingDingDepartmentParentId.trim();
}
public void setDingDingDepartmentParentId(String dingDingDepartmentParentId) {
this.dingDingDepartmentParentId = dingDingDepartmentParentId;
}
public String getDepartmentId() {
return departmentId == null ? "" : departmentId.trim();
}
public void setDepartmentId(String departmentId) {
this.departmentId = departmentId;
}
public String getDepartmentParentId() {
return departmentParentId == null ? "" : departmentParentId.trim();
}
public void setDepartmentParentId(String departmentParentId) {
this.departmentParentId = departmentParentId;
}
public String getDepartmentName() {
return departmentName == null ? "" : departmentName.trim();
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public String getGmtCreate() {
return gmtCreate == null ? "" : gmtCreate.trim();
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public String getGmtModified() {
return gmtModified == null ? "" : gmtModified.trim();
}
public void setGmtModified(String gmtModified) {
this.gmtModified = gmtModified;
}
}

View File

@ -0,0 +1,84 @@
package com.cm.common.dingding.pojo.pos;
/**
* @ClassName: DingDingUserPO
* @Description: 钉钉用户
* @Author: wanggeng
* @Date: 2021/8/12 11:14 下午
* @Version: 1.0
*/
public class DingDingUserPO {
private String unionid;
private String dingdingUserId;
private String userId;
private String name;
private String mobile;
private String deptIdList;
private String gmtCreate;
private String gmtModified;
public String getUnionid() {
return unionid == null ? "" : unionid.trim();
}
public void setUnionid(String unionid) {
this.unionid = unionid;
}
public String getDingdingUserId() {
return dingdingUserId == null ? "" : dingdingUserId.trim();
}
public void setDingdingUserId(String dingdingUserId) {
this.dingdingUserId = dingdingUserId;
}
public String getUserId() {
return userId == null ? "" : userId.trim();
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getName() {
return name == null ? "" : name.trim();
}
public void setName(String name) {
this.name = name;
}
public String getMobile() {
return mobile == null ? "" : mobile.trim();
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getDeptIdList() {
return deptIdList == null ? "" : deptIdList.trim();
}
public void setDeptIdList(String deptIdList) {
this.deptIdList = deptIdList;
}
public String getGmtCreate() {
return gmtCreate == null ? "" : gmtCreate.trim();
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public String getGmtModified() {
return gmtModified == null ? "" : gmtModified.trim();
}
public void setGmtModified(String gmtModified) {
this.gmtModified = gmtModified;
}
}

View File

@ -0,0 +1,58 @@
package com.cm.common.dingding.pojo.vos;
/**
* @ClassName: DingDingDepartmentVO
* @Description: 钉钉部门
* @Author: wanggeng
* @Date: 2021/8/12 3:30 下午
* @Version: 1.0
*/
public class DingDingDepartmentVO {
private Long dingdingDepartmentId;
private Long dingdingDepartmentParentId;
private String departmentId;
private String departmentParentId;
private String departmentName;
public Long getDingdingDepartmentId() {
return dingdingDepartmentId == null ? 0 : dingdingDepartmentId;
}
public void setDingdingDepartmentId(Long dingdingDepartmentId) {
this.dingdingDepartmentId = dingdingDepartmentId;
}
public Long getDingdingDepartmentParentId() {
return dingdingDepartmentParentId == null ? 0 : dingdingDepartmentParentId;
}
public void setDingdingDepartmentParentId(Long dingdingDepartmentParentId) {
this.dingdingDepartmentParentId = dingdingDepartmentParentId;
}
public String getDepartmentId() {
return departmentId == null ? "" : departmentId.trim();
}
public void setDepartmentId(String departmentId) {
this.departmentId = departmentId;
}
public String getDepartmentParentId() {
return departmentParentId == null ? "" : departmentParentId.trim();
}
public void setDepartmentParentId(String departmentParentId) {
this.departmentParentId = departmentParentId;
}
public String getDepartmentName() {
return departmentName == null ? "" : departmentName.trim();
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
}

View File

@ -0,0 +1,66 @@
package com.cm.common.dingding.pojo.vos;
/**
* @ClassName: DingDingUserVO
* @Description: 钉钉用户
* @Author: wanggeng
* @Date: 2021/8/12 3:28 下午
* @Version: 1.0
*/
public class DingDingUserVO {
private String unionid;
private String dingdingUserId;
private String userId;
private String name;
private String mobile;
private String deptIdList;
public String getUnionid() {
return unionid == null ? "" : unionid.trim();
}
public void setUnionid(String unionid) {
this.unionid = unionid;
}
public String getDingdingUserId() {
return dingdingUserId == null ? "" : dingdingUserId.trim();
}
public void setDingdingUserId(String dingdingUserId) {
this.dingdingUserId = dingdingUserId;
}
public String getUserId() {
return userId == null ? "" : userId.trim();
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getName() {
return name == null ? "" : name.trim();
}
public void setName(String name) {
this.name = name;
}
public String getMobile() {
return mobile == null ? "" : mobile.trim();
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getDeptIdList() {
return deptIdList == null ? "" : deptIdList.trim();
}
public void setDeptIdList(String deptIdList) {
this.deptIdList = deptIdList;
}
}

View File

@ -1,6 +1,7 @@
package com.cm.common.dingding.service; package com.cm.common.dingding.service;
import com.alibaba.fastjson.JSONObject; import com.cm.common.dingding.pojo.pos.DingDingDepartmentPO;
import com.cm.common.dingding.pojo.vos.DingDingDepartmentVO;
import com.dingtalk.api.response.OapiV2DepartmentListsubResponse; import com.dingtalk.api.response.OapiV2DepartmentListsubResponse;
import com.taobao.api.ApiException; import com.taobao.api.ApiException;
@ -15,6 +16,13 @@ import java.util.List;
*/ */
public interface IDingDingAppDepartmentService { public interface IDingDingAppDepartmentService {
/**
* 保存
*
* @param dingDingDepartmentVO
*/
void save(DingDingDepartmentVO dingDingDepartmentVO) throws Exception;
/** /**
* 部门全部列表无层级 * 部门全部列表无层级
* *
@ -22,4 +30,20 @@ public interface IDingDingAppDepartmentService {
*/ */
List<OapiV2DepartmentListsubResponse.DeptBaseResponse> listAll() throws ApiException; List<OapiV2DepartmentListsubResponse.DeptBaseResponse> listAll() throws ApiException;
/**
* 部门列表
*
* @param parentId
* @return
* @throws ApiException
*/
List<OapiV2DepartmentListsubResponse.DeptBaseResponse> list(Long parentId) throws ApiException;
/**
* 部门详情
*
* @param deptId
* @return
*/
DingDingDepartmentPO getPO(Long deptId);
} }

View File

@ -1,5 +1,7 @@
package com.cm.common.dingding.service; package com.cm.common.dingding.service;
import com.cm.common.dingding.pojo.pos.DingDingUserPO;
import com.cm.common.dingding.pojo.vos.DingDingUserVO;
import com.cm.common.exception.SearchException; import com.cm.common.exception.SearchException;
import com.dingtalk.api.response.OapiUserGetResponse; import com.dingtalk.api.response.OapiUserGetResponse;
import com.dingtalk.api.response.OapiV2UserListResponse; import com.dingtalk.api.response.OapiV2UserListResponse;
@ -19,6 +21,14 @@ import java.util.List;
**/ **/
public interface IDingDingAppUserService { public interface IDingDingAppUserService {
/**
* 保存
*
* @param dingDingUserVO
* @throws Exception
*/
void save(DingDingUserVO dingDingUserVO) throws Exception;
/** /**
* 通过UnionId获取userId * 通过UnionId获取userId
* *
@ -61,4 +71,11 @@ public interface IDingDingAppUserService {
*/ */
List<OapiV2UserListResponse.ListUserResponse> listByDeptIds(List<Long> deptIds) throws ApiException; List<OapiV2UserListResponse.ListUserResponse> listByDeptIds(List<Long> deptIds) throws ApiException;
/**
* 详情
*
* @param dingDingUserId
* @return
*/
DingDingUserPO getPO(String dingDingUserId);
} }

View File

@ -1,21 +1,23 @@
package com.cm.common.dingding.service.impl; package com.cm.common.dingding.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.cm.common.base.AbstractService; import com.cm.common.base.AbstractService;
import com.cm.common.dingding.dao.IDingDingDepartmentDao;
import com.cm.common.dingding.manager.app.DingDingAppManager; import com.cm.common.dingding.manager.app.DingDingAppManager;
import com.cm.common.dingding.pojo.pos.DingDingDepartmentPO;
import com.cm.common.dingding.pojo.vos.DingDingDepartmentVO;
import com.cm.common.dingding.service.IDingDingAppDepartmentService; import com.cm.common.dingding.service.IDingDingAppDepartmentService;
import com.cm.common.utils.HashMapUtil;
import com.dingtalk.api.DefaultDingTalkClient; import com.dingtalk.api.DefaultDingTalkClient;
import com.dingtalk.api.DingTalkClient; import com.dingtalk.api.DingTalkClient;
import com.dingtalk.api.request.OapiUserSimplelistRequest;
import com.dingtalk.api.request.OapiV2DepartmentListsubRequest; import com.dingtalk.api.request.OapiV2DepartmentListsubRequest;
import com.dingtalk.api.response.OapiUserSimplelistResponse;
import com.dingtalk.api.response.OapiV2DepartmentListsubResponse; import com.dingtalk.api.response.OapiV2DepartmentListsubResponse;
import com.taobao.api.ApiException; import com.taobao.api.ApiException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @ClassName: DingDingAppDepartmentServiceImpl * @ClassName: DingDingAppDepartmentServiceImpl
@ -27,6 +29,16 @@ import java.util.List;
@Service @Service
public class DingDingAppDepartmentServiceImpl extends AbstractService implements IDingDingAppDepartmentService { public class DingDingAppDepartmentServiceImpl extends AbstractService implements IDingDingAppDepartmentService {
@Autowired
private IDingDingDepartmentDao dingDingDepartmentDao;
@Override
public void save(DingDingDepartmentVO dingDingDepartmentVO) throws Exception {
Map<String, Object> params = HashMapUtil.beanToMap(dingDingDepartmentVO);
setSaveInfoByUserId(params, "1");
dingDingDepartmentDao.save(params);
}
@Override @Override
public List<OapiV2DepartmentListsubResponse.DeptBaseResponse> listAll() throws ApiException { public List<OapiV2DepartmentListsubResponse.DeptBaseResponse> listAll() throws ApiException {
List<OapiV2DepartmentListsubResponse.DeptBaseResponse> deptBaseResponses = new ArrayList<>(); List<OapiV2DepartmentListsubResponse.DeptBaseResponse> deptBaseResponses = new ArrayList<>();
@ -34,13 +46,25 @@ public class DingDingAppDepartmentServiceImpl extends AbstractService implements
return deptBaseResponses; return deptBaseResponses;
} }
private void buildDeptList(Long parentDeptId, List<OapiV2DepartmentListsubResponse.DeptBaseResponse> deptBaseResponses) throws ApiException { @Override
public List<OapiV2DepartmentListsubResponse.DeptBaseResponse> list(Long parentDeptId) throws ApiException {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/department/listsub"); DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/department/listsub");
OapiV2DepartmentListsubRequest oapiV2DepartmentListsubRequest = new OapiV2DepartmentListsubRequest(); OapiV2DepartmentListsubRequest oapiV2DepartmentListsubRequest = new OapiV2DepartmentListsubRequest();
oapiV2DepartmentListsubRequest.setDeptId(parentDeptId); oapiV2DepartmentListsubRequest.setDeptId(parentDeptId);
oapiV2DepartmentListsubRequest.setLanguage("zh_CN"); oapiV2DepartmentListsubRequest.setLanguage("zh_CN");
OapiV2DepartmentListsubResponse rsp = client.execute(oapiV2DepartmentListsubRequest, DingDingAppManager.getInstance().getAccessToken()); OapiV2DepartmentListsubResponse rsp = client.execute(oapiV2DepartmentListsubRequest, DingDingAppManager.getInstance().getAccessToken());
List<OapiV2DepartmentListsubResponse.DeptBaseResponse> subDepts = rsp.getResult(); return rsp.getResult();
}
@Override
public DingDingDepartmentPO getPO(Long deptId) {
Map<String, Object> params = getHashMap(2);
params.put("dingDingDepartmentId", deptId);
return dingDingDepartmentDao.getPO(params);
}
private void buildDeptList(Long parentDeptId, List<OapiV2DepartmentListsubResponse.DeptBaseResponse> deptBaseResponses) throws ApiException {
List<OapiV2DepartmentListsubResponse.DeptBaseResponse> subDepts = list(parentDeptId);
if (!subDepts.isEmpty()) { if (!subDepts.isEmpty()) {
for (OapiV2DepartmentListsubResponse.DeptBaseResponse subDept : subDepts) { for (OapiV2DepartmentListsubResponse.DeptBaseResponse subDept : subDepts) {
deptBaseResponses.add(subDept); deptBaseResponses.add(subDept);

View File

@ -2,9 +2,13 @@ package com.cm.common.dingding.service.impl;
import com.cm.common.base.AbstractService; import com.cm.common.base.AbstractService;
import com.cm.common.dingding.config.properties.DingDingAppProperties; import com.cm.common.dingding.config.properties.DingDingAppProperties;
import com.cm.common.dingding.dao.IDingDingUserDao;
import com.cm.common.dingding.manager.app.DingDingAppManager; import com.cm.common.dingding.manager.app.DingDingAppManager;
import com.cm.common.dingding.pojo.pos.DingDingUserPO;
import com.cm.common.dingding.pojo.vos.DingDingUserVO;
import com.cm.common.dingding.service.IDingDingAppUserService; import com.cm.common.dingding.service.IDingDingAppUserService;
import com.cm.common.exception.SearchException; import com.cm.common.exception.SearchException;
import com.cm.common.utils.HashMapUtil;
import com.dingtalk.api.DefaultDingTalkClient; import com.dingtalk.api.DefaultDingTalkClient;
import com.dingtalk.api.DingTalkClient; import com.dingtalk.api.DingTalkClient;
import com.dingtalk.api.request.OapiUserGetByMobileRequest; import com.dingtalk.api.request.OapiUserGetByMobileRequest;
@ -21,6 +25,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* When you feel like quitting. Think about why you started * When you feel like quitting. Think about why you started
@ -37,6 +42,15 @@ public class DingDingAppUserServiceImpl extends AbstractService implements IDing
@Autowired @Autowired
private DingDingAppProperties dingDingAppProperties; private DingDingAppProperties dingDingAppProperties;
@Autowired
private IDingDingUserDao dingDingUserDao;
@Override
public void save(DingDingUserVO dingDingUserVO) throws Exception {
Map<String, Object> params = HashMapUtil.beanToMap(dingDingUserVO);
setSaveInfoByUserId(params, "1");
dingDingUserDao.save(params);
}
@Override @Override
public String getUserIdByUnionId(String unionId) throws SearchException { public String getUserIdByUnionId(String unionId) throws SearchException {
@ -103,7 +117,7 @@ public class DingDingAppUserServiceImpl extends AbstractService implements IDing
OapiV2UserListRequest req = new OapiV2UserListRequest(); OapiV2UserListRequest req = new OapiV2UserListRequest();
req.setDeptId(deptId); req.setDeptId(deptId);
req.setCursor(cursor); req.setCursor(cursor);
req.setSize(1000L); req.setSize(100L);
req.setContainAccessLimit(true); req.setContainAccessLimit(true);
req.setLanguage("zh_CN"); req.setLanguage("zh_CN");
OapiV2UserListResponse oapiV2UserListResponse = client.execute(req, DingDingAppManager.getInstance().getAccessToken()); OapiV2UserListResponse oapiV2UserListResponse = client.execute(req, DingDingAppManager.getInstance().getAccessToken());
@ -127,4 +141,11 @@ public class DingDingAppUserServiceImpl extends AbstractService implements IDing
return userResponses; return userResponses;
} }
@Override
public DingDingUserPO getPO(String dingDingUserId) {
Map<String, Object> params = getHashMap(2);
params.put("dingDingUserId", dingDingUserId);
return dingDingUserDao.getPO(params);
}
} }

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cm.common.dingding.dao.IDingDingDepartmentDao">
<resultMap id="dingDingDepartmentPO" type="com.cm.common.dingding.pojo.pos.DingDingDepartmentPO">
<result column="dingding_department_id" property="dingDingDepartmentId"/>
<result column="dingding_department_parent_id" property="dingDingDepartmentParentId"/>
<result column="department_id" property="departmentId"/>
<result column="department_parent_id" property="departmentParentId"/>
<result column="department_name" property="departmentName"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="gmt_modified" property="gmtModified"/>
</resultMap>
<insert id="save" parameterType="map">
INSERT INTO sys_dingding_department(
dingding_department_id,
dingding_department_parent_id,
department_id,
department_parent_id,
department_name,
gmt_create,
gmt_modified
) VALUES(
#{dingdingDepartmentId},
#{dingdingDepartmentParentId},
#{departmentId},
#{departmentParentId},
#{departmentName},
#{gmtCreate},
#{gmtModified}
)
</insert>
<!-- 详情 -->
<select id="getPO" parameterType="map" resultMap="dingDingDepartmentPO">
SELECT
dingding_department_id,
dingding_department_parent_id,
department_id,
department_parent_id,
department_name,
gmt_create,
gmt_modified
FROM
sys_dingding_department
WHERE
dingding_department_id = #{dingDingDepartmentId}
</select>
</mapper>

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cm.common.dingding.dao.IDingDingUserDao">
<resultMap id="dingDingUserPO" type="com.cm.common.dingding.pojo.pos.DingDingUserPO">
<result column="unionid" property="unionid"></result>
<result column="dingding_user_id" property="dingdingUserId"></result>
<result column="user_id" property="userId"/>
<result column="name" property="name"/>
<result column="mobile" property="mobile"/>
<result column="dept_id_list" property="deptIdList"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="gmt_modified" property="gmtModified"/>
</resultMap>
<insert id="save" parameterType="map">
INSERT INTO sys_dingding_user(
unionid,
dingding_user_id,
user_id,
name,
mobile,
dept_id_list,
gmt_create,
gmt_modified
) VALUES(
#{unionid},
#{dingdingUserId},
#{userId},
#{name},
#{mobile},
#{deptIdList},
#{gmtCreate},
#{gmtModified}
)
</insert>
<!-- 详情 -->
<select id="getPO" parameterType="map" resultMap="dingDingUserPO">
SELECT
unionid,
dingding_user_id,
user_id,
name,
mobile,
dept_id_list,
gmt_create,
gmt_modified
FROM
sys_dingding_user
WHERE
dingding_user_id = #{dingDingUserId}
</select>
</mapper>

View File

@ -30,7 +30,9 @@
<script type="text/javascript" src="assets/js/vendor/bootstrap-fileupload/js/fileinput.js"></script> <script type="text/javascript" src="assets/js/vendor/bootstrap-fileupload/js/fileinput.js"></script>
<script type="text/javascript" src="assets/js/vendor/bootstrap-fileupload/js/locales/zh.js"></script> <script type="text/javascript" src="assets/js/vendor/bootstrap-fileupload/js/locales/zh.js"></script>
<script type="text/javascript"> <script type="text/javascript">
var customType = top.restAjax.params(window.location.href).customType; var queryParams = top.restAjax.params(window.location.href);
var customType = queryParams.customType;
var baseUrl = queryParams.baseUrl ? queryParams.baseUrl : '';
var uploadFileArray = []; var uploadFileArray = [];
function closeBox() { function closeBox() {
top.dialog.closeBox(); top.dialog.closeBox();
@ -46,7 +48,7 @@
var maxFileCount = top.dialog.maxFileCount == null ? $('#maxFileCount').val() : top.dialog.maxFileCount; var maxFileCount = top.dialog.maxFileCount == null ? $('#maxFileCount').val() : top.dialog.maxFileCount;
$('#uploadFile').fileinput({ $('#uploadFile').fileinput({
language: 'zh', // 中文 language: 'zh', // 中文
uploadUrl: $('#uploadUrl').val(), // 服务器地址 uploadUrl: baseUrl + $('#uploadUrl').val(), // 服务器地址
allowedFileExtensions: customType ? customType.split(',') : $('#allowFiles').val().split(','), // 文件后缀 allowedFileExtensions: customType ? customType.split(',') : $('#allowFiles').val().split(','), // 文件后缀
showUpload: false, // 显示上传按钮 showUpload: false, // 显示上传按钮
showRemove: false, // 显示删除按钮 showRemove: false, // 显示删除按钮

View File

@ -2,16 +2,11 @@ package com.cm.common.config;
import com.cm.common.config.properties.FileProperties; import com.cm.common.config.properties.FileProperties;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import javax.servlet.MultipartConfigElement;
import java.io.File;
/** /**
* @ClassName: WebConfig * @ClassName: WebConfig
* @Description: Web配置 * @Description: Web配置
@ -35,16 +30,4 @@ public class WebConfig implements WebMvcConfigurer {
registry.addResourceHandler("/files/**").addResourceLocations("file:" + fileProperties.getUploadPath()); registry.addResourceHandler("/files/**").addResourceLocations("file:" + fileProperties.getUploadPath());
registry.addResourceHandler("/assets/**").addResourceLocations("classpath:/static/assets/").setCachePeriod(7 * 24 * 3600); registry.addResourceHandler("/assets/**").addResourceLocations("classpath:/static/assets/").setCachePeriod(7 * 24 * 3600);
} }
@Bean
public MultipartConfigElement multipartConfigElement(){
MultipartConfigFactory multipartConfigFactory = new MultipartConfigFactory();
String location = System.getProperty("user.dir") + "/data/tmp";
File file = new File(location);
if(!file.exists()){
file.mkdirs();
}
multipartConfigFactory.setLocation(location);
return multipartConfigFactory.createMultipartConfig();
}
} }

View File

@ -36,6 +36,10 @@ public interface ISystemConstant {
* 微信小程序接口 * 微信小程序接口
*/ */
String API_TAGS_WECHAT_MINI_APP_PREFIX = "微信小程序接口-"; String API_TAGS_WECHAT_MINI_APP_PREFIX = "微信小程序接口-";
/**
* 钉钉接口前缀-
*/
String API_TAGS_DINGDING_PREFIX = "钉钉接口-";
/** /**
* 发行接口前缀 * 发行接口前缀
*/ */
@ -104,6 +108,10 @@ public interface ISystemConstant {
* 微信小程序前缀 * 微信小程序前缀
*/ */
String WECHAT_MINI_APP_PREFIX = "/wxminiapp"; String WECHAT_MINI_APP_PREFIX = "/wxminiapp";
/**
* 钉钉前缀
*/
String DINGDING_PREFIX = "/dingding";
/** /**
* true * true
*/ */

View File

@ -6,14 +6,15 @@ import com.cm.common.service.IApiDocService;
import freemarker.template.TemplateException; import freemarker.template.TemplateException;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -35,8 +36,8 @@ public class ApiDocController extends AbstractController {
private IApiDocService apiDocService; private IApiDocService apiDocService;
@GetMapping("get-api") @GetMapping("get-api")
public Map<String, Object> getApi() { public Map<String, Object> getApi(@RequestParam(name = "apiTypes", required = false) List<String> apiTypes) {
return apiDocService.getApi(); return apiDocService.getApi(apiTypes);
} }
@GetMapping("get") @GetMapping("get")

View File

@ -5,6 +5,7 @@ import freemarker.template.TemplateException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -22,9 +23,10 @@ public interface IApiDocService {
/** /**
* 获取接口 * 获取接口
* *
* @param apiTypes
* @return * @return
*/ */
Map<String, Object> getApi(); Map<String, Object> getApi(List<String> apiTypes);
/** /**
* 获取文档 * 获取文档

View File

@ -4,11 +4,14 @@ import com.cm.common.base.AbstractService;
import com.cm.common.constants.ISystemConstant; import com.cm.common.constants.ISystemConstant;
import com.cm.common.service.IApiDocService; import com.cm.common.service.IApiDocService;
import com.cm.common.utils.DateUtil; import com.cm.common.utils.DateUtil;
import freemarker.template.Configuration;
import freemarker.template.Template; import freemarker.template.Template;
import freemarker.template.TemplateException; import freemarker.template.TemplateException;
import io.swagger.models.*; import io.swagger.models.*;
import io.swagger.models.parameters.BodyParameter;
import io.swagger.models.parameters.Parameter; import io.swagger.models.parameters.Parameter;
import io.swagger.models.properties.ArrayProperty;
import io.swagger.models.properties.Property;
import io.swagger.models.properties.RefProperty;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -18,15 +21,14 @@ import springfox.documentation.spring.web.DocumentationCache;
import springfox.documentation.swagger2.mappers.ServiceModelToSwagger2Mapper; import springfox.documentation.swagger2.mappers.ServiceModelToSwagger2Mapper;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* When you feel like quitting. Think about why you started * When you feel like quitting. Think about why you started
@ -58,29 +60,30 @@ public class ApiDocServiceImpl extends AbstractService implements IApiDocService
} }
@Override @Override
public Map<String, Object> getApi() { public Map<String, Object> getApi(List<String> apiTypes) {
Map<String, Object> apiDocMap = new HashMap<>(); Map<String, Object> apiDocMap = new HashMap<>();
List<Map<String, Object>> apiGroups = new ArrayList<>(); List<Map<String, Object>> apiGroups = new ArrayList<>();
Map<String, Object> systemDocMap = new HashMap<>(); if (apiTypes != null) {
systemDocMap.put("name", "系统接口"); for (String apiType : apiTypes) {
systemDocMap.put("api", getApi("SYSTEM")); String name = null;
apiGroups.add(systemDocMap); if (StringUtils.equalsIgnoreCase(apiType, "SYSTEM")) {
name = "系统接口";
Map<String, Object> appDocMap = new HashMap<>(); } else if (StringUtils.equalsIgnoreCase(apiType, "APP")) {
appDocMap.put("name", "APP接口"); name = "APP接口";
appDocMap.put("api", getApi("APP")); } else if (StringUtils.equalsIgnoreCase(apiType, "RESOURCE")) {
apiGroups.add(appDocMap); name = "资源接口";
} else if (StringUtils.equalsIgnoreCase(apiType, "WECHAT")) {
Map<String, Object> resourceDocMap = new HashMap<>(); name = "微信接口";
resourceDocMap.put("name", "资源接口"); }
resourceDocMap.put("api", getApi("RESOURCE")); if (name == null) {
apiGroups.add(resourceDocMap); continue;
}
Map<String, Object> wechatDocMap = new HashMap<>(); Map<String, Object> systemDocMap = new HashMap<>();
wechatDocMap.put("name", "微信接口"); systemDocMap.put("name", name);
wechatDocMap.put("api", getApi("WECHAT")); systemDocMap.put("api", getApi(apiType.toUpperCase()));
apiGroups.add(wechatDocMap); apiGroups.add(systemDocMap);
}
}
apiDocMap.put("apiGroups", apiGroups); apiDocMap.put("apiGroups", apiGroups);
apiDocMap.put("author", "System"); apiDocMap.put("author", "System");
@ -91,9 +94,10 @@ public class ApiDocServiceImpl extends AbstractService implements IApiDocService
@Override @Override
public void get(HttpServletRequest request, HttpServletResponse response) throws IOException, TemplateException { public void get(HttpServletRequest request, HttpServletResponse response) throws IOException, TemplateException {
String apiTypes = request.getParameter("apiTypes");
Template template = freeMarkerConfigurer.getConfiguration().getTemplate("ftl/api-template.ftl"); Template template = freeMarkerConfigurer.getConfiguration().getTemplate("ftl/api-template.ftl");
response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode("接口文档.doc", "UTF-8")); response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode("接口文档.doc", "UTF-8"));
Map<String, Object> apiDocMap = getApi(); Map<String, Object> apiDocMap = getApi(StringUtils.isBlank(apiTypes) ? null : Arrays.asList(apiTypes.split(",")));
Writer writer = new BufferedWriter(new OutputStreamWriter(response.getOutputStream(), ISystemConstant.CHARSET_UTF8)); Writer writer = new BufferedWriter(new OutputStreamWriter(response.getOutputStream(), ISystemConstant.CHARSET_UTF8));
template.process(apiDocMap, writer); template.process(apiDocMap, writer);
} }
@ -117,6 +121,7 @@ public class ApiDocServiceImpl extends AbstractService implements IApiDocService
apiMap.put("host", host); apiMap.put("host", host);
apiMap.put("basePath", basePath); apiMap.put("basePath", basePath);
apiMap.put("apiControllers", apiControllers); apiMap.put("apiControllers", apiControllers);
apiMap.put("definitions", definitions);
for (Tag tag : tags) { for (Tag tag : tags) {
Map<String, Object> apiController = new HashMap<>(); Map<String, Object> apiController = new HashMap<>();
apiController.put("name", tag.getName()); apiController.put("name", tag.getName());
@ -159,12 +164,30 @@ public class ApiDocServiceImpl extends AbstractService implements IApiDocService
List<Parameter> parameters = operation.getParameters(); List<Parameter> parameters = operation.getParameters();
for (Parameter parameter : parameters) { for (Parameter parameter : parameters) {
Map<String, Object> requestParameter = new HashMap<>(); Map<String, Object> requestParameter = new HashMap<>();
requestParameter.put("class", parameter.getClass());
requestParameter.put("name", parameter.getName()); requestParameter.put("name", parameter.getName());
requestParameter.put("description", parameter.getDescription()); requestParameter.put("description", parameter.getDescription());
String type = StringUtils.isBlank(parameter.getPattern()) ? "string" : parameter.getPattern();
requestParameter.put("in", parameter.getIn()); requestParameter.put("in", parameter.getIn());
requestParameter.put("type", parameter.getPattern() == null ? "string" : parameter.getPattern()); if (StringUtils.equals(parameter.getIn(), "body")) {
type = "object";
}
requestParameter.put("type", type);
requestParameter.put("source", parameter); requestParameter.put("source", parameter);
requestParameter.put("access", parameter.getAccess());
if (parameter instanceof BodyParameter) {
BodyParameter bodyParameter = (BodyParameter) parameter;
Model schema = bodyParameter.getSchema();
requestParameter.put("schemaClass", schema.getClass());
if (schema instanceof RefModel) {
RefModel refModel = (RefModel) schema;
requestParameter.put("ref", refModel.get$ref());
requestParameter.put("simpleRef", refModel.getSimpleRef());
}
}
requestParameterList.add(requestParameter); requestParameterList.add(requestParameter);
} }
return requestParameterList; return requestParameterList;
} }
@ -178,7 +201,24 @@ public class ApiDocServiceImpl extends AbstractService implements IApiDocService
Map<String, Object> responseMap = new HashMap<>(); Map<String, Object> responseMap = new HashMap<>();
responseMap.put("code", code); responseMap.put("code", code);
responseMap.put("description", response.getDescription()); responseMap.put("description", response.getDescription());
responseMap.put("schema", response.getSchema()); Property schema = response.getSchema();
if (schema != null) {
responseMap.put("schemaClass", schema.getClass());
responseMap.put("type", schema.getType());
if (schema instanceof ArrayProperty) {
ArrayProperty arrayProperty = (ArrayProperty) schema;
Property items = arrayProperty.getItems();
if (items instanceof RefProperty) {
RefProperty refProperty = (RefProperty) items;
responseMap.put("ref", refProperty.get$ref());
responseMap.put("simpleRef", refProperty.getSimpleRef());
}
} else if (schema instanceof RefProperty) {
RefProperty refProperty = (RefProperty) schema;
responseMap.put("ref", refProperty.get$ref());
responseMap.put("simpleRef", refProperty.getSimpleRef());
}
}
responseMaps.add(responseMap); responseMaps.add(responseMap);
} }
return responseMaps; return responseMaps;

View File

@ -409,7 +409,7 @@
<w:sz w:val="24"/> <w:sz w:val="24"/>
<w:szCs w:val="24"/> <w:szCs w:val="24"/>
</w:rPr> </w:rPr>
<w:t>${api.summary}</w:t> <w:t>描述:${api.summary}</w:t>
</w:r> </w:r>
</w:p> </w:p>
<w:p w14:paraId="3520F921" w14:textId="06032F8E" w:rsidR="00FE5FDB" w:rsidRPr="003374F2" w:rsidRDefault="00C80924" w:rsidP="00FE5FDB"> <w:p w14:paraId="3520F921" w14:textId="06032F8E" w:rsidR="00FE5FDB" w:rsidRPr="003374F2" w:rsidRDefault="00C80924" w:rsidP="00FE5FDB">
@ -493,7 +493,7 @@
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体" w:hint="eastAsia"/> <w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体" w:hint="eastAsia"/>
<w:szCs w:val="21"/> <w:szCs w:val="21"/>
</w:rPr> </w:rPr>
<w:t>请求地址:${api.apiUrl}</w:t> <w:t>请求地址:${apiGroup.api.basePath}${api.apiUrl}</w:t>
</w:r> </w:r>
</w:p> </w:p>
<w:p w14:paraId="6EAA84A3" w14:textId="04D5857A" w:rsidR="004A47C0" w:rsidRPr="0019798A" w:rsidRDefault="004A47C0" w:rsidP="001A2E56"> <w:p w14:paraId="6EAA84A3" w14:textId="04D5857A" w:rsidR="004A47C0" w:rsidRPr="0019798A" w:rsidRDefault="004A47C0" w:rsidP="001A2E56">
@ -1109,17 +1109,7 @@
<w:sz w:val="20"/> <w:sz w:val="20"/>
<w:szCs w:val="20"/> <w:szCs w:val="20"/>
</w:rPr> </w:rPr>
<w:t>响应状态</w:t> <w:t>响应状态码</w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体" w:hint="eastAsia"/>
<w:b w:val="0"/>
<w:bCs w:val="0"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>码</w:t>
</w:r> </w:r>
</w:p> </w:p>
</w:tc> </w:tc>
@ -1203,11 +1193,12 @@
<w:sz w:val="20"/> <w:sz w:val="20"/>
<w:szCs w:val="20"/> <w:szCs w:val="20"/>
</w:rPr> </w:rPr>
<w:t>响应类型</w:t> <w:t>响应类型</w:t>`
</w:r> </w:r>
</w:p> </w:p>
</w:tc> </w:tc>
</w:tr> </w:tr>
<#list api.responses as response>
<w:tr w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w14:paraId="06FB0FCD" w14:textId="77777777" w:rsidTr="006B54D1"> <w:tr w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w14:paraId="06FB0FCD" w14:textId="77777777" w:rsidTr="006B54D1">
<w:trPr> <w:trPr>
<w:cnfStyle w:val="000000100000" w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="1" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/> <w:cnfStyle w:val="000000100000" w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="1" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
@ -1232,15 +1223,7 @@
<w:sz w:val="20"/> <w:sz w:val="20"/>
<w:szCs w:val="20"/> <w:szCs w:val="20"/>
</w:rPr> </w:rPr>
<w:t>4</w:t> <w:t>${response.code}</w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>00</w:t>
</w:r> </w:r>
</w:p> </w:p>
</w:tc> </w:tc>
@ -1264,7 +1247,7 @@
<w:sz w:val="20"/> <w:sz w:val="20"/>
<w:szCs w:val="20"/> <w:szCs w:val="20"/>
</w:rPr> </w:rPr>
<w:t>请求失败</w:t> <w:t>${response.description}</w:t>
</w:r> </w:r>
</w:p> </w:p>
</w:tc> </w:tc>
@ -1317,480 +1300,7 @@
</w:p> </w:p>
</w:tc> </w:tc>
</w:tr> </w:tr>
<w:tr w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w14:paraId="69C5F0CC" w14:textId="77777777" w:rsidTr="006B54D1"> </#list>
<w:tc>
<w:tcPr>
<w:cnfStyle w:val="001000000000" w:firstRow="0" w:lastRow="0" w:firstColumn="1" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="0" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
<w:tcW w:w="1980" w:type="dxa"/>
</w:tcPr>
<w:p w14:paraId="6899E5C4" w14:textId="51CC432E" w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00">
<w:pPr>
<w:jc w:val="center"/>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体" w:hint="eastAsia"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>4</w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>04</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2268" w:type="dxa"/>
</w:tcPr>
<w:p w14:paraId="7310762E" w14:textId="18EEEB80" w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00">
<w:pPr>
<w:jc w:val="center"/>
<w:cnfStyle w:val="000000000000" w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="0" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体" w:hint="eastAsia"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>请求不存在</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1875" w:type="dxa"/>
</w:tcPr>
<w:p w14:paraId="5701C657" w14:textId="77777777" w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00">
<w:pPr>
<w:jc w:val="center"/>
<w:cnfStyle w:val="000000000000" w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="0" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2173" w:type="dxa"/>
</w:tcPr>
<w:p w14:paraId="5992A4B7" w14:textId="474902EB" w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00">
<w:pPr>
<w:jc w:val="center"/>
<w:cnfStyle w:val="000000000000" w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="0" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
</w:p>
</w:tc>
</w:tr>
<w:tr w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w14:paraId="69AB5C2F" w14:textId="77777777" w:rsidTr="006B54D1">
<w:trPr>
<w:cnfStyle w:val="000000100000" w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="1" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
</w:trPr>
<w:tc>
<w:tcPr>
<w:cnfStyle w:val="001000000000" w:firstRow="0" w:lastRow="0" w:firstColumn="1" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="0" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
<w:tcW w:w="1980" w:type="dxa"/>
</w:tcPr>
<w:p w14:paraId="76642C8B" w14:textId="358083FC" w:rsidR="005F2E4B" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00">
<w:pPr>
<w:jc w:val="center"/>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体" w:hint="eastAsia"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>4</w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>03</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2268" w:type="dxa"/>
</w:tcPr>
<w:p w14:paraId="7C0DBF16" w14:textId="1E4278F6" w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00">
<w:pPr>
<w:jc w:val="center"/>
<w:cnfStyle w:val="000000100000" w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="1" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体" w:hint="eastAsia"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>权限不足</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1875" w:type="dxa"/>
</w:tcPr>
<w:p w14:paraId="24AD1562" w14:textId="77777777" w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00">
<w:pPr>
<w:jc w:val="center"/>
<w:cnfStyle w:val="000000100000" w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="1" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2173" w:type="dxa"/>
</w:tcPr>
<w:p w14:paraId="3668B317" w14:textId="7A22D0B1" w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00">
<w:pPr>
<w:jc w:val="center"/>
<w:cnfStyle w:val="000000100000" w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="1" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
</w:p>
</w:tc>
</w:tr>
<w:tr w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w14:paraId="44EE54B0" w14:textId="77777777" w:rsidTr="006B54D1">
<w:tc>
<w:tcPr>
<w:cnfStyle w:val="001000000000" w:firstRow="0" w:lastRow="0" w:firstColumn="1" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="0" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
<w:tcW w:w="1980" w:type="dxa"/>
</w:tcPr>
<w:p w14:paraId="1A591B8F" w14:textId="6041B229" w:rsidR="005F2E4B" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00">
<w:pPr>
<w:jc w:val="center"/>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体" w:hint="eastAsia"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>5</w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>03</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2268" w:type="dxa"/>
</w:tcPr>
<w:p w14:paraId="67830840" w14:textId="7E08DF91" w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00">
<w:pPr>
<w:jc w:val="center"/>
<w:cnfStyle w:val="000000000000" w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="0" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体" w:hint="eastAsia"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>服务</w:t>
</w:r>
<w:proofErr w:type="gramStart"/>
<w:r>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体" w:hint="eastAsia"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>不</w:t>
</w:r>
<w:proofErr w:type="gramEnd"/>
<w:r>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体" w:hint="eastAsia"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>可用</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1875" w:type="dxa"/>
</w:tcPr>
<w:p w14:paraId="447740CD" w14:textId="77777777" w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00">
<w:pPr>
<w:jc w:val="center"/>
<w:cnfStyle w:val="000000000000" w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="0" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2173" w:type="dxa"/>
</w:tcPr>
<w:p w14:paraId="28E06E25" w14:textId="1F1A067A" w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00">
<w:pPr>
<w:jc w:val="center"/>
<w:cnfStyle w:val="000000000000" w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="0" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
</w:p>
</w:tc>
</w:tr>
<w:tr w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w14:paraId="14285AC7" w14:textId="77777777" w:rsidTr="006B54D1">
<w:trPr>
<w:cnfStyle w:val="000000100000" w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="1" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
</w:trPr>
<w:tc>
<w:tcPr>
<w:cnfStyle w:val="001000000000" w:firstRow="0" w:lastRow="0" w:firstColumn="1" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="0" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
<w:tcW w:w="1980" w:type="dxa"/>
</w:tcPr>
<w:p w14:paraId="6E457114" w14:textId="51D72EB8" w:rsidR="005F2E4B" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00">
<w:pPr>
<w:jc w:val="center"/>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>500</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2268" w:type="dxa"/>
</w:tcPr>
<w:p w14:paraId="790FEE7E" w14:textId="7E926E9F" w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00">
<w:pPr>
<w:jc w:val="center"/>
<w:cnfStyle w:val="000000100000" w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="1" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体" w:hint="eastAsia"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>系统异常</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1875" w:type="dxa"/>
</w:tcPr>
<w:p w14:paraId="7AE4F67A" w14:textId="77777777" w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00">
<w:pPr>
<w:jc w:val="center"/>
<w:cnfStyle w:val="000000100000" w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="1" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2173" w:type="dxa"/>
</w:tcPr>
<w:p w14:paraId="733D5D11" w14:textId="2DFDC114" w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00">
<w:pPr>
<w:jc w:val="center"/>
<w:cnfStyle w:val="000000100000" w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="1" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
</w:p>
</w:tc>
</w:tr>
<w:tr w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w14:paraId="33D79B7D" w14:textId="77777777" w:rsidTr="006B54D1">
<w:tc>
<w:tcPr>
<w:cnfStyle w:val="001000000000" w:firstRow="0" w:lastRow="0" w:firstColumn="1" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="0" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
<w:tcW w:w="1980" w:type="dxa"/>
</w:tcPr>
<w:p w14:paraId="5F4BA104" w14:textId="3FACCC9B" w:rsidR="005F2E4B" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00">
<w:pPr>
<w:jc w:val="center"/>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体" w:hint="eastAsia"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>2</w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>00</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2268" w:type="dxa"/>
</w:tcPr>
<w:p w14:paraId="736D0891" w14:textId="7B2190EC" w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00">
<w:pPr>
<w:jc w:val="center"/>
<w:cnfStyle w:val="000000000000" w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="0" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体" w:hint="eastAsia"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>请求成功</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1875" w:type="dxa"/>
</w:tcPr>
<w:p w14:paraId="29D0C89A" w14:textId="77777777" w:rsidR="005F2E4B" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00">
<w:pPr>
<w:jc w:val="center"/>
<w:cnfStyle w:val="000000000000" w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="0" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2173" w:type="dxa"/>
</w:tcPr>
<w:p w14:paraId="38EE9504" w14:textId="3CD09AD6" w:rsidR="005F2E4B" w:rsidRPr="00B50D00" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00">
<w:pPr>
<w:jc w:val="center"/>
<w:cnfStyle w:val="000000000000" w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:oddVBand="0" w:evenVBand="0" w:oddHBand="0" w:evenHBand="0" w:firstRowFirstColumn="0" w:firstRowLastColumn="0" w:lastRowFirstColumn="0" w:lastRowLastColumn="0"/>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体" w:hint="eastAsia"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>object</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
</w:tbl> </w:tbl>
<w:p w14:paraId="3E49EA28" w14:textId="7544DC55" w:rsidR="00B50D00" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00"> <w:p w14:paraId="3E49EA28" w14:textId="7544DC55" w:rsidR="00B50D00" w:rsidRDefault="005F2E4B" w:rsidP="00B50D00">
<w:pPr> <w:pPr>
@ -2040,7 +1550,7 @@
<w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体" w:hint="eastAsia"/> <w:rFonts w:ascii="黑体" w:eastAsia="黑体" w:hAnsi="黑体" w:hint="eastAsia"/>
<w:szCs w:val="21"/> <w:szCs w:val="21"/>
</w:rPr> </w:rPr>
<w:t>请求失败示例</w:t> <w:t>请求失败示例</w:t>
</w:r> </w:r>
</w:p> </w:p>
<w:tbl> <w:tbl>