Documentation ¶
Overview ¶
*
- Copyright 2014 @ z3q.net.
- name :
- author : jarryliu
- date : 2014-02-14 15:18
- description :
- history :
*
- Copyright 2014 @ z3q.net.
- name :
- author : jarryliu
- date : 2014-02-12 16:38
- description :
- history :
*
- Copyright 2014 @ z3q.net.
- name :
- author : jarryliu
- date : 2014-02-12 17:08
- description :
- history :
*
- Copyright 2014 @ z3q.net.
- name :
- author : jarryliu
- date : 2014-02-12 16:21
- description :
- history :
*
- Copyright 2014 @ z3q.net.
- name :
- author : jarryliu
- date : 2014-02-14 15:37
- description :
- history :
*
- Copyright 2014 @ z3q.net.
- name :
- author : jarryliu
- date : 2014-02-12 21:09
- description :
- history :
*
- Copyright 2014 @ z3q.net.
- name :
- author : jarryliu
- date : 2013-12-12 16:53
- description :
- history :
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotCoveragedArea *domain.DomainError = domain.NewDomainError(
"not_coveraged_area", "未覆盖的配送区域")
)
Functions ¶
This section is empty.
Types ¶
type AreaValue ¶
type AreaValue struct { Id int `db:"id" pk:"yes" auto:"no"` Pid int `db:"pid"` Name string `db:"name"` }
中国省市行政规划
type CoverageValue ¶
type CoverageValue struct { Id int `db:"id" auto:"yes" pk:"true"` Name string `db:"name"` Lng float64 `db:"lng"` Lat float64 `db:"lat"` Radius int `db:"radius"` Address string `db:"address"` AreaId int `db:"area_id"` }
覆盖区域
type ICoverageArea ¶
type IDelivery ¶
type IDelivery interface { // 返回聚合编号 GetAggregateRootId() int // 等同于GetAggregateRootId() GetPartnerId() int // 获取最近的配送区域 GetNearestCoverage(lng, lat float64) ICoverageArea // 根据地址获取地区(可能会有重复的区名) GetArea(addr string) ([]*AreaValue, error) // 获取覆盖区域 GetCoverageArea(id int) ICoverageArea // 查看单个所在的区域 FindSingleCoverageArea(lng, lat float64) ICoverageArea // 查找所有所在的区域 FindCoverageAreas(lng, lat float64) []ICoverageArea // 获取配送信息 GetDeliveryInfo(coverageId int) (shopId, deliverUsrId int, err error) }
type IDeliveryRep ¶
type IDeliveryRep interface { // 获取配送 GetDelivery(int) IDelivery // 根据区名获取区域 GetAreaByArea(name string) []*AreaValue // 保存覆盖区域 SaveCoverageArea(*CoverageValue) (int, error) // 获取覆盖区域 GetCoverageArea(areaId, id int) *CoverageValue // 获取所有的覆盖区域 GetAllCoverageAreas(areaId int) []*CoverageValue // 获取配送绑定 GetDeliveryBind(partnerId, coverageId int) *PartnerDeliverBind }
Click to show internal directories.
Click to hide internal directories.