2026-08-16 12:46:15 +08:00
|
|
|
|
/*
|
|
|
|
|
|
* Copyright (c) 2025 SimcuTeam. All rights reserved.
|
|
|
|
|
|
* 移植自 C# 项目 SimApi(E:\simcu\simapi-net),遵循 MIT 许可证。
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
package simapi.communications
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 基础请求 DTO。
|
|
|
|
|
|
*/
|
|
|
|
|
|
public class SimApiBaseRequest {}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 仅包含 Id 的请求。
|
|
|
|
|
|
*/
|
2026-08-16 23:44:20 +08:00
|
|
|
|
public class SimApiIdOnlyRequest {
|
|
|
|
|
|
public var id: Int64 = 0
|
|
|
|
|
|
|
|
|
|
|
|
public init() {}
|
|
|
|
|
|
|
|
|
|
|
|
public init(id: Int64) {
|
|
|
|
|
|
this.id = id
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 仅包含 Id 的请求(字符串)。
|
|
|
|
|
|
*/
|
2026-08-16 12:46:15 +08:00
|
|
|
|
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
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|