package cn.ey.biz.module.system.controller.admin.delegation.vo;

import cn.ey.biz.common.util.json.JsonUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

@ApiModel("管理后台 - 代理人单元条目 Response VO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class UserDelegationUnitRespVO extends UserDelegationUnitBaseVO {

    @ApiModelProperty(value = "代理人单元主键编号", required = true, example = "1024")
    private Long id;

    @ApiModelProperty(value = "关系描述",example = "[[1,10],[2,20]]")
    private List<String[]> relationData;

    @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式")
    private Date createTime;

    /**
     * json 自动序列化使用
     */
    public List<String[]> getRelationData() {
        this.relationData = JsonUtils.parseArray(this.getRelation(), String[].class);
        return relationData;
    }
}
