app-cloudep-trade-service/internal/server/orderservice/order_service_server.go

66 lines
2.2 KiB
Go
Raw Normal View History

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