refactor: 对齐 simapi-net 的 20 项差异
- SimApiLoginItem._types 默认 [user] - 新增 SimApiIdOnlyRequest - errorWhenNone 改名 errorWhenNull - SimApiAuth.update 保留 TTL(Redis ttl/expire) - SimApiCache: set 接受 Any + 新增 get<T>/getString - SimApiHttpClient 签名字段移出 Options - SimApiUtil: md5/sha1 支持 mode + 新增 paginate - @SimApiAuth 支持逗号分隔多类型 - Logger: 4 位毫秒 + IsEnabled 恒 true - 删除 /versions 端点;exceptionHandler 改为抛错 - UseSimApi 中间件顺序对齐 .NET - README 同步更新
This commit is contained in:
@@ -26,24 +26,11 @@ public class SimApiCommonController <: SimApiBaseController {
|
||||
|
||||
/**
|
||||
* GET /exception/{code}:错误反馈页面(始终注册)。
|
||||
* 返回 SimApiBaseResponse(已是响应体,原样输出)。
|
||||
* 对齐 C# ExceptionHandler:抛 SimApiException,由异常中间件统一输出。
|
||||
*/
|
||||
@HttpGet["exception/{code}"]
|
||||
public func exceptionHandler(@FromRoute code: Int64): SimApiBaseResponse {
|
||||
SimApiBaseResponse(code, SimApiBaseResponse.getDefaultMessage(code))
|
||||
}
|
||||
|
||||
/**
|
||||
* GET/POST /versions:返回 SimApi/App 版本信息(HashMap 由 SimApiResponseFilter 自动封装)。
|
||||
*/
|
||||
@HttpGet["versions"]
|
||||
public func versions(): HashMap<String, Any> {
|
||||
versionsMap()
|
||||
}
|
||||
|
||||
@HttpPost["versions"]
|
||||
public func versionsPost(): HashMap<String, Any> {
|
||||
versionsMap()
|
||||
public func exceptionHandler(@FromRoute code: Int64): Unit {
|
||||
SimApiError.error(code: code)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user