package io.wdd.rpc.message;


import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder(toBuilder = true)
public class OctopusMessage {

    /**
     * 应该为64位的UUID
     */
    String uuid;


    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    LocalDateTime init_time;

    /**
     * 执行操作的类型
     */
    OctopusMessageType octopusMessageType;


    // server send message content
    Object content;

    /**
     * Agent 完成操作的时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    LocalDateTime ac_time;


    // agent reply message content
    Object result;

    /**
     * 执行结果的状态Code
     */
    String resultCode;
}
