com.feingto.cloud.domain.api.BaseApiRoute Maven / Gradle / Ivy
package com.feingto.cloud.domain.api;
import com.feingto.cloud.data.jpa.entity.IdEntity;
import com.feingto.cloud.domain.converters.ParameterPersistenceConverters;
import com.feingto.cloud.dto.apis.ParameterDTO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.annotations.ColumnDefault;
import org.springframework.http.HttpMethod;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.List;
/**
* API 路由配置
*
* @author longfei
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@MappedSuperclass
public class BaseApiRoute extends IdEntity {
@Enumerated(EnumType.STRING)
@Column(length = 16, nullable = false)
@ColumnDefault("'GET'")
protected HttpMethod httpMethod = HttpMethod.GET;
@NotBlank(message = "路由地址不能为空")
@Column(nullable = false)
protected String url;
/**
* 路由参数
*/
@Convert(converter = ParameterPersistenceConverters.class)
@Column(name = "route_params", columnDefinition = "text")
protected List routeParams = new ArrayList<>();
/**
* 路由响应结果键
*/
@Column(length = 16)
protected String responseKey;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy