Files
simapi-cj/src/configurations/SimApiDocOptions.cj
T
xrain ea31bd9b6a refactor: 删除仅有空构造器的 public init() {}——编译器自动提供无参构造
删除(类无其他构造器):
- SimApiBaseModel / SimApiLoggerProvider / SimApiSignProviderBase / AesBodyProviderBase
- SimApiResponseFilter / SimApiAuthCenterOptions / SimApiExceptionOptions
- SimApiHttpClientOptions / SimApiOptions / SimApiSynapseOptions / SimApiRouteOptions
- SimApiStorageOptions / SimApiRequestLogOptions / SimApiJobServer / SimApiAuthOption
- AuthDto 5 个纯 POCO(AppAndProfileItem/ConfirmResponse/LoginInfoResponse/
  GroupRelatedItem/GroupDetailTreeNode)/ AesBodyRequest

保留(有带参构造器,空 init 是反序列化/绑定必需):
- GetCodeResponse / PermissionItem / SimApiBaseRequest 系列 / PageResponse
- SimApiLoginItem / SimApiDocGroup / SimApiStorage 相关 / 各 DTO
2026-08-18 00:59:48 +08:00

88 lines
2.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* Copyright (c) 2025 SimcuTeam. All rights reserved.
* 移植自 C# 项目 SimApiE:\simcu\simapi-net),遵循 MIT 许可证。
* 对齐 C# 的 Configurations/SimApiDocOptions.cs。
*/
package simapi.configurations
import std.collection.*
/**
* 文档组配置(对齐 C# SimApiDocGroupOption)。
*/
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
}
}
/**
* 文档授权配置(对齐 C# SimApiAuthOption)。
* Type 支持 "SimApiAuth"、"ClientCredentials"、"Implicit"、"AuthorizationCode"、"Password"。
*/
public class SimApiAuthOption {
/**
* 认证方式(默认 ["SimApiAuth"])。
* `type` 是仓颉关键字,用反引号转义以对齐 C# 属性名 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>()
}
/**
* 文档相关配置(默认值与 C# 一致)。
*/
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接口文档"))
}
}