|
|
@@ -18,7 +18,7 @@ type DistributorHandler struct{}
|
|
|
|
|
|
// GetList 获取列表
|
|
|
// Swagger:Distributor 经销商代理商 查询
|
|
|
-func (p *DistributorHandler) GetList(ctx context.Context, req *model.BaseDistributorSearchReq, rsp *comm_def.CommonMsg) error {
|
|
|
+func (c *DistributorHandler) GetList(ctx context.Context, req *model.BaseDistributorSearchReq, rsp *comm_def.CommonMsg) error {
|
|
|
distributorServer, err := server.NewDistributorService(ctx)
|
|
|
if err != nil {
|
|
|
|
|
|
@@ -34,7 +34,7 @@ func (p *DistributorHandler) GetList(ctx context.Context, req *model.BaseDistrib
|
|
|
}
|
|
|
|
|
|
// Swagger:Distributor 经销商代理商 新增
|
|
|
-func (p *DistributorHandler) Create(ctx context.Context, req *model.AddDistributor, rsp *comm_def.CommonMsg) error {
|
|
|
+func (c *DistributorHandler) Create(ctx context.Context, req *model.AddDistributor, rsp *comm_def.CommonMsg) error {
|
|
|
distributorServer, err := server.NewDistributorService(ctx)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
@@ -47,7 +47,7 @@ func (p *DistributorHandler) Create(ctx context.Context, req *model.AddDistribut
|
|
|
}
|
|
|
|
|
|
// GetEntityById 详情
|
|
|
-func (p *DistributorHandler) GetEntityById(ctx context.Context, req *comm_def.IdReq, rsp *comm_def.CommonMsg) error {
|
|
|
+func (c *DistributorHandler) GetEntityById(ctx context.Context, req *comm_def.IdReq, rsp *comm_def.CommonMsg) error {
|
|
|
if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
|
|
|
return err
|
|
|
}
|
|
|
@@ -64,7 +64,7 @@ func (p *DistributorHandler) GetEntityById(ctx context.Context, req *comm_def.Id
|
|
|
}
|
|
|
|
|
|
// Swagger:Distributor 经销商代理商 修改
|
|
|
-func (p *DistributorHandler) UpdateById(ctx context.Context, req *model.UpdateDistributorReq, rsp *comm_def.CommonMsg) error {
|
|
|
+func (c *DistributorHandler) UpdateById(ctx context.Context, req *model.UpdateDistributorReq, rsp *comm_def.CommonMsg) error {
|
|
|
if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
|
|
|
return err
|
|
|
}
|
|
|
@@ -80,7 +80,7 @@ func (p *DistributorHandler) UpdateById(ctx context.Context, req *model.UpdateDi
|
|
|
}
|
|
|
|
|
|
// Swagger:Distributor 经销商代理商 转为代理商
|
|
|
-func (p *DistributorHandler) ToProxy(ctx context.Context, req *model.DistributorToProxyReq, rsp *comm_def.CommonMsg) error {
|
|
|
+func (c *DistributorHandler) ToProxy(ctx context.Context, req *model.DistributorToProxyReq, rsp *comm_def.CommonMsg) error {
|
|
|
g.Log().Infof("DistributorHandler.ToProxy request %#v ", *req)
|
|
|
if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
|
|
|
return err
|
|
|
@@ -97,7 +97,7 @@ func (p *DistributorHandler) ToProxy(ctx context.Context, req *model.Distributor
|
|
|
}
|
|
|
|
|
|
// Swagger:Distributor 经销商代理商 续签
|
|
|
-func (p *DistributorHandler) Renew(ctx context.Context, req *model.DistributorRenewReq, rsp *comm_def.CommonMsg) error {
|
|
|
+func (c *DistributorHandler) Renew(ctx context.Context, req *model.DistributorRenewReq, rsp *comm_def.CommonMsg) error {
|
|
|
g.Log().Infof("DistributorHandler.Renew request %#v ", *req)
|
|
|
if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
|
|
|
return err
|
|
|
@@ -114,7 +114,7 @@ func (p *DistributorHandler) Renew(ctx context.Context, req *model.DistributorRe
|
|
|
}
|
|
|
|
|
|
// Swagger:Distributor 经销商代理商 转为经销商
|
|
|
-func (p *DistributorHandler) ToDist(ctx context.Context, req *model.DistributorToDistReq, rsp *comm_def.CommonMsg) error {
|
|
|
+func (c *DistributorHandler) ToDist(ctx context.Context, req *model.DistributorToDistReq, rsp *comm_def.CommonMsg) error {
|
|
|
g.Log().Infof("DistributorHandler.ToDist request %#v ", *req)
|
|
|
if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
|
|
|
return err
|
|
|
@@ -149,7 +149,7 @@ func (c *DistributorHandler) TransRecord(ctx context.Context, req *model.Distrib
|
|
|
}
|
|
|
|
|
|
// DeleteByIds 删掉
|
|
|
-func (p *DistributorHandler) DeleteByIds(ctx context.Context, req *model.DeleteDistributorReq, rsp *comm_def.CommonMsg) error {
|
|
|
+func (c *DistributorHandler) DeleteByIds(ctx context.Context, req *model.DeleteDistributorReq, rsp *comm_def.CommonMsg) error {
|
|
|
distributorServer, err := server.NewDistributorService(ctx)
|
|
|
if err != nil {
|
|
|
|
|
|
@@ -214,3 +214,17 @@ func (c *DistributorHandler) DynamicsList(ctx context.Context, req *model.Distri
|
|
|
rsp.Data = g.Map{"list": ent, "total": total}
|
|
|
return nil
|
|
|
}
|
|
|
+
|
|
|
+// Swagger:Distributor 经销商代理商 系统管理员转移经销商代理商
|
|
|
+func (c *DistributorHandler) SysAdminTransferDistributor(ctx context.Context, req *model.SysAdminTransferDistributorReq, rsp *comm_def.CommonMsg) error {
|
|
|
+ g.Log().Infof("DistributorHandler.SysAdminTransferDistributor request %#v ", *req)
|
|
|
+ s, err := server.NewDistributorService(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ err = s.SysAdminTransferDistributor(ctx, req)
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ return nil
|
|
|
+}
|