Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IMediator ¶
type IMediator interface { RegisterRoom(landlord ILandlord) Serve(client interface{}) //服务日常活动 RentOutRoom(tenant ITenant) }
IMediator 中介能做的事情,中介能代表任何一方, 所以理论上他需要实现所代表对象的所有能力 实际设计中,中介对象本身也会成为问题的所在,可能会比较臃肿
type Landlord ¶
Landlord 房东,也继承Person,要收房租
func (*Landlord) CollectRent ¶
CollectRent 房东收租金,只需要向中介收,中介会提代替房东收租金
type Mediator ¶
type Mediator struct { Person // contains filtered or unexported fields }
Mediator 中介也继承Person,比如某居客,某家,某壳,即代表租客跟房东谈条件,又代表房东对付租客 Mediator 中介一定会持有两方的必要信息 Mediator 这里简化一下,假设中介只为一个房东和一个租客服务
func (*Mediator) RegisterRoom ¶
RegisterRoom 可以在中介这里发布房源
Click to show internal directories.
Click to hide internal directories.