bug修复
This commit is contained in:
parent
8c6e852c4c
commit
c3f6cd2ba1
@ -28,11 +28,24 @@ public class SwaggerConfig {
|
|||||||
// 定义分隔符
|
// 定义分隔符
|
||||||
private static final String splitor = ";";
|
private static final String splitor = ";";
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Docket createZwRestApi() {
|
||||||
|
return new Docket(DocumentationType.SWAGGER_2)
|
||||||
|
.groupName("政务接口")
|
||||||
|
.apiInfo(apiInfo("政务管理API", "政务前后端联调api文档", "1.0"))
|
||||||
|
.select()
|
||||||
|
//.apis(RequestHandlerSelectors.basePackage("com.zhgd.xmgl"))
|
||||||
|
.apis(basePackage("com.zhwl.zw"))
|
||||||
|
.paths(PathSelectors.any())
|
||||||
|
//.paths(PathSelectors.regex("/zw.*"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public Docket createRestApi() {
|
public Docket createRestApi() {
|
||||||
return new Docket(DocumentationType.SWAGGER_2)
|
return new Docket(DocumentationType.SWAGGER_2)
|
||||||
.groupName("项目接口")
|
.groupName("项目接口")
|
||||||
.apiInfo(apiInfo("项目管理API","项目前后端联调api文档","1.0"))
|
.apiInfo(apiInfo("项目管理API", "项目前后端联调api文档", "1.0"))
|
||||||
.select()
|
.select()
|
||||||
//.apis(RequestHandlerSelectors.basePackage("com.zhgd.xmgl"))
|
//.apis(RequestHandlerSelectors.basePackage("com.zhgd.xmgl"))
|
||||||
.apis(basePackage("com.zhgd.xmgl"))
|
.apis(basePackage("com.zhgd.xmgl"))
|
||||||
@ -43,20 +56,7 @@ public class SwaggerConfig {
|
|||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
private ApiInfo apiInfo(String titleName, String description, String version) {
|
||||||
public Docket createZwRestApi() {
|
|
||||||
return new Docket(DocumentationType.SWAGGER_2)
|
|
||||||
.groupName("政务接口")
|
|
||||||
.apiInfo(apiInfo("政务管理API","政务前后端联调api文档","1.0"))
|
|
||||||
.select()
|
|
||||||
//.apis(RequestHandlerSelectors.basePackage("com.zhgd.xmgl"))
|
|
||||||
.apis(basePackage("com.zhwl.zw"))
|
|
||||||
.paths(PathSelectors.any())
|
|
||||||
//.paths(PathSelectors.regex("/zw.*"))
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
private ApiInfo apiInfo(String titleName,String description,String version) {
|
|
||||||
return new ApiInfoBuilder()
|
return new ApiInfoBuilder()
|
||||||
.title(titleName)
|
.title(titleName)
|
||||||
.description(description)
|
.description(description)
|
||||||
@ -67,7 +67,8 @@ public class SwaggerConfig {
|
|||||||
public static Predicate<RequestHandler> basePackage(final String basePackage) {
|
public static Predicate<RequestHandler> basePackage(final String basePackage) {
|
||||||
return input -> declaringClass(input).transform(handlerPackage(basePackage)).or(true);
|
return input -> declaringClass(input).transform(handlerPackage(basePackage)).or(true);
|
||||||
}
|
}
|
||||||
private static Function<Class<?>, Boolean> handlerPackage(final String basePackage) {
|
|
||||||
|
private static Function<Class<?>, Boolean> handlerPackage(final String basePackage) {
|
||||||
return input -> {
|
return input -> {
|
||||||
// 循环判断匹配
|
// 循环判断匹配
|
||||||
for (String strPackage : basePackage.split(splitor)) {
|
for (String strPackage : basePackage.split(splitor)) {
|
||||||
@ -79,6 +80,7 @@ public class SwaggerConfig {
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Optional<? extends Class<?>> declaringClass(RequestHandler input) {
|
private static Optional<? extends Class<?>> declaringClass(RequestHandler input) {
|
||||||
return Optional.fromNullable(input.declaringClass());
|
return Optional.fromNullable(input.declaringClass());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import io.swagger.annotations.Api;
|
|||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections.MapUtils;
|
||||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
@ -26,6 +27,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@ -33,6 +35,7 @@ import java.io.IOException;
|
|||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLDecoder;
|
import java.net.URLDecoder;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -137,14 +140,13 @@ public class PoisonousGasDevCurrentDataController {
|
|||||||
/**
|
/**
|
||||||
* 通过id删除
|
* 通过id删除
|
||||||
*
|
*
|
||||||
* @param id
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "删除有毒气体-数据信息", notes = "删除有毒气体-数据信息", httpMethod = "POST")
|
@ApiOperation(value = "删除有毒气体-数据信息", notes = "删除有毒气体-数据信息", httpMethod = "POST")
|
||||||
|
@ApiImplicitParam(name = "id", value = "有毒气体-数据ID", paramType = "body", required = true, dataType = "String")
|
||||||
@PostMapping(value = "/delete")
|
@PostMapping(value = "/delete")
|
||||||
public Result<PoisonousGasDevCurrentData> delete(@RequestBody String id) {
|
public Result<PoisonousGasDevCurrentData> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
|
||||||
JSONObject jsonObject = JSON.parseObject(id, JSONObject.class);
|
String id = MapUtils.getString(map, "id");
|
||||||
id = String.valueOf(jsonObject.get("id"));
|
|
||||||
Result<PoisonousGasDevCurrentData> result = new Result<PoisonousGasDevCurrentData>();
|
Result<PoisonousGasDevCurrentData> result = new Result<PoisonousGasDevCurrentData>();
|
||||||
PoisonousGasDevCurrentData poisonousGasDevCurrentData = poisonousGasDevCurrentDataService.getById(id);
|
PoisonousGasDevCurrentData poisonousGasDevCurrentData = poisonousGasDevCurrentDataService.getById(id);
|
||||||
if (poisonousGasDevCurrentData == null) {
|
if (poisonousGasDevCurrentData == null) {
|
||||||
|
|||||||
@ -121,10 +121,10 @@ public class ${entityName}Controller {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "删除${tableVo.ftlDescription}信息", notes = "删除${tableVo.ftlDescription}信息" , httpMethod="POST")
|
@ApiOperation(value = "删除${tableVo.ftlDescription}信息", notes = "删除${tableVo.ftlDescription}信息" , httpMethod="POST")
|
||||||
|
@ApiImplicitParam(name = "id", value = "${tableVo.ftlDescription}ID", paramType = "body", required = true, dataType = "String")
|
||||||
@PostMapping(value = "/delete")
|
@PostMapping(value = "/delete")
|
||||||
public Result<${entityName}> delete(@RequestBody String id) {
|
public Result<${entityName}> delete(@ApiIgnore @RequestBody HashMap<String ,Object> map) {
|
||||||
JSONObject jsonObject = JSON.parseObject(id, JSONObject.class);
|
String id = MapUtils.getString(map, "id");
|
||||||
id = String.valueOf(jsonObject.get("id"));
|
|
||||||
Result<${entityName}> result = new Result<${entityName}>();
|
Result<${entityName}> result = new Result<${entityName}>();
|
||||||
${entityName} ${entityName?uncap_first} = ${entityName?uncap_first}Service.getById(id);
|
${entityName} ${entityName?uncap_first} = ${entityName?uncap_first}Service.getById(id);
|
||||||
if(${entityName?uncap_first}==null) {
|
if(${entityName?uncap_first}==null) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user