package cn.axzo.msg.center.domain.entity;

import cn.axzo.msg.center.service.enums.YesOrNo;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author yanglin
 */
@Setter
@Getter
@TableName(value = "tingyun_interface_list", autoResultMap = true)
public class TingyunInterfaceList {
    private Long id;
    private Date date;
    private Long applicationId;
    private String applicationName;
    private String actionName;
    private String actionAlias;
    private Integer response;
    private BigDecimal throught;
    private BigDecimal maxThrought;
    private BigDecimal error;
    private BigDecimal timePercentage;
    private Integer errorCount;
    private Integer slowCount;
    private Integer totalResponse;
    private Integer count;
    private YesOrNo responseEmpty = YesOrNo.NO;

    public static TingyunInterfaceList emptyResponse(Long applicationId, String action, Date date) {
        TingyunInterfaceList list = new TingyunInterfaceList();
        list.setResponseEmpty(YesOrNo.YES);
        list.setApplicationId(applicationId);
        list.setActionName(action);
        list.setDate(date);
        return list;
    }
}
