ci: 所有接口swagger注释

This commit is contained in:
2023-11-20 16:36:02 +08:00
parent 6e1642e5b6
commit 5976ec50ae
8 changed files with 61 additions and 63 deletions
@@ -92,7 +92,7 @@ public class LawsEnterpriseController {
@PostMapping(value = "/commonAdd")
@ApiOperationSupport(order = 3)
@RequiresPermissions("enterpriseStandard:add")
public Result<String> commonAdd(@RequestBody Map<String,Object> parameterMap) {
public Result<String> commonAdd(@RequestBody @ApiParam("标签管理") Map<String,Object> parameterMap) {
parameterMap.put(FieldCommon.MODULE, MODULE_VALUE);
return Result.OK(lawsCommonService.commonAdd(parameterMap));
}
@@ -102,7 +102,7 @@ public class LawsEnterpriseController {
@PostMapping(value = "/commonEdit")
@ApiOperationSupport(order = 4)
@RequiresPermissions("enterpriseStandard:edit")
public Result<String> commonEdit(@RequestBody Map<String,Object> parameterMap) {
public Result<String> commonEdit(@RequestBody @ApiParam("标签管理") Map<String,Object> parameterMap) {
parameterMap.put(FieldCommon.MODULE, MODULE_VALUE);
return Result.OK(lawsCommonService.commonEdit(parameterMap));
}
@@ -121,7 +121,7 @@ public class LawsEnterpriseController {
@GetMapping(value = "getFormModel")
@ApiOperationSupport(order = 6)
@RequiresPermissions("enterpriseStandard:search")
public Result<Map<String,Object>> getFormModel(@RequestParam(name="type") String type) {
public Result<Map<String,Object>> getFormModel(@RequestParam(name="type") @ApiParam("类型(1详情,2新增编辑)") String type) {
return Result.OK(lawsCommonService.getFormModel(MODULE_VALUE, type));
}
@@ -130,9 +130,9 @@ public class LawsEnterpriseController {
@GetMapping(value = "getByIdAndModule")
@ApiOperationSupport(order = 7)
@RequiresPermissions("enterpriseStandard:search")
public Result<Map<String,Object>> getByIdAndModule(@RequestParam(name="id", required = false) String id,
@RequestParam(name="type") String type,
@RequestParam(name="standardNumber", required = false) String standardNumber) {
public Result<Map<String,Object>> getByIdAndModule(@RequestParam(name="id", required = false) @ApiParam("主键") String id,
@RequestParam(name="type") @ApiParam("类型(1详情,2新增编辑)") String type,
@RequestParam(name="standardNumber", required = false) @ApiParam("标准编号") String standardNumber) {
lawsCommonService.addLookHistory(id, type, MODULE_VALUE);
return Result.OK(lawsCommonService.getByIdAndModule(id, MODULE_VALUE, type, standardNumber));
}
@@ -154,7 +154,7 @@ public class LawsEnterpriseController {
@PostMapping(value = "singleDelete")
@ApiOperationSupport(order = 9)
@RequiresPermissions("enterpriseStandard:delete")
public Result<String> singleDelete(@RequestBody Map<String,Object> parameterMap) {
public Result<String> singleDelete(@RequestBody @ApiParam(name = "ids", value = "主键(多个用逗号分隔)") Map<String,Object> parameterMap) {
//删除标准时同步删除这个标准的收藏数据
lawsStandardCollectionService.deleteByStandardId((String) parameterMap.get("ids"));
lawsStandardSharingService.deleteByStandardId((String) parameterMap.get("ids"));
@@ -166,8 +166,8 @@ public class LawsEnterpriseController {
@GetMapping(value = "relatedStandard")
@ApiOperationSupport(order = 10)
@RequiresPermissions("enterpriseStandard:configStandard")
public Result<String> relatedStandard(@RequestParam(name="nodeCode") String nodeCode,
@RequestParam("ids") String ids) {
public Result<String> relatedStandard(@RequestParam(name="nodeCode") @ApiParam("体系编码") String nodeCode,
@RequestParam("ids") @ApiParam("主键(多个用逗号分隔)") String ids) {
lawsNodeRelationService.relatedStandard(nodeCode, ids);
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
@@ -177,8 +177,8 @@ public class LawsEnterpriseController {
@GetMapping(value = "removeStandard")
@ApiOperationSupport(order = 11)
@RequiresPermissions("enterpriseStandard:removeStandard")
public Result<String> removeStandard(@RequestParam(name="nodeCode") String nodeCode,
@RequestParam("ids") String ids) {
public Result<String> removeStandard(@RequestParam(name="nodeCode") @ApiParam("体系编码") String nodeCode,
@RequestParam("ids") @ApiParam("主键(多个用逗号分隔)") String ids) {
lawsNodeRelationService.removeStandard(nodeCode, ids);
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
@@ -188,7 +188,7 @@ public class LawsEnterpriseController {
@GetMapping(value = "/getUpdateRecordList")
@ApiOperationSupport(order = 12)
@RequiresPermissions("enterpriseStandard:updateRecord")
public Result<List<LawsUpdateRecord>> getUpdateRecordList(@RequestParam("standardNumber") String standardNumber) {
public Result<List<LawsUpdateRecord>> getUpdateRecordList(@RequestParam("standardNumber") @ApiParam("标准编号") String standardNumber) {
LambdaQueryWrapper<LawsUpdateRecord> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(LawsUpdateRecord::getUniqueRelationFlag, standardNumber);
queryWrapper.orderByDesc(LawsUpdateRecord::getCreateTime);
@@ -222,7 +222,7 @@ public class LawsEnterpriseController {
@ApiOperation(value = "企业法规标准-企标评价", notes = "企业法规标准-企标评价")
@GetMapping(value = "/evaluateDetail/{standardNumber}")
@ApiOperationSupport(order = 14)
public Result<?> evaluateDetail(@PathVariable("standardNumber") String standardNumber) {
public Result<?> evaluateDetail(@PathVariable("standardNumber") @ApiParam("标准编号") String standardNumber) {
Map<String, List<EnterpriseStandardRmrEvaluateDetail>> resultMap = esReviewMeetingService.evaluateDetailByStandardNo(standardNumber);
return Result.OK(resultMap);
}
@@ -232,7 +232,7 @@ public class LawsEnterpriseController {
@PostMapping("/exportData")
@ApiOperationSupport(order = 15)
@RequiresPermissions("enterpriseStandard:export")
public void exportData(HttpServletResponse response, @RequestBody(required = false) Map<String,Object> parameterMap) {
public void exportData(HttpServletResponse response, @RequestBody(required = false) @ApiParam("标签管理") Map<String,Object> parameterMap) {
parameterMap.put(FieldCommon.MODULE, TableNameEnum.ENTERPRISE_STANDARDS.getValue());
lawsCommonService.commonExport(response, parameterMap, "企业标准", "企业标准");
}
@@ -242,7 +242,7 @@ public class LawsEnterpriseController {
@PostMapping("/exportDataWithFile")
@ApiOperationSupport(order = 16)
@RequiresPermissions("enterpriseStandard:fileExport")
public void exportDataWithFile(HttpServletResponse response, @RequestBody(required = false) Map<String,Object> parameterMap) {
public void exportDataWithFile(HttpServletResponse response, @RequestBody(required = false) @ApiParam("标签管理") Map<String,Object> parameterMap) {
parameterMap.put(FieldCommon.MODULE, TableNameEnum.ENTERPRISE_STANDARDS.getValue());
lawsCommonService.exportDataWithFile(response, parameterMap, "企业标准", "企业标准");
}
@@ -265,7 +265,7 @@ public class LawsEnterpriseController {
@PostMapping("/importExcelWithData")
@ApiOperationSupport(order = 18)
@RequiresPermissions("enterpriseStandard:upload")
public Result<?> importExcelWithData(@RequestParam("file") MultipartFile file) {
public Result<?> importExcelWithData(@RequestParam("file") @ApiParam("上传的文件") MultipartFile file) {
List<String> errorMessages = lawsCommonService.importExcelWithData(file, TableNameEnum.ENTERPRISE_STANDARDS.getValue());
if (errorMessages.size() > 0) {
return Result.error(MessageUtils.getMessage(ResultCommon.IMPORT_ERROR), errorMessages);
@@ -282,7 +282,7 @@ public class LawsEnterpriseController {
@ApiOperation(value = "企业法规标准-评分详情", notes = "企业法规标准-评分详情")
@GetMapping(value = "/evaluateDetailForESInfo/{standardId}")
@ApiOperationSupport(order = 19)
public Result<?> evaluateDetailForESInfo(@PathVariable("standardId") String standardId) {
public Result<?> evaluateDetailForESInfo(@PathVariable("standardId") @ApiParam("标准Id") String standardId) {
Map<String, List<EnterpriseStandardRmrEvaluateDetail>> resultMap = esReviewMeetingService.evaluateDetailForESInfo(standardId);
return Result.OK(resultMap);
}
@@ -296,8 +296,8 @@ public class LawsEnterpriseController {
@ApiOperation(value = "企业法规标准-获取是否有查看详情权限", notes = "企业法规标准-获取是否有查看详情权限")
@GetMapping(value = "/detailPermission")
@ApiOperationSupport(order = 20)
public Result<?> detailPermission(@RequestParam(name="id", required = false) String id,
@RequestParam(name="standardNumber", required = false) String standardNumber) {
public Result<?> detailPermission(@RequestParam(name="id", required = false) @ApiParam("标准Id") String id,
@RequestParam(name="standardNumber", required = false) @ApiParam("标准编号") String standardNumber) {
return Result.OK(esAuthUserService.detailPermissionByUser(id, standardNumber, UserUtils.getUserId()));
}
}
@@ -1,7 +1,6 @@
package com.jero.modules.laws.standard.controller;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@@ -12,7 +11,9 @@ import com.jero.common.api.vo.ResultCommon;
import com.jero.modules.laws.enterprise.entity.vo.LawsTreeNodeModel;
import com.jero.modules.laws.standard.entity.LawsTreeNode;
import com.jero.modules.laws.standard.service.ILawsTreeNodeService;
import com.jero.modules.system.vo.IdMapBody;
import com.jero.modules.tag.enums.TableNameEnum;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import com.jero.common.system.base.controller.JeroController;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -46,8 +47,8 @@ public class LawsTreeNodeController extends JeroController<LawsTreeNode, ILawsTr
@AutoLog(value = "企业标准-体系树")
@ApiOperation(value = "企业标准-体系树", notes = "企业标准-体系树")
@GetMapping("/enterprise")
public Result<List<LawsTreeNodeModel>> queryENTreeList(@RequestParam(required = false, defaultValue = "") String nodeName,
@RequestParam(required = false) String option) {
public Result<List<LawsTreeNodeModel>> queryENTreeList(@RequestParam(required = false, defaultValue = "") @ApiParam("节点名称") String nodeName,
@RequestParam(required = false) @ApiParam("为空:显示我的收藏 1:不显示我的收藏") String option) {
String moduleCode = TableNameEnum.ENTERPRISE_STANDARDS.getValue();
List<LawsTreeNodeModel> list = lawsTreeNodeService.queryTreeNodeList(moduleCode, nodeName, option);
return Result.OK(list);
@@ -57,8 +58,8 @@ public class LawsTreeNodeController extends JeroController<LawsTreeNode, ILawsTr
@AutoLog(value = "国内标准-体系树")
@ApiOperation(value = "国内标准-体系树", notes = "国内标准-体系树")
@GetMapping("/domestic")
public Result<List<LawsTreeNodeModel>> queryGBTreeList(@RequestParam(required = false) String nodeName,
@RequestParam(required = false) String option) {
public Result<List<LawsTreeNodeModel>> queryGBTreeList(@RequestParam(required = false) @ApiParam("节点名称") String nodeName,
@RequestParam(required = false) @ApiParam("为空:显示我的收藏 1:不显示我的收藏") String option) {
String moduleCode = TableNameEnum.DOMESTIC_REGULATIONS.getValue();
List<LawsTreeNodeModel> list = lawsTreeNodeService.queryTreeNodeList(moduleCode, nodeName, option);
return Result.OK(list);
@@ -68,8 +69,8 @@ public class LawsTreeNodeController extends JeroController<LawsTreeNode, ILawsTr
@AutoLog(value = "海外标准-体系树")
@ApiOperation(value = "海外标准-体系树", notes = "海外标准-体系树")
@GetMapping("/overseas")
public Result<List<LawsTreeNodeModel>> queryFBTreeList(@RequestParam(required = false) String nodeName,
@RequestParam(required = false) String option) {
public Result<List<LawsTreeNodeModel>> queryFBTreeList(@RequestParam(required = false) @ApiParam("节点名称") String nodeName,
@RequestParam(required = false) @ApiParam("为空:显示我的收藏 1:不显示我的收藏") String option) {
String moduleCode = TableNameEnum.FOREIGN_REGULATIONS.getValue();
List<LawsTreeNodeModel> list = lawsTreeNodeService.queryTreeNodeList(moduleCode, nodeName, option);
return Result.OK(list);
@@ -159,8 +160,8 @@ public class LawsTreeNodeController extends JeroController<LawsTreeNode, ILawsTr
* @param moduleCode 所属模块
* @return 结果
*/
private Result<T> commonDelete(Map<String, String> map, String moduleCode) {
String id = map.get("id");
private Result<T> commonDelete(IdMapBody map, String moduleCode) {
String id = map.getId();
if (StringUtils.isBlank(id)) {
throw new JeroBootException(ResultCommon.PARAMETERS_CANNOT_BE_NULL);
}
@@ -184,7 +185,7 @@ public class LawsTreeNodeController extends JeroController<LawsTreeNode, ILawsTr
@AutoLog(value = "企业标准-通过id删除")
@ApiOperation(value = "企业标准-通过id删除", notes = "企业标准-通过id删除")
@PostMapping(value = "/enterprise/delete")
public Result<T> deleteEN(@RequestBody Map<String, String> map) {
public Result<T> deleteEN(@RequestBody IdMapBody map) {
return this.commonDelete(map, TableNameEnum.ENTERPRISE_STANDARDS.getValue());
}
@@ -192,7 +193,7 @@ public class LawsTreeNodeController extends JeroController<LawsTreeNode, ILawsTr
@AutoLog(value = "国内标准-通过id删除")
@ApiOperation(value = "国内标准-通过id删除", notes = "国内标准-通过id删除")
@PostMapping(value = "/domestic/delete")
public Result<T> deleteGB(@RequestBody Map<String, String> map) {
public Result<T> deleteGB(@RequestBody IdMapBody map) {
return this.commonDelete(map, TableNameEnum.DOMESTIC_REGULATIONS.getValue());
}
@@ -200,7 +201,7 @@ public class LawsTreeNodeController extends JeroController<LawsTreeNode, ILawsTr
@AutoLog(value = "海外标准-通过id删除")
@ApiOperation(value = "海外标准-通过id删除", notes = "海外标准-通过id删除")
@PostMapping(value = "/overseas/delete")
public Result<T> deleteFB(@RequestBody Map<String, String> map) {
public Result<T> deleteFB(@RequestBody IdMapBody map) {
return this.commonDelete(map, TableNameEnum.FOREIGN_REGULATIONS.getValue());
}
}
@@ -41,15 +41,6 @@ public class LawsTreeNodeServiceImpl extends ServiceImpl<LawsTreeNodeMapper, Law
@Resource
private ILawsNodeRelationService lawsNodeRelationService;
@Resource
private ILawsEnterpriseStandardService enterpriseStandardService;
@Resource
private ILawsDomesticStandardService domesticStandardService;
@Resource
private ILawsOverseasStandardService overseasStandardService;
@Override
public List<LawsTreeNodeModel> queryTreeNodeList(String moduleCode, String nodeName, String option) {
LambdaQueryWrapper<LawsTreeNode> query = new LambdaQueryWrapper<>();