pro
wj 2 years ago
parent e15f17b2db
commit 82ce51f0a1

@ -21,7 +21,7 @@ public class ResultVOUtils {
*/ */
public static BaseResponse success(Object data) { public static BaseResponse success(Object data) {
BaseResponse<Object> baseResponse = new BaseResponse<>(); BaseResponse<Object> baseResponse = new BaseResponse<>();
baseResponse.setCode(20000); baseResponse.setCode(ResultEnum.SUCCESS.getCode());
baseResponse.setMessage("success"); baseResponse.setMessage("success");
baseResponse.setData(data); baseResponse.setData(data);
return baseResponse; return baseResponse;

@ -4,6 +4,7 @@ package com.glxp.api.config;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.builders.RequestHandlerSelectors;
@ -11,6 +12,7 @@ import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
@Profile({"dev","test"})
@Configuration @Configuration
@EnableSwagger2WebMvc @EnableSwagger2WebMvc
public class Knife4jConfiguration { public class Knife4jConfiguration {

@ -2,6 +2,7 @@ package com.glxp.api.util.page;
import cn.hutool.http.HttpStatus; import cn.hutool.http.HttpStatus;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.glxp.api.common.enums.ResultEnum;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@ -48,7 +49,7 @@ public class TableDataInfo<T> {
public static <T> TableDataInfo<T> build(IPage<T> page) { public static <T> TableDataInfo<T> build(IPage<T> page) {
TableDataInfo<T> rspData = new TableDataInfo<>(); TableDataInfo<T> rspData = new TableDataInfo<>();
rspData.setCode(20000); rspData.setCode(ResultEnum.SUCCESS.getCode());
rspData.setMsg("查询成功"); rspData.setMsg("查询成功");
rspData.setList(page.getRecords()); rspData.setList(page.getRecords());
rspData.setTotal(page.getTotal()); rspData.setTotal(page.getTotal());

Loading…
Cancel
Save