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

com.github.lkqm.spring.api.version.ApiVersionProperties Maven / Gradle / Ivy

Go to download

Simple development of multi-version api based on spring-mvc via @ApiVersion annotation, support for uri, header, param.

There is a newer version: 1.4.0
Show newest version
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