wangxingcheng il y a 2 ans
Parent
commit
c67806463f

+ 13 - 14
opms_parent/app/handler/cust/customer.go

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

+ 1 - 7
opms_parent/app/handler/work/workorder.go → opms_parent/app/handler/work/work_order.go

@@ -12,17 +12,15 @@ import (
 
 type WorkOrderHandler struct{}
 
-//工单列表
+// Swagger:WorkOrder 工单,测试tag 工单列表
 func (w *WorkOrderHandler) GetList(ctx context.Context, req *model.WorkOrderSearchReq, rsp *comm_def.CommonMsg) error {
 
 	orderServer, err := server.NewOrderService(ctx)
 	if err != nil {
-		g.Log().Error(err)
 		return err
 	}
 	total, list, err := orderServer.GetList(req)
 	if err != nil {
-		g.Log().Error(err)
 		return err
 	}
 	rsp.Data = g.Map{"list": list, "total": total}
@@ -34,12 +32,10 @@ func (w *WorkOrderHandler) GetList(ctx context.Context, req *model.WorkOrderSear
 func (w *WorkOrderHandler) DeriveList(ctx context.Context, req *model.WorkOrderExport, rsp *comm_def.CommonMsg) error {
 	orderServer, err := server.NewOrderService(ctx)
 	if err != nil {
-		g.Log().Error(err)
 		return err
 	}
 	con, err := orderServer.DeriveList(req)
 	if err != nil {
-		g.Log().Error(err)
 		return err
 	}
 	rsp.Data = g.Map{"list": con}
@@ -51,12 +47,10 @@ func (w *WorkOrderHandler) DeriveList(ctx context.Context, req *model.WorkOrderE
 func (w *WorkOrderHandler) GetEntityById(ctx context.Context, req *comm_def.IdReq, rsp *comm_def.CommonMsg) error {
 	orderServer, err := server.NewOrderService(ctx)
 	if err != nil {
-		g.Log().Error(err)
 		return err
 	}
 	detail, err := orderServer.GetEntityById(req)
 	if err != nil {
-		g.Log().Error(err)
 		return err
 	}
 	rsp.Data = g.Map{"list": detail}

+ 4 - 4
opms_parent/app/model/cust/cust_customer.go

@@ -46,18 +46,18 @@ type CustExport struct {
 
 //CustomerAddSeq 单表添加客户信息表
 type CustomerAddSeq struct {
-	CustName     string      `p:"custName"        json:"custName"      v:"required#客户名称不能为空"`
+	CustName     string      `p:"custName"        json:"custName"      v:"required#客户名称不能为空"` // 客户名称
 	AbbrName     string      `p:"abbrName"        json:"abbrName"   `                         // 助计名
 	CustLocation string      `p:"custLocation"    json:"custLocation"    `                    // 所在地区
 	CustAddress  string      `p:"custAddress"     json:"custAddress"   `                      // 详细地址
 	FollowUpDate *gtime.Time `p:"followUpDate"    json:"followUpDate"   `                     //跟进时间
 	CustIndustry string      `p:"custIndustry"    json:"custIndustry"  v:"required#客户行业不能为空"` //客户行业
 	CustLevel    string      `p:"custLevel"       json:"custLevel"     v:"required#客户级别不能为空"` //客户级别
-	CustSource   string      `p:"custSource"      json:"source"        v:"required#客户来源不能为空"`
+	CustSource   string      `p:"custSource"      json:"source"        v:"required#客户来源不能为空"` //客户来源
 	CustDistCode int         `p:"custDistCode"    json:"custDistCode"  v:"required#省份不能为空" ` // 省份Id
 	Remark       string      `p:"remark"          json:"remark""`                            //备注
-	SalesName    string      `p:"salesName"       json:"salesName"   `                       //
-	SalesId      int         `p:"salesId"         json:"salesId"   `                         //
+	SalesName    string      `p:"salesName"       json:"salesName"   `                       // 销售名称
+	SalesId      int         `p:"salesId"         json:"salesId"   `                         // 销售id
 }
 
 // 客户联系人信息

+ 2 - 2
opms_parent/app/model/work/work_order.go

@@ -8,11 +8,11 @@ import (
 	"dashoo.cn/opms_libary/request"
 	"github.com/gogf/gf/os/gtime"
 
-	internal2 "dashoo.cn/micro/app/model/work/internal"
+	 "dashoo.cn/micro/app/model/work/internal"
 )
 
 // WorkOrder is the golang structure for table work_order.
-type WorkOrder internal2.WorkOrder
+type WorkOrder internal.WorkOrder
 
 // Fill with you ideas below.
 

+ 1 - 0
opms_parent/config/config.toml

@@ -6,6 +6,7 @@
     need-advertise-addr = false
     srv-name = "dashoo.opms.parent-0.0.1"
     env = "dev"
+    swagger = true
 
 # 微服务注册中心配置
 [service_registry]

+ 2 - 2
opms_parent/swaggerui/index.html

@@ -57,7 +57,7 @@
           }
           console.log(req)
           // let serviceUrl = "http://192.168.0.105:9981/dashoo.dev.lims.micro_learning-1.0"
-          let serviceUrl = "http://192.168.0.252:8100/dashoo.dev.opms.parent-0.0.1"
+          let serviceUrl = "http://192.168.0.83:9981/dashoo.opms.parent-0.0.1"
           let reqUrl = new URL(req.url)
           let urlInfo = reqUrl.pathname.substring(1).split('.')
           if (urlInfo.length < 2) {
@@ -68,7 +68,7 @@
           let token = req.headers.Authorization
           if (!token) {
             // token = "Bearer ajg7o1Dts1JrKCm6VtgyuuaYbUIiirXxI5+6WzYnC7gWl+43NdKq6LbWxU1zWhsBaL0A/CIkBoefM0vuu6h4ZA=="
-            token = "Bearer 5a9R22RiKGsqBigUbLyd6xpdKYbMJdTw9Aowx8cmbm2qH1V5W3xxR4gNAic8PuG/"
+            token = "Bearer zJi/xqrZflnSrapwY+wSWPJ3eWbfKWl4YSeZAGpxTXQn+Q00mDJXwfBawghR97AM"
             // token = "Bearer EyQWHd05nop+PL71oABt/1i0zoXd7bym1bFMWMXorORLmyDuyowEDoiKq8DhP2lbZo9XTSMe31d0Q7RRnkDNLA=="
             // token = "Bearer 7XrzVhU+ibTV/77q7h0ETY+bEWy4r4g9wteUr/43vNadbuWG5y8wucSmeU0BRd/1"
           }