refactor: localize protobuf definitions
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
// 新建公告
|
||||
func Create(ctx context.Context, in *pb.NoticeItem) (reply *pb.StatusReply, err error) {
|
||||
func Create(ctx context.Context, in *pb.NoticeItem) (reply *pb.IdentityStatusReply, err error) {
|
||||
// parse authorization meta.
|
||||
AUTH, err := service.ParseMetaCtx(ctx, &service.ParseOptions{RoleValue: "Mall_Admin"})
|
||||
if err != nil {
|
||||
@@ -44,7 +44,7 @@ func Create(ctx context.Context, in *pb.NoticeItem) (reply *pb.StatusReply, err
|
||||
return nil, errcode.ErrDB
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.IdentityStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Timeseq: time.Now().UnixMilli(),
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
// 删除公告
|
||||
func Delete(ctx context.Context, in *pb.IdentRequest) (reply *pb.StatusReply, err error) {
|
||||
func Delete(ctx context.Context, in *pb.IdentRequest) (reply *pb.IdentityStatusReply, err error) {
|
||||
// parse authorization meta.
|
||||
_, err = service.ParseMetaCtx(ctx, &service.ParseOptions{RoleValue: "Mall_Admin"})
|
||||
if err != nil {
|
||||
@@ -31,7 +31,7 @@ func Delete(ctx context.Context, in *pb.IdentRequest) (reply *pb.StatusReply, er
|
||||
return nil, errcode.ErrDB
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.IdentityStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Timeseq: time.Now().UnixMilli(),
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
// 公告列表
|
||||
func Fetch(ctx context.Context, in *pb.FetchRequest) (reply *pb.NoticeListReply, err error) {
|
||||
func Fetch(ctx context.Context, in *pb.MallFetchRequest) (reply *pb.NoticeListReply, err error) {
|
||||
|
||||
if in.GetStoreIdentity() == "" {
|
||||
return nil, errcode.ErrInvalidArgument
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
// 修改公告
|
||||
func Modify(ctx context.Context, in *pb.NoticeItem) (reply *pb.StatusReply, err error) {
|
||||
func Modify(ctx context.Context, in *pb.NoticeItem) (reply *pb.IdentityStatusReply, err error) {
|
||||
// parse authorization meta.
|
||||
_, err = service.ParseMetaCtx(ctx, &service.ParseOptions{RoleValue: "Mall_Admin"})
|
||||
if err != nil {
|
||||
@@ -37,7 +37,7 @@ func Modify(ctx context.Context, in *pb.NoticeItem) (reply *pb.StatusReply, err
|
||||
return nil, errcode.ErrDB
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.IdentityStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Identity: in.GetIdentity(),
|
||||
|
||||
Reference in New Issue
Block a user