lib

package
v0.0.0-...-40b8f2d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

*

  • @Author: 夜央 Oh oh oh oh oh oh (https://github.com/togettoyou)
  • @Email: zoujh99@qq.com
  • @Date: 2020/3/4 2:00 下午
  • @Description: 定义的数据结构体、常量

Index

Constants

View Source
const (
	UserKey     = "user-key"
	ResourceKey = "resource-key"
	DealKey     = "deal-key"

	AccountKey         = "account-key"
	RealEstateKey      = "real-estate-key"
	SellingKey         = "selling-key"
	SellingBuyKey      = "selling-buy-key"
	DonatingKey        = "donating-key"
	DonatingGranteeKey = "donating-grantee-key"
)

Variables

View Source
var DonatingStatusConstant = func() map[string]string {
	return map[string]string{
		"donatingStart": "捐赠中",
		"cancelled":     "已取消",
		"done":          "完成",
	}
}

捐赠状态

View Source
var SellingStatusConstant = func() map[string]string {
	return map[string]string{
		"saleStart": "销售中",
		"cancelled": "已取消",
		"expired":   "已过期",
		"delivery":  "交付中",
		"done":      "完成",
	}
}

销售状态

Functions

This section is empty.

Types

type Account

type Account struct {
	AccountId string  `json:"accountId"` //账号ID
	UserName  string  `json:"userName"`  //账号名
	Balance   float64 `json:"balance"`   //余额
}

账户,虚拟管理员和若干业主账号

type Deal

type Deal struct {
	//ObjectType  string        `json:"docType"` //用于CouchDB
	//Id          string        `json:"id"`     //联合主键  三个
	Sell_id      string    `json:"Sell_id"`
	Buy_id       string    `json:"Buy_id"`
	Rescource_id string    `json:"Rescource_id"` //上传的资源对象,json格式
	Cost         float64   `json:"Cost"`         //积分
	Time         time.Time `json:"Time"`         //交易完成时间(上链时间更准)
}

type Donating

type Donating struct {
	ObjectOfDonating string `json:"objectOfDonating"` //捐赠对象(正在捐赠的房地产RealEstateID)
	Donor            string `json:"donor"`            //捐赠人(捐赠人AccountId)
	Grantee          string `json:"grantee"`          //受赠人(受赠人AccountId)
	CreateTime       string `json:"createTime"`       //创建时间
	DonatingStatus   string `json:"donatingStatus"`   //捐赠状态
}

捐赠要约 需要确定ObjectOfDonating是否属于Donor 需要指定受赠人Grantee,并等待受赠人同意接收

type DonatingGrantee

type DonatingGrantee struct {
	Grantee    string   `json:"grantee"`    //受赠人(受赠人AccountId)
	CreateTime string   `json:"createTime"` //创建时间
	Donating   Donating `json:"donating"`   //捐赠对象
}

供受赠人查询的

type RealEstate

type RealEstate struct {
	RealEstateID string  `json:"realEstateId"` //房地产ID
	Proprietor   string  `json:"proprietor"`   //所有者(业主)(业主AccountId)
	Encumbrance  bool    `json:"encumbrance"`  //是否作为担保
	TotalArea    float64 `json:"totalArea"`    //总面积
	LivingSpace  float64 `json:"livingSpace"`  //生活空间
}

房地产作为担保出售、捐赠或质押时Encumbrance为true,默认状态false。 仅当Encumbrance为false时,才可发起出售、捐赠或质押 Proprietor和RealEstateID一起作为复合键,保证可以通过Proprietor查询到名下所有的房产信息

type Resource

type Resource struct {
	//ObjectType string    `json:"docType"` //用于CouchDB
	Id       string  `json:"id"`       //资源在关系型数据库中的id,从id中可知类型
	Hash     string  `json:"Hash"`     //文件在IPFS系统中的Hash值
	Uploader string  `json:"Uploader"` //标记卖方id
	Time     string  `json:"Time"`     //标记上链时间
	State    string  `json:"State"`    //只有未有对应解决方案的项目需求为true
	Cost     float64 `json:"Cost"`     //交易需要话费的积分,可设置为零
}

type Selling

type Selling struct {
	ObjectOfSale  string  `json:"objectOfSale"`  //销售对象(正在出售的房地产RealEstateID)
	Seller        string  `json:"seller"`        //发起销售人、卖家(卖家AccountId)
	Buyer         string  `json:"buyer"`         //参与销售人、买家(买家AccountId)
	Price         float64 `json:"price"`         //价格
	CreateTime    string  `json:"createTime"`    //创建时间
	SalePeriod    int     `json:"salePeriod"`    //智能合约的有效期(单位为天)
	SellingStatus string  `json:"sellingStatus"` //销售状态
}

销售要约 需要确定ObjectOfSale是否属于Seller 买家初始为空 Seller和ObjectOfSale一起作为复合键,保证可以通过seller查询到名下所有发起的销售

type SellingBuy

type SellingBuy struct {
	Buyer      string  `json:"buyer"`      //参与销售人、买家(买家AccountId)
	CreateTime string  `json:"createTime"` //创建时间
	Selling    Selling `json:"selling"`    //销售对象
}

买家参与销售 销售对象不能是买家发起的 Buyer和CreateTime作为复合键,保证可以通过buyer查询到名下所有参与的销售

type User

type User struct {
	//ObjectType  string        `json:"docType"` //用于CouchDB
	Id     string     `json:"id"`     //关系型数据库id
	Upload []Resource `json:"Upload"` //上传的资源对象,json格式
	Buy    []Resource `json:"Buy"`    //购买的资源对象
	Score  float64    `json:"Score"`  //积分
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL