瀏覽代碼

修改方法名

wangchuanjin 2 年之前
父節點
當前提交
1de4f4f3e6

+ 2 - 2
middleground/entmanageapplication.go

@@ -22,7 +22,7 @@ func newEntManageApplication(hosts []string, key string) *entManageApplication {
 	}
 }
 
-func (e *entManageApplication) newClient() zrpc.Client {
+func (e *entManageApplication) NewClient() zrpc.Client {
 	client, err := zrpc.NewClient(zrpc.RpcClientConf{
 		Etcd: discov.EtcdConf{
 			Hosts: e.hosts,
@@ -38,7 +38,7 @@ func (e *entManageApplication) newClient() zrpc.Client {
 
 //
 func (e *entManageApplication) EmpowerUserIds(ids []int64) *pb.EmpowerUserIds {
-	client := e.newClient()
+	client := e.NewClient()
 	if client == nil {
 		return nil
 	}

+ 2 - 2
middleground/powercheckcenter.go

@@ -22,7 +22,7 @@ func newPowerCheckCenter(hosts []string, key string) *powerCheckCenter {
 	}
 }
 
-func (p *powerCheckCenter) newClient() zrpc.Client {
+func (p *powerCheckCenter) NewClient() zrpc.Client {
 	client, err := zrpc.NewClient(zrpc.RpcClientConf{
 		Etcd: discov.EtcdConf{
 			Hosts: p.hosts,
@@ -37,7 +37,7 @@ func (p *powerCheckCenter) newClient() zrpc.Client {
 }
 
 func (p *powerCheckCenter) Check(appid, userId string, baseUserId, accountId, entId, positionType, positionId int64) *pb.CheckResp {
-	client := p.newClient()
+	client := p.NewClient()
 	if client == nil {
 		return nil
 	}

+ 2 - 2
middleground/resourcecenter.go

@@ -22,7 +22,7 @@ func newResourceCenter(hosts []string, key string) *resourceCenter {
 	}
 }
 
-func (r *resourceCenter) newClient() zrpc.Client {
+func (r *resourceCenter) NewClient() zrpc.Client {
 	client, err := zrpc.NewClient(zrpc.RpcClientConf{
 		Etcd: discov.EtcdConf{
 			Hosts: r.hosts,
@@ -38,7 +38,7 @@ func (r *resourceCenter) newClient() zrpc.Client {
 
 //
 func (r *resourceCenter) Haspowers(accountId, entAccountId, entId, entUserId int64) *pb.HaspowersResp {
-	client := r.newClient()
+	client := r.NewClient()
 	if client == nil {
 		return nil
 	}

+ 8 - 8
middleground/usercenter.go

@@ -22,7 +22,7 @@ func newUserCenter(hosts []string, key string) *userCenter {
 	}
 }
 
-func (u *userCenter) newClient() zrpc.Client {
+func (u *userCenter) NewClient() zrpc.Client {
 	client, err := zrpc.NewClient(zrpc.RpcClientConf{
 		Etcd: discov.EtcdConf{
 			Hosts: u.hosts,
@@ -38,7 +38,7 @@ func (u *userCenter) newClient() zrpc.Client {
 
 //获取身份列表
 func (u *userCenter) IdentityList(userId int64) []*pb.Identity {
-	client := u.newClient()
+	client := u.NewClient()
 	if client == nil {
 		return nil
 	}
@@ -55,7 +55,7 @@ func (u *userCenter) IdentityList(userId int64) []*pb.Identity {
 
 //获取账号id获取个人身份信息
 func (u *userCenter) IdentityByUserId(userId int64) *pb.Identity {
-	client := u.newClient()
+	client := u.NewClient()
 	if client == nil {
 		return nil
 	}
@@ -72,7 +72,7 @@ func (u *userCenter) IdentityByUserId(userId int64) *pb.Identity {
 
 //根据职位id获取身份信息
 func (u *userCenter) IdentityByPositionId(positionId int64) *pb.Identity {
-	client := u.newClient()
+	client := u.NewClient()
 	if client == nil {
 		return nil
 	}
@@ -89,7 +89,7 @@ func (u *userCenter) IdentityByPositionId(positionId int64) *pb.Identity {
 
 //根据企业员工id获取身份信息
 func (u *userCenter) IdentityByEntUserId(entUserId int64) *pb.Identity {
-	client := u.newClient()
+	client := u.NewClient()
 	if client == nil {
 		return nil
 	}
@@ -106,7 +106,7 @@ func (u *userCenter) IdentityByEntUserId(entUserId int64) *pb.Identity {
 
 //添加用户
 func (u *userCenter) UserAdd(req pb.UserAddReq) *pb.UserAddResp {
-	client := u.newClient()
+	client := u.NewClient()
 	defer client.Conn().Close()
 	resp, err := usercenter.NewUserCenter(client).UserAdd(context.Background(), &pb.UserAddReq{
 		Appid:    req.Appid,
@@ -132,7 +132,7 @@ func (u *userCenter) UserAdd(req pb.UserAddReq) *pb.UserAddResp {
 
 //修改用户
 func (u *userCenter) UserUpdate(req pb.UserIdReq) *pb.ExamineResp {
-	client := u.newClient()
+	client := u.NewClient()
 	defer client.Conn().Close()
 	resp, err := usercenter.NewUserCenter(client).UserUpdate(context.Background(), &pb.UserIdReq{
 		Appid:    req.Appid,
@@ -156,7 +156,7 @@ func (u *userCenter) UserUpdate(req pb.UserIdReq) *pb.ExamineResp {
 
 //删除用户
 func (u *userCenter) UserDel(req pb.UserIdReq) *pb.ExamineResp {
-	client := u.newClient()
+	client := u.NewClient()
 	defer client.Conn().Close()
 	resp, err := usercenter.NewUserCenter(client).UserDel(context.Background(), &pb.UserIdReq{
 		Appid: req.Appid,