first version
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) 2025 SimcuTeam. All rights reserved.
|
||||
* 移植自 C# 项目 SimApi(E:\simcu\simapi-net),遵循 MIT 许可证。
|
||||
*/
|
||||
|
||||
package simapi.communications
|
||||
|
||||
/**
|
||||
* 基础请求 DTO。
|
||||
*/
|
||||
public class SimApiBaseRequest {}
|
||||
|
||||
/**
|
||||
* 仅包含 Id 的请求。
|
||||
*/
|
||||
public class SimApiStringIdOnlyRequest {
|
||||
public var id: String = ""
|
||||
|
||||
public init() {}
|
||||
|
||||
public init(id: String) {
|
||||
this.id = id
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 单字段请求。
|
||||
* @param T 数据类型。
|
||||
*/
|
||||
public class SimApiOneFieldRequest<T> {
|
||||
public var data: ?T = None
|
||||
|
||||
public init() {}
|
||||
|
||||
public init(data: T) {
|
||||
this.data = Some(data)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 基础分页请求。
|
||||
*/
|
||||
public class SimApiBasePageRequest {
|
||||
public var page: Int64 = 1
|
||||
public var count: Int64 = 20
|
||||
|
||||
public init() {}
|
||||
|
||||
public init(page: Int64, count: Int64) {
|
||||
this.page = page
|
||||
this.count = count
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user