refactor: localize protobuf definitions
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
// 审核
|
||||
func Approve(ctx context.Context, in *pb.ApproveRequest) (reply *pb.StatusReply, err error) {
|
||||
func Approve(ctx context.Context, in *pb.ApproveRequest) (reply *pb.IdentityStatusReply, err error) {
|
||||
var data *models.MarketAgency
|
||||
if in.GetIdentity() == "" {
|
||||
return nil, errcode.ErrInvalidArgument
|
||||
@@ -35,7 +35,7 @@ func Approve(ctx context.Context, in *pb.ApproveRequest) (reply *pb.StatusReply,
|
||||
}
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.IdentityStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Identity: data.Identity,
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
// 新增代理商
|
||||
func Create(ctx context.Context, in *pb.MarketAgenctyItem) (reply *pb.StatusReply, err error) {
|
||||
func Create(ctx context.Context, in *pb.MarketAgenctyItem) (reply *pb.IdentityStatusReply, err error) {
|
||||
// _, err = service.ParseMetaCtx(ctx, nil)
|
||||
// if err != nil {
|
||||
// return nil, err
|
||||
@@ -49,7 +49,7 @@ func Create(ctx context.Context, in *pb.MarketAgenctyItem) (reply *pb.StatusRepl
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.IdentityStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Identity: mktModel.Identity,
|
||||
|
||||
@@ -11,7 +11,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, nil)
|
||||
// if err != nil {
|
||||
@@ -26,7 +26,7 @@ func Delete(ctx context.Context, in *pb.IdentRequest) (reply *pb.StatusReply, er
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.IdentityStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Identity: in.GetIdentity(),
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
// 代理商列表
|
||||
func Fetch(ctx context.Context, in *pb.FetchRequest) (reply *pb.AgencyReply, err error) {
|
||||
func Fetch(ctx context.Context, in *pb.MarketFetchRequest) (reply *pb.AgencyReply, err error) {
|
||||
var (
|
||||
cnt int64 = 0
|
||||
Offset int64 = (in.GetPageNo() - 1) * in.GetPageSize()
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
// 更新代理商数据
|
||||
func Modify(ctx context.Context, in *pb.MarketAgenctyItem) (reply *pb.StatusReply, err error) {
|
||||
func Modify(ctx context.Context, in *pb.MarketAgenctyItem) (reply *pb.IdentityStatusReply, err error) {
|
||||
var (
|
||||
identity string
|
||||
)
|
||||
@@ -45,7 +45,7 @@ func Modify(ctx context.Context, in *pb.MarketAgenctyItem) (reply *pb.StatusRepl
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.IdentityStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Identity: mktModel.Identity,
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
// 待审核
|
||||
func Pending(ctx context.Context, in *pb.FetchRequest) (reply *pb.AgencyReply, err error) {
|
||||
func Pending(ctx context.Context, in *pb.MarketFetchRequest) (reply *pb.AgencyReply, err error) {
|
||||
_, err = service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
// 更新密码
|
||||
func SetPassword(ctx context.Context, in *pb.SetPasswordRequest) (reply *pb.StatusReply, err error) {
|
||||
func SetPassword(ctx context.Context, in *pb.SetPasswordRequest) (reply *pb.IdentityStatusReply, err error) {
|
||||
var (
|
||||
identity string
|
||||
)
|
||||
@@ -50,7 +50,7 @@ func SetPassword(ctx context.Context, in *pb.SetPasswordRequest) (reply *pb.Stat
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.IdentityStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Identity: identity,
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
// 会员列表
|
||||
func MemberFetch(ctx context.Context, in *pb.FetchRequest) (reply *pb.DataReply, err error) {
|
||||
func MemberFetch(ctx context.Context, in *pb.MarketFetchRequest) (reply *pb.DataReply, err error) {
|
||||
// parse authorization meta.
|
||||
_, err = service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
// 订单列表
|
||||
func OrderFetch(ctx context.Context, in *pb.FetchRequest) (reply *pb.DataReply, err error) {
|
||||
func OrderFetch(ctx context.Context, in *pb.MarketFetchRequest) (reply *pb.DataReply, err error) {
|
||||
// parse authorization meta.
|
||||
_, err = service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
// 新增供应商
|
||||
func Create(ctx context.Context, in *pb.MarketSupplyItem) (reply *pb.StatusReply, err error) {
|
||||
func Create(ctx context.Context, in *pb.MarketSupplyItem) (reply *pb.IdentityStatusReply, err error) {
|
||||
// parse authorization meta.
|
||||
// _, err = service.ParseMetaCtx(ctx, nil)
|
||||
// if err != nil {
|
||||
@@ -38,7 +38,7 @@ func Create(ctx context.Context, in *pb.MarketSupplyItem) (reply *pb.StatusReply
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.IdentityStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Identity: mktModel.Identity,
|
||||
|
||||
@@ -12,7 +12,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, nil)
|
||||
if err != nil {
|
||||
@@ -29,7 +29,7 @@ func Delete(ctx context.Context, in *pb.IdentRequest) (reply *pb.StatusReply, er
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.IdentityStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Timeseq: time.Now().UnixNano(),
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
// 供应商列表
|
||||
func Fetch(ctx context.Context, in *pb.FetchRequest) (reply *pb.SupplyReply, err error) {
|
||||
func Fetch(ctx context.Context, in *pb.MarketFetchRequest) (reply *pb.SupplyReply, err error) {
|
||||
var (
|
||||
cnt int64 = 0
|
||||
Offset int64 = (in.GetPageNo() - 1) * in.GetPageSize()
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
// 更新供应商数据
|
||||
func Modify(ctx context.Context, in *pb.MarketSupplyItem) (reply *pb.StatusReply, err error) {
|
||||
func Modify(ctx context.Context, in *pb.MarketSupplyItem) (reply *pb.IdentityStatusReply, err error) {
|
||||
_, err = service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -38,7 +38,7 @@ func Modify(ctx context.Context, in *pb.MarketSupplyItem) (reply *pb.StatusReply
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.IdentityStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Identity: mktModel.Identity,
|
||||
|
||||
Reference in New Issue
Block a user