refactor: localize protobuf definitions
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
// 创建工作人员
|
||||
func Create(ctx context.Context, in *pb.StaffItem) (reply *pb.StatusReply, err error) {
|
||||
func Create(ctx context.Context, in *pb.StaffItem) (reply *pb.IdentityStatusReply, err error) {
|
||||
// parse authorization meta.
|
||||
auth, err := service.ParseMetaCtx(ctx, &service.ParseOptions{RoleValue: "Mall_Admin"})
|
||||
if err != nil {
|
||||
@@ -66,7 +66,7 @@ func Create(ctx context.Context, in *pb.StaffItem) (reply *pb.StatusReply, err e
|
||||
return nil, errcode.ErrDB
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.IdentityStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Identity: data.Identity,
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
// 获取工作人员列表
|
||||
func Fetch(ctx context.Context, in *pb.FetchRequest) (reply *pb.StaffListReply, err error) {
|
||||
func Fetch(ctx context.Context, in *pb.MallFetchRequest) (reply *pb.StaffListReply, err error) {
|
||||
// parse authorization meta.
|
||||
// _, err = service.ParseMetaCtx(ctx, &service.ParseOptions{RoleValue: "Mall_Admin"})
|
||||
// if err != nil {
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
// SetPassword 设置账号密码
|
||||
func SetPassword(ctx context.Context, in *pb.SetAccountRequest) (reply *pb.StatusReply, err error) {
|
||||
func SetPassword(ctx context.Context, in *pb.SetAccountRequest) (reply *pb.IdentityStatusReply, err error) {
|
||||
// parse authorization meta.
|
||||
auth, err := service.ParseMetaCtx(ctx, &service.ParseOptions{RoleValue: "Mall_Admin"})
|
||||
if err != nil {
|
||||
@@ -33,7 +33,7 @@ func SetPassword(ctx context.Context, in *pb.SetAccountRequest) (reply *pb.Statu
|
||||
return nil, errcode.ErrDB
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.IdentityStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Timeseq: time.Now().UnixMilli(),
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
// SetProfile 设置个人信息
|
||||
func SetProfile(ctx context.Context, in *pb.StaffItem) (reply *pb.StatusReply, err error) {
|
||||
func SetProfile(ctx context.Context, in *pb.StaffItem) (reply *pb.IdentityStatusReply, err error) {
|
||||
// parse authorization meta.
|
||||
auth, err := service.ParseMetaCtx(ctx, &service.ParseOptions{RoleValue: "Mall_Admin"})
|
||||
if err != nil {
|
||||
@@ -34,7 +34,7 @@ func SetProfile(ctx context.Context, in *pb.StaffItem) (reply *pb.StatusReply, e
|
||||
return nil, errcode.ErrDB
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.IdentityStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Timeseq: time.Now().UnixMilli(),
|
||||
|
||||
Reference in New Issue
Block a user