2024-10-06 07:02:30 +00:00
|
|
|
// Code generated by goctl. DO NOT EDIT.
|
|
|
|
// Source: order.proto
|
|
|
|
|
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2024-10-23 09:50:11 +00:00
|
|
|
"app-cloudep-order-server/gen_result/pb/order"
|
|
|
|
orderservicelogic "app-cloudep-order-server/internal/logic/orderservice"
|
2024-10-06 07:02:30 +00:00
|
|
|
"app-cloudep-order-server/internal/svc"
|
|
|
|
)
|
|
|
|
|
|
|
|
type OrderServiceServer struct {
|
|
|
|
svcCtx *svc.ServiceContext
|
2024-10-23 09:50:11 +00:00
|
|
|
order.UnimplementedOrderServiceServer
|
2024-10-06 07:02:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewOrderServiceServer(svcCtx *svc.ServiceContext) *OrderServiceServer {
|
|
|
|
return &OrderServiceServer{
|
|
|
|
svcCtx: svcCtx,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// CreateOrder 建立訂單
|
2024-10-23 09:50:11 +00:00
|
|
|
func (s *OrderServiceServer) CreateOrder(ctx context.Context, in *order.CreateOrderReq) (*order.OKResp, error) {
|
2024-10-06 07:02:30 +00:00
|
|
|
l := orderservicelogic.NewCreateOrderLogic(ctx, s.svcCtx)
|
|
|
|
return l.CreateOrder(in)
|
|
|
|
}
|
|
|
|
|
|
|
|
// CancelOrder 取消訂單
|
2024-10-23 09:50:11 +00:00
|
|
|
func (s *OrderServiceServer) CancelOrder(ctx context.Context, in *order.CancelOrderReq) (*order.OKResp, error) {
|
2024-10-06 07:02:30 +00:00
|
|
|
l := orderservicelogic.NewCancelOrderLogic(ctx, s.svcCtx)
|
|
|
|
return l.CancelOrder(in)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ModifyOrderStatus 修改訂單狀態
|
2024-10-23 09:50:11 +00:00
|
|
|
func (s *OrderServiceServer) ModifyOrderStatus(ctx context.Context, in *order.ModifyOrderStatusReq) (*order.OKResp, error) {
|
2024-10-06 07:02:30 +00:00
|
|
|
l := orderservicelogic.NewModifyOrderStatusLogic(ctx, s.svcCtx)
|
|
|
|
return l.ModifyOrderStatus(in)
|
|
|
|
}
|
|
|
|
|
|
|
|
// DeleteOrder 刪除訂單(軟刪除)
|
2024-10-23 09:50:11 +00:00
|
|
|
func (s *OrderServiceServer) DeleteOrder(ctx context.Context, in *order.DeleteOrderReq) (*order.OKResp, error) {
|
2024-10-06 07:02:30 +00:00
|
|
|
l := orderservicelogic.NewDeleteOrderLogic(ctx, s.svcCtx)
|
|
|
|
return l.DeleteOrder(in)
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetOrder 取得訂單詳情
|
2024-10-23 09:50:11 +00:00
|
|
|
func (s *OrderServiceServer) GetOrder(ctx context.Context, in *order.GetOrderReq) (*order.GetOrderResp, error) {
|
2024-10-06 07:02:30 +00:00
|
|
|
l := orderservicelogic.NewGetOrderLogic(ctx, s.svcCtx)
|
|
|
|
return l.GetOrder(in)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ListOrder 取得訂單列表
|
2024-10-23 09:50:11 +00:00
|
|
|
func (s *OrderServiceServer) ListOrder(ctx context.Context, in *order.ListOrderReq) (*order.ListOrderResp, error) {
|
2024-10-06 07:02:30 +00:00
|
|
|
l := orderservicelogic.NewListOrderLogic(ctx, s.svcCtx)
|
|
|
|
return l.ListOrder(in)
|
|
|
|
}
|
|
|
|
|
|
|
|
// OrderStatusTimeout 訂單超時任務/cron/order-status/timeout
|
2024-10-23 09:50:11 +00:00
|
|
|
func (s *OrderServiceServer) OrderStatusTimeout(ctx context.Context, in *order.OrderStatusTimeoutReq) (*order.OKResp, error) {
|
2024-10-06 07:02:30 +00:00
|
|
|
l := orderservicelogic.NewOrderStatusTimeoutLogic(ctx, s.svcCtx)
|
|
|
|
return l.OrderStatusTimeout(in)
|
|
|
|
}
|