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

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

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

import com.feingto.cloud.core.json.JSON;
import com.feingto.cloud.dto.gateway.ApiDTO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.messaging.Message;

import java.io.Serializable;

/**
 * 路由事件消息
 *
 * @author longfei
 */
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RouteEventMessage implements Serializable {
    private static final long serialVersionUID = -4527517827960155183L;

    private Type type;

    private ApiDTO api;

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy