first commit
This commit is contained in:
50
apps/sentinel/internal/server/product/productserver.go
Normal file
50
apps/sentinel/internal/server/product/productserver.go
Normal file
@@ -0,0 +1,50 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.7.2
|
||||
// Source: sentinel.proto
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tianyuan-api/apps/sentinel/internal/logic/product"
|
||||
"tianyuan-api/apps/sentinel/internal/svc"
|
||||
"tianyuan-api/apps/sentinel/sentinel"
|
||||
)
|
||||
|
||||
type ProductServer struct {
|
||||
svcCtx *svc.ServiceContext
|
||||
sentinel.UnimplementedProductServer
|
||||
}
|
||||
|
||||
func NewProductServer(svcCtx *svc.ServiceContext) *ProductServer {
|
||||
return &ProductServer{
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
// Product methods
|
||||
func (s *ProductServer) CreateProduct(ctx context.Context, in *sentinel.CreateProductRequest) (*sentinel.Product, error) {
|
||||
l := productlogic.NewCreateProductLogic(ctx, s.svcCtx)
|
||||
return l.CreateProduct(in)
|
||||
}
|
||||
|
||||
func (s *ProductServer) UpdateProduct(ctx context.Context, in *sentinel.UpdateProductRequest) (*sentinel.Product, error) {
|
||||
l := productlogic.NewUpdateProductLogic(ctx, s.svcCtx)
|
||||
return l.UpdateProduct(in)
|
||||
}
|
||||
|
||||
func (s *ProductServer) DeleteProduct(ctx context.Context, in *sentinel.DeleteProductRequest) (*sentinel.Product, error) {
|
||||
l := productlogic.NewDeleteProductLogic(ctx, s.svcCtx)
|
||||
return l.DeleteProduct(in)
|
||||
}
|
||||
|
||||
func (s *ProductServer) GetProductPageList(ctx context.Context, in *sentinel.PageListRequest) (*sentinel.ProductResponse, error) {
|
||||
l := productlogic.NewGetProductPageListLogic(ctx, s.svcCtx)
|
||||
return l.GetProductPageList(in)
|
||||
}
|
||||
|
||||
func (s *ProductServer) GetProductById(ctx context.Context, in *sentinel.GetRecordByIdRequest) (*sentinel.Product, error) {
|
||||
l := productlogic.NewGetProductByIdLogic(ctx, s.svcCtx)
|
||||
return l.GetProductById(in)
|
||||
}
|
||||
Reference in New Issue
Block a user