commit
f983a9d574
@ -1,5 +1,36 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.oa00.com/supply-chain/service/client"
|
||||
)
|
||||
|
||||
type Service struct {
|
||||
Audit audit
|
||||
Audit audit
|
||||
Service service
|
||||
}
|
||||
|
||||
type ArgsServiceLists struct {
|
||||
CustomerId uint
|
||||
Status uint
|
||||
}
|
||||
|
||||
type ReplyServiceLists struct {
|
||||
ServiceId uint `json:"serviceId"`
|
||||
ServiceName string `json:"serviceName"`
|
||||
EndTime int64 `json:"endTime"`
|
||||
AuditStatus uint `json:"auditStatus"`
|
||||
}
|
||||
|
||||
type service struct {
|
||||
}
|
||||
|
||||
// All @Title 全部服务
|
||||
func (s *service) All(ctx context.Context, customerId uint) (reply []ReplyServiceLists, err error) {
|
||||
xClient, err := client.GetClient(s)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "All", customerId, &reply)
|
||||
return
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
package rpc
|
||||
|
||||
type Error uint
|
||||
|
||||
const (
|
||||
ErrorSystem Error = 11001 // 系统错误
|
||||
|
||||
ErrorOrderRepeat Error = 11002 // 重复下单
|
||||
ErrorOrderFreightFee Error = 11003 // 运费错误
|
||||
ErrorOrderSubmit Error = 11004 // 下单失败
|
||||
ErrorOrderShipment Error = 11005 // 无法配送
|
||||
ErrorOrderSkuPrice Error = 11006 // 商品价格错误
|
||||
ErrorOrderAmount Error = 11007 // 订单金额错误
|
||||
)
|
||||
|
||||
var ErrorCodes = map[Error]string{
|
||||
ErrorSystem: "系统错误",
|
||||
ErrorOrderRepeat: "重复下单",
|
||||
ErrorOrderFreightFee: "运费错误",
|
||||
ErrorOrderSubmit: "下单失败",
|
||||
ErrorOrderShipment: "无法配送",
|
||||
ErrorOrderSkuPrice: "商品价格错误",
|
||||
ErrorOrderAmount: "订单金额错误",
|
||||
}
|
||||
|
||||
func (e Error) Error() string {
|
||||
return ErrorCodes[e]
|
||||
}
|
Loading…
Reference in new issue