package upstream import ( "github.com/gogf/gf/frame/g" ) const ( Cloud = 1 //云仓 Jd = 2 //京东 Ali = 6 //阿里 Tm = 7 //天猫 Sn = 8 //苏宁 Gome = 10 //国美 Schl = 11 //盛创汇联 Wpc = 12 //唯品会 Ikc = 13 //爱库存 Dwd = 14 //好食期 Itao = 15 //淘特 ) var ( //消息类型 ProductExpire = 101 ProductModify = 102 ProductPrice = 103 ProductRepost = 104 OrderSendgoods = 201 OrderComfirmReceiveGoods = 202 OrderSuccess = 203 OrderCancel = 204 RefundApply = 300 RefundAgree = 301 RefundRefuse = 302 RefundSuccess = 303 ) func GetUpstreamList() (res interface{}, err error) { res = g.List{ g.Map{ "key": Jd, "name": GetUpstreamName(Jd), }, g.Map{ "key": Ali, "name": GetUpstreamName(Ali), }, g.Map{ "key": Tm, "name": GetUpstreamName(Tm), }, g.Map{ "key": Cloud, "name": GetUpstreamName(Cloud), }, g.Map{ "key": Sn, "name": GetUpstreamName(Sn), }, g.Map{ "key": Gome, "name": GetUpstreamName(Gome), }, g.Map{ "key": Schl, "name": GetUpstreamName(Schl), }, g.Map{ "key": Wpc, "name": GetUpstreamName(Wpc), }, g.Map{ "key": Ikc, "name": GetUpstreamName(Ikc), }, g.Map{ "key": Dwd, "name": GetUpstreamName(Dwd), }, g.Map{ "key": Itao, "name": GetUpstreamName(Itao), }, } return } func GetUpstreamName(source int) string { switch source { case Jd: return "京东" case Ali: return "阿里" case Tm: return "天猫" case Cloud: return "云仓" case Sn: return "苏宁" case Gome: return "国美" case Schl: return "盛创汇联" case Wpc: return "特卖一仓" case Ikc: return "特卖二仓" case Dwd: return "好食期" case Itao: return "淘特" default: return "未知来源" } }