springboot响应到前端的数据中去掉为空的数据
主类
package top.myico.sso.client;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author 夜色
* @version 1.0
* @date 2019/8/7 10:20
*/
@SpringBootApplication
public class ClientApplication {
public static void main(String[] args) {
SpringApplication.run(ClientApplication.class, args);
}
}
实体类(@Data其实是相当于帮你写了所有的get和set方法,equals和HashCode方法,toString方法,可以自己写get和set方法,对本例不影响)
package top.myico.sso.client.entity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author 夜色
* @version 1.0
* @date 2019/8/7 15:51
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class User {
private String id;
private String username;
private String password;
}
控制类<