All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.feingto.cloud.dto.message.ApiEventMessage Maven / Gradle / Ivy

There is a newer version: 2.3.5.RELEASE
Show newest version
package com.feingto.cloud.dto.message;

import com.feingto.cloud.domain.api.BaseApi;
import com.feingto.cloud.kit.json.JSON;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.messaging.Message;

import java.io.Serializable;

/**
 * API 事件消息
 *
 * @author longfei
 */
@Data
@Accessors(chain = true)
public class ApiEventMessage implements Serializable {
    private static final long serialVersionUID = -4527517827960155183L;

    private String id;

    private Type type;

    private BaseApi api;

    /**
     * 成功/失败
     */
    private boolean success = true;

    public Message toMessage() {
        return MessageBuilder.withPayload(JSON.obj2json(this)).build();
    }

    /**
     * 消息类型
     */
    public enum Type {
        UPDATE,
        REMOVE,
        RESET
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy