package pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class StudentInfo {
    private int id;
    private String code;
    private String name;
    private int sex;
    private int grade;
    private String major;
    private String detail;

    public String toJSON(){
        String json = "{";
        json += "\"id\":" + id + ",";
        json += "\"code\":" + code + ",";
        json += "\"name\":" + name + ",";
        json += "\"sex\":" + sex + ",";
        json += "\"grade\":" + grade + ",";
        json += "\"major\":" + major + ",";
        json += "\"detail\":" + detail + ",";
        return json + "}";
    }
}
