pragma solidity ^0.4.0;
contract Rent {
uint price1;
address addr1;
uint public roomIndex;
mapping(address => mapping(uint => Room)) stores;
mapping(uint => address) roomIdInStore;
struct Room{//fangwu房屋duixiang房屋对象
uint id; //fanmgwu房屋 ID
string name;
string ty; //zhengzu整租 hezu合租
string imageLink;//tupian图片 HASH
string descr; //fangwumiaoshu房屋描述
uint price; //zujin租金
address ad;
}
function Rent() public {//gouzaohanshu构造函数
roomIndex = 0;
addr1 = msg.sender;
}
//保存起来
function addRoomToStore(string name,string ty,string imageLink,string descr,uint price) public {
roomIndex += 1 ;
Room memory room = Room(roomIndex,name,ty,imageLink,descr,price,addr1) ;
stores[msg.sender][roomIndex]=room