feat: import services and standardize Go 1.26.5
This commit is contained in:
28
apps/ec/mall/internal/logic/freight/deny_region_fetch.go
Normal file
28
apps/ec/mall/internal/logic/freight/deny_region_fetch.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package freight
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
pb "git.apinb.com/bsm-ec/mall/pb"
|
||||
"git.apinb.com/bsm-sdk/core/service"
|
||||
)
|
||||
|
||||
// DenyRegionFetch 限制区域列表
|
||||
func DenyRegionFetch(ctx context.Context, in *pb.FetchRequest) (reply *pb.DenyRegionReply, err error) {
|
||||
// parse authorization meta.
|
||||
_, err = service.ParseMetaCtx(ctx, &service.ParseOptions{RoleValue: "Mall_Admin"})
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user