R.java 744 B

123456789101112131415161718192021222324252627282930313233343536
  1. package com.gyee.power.fitting.common.config;
  2. import io.swagger.annotations.ApiModelProperty;
  3. import lombok.Data;
  4. /**
  5. * @ClassName : R
  6. * @Author : xieshengjie
  7. * @Date: 2021/5/16 16:59
  8. * @Description : 结果集
  9. */
  10. @Data
  11. public class R {
  12. // //@ApiModelProperty(value = "返回码")
  13. private Integer code;
  14. // //@ApiModelProperty(value = "返回数据")
  15. private ResultMsg data = new ResultMsg();
  16. private R(){}
  17. public static R error(ResultMsg error){
  18. R r = new R();
  19. r.setData(error);
  20. r.setCode(ResultCode.ERROR1);
  21. return r;
  22. }
  23. public static R data(ResultMsg ok) {
  24. R r = new R();
  25. r.setCode(ResultCode.SUCCESS0);
  26. r.setData(ok);
  27. return r;
  28. }
  29. }