package cn.reghao.tnb.search.esapp.model.vo;

import cn.reghao.tnb.search.esapp.model.po.Wenshu;
import lombok.Getter;
import lombok.Setter;

import java.util.Arrays;
import java.util.List;

/**
 * @author reghao
 * @date 2025-08-20 14:52:09
 */
@Setter
@Getter
public class WenshuResult {
    private long id;
    // 原始链接
    private String originalUrl;
    // 案号
    private String caseId;
    // 案件名称
    private String caseName;
    // 法院
    private String court;
    // 所属地区
    private String region;
    // 案件类型
    private String caseType;
    // 案件类型编码
    private String caseTypeId;
    // 审理程序
    private String procedure;
    // 裁判日期
    private String judgmentDate;
    // 发布日期
    private String publicDate;
    // 当事人
    private String parties;
    // 案由
    private String cause;
    // 法律依据
    private String legalBasis;
    private List<String> legalBasisList;

    public WenshuResult(Wenshu wenshu) {
        this.id = Long.parseLong(wenshu.getId());
        this.caseName = wenshu.getCaseName();
        this.originalUrl = wenshu.getOriginalUrl();
        this.caseId = wenshu.getCaseId();
        this.court = wenshu.getCourt();
        this.region = wenshu.getRegion();
        this.caseType = wenshu.getCaseType();
        //this.caseTypeId = wenshu.getCaseTypeId();
        this.procedure = wenshu.getProcedure();
        this.judgmentDate = wenshu.getJudgmentDate();
        this.publicDate = wenshu.getPublicDate();
        this.parties = wenshu.getParties();
        this.cause = wenshu.getCause();
        this.legalBasis = wenshu.getLegalBasis();
        this.legalBasisList = Arrays.asList(this.legalBasis.split("；"));
    }
}
