Compare commits

..

No commits in common. "f6447a771abd7f3a97bba1762a46bc92a5ab07e3" and "b0f5d41ef0ef5a4bbd96c509cad1a1e5daeb02cf" have entirely different histories.

6 changed files with 14 additions and 53 deletions

View File

@ -140,22 +140,3 @@ func (o Order) GetSupplierCash(p model.OrderSupplierCashReq) (*model.OrderSuppli
} }
return &r.Data, nil return &r.Data, nil
} }
// GetUserTotalWarningOrder ...
func (o Order) GetUserTotalWarningOrder(p model.OrderGetTotalWarningPayload) (*model.OrderGetTotalWarningRes, error) {
msg, err := natsio.GetServer().Request(subject.Order.GetUserTotalWarningOrders, toBytes(p))
if err != nil {
return nil, err
}
var r struct {
Data model.OrderGetTotalWarningRes `json:"data"`
Error string `json:"error"`
}
if err = json.Unmarshal(msg.Data, &r); err != nil {
return nil, err
}
if r.Error != "" {
return nil, errors.New(r.Error)
}
return &r.Data, nil
}

View File

@ -19,9 +19,3 @@ func (s Socket) EmitSocketEventDataReward(p model.PayloadEmitSocketEvent) error
_, err := natsio.GetServer().Request(subject.Socket.EmitEventReward, toBytes(p)) _, err := natsio.GetServer().Request(subject.Socket.EmitEventReward, toBytes(p))
return err return err
} }
// EmitEventToUser ...
func (s Socket) EmitEventToUser(p model.PayloadEmitSocketEvent) error {
_, err := natsio.GetServer().Request(subject.Socket.EmitEventToUser, toBytes(p))
return err
}

View File

@ -53,7 +53,3 @@ type OrderSupplierQuery struct {
type OrderSupplierCashReq struct { type OrderSupplierCashReq struct {
SupplierID string `json:"supplierId"` SupplierID string `json:"supplierId"`
} }
type OrderGetTotalWarningPayload struct {
UserID string `json:"userId"`
}

View File

@ -39,9 +39,3 @@ type OrderSupplierCashRes struct {
WaitingForReconcileCash float64 `json:"waitingForReconcileCash"` WaitingForReconcileCash float64 `json:"waitingForReconcileCash"`
ReconciledCash float64 `json:"reconciledCash"` ReconciledCash float64 `json:"reconciledCash"`
} }
// OrderGetTotalWarningRes ...
type OrderGetTotalWarningRes struct {
UserID string `json:"userId"`
TotalWarningOrders int64 `json:"totalWarningOrders"`
}

View File

@ -7,21 +7,19 @@ func getOrderValue(val string) string {
} }
var Order = struct { var Order = struct {
UpdateORStatus string UpdateORStatus string
GetUserTotalWarningOrders string CancelDelivery string
CancelDelivery string ChangeDeliveryStatus string
ChangeDeliveryStatus string UpdateLogisticInfoFailed string
UpdateLogisticInfoFailed string ORNotUpdateStatus string
ORNotUpdateStatus string GetSupplierOrders string
GetSupplierOrders string GetSupplierCash string
GetSupplierCash string
}{ }{
UpdateORStatus: getOrderValue("update_outbound_request_status"), UpdateORStatus: getOrderValue("update_outbound_request_status"),
GetUserTotalWarningOrders: getOrderValue("get_user_total_warning_orders"), CancelDelivery: getOrderValue("cancel_delivery"),
CancelDelivery: getOrderValue("cancel_delivery"), ChangeDeliveryStatus: getOrderValue("change_delivery_status"),
ChangeDeliveryStatus: getOrderValue("change_delivery_status"), UpdateLogisticInfoFailed: getOrderValue("update_logistic_info_failed"),
UpdateLogisticInfoFailed: getOrderValue("update_logistic_info_failed"), ORNotUpdateStatus: getOrderValue("outbound_request_not_update_status"),
ORNotUpdateStatus: getOrderValue("outbound_request_not_update_status"), GetSupplierOrders: getOrderValue("get_supplier_orders"),
GetSupplierOrders: getOrderValue("get_supplier_orders"), GetSupplierCash: getOrderValue("get_supplier_cash"),
GetSupplierCash: getOrderValue("get_supplier_cash"),
} }

View File

@ -9,8 +9,6 @@ func getSocketValue(val string) string {
// Socket ... // Socket ...
var Socket = struct { var Socket = struct {
EmitEventReward string EmitEventReward string
EmitEventToUser string
}{ }{
EmitEventReward: getSocketValue("emit_event_reward"), EmitEventReward: getSocketValue("emit_event_reward"),
EmitEventToUser: "send_message_to_socket",
} }