com.github.lkqm.spring.api.version.ApiVersionProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-api-versioning Show documentation
Show all versions of spring-api-versioning Show documentation
Simple development of multi-version api based on spring-mvc via @ApiVersion annotation, support for
uri, header, param.
package com.github.lkqm.spring.api.version;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import java.io.Serializable;
/**
* Api-Version配置
*/
@Data
@ConfigurationProperties("api.version")
public class ApiVersionProperties implements Serializable {
/**
* 实现多版本的方式
*/
private Type type = Type.URI;
/**
* URI地址前缀, 例如: /api
*/
private String uriPrefix;
/**
* 版本请求头名
*/
private String header = "X-API-VERSION";
/**
* 版本请求参数名
*/
private String param = "api_version";
public enum Type {
/**
* URI路径
*/
URI,
/**
* 请求头
*/
HEADER,
/**
* 请求参数
*/
PARAM;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy