- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试从 API 获取响应,但缺少一些值,我如何获取这些值,我的响应是这样的,
{
"responseHeader": {
"code": 1,
"msg": "Data Retrived Successfully "
},
"responseBody": {
"data": [
{
"totalPages": 1,
"pageNumber": 0,
"numberOfElements": 3,
"totalRecords": 3,
"data": [
{
"buyerProcessId": 55,
"bidReferenceNo": "BidReferenceNo-439187-GEA",
"biddingStatus": null,
"chiraghuser": {
"userId": 1678,
"userName": "mutiurrehman111",
"userEmail": "muti.urrehman2202@gmail.com",
"firstName": "Muti",
"middleName": null,
"lastName": "urRehman",
"mobileNo": "3477002202",
"streetAddress": null,
"buildingAddress": "Dubai Tower - D89 - Dubai - United Arab Emirates",
"emailVerificationCode": null,
"mobileOtpCode": "8712",
"cityId": 1,
"otpCodeExpiration": null,
"profilePicUpload": null,
"token": "1",
"role": "chiraghuser",
"nationality": "Pakistani",
"idCardNumber": null,
"idCardExpiryDate": null,
"passportNumber": null,
"passportExpiryDate": null,
"phoneNumber": null,
"fax": null,
"classifyYourself": null,
"country": null,
"userCity": null,
"scannedPassportCopyUpload": null,
"scannedIdCopyUpload": null,
"oldPasssword": null,
"status": "activated",
"nationalityOther": null,
"securityOtp": "4491",
"mobileCode": "92",
"telephoneCode": null,
"countryId": 162,
"isApproved": null
},
"chiraghproperty": {
"propertyId": 36567,
"propertyTitle": "Jumeirah Village Triangle , 4 Beds, Town House",
"propertyDescription": "Jumeirah Village Triangle - Jumeirah Village Triangle - Jumeirah Village Triangle - Jumeirah Village Triangle - Jumeirah Village Triangle - Jumeirah Village Triangle - Jumeirah Village Triangle - Jumeirah Village Triangle - Jumeirah Village Triangle - Jumeirah Village Triangle - ",
"location": null,
"sizePerSqft": 0.0,
"address": "Dubai - United Arab Emirates",
"askingPrice": 0.0,
"areaPermitNo": null,
"propertyReferenceNo": "Prop-840146-BFU",
"pricePerSqft": 0.0,
"isMdApproved": true,
"isPublished": null,
"noOfBedrooms": 4,
"noOfBaths": 3,
"floorNo": null,
"kitchens": null,
"carParks": null,
"noOfFloors": null,
"propertyTypeId": null,
"scannedTitleDeed": null,
"mapLocation": "25.0472882,55.190022699999986",
"plotNo": null,
"titleDeedNo": null,
"typeArea": "Non-Free Hold",
"projectName": "Jumeirah Village Triangle ",
"ownerAssociationNo": null,
"presentUse": "Residential",
"communityNo": null,
"propertyAge": null,
"noUnits": null,
"noShops": null,
"userId": null,
"leaseStartDate": null,
"leaseExpiryDate": null,
"tenantName": null,
"tenancyContractUpload": null,
"thirdPartyVerification": "true",
"isThirdPartyPayment": null,
"verificationHodApproved": "1",
"valuationHodApproved": false,
"isVacant": null,
"agreeVatCommission": false,
"amount": 0.0,
"balanceAmount": 0.0,
"propertyNo": null,
"propertyStatus": "Off-Plan",
"propertyType": "Town House",
"area": null,
"lastActionPerformed": "Not Started",
"isPersonalDetailsVerified": null,
"isPoaDetailsVerified": null,
"isPropertyDetailsVerified": "true",
"isAcknowledgementCall": null,
"dateReceived": "2019-10-21",
"lastAction": null,
"actionPerformedBy": null,
"sellerUserName": "Test_User",
"status": "active",
"areaUnit": "sqft",
"isPropertyFinancialDetailsVerified": null,
"isPropertyRentalDetailsVerified": null,
"bankOther": null,
"netArea": "980",
"grossArea": "1500",
"floorPlanUpload": null,
"typePropertyOther": null,
"propertyStatusOther": null,
"bulidingName": null,
"bulidingNumber": null,
"isVerificationHodApproved": "false",
"valuationAssignTo": null,
"brokerageAssignTo": null,
"isValuationCompleted": null,
"valuationReportCopy": "https://s3.us-east-2.amazonaws.com/chiragh-asset/1571665049034-1valuation.pdf",
"isThirdPartyValuationCompleted": null,
"thirdPartyReportCopy": null,
"isValuationReportUploaded": "true",
"valuationReportDocument": "https://s3.us-east-2.amazonaws.com/chiragh-asset/1571665045520-1valuation.pdf",
"isValuationHodApproved": "1",
"isBrokerageCompleted": null,
"isBrokerageReportUploaded": "true",
"brokerageReportCopy": "https://s3.us-east-2.amazonaws.com/chiragh-asset/1571665219758-1valuation.pdf",
"isBrokerageHodApproved": "1",
"price": null,
"isWatchedList": null,
"auctionStatus": "live",
"developerName": "dev",
"makaniNo": null,
"adminPropertyStatus": "new",
"requestedChanges": null,
"priceUnit": null,
"telephoneCode": null,
"mobileCode": null,
"listingChecklistConfirm": true,
"listingHodApproved": "1",
"verificationChecklistConfirm": null,
"valuationChecklistConfirm": null,
"brokerageChecklistConfirm": null,
"financeChecklistConfirm": null,
"isFinanceHodApproved": null,
"verificationAssignTo": null,
"otherDocument": null,
"spaDocument": "https://s3.us-east-2.amazonaws.com/chiragh-asset/1571664075956-1valuation.pdf",
"okoodiNo": "787878787",
"netAreaUnit": "sqft",
"officeNo": null,
"departementId": null,
"userRoleId": null,
"isOwnerVerified": false,
"isPoaVerified": false,
"isPropertyVerified": false,
"isReportVisibleToSeller": null,
"formAUpload": "https://s3.us-east-2.amazonaws.com/chiragh-asset/1571665216574-1valuation.pdf",
"isFormAUploaded": 1,
"isValuationReportCopyUploaded": null,
"isRegistrationReady": null,
"rentalOtherDocument": null,
"thirdpartyHodApproved": null,
"listingTitle": "Jumeirah Village Triangle , 4 Beds, Town House",
"listingDescription": "<p>Jumeirah Village Triangle - Jumeirah Village Triangle - Jumeirah Village Triangle - Jumeirah Village Triangle - Jumeirah Village Triangle - Jumeirah Village Triangle - Jumeirah Village Triangle - Jumeirah Village Triangle - Jumeirah Village Triangle - Jumeirah Village Triangle -</p>",
"buyerProcessId": 0,
"images": [
{
"propertyId": 36567,
"imageUrl": "https://s3.us-east-2.amazonaws.com/chiragh-asset/1571665096963-95a23be9d1e876b1ae03514493ff69cc_mod_1.jpg",
"imageName": "ordinary",
"fileName": null,
"isVisible": null,
"thumbnailUrl": "https://s3.us-east-2.amazonaws.com/chiragh-asset/1571665097160-95a23be9d1e876b1ae03514493ff69cc_mod_1.jpg"
},
{
"propertyId": 36567,
"imageUrl": "https://s3.us-east-2.amazonaws.com/chiragh-asset/1571665099672-49836-1.jpg",
"imageName": "ordinary",
"fileName": null,
"isVisible": null,
"thumbnailUrl": "https://s3.us-east-2.amazonaws.com/chiragh-asset/1571665099909-49836-1.jpg"
},
{
"propertyId": 36567,
"imageUrl": "https://s3.us-east-2.amazonaws.com/chiragh-asset/1571665102680-292968_16012118210039308812.jpg",
"imageName": "ordinary",
"fileName": null,
"isVisible": true,
"thumbnailUrl": "https://s3.us-east-2.amazonaws.com/chiragh-asset/1571665102759-292968_16012118210039308812.jpg"
},
{
"propertyId": 36567,
"imageUrl": "https://s3.us-east-2.amazonaws.com/chiragh-asset/1571665106366-1804.png",
"imageName": "ordinary",
"fileName": null,
"isVisible": true,
"thumbnailUrl": "https://s3.us-east-2.amazonaws.com/chiragh-asset/1571665106475-1804.png"
},
{
"propertyId": 36567,
"imageUrl": "https://s3.us-east-2.amazonaws.com/chiragh-asset/1571665112768-37605408-800x600.jpeg",
"imageName": "ordinary",
"fileName": null,
"isVisible": null,
"thumbnailUrl": "https://s3.us-east-2.amazonaws.com/chiragh-asset/1571665112906-37605408-800x600.jpeg"
},
{
"propertyId": 36567,
"imageUrl": "https://s3.us-east-2.amazonaws.com/chiragh-asset/1571665117617-130257047.jpg",
"imageName": "main-ordinary",
"fileName": null,
"isVisible": true,
"thumbnailUrl": "https://s3.us-east-2.amazonaws.com/chiragh-asset/1571665117694-130257047.jpg"
},
{
"propertyId": 36567,
"imageUrl": "https://s3.us-east-2.amazonaws.com/chiragh-asset/1571665122815-117127050.jpg",
"imageName": "ordinary",
"fileName": null,
"isVisible": null,
"thumbnailUrl": "https://s3.us-east-2.amazonaws.com/chiragh-asset/1571665122878-117127050.jpg"
},
{
"propertyId": 36567,
"imageUrl": "https://s3.us-east-2.amazonaws.com/chiragh-asset/1571676983964-10-marla-house-design-luxury-new-indian-exterior-house-designs-s-of-10-marla-house-design.jpg",
"imageName": "ordinary",
"fileName": null,
"isVisible": true,
"thumbnailUrl": "https://s3.us-east-2.amazonaws.com/chiragh-asset/1571676984241-10-marla-house-design-luxury-new-indian-exterior-house-designs-s-of-10-marla-house-design.jpg"
}
],
"propertyBids": null,
"country": {
"countryId": 0,
"name": null,
"isActive": null,
"nationality": null,
"iso2": null,
"iso3": null,
"code": null,
"cities": []
},
"city": {
"cityId": 0,
"name": null,
"isActive": null
}
},
"processType": "open_house",
"paymentStatus": null,
"openHouseNotes": null
}
]
}]}
这是我的模型类,我通过它在我的模型类中传递 json,
import ObjectMapper
class OpenHouseModel: Mappable {
var totalPages : Int?
var pageNumber : Int?
var numberOfElements : Int?
var totalRecords : Int?
var propertyData : [PropertyData]?
required init?(map: Map) {
}
func mapping(map: Map) {
totalPages <- map["totalPages"]
pageNumber <- map["pageNumber"]
numberOfElements <- map["numberOfElements"]
totalRecords <- map["totalRecords"]
propertyData <- map["data"]
}
}
class PropertyData: Mappable {
var buyerProcessId : Int?
var bidReferenceNo : String?
var processType : String?
var chiraghProperty : ChiraghProperty?
var images : [PropertyImages]?
required init?(map: Map) {
}
func mapping(map: Map) {
processType <- map["processType"]
buyerProcessId <- map["buyerProcessId"]
buyerProcessId <- map["bidReferenceNo"]
chiraghProperty <- map["chiraghproperty"]
images <- map["images"]
}
}
class ChiraghProperty: Mappable {
var propertyId : Int?
var propertyTitle : String?
var propertyDescription : String?
var sizePerSqft : Double?
var address : String?
var propertyReferenceNo : String?
var pricePerSqft : Double?
var noOfBedrooms : Int?
var noOfBaths : Int?
var typeArea : String?
var projectName : String?
var presentUse : String?
var propertyType : String?
var dateReceived : String?
var areaUnit : String?
var status : String?
var netArea : String?
var grossArea : String?
var valuationReportCopy : String?
var valuationReportDocument: String?
var brokerageReportCopy: String?
var spaDocument : String?
var formAUpload : String?
required init?(map: Map) {
}
func mapping(map: Map) {
propertyId <- map["propertyId"]
propertyTitle <- map["propertyTitle"]
propertyDescription <- map["propertyDescription"]
sizePerSqft <- map["sizePerSqft"]
address <- map["address"]
propertyReferenceNo <- map["propertyReferenceNo"]
pricePerSqft <- map["pricePerSqft"]
noOfBedrooms <- map["noOfBedrooms"]
noOfBaths <- map["noOfBaths"]
typeArea <- map["typeArea"]
projectName <- map["projectName"]
propertyType <- map["propertyType"]
dateReceived <- map["dateReceived"]
areaUnit <- map["areaUnit"]
status <- map["status"]
netArea <- map["netArea"]
valuationReportCopy <- map["valuationReportCopy"]
valuationReportDocument <- map["valuationReportDocument"]
brokerageReportCopy <- map["brokerageReportCopy"]
spaDocument <- map["spaDocument"]
formAUpload <- map["formAUpload"]
}
}
class PropertyImages: Mappable {
var imageUrl : String?
var imageName : String?
required init?(map: Map) {
}
func mapping(map: Map) {
imageUrl <- map["imageUrl"]
imageName <- map["imageName"]
}
}
现在,当我运行代码并获取值时,buyerProcessId
键为 nil。其他值都很好,我不知道为什么它不显示 chiraghuser
上方这些键的值。
最佳答案
看起来您的问题出在 PropertyData
中,因为您似乎正在将 bidReferenceNo
映射到 buyerProcessId
。这就是您得到 nil
的原因。
class PropertyData: Mappable {
var buyerProcessId : Int?
var bidReferenceNo : String?
var processType : String?
var chiraghProperty : ChiraghProperty?
var images : [PropertyImages]?
required init?(map: Map) {
}
func mapping(map: Map) {
processType <- map["processType"]
buyerProcessId <- map["buyerProcessId"]
buyerProcessId <- map["bidReferenceNo"] // this seems like it is wrong and should be bidReferenceNo
chiraghProperty <- map["chiraghproperty"]
images <- map["images"]
}
}
关于json - 快速解析响应时出现问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58539151/
如何更改循环中变量的名称?比如 number1 、 number2 、 number3 、 number4 ? var array = [2,4,6,8] func ap ( number1: Int
我想设置 View 的背景颜色并在一定延迟后将其更改为另一种颜色。这是我的尝试方式: print("setting color 1") self.view.backgroundColor = UICo
我在使用 express-session 时遇到问题。 session 数据不会在请求之间持续存在。 正如您在下面的代码中看到的那样,/join 路由设置了一些 session 属性,但是当 /sur
我试图从叶渲染器获得一个非常简单的结果,用于快速 Steam 的 for 循环。 我正在上传叶文件 HTML,因为它不接受此处格式正确的代码 - 下面的pizza.swift代码- import
你们中有人有什么好的链接可以与我分享吗?我正在寻找一个 FAST 程序员编辑器,它可以非常快速地打开包含超过 100, 000 行代码的文件?我目前正在使用记事本自动取款机,打开一个 29000 行长
我现在正在处理眼动追踪数据,因此拥有一个巨大的数据集(想想数百万行),因此希望有一种快速的方法来完成此任务。这是它的简化版本。 数据告诉您眼睛在每个时间点正在查看的位置以及我们正在查看的每个文件。 X
我是新手,想为计时器或其他设备选择提示音。 如何打开此列表,以选择其中一种声音? Alert sound list 最佳答案 您将无法在应用中使用系统声音。 但是,您可以包括自己的声音文件,并将其显示
我编写了以下代码来构建具有顺序字符串的数组。 它的工作方式与我预期的一样,但我希望它能更快地运行。有没有更有效的方法在PowerShell中产生我想要的结果? 我是PowerShell的新手,非常感谢
我有一个包含一些非唯一行的矩阵,例如: x 尝试 y <- rle(apply(x, 1, paste, collapse = " ")) # y$lengths is the vector con
我的函数“keyboardWillShown”有问题。所以我想要的是菜单打开时,菜单正好出现在键盘上方。它可以在Iphone 8 plus,8、7、6上完美运行。但是,当我在模拟器上运行Iphone
我正在尝试通过Swift 5中的HTTP get方法从API提取数据。它在启动时成功加载了数据,但是当我刷新页面时,它说“索引超出范围”,这是因为数据是不再会在我的日志中读取,因此索引中没有任何内容。
我想做什么: 从我的数据库中获取时间戳并将其转换为用户的时区。 我的代码: let tryItNow = "\(model.timestampName)" let format = D
给定字体名称和字体大小,如何查找字符串的宽度(CGFloat)? (目标是将UIView的宽度设置为足以容纳字符串的宽度。) 我有两个字符串:一个重复“1”,重复36次,另一个重复“M”,重复36次。
我正在尝试解析此JSON ["Items": ( { AccountBalance = 0; AlphabetType = 3; Description = "\U0631\U
我在UINavigationBar内放置了一个UILabel。 我想根据navigationBar的高度增加该标签的字体大小。当navigationBar很大时,我希望字体大小更大;当滚动并缩小nav
我想将用户输入限制为仅有效数字并使用以下内容: func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, rep
目前我有一个包含超过 100.000 张图像的数据库,它们大小不一或类似,但我想为我的公司制作以下内容: 我插入/上传一张图片,系统返回最有可能相同的图片。我不知道使用什么算法,但它需要快速。我可以预
在我的 swift 项目中,我有一个按钮,我想在标签上打印按下该按钮的时间。 如何解决这个问题? 最佳答案 添加到DHEERAJ的答案中,您只需在func press(sender: UIButton
我必须发表评论,尝试在解析中导入数组。然而,有一个问题。 当我尝试从 Parse 加载数组时,我的输出是 ("Blah","Blah","Blah")这是一个元组...而不是一个数组 TT... 如何
我的应用程序有一个名为 MyDevice 的类,我用它来与硬件通信。该硬件是可选的,实例变量也是可选的: var theDevice:MyDevice = nil 然后,在应用程序中,我必须初始化设备
我是一名优秀的程序员,十分优秀!