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

com.feingto.cloud.dto.gateway.ApiDTO Maven / Gradle / Ivy

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

import com.feingto.cloud.domain.type.IntervalUnit;
import com.feingto.cloud.domain.type.ParamMode;
import com.feingto.cloud.domain.type.Stage;
import com.feingto.cloud.dto.KeyValue;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.http.HttpMethod;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * API
 *
 * @author longfei
 */
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ApiDTO implements Serializable {
    private static final long serialVersionUID = -2656240968386207538L;

    private String id;

    /**
     * 标识(管理平台API的ID)
     */
    private String sn;

    /**
     * 请求路径
     */
    private String path;

    /**
     * 环境类型(线上、预发、测试)
     */
    private Stage stage;

    /**
     * 请求方式
     */
    @Builder.Default
    private HttpMethod httpMethod = HttpMethod.GET;

    /**
     * 超时时间(单位:秒)
     */
    @Builder.Default
    private Integer timeout = 180;

    /**
     * 是否启用OAuth2授权验证
     */
    private boolean authorized;

    /**
     * 是否开启缓存
     */
    private boolean cacheable;

    /**
     * 是否使用Mock
     */
    private boolean mock;

    /**
     * 缓存有效时间(单位:秒)
     */
    @Builder.Default
    private Integer cachetime = 60;

    /**
     * 入参请求模式: 入参映射; 入参透传
     */
    private ParamMode paramMode;

    /**
     * 预期服务器返回的数据类型
     */
    private String contentType;

    private String sensitiveHeaders;

    /**
     * 非Form表单数据,比如JSON字符串、文件二进制数据等
     */
    private boolean body;

    /**
     * 创建人
     */
    private String owner;

    /**
     * API流量限制次数
     */
    @Builder.Default
    private Long apiLimit = 0L;

    /**
     * 用户流量限制次数(不超过API流量限制值)
     */
    @Builder.Default
    private Long userLimit = 0L;

    /**
     * APP流量限制次数(不超过用户流量限制值)
     */
    @Builder.Default
    private Long appLimit = 0L;

    /**
     * 频率(时间范围内次数)
     */
    @Builder.Default
    private Long frequency = 0L;// 频率

    /**
     * 单位时间(分钟、小时、天)
     */
    private IntervalUnit intervalUnit;

    /**
     * 环境变量参数
     */
    @Builder.Default
    private List params = new ArrayList<>();

    /**
     * 请求参数
     */
    @Builder.Default
    private List requestParams = new ArrayList<>();

    /**
     * 返回参数
     */
    @Builder.Default
    private List responseParams = new ArrayList<>();

    /**
     * 路由信息
     */
    @Builder.Default
    private List apiRoutes = new ArrayList<>();

    private String createdBy;

    @Builder.Default
    private Date createdDate = new Date();

    private String lastModifiedBy;

    @Builder.Default
    private Date lastModifiedDate = new Date();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy