refactor: reorganize modules and add Linux build tooling
This commit is contained in:
26
module/ec/market/internal/logic/data/member_details.go
Normal file
26
module/ec/market/internal/logic/data/member_details.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"context"
|
||||
pb "bsm/full/module/ec/market/pb"
|
||||
"git.apinb.com/bsm-sdk/core/errcode"
|
||||
"git.apinb.com/bsm-sdk/core/service"
|
||||
)
|
||||
|
||||
// 会员详情
|
||||
func MemberDetails(ctx context.Context, in *pb.IdentRequest) (reply *pb.KeyVal, err error) {
|
||||
// parse authorization meta.
|
||||
_, err = service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// valildate request id,identity.
|
||||
if in.Id == 0 && in.Identity == "" {
|
||||
return nil, errcode.ErrInvalidArgument
|
||||
}
|
||||
|
||||
// TODO: add your logic code & delete this line.
|
||||
|
||||
return
|
||||
}
|
||||
28
module/ec/market/internal/logic/data/member_fetch.go
Normal file
28
module/ec/market/internal/logic/data/member_fetch.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"context"
|
||||
pb "bsm/full/module/ec/market/pb"
|
||||
"git.apinb.com/bsm-sdk/core/service"
|
||||
)
|
||||
|
||||
// 会员列表
|
||||
func MemberFetch(ctx context.Context, in *pb.FetchRequest) (reply *pb.DataReply, err error) {
|
||||
// parse authorization meta.
|
||||
_, err = service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// valildate request page_no,page_size.
|
||||
if in.GetPageNo() < 1 {
|
||||
in.PageNo = 1
|
||||
}
|
||||
if in.GetPageSize() < 10 {
|
||||
in.PageSize = 50
|
||||
}
|
||||
|
||||
// TODO: add your logic code & delete this line.
|
||||
|
||||
return
|
||||
}
|
||||
26
module/ec/market/internal/logic/data/order_details.go
Normal file
26
module/ec/market/internal/logic/data/order_details.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"context"
|
||||
pb "bsm/full/module/ec/market/pb"
|
||||
"git.apinb.com/bsm-sdk/core/errcode"
|
||||
"git.apinb.com/bsm-sdk/core/service"
|
||||
)
|
||||
|
||||
// 订单详情
|
||||
func OrderDetails(ctx context.Context, in *pb.IdentRequest) (reply *pb.KeyVal, err error) {
|
||||
// parse authorization meta.
|
||||
_, err = service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// valildate request id,identity.
|
||||
if in.Id == 0 && in.Identity == "" {
|
||||
return nil, errcode.ErrInvalidArgument
|
||||
}
|
||||
|
||||
// TODO: add your logic code & delete this line.
|
||||
|
||||
return
|
||||
}
|
||||
28
module/ec/market/internal/logic/data/order_fetch.go
Normal file
28
module/ec/market/internal/logic/data/order_fetch.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"context"
|
||||
pb "bsm/full/module/ec/market/pb"
|
||||
"git.apinb.com/bsm-sdk/core/service"
|
||||
)
|
||||
|
||||
// 订单列表
|
||||
func OrderFetch(ctx context.Context, in *pb.FetchRequest) (reply *pb.DataReply, err error) {
|
||||
// parse authorization meta.
|
||||
_, err = service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// valildate request page_no,page_size.
|
||||
if in.GetPageNo() < 1 {
|
||||
in.PageNo = 1
|
||||
}
|
||||
if in.GetPageSize() < 10 {
|
||||
in.PageSize = 50
|
||||
}
|
||||
|
||||
// TODO: add your logic code & delete this line.
|
||||
|
||||
return
|
||||
}
|
||||
22
module/ec/market/internal/logic/data/overview.go
Normal file
22
module/ec/market/internal/logic/data/overview.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"context"
|
||||
pb "bsm/full/module/ec/market/pb"
|
||||
"git.apinb.com/bsm-sdk/core/service"
|
||||
)
|
||||
|
||||
// 概况
|
||||
func Overview(ctx context.Context, in *pb.Empty) (reply *pb.OverviewReply, err error) {
|
||||
// parse authorization meta.
|
||||
_, err = service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// TODO: valid code
|
||||
|
||||
// TODO: add your logic code & delete this line.
|
||||
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user