Commit 5e6d6c62 authored by David黄金龙's avatar David黄金龙

删除不使用的文件

parent 573ba0c1
......@@ -54,11 +54,4 @@ target 'galaxy' do
pod 'DeviceKit', '5.1.0'
#骨架图
pod 'SkeletonView','1.30.4'
# #数据模型转换
pod 'HandyJSON','5.0.2'
end
This diff is collapsed.
//
// BaseModel.swift
// DouYuUI
//
// Created by davidhuang on 2022/8/15.
// Copyright © 2022 davidhuang. All rights reserved.
//
import UIKit
import HandyJSON
// MARK: - JSon解析模型的基类
class BsBaseModel: HandyJSON {
var data : Any?
var errorCode : Int = -1
var errorMessage : String = ""
var success : Bool = false
// MARK: - 使用 HandyJSON 进行解析
required init() {}
}
......@@ -30,7 +30,7 @@ class BsOverlayView: UIView {
private func setupOverlayView() {
// 1 获取window
if (keyWindow == nil) {
self.keyWindow = UIApplication.shared.bsKeyWindow()
self.keyWindow = UIApplication.shared.yhKeyWindow()
}
// 2.遮罩view
overlayView = UIControl.init(frame: UIScreen.main.bounds)
......
//
// Date-Extension.swift
// DouYuUI
//
// Created by davidhuang on 2022/8/11.
// Copyright © 2022 davidhuang. All rights reserved.
//
import UIKit
extension Date {
static func getCurrentDate() -> String {
let now = Int(Date.timeIntervalSinceReferenceDate)
return "\(now)"
}
init(_ dateString: String, dateFormat: String = "yyyy-MM-dd") {
let df = DateFormatter()
df.dateFormat = dateFormat
let date = df.date(from: dateString)!
self.init(timeInterval: 0, since: date)
}
}
......@@ -10,7 +10,7 @@ import UIKit
extension UIApplication {
func bsKeyWindow() -> UIWindow? {
func yhKeyWindow() -> UIWindow? {
var originalKeyWindow: UIWindow?
#if swift(>=5.1)
if #available(iOS 13, *) {
......
......@@ -8,7 +8,7 @@
import Foundation
open class BsCacheTool: NSObject {
open class YhCacheTool {
/// 计算缓存大小
public static var cacheSize: String{
......
//
// BSjsonUtil.swift
// BaiSiSMApp
//
// Created by davidhuang on 2022/11/18.
// Copyright © 2022 www.davidhuang.com. All rights reserved.
//
import UIKit
import HandyJSON
class BSJsonUtil: NSObject {
/**
* Json转对象
*/
static func jsonToModel(_ jsonStr:String,_ modelType:HandyJSON.Type) ->BsBaseModel {
if jsonStr == "" || jsonStr.count == 0 {
#if DEBUG
print("jsonoModel:字符串为空")
#endif
return BsBaseModel()
}
return modelType.deserialize(from: jsonStr) as! BsBaseModel
}
/**
* Json转数组对象
*/
static func jsonArrayToModel(_ jsonArrayStr:String, _ modelType:HandyJSON.Type) ->[BsBaseModel] {
if jsonArrayStr == "" || jsonArrayStr.count == 0 {
#if DEBUG
print("jsonToModelArray:字符串为空")
#endif
return []
}
var modelArray:[BsBaseModel] = []
let data = jsonArrayStr.data(using: String.Encoding.utf8)
let peoplesArray = try! JSONSerialization.jsonObject(with:data!, options: JSONSerialization.ReadingOptions()) as? [AnyObject]
for people in peoplesArray! {
modelArray.append(dictionaryToModel(people as! [String : Any], modelType))
}
return modelArray
}
/**
* 字典转对象
*/
static func dictionaryToModel(_ dictionStr:[String:Any],_ modelType:HandyJSON.Type) -> BsBaseModel {
if dictionStr.count == 0 {
#if DEBUG
print("dictionaryToModel:字符串为空")
#endif
return BsBaseModel()
}
return modelType.deserialize(from: dictionStr) as! BsBaseModel
}
/**
* 对象转JSON
*/
static func modelToJson(_ model:BsBaseModel?) -> String {
if model == nil {
#if DEBUG
print("modelToJson:model为空")
#endif
return ""
}
return (model?.toJSONString())!
}
/**
* 对象转字典
*/
static func modelToDictionary(_ model:BsBaseModel?) -> [String:Any] {
if model == nil {
#if DEBUG
print("modelToJson:model为空")
#endif
return [:]
}
return (model?.toJSON())!
}
//数组转json
static func arrayToJson(_ array:NSArray) -> String {
if (!JSONSerialization.isValidJSONObject(array)) {
print("无法解析出JSONString")
return ""
}
let data : NSData! = try? JSONSerialization.data(withJSONObject: array, options: []) as NSData
let JSONString = NSString(data:data as Data,encoding: String.Encoding.utf8.rawValue)
return JSONString! as String
}
/**
* 字典转JSON
*/
static func dictionaryToJson(_ dictionary:NSDictionary) -> String {
if (!JSONSerialization.isValidJSONObject(dictionary)) {
print("无法解析出JSONString")
return ""
}
let data : NSData! = try? JSONSerialization.data(withJSONObject: dictionary, options: []) as NSData
let JSONString = NSString(data:data as Data,encoding: String.Encoding.utf8.rawValue)
return JSONString! as String
}
}
......@@ -10,116 +10,6 @@ import UIKit
// MARK: - 工程中的 常量定义
class BsConstant {
// MARK: - 个人信息基本类型
enum UserBaseInfoType : Int {
case unknow //未知
case sex//性别
case birthday//生日
case height//身高
case weight//体重
case education //学历
case profession //职务
case work_domain//从事行业
case income//收入
func title() -> String {
switch self {
case .sex:
return "性别"
case .birthday:
return "生日"
case .height:
return "身高"
case .weight:
return "体重"
case .education:
return "学历"
case .profession:
return "职务"
case .work_domain:
return "从事行业"
case .income:
return "收入"
default:
return "--"
}
}
func titleForSelectView() -> String {
switch self {
case .sex:
return "性别"
case .birthday:
return "生日"
case .height:
return "身高(单位:cm)"
case .weight:
return "体重(单位:kg)"
case .education:
return "学历"
case .profession:
return "职务"
case .work_domain:
return "从事行业"
case .income:
return "收入(单位:k)"
default:
return "--"
}
}
/*
var id : String = ""//用户ID
var user_type : String = ""//用户类型 1:普通用户2.明星用户3.管理员
var sex : String = ""//性别 0其他, 1:男, 2女
var real_name : String = "" //真实姓名
var nick_name : String = "" //昵称
var avatar : String = ""//头像
var birthday : String = ""//生日
var status : String = ""//用户状态1:正常,0:已注销
var height : String = ""//身高
var weight : String = ""//体重
var user_name : String = ""//用户名
var phone : String = ""//手机号码
var marital_status : String = ""//婚姻情况
var profession : String = ""//职业ID
var profession_name : String = ""//职业名称
var education : String = ""//文化程度ID
var education_name : String = ""//文化程度名称
var work_domain : String = ""//行业领域ID
var work_domain_name : String = ""//行业领域名称
*/
func key() -> String {
switch self {
case .sex:
return "sex"
case .birthday:
return "birthday"
case .height:
return "height"
case .weight:
return "weight"
case .education:
return "education"
case .profession:
return "profession"
case .work_domain:
return "work_domain"
case .income:
return "monthly_income"
default:
return ""
}
}
}
// MARK: - URL 相关
struct URL {
......
......@@ -37,7 +37,7 @@ class YHBaseUrlManager {
#if DEBUG
return urlForEditing ?? YHBaseUrlManager.baseUrlDev
#else
return urlForEditing ?? YHBaseUrlManager.baseUrlRelease
return YHBaseUrlManager.baseUrlRelease
#endif
}
......
......@@ -7,7 +7,6 @@
import UIKit
import SnapKit
import PDFKit
struct PersonalModuleItem {
var icon: String
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment