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