diff --git a/src/main/java/com/glxp/api/common/util/ResultVOUtils.java b/src/main/java/com/glxp/api/common/util/ResultVOUtils.java index 87eb51b9..106c5da6 100644 --- a/src/main/java/com/glxp/api/common/util/ResultVOUtils.java +++ b/src/main/java/com/glxp/api/common/util/ResultVOUtils.java @@ -21,7 +21,7 @@ public class ResultVOUtils { */ public static BaseResponse success(Object data) { BaseResponse baseResponse = new BaseResponse<>(); - baseResponse.setCode(20000); + baseResponse.setCode(ResultEnum.SUCCESS.getCode()); baseResponse.setMessage("success"); baseResponse.setData(data); return baseResponse; diff --git a/src/main/java/com/glxp/api/config/Knife4jConfiguration.java b/src/main/java/com/glxp/api/config/Knife4jConfiguration.java index 3b7d48c1..de2f15c2 100644 --- a/src/main/java/com/glxp/api/config/Knife4jConfiguration.java +++ b/src/main/java/com/glxp/api/config/Knife4jConfiguration.java @@ -4,6 +4,7 @@ package com.glxp.api.config; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; @@ -11,6 +12,7 @@ import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; +@Profile({"dev","test"}) @Configuration @EnableSwagger2WebMvc public class Knife4jConfiguration { diff --git a/src/main/java/com/glxp/api/util/page/TableDataInfo.java b/src/main/java/com/glxp/api/util/page/TableDataInfo.java index c7e958f4..eaddbd2d 100644 --- a/src/main/java/com/glxp/api/util/page/TableDataInfo.java +++ b/src/main/java/com/glxp/api/util/page/TableDataInfo.java @@ -2,6 +2,7 @@ package com.glxp.api.util.page; import cn.hutool.http.HttpStatus; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.glxp.api.common.enums.ResultEnum; import lombok.Data; import lombok.NoArgsConstructor; @@ -48,7 +49,7 @@ public class TableDataInfo { public static TableDataInfo build(IPage page) { TableDataInfo rspData = new TableDataInfo<>(); - rspData.setCode(20000); + rspData.setCode(ResultEnum.SUCCESS.getCode()); rspData.setMsg("查询成功"); rspData.setList(page.getRecords()); rspData.setTotal(page.getTotal());