package com.usky.ai.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class EdgeAlgTaskResponseDTO {
    @JsonProperty("BoardId")
    private String boardId;
    @JsonProperty("BoardIp")
    private String boardIp;
    @JsonProperty("Event")
    private String event;
    @JsonProperty("AlgTaskSession")
    private String algTaskSession;
    @JsonProperty("Result")
    private Result result;

    @Data
    public static class Result {
        @JsonProperty("Code")
        private Integer code;
        @JsonProperty("Desc")
        private String desc;
    }

    public boolean isSuccess() {
        return result != null && Integer.valueOf(0).equals(result.code);
    }

    private long time = System.currentTimeMillis();
}