mirror of
				https://github.moeyy.xyz/https://github.com/GeWuYou/forgeboot
				synced 2025-11-01 02:21:09 +08:00 
			
		
		
		
	Compare commits
	
		
			No commits in common. "0ca32efc028bcfc16a0a8f3857224655857ea625" and "9cdc962d9abbe5921c688deb43de1547099e5e65" have entirely different histories.
		
	
	
		
			0ca32efc02
			...
			9cdc962d9a
		
	
		
| @ -105,7 +105,7 @@ subprojects { | |||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|             // Gitea 仓库 |             // Gitea 仓库 | ||||||
|             val host = System.getenv("GITEA_HOST") |             val host = System.getenv("GEWUYOU_GITEA_HOST") | ||||||
|             host?.let { |             host?.let { | ||||||
|                 maven { |                 maven { | ||||||
|                     isAllowInsecureProtocol = true |                     isAllowInsecureProtocol = true | ||||||
| @ -113,7 +113,7 @@ subprojects { | |||||||
|                     url = uri("http://${it}/api/packages/gewuyou/maven") |                     url = uri("http://${it}/api/packages/gewuyou/maven") | ||||||
|                     credentials(HttpHeaderCredentials::class.java) { |                     credentials(HttpHeaderCredentials::class.java) { | ||||||
|                         name = "Authorization" |                         name = "Authorization" | ||||||
|                         value = "token ${System.getenv("GITEA_TOKEN")}" |                         value = "token ${System.getenv("GEWUYOU_GITEA_TOKEN")}" | ||||||
|                     } |                     } | ||||||
|                     authentication { |                     authentication { | ||||||
|                         create("header", HttpHeaderAuthentication::class.java) |                         create("header", HttpHeaderAuthentication::class.java) | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| // This file is used to define the repositories used by the project. | // This file is used to define the repositories used by the project. | ||||||
| repositories { | repositories { | ||||||
|     mavenLocal() |     mavenLocal() | ||||||
|     val host = System.getenv("GITEA_HOST") |     val host = System.getenv("GEWUYOU_GITEA_HOST") | ||||||
|     host?.let { |     host?.let { | ||||||
|         maven{ |         maven{ | ||||||
|             url = uri("http://${host}/api/packages/gewuyou/maven") |             url = uri("http://${host}/api/packages/gewuyou/maven") | ||||||
|  | |||||||
| @ -18,7 +18,7 @@ data class R<T>( | |||||||
|     val message: String, |     val message: String, | ||||||
|     val data: T? = null, |     val data: T? = null, | ||||||
|     val requestId: String? = null, |     val requestId: String? = null, | ||||||
|     val extra: Map<String, Any?> = emptyMap() |     val extra: Map<String, Any?> = emptyMap() // ✅ 扩展字段保存位置 | ||||||
| ) { | ) { | ||||||
|     /** |     /** | ||||||
|      * 转换为可变 Map,包含 extra 中的字段 |      * 转换为可变 Map,包含 extra 中的字段 | ||||||
| @ -33,7 +33,7 @@ data class R<T>( | |||||||
|         if (!requestId.isNullOrBlank()) { |         if (!requestId.isNullOrBlank()) { | ||||||
|             map["requestId"] = requestId |             map["requestId"] = requestId | ||||||
|         } |         } | ||||||
|         map.putAll(extra) |         map.putAll(extra) // ✅ 扁平化合并 | ||||||
|         return map |         return map | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -11,7 +11,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; | |||||||
|  * @author gewuyou |  * @author gewuyou | ||||||
|  * @since 2025-05-02 11:52:24 |  * @since 2025-05-02 11:52:24 | ||||||
|  */ |  */ | ||||||
| @ConfigurationProperties(prefix = "forgeboot.version") | @ConfigurationProperties(prefix = "version") | ||||||
| public class VersionProperties { | public class VersionProperties { | ||||||
|     /** |     /** | ||||||
|      * API前缀 |      * API前缀 | ||||||
|  | |||||||
| @ -6,8 +6,6 @@ import com.gewuyou.forgeboot.webmvc.version.mapping.ApiVersionRequestMappingHand | |||||||
| import org.springframework.boot.context.properties.EnableConfigurationProperties | import org.springframework.boot.context.properties.EnableConfigurationProperties | ||||||
| import org.springframework.context.annotation.Bean | import org.springframework.context.annotation.Bean | ||||||
| import org.springframework.context.annotation.Configuration | import org.springframework.context.annotation.Configuration | ||||||
| import org.springframework.web.cors.CorsConfigurationSource |  | ||||||
| import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  *版本自动配置 |  *版本自动配置 | ||||||
| @ -28,14 +26,8 @@ open class VersionAutoConfiguration { | |||||||
|      * @return ApiVersionRequestMappingHandlerMapping 实例,用于处理基于 API 版本的请求映射 |      * @return ApiVersionRequestMappingHandlerMapping 实例,用于处理基于 API 版本的请求映射 | ||||||
|      */ |      */ | ||||||
|     @Bean |     @Bean | ||||||
|     open fun apiVersionRequestMappingHandlerMapping( |     open fun apiVersionRequestMappingHandlerMapping(versionProperties: VersionProperties): ApiVersionRequestMappingHandlerMapping { | ||||||
|         versionProperties: VersionProperties, |  | ||||||
|         corsConfigurationSource: CorsConfigurationSource, |  | ||||||
|     ): RequestMappingHandlerMapping { |  | ||||||
|         log.info("创建 API 版本请求映射处理程序映射") |         log.info("创建 API 版本请求映射处理程序映射") | ||||||
|         return ApiVersionRequestMappingHandlerMapping(versionProperties).also { |         return ApiVersionRequestMappingHandlerMapping(versionProperties).also { it.order = Int.MIN_VALUE } | ||||||
|             it.order = Int.MIN_VALUE |  | ||||||
|             it.corsConfigurationSource = corsConfigurationSource |  | ||||||
|         } |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user