add swiftUI code

This commit is contained in:
zeus
2025-01-22 14:09:10 +08:00
parent 68e7b7347c
commit 8a99853829
2531 changed files with 486215 additions and 0 deletions
@@ -0,0 +1,35 @@
//
// InviteReponse.swift
// SFI
//
// Created by Mac on 2024/10/21.
//
import Foundation
// MARK: - Welcome
struct InviteReponse: Codable {
let status, message: String?
let data: InviteReponseDataClass?
}
// MARK: - DataClass
struct InviteReponseDataClass: Codable {
let codes: [InviteCode]?
let stat: [Int]?
}
// MARK: - Code
struct InviteCode: Codable,Identifiable {
var id = UUID().uuidString
let userID: Int
let code: String
let createdAt:Int
enum CodingKeys: String, CodingKey {
case userID = "user_id"
case code
case createdAt = "created_at"
}
}
@@ -0,0 +1,20 @@
//
// File.swift
// SFI
//
// Created by Mac on 2024/10/13.
//
import Foundation
struct MessageResponse: Codable {
let message: String
let status: String?
let errors: MessageResponseErrors?
}
// MARK: - Errors
struct MessageResponseErrors: Codable {
let email: [String]
}
@@ -0,0 +1,30 @@
//
// Nodes.swift
// SFI
//
// Created by Mac on 2024/10/13.
//
import Foundation
// MARK: - Welcome
struct nodereponse: Codable {
let data: [nodereponseData]?
let message: String?
}
// MARK: - Datum
struct nodereponseData: Codable,Identifiable {
// let id: Int
var id = UUID().uuidString
let type, name, rate: String
let id2, isOnline: Int
let cacheKey: String
enum CodingKeys: String, CodingKey {
case type, name, rate
case isOnline = "is_online"
case id2 = "id"
case cacheKey = "cache_key"
}
}
@@ -0,0 +1,17 @@
//
// OnBoardingItem.swift
// AnimatedOnBoardingScreen
//
// Created by Balaji on 17/12/22.
//
import SwiftUI
import Lottie
// MARK: OnBoarding Item Model
struct OnboardingItem: Identifiable,Equatable{
var id: UUID = .init()
var title: String
var subTitle: String
var lottieView: LottieAnimationView = .init()
}
@@ -0,0 +1,133 @@
//
// File.swift
// SFI
//
// Created by Mac on 2024/10/21.
//
import Foundation
// MARK: - OrderInfoReponse
struct OrderInfoReponse: Codable {
let status, message: String?
let data: [OrderInfoDatum]?
}
struct OrderInfoSingleReponse: Codable {
let status, message: String?
let data: OrderInfoDatum?
}
// MARK: - Datum
struct OrderInfoDatum: Codable ,Identifiable {
var id = UUID().uuidString
let inviteUserID: String?
let planID: Int?
let siteID, couponID: String?
let type: Int
let period: String
let couponCode: String?
let tradeNo: String
let callbackNo: String?
let totalAmount: Double
let handlingAmount, discountAmount, surplusAmount, refundAmount: Double?
let balanceAmount, surplusOrderIDS,paymentID: Int?
let status: Int
let actualCommissionBalance, paidAt: String?
let createdAt, updatedAt: Int
let commissionStatus, commissionBalance: Int?
let tixianstatus: String?
let plan: PlanOrder
var status_zh: String {
switch status {
case 0:
return "待支付"
case 1:
return "已支付"
case 2:
return "已取消"
default:
return "未知"
}
}
var period_zh: String {
switch period {
case "month_price":
return "月付"
case "quarter_price":
return "季付"
case "half_year_price":
return "半年付"
case "year_price":
return "年付"
default:
return "月付"
}
}
enum CodingKeys: String, CodingKey {
case inviteUserID = "invite_user_id"
case planID = "plan_id"
case siteID = "site_id"
case couponID = "coupon_id"
case paymentID = "payment_id"
case type, period
case couponCode = "coupon_code"
case tradeNo = "trade_no"
case callbackNo = "callback_no"
case totalAmount = "total_amount"
case handlingAmount = "handling_amount"
case discountAmount = "discount_amount"
case surplusAmount = "surplus_amount"
case refundAmount = "refund_amount"
case balanceAmount = "balance_amount"
case surplusOrderIDS = "surplus_order_ids"
case status
case commissionStatus = "commission_status"
case commissionBalance = "commission_balance"
case actualCommissionBalance = "actual_commission_balance"
case paidAt = "paid_at"
case createdAt = "created_at"
case updatedAt = "updated_at"
case tixianstatus, plan
}
}
// MARK: - Plan
struct PlanOrder: Codable {
let id: Int
let name: String
let speedLimit: Int?
let show, sort, renew, groupID, transferEnable: Int?
let content: String
let monthPrice, quarterPrice, halfYearPrice, yearPrice: Int?
let twoYearPrice, threeYearPrice, onetimePrice, resetPrice: Double?
let resetTrafficMethod: Int?
let capacityLimit: Int?
let createdAt, updatedAt: Int
enum CodingKeys: String, CodingKey {
case id
case groupID = "group_id"
case transferEnable = "transfer_enable"
case name
case speedLimit = "speed_limit"
case show, sort, renew, content
case monthPrice = "month_price"
case quarterPrice = "quarter_price"
case halfYearPrice = "half_year_price"
case yearPrice = "year_price"
case twoYearPrice = "two_year_price"
case threeYearPrice = "three_year_price"
case onetimePrice = "onetime_price"
case resetPrice = "reset_price"
case resetTrafficMethod = "reset_traffic_method"
case capacityLimit = "capacity_limit"
case createdAt = "created_at"
case updatedAt = "updated_at"
}
}
@@ -0,0 +1,28 @@
//
// PaymentReponse.swift
// SFI
//
// Created by Mac on 2024/10/21.
//
import Foundation
// MARK: - PaymentReponse
struct PaymentReponse: Codable {
let status, message: String?
let data: [PaymentReponseDatum]?
}
// MARK: - Datum
struct PaymentReponseDatum: Codable {
let id: Int
let name, payment: String
let icon,handlingFeePercent,handlingFeeFixed: String?
enum CodingKeys: String, CodingKey {
case id, name, payment, icon
case handlingFeeFixed = "handling_fee_fixed"
case handlingFeePercent = "handling_fee_percent"
}
}
@@ -0,0 +1,46 @@
//
// PlanResponse.swift
// SFI
//
// Created by Mac on 2024/10/12.
//
import Foundation
// MARK: - Welcome
struct PlanResponse: Codable {
let data: [DatuPlanResponse]?
let message: String?
}
// MARK: - Datum
struct DatuPlanResponse: Codable,Identifiable {
var id = UUID()
let idOLD, groupID, transferEnable: Int?
let name: String
let deviceLimit: Int?
let show: Int?
let renew: Int?
let content: String?
let monthPrice, quarterPrice, halfYearPrice, yearPrice: Int?
let onetimePrice: Int?
let createdAt, updatedAt: Int?
enum CodingKeys: String, CodingKey {
case idOLD = "id"
case groupID = "group_id"
case transferEnable = "transfer_enable"
case name
case deviceLimit = "device_limit"
case show, renew, content
case monthPrice = "month_price"
case quarterPrice = "quarter_price"
case halfYearPrice = "half_year_price"
case yearPrice = "year_price"
case onetimePrice = "onetime_price"
case createdAt = "created_at"
case updatedAt = "updated_at"
}
}
@@ -0,0 +1,27 @@
//
// Server.swift
// Server
//
// Created by Balaji on 12/09/21.
//
import SwiftUI
// Sample Server and data...
//struct Server: Identifiable {
//
// var id = UUID().uuidString
// var name: String
// var flag: String
//}
//var servers = [
// Server(name: "Auto Select", flag: "us"),
// Server(name: "United States", flag: "us"),
// Server(name: "India", flag: "in"),
// Server(name: "United Kingdom", flag: "uk"),
// Server(name: "France", flag: "fr"),
// Server(name: "Germany", flag: "ge"),
// Server(name: "Singapore", flag: "si"),
//]
@@ -0,0 +1,67 @@
//
// File.swift
// SFI
//
// Created by Mac on 2024/10/12.
//
import Foundation
// MARK: - Welcome
struct SubscribeReponse: Codable {
let data: SubscribeReponseClass?
let message: String?
}
// MARK: - DataClass
struct SubscribeReponseClass: Codable {
let planID: Int?
let token: String
let u, d, transferEnable: Int
let email, uuid: String
let plan: Plan?
let subscribeURL: String
enum CodingKeys: String, CodingKey {
case planID = "plan_id"
case token
case u, d
case transferEnable = "transfer_enable"
case email, uuid, plan
case subscribeURL = "subscribe_url"
}
}
// MARK: - Plan
struct Plan: Codable {
let id, groupID: Int
let name: String
let show,renew: Int
let content: String?
let monthPrice, quarterPrice, halfYearPrice, yearPrice: Int?
let onetimePrice: Int?
let createdAt, updatedAt: Int
enum CodingKeys: String, CodingKey {
case id
case groupID = "group_id"
case name
case show, renew, content
case monthPrice = "month_price"
case quarterPrice = "quarter_price"
case halfYearPrice = "half_year_price"
case yearPrice = "year_price"
case onetimePrice = "onetime_price"
case createdAt = "created_at"
case updatedAt = "updated_at"
}
}
@@ -0,0 +1,56 @@
//
// TicketChatReponse.swift
// SFI
//
// Created by Mac on 2024/10/20.
//
import Foundation
// MARK: - TicketChatReponse
struct TicketChatReponse: Codable {
let status, message: String?
let data: TicketChatReponseDataClass?
}
// MARK: - DataClass
struct TicketChatReponseDataClass: Codable {
let id, level, replyStatus, status: Int
let subject: String
let message: [Message]
let createdAt, updatedAt, userID: Int
enum CodingKeys: String, CodingKey {
case id
case level
case replyStatus = "reply_status"
case status, subject, message
case createdAt = "created_at"
case updatedAt = "updated_at"
case userID = "user_id"
}
}
struct Message: Codable ,Identifiable,Equatable {
var id = UUID().uuidString
let idold, ticketID: Int
let isMe: Bool
let message: String
let photo:String?
let createdAt, updatedAt: Int
let profilePic : String?
enum CodingKeys: String, CodingKey {
case idold = "id"
case ticketID = "ticket_id"
case isMe = "is_me"
case message
case photo
case profilePic
case createdAt = "created_at"
case updatedAt = "updated_at"
}
}
@@ -0,0 +1,36 @@
//
// TicketsReponse.swift
// SFI
//
// Created by Mac on 2024/10/20.
//
import Foundation
// MARK: - Welcome
struct TicketsReponse: Codable {
let status, message: String?
let data: [TicketsReponseDatum]?
}
//Message
// MARK: - Datum
struct TicketsReponseDatum: Codable,Identifiable {
var id = UUID().uuidString
let idOLD, level, replyStatus, status: Int
let subject: String
let message: String?
let createdAt, updatedAt, userID: Int
enum CodingKeys: String, CodingKey {
case idOLD = "id"
case level
case replyStatus = "reply_status"
case status, subject, message
case createdAt = "created_at"
case updatedAt = "updated_at"
case userID = "user_id"
}
}
@@ -0,0 +1,30 @@
//
// UserInfo.swift
// LoginKit
//
// Created by Mac on 2024/10/12.
//
import Foundation
struct UserInfo: Codable {
struct Data: Codable {
let email: String
let transfer_enable: Int
let device_limit: Int?
let last_login_at: Int
let created_at: Int
let banned: Int
let remind_expire: Int
let remind_traffic: Int
let expired_at: Int?
let balance: Int
let commission_balance: Int
let plan_id: Int
let discount: Int?
let commission_rate: Int?
let telegram_id: Int?
let uuid: String
let avatar_url: String
}
let data: Data
}