service

package
v0.0.0-...-8176360 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthInterceptor

func AuthInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

Types

type GRPCService

type GRPCService struct {
	OrderSvc *OrderSvc
	// contains filtered or unexported fields
}

GRPCService ...

func BuildGRPCService

func BuildGRPCService(server *grpc.Server, repository repository.Repository) *GRPCService

BuildGRPCService register gRPC services implementation

type JwtClaims

type JwtClaims struct {
	jwt.StandardClaims
	UserID   string `json:"userid"`
	DeviceID string `json:"dvcid"`
	UserNo   int    `json:"userno"`
	Username string `json:"username"`
	Email    string `json:"email"`
	Phone    string `json:"phone"`
}

JwtClaims is wrapper for claiming JWT during login process

type OrderSvc

type OrderSvc struct {
	// contains filtered or unexported fields
}

OrderService

func NewOrderSvc

func NewOrderSvc(orepo repository.OrderRepository, log *logrus.Logger) *OrderSvc

Instantiate new user Service

func (*OrderSvc) Create

func (s *OrderSvc) Create(ctx context.Context, ord *pb.OrderReqDto) (*pb.OrderDto, error)

CreateOrder ...

func (*OrderSvc) GetOrderByID

func (s *OrderSvc) GetOrderByID(ctx context.Context, id *wrappers.StringValue) (*pb.OrderDto, error)

GetOrderByID will return product detail

func (*OrderSvc) ListOrderByUserID

func (s *OrderSvc) ListOrderByUserID(ctx context.Context, userId *wrappers.StringValue) (*pb.OrderDtoList, error)

ListOrderByUserID will return all product with date choosen

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL