dada

package module
v0.0.0-...-36490d1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2020 License: MIT Imports: 12 Imported by: 0

README

Dada SDK for Golang

安装

启用 Go module
go get github.com/royromny/dada
import github.com/royromny/dada
未启用 Go module
go get github.com/royromny/dada
import github.com/royromny/dada

帮助

关于各分支(版本)

  • master - 和主要维护分支同步;

两个回调接口:

http.HandleFunc("/dada", func(rep http.ResponseWriter, req *http.Request) {
	var notify, _ = client.GetOrderNotification(req)
	if notify != nil {
		fmt.Println("订单状态为:", notify.OrderStatus)
	}
	dada.AckNotification(rep) // 确认收到通知消息
})

License

This project is licensed under the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AckMessageNotify

func AckMessageNotify(w http.ResponseWriter)

func AckNotification

func AckNotification(w http.ResponseWriter)

func MD5

func MD5(str string) (res string)

func VerifySign

func VerifySign(notity OrderNotification) (ok bool)

Types

type AddAfterQuery

type AddAfterQuery struct {
	DeliveryNo string `json:"deliveryNo"` // 平台订单号
}

-------------------------------------------------------------------------------- AddAfterQuery 订单预发布-查询运费后发单 https://newopen.imdada.cn/#/development/file/readyAdd?_k=0hxqh8

func (*AddAfterQuery) APIName

func (t *AddAfterQuery) APIName() string

func (*AddAfterQuery) Params

func (t *AddAfterQuery) Params() map[string]string

type AddAfterQueryRsp

type AddAfterQueryRsp struct {
	BaseRep
}

type AddOrderRsp

type AddOrderRsp struct {
	BaseRep
	Result struct {
		Distance     float64 `json:"distance"`
		Fee          float64 `json:"fee"`
		DeliverFee   float64 `json:"deliverFee"`
		CouponFee    float64 `json:"couponFee"`
		Tips         float64 `json:"tips"`
		InsuranceFee float64 `json:"insuranceFee"`
	} `json:"result"`
}

type AddTip

type AddTip struct {
	OrderId  string  `json:"order_id"`  // 是	第三方订单编号
	Tips     float64 `json:"tips"`      // 是	小费金额(精确到小数点后一位,单位:元)
	CityCode string  `json:"city_code"` // 是	订单城市区号
	Info     string  `json:"info"`      // 否	备注(字段最大长度:512)
}

-------------------------------------------------------------------------------- AddTip 增加小费 https://newopen.imdada.cn/#/development/file/addTip?_k=l9b2m4

func (*AddTip) APIName

func (t *AddTip) APIName() string

func (*AddTip) Params

func (t *AddTip) Params() map[string]string

type AddTipRsp

type AddTipRsp struct {
	BaseRep
}

type AppointCancel

type AppointCancel struct {
	OrderId string `json:"order_id"` // 是	追加的第三方订单ID
}

-------------------------------------------------------------------------------- AppointCancel 追加订单 https://newopen.imdada.cn/#/development/file/appointOrderCancel?_k=cv6mo9

func (*AppointCancel) APIName

func (t *AppointCancel) APIName() string

func (*AppointCancel) Params

func (t *AppointCancel) Params() map[string]string

type AppointCancelRsp

type AppointCancelRsp struct {
	BaseRep
}

type AppointExist

type AppointExist struct {
	OrderId       string `json:"order_id"`       // 是	追加的第三方订单ID
	TransporterId int    `json:"transporter_id"` //	是	追加的配送员ID
	ShopNo        string `json:"shop_no"`        // 是	追加订单的门店编码
}

-------------------------------------------------------------------------------- AppointExist 追加订单 https://newopen.imdada.cn/#/development/file/appointOrder?_k=4ugvgj

func (*AppointExist) APIName

func (t *AppointExist) APIName() string

func (*AppointExist) Params

func (t *AppointExist) Params() map[string]string

type AppointExistRsp

type AppointExistRsp struct {
	BaseRep
}

type AppointListTransporter

type AppointListTransporter struct {
	ShopNo string `json:"shop_no"` // 是	门店编码
}

-------------------------------------------------------------------------------- AppointListTransporter 查询追加配送员 https://newopen.imdada.cn/#/development/file/listTransportersToAppoint?_k=4ecth3

func (*AppointListTransporter) APIName

func (t *AppointListTransporter) APIName() string

func (*AppointListTransporter) Params

func (t *AppointListTransporter) Params() map[string]string

type AppointListTransporterRsp

type AppointListTransporterRsp struct {
	BaseRep
	Result []Transporter `json:"result"`
}

type BalanceQuery

type BalanceQuery struct {
	Category uint8 `json:"category"` //	否	查询运费账户类型(1:运费账户;2:红包账户,3:所有),默认查询运费账户余额
}

-------------------------------------------------------------------------------- BalanceQuery 查询账户余额 https://newopen.imdada.cn/#/development/file/balanceQuery?_k=5uinae

func (*BalanceQuery) APIName

func (t *BalanceQuery) APIName() string

func (*BalanceQuery) Params

func (t *BalanceQuery) Params() map[string]string

type BalanceQueryRsp

type BalanceQueryRsp struct {
	BaseRep
	Result struct {
		DeliverBalance   float64 `json:"deliverBalance"`   // 交付余额
		RedPacketBalance float64 `json:"redPacketBalance"` // 红包余额
	} `json:"result"`
}

type BaseRep

type BaseRep struct {
	Status    string `json:"status"`              // 响应状态,成功为"success",失败为"fail"
	Code      int    `json:"code"`                // 响应返回吗,参考接口返回码
	Msg       string `json:"msg"`                 // 响应描述
	ErrorCode int    `json:"errorCode,omitempty"` // 错误编码,与code一致
}

type CancelReason

type CancelReason struct {
	Id     int    `json:"id"`     // 理由编号
	Reason string `json:"reason"` // 取消理由
}

type CancelReasons

type CancelReasons struct{}

-------------------------------------------------------------------------------- CancelReasons 获取取消原因 https://newopen.imdada.cn/#/development/file/reasonList?_k=i8gq02

func (*CancelReasons) APIName

func (t *CancelReasons) APIName() string

func (*CancelReasons) Params

func (t *CancelReasons) Params() map[string]string

type CancelReasonsRsp

type CancelReasonsRsp struct {
	BaseRep
	Result []CancelReason `json:"result"`
}

type City

type City struct {
	CityName string `json:"cityName"` // 城市名称
	CityCode string `json:"cityCode"` // 城市编码
}

type CityCodeList

type CityCodeList struct{}

-------------------------------------------------------------------------------- 获取城市信息 https://newopen.imdada.cn/#/development/file/cityList?_k=7xzq6j

func (*CityCodeList) APIName

func (t *CityCodeList) APIName() string

func (*CityCodeList) Params

func (t *CityCodeList) Params() map[string]string

type CityCodeListRsp

type CityCodeListRsp struct {
	BaseRep
	Result []City `json:"result"`
}

type Client

type Client struct {
	Client *http.Client
	// contains filtered or unexported fields
}

func New

func New(appKey, appSecret string, isProduction bool) (client *Client, err error)

New 初始化客户端 appKey appSecret isProduction - 是否为生产环境,传 false 的时候为沙箱环境,用于开发测试,正式上线的时候需要改为 true

func (*Client) AckMessageNotify

func (this *Client) AckMessageNotify(w http.ResponseWriter)

func (*Client) AckNotification

func (this *Client) AckNotification(w http.ResponseWriter)

func (*Client) AddAfterQuery

func (this *Client) AddAfterQuery(param AddAfterQuery, sourceId string) (result *AddAfterQueryRsp, err error)

AddAfterQuery 订单预发布-查询运费后发单 https://newopen.imdada.cn/#/development/file/readyAdd?_k=0hxqh8

func (*Client) AddOrder

func (this *Client) AddOrder(param Order, sourceId string) (result *AddOrderRsp, err error)

AddOrder 新增配送单接口 https://newopen.imdada.cn/#/development/file/add?_k=21pavh

func (*Client) AddTip

func (this *Client) AddTip(param AddTip, sourceId string) (result *AddTipRsp, err error)

AddTip 增加小费 https://newopen.imdada.cn/#/development/file/addTip?_k=l9b2m4

func (*Client) AppointCancel

func (this *Client) AppointCancel(param AppointCancel, sourceId string) (result *AppointCancelRsp, err error)

AppointCancel 追加订单 https://newopen.imdada.cn/#/development/file/appointOrderCancel?_k=cv6mo9

func (*Client) AppointExist

func (this *Client) AppointExist(param AppointExist, sourceId string) (result *AppointExistRsp, err error)

AppointExist 追加订单 https://newopen.imdada.cn/#/development/file/appointOrder?_k=4ugvgj

func (*Client) AppointListTransporter

func (this *Client) AppointListTransporter(param AppointListTransporter, sourceId string) (result *AppointListTransporterRsp, err error)

AppointListTransporter 查询追加配送员 https://newopen.imdada.cn/#/development/file/listTransportersToAppoint?_k=4ecth3

func (*Client) BalanceQuery

func (this *Client) BalanceQuery(param BalanceQuery, sourceId string) (result *BalanceQueryRsp, err error)

BalanceQuery 查询账户余额 https://newopen.imdada.cn/#/development/file/balanceQuery?_k=5uinae

func (*Client) CancelReasons

func (this *Client) CancelReasons(param CancelReasons, sourceId string) (result *CancelReasonsRsp, err error)

CancelReasons 获取取消原因 https://newopen.imdada.cn/#/development/file/reasonList?_k=i8gq02

func (*Client) CityCodeList

func (this *Client) CityCodeList(param CityCodeList, sourceId string) (result *CityCodeListRsp, err error)

CityCodeList 获取城市信息 https://newopen.imdada.cn/#/development/file/cityList?_k=7xzq6j

func (*Client) ConfirmGoods

func (this *Client) ConfirmGoods(param ConfirmGoods, sourceId string) (result *ConfirmGoodsRsp, err error)

ConfirmGoods 妥投异常之物品返回完成 https://newopen.imdada.cn/#/development/file/abnormalConfirm?_k=fxapv2

func (*Client) Dada

func (this *Client) Dada(param Dada, sourceId string) (result *DadaRsp, err error)

Dada 商家投诉达达 https://newopen.imdada.cn/#/development/file/complaintDada?_k=v9oino

func (*Client) DoRequest

func (this *Client) DoRequest(method string, param Param, sourceId string, result interface{}) (err error)

func (*Client) FormalCancel

func (this *Client) FormalCancel(param FormalCancel, sourceId string) (result *FormalCancelRsp, err error)

FormalCancel 取消订单(线上环境) https://newopen.imdada.cn/#/development/file/formalCancel?_k=pxanlf

func (*Client) GetMessageNotify

func (this *Client) GetMessageNotify(req *http.Request) (notity *MessageNotify, err error)

消息通知 https://newopen.imdada.cn/#/development/file/messageIndex?_k=xwnkni

func (*Client) GetOrderNotification

func (this *Client) GetOrderNotification(req *http.Request) (notity *OrderNotification, err error)

订单回调 https://newopen.imdada.cn/#/development/file/order?_k=md8v7x

func (*Client) IsProduction

func (this *Client) IsProduction() bool

func (*Client) MerchantAdd

func (this *Client) MerchantAdd(param MerchantAdd, sourceId string) (result *MerchantAddRsp, err error)

MerchantAdd 注册商户 https://newopen.imdada.cn/#/development/file/merchantAdd?_k=rs4djb

func (*Client) MessageConfirm

func (this *Client) MessageConfirm(param MessageConfirm, sourceId string) (result *MessageConfirmRsp, err error)

MessageConfirm 消息确认 https://newopen.imdada.cn/#/development/file/merchantConfirm?_k=6f8hwj

func (*Client) QueryDeliverFee

func (this *Client) QueryDeliverFee(param QueryDeliverFee, sourceId string) (result *QueryDeliverFeeRsp, err error)

QueryDeliverFee 订单预发布-查询订单运费 https://newopen.imdada.cn/#/development/file/readyAdd?_k=0hxqh8

func (*Client) ReAddOrder

func (this *Client) ReAddOrder(param ReAddOrder, sourceId string) (result *ReAddOrderRsp, err error)

ReAddOrder 重新发布订单 https://newopen.imdada.cn/#/development/file/reAdd?_k=2jkzyb

func (*Client) Reasons

func (this *Client) Reasons(param Reasons, sourceId string) (result *ReasonsRsp, err error)

Reasons 获取商家投诉达达原因 https://newopen.imdada.cn/#/development/file/complaintReasons?_k=8jenc0

func (*Client) Recharge

func (this *Client) Recharge(param Recharge, sourceId string) (result *RechargeRsp, err error)

Recharge 获取充值链接 https://newopen.imdada.cn/#/development/file/recharge?_k=t5p8m5

func (*Client) ShopAdd

func (this *Client) ShopAdd(param ShopAdd, sourceId string) (result *ShopAddRsp, err error)

ShopAdd 新增门店 https://newopen.imdada.cn/#/development/file/shopAdd?_k=lewbit

func (*Client) ShopDetail

func (this *Client) ShopDetail(param ShopDetail, sourceId string) (result *ShopDetailRsp, err error)

ShopDetail 门店详情 https://newopen.imdada.cn/#/development/file/shopDetail?_k=7k6t2r

func (*Client) ShopUpdate

func (this *Client) ShopUpdate(param ShopUpdate, sourceId string) (result *ShopUpdateRsp, err error)

ShopUpdate 编辑门店 https://newopen.imdada.cn/#/development/file/shopUpdate?_k=6396gm

func (*Client) StatusQuery

func (this *Client) StatusQuery(param StatusQuery, sourceId string) (result *StatusQueryRsp, err error)

StatusQuery 订单详情查询 https://newopen.imdada.cn/#/development/file/statusQuery?_k=v8u4ug

func (*Client) URLValues

func (this *Client) URLValues(param Param, sourceId string) (map[string]string, error)

补充处理基本请求参数

type ConfirmGoods

type ConfirmGoods struct {
	OrderId string `json:"order_id"` // 是 第三方订单编号
}

-------------------------------------------------------------------------------- ConfirmGoods 妥投异常之物品返回完成 https://newopen.imdada.cn/#/development/file/abnormalConfirm?_k=fxapv2

func (*ConfirmGoods) APIName

func (t *ConfirmGoods) APIName() string

func (*ConfirmGoods) Params

func (t *ConfirmGoods) Params() map[string]string

type ConfirmGoodsRsp

type ConfirmGoodsRsp struct {
	BaseRep
}

type Dada

type Dada struct {
	OrderId  string `json:"order_id"`  // 是	追加的第三方订单ID
	ReasonId int    `json:"reason_id"` // 是	投诉原因ID(投诉原因列表)
}

-------------------------------------------------------------------------------- Dada 商家投诉达达 https://newopen.imdada.cn/#/development/file/complaintDada?_k=v9oino

func (*Dada) APIName

func (t *Dada) APIName() string

func (*Dada) Params

func (t *Dada) Params() map[string]string

type DadaRsp

type DadaRsp struct {
	BaseRep
}

type Failed

type Failed struct {
	ShopNo   string `json:"shopNo"`
	Msg      string `json:"msg"`
	ShopName string `json:"ShopName"`
}

type FormalCancel

type FormalCancel struct {
	OrderId        string `json:"order_id"`         // 是	第三方订单编号
	CancelReasonid uint   `json:"cancel_reason_id"` // 是	取消原因ID(取消原因列表)
	CancelReason   string `json:"cancel_reason"`    // 否	取消原因(当取消原因ID为其他时,此字段必填)
}

-------------------------------------------------------------------------------- FormalCancel 取消订单(线上环境) https://newopen.imdada.cn/#/development/file/formalCancel?_k=pxanlf

func (*FormalCancel) APIName

func (t *FormalCancel) APIName() string

func (*FormalCancel) Params

func (t *FormalCancel) Params() map[string]string

type FormalCancelRsp

type FormalCancelRsp struct {
	BaseRep
	Result struct {
		DeductFee float64 `json:"deduct_fee"` // 扣除的违约金(单位:元)
	} `json:"result"`
}

type KnightCancel

type KnightCancel struct {
	OrderId      string `json:"orderId"`      //	是	商家第三方订单号
	DadaOrderId  int64  `json:"dadaOrderId"`  //	否	达达订单号
	CancelReason string `json:"cancelReason"` //	是	骑士取消原因
}

骑士取消订单 https://newopen.imdada.cn/#/development/file/transporterCancelOrder?_k=if07yb

type KnightCancelConfirm

type KnightCancelConfirm struct {
	OrderId     string `json:"orderId"`     //	是	商家第三方订单号
	DadaOrderId int64  `json:"dadaOrderId"` //	否	达达订单号
	IsConfirm   int    `json:"isConfirm"`   //  是	0:不同意,1:表示同意
}

骑士取消订单 https://newopen.imdada.cn/#/development/file/transporterCancelOrder?_k=if07yb

type MerchantAdd

type MerchantAdd struct {
	Mobile            string `json:"mobile"`             // 是	注册商户手机号,用于登陆商户后台
	CityName          string `json:"city_name"`          // 是	商户城市名称(如,上海)
	EnterpriseName    string `json:"enterprise_name"`    // 是	企业全称
	EnterpriseAddress string `json:"enterprise_address"` // 是	企业地址
	ContactName       string `json:"contact_name"`       // 是	联系人姓名
	ContactPhone      string `json:"contact_phone"`      // 是	联系人电话
	Email             string `json:"email"`              // 是	邮箱地址
}

-------------------------------------------------------------------------------- MerchantAdd 注册商户 https://newopen.imdada.cn/#/development/file/merchantAdd?_k=rs4djb

func (*MerchantAdd) APIName

func (t *MerchantAdd) APIName() string

func (*MerchantAdd) Params

func (t *MerchantAdd) Params() map[string]string

type MerchantAddRsp

type MerchantAddRsp struct {
	BaseRep
	Result int `json:"result"` // 商户编号
}

type MessageConfirm

type MessageConfirm struct {
	MessageType int    `json:"messageType"` //  是	消息类型(1:骑士取消订单推送消息)
	MessageBody string `json:"messageBody"` //	是	消息内容(json字符串)
}

-------------------------------------------------------------------------------- MessageConfirm 消息确认 https://newopen.imdada.cn/#/development/file/merchantConfirm?_k=6f8hwj

func (*MessageConfirm) APIName

func (t *MessageConfirm) APIName() string

func (*MessageConfirm) Params

func (t *MessageConfirm) Params() map[string]string

type MessageConfirmRsp

type MessageConfirmRsp struct {
	BaseRep
}

type MessageNotify

type MessageNotify struct {
	MessageType int    `json:"messageType"` // 是	消息类型(1:骑士取消订单推送消息)
	MessageBody string `json:"messageBody"` //	是	消息内容(json字符串)
	CreateTime  int    `json:"createTime"`  //	是	创建时间(unix时间戳)
}

消息通知 https://newopen.imdada.cn/#/development/file/messageIndex?_k=xwnkni

type Order

type Order struct {
	// 必填
	ShopNo          string  `json:"shop_no"`          // 门店编号,门店创建后可在门店列表和单页查看
	OriginId        string  `json:"origin_id"`        // 第三方订单ID
	CityCode        string  `json:"city_code"`        // 订单所在城市的code(查看各城市对应的code值)
	CargoPrice      float64 `json:"cargo_price"`      // 订单金额
	IsPrepay        uint8   `json:"is_prepay"`        // 是否需要垫付 1:是 0:否 (垫付订单金额,非运费)
	ReceiverName    string  `json:"receiver_name"`    // 收货人姓名
	ReceiverAddress string  `json:"receiver_address"` // 收货人地址
	ReceiverLat     float64 `json:"receiver_lat"`     // 收货人地址维度(高德坐标系)
	ReceiverLng     float64 `json:"receiver_lng"`     // 收货人地址经度(高德坐标系)
	Callback        string  `json:"callback"`         // 回调URL(查看回调说明)
	ReceiverPhone   string  `json:"receiver_phone"`   // 收货人手机号(手机号和座机号必填一项)

	// 非必填
	ReceiverTel    string  `json:"receiver_tel"`     // 收货人座机号(手机号和座机号必填一项)
	Tips           float64 `json:"tips"`             // 小费(单位:元,精确小数点后一位)
	Info           string  `json:"info"`             // 订单备注
	CargoType      uint8   `json:"cargo_type"`       // 订单商品类型:食品小吃-1,饮料-2,鲜花-3,文印票务-8,便利店-9,水果生鲜-13,同城电商-19, 医药-20,蛋糕-21,酒品-24,小商品市场-25,服装-26,汽修零配-27,数码-28,小龙虾-29, 其他-5
	CargoWeight    float64 `json:"cargo_weight"`     // 订单重量(单位:Kg)
	CargoNum       int     `json:"cargo_num"`        // 订单商品数量
	InvoiceTitle   string  `json:"invoice_title"`    // 发票抬头
	OriginMark     string  `json:"origin_mark"`      // 订单来源标示(该字段可以显示在达达app订单详情页面,只支持字母,最大长度为10)
	OriginMarkNo   string  `json:"origin_mark_no"`   // 订单来源编号(该字段可以显示在达达app订单详情页面,支持字母和数字,最大长度为30)
	IsUseInsurance uint8   `json:"is_use_insurance"` // 是否使用保价费(0:不使用保价,1:使用保价; 同时,请确保填写了订单金额(cargo_price))
	// 商品保价费(当商品出现损坏,可获取一定金额的赔付)
	// 保费=配送物品实际价值*费率(5‰),配送物品价值及最高赔付不超过10000元, 最高保费为50元(物品价格最小单位为100元,不足100元部分按100元认定,保价费向上取整数, 如:物品声明价值为201元,保价费为300元*5‰=1.5元,取整数为2元。)
	// 若您选择不保价,若物品出现丢失或损毁,最高可获得平台30元优惠券。 (优惠券直接存入用户账户中)。
	IsFinishCodeNeeded string `json:"is_finish_code_needed"` // 收货码(0:不需要;1:需要。收货码的作用是:骑手必须输入收货码才能完成订单妥投)
	DelayPublishTime   string `json:"delay_publish_time"`    // 预约发单时间(预约时间unix时间戳(10位),精确到分;整10分钟为间隔,并且需要至少提前20分钟预约。)
	IsDirectDelivery   string `json:"is_direct_delivery"`    // 是否选择直拿直送(0:不需要;1:需要。选择直拿直送后,同一时间骑士只能配送此订单至完成,同时,也会相应的增加配送费用)
}

-------------------------------------------------------------------------------- 新增订单 https://newopen.imdada.cn/#/development/file/add?_k=21pavh

func (*Order) APIName

func (t *Order) APIName() string

func (*Order) Params

func (t *Order) Params() map[string]string

type OrderNotification

type OrderNotification struct {
	ClientId     string `json:"client_id"`     //	是	返回达达运单号,默认为空
	OrderId      string `json:"order_id"`      //	是	添加订单接口中的origin_id值
	OrderStatus  int    `json:"order_status"`  //	是	订单状态(待接单=1,待取货=2,配送中=3,已完成=4,已取消=5, 已过期=7,指派单=8,妥投异常之物品返回中=9, 妥投异常之物品返回完成=10,骑士到店=100,创建达达运单失败=1000 可参考文末的状态说明)
	CancelReason string `json:"cancel_reason"` //	是	订单取消原因,其他状态下默认值为空字符串
	CancelFrom   int    `json:"cancel_from"`   //	是	订单取消原因来源(1:达达配送员取消;2:商家主动取消;3:系统或客服取消;0:默认值)
	UpdateTime   string `json:"update_time"`   //	是	更新时间,时间戳
	Signature    string `json:"signature"`     //	是	对client_id, order_id, update_time的值进行字符串升序排列,再连接字符串,取md5值
	DmId         int    `json:"dm_id"`         //	否	达达配送员id,接单以后会传
	DmName       string `json:"dm_name"`       //	否	配送员姓名,接单以后会传
	DmMobile     string `json:"dm_mobile"`     //	否	配送员手机号,接单以后会传
}

订单回调 https://newopen.imdada.cn/#/development/file/order?_k=md8v7x

type OrderNotification2

type OrderNotification2 struct {
	ClientId     string `json:"client_id"`     //	是	返回达达运单号,默认为空
	OrderId      string `json:"order_id"`      //	是	添加订单接口中的origin_id值
	OrderStatus  int    `json:"order_status"`  //	是	订单状态(待接单=1,待取货=2,配送中=3,已完成=4,已取消=5, 已过期=7,指派单=8,妥投异常之物品返回中=9, 妥投异常之物品返回完成=10,骑士到店=100,创建达达运单失败=1000 可参考文末的状态说明)
	CancelReason string `json:"cancel_reason"` //	是	订单取消原因,其他状态下默认值为空字符串
	CancelFrom   int    `json:"cancel_from"`   //	是	订单取消原因来源(1:达达配送员取消;2:商家主动取消;3:系统或客服取消;0:默认值)
	UpdateTime   int    `json:"update_time"`   //	是	更新时间,时间戳
	Signature    string `json:"signature"`     //	是	对client_id, order_id, update_time的值进行字符串升序排列,再连接字符串,取md5值
	DmId         int    `json:"dm_id"`         //	否	达达配送员id,接单以后会传
	DmName       string `json:"dm_name"`       //	否	配送员姓名,接单以后会传
	DmMobile     string `json:"dm_mobile"`     //	否	配送员手机号,接单以后会传
}

type Param

type Param interface {
	// 用于提供访问的 method
	APIName() string

	// 返回参数列表
	Params() map[string]string
}

type QueryDeliverFee

type QueryDeliverFee struct {
	Order
}

-------------------------------------------------------------------------------- QueryDeliverFee 重新发布订单 https://newopen.imdada.cn/#/development/file/readyAdd?_k=0hxqh8

func (*QueryDeliverFee) APIName

func (t *QueryDeliverFee) APIName() string

func (*QueryDeliverFee) Params

func (t *QueryDeliverFee) Params() map[string]string

type QueryDeliverFeeRsp

type QueryDeliverFeeRsp struct {
	BaseRep
	Result struct {
		Distance     float64 `json:"distance"`   // 是	配送距离(单位:米)
		DeliveryNo   string  `json:"deliveryNo"` // 平台订单号
		Fee          float64 `json:"fee"`
		DeliverFee   float64 `json:"deliverFee"`
		CouponFee    float64 `json:"couponFee"`
		Tips         float64 `json:"tips"`
		InsuranceFee float64 `json:"insuranceFee"`
	} `json:"result"`
}

type ReAddOrder

type ReAddOrder struct {
	Order
}

-------------------------------------------------------------------------------- ReAddOrder 重新发布订单 https://newopen.imdada.cn/#/development/file/reAdd?_k=2jkzyb

func (*ReAddOrder) APIName

func (t *ReAddOrder) APIName() string

func (*ReAddOrder) Params

func (t *ReAddOrder) Params() map[string]string

type ReAddOrderRsp

type ReAddOrderRsp struct {
	AddOrderRsp
}

type Reason

type Reason struct {
	Id int `json:"id"` // 原因编号
	// contains filtered or unexported fields
}

type Reasons

type Reasons struct{}

-------------------------------------------------------------------------------- Reasons 获取商家投诉达达原因 https://newopen.imdada.cn/#/development/file/complaintReasons?_k=8jenc0

func (*Reasons) APIName

func (t *Reasons) APIName() string

func (*Reasons) Params

func (t *Reasons) Params() map[string]string

type ReasonsRsp

type ReasonsRsp struct {
	BaseRep
	Result []Reason `json:"result"`
}

type Recharge

type Recharge struct {
	Amount    float64 `json:"amount"`     //	是	充值金额(单位元,可以精确到分)
	Category  string  `json:"category"`   //	是	生成链接适应场景(category有二种类型值:PC、H5)
	NotifyUrl string  `json:"notify_url"` //	否	支付成功后跳转的页面(支付宝在支付成功后可以跳转到某个指定的页面,微信支付不支持)
}

-------------------------------------------------------------------------------- Recharge 获取充值链接 https://newopen.imdada.cn/#/development/file/recharge?_k=t5p8m5

func (*Recharge) APIName

func (t *Recharge) APIName() string

func (*Recharge) Params

func (t *Recharge) Params() map[string]string

type RechargeRsp

type RechargeRsp struct {
	BaseRep
	Result string `json:"result"` // 充值的链接
}

type Shop

type Shop struct {
	StationName    string  `json:"station_name"`    //  是	门店名称
	Business       int     `json:"business"`        // 	是	业务类型(食品小吃-1,饮料-2,鲜花-3,文印票务-8,便利店-9,水果生鲜-13,同城电商-19, 医药-20,蛋糕-21,酒品-24,小商品市场-25,服装-26,汽修零配-27,数码-28,小龙虾-29, 其他-5)
	CityName       string  `json:"city_name"`       // 	是	城市名称(如,上海)
	AreaName       string  `json:"area_name"`       // 	是	区域名称(如,浦东新区)
	StationAddress string  `json:"station_address"` // 	是	门店地址
	Lng            float64 `json:"lng"`             // 	是	门店经度
	Lat            float64 `json:"lat"`             // 	是	门店纬度
	ContactName    string  `json:"contact_name"`    // 	是	联系人姓名
	Phone          string  `json:"phone"`           // 	是	联系人电话
	OriginShopId   string  `json:"origin_shop_id"`  // 	否	门店编码,可自定义,但必须唯一;若不填写,则系统自动生成
	IdCard         string  `json:"id_card"`         // 	否	联系人身份证
	Username       string  `json:"username"`        // 	否	达达商家app账号(若不需要登陆app,则不用设置)
	Password       string  `json:"password"`        // 	否	达达商家app密码(若不需要登陆app,则不用设置)
}

type ShopAdd

type ShopAdd []*Shop

-------------------------------------------------------------------------------- ShopAdd 新增门店 https://newopen.imdada.cn/#/development/file/shopAdd?_k=lewbit

func (*ShopAdd) APIName

func (t *ShopAdd) APIName() string

func (*ShopAdd) Params

func (t *ShopAdd) Params() map[string]string

type ShopAddRsp

type ShopAddRsp struct {
	BaseRep
	Result struct {
		Success     int       `json:"success"`     //	成功导入门店的数量
		SuccessList []ShopRsp `json:"successList"` //	成功导入的门店
		FailedList  []Failed  `json:"failedList"`  //	导入失败门店编号以及原因
	} `json:"result"`
}

type ShopDetail

type ShopDetail struct {
	OriginShopId string `json:"origin_shop_id"` // 	是	门店编码
}

-------------------------------------------------------------------------------- ShopDetail 门店详情 https://newopen.imdada.cn/#/development/file/shopDetail?_k=7k6t2r

func (*ShopDetail) APIName

func (t *ShopDetail) APIName() string

func (*ShopDetail) Params

func (t *ShopDetail) Params() map[string]string

type ShopDetailRsp

type ShopDetailRsp struct {
	BaseRep
	Result struct {
		OriginShopId   string  `json:"origin_shop_id"`  // 	是	门店编码
		StationName    string  `json:"station_name"`    // 	否	门店名称
		Business       int     `json:"business"`        // 	否	业务类型(食品小吃-1,饮料-2,鲜花-3,文印票务-8,便利店-9,水果生鲜-13,同城电商-19, 医药-20,蛋糕-21,酒品-24,小商品市场-25,服装-26,汽修零配-27,数码-28,小龙虾-29, 其他-5)
		CityName       string  `json:"city_name"`       // 	否	城市名称(如,上海)
		AreaName       string  `json:"area_name"`       // 	否	区域名称(如,浦东新区)
		StationAddress string  `json:"station_address"` // 	否	门店地址
		Lng            float64 `json:"lng"`             // 	否	门店经度
		Lat            float64 `json:"lat"`             // 	否	门店纬度
		ContactName    string  `json:"contact_name"`    // 	否	联系人姓名
		Phone          string  `json:"phone"`           // 	否	联系人电话
		Status         int     `json:"status"`          // 	否	门店状态(1-门店激活,0-门店下线)
	} `json:"result"`
}

type ShopRsp

type ShopRsp struct {
	StationName    string  `json:"stationName"`    //  是	门店名称
	Business       int     `json:"business"`       // 	是	业务类型(食品小吃-1,饮料-2,鲜花-3,文印票务-8,便利店-9,水果生鲜-13,同城电商-19, 医药-20,蛋糕-21,酒品-24,小商品市场-25,服装-26,汽修零配-27,数码-28,小龙虾-29, 其他-5)
	CityName       string  `json:"cityName"`       // 	是	城市名称(如,上海)
	AreaName       string  `json:"areaName"`       // 	是	区域名称(如,浦东新区)
	StationAddress string  `json:"stationAddress"` // 	是	门店地址
	Lng            float64 `json:"lng"`            // 	是	门店经度
	Lat            float64 `json:"lat"`            // 	是	门店纬度
	ContactName    string  `json:"contactName"`    // 	是	联系人姓名
	Phone          string  `json:"phone"`          // 	是	联系人电话
	OriginShopId   string  `json:"originShopId"`   // 	否	门店编码,可自定义,但必须唯一;若不填写,则系统自动生成
}

type ShopUpdate

type ShopUpdate struct {
	OriginShopId   string  `json:"origin_shop_id"`  // 	是	门店编码
	NewShopId      string  `json:"new_shop_id"`     // 	否	新的门店编码
	StationName    string  `json:"station_name"`    // 	否	门店名称
	Business       int     `json:"business"`        // 	否	业务类型(食品小吃-1,饮料-2,鲜花-3,文印票务-8,便利店-9,水果生鲜-13,同城电商-19, 医药-20,蛋糕-21,酒品-24,小商品市场-25,服装-26,汽修零配-27,数码-28,小龙虾-29, 其他-5)
	CityName       string  `json:"city_name"`       // 	否	城市名称(如,上海)
	AreaName       string  `json:"area_name"`       // 	否	区域名称(如,浦东新区)
	StationAddress string  `json:"station_address"` // 	否	门店地址
	Lng            float64 `json:"lng"`             // 	否	门店经度
	Lat            float64 `json:"lat"`             // 	否	门店纬度
	ContactName    string  `json:"contact_name"`    // 	否	联系人姓名
	Phone          string  `json:"phone"`           // 	否	联系人电话
	Status         int     `json:"status"`          // 	否	门店状态(1-门店激活,0-门店下线)
}

-------------------------------------------------------------------------------- ShopUpdate 编辑门店 https://newopen.imdada.cn/#/development/file/shopUpdate?_k=6396gm

func (*ShopUpdate) APIName

func (t *ShopUpdate) APIName() string

func (*ShopUpdate) Params

func (t *ShopUpdate) Params() map[string]string

type ShopUpdateRsp

type ShopUpdateRsp struct {
	BaseRep
}

type StatusQuery

type StatusQuery struct {
	OrderId string `json:"order_id"` // 第三方订单编号
}

-------------------------------------------------------------------------------- 订单详情查询 https://newopen.imdada.cn/#/development/file/statusQuery?_k=v8u4ug

func (*StatusQuery) APIName

func (t *StatusQuery) APIName() string

func (*StatusQuery) Params

func (t *StatusQuery) Params() map[string]string

type StatusQueryRsp

type StatusQueryRsp struct {
	BaseRep
	Result struct {
		OrderId          string  `json:"orderId"`          // 第三方订单编号
		StatusCode       int     `json:"statusCode"`       //	订单状态(待接单=1 待取货=2 配送中=3 已完成=4 已取消=5 已过期=7 指派单=8 妥投异常之物品返回中=9 妥投异常之物品返回完成=10 系统故障订单发布失败=1000 可参考文末的状态说明)
		StatusMsg        string  `json:"statusMsg"`        //	订单状态
		TransporterName  string  `json:"transporterName"`  //	骑手姓名
		TransporterPhone string  `json:"transporterPhone"` //	骑手电话
		TransporterLng   string  `json:"transporterLng"`   //	骑手经度
		TransporterLat   string  `json:"transporterLat"`   //	骑手纬度
		DeliveryFee      float64 `json:"deliveryFee"`      //	配送费,单位为元
		Tips             float64 `json:"tips"`             //	小费,单位为元
		CouponFee        float64 `json:"couponFee"`        //	优惠券费用,单位为元
		InsuranceFee     float64 `json:"insuranceFee"`     //	保价费,单位为元
		ActualFee        float64 `json:"actualFee"`        //	实际支付费用,单位为元
		Distance         float64 `json:"distance"`         //	配送距离,单位为米
		CreateTime       string  `json:"createTime"`       //	发单时间
		AcceptTime       string  `json:"acceptTime"`       //	接单时间,若未接单,则为空
		FetchTime        string  `json:"fetchTime"`        //	取货时间,若未取货,则为空
		FinishTime       string  `json:"finishTime"`       //	送达时间,若未送达,则为空
		CancelTime       string  `json:"cancelTime"`       //	取消时间,若未取消,则为空
		OrderFinishCode  string  `json:"orderFinishCode"`  //	收货码
		DeductFee        float64 `json:"deductFee"`        //	违约金
	} `json:"result"`
}

type Transporter

type Transporter struct {
	Id      int    `json:"id"`      // 配送员id
	Name    string `json:"name"`    // 配送员姓名
	CityIid int    `json:"city_id"` // 配送员城市
}

Jump to

Keyboard shortcuts

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