|
@@ -17,7 +17,7 @@ type CustomerHeader struct{}
|
|
|
var isPublic, noPublic = "10", "20" // 公海,非公海
|
|
var isPublic, noPublic = "10", "20" // 公海,非公海
|
|
|
var noCustomer = true // 区分公海列表 和 客户列表 true 公海
|
|
var noCustomer = true // 区分公海列表 和 客户列表 true 公海
|
|
|
|
|
|
|
|
-//GetList 客户列表
|
|
|
|
|
|
|
+//Swagger:Customer 客户,测试tag 客户列表
|
|
|
func (c *CustomerHeader) GetList(ctx context.Context, req *model.CustCustomerSearchReq, rsp *comm_def.CommonMsg) error {
|
|
func (c *CustomerHeader) GetList(ctx context.Context, req *model.CustCustomerSearchReq, rsp *comm_def.CommonMsg) error {
|
|
|
customerServer, err := server.NewCustomerService(ctx)
|
|
customerServer, err := server.NewCustomerService(ctx)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -32,7 +32,7 @@ func (c *CustomerHeader) GetList(ctx context.Context, req *model.CustCustomerSea
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//PublicGetList 公海列表
|
|
|
|
|
|
|
+//Swagger:Customer 客户,测试tag 公海列表
|
|
|
func (c *CustomerHeader) PublicGetList(ctx context.Context, req *model.CustCustomerSearchReq, rsp *comm_def.CommonMsg) error {
|
|
func (c *CustomerHeader) PublicGetList(ctx context.Context, req *model.CustCustomerSearchReq, rsp *comm_def.CommonMsg) error {
|
|
|
customerServer, err := server.NewCustomerService(ctx)
|
|
customerServer, err := server.NewCustomerService(ctx)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -51,8 +51,7 @@ func (c *CustomerHeader) PublicGetList(ctx context.Context, req *model.CustCusto
|
|
|
return nil
|
|
return nil
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-//Create 创建客户
|
|
|
|
|
|
|
+//Swagger:Customer 客户,测试tag 创建客户
|
|
|
func (c *CustomerHeader) Create(ctx context.Context, req *model.CustomerAddSeq, rsp *comm_def.CommonMsg) error {
|
|
func (c *CustomerHeader) Create(ctx context.Context, req *model.CustomerAddSeq, rsp *comm_def.CommonMsg) error {
|
|
|
if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
|
|
if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
|
|
|
return err
|
|
return err
|
|
@@ -73,7 +72,7 @@ func (c *CustomerHeader) Create(ctx context.Context, req *model.CustomerAddSeq,
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//UpdateById 修改客户
|
|
|
|
|
|
|
+//Swagger:Customer 客户,测试tag 修改客户
|
|
|
func (c *CustomerHeader) UpdateById(ctx context.Context, req *model.UpdateCustomer, rsp *comm_def.CommonMsg) error {
|
|
func (c *CustomerHeader) UpdateById(ctx context.Context, req *model.UpdateCustomer, rsp *comm_def.CommonMsg) error {
|
|
|
s, err := server.NewCustomerService(ctx)
|
|
s, err := server.NewCustomerService(ctx)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -89,7 +88,7 @@ func (c *CustomerHeader) UpdateById(ctx context.Context, req *model.UpdateCustom
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//GetEntityById 客户详情
|
|
|
|
|
|
|
+//Swagger:Customer 客户,测试tag 客户详情
|
|
|
func (c *CustomerHeader) GetEntityById(ctx context.Context, req *comm_def.IdsReq, rsp *comm_def.CommonMsg) error {
|
|
func (c *CustomerHeader) GetEntityById(ctx context.Context, req *comm_def.IdsReq, rsp *comm_def.CommonMsg) error {
|
|
|
if len(req.Ids) == 0 {
|
|
if len(req.Ids) == 0 {
|
|
|
return myerrors.ValidError("参数有误")
|
|
return myerrors.ValidError("参数有误")
|
|
@@ -107,7 +106,7 @@ func (c *CustomerHeader) GetEntityById(ctx context.Context, req *comm_def.IdsReq
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//DeleteById 删除客户
|
|
|
|
|
|
|
+//Swagger:Customer 客户,测试tag 删除客户
|
|
|
func (c *CustomerHeader) DeleteById(ctx context.Context, req *model.DelCustomer, rsp *comm_def.CommonMsg) error {
|
|
func (c *CustomerHeader) DeleteById(ctx context.Context, req *model.DelCustomer, rsp *comm_def.CommonMsg) error {
|
|
|
if len(req.Ids) == 0 {
|
|
if len(req.Ids) == 0 {
|
|
|
return myerrors.ValidError("参数有误")
|
|
return myerrors.ValidError("参数有误")
|
|
@@ -125,7 +124,7 @@ func (c *CustomerHeader) DeleteById(ctx context.Context, req *model.DelCustomer,
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//GetCustNameIsExist 判断客户名称是否存在 bool
|
|
|
|
|
|
|
+//Swagger:Customer 客户,测试tag 判断客户名称是否存在
|
|
|
func (c *CustomerHeader) GetCustNameIsExist(ctx context.Context, req *model.IsExistsCustName, rsp *comm_def.CommonMsg) error {
|
|
func (c *CustomerHeader) GetCustNameIsExist(ctx context.Context, req *model.IsExistsCustName, rsp *comm_def.CommonMsg) error {
|
|
|
if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
|
|
if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
|
|
|
return err
|
|
return err
|
|
@@ -142,7 +141,7 @@ func (c *CustomerHeader) GetCustNameIsExist(ctx context.Context, req *model.IsEx
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//TransCustomer 转移客户
|
|
|
|
|
|
|
+// 客户,测试tag 转移客户
|
|
|
func (c *CustomerHeader) TransCustomer(ctx context.Context, req *model.AssignCustomerReq, rsp *comm_def.CommonMsg) error {
|
|
func (c *CustomerHeader) TransCustomer(ctx context.Context, req *model.AssignCustomerReq, rsp *comm_def.CommonMsg) error {
|
|
|
if len(req.Ids) == 0 || req.SalesId == 0 {
|
|
if len(req.Ids) == 0 || req.SalesId == 0 {
|
|
|
return myerrors.ValidError("参数有误")
|
|
return myerrors.ValidError("参数有误")
|
|
@@ -161,7 +160,7 @@ func (c *CustomerHeader) TransCustomer(ctx context.Context, req *model.AssignCus
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//AssignCustomer 分配,领取客户
|
|
|
|
|
|
|
+// 客户,测试tag 分配 领取客户
|
|
|
func (c *CustomerHeader) AssignCustomer(ctx context.Context, req *model.AssignCustomerReq, rsp *comm_def.CommonMsg) error {
|
|
func (c *CustomerHeader) AssignCustomer(ctx context.Context, req *model.AssignCustomerReq, rsp *comm_def.CommonMsg) error {
|
|
|
if len(req.Ids) == 0 || req.SalesId == 0 {
|
|
if len(req.Ids) == 0 || req.SalesId == 0 {
|
|
|
return myerrors.ValidError("参数有误")
|
|
return myerrors.ValidError("参数有误")
|
|
@@ -185,7 +184,7 @@ func (c *CustomerHeader) AssignCustomer(ctx context.Context, req *model.AssignCu
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//MoveToPubic 移入公海
|
|
|
|
|
|
|
+// 客户,测试tag 移入公海
|
|
|
func (c *CustomerHeader) MoveToPubic(ctx context.Context, req *model.MoveToPubicRep, rsp *comm_def.CommonMsg) error {
|
|
func (c *CustomerHeader) MoveToPubic(ctx context.Context, req *model.MoveToPubicRep, rsp *comm_def.CommonMsg) error {
|
|
|
if len(req.Ids) == 0 {
|
|
if len(req.Ids) == 0 {
|
|
|
return myerrors.ValidError("参数有误")
|
|
return myerrors.ValidError("参数有误")
|
|
@@ -206,7 +205,7 @@ func (c *CustomerHeader) MoveToPubic(ctx context.Context, req *model.MoveToPubic
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//GetDynamicsList 客户动态
|
|
|
|
|
|
|
+// 客户,测试tag 客户动态
|
|
|
func (c *CustomerHeader) GetDynamicsList(ctx context.Context, req *model.CustomerDynameicsReq, rsp *comm_def.CommonMsg) error {
|
|
func (c *CustomerHeader) GetDynamicsList(ctx context.Context, req *model.CustomerDynameicsReq, rsp *comm_def.CommonMsg) error {
|
|
|
customerServer, err := server.NewCustomerService(ctx)
|
|
customerServer, err := server.NewCustomerService(ctx)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -220,7 +219,7 @@ func (c *CustomerHeader) GetDynamicsList(ctx context.Context, req *model.Custome
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//MergeCustomer 合并客户
|
|
|
|
|
|
|
+// 客户,测试tag 合并客户
|
|
|
func (c *CustomerHeader) MergeCustomer(ctx context.Context, req *model.MergeCustomerRep, rsp *comm_def.CommonMsg) error {
|
|
func (c *CustomerHeader) MergeCustomer(ctx context.Context, req *model.MergeCustomerRep, rsp *comm_def.CommonMsg) error {
|
|
|
if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
|
|
if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
|
|
|
return err
|
|
return err
|
|
@@ -238,7 +237,7 @@ func (c *CustomerHeader) MergeCustomer(ctx context.Context, req *model.MergeCust
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//GetCustAbstract 客户摘要
|
|
|
|
|
|
|
+// 客户,测试tag 客户摘要
|
|
|
func (c *CustomerHeader) GetCustAbstract(ctx context.Context, req *comm_def.IdReq, rsp *comm_def.CommonMsg) error {
|
|
func (c *CustomerHeader) GetCustAbstract(ctx context.Context, req *comm_def.IdReq, rsp *comm_def.CommonMsg) error {
|
|
|
if req.Id == 0 {
|
|
if req.Id == 0 {
|
|
|
return myerrors.ValidError("参数有误")
|
|
return myerrors.ValidError("参数有误")
|