com.codingapi.springboot.framework.dto.response.SingleResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of springboot-starter Show documentation
Show all versions of springboot-starter Show documentation
springboot-starter project for Spring Boot
The newest version!
package com.codingapi.springboot.framework.dto.response;
import lombok.Getter;
import lombok.Setter;
/**
* @author lorne
* 2020/12/17
*/
@Setter
@Getter
public class SingleResponse extends Response {
private T data;
public static SingleResponse of(T data) {
SingleResponse singleResponse = new SingleResponse<>();
singleResponse.setSuccess(true);
singleResponse.setData(data);
return singleResponse;
}
public static SingleResponse empty() {
SingleResponse singleResponse = new SingleResponse<>();
singleResponse.setSuccess(true);
singleResponse.setData(null);
return singleResponse;
}
}