Browse Source

feat:企业列表、是否是管理员相关rpc

zhangxinlei1996 3 years ago
parent
commit
ba714ee655

+ 127 - 2
entity/entUser.go

@@ -1,13 +1,18 @@
 package entity
 
 import (
+	"encoding/json"
+	"fmt"
+
 	"app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/mysql"
+	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/usercenter"
 )
 
 type EntUserInfo struct {
 	AppId     string
 	EntUserId int64
+	EntId     int64
 	Mysql     *mysql.Mysql
 }
 type User struct {
@@ -15,13 +20,15 @@ type User struct {
 	Mail      string //邮箱
 	Phone     string //手机号
 	Dept_name string //部门名称
+	EntUserId int64
 }
 
 //获取员工信息
 func (this *EntUserInfo) GetEntUserInfo() (*User, string) {
-	data := this.Mysql.SelectBySql(`SELECT a.name,a.phone,a.mail,c.name AS dept_name FROM entniche_user a 
+	data := this.Mysql.SelectBySql(`SELECT a.name,a.phone,a.mail,c.name AS dept_name,a.id as entUserId FROM entniche_user a 
 		INNER JOIN entniche_department_user b ON (a.id=? AND a.id=b.user_id) 
-		INNER JOIN entniche_department c ON (b.dept_id=c.id)`, this.EntUserId)
+		INNER JOIN entniche_department c ON (b.dept_id=c.id)
+		WHERE a.ent_id=?`, this.EntUserId, this.EntId)
 	if data == nil || len(*data) == 0 {
 		return nil, "暂无数据"
 	}
@@ -29,3 +36,121 @@ func (this *EntUserInfo) GetEntUserInfo() (*User, string) {
 
 	return (*users)[0], ""
 }
+
+//1企业管理员 2部门管理员 3员工
+func (this *EntUserInfo) CheckEntAdmin() (int64, string) {
+	if count := this.Mysql.CountBySql(`select count(1) from entniche_user where id =? and ent_id =?`, this.EntUserId, this.EntId); count <= 0 {
+		return -1, "暂无数据"
+	}
+	if data := this.Mysql.SelectBySql(`select role_id from entniche_user_role where user_id =?`, this.EntUserId); data != nil && len(*data) > 0 {
+		rule := common.Int64All((*data)[0]["role_id"])
+		return rule, ""
+	}
+	return 3, ""
+}
+
+type EntUserList struct {
+	EntId  int64
+	DeptId int64
+	Name   string
+	Mysql  *mysql.Mysql
+}
+
+func (this *EntUserList) GetEntUserList() ([]*usercenter.EntUserListData, string) {
+	sql := `SELECT a.id,a.pid,a.name,c.id AS user_id,c.name AS user_name,c.mail AS user_mail, c.phone AS user_phone ,ed.name AS fdept FROM entniche_department a 
+			INNER JOIN entniche_department_user b ON (a.ent_id=? AND a.id=b.dept_id) 
+			INNER JOIN entniche_user c ON (b.user_id=c.id) 
+			LEFT JOIN entniche_department ed ON (a.pid=ed.id)`
+	if this.Name != "" {
+		sql += `where c.name like "%` + this.Name + `%"`
+	}
+	sql += `ORDER BY a.id,CONVERT(c.name USING gbk) COLLATE gbk_chinese_ci ASC`
+	data := this.Mysql.SelectBySql(sql, this.EntId)
+	listMap := map[int64][]*usercenter.EntUser{}
+	if data != nil {
+		for _, v := range *data {
+			id := common.Int64All(v["id"])
+			listMap[id] = append(listMap[id], &usercenter.EntUser{
+				Name:      common.ObjToString(v["user_name"]),
+				Phone:     common.ObjToString(v["user_phone"]),
+				Mail:      common.ObjToString(v["user_mail"]),
+				DeptName:  common.ObjToString(v["name"]),
+				EntUserId: common.Int64All(v["user_id"]),
+			})
+		}
+	}
+	deptData := &[]map[string]interface{}{}
+	//获取部门层级关系
+	if this.DeptId > 0 {
+		deptData = this.Mysql.SelectBySql(`select a.id,a.name,a.pid from entniche_department a 
+							inner join entniche_department_parent b on (a.ent_id=? and b.pid=? and a.id =b.id)`, this.EntId, this.DeptId)
+	} else {
+		deptData = this.Mysql.SelectBySql(`select id,name,pid from entniche_department where ent_id=?`, this.EntId)
+	}
+	deptList := []*usercenter.EntUserListData{}
+	ret := []*usercenter.EntUserListData{}
+
+	if len(*deptData) > 0 {
+		for _, v := range *deptData {
+			deptList = append(deptList, &usercenter.EntUserListData{
+				DeptId:      common.Int64All(v["id"]),
+				Name:        common.ObjToString(v["name"]),
+				PId:         common.Int64All(v["pid"]),
+				EntUserList: listMap[common.Int64All(v["id"])],
+				DeptList:    []*usercenter.EntUserListData{},
+			})
+		}
+		//创建根
+		root := []*usercenter.EntUserListData{deptList[0]}
+		//获取根上部门
+		pdept := make([]*usercenter.EntUserListData, 0)
+		for i, _ := range deptList {
+			var a *usercenter.EntUserListData
+			a = deptList[i]
+			pdept = append(pdept, a)
+		}
+		//
+		for _, v := range root {
+			makeTree(pdept, v)
+			data, _ := json.Marshal(&v)
+			fmt.Println(string(data))
+			ret = append(ret, v)
+		}
+	}
+	if len(ret) == 0 {
+		return ret, "暂无数据"
+	}
+	return ret, ""
+}
+
+func has(v1 usercenter.EntUserListData, vs []*usercenter.EntUserListData) bool {
+	var has bool
+	has = false
+	for _, v2 := range vs {
+		v3 := *v2
+		if v1.PId == v3.DeptId {
+			has = true
+			break
+		}
+	}
+	return has
+}
+
+func makeTree(vs []*usercenter.EntUserListData, node *usercenter.EntUserListData) {
+	childs := findChild(node, vs)
+	for _, child := range childs {
+		node.DeptList = append(node.DeptList, child)
+		if has(*child, vs) {
+			makeTree(vs, child)
+		}
+	}
+}
+
+func findChild(v *usercenter.EntUserListData, vs []*usercenter.EntUserListData) (ret []*usercenter.EntUserListData) {
+	for _, v2 := range vs {
+		if v.DeptId == v2.PId {
+			ret = append(ret, v2)
+		}
+	}
+	return
+}

+ 40 - 0
rpc/internal/logic/checkisentadminlogic.go

@@ -0,0 +1,40 @@
+package logic
+
+import (
+	"context"
+	"fmt"
+
+	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type CheckIsEntAdminLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewCheckIsEntAdminLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CheckIsEntAdminLogic {
+	return &CheckIsEntAdminLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 查看员工是否是企业管理员
+func (l *CheckIsEntAdminLogic) CheckIsEntAdmin(in *pb.EntUserReq) (*pb.CheckIsEntAdminResp, error) {
+	// todo: add your logic here and delete this line
+	resp := &pb.CheckIsEntAdminResp{}
+	data, msg := Entservice.CheckEntUserAdmin(in)
+	if msg != "" {
+		l.Error(fmt.Sprintf("%+v", in), msg)
+		resp.ErrorMsg = msg
+		resp.ErrorCode = -1
+	} else {
+		resp.Status = data
+	}
+	return resp, nil
+}

+ 0 - 1
rpc/internal/logic/getentuserinfologic.go

@@ -3,7 +3,6 @@ package logic
 import (
 	"context"
 	"fmt"
-	"log"
 
 	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/internal/svc"
 	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"

+ 40 - 0
rpc/internal/logic/getentuserlistlogic.go

@@ -0,0 +1,40 @@
+package logic
+
+import (
+	"context"
+	"fmt"
+
+	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetEntUserListLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewGetEntUserListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetEntUserListLogic {
+	return &GetEntUserListLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 获取企业员工列表
+func (l *GetEntUserListLogic) GetEntUserList(in *pb.EntUserListReq) (*pb.EntUserListResp, error) {
+	// todo: add your logic here and delete this line
+	resp := &pb.EntUserListResp{}
+	data, msg := Entservice.GetEntUserList(in)
+	if msg != "" {
+		l.Error(fmt.Sprintf("%+v", in), msg)
+		resp.ErrorMsg = msg
+		resp.ErrorCode = -1
+	} else {
+		resp.Data = data
+	}
+	return resp, nil
+}

+ 12 - 0
rpc/internal/server/usercenterserver.go

@@ -87,3 +87,15 @@ func (s *UserCenterServer) GetEntUserInfo(ctx context.Context, in *pb.EntUserReq
 	l := logic.NewGetEntUserInfoLogic(ctx, s.svcCtx)
 	return l.GetEntUserInfo(in)
 }
+
+// 获取企业员工列表
+func (s *UserCenterServer) GetEntUserList(ctx context.Context, in *pb.EntUserListReq) (*pb.EntUserListResp, error) {
+	l := logic.NewGetEntUserListLogic(ctx, s.svcCtx)
+	return l.GetEntUserList(in)
+}
+
+// 查看员工是否是企业管理员
+func (s *UserCenterServer) CheckIsEntAdmin(ctx context.Context, in *pb.EntUserReq) (*pb.CheckIsEntAdminResp, error) {
+	l := logic.NewCheckIsEntAdminLogic(ctx, s.svcCtx)
+	return l.CheckIsEntAdmin(in)
+}

+ 489 - 97
rpc/pb/userCenter.pb.go

@@ -2216,6 +2216,7 @@ type EntUserReq struct {
 
 	AppId     string `protobuf:"bytes,1,opt,name=appId,proto3" json:"appId,omitempty"`
 	EntUserId int64  `protobuf:"varint,2,opt,name=entUserId,proto3" json:"entUserId,omitempty"`
+	EntId     int64  `protobuf:"varint,3,opt,name=entId,proto3" json:"entId,omitempty"`
 }
 
 func (x *EntUserReq) Reset() {
@@ -2264,6 +2265,13 @@ func (x *EntUserReq) GetEntUserId() int64 {
 	return 0
 }
 
+func (x *EntUserReq) GetEntId() int64 {
+	if x != nil {
+		return x.EntId
+	}
+	return 0
+}
+
 type EntUserResp struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -2332,10 +2340,11 @@ type EntUser struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	Name     string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`         //员工名册
-	Phone    string `protobuf:"bytes,2,opt,name=phone,proto3" json:"phone,omitempty"`       //员工手机号
-	Mail     string `protobuf:"bytes,3,opt,name=mail,proto3" json:"mail,omitempty"`         //邮箱
-	DeptName string `protobuf:"bytes,4,opt,name=deptName,proto3" json:"deptName,omitempty"` //部门名称
+	Name      string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`         //员工名册
+	Phone     string `protobuf:"bytes,2,opt,name=phone,proto3" json:"phone,omitempty"`       //员工手机号
+	Mail      string `protobuf:"bytes,3,opt,name=mail,proto3" json:"mail,omitempty"`         //邮箱
+	DeptName  string `protobuf:"bytes,4,opt,name=deptName,proto3" json:"deptName,omitempty"` //部门名称
+	EntUserId int64  `protobuf:"varint,5,opt,name=entUserId,proto3" json:"entUserId,omitempty"`
 }
 
 func (x *EntUser) Reset() {
@@ -2398,6 +2407,289 @@ func (x *EntUser) GetDeptName() string {
 	return ""
 }
 
+func (x *EntUser) GetEntUserId() int64 {
+	if x != nil {
+		return x.EntUserId
+	}
+	return 0
+}
+
+type EntUserListReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	AppId  string `protobuf:"bytes,1,opt,name=appId,proto3" json:"appId,omitempty"`
+	EntId  int64  `protobuf:"varint,2,opt,name=entId,proto3" json:"entId,omitempty"`
+	DeptId int64  `protobuf:"varint,3,opt,name=deptId,proto3" json:"deptId,omitempty"`
+	Name   string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
+}
+
+func (x *EntUserListReq) Reset() {
+	*x = EntUserListReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_userCenter_proto_msgTypes[30]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *EntUserListReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*EntUserListReq) ProtoMessage() {}
+
+func (x *EntUserListReq) ProtoReflect() protoreflect.Message {
+	mi := &file_userCenter_proto_msgTypes[30]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use EntUserListReq.ProtoReflect.Descriptor instead.
+func (*EntUserListReq) Descriptor() ([]byte, []int) {
+	return file_userCenter_proto_rawDescGZIP(), []int{30}
+}
+
+func (x *EntUserListReq) GetAppId() string {
+	if x != nil {
+		return x.AppId
+	}
+	return ""
+}
+
+func (x *EntUserListReq) GetEntId() int64 {
+	if x != nil {
+		return x.EntId
+	}
+	return 0
+}
+
+func (x *EntUserListReq) GetDeptId() int64 {
+	if x != nil {
+		return x.DeptId
+	}
+	return 0
+}
+
+func (x *EntUserListReq) GetName() string {
+	if x != nil {
+		return x.Name
+	}
+	return ""
+}
+
+type EntUserListResp struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	ErrorCode int64              `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"`
+	ErrorMsg  string             `protobuf:"bytes,2,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"`
+	Data      []*EntUserListData `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"`
+}
+
+func (x *EntUserListResp) Reset() {
+	*x = EntUserListResp{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_userCenter_proto_msgTypes[31]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *EntUserListResp) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*EntUserListResp) ProtoMessage() {}
+
+func (x *EntUserListResp) ProtoReflect() protoreflect.Message {
+	mi := &file_userCenter_proto_msgTypes[31]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use EntUserListResp.ProtoReflect.Descriptor instead.
+func (*EntUserListResp) Descriptor() ([]byte, []int) {
+	return file_userCenter_proto_rawDescGZIP(), []int{31}
+}
+
+func (x *EntUserListResp) GetErrorCode() int64 {
+	if x != nil {
+		return x.ErrorCode
+	}
+	return 0
+}
+
+func (x *EntUserListResp) GetErrorMsg() string {
+	if x != nil {
+		return x.ErrorMsg
+	}
+	return ""
+}
+
+func (x *EntUserListResp) GetData() []*EntUserListData {
+	if x != nil {
+		return x.Data
+	}
+	return nil
+}
+
+type EntUserListData struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Name        string             `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+	DeptId      int64              `protobuf:"varint,2,opt,name=deptId,proto3" json:"deptId,omitempty"`
+	PId         int64              `protobuf:"varint,3,opt,name=pId,proto3" json:"pId,omitempty"`
+	EntUserList []*EntUser         `protobuf:"bytes,4,rep,name=entUserList,proto3" json:"entUserList,omitempty"`
+	DeptList    []*EntUserListData `protobuf:"bytes,5,rep,name=deptList,proto3" json:"deptList,omitempty"`
+}
+
+func (x *EntUserListData) Reset() {
+	*x = EntUserListData{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_userCenter_proto_msgTypes[32]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *EntUserListData) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*EntUserListData) ProtoMessage() {}
+
+func (x *EntUserListData) ProtoReflect() protoreflect.Message {
+	mi := &file_userCenter_proto_msgTypes[32]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use EntUserListData.ProtoReflect.Descriptor instead.
+func (*EntUserListData) Descriptor() ([]byte, []int) {
+	return file_userCenter_proto_rawDescGZIP(), []int{32}
+}
+
+func (x *EntUserListData) GetName() string {
+	if x != nil {
+		return x.Name
+	}
+	return ""
+}
+
+func (x *EntUserListData) GetDeptId() int64 {
+	if x != nil {
+		return x.DeptId
+	}
+	return 0
+}
+
+func (x *EntUserListData) GetPId() int64 {
+	if x != nil {
+		return x.PId
+	}
+	return 0
+}
+
+func (x *EntUserListData) GetEntUserList() []*EntUser {
+	if x != nil {
+		return x.EntUserList
+	}
+	return nil
+}
+
+func (x *EntUserListData) GetDeptList() []*EntUserListData {
+	if x != nil {
+		return x.DeptList
+	}
+	return nil
+}
+
+type CheckIsEntAdminResp struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	ErrorCode int64  `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"`
+	ErrorMsg  string `protobuf:"bytes,2,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"`
+	Status    int64  `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` //1企业管理员 2部门管理员 3员工
+}
+
+func (x *CheckIsEntAdminResp) Reset() {
+	*x = CheckIsEntAdminResp{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_userCenter_proto_msgTypes[33]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *CheckIsEntAdminResp) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CheckIsEntAdminResp) ProtoMessage() {}
+
+func (x *CheckIsEntAdminResp) ProtoReflect() protoreflect.Message {
+	mi := &file_userCenter_proto_msgTypes[33]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use CheckIsEntAdminResp.ProtoReflect.Descriptor instead.
+func (*CheckIsEntAdminResp) Descriptor() ([]byte, []int) {
+	return file_userCenter_proto_rawDescGZIP(), []int{33}
+}
+
+func (x *CheckIsEntAdminResp) GetErrorCode() int64 {
+	if x != nil {
+		return x.ErrorCode
+	}
+	return 0
+}
+
+func (x *CheckIsEntAdminResp) GetErrorMsg() string {
+	if x != nil {
+		return x.ErrorMsg
+	}
+	return ""
+}
+
+func (x *CheckIsEntAdminResp) GetStatus() int64 {
+	if x != nil {
+		return x.Status
+	}
+	return 0
+}
+
 type ExamineResp_ExamineData struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -2409,7 +2701,7 @@ type ExamineResp_ExamineData struct {
 func (x *ExamineResp_ExamineData) Reset() {
 	*x = ExamineResp_ExamineData{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_userCenter_proto_msgTypes[30]
+		mi := &file_userCenter_proto_msgTypes[34]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -2422,7 +2714,7 @@ func (x *ExamineResp_ExamineData) String() string {
 func (*ExamineResp_ExamineData) ProtoMessage() {}
 
 func (x *ExamineResp_ExamineData) ProtoReflect() protoreflect.Message {
-	mi := &file_userCenter_proto_msgTypes[30]
+	mi := &file_userCenter_proto_msgTypes[34]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -2457,7 +2749,7 @@ type CheckEntRespCheckData struct {
 func (x *CheckEntRespCheckData) Reset() {
 	*x = CheckEntRespCheckData{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_userCenter_proto_msgTypes[31]
+		mi := &file_userCenter_proto_msgTypes[35]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -2470,7 +2762,7 @@ func (x *CheckEntRespCheckData) String() string {
 func (*CheckEntRespCheckData) ProtoMessage() {}
 
 func (x *CheckEntRespCheckData) ProtoReflect() protoreflect.Message {
-	mi := &file_userCenter_proto_msgTypes[31]
+	mi := &file_userCenter_proto_msgTypes[35]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -2512,7 +2804,7 @@ type GetStatusByCodeResp_GetStatusByCode struct {
 func (x *GetStatusByCodeResp_GetStatusByCode) Reset() {
 	*x = GetStatusByCodeResp_GetStatusByCode{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_userCenter_proto_msgTypes[32]
+		mi := &file_userCenter_proto_msgTypes[36]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -2525,7 +2817,7 @@ func (x *GetStatusByCodeResp_GetStatusByCode) String() string {
 func (*GetStatusByCodeResp_GetStatusByCode) ProtoMessage() {}
 
 func (x *GetStatusByCodeResp_GetStatusByCode) ProtoReflect() protoreflect.Message {
-	mi := &file_userCenter_proto_msgTypes[32]
+	mi := &file_userCenter_proto_msgTypes[36]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -2864,56 +3156,97 @@ var file_userCenter_proto_rawDesc = []byte{
 	0x70, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01,
 	0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x74,
 	0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x6e,
-	0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x40, 0x0a, 0x0a, 0x45, 0x6e, 0x74, 0x55, 0x73,
+	0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x56, 0x0a, 0x0a, 0x45, 0x6e, 0x74, 0x55, 0x73,
 	0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x01,
 	0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x65,
 	0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09,
-	0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x67, 0x0a, 0x0b, 0x45, 0x6e, 0x74,
-	0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f,
-	0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x72,
-	0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72,
-	0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f,
-	0x72, 0x4d, 0x73, 0x67, 0x12, 0x1c, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01,
-	0x28, 0x0b, 0x32, 0x08, 0x2e, 0x45, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x64, 0x61,
-	0x74, 0x61, 0x22, 0x63, 0x0a, 0x07, 0x45, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x12, 0x0a,
-	0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d,
-	0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x69, 0x6c, 0x18,
-	0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x64,
-	0x65, 0x70, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64,
-	0x65, 0x70, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x32, 0xeb, 0x03, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72,
-	0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x07, 0x45, 0x6e, 0x74, 0x41, 0x75, 0x74,
-	0x68, 0x12, 0x0b, 0x2e, 0x45, 0x6e, 0x74, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x0c,
-	0x2e, 0x45, 0x6e, 0x74, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x0a,
-	0x45, 0x6e, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x12, 0x0b, 0x2e, 0x45, 0x78, 0x61,
-	0x6d, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e,
-	0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, 0x07, 0x45, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74,
-	0x12, 0x0b, 0x2e, 0x45, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e,
-	0x45, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0b, 0x45,
-	0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0f, 0x2e, 0x45, 0x78, 0x61,
-	0x6d, 0x69, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x45, 0x78,
-	0x61, 0x6d, 0x69, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a,
-	0x08, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x45, 0x6e, 0x74, 0x12, 0x0c, 0x2e, 0x43, 0x68, 0x65, 0x63,
-	0x6b, 0x45, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x45,
-	0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x07, 0x45, 0x6e, 0x74, 0x49, 0x6e, 0x66,
-	0x6f, 0x12, 0x0c, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x45, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a,
-	0x0c, 0x2e, 0x45, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x28, 0x0a,
-	0x09, 0x45, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x0d, 0x2e, 0x45, 0x6e, 0x74,
-	0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x78, 0x61, 0x6d,
-	0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x0b, 0x45, 0x78, 0x61, 0x6d, 0x69,
-	0x6e, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x45, 0x78,
-	0x61, 0x6d, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x6e, 0x74, 0x49, 0x6e,
-	0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61,
-	0x74, 0x75, 0x73, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x13, 0x2e, 0x47, 0x65, 0x74, 0x53,
-	0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x14,
-	0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65,
-	0x52, 0x65, 0x73, 0x70, 0x12, 0x22, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49,
-	0x6e, 0x66, 0x6f, 0x12, 0x08, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x09, 0x2e,
-	0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2b, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x45,
-	0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0b, 0x2e, 0x45, 0x6e, 0x74,
-	0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x6e, 0x74, 0x55, 0x73, 0x65,
-	0x72, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70,
-	0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6e, 0x74,
+	0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22,
+	0x67, 0x0a, 0x0b, 0x45, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d,
+	0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a,
+	0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x1c, 0x0a, 0x04, 0x64, 0x61,
+	0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x45, 0x6e, 0x74, 0x55, 0x73,
+	0x65, 0x72, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x81, 0x01, 0x0a, 0x07, 0x45, 0x6e, 0x74,
+	0x55, 0x73, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e,
+	0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x12,
+	0x0a, 0x04, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61,
+	0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x70, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c,
+	0x0a, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x68, 0x0a, 0x0e,
+	0x45, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14,
+	0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61,
+	0x70, 0x70, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65,
+	0x70, 0x74, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x64, 0x65, 0x70, 0x74,
+	0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x73, 0x0a, 0x0f, 0x45, 0x6e, 0x74, 0x55, 0x73, 0x65,
+	0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72,
+	0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65,
+	0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f,
+	0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72,
+	0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x24, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20,
+	0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x45, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73,
+	0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xa9, 0x01, 0x0a, 0x0f,
+	0x45, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12,
+	0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
+	0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x70, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x06, 0x64, 0x65, 0x70, 0x74, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x70,
+	0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x70, 0x49, 0x64, 0x12, 0x2a, 0x0a,
+	0x0b, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03,
+	0x28, 0x0b, 0x32, 0x08, 0x2e, 0x45, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x0b, 0x65, 0x6e,
+	0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x08, 0x64, 0x65, 0x70,
+	0x74, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x45, 0x6e,
+	0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x64,
+	0x65, 0x70, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x69, 0x0a, 0x13, 0x43, 0x68, 0x65, 0x63, 0x6b,
+	0x49, 0x73, 0x45, 0x6e, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d,
+	0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a,
+	0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74,
+	0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74,
+	0x75, 0x73, 0x32, 0xd6, 0x04, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x43, 0x65, 0x6e, 0x74, 0x65,
+	0x72, 0x12, 0x24, 0x0a, 0x07, 0x45, 0x6e, 0x74, 0x41, 0x75, 0x74, 0x68, 0x12, 0x0b, 0x2e, 0x45,
+	0x6e, 0x74, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x6e, 0x74, 0x41,
+	0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x0a, 0x45, 0x6e, 0x74, 0x45, 0x78,
+	0x61, 0x6d, 0x69, 0x6e, 0x65, 0x12, 0x0b, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x52,
+	0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70,
+	0x12, 0x24, 0x0a, 0x07, 0x45, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0b, 0x2e, 0x45, 0x6e,
+	0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x6e, 0x74, 0x4c, 0x69,
+	0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0b, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e,
+	0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0f, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x4c,
+	0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65,
+	0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x08, 0x43, 0x68, 0x65, 0x63,
+	0x6b, 0x45, 0x6e, 0x74, 0x12, 0x0c, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x45, 0x6e, 0x74, 0x52,
+	0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x45, 0x6e, 0x74, 0x52, 0x65, 0x73,
+	0x70, 0x12, 0x25, 0x0a, 0x07, 0x45, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0c, 0x2e, 0x43,
+	0x68, 0x65, 0x63, 0x6b, 0x45, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x6e, 0x74,
+	0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x28, 0x0a, 0x09, 0x45, 0x6e, 0x74, 0x55,
+	0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x0d, 0x2e, 0x45, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74,
+	0x65, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x52, 0x65,
+	0x73, 0x70, 0x12, 0x2d, 0x0a, 0x0b, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x49, 0x6e, 0x66,
+	0x6f, 0x12, 0x10, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65,
+	0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73,
+	0x70, 0x12, 0x3c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x79,
+	0x43, 0x6f, 0x64, 0x65, 0x12, 0x13, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
+	0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x47, 0x65, 0x74, 0x53,
+	0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12,
+	0x22, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x08,
+	0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x09, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49,
+	0x6e, 0x66, 0x6f, 0x12, 0x2b, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x55, 0x73, 0x65,
+	0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0b, 0x2e, 0x45, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52,
+	0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70,
+	0x12, 0x33, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69,
+	0x73, 0x74, 0x12, 0x0f, 0x2e, 0x45, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74,
+	0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x45, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73,
+	0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x34, 0x0a, 0x0f, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x73,
+	0x45, 0x6e, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x0b, 0x2e, 0x45, 0x6e, 0x74, 0x55, 0x73,
+	0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x73, 0x45,
+	0x6e, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e,
+	0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -2928,7 +3261,7 @@ func file_userCenter_proto_rawDescGZIP() []byte {
 	return file_userCenter_proto_rawDescData
 }
 
-var file_userCenter_proto_msgTypes = make([]protoimpl.MessageInfo, 34)
+var file_userCenter_proto_msgTypes = make([]protoimpl.MessageInfo, 38)
 var file_userCenter_proto_goTypes = []interface{}{
 	(*EntAuthReq)(nil),                          // 0: EntAuthReq
 	(*EntAuthResp)(nil),                         // 1: EntAuthResp
@@ -2960,54 +3293,65 @@ var file_userCenter_proto_goTypes = []interface{}{
 	(*EntUserReq)(nil),                          // 27: EntUserReq
 	(*EntUserResp)(nil),                         // 28: EntUserResp
 	(*EntUser)(nil),                             // 29: EntUser
-	(*ExamineResp_ExamineData)(nil),             // 30: ExamineResp.ExamineData
-	(*CheckEntRespCheckData)(nil),               // 31: CheckEntResp.checkData
-	(*GetStatusByCodeResp_GetStatusByCode)(nil), // 32: GetStatusByCodeResp.GetStatusByCode
-	nil, // 33: Subscribe.AreaEntry
+	(*EntUserListReq)(nil),                      // 30: EntUserListReq
+	(*EntUserListResp)(nil),                     // 31: EntUserListResp
+	(*EntUserListData)(nil),                     // 32: EntUserListData
+	(*CheckIsEntAdminResp)(nil),                 // 33: CheckIsEntAdminResp
+	(*ExamineResp_ExamineData)(nil),             // 34: ExamineResp.ExamineData
+	(*CheckEntRespCheckData)(nil),               // 35: CheckEntResp.checkData
+	(*GetStatusByCodeResp_GetStatusByCode)(nil), // 36: GetStatusByCodeResp.GetStatusByCode
+	nil, // 37: Subscribe.AreaEntry
 }
 var file_userCenter_proto_depIdxs = []int32{
 	2,  // 0: EntAuthResp.data:type_name -> EntAuthData
-	30, // 1: ExamineResp.data:type_name -> ExamineResp.ExamineData
+	34, // 1: ExamineResp.data:type_name -> ExamineResp.ExamineData
 	7,  // 2: EntListResp.data:type_name -> EntData
 	8,  // 3: EntData.list:type_name -> EntList
 	11, // 4: ExamineListResp.data:type_name -> ExamineListData
 	12, // 5: ExamineListData.list:type_name -> ExamineList
-	31, // 6: CheckEntResp.data:type_name -> CheckEntResp.checkData
+	35, // 6: CheckEntResp.data:type_name -> CheckEntResp.checkData
 	16, // 7: EntInfoResp.data:type_name -> EntInfoData
-	32, // 8: GetStatusByCodeResp.data:type_name -> GetStatusByCodeResp.GetStatusByCode
+	36, // 8: GetStatusByCodeResp.data:type_name -> GetStatusByCodeResp.GetStatusByCode
 	22, // 9: UserInfo.data:type_name -> Subscribe
-	33, // 10: Subscribe.area:type_name -> Subscribe.AreaEntry
+	37, // 10: Subscribe.area:type_name -> Subscribe.AreaEntry
 	24, // 11: Subscribe.items:type_name -> Items
 	25, // 12: Items.a_key:type_name -> Keys
 	29, // 13: EntUserResp.data:type_name -> EntUser
-	23, // 14: Subscribe.AreaEntry.value:type_name -> List
-	0,  // 15: UserCenter.EntAuth:input_type -> EntAuthReq
-	3,  // 16: UserCenter.EntExamine:input_type -> ExamineReq
-	5,  // 17: UserCenter.EntList:input_type -> EntListReq
-	9,  // 18: UserCenter.ExamineList:input_type -> ExamineListReq
-	13, // 19: UserCenter.CheckEnt:input_type -> CheckEntReq
-	13, // 20: UserCenter.EntInfo:input_type -> CheckEntReq
-	17, // 21: UserCenter.EntUpdate:input_type -> EntUpdateReq
-	18, // 22: UserCenter.ExamineInfo:input_type -> CheckExamineReq
-	19, // 23: UserCenter.GetStatusByCode:input_type -> GetStatusByCodeReq
-	26, // 24: UserCenter.GetUserInfo:input_type -> UserReq
-	27, // 25: UserCenter.GetEntUserInfo:input_type -> EntUserReq
-	1,  // 26: UserCenter.EntAuth:output_type -> EntAuthResp
-	4,  // 27: UserCenter.EntExamine:output_type -> ExamineResp
-	6,  // 28: UserCenter.EntList:output_type -> EntListResp
-	10, // 29: UserCenter.ExamineList:output_type -> ExamineListResp
-	14, // 30: UserCenter.CheckEnt:output_type -> CheckEntResp
-	15, // 31: UserCenter.EntInfo:output_type -> EntInfoResp
-	4,  // 32: UserCenter.EntUpdate:output_type -> ExamineResp
-	15, // 33: UserCenter.ExamineInfo:output_type -> EntInfoResp
-	20, // 34: UserCenter.GetStatusByCode:output_type -> GetStatusByCodeResp
-	21, // 35: UserCenter.GetUserInfo:output_type -> UserInfo
-	28, // 36: UserCenter.GetEntUserInfo:output_type -> EntUserResp
-	26, // [26:37] is the sub-list for method output_type
-	15, // [15:26] is the sub-list for method input_type
-	15, // [15:15] is the sub-list for extension type_name
-	15, // [15:15] is the sub-list for extension extendee
-	0,  // [0:15] is the sub-list for field type_name
+	32, // 14: EntUserListResp.data:type_name -> EntUserListData
+	29, // 15: EntUserListData.entUserList:type_name -> EntUser
+	32, // 16: EntUserListData.deptList:type_name -> EntUserListData
+	23, // 17: Subscribe.AreaEntry.value:type_name -> List
+	0,  // 18: UserCenter.EntAuth:input_type -> EntAuthReq
+	3,  // 19: UserCenter.EntExamine:input_type -> ExamineReq
+	5,  // 20: UserCenter.EntList:input_type -> EntListReq
+	9,  // 21: UserCenter.ExamineList:input_type -> ExamineListReq
+	13, // 22: UserCenter.CheckEnt:input_type -> CheckEntReq
+	13, // 23: UserCenter.EntInfo:input_type -> CheckEntReq
+	17, // 24: UserCenter.EntUpdate:input_type -> EntUpdateReq
+	18, // 25: UserCenter.ExamineInfo:input_type -> CheckExamineReq
+	19, // 26: UserCenter.GetStatusByCode:input_type -> GetStatusByCodeReq
+	26, // 27: UserCenter.GetUserInfo:input_type -> UserReq
+	27, // 28: UserCenter.GetEntUserInfo:input_type -> EntUserReq
+	30, // 29: UserCenter.GetEntUserList:input_type -> EntUserListReq
+	27, // 30: UserCenter.CheckIsEntAdmin:input_type -> EntUserReq
+	1,  // 31: UserCenter.EntAuth:output_type -> EntAuthResp
+	4,  // 32: UserCenter.EntExamine:output_type -> ExamineResp
+	6,  // 33: UserCenter.EntList:output_type -> EntListResp
+	10, // 34: UserCenter.ExamineList:output_type -> ExamineListResp
+	14, // 35: UserCenter.CheckEnt:output_type -> CheckEntResp
+	15, // 36: UserCenter.EntInfo:output_type -> EntInfoResp
+	4,  // 37: UserCenter.EntUpdate:output_type -> ExamineResp
+	15, // 38: UserCenter.ExamineInfo:output_type -> EntInfoResp
+	20, // 39: UserCenter.GetStatusByCode:output_type -> GetStatusByCodeResp
+	21, // 40: UserCenter.GetUserInfo:output_type -> UserInfo
+	28, // 41: UserCenter.GetEntUserInfo:output_type -> EntUserResp
+	31, // 42: UserCenter.GetEntUserList:output_type -> EntUserListResp
+	33, // 43: UserCenter.CheckIsEntAdmin:output_type -> CheckIsEntAdminResp
+	31, // [31:44] is the sub-list for method output_type
+	18, // [18:31] is the sub-list for method input_type
+	18, // [18:18] is the sub-list for extension type_name
+	18, // [18:18] is the sub-list for extension extendee
+	0,  // [0:18] is the sub-list for field type_name
 }
 
 func init() { file_userCenter_proto_init() }
@@ -3377,7 +3721,7 @@ func file_userCenter_proto_init() {
 			}
 		}
 		file_userCenter_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*ExamineResp_ExamineData); i {
+			switch v := v.(*EntUserListReq); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -3389,7 +3733,7 @@ func file_userCenter_proto_init() {
 			}
 		}
 		file_userCenter_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*CheckEntRespCheckData); i {
+			switch v := v.(*EntUserListResp); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -3401,6 +3745,54 @@ func file_userCenter_proto_init() {
 			}
 		}
 		file_userCenter_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*EntUserListData); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_userCenter_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*CheckIsEntAdminResp); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_userCenter_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*ExamineResp_ExamineData); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_userCenter_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*CheckEntRespCheckData); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_userCenter_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*GetStatusByCodeResp_GetStatusByCode); i {
 			case 0:
 				return &v.state
@@ -3419,7 +3811,7 @@ func file_userCenter_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_userCenter_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   34,
+			NumMessages:   38,
 			NumExtensions: 0,
 			NumServices:   1,
 		},

+ 76 - 0
rpc/pb/userCenter_grpc.pb.go

@@ -44,6 +44,10 @@ type UserCenterClient interface {
 	GetUserInfo(ctx context.Context, in *UserReq, opts ...grpc.CallOption) (*UserInfo, error)
 	//根据企业员工id获取员工的信息
 	GetEntUserInfo(ctx context.Context, in *EntUserReq, opts ...grpc.CallOption) (*EntUserResp, error)
+	//获取企业员工列表
+	GetEntUserList(ctx context.Context, in *EntUserListReq, opts ...grpc.CallOption) (*EntUserListResp, error)
+	//查看员工是否是企业管理员
+	CheckIsEntAdmin(ctx context.Context, in *EntUserReq, opts ...grpc.CallOption) (*CheckIsEntAdminResp, error)
 }
 
 type userCenterClient struct {
@@ -153,6 +157,24 @@ func (c *userCenterClient) GetEntUserInfo(ctx context.Context, in *EntUserReq, o
 	return out, nil
 }
 
+func (c *userCenterClient) GetEntUserList(ctx context.Context, in *EntUserListReq, opts ...grpc.CallOption) (*EntUserListResp, error) {
+	out := new(EntUserListResp)
+	err := c.cc.Invoke(ctx, "/UserCenter/GetEntUserList", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *userCenterClient) CheckIsEntAdmin(ctx context.Context, in *EntUserReq, opts ...grpc.CallOption) (*CheckIsEntAdminResp, error) {
+	out := new(CheckIsEntAdminResp)
+	err := c.cc.Invoke(ctx, "/UserCenter/CheckIsEntAdmin", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // UserCenterServer is the server API for UserCenter service.
 // All implementations must embed UnimplementedUserCenterServer
 // for forward compatibility
@@ -179,6 +201,10 @@ type UserCenterServer interface {
 	GetUserInfo(context.Context, *UserReq) (*UserInfo, error)
 	//根据企业员工id获取员工的信息
 	GetEntUserInfo(context.Context, *EntUserReq) (*EntUserResp, error)
+	//获取企业员工列表
+	GetEntUserList(context.Context, *EntUserListReq) (*EntUserListResp, error)
+	//查看员工是否是企业管理员
+	CheckIsEntAdmin(context.Context, *EntUserReq) (*CheckIsEntAdminResp, error)
 	mustEmbedUnimplementedUserCenterServer()
 }
 
@@ -219,6 +245,12 @@ func (UnimplementedUserCenterServer) GetUserInfo(context.Context, *UserReq) (*Us
 func (UnimplementedUserCenterServer) GetEntUserInfo(context.Context, *EntUserReq) (*EntUserResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method GetEntUserInfo not implemented")
 }
+func (UnimplementedUserCenterServer) GetEntUserList(context.Context, *EntUserListReq) (*EntUserListResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetEntUserList not implemented")
+}
+func (UnimplementedUserCenterServer) CheckIsEntAdmin(context.Context, *EntUserReq) (*CheckIsEntAdminResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method CheckIsEntAdmin not implemented")
+}
 func (UnimplementedUserCenterServer) mustEmbedUnimplementedUserCenterServer() {}
 
 // UnsafeUserCenterServer may be embedded to opt out of forward compatibility for this service.
@@ -430,6 +462,42 @@ func _UserCenter_GetEntUserInfo_Handler(srv interface{}, ctx context.Context, de
 	return interceptor(ctx, in, info, handler)
 }
 
+func _UserCenter_GetEntUserList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(EntUserListReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(UserCenterServer).GetEntUserList(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/UserCenter/GetEntUserList",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(UserCenterServer).GetEntUserList(ctx, req.(*EntUserListReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _UserCenter_CheckIsEntAdmin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(EntUserReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(UserCenterServer).CheckIsEntAdmin(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/UserCenter/CheckIsEntAdmin",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(UserCenterServer).CheckIsEntAdmin(ctx, req.(*EntUserReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 // UserCenter_ServiceDesc is the grpc.ServiceDesc for UserCenter service.
 // It's only intended for direct use with grpc.RegisterService,
 // and not to be introspected or modified (even as a copy)
@@ -481,6 +549,14 @@ var UserCenter_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "GetEntUserInfo",
 			Handler:    _UserCenter_GetEntUserInfo_Handler,
 		},
+		{
+			MethodName: "GetEntUserList",
+			Handler:    _UserCenter_GetEntUserList_Handler,
+		},
+		{
+			MethodName: "CheckIsEntAdmin",
+			Handler:    _UserCenter_CheckIsEntAdmin_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "userCenter.proto",

+ 39 - 0
rpc/test/ent_test.go

@@ -217,14 +217,53 @@ func Test_UserInfo(t *testing.T) {
 }
 
 // go test -v -run Test_EntUserInfo
+//获取用户企业信息
 func Test_EntUserInfo(t *testing.T) {
 	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
 	FileSystem := usercenterclient.NewUserCenter(zrpc.MustNewClient(c.FileSystemConf))
 	req := &pb.EntUserReq{
 		EntUserId: 4254,
+		AppId:     "10000",
+		EntId:     14904,
 	}
 
 	res, err := FileSystem.GetEntUserInfo(ctx, req)
+
+	log.Println("res:", res)
 	log.Println("err ", err)
+}
+
+// go test -v -run Test_EntUserList
+//获取企业列表/员工列表
+func Test_EntUserList(t *testing.T) {
+	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
+	FileSystem := usercenterclient.NewUserCenter(zrpc.MustNewClient(c.FileSystemConf))
+	req := &pb.EntUserListReq{
+		EntId: 149041,
+		AppId: "10000",
+		// DeptId: 3821,  //非必填
+		// Name: "后端",//非必填
+	}
+
+	res, err := FileSystem.GetEntUserList(ctx, req)
+
 	log.Println("res:", res)
+	log.Println("err ", err)
+}
+
+// go test -v -run Test_CheckIsEntAdmin
+//查看用户是否是管理员 1-企业管理员 2-部门管理员 3-员工
+func Test_CheckIsEntAdmin(t *testing.T) {
+	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
+	FileSystem := usercenterclient.NewUserCenter(zrpc.MustNewClient(c.FileSystemConf))
+	req := &pb.EntUserReq{
+		EntUserId: 4254,
+		AppId:     "10000",
+		EntId:     14904,
+	}
+
+	res, err := FileSystem.CheckIsEntAdmin(ctx, req)
+
+	log.Println("res:", res)
+	log.Println("err ", err)
 }

+ 2 - 2
rpc/test/usercenter.yaml

@@ -11,13 +11,13 @@ Redis:
   idleTimeOut: 240
 Etcd:
   Hosts:
-  - 127.0.0.1:2379
+  - 192.168.3.240:2379
   Key: usercenter.rpc
 DataSource: root:Topnet123@tcp(192.168.3.11:3366)/jianyu?charset=utf8mb4&parseTime=true&loc=Local
 FileSystemConf:
   Etcd:
     Hosts:
-      - 127.0.0.1:2379
+      - 192.168.3.240:2379
     Key: usercenter.rpc
 CalleeId: usercenter.rpc
 Node: 1

+ 33 - 0
rpc/userCenter.proto

@@ -254,6 +254,7 @@ message UserReq{
 message EntUserReq{
 	string appId =1;
 	int64 entUserId =2;
+	int64 entId=3;
 }
 
 message EntUserResp{
@@ -267,6 +268,34 @@ message EntUser{
 	string phone =2;//员工手机号
 	string mail =3;//邮箱
 	string deptName =4;//部门名称
+	int64 entUserId=5;
+}
+
+message EntUserListReq{
+	string appId =1;
+	int64 entId=2;
+	int64 deptId=3;
+	string name=4;
+}
+
+message EntUserListResp{
+	int64 error_code = 1;
+	string error_msg = 2;
+	repeated EntUserListData data=3;
+}
+
+message EntUserListData{
+	string name =1;
+	int64 deptId=2;
+	int64 pId=3;
+	repeated EntUser entUserList=4;
+	repeated EntUserListData deptList=5;
+}
+
+message CheckIsEntAdminResp{
+	int64 error_code = 1;
+	string error_msg = 2;
+	int64 status=3; //1企业管理员 2部门管理员 3员工 
 }
 
 service UserCenter {
@@ -292,4 +321,8 @@ service UserCenter {
 	rpc GetUserInfo(UserReq) returns(UserInfo);
 	//根据企业员工id获取员工的信息
 	rpc GetEntUserInfo(EntUserReq) returns(EntUserResp);
+	//获取企业员工列表
+	rpc GetEntUserList (EntUserListReq) returns(EntUserListResp);
+	//查看员工是否是企业管理员
+	rpc CheckIsEntAdmin(EntUserReq)returns(CheckIsEntAdminResp);
 }

+ 20 - 0
rpc/usercenter/usercenter.go

@@ -17,6 +17,7 @@ type (
 	CheckEntResp                        = pb.CheckEntResp
 	CheckEntRespCheckData               = pb.CheckEntRespCheckData
 	CheckExamineReq                     = pb.CheckExamineReq
+	CheckIsEntAdminResp                 = pb.CheckIsEntAdminResp
 	EntAuthData                         = pb.EntAuthData
 	EntAuthReq                          = pb.EntAuthReq
 	EntAuthResp                         = pb.EntAuthResp
@@ -28,6 +29,9 @@ type (
 	EntListResp                         = pb.EntListResp
 	EntUpdateReq                        = pb.EntUpdateReq
 	EntUser                             = pb.EntUser
+	EntUserListData                     = pb.EntUserListData
+	EntUserListReq                      = pb.EntUserListReq
+	EntUserListResp                     = pb.EntUserListResp
 	EntUserReq                          = pb.EntUserReq
 	EntUserResp                         = pb.EntUserResp
 	ExamineList                         = pb.ExamineList
@@ -70,6 +74,10 @@ type (
 		GetUserInfo(ctx context.Context, in *UserReq, opts ...grpc.CallOption) (*UserInfo, error)
 		// 根据企业员工id获取员工的信息
 		GetEntUserInfo(ctx context.Context, in *EntUserReq, opts ...grpc.CallOption) (*EntUserResp, error)
+		// 获取企业员工列表
+		GetEntUserList(ctx context.Context, in *EntUserListReq, opts ...grpc.CallOption) (*EntUserListResp, error)
+		// 查看员工是否是企业管理员
+		CheckIsEntAdmin(ctx context.Context, in *EntUserReq, opts ...grpc.CallOption) (*CheckIsEntAdminResp, error)
 	}
 
 	defaultUserCenter struct {
@@ -148,3 +156,15 @@ func (m *defaultUserCenter) GetEntUserInfo(ctx context.Context, in *EntUserReq,
 	client := pb.NewUserCenterClient(m.cli.Conn())
 	return client.GetEntUserInfo(ctx, in, opts...)
 }
+
+// 获取企业员工列表
+func (m *defaultUserCenter) GetEntUserList(ctx context.Context, in *EntUserListReq, opts ...grpc.CallOption) (*EntUserListResp, error) {
+	client := pb.NewUserCenterClient(m.cli.Conn())
+	return client.GetEntUserList(ctx, in, opts...)
+}
+
+// 查看员工是否是企业管理员
+func (m *defaultUserCenter) CheckIsEntAdmin(ctx context.Context, in *EntUserReq, opts ...grpc.CallOption) (*CheckIsEntAdminResp, error) {
+	client := pb.NewUserCenterClient(m.cli.Conn())
+	return client.CheckIsEntAdmin(ctx, in, opts...)
+}

+ 24 - 0
service/entService.go

@@ -327,6 +327,30 @@ func (this *EntService) GetEntUserInfo(data *userCenter.EntUserReq) (*entity.Use
 	info := &entity.EntUserInfo{
 		Mysql:     entity.Mysql,
 		EntUserId: data.EntUserId,
+		EntId:     data.EntId,
 	}
 	return info.GetEntUserInfo()
 }
+
+//获取部门及子部门的员工列表
+func (this *EntService) GetEntUserList(data *userCenter.EntUserListReq) ([]*userCenter.EntUserListData, string) {
+	info := &entity.EntUserList{
+		Mysql:  entity.Mysql,
+		EntId:  data.EntId,
+		DeptId: data.DeptId,
+		Name:   data.Name,
+	}
+
+	return info.GetEntUserList()
+}
+
+//判断是否是企业管理员
+func (this *EntService) CheckEntUserAdmin(data *userCenter.EntUserReq) (int64, string) {
+	info := &entity.EntUserInfo{
+		Mysql:     entity.Mysql,
+		EntUserId: data.EntUserId,
+		EntId:     data.EntId,
+	}
+
+	return info.CheckEntAdmin()
+}