浏览代码

调整文件命名规范

wangxingcheng 3 年之前
父节点
当前提交
f943537897
共有 2 个文件被更改,包括 13 次插入18 次删除
  1. 13 15
      opms_parent/app/handler/base/distributor.go
  2. 0 3
      opms_parent/app/service/base/base_distributor.go

+ 13 - 15
opms_parent/app/handler/base/distributor.go

@@ -18,7 +18,7 @@ type DistributorHandler struct{}
 func (p *DistributorHandler) GetList(ctx context.Context, req *model.BaseDistributorSearchReq, rsp *comm_def.CommonMsg) error {
 	distributorServer, err := server.NewDistributorService(ctx)
 	if err != nil {
-		g.Log().Error(err)
+
 		return err
 	}
 	total, list, err := distributorServer.GetList(req)
@@ -31,7 +31,7 @@ func (p *DistributorHandler) GetList(ctx context.Context, req *model.BaseDistrib
 	return nil
 }
 
-// 创建
+//Create 创建
 func (p *DistributorHandler) Create(ctx context.Context, req *model.AddDistributor, rsp *comm_def.CommonMsg) error {
 
 	if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
@@ -39,19 +39,19 @@ func (p *DistributorHandler) Create(ctx context.Context, req *model.AddDistribut
 	}
 	distributorServer, err := server.NewDistributorService(ctx)
 	if err != nil {
-		g.Log().Error(err)
+
 		return err
 	}
 	distributorServer.Create(req)
 	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
 	if err != nil {
-		g.Log().Error(err)
+
 		return err
 	}
 	return nil
 }
 
-//详情
+//GetEntityById 详情
 func (p *DistributorHandler) GetEntityById(ctx context.Context, req *comm_def.IdReq, rsp *comm_def.CommonMsg) error {
 
 	if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
@@ -59,22 +59,20 @@ func (p *DistributorHandler) GetEntityById(ctx context.Context, req *comm_def.Id
 	}
 	distributorServer, err := server.NewDistributorService(ctx)
 	if err != nil {
-		g.Log().Error(err)
+
 		return err
 	}
 	list, err := distributorServer.GetEntityById(req.Id)
 	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
 	if err != nil {
-		g.Log().Error(err)
+
 		return err
 	}
 	rsp.Data = g.Map{"list": list}
 	return nil
 }
 
-//删掉
-
-// 编辑
+//UpdateById 编辑
 func (p *DistributorHandler) UpdateById(ctx context.Context, req *model.UpdateDistributorReq, rsp *comm_def.CommonMsg) error {
 
 	if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
@@ -82,27 +80,27 @@ func (p *DistributorHandler) UpdateById(ctx context.Context, req *model.UpdateDi
 	}
 	distributorServer, err := server.NewDistributorService(ctx)
 	if err != nil {
-		g.Log().Error(err)
+
 		return err
 	}
 	distributorServer.UpdateById(req)
 	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
 	if err != nil {
-		g.Log().Error(err)
+
 		return err
 	}
 	return nil
 }
 
-//删掉
+//DeleteByIds 删掉
 func (p *DistributorHandler) DeleteByIds(ctx context.Context, req *model.DeleteDistributorReq, rsp *comm_def.CommonMsg) error {
 	distributorServer, err := server.NewDistributorService(ctx)
 	if err != nil {
-		g.Log().Error(err)
+
 		return err
 	}
 	err = distributorServer.DeleteByIds(req.Ids)
-	g.Log().Info("req", req)
+
 	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
 	if err != nil {
 		g.Log().Error(err)

+ 0 - 3
opms_parent/app/service/base/base_distributor.go

@@ -6,7 +6,6 @@ import (
 	"strconv"
 
 	"dashoo.cn/opms_libary/myerrors"
-	"github.com/gogf/gf/errors/gerror"
 	"github.com/gogf/gf/frame/g"
 	"github.com/gogf/gf/os/gtime"
 	"github.com/gogf/gf/text/gstr"
@@ -52,11 +51,9 @@ func (s *distributorService) GetList(req *model.BaseDistributorSearchReq) (total
 	total, err = distributorModel.Count()
 	if err != nil {
 		g.Log().Error(err)
-		err = gerror.New("获取总行数失败")
 		return
 	}
 	err = distributorModel.Page(req.GetPage()).Order("id desc").Scan(&distributorList)
-	g.Log().Info("返回列表", distributorList)
 	return
 }