package com.imdroid.sec_exapi.entity;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class LoginResponse extends BasicResponse{
    static class Project{
        String projectName;
        public Project(String name){
            projectName = name;
        }
    }
    class Data{
        String token;
        List<Project> projects=new ArrayList<>();
    }

    Data data;

    public void setToken(String token){
        if(data == null) data = new Data();
        data.token = token;
    }

    public void addProject(String name){
        if(data == null) data = new Data();
        data.projects.add(new Project(name));
    }
}
