package com.mosquito.project.dto;

import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

@NoArgsConstructor
public class ActivityGraphResponse implements Serializable {

    private static final long serialVersionUID = 1L;

    private List<Node> nodes;
    private List<Edge> edges;

    public ActivityGraphResponse(List<Node> nodes, List<Edge> edges) {
        this.nodes = nodes;
        this.edges = edges;
    }

    public List<Node> getNodes() {
        return nodes;
    }

    public void setNodes(List<Node> nodes) {
        this.nodes = nodes;
    }

    public List<Edge> getEdges() {
        return edges;
    }

    public void setEdges(List<Edge> edges) {
        this.edges = edges;
    }

    @NoArgsConstructor
    public static class Node implements Serializable {

        private static final long serialVersionUID = 1L;
        private String id;
        private String label;
        private int directInvites;   // 直接邀请数（一级）
        private int indirectInvites; // 间接邀请数（二级及以上）

        public Node(String id, String label) {
            this.id = id;
            this.label = label;
        }

        public Node(String id, String label, int directInvites, int indirectInvites) {
            this.id = id;
            this.label = label;
            this.directInvites = directInvites;
            this.indirectInvites = indirectInvites;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getLabel() {
            return label;
        }

        public void setLabel(String label) {
            this.label = label;
        }

        public int getDirectInvites() {
            return directInvites;
        }

        public void setDirectInvites(int directInvites) {
            this.directInvites = directInvites;
        }

        public int getIndirectInvites() {
            return indirectInvites;
        }

        public void setIndirectInvites(int indirectInvites) {
            this.indirectInvites = indirectInvites;
        }
    }

    @NoArgsConstructor
    public static class Edge implements Serializable {

        private static final long serialVersionUID = 1L;
        private String from;
        private String to;

        public Edge(String from, String to) {
            this.from = from;
            this.to = to;
        }

        public String getFrom() {
            return from;
        }

        public void setFrom(String from) {
            this.from = from;
        }

        public String getTo() {
            return to;
        }

        public void setTo(String to) {
            this.to = to;
        }
    }
}
