重构: 源码文件蛇形命名, 接口去I头(BindRequestContext/SimApiAuthChecker), 清理C#相关说明, serialization依赖路径改 serialization-cj

This commit is contained in:
2026-08-25 13:43:26 +08:00
parent 829f009229
commit 30e5f165f2
56 changed files with 319 additions and 332 deletions
+86
View File
@@ -0,0 +1,86 @@
/*
* Copyright (c) 2025 SimcuTeam. All rights reserved.
* 遵循 MIT 许可证。
*/
package simcu::simapi.configurations
import std.collection.*
/**
* 文档组配置。
*/
public class SimApiDocGroup {
public var id: String = ""
public var name: String = ""
public var description: String = ""
public init() {}
public init(id: String, name: String, description!: String = "") {
this.id = id
this.name = name
this.description = description
}
}
/**
* 文档授权配置。
* Type 支持 "SimApiAuth"、"ClientCredentials"、"Implicit"、"AuthorizationCode"、"Password"。
*/
public class SimApiAuthOption {
/**
* 认证方式(默认 ["SimApiAuth"])。
* `type` 是仓颉关键字,用反引号转义保留属性名。
*/
public var `type`: Array<String> = ["SimApiAuth"]
/**
* 认证描述(默认 "认证服务器颁发的AccessToken")。
*/
public var description: String = "认证服务器颁发的AccessToken"
/**
* 授权地址。
*/
public var authorizationUrl: String = ""
/**
* Token 地址。
*/
public var tokenUrl: String = ""
/**
* 授权范围。
*/
public var scopes: HashMap<String, String> = HashMap<String, String>()
}
/**
* 文档相关配置(默认值)。
*/
public class SimApiDocOptions {
/**
* 文档组配置(默认 [new("api", "Api", "Api接口文档")])。
*/
public var apiGroups: ArrayList<SimApiDocGroup> = ArrayList<SimApiDocGroup>()
/**
* 授权配置(默认 SimApiAuthOption())。
*/
public var apiAuth = SimApiAuthOption()
/**
* 文档页面标题(默认 "API接口文档")。
*/
public var documentTitle: String = "API接口文档"
/**
* 接口支持的调用方式(默认仅 POST)。
*/
public var supportedMethods: Array<String> = ["POST"]
public init() {
apiGroups.add(SimApiDocGroup("api", "Api", description: "Api接口文档"))
}
}