소스 검색

feat:完善

xuzhiheng 3 년 전
부모
커밋
2f37cdab98

+ 16 - 16
api/internal/types/types.go

@@ -189,28 +189,28 @@ type GetStatus struct {
 type UserAddReq struct {
 	Authorization string `header:"Authorization"`
 	Appid         string `json:"appid"`
-	Phone         string `json:"phone"`
-	Nickname      string `json:"nickname"`
-	Headimg       string `json:"headimg"`
-	Company       string `json:"company"`
-	Position      string `json:"position"`
-	Password      string `json:"password"`
-	Openid        string `json:"openid"`
-	Unionid       string `json:"unionid"`
+	Phone         string `json:"phone,optional"`
+	Nickname      string `json:"nickname,optional"`
+	Headimg       string `json:"headimg,optional"`
+	Company       string `json:"company,optional"`
+	Position      string `json:"position,optional"`
+	Password      string `json:"password,optional"`
+	Openid        string `json:"openid,optional"`
+	Unionid       string `json:"unionid,optional"`
 }
 
 type UserUpdateReq struct {
 	Authorization string `header:"Authorization"`
 	Appid         string `json:"appid"`
 	Id            int64  `json:"id"`
-	Phone         string `json:"phone"`
-	Nickname      string `json:"nickname"`
-	Headimg       string `json:"headimg"`
-	Company       string `json:"company"`
-	Position      string `json:"position"`
-	Password      string `json:"password"`
-	Openid        string `json:"openid"`
-	Unionid       string `json:"unionid"`
+	Phone         string `json:"phone,optional"`
+	Nickname      string `json:"nickname,optional"`
+	Headimg       string `json:"headimg,optional"`
+	Company       string `json:"company,optional"`
+	Position      string `json:"position,optional"`
+	Password      string `json:"password,optional"`
+	Openid        string `json:"openid,optional"`
+	Unionid       string `json:"unionid,optional"`
 }
 
 type UserDelReq struct {

+ 16 - 16
api/userCenter.api

@@ -202,28 +202,28 @@ type (
 	UserAddReq {
 		Authorization string `header:"Authorization"`
 		Appid         string `json:"appid"`
-		Phone         string `json:"phone"`
-		Nickname      string `json:"nickname"`
-		Headimg       string `json:"headimg"`
-		Company       string `json:"company"`
-		Position      string `json:"position"`
-		Password      string `json:"password"`
-		Openid        string `json:"openid"`
-		Unionid       string `json:"unionid"`
+		Phone         string `json:"phone,optional"`
+		Nickname      string `json:"nickname,optional"`
+		Headimg       string `json:"headimg,optional"`
+		Company       string `json:"company,optional"`
+		Position      string `json:"position,optional"`
+		Password      string `json:"password,optional"`
+		Openid        string `json:"openid,optional"`
+		Unionid       string `json:"unionid,optional"`
 	}
 
 	UserUpdateReq {
 		Authorization string `header:"Authorization"`
 		Appid         string `json:"appid"`
 		Id            int64  `json:"id"`
-		Phone         string `json:"phone"`
-		Nickname      string `json:"nickname"`
-		Headimg       string `json:"headimg"`
-		Company       string `json:"company"`
-		Position      string `json:"position"`
-		Password      string `json:"password"`
-		Openid        string `json:"openid"`
-		Unionid       string `json:"unionid"`
+		Phone         string `json:"phone,optional"`
+		Nickname      string `json:"nickname,optional"`
+		Headimg       string `json:"headimg,optional"`
+		Company       string `json:"company,optional"`
+		Position      string `json:"position,optional"`
+		Password      string `json:"password,optional"`
+		Openid        string `json:"openid,optional"`
+		Unionid       string `json:"unionid,optional"`
 	}
 
 	UserDelReq {

+ 1 - 0
entity/db.go

@@ -6,6 +6,7 @@ import (
 
 var (
 	Mysql             *mysql.Mysql
+	BaseMysql         *mysql.Mysql
 	UserTable         = "base_user"
 	UserSnapshotTable = "base_user_snapshot"
 )

+ 7 - 0
rpc/etc/usercenter.yaml

@@ -23,6 +23,13 @@ Mysql:
   passWord: Topnet123
   maxOpenConns: 5
   maxIdleConns: 5
+BaseMysql:
+  dbName: base_service  
+  address: 192.168.3.11:3366
+  userName: root
+  passWord: Topnet123
+  maxOpenConns: 5
+  maxIdleConns: 5
 Logx:
   Mode: console #console|file|volume
   Path: logs

+ 1 - 0
rpc/internal/config/config.go

@@ -16,6 +16,7 @@ type Config struct {
 	ResourceEtcdConf zrpc.RpcClientConf //资源中台
 	Node             int                // 节点
 	Mysql            Mysql
+	BaseMysql        Mysql
 	Logx             logx.LogConf
 	IsRun            bool   //定时任务是否开启
 	CheckEntIsExpire string //

+ 9 - 1
rpc/internal/db/db.go

@@ -18,6 +18,14 @@ func init() {
 		MaxIdleConns: config.ConfigJson.Mysql.MaxIdleConns,
 	}
 	entity.Mysql.Init()
+	entity.BaseMysql = &mysql.Mysql{
+		Address:      config.ConfigJson.BaseMysql.Address,
+		UserName:     config.ConfigJson.BaseMysql.UserName,
+		PassWord:     config.ConfigJson.BaseMysql.PassWord,
+		DBName:       config.ConfigJson.BaseMysql.DbName,
+		MaxOpenConns: config.ConfigJson.BaseMysql.MaxOpenConns,
+		MaxIdleConns: config.ConfigJson.BaseMysql.MaxIdleConns,
+	}
+	entity.BaseMysql.Init()
 	log.Println("初始化 mysql")
-
 }

+ 1 - 1
rpc/internal/logic/useraddlogic.go

@@ -24,7 +24,7 @@ func NewUserAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserAddLo
 }
 
 // 新增用户
-func (l *UserAddLogic) UserAdd(in *pb.UserAddReq) (*pb.ExamineResp, error) {
+func (l *UserAddLogic) UserAdd(in *pb.UserAddReq) (*pb.UserAddResp, error) {
 	// todo: add your logic here and delete this line
 
 	return service.UserAdd(in), nil

+ 1 - 1
rpc/internal/server/usercenterserver.go

@@ -76,7 +76,7 @@ func (s *UserCenterServer) GetStatusByCode(ctx context.Context, in *pb.GetStatus
 }
 
 // 新增用户
-func (s *UserCenterServer) UserAdd(ctx context.Context, in *pb.UserAddReq) (*pb.ExamineResp, error) {
+func (s *UserCenterServer) UserAdd(ctx context.Context, in *pb.UserAddReq) (*pb.UserAddResp, error) {
 	l := logic.NewUserAddLogic(ctx, s.svcCtx)
 	return l.UserAdd(in)
 }

+ 246 - 91
rpc/pb/userCenter.pb.go

@@ -2008,6 +2008,124 @@ func (x *UserAddReq) GetUnionid() string {
 	return ""
 }
 
+type UserAddResp 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      *UserAdds `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
+}
+
+func (x *UserAddResp) Reset() {
+	*x = UserAddResp{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_userCenter_proto_msgTypes[25]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *UserAddResp) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UserAddResp) ProtoMessage() {}
+
+func (x *UserAddResp) ProtoReflect() protoreflect.Message {
+	mi := &file_userCenter_proto_msgTypes[25]
+	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 UserAddResp.ProtoReflect.Descriptor instead.
+func (*UserAddResp) Descriptor() ([]byte, []int) {
+	return file_userCenter_proto_rawDescGZIP(), []int{25}
+}
+
+func (x *UserAddResp) GetErrorCode() int64 {
+	if x != nil {
+		return x.ErrorCode
+	}
+	return 0
+}
+
+func (x *UserAddResp) GetErrorMsg() string {
+	if x != nil {
+		return x.ErrorMsg
+	}
+	return ""
+}
+
+func (x *UserAddResp) GetData() *UserAdds {
+	if x != nil {
+		return x.Data
+	}
+	return nil
+}
+
+type UserAdds struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Status int64 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"`
+	Id     int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
+}
+
+func (x *UserAdds) Reset() {
+	*x = UserAdds{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_userCenter_proto_msgTypes[26]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *UserAdds) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UserAdds) ProtoMessage() {}
+
+func (x *UserAdds) ProtoReflect() protoreflect.Message {
+	mi := &file_userCenter_proto_msgTypes[26]
+	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 UserAdds.ProtoReflect.Descriptor instead.
+func (*UserAdds) Descriptor() ([]byte, []int) {
+	return file_userCenter_proto_rawDescGZIP(), []int{26}
+}
+
+func (x *UserAdds) GetStatus() int64 {
+	if x != nil {
+		return x.Status
+	}
+	return 0
+}
+
+func (x *UserAdds) GetId() int64 {
+	if x != nil {
+		return x.Id
+	}
+	return 0
+}
+
 type UserIdReq struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -2028,7 +2146,7 @@ type UserIdReq struct {
 func (x *UserIdReq) Reset() {
 	*x = UserIdReq{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_userCenter_proto_msgTypes[25]
+		mi := &file_userCenter_proto_msgTypes[27]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -2041,7 +2159,7 @@ func (x *UserIdReq) String() string {
 func (*UserIdReq) ProtoMessage() {}
 
 func (x *UserIdReq) ProtoReflect() protoreflect.Message {
-	mi := &file_userCenter_proto_msgTypes[25]
+	mi := &file_userCenter_proto_msgTypes[27]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -2054,7 +2172,7 @@ func (x *UserIdReq) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use UserIdReq.ProtoReflect.Descriptor instead.
 func (*UserIdReq) Descriptor() ([]byte, []int) {
-	return file_userCenter_proto_rawDescGZIP(), []int{25}
+	return file_userCenter_proto_rawDescGZIP(), []int{27}
 }
 
 func (x *UserIdReq) GetAppid() string {
@@ -2386,57 +2504,67 @@ var file_userCenter_proto_rawDesc = []byte{
 	0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x64, 0x18,
 	0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x64, 0x12, 0x18, 0x0a,
 	0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
-	0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x22, 0x81, 0x02, 0x0a, 0x09, 0x55, 0x73, 0x65, 0x72,
-	0x49, 0x64, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x01,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69,
-	0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x70,
-	0x68, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e,
-	0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a,
-	0x07, 0x68, 0x65, 0x61, 0x64, 0x69, 0x6d, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
-	0x68, 0x65, 0x61, 0x64, 0x69, 0x6d, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x70, 0x61,
-	0x6e, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e,
-	0x79, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a,
-	0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x70, 0x65,
-	0x6e, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x70, 0x65, 0x6e, 0x69,
-	0x64, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x32, 0x8d, 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, 0x24, 0x0a, 0x07, 0x55, 0x73, 0x65, 0x72,
-	0x41, 0x64, 0x64, 0x12, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71,
-	0x1a, 0x0c, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26,
-	0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x0a, 0x2e, 0x55,
-	0x73, 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x69,
-	0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x07, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65,
-	0x6c, 0x12, 0x0a, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e,
-	0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e,
-	0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x22, 0x68, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x41,
+	0x64, 0x64, 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, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
+	0x32, 0x09, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x64, 0x64, 0x73, 0x52, 0x04, 0x64, 0x61, 0x74,
+	0x61, 0x22, 0x32, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x41, 0x64, 0x64, 0x73, 0x12, 0x16, 0x0a,
+	0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73,
+	0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x81, 0x02, 0x0a, 0x09, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64,
+	0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
+	0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f,
+	0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12,
+	0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x68,
+	0x65, 0x61, 0x64, 0x69, 0x6d, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x68, 0x65,
+	0x61, 0x64, 0x69, 0x6d, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79,
+	0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x12,
+	0x1a, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x70,
+	0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70,
+	0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x70, 0x65, 0x6e, 0x69,
+	0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x64, 0x12,
+	0x18, 0x0a, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x32, 0x8d, 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, 0x24, 0x0a, 0x07, 0x55, 0x73, 0x65, 0x72, 0x41, 0x64,
+	0x64, 0x12, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0c,
+	0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x0a,
+	0x55, 0x73, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x0a, 0x2e, 0x55, 0x73, 0x65,
+	0x72, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65,
+	0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x07, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x12,
+	0x0a, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x78,
+	0x61, 0x6d, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70,
+	0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -2451,7 +2579,7 @@ func file_userCenter_proto_rawDescGZIP() []byte {
 	return file_userCenter_proto_rawDescData
 }
 
-var file_userCenter_proto_msgTypes = make([]protoimpl.MessageInfo, 26)
+var file_userCenter_proto_msgTypes = make([]protoimpl.MessageInfo, 28)
 var file_userCenter_proto_goTypes = []interface{}{
 	(*EntAuthReq)(nil),          // 0: EntAuthReq
 	(*EntAuthResp)(nil),         // 1: EntAuthResp
@@ -2478,7 +2606,9 @@ var file_userCenter_proto_goTypes = []interface{}{
 	(*GetStatusByCodeResp)(nil), // 22: GetStatusByCodeResp
 	(*GetStatusByCode)(nil),     // 23: GetStatusByCode
 	(*UserAddReq)(nil),          // 24: UserAddReq
-	(*UserIdReq)(nil),           // 25: UserIdReq
+	(*UserAddResp)(nil),         // 25: UserAddResp
+	(*UserAdds)(nil),            // 26: UserAdds
+	(*UserIdReq)(nil),           // 27: UserIdReq
 }
 var file_userCenter_proto_depIdxs = []int32{
 	2,  // 0: EntAuthResp.data:type_name -> EntAuthData
@@ -2490,35 +2620,36 @@ var file_userCenter_proto_depIdxs = []int32{
 	16, // 6: CheckEntResp.data:type_name -> checkData
 	18, // 7: EntInfoResp.data:type_name -> EntInfoData
 	23, // 8: GetStatusByCodeResp.data:type_name -> GetStatusByCode
-	0,  // 9: UserCenter.EntAuth:input_type -> EntAuthReq
-	3,  // 10: UserCenter.EntExamine:input_type -> ExamineReq
-	6,  // 11: UserCenter.EntList:input_type -> EntListReq
-	10, // 12: UserCenter.ExamineList:input_type -> ExamineListReq
-	14, // 13: UserCenter.CheckEnt:input_type -> CheckEntReq
-	14, // 14: UserCenter.EntInfo:input_type -> CheckEntReq
-	19, // 15: UserCenter.EntUpdate:input_type -> EntUpdateReq
-	20, // 16: UserCenter.ExamineInfo:input_type -> CheckExamineReq
-	21, // 17: UserCenter.GetStatusByCode:input_type -> GetStatusByCodeReq
-	24, // 18: UserCenter.UserAdd:input_type -> UserAddReq
-	25, // 19: UserCenter.UserUpdate:input_type -> UserIdReq
-	25, // 20: UserCenter.UserDel:input_type -> UserIdReq
-	1,  // 21: UserCenter.EntAuth:output_type -> EntAuthResp
-	4,  // 22: UserCenter.EntExamine:output_type -> ExamineResp
-	7,  // 23: UserCenter.EntList:output_type -> EntListResp
-	11, // 24: UserCenter.ExamineList:output_type -> ExamineListResp
-	15, // 25: UserCenter.CheckEnt:output_type -> CheckEntResp
-	17, // 26: UserCenter.EntInfo:output_type -> EntInfoResp
-	4,  // 27: UserCenter.EntUpdate:output_type -> ExamineResp
-	17, // 28: UserCenter.ExamineInfo:output_type -> EntInfoResp
-	22, // 29: UserCenter.GetStatusByCode:output_type -> GetStatusByCodeResp
-	4,  // 30: UserCenter.UserAdd:output_type -> ExamineResp
-	4,  // 31: UserCenter.UserUpdate:output_type -> ExamineResp
-	4,  // 32: UserCenter.UserDel:output_type -> ExamineResp
-	21, // [21:33] is the sub-list for method output_type
-	9,  // [9:21] is the sub-list for method input_type
-	9,  // [9:9] is the sub-list for extension type_name
-	9,  // [9:9] is the sub-list for extension extendee
-	0,  // [0:9] is the sub-list for field type_name
+	26, // 9: UserAddResp.data:type_name -> UserAdds
+	0,  // 10: UserCenter.EntAuth:input_type -> EntAuthReq
+	3,  // 11: UserCenter.EntExamine:input_type -> ExamineReq
+	6,  // 12: UserCenter.EntList:input_type -> EntListReq
+	10, // 13: UserCenter.ExamineList:input_type -> ExamineListReq
+	14, // 14: UserCenter.CheckEnt:input_type -> CheckEntReq
+	14, // 15: UserCenter.EntInfo:input_type -> CheckEntReq
+	19, // 16: UserCenter.EntUpdate:input_type -> EntUpdateReq
+	20, // 17: UserCenter.ExamineInfo:input_type -> CheckExamineReq
+	21, // 18: UserCenter.GetStatusByCode:input_type -> GetStatusByCodeReq
+	24, // 19: UserCenter.UserAdd:input_type -> UserAddReq
+	27, // 20: UserCenter.UserUpdate:input_type -> UserIdReq
+	27, // 21: UserCenter.UserDel:input_type -> UserIdReq
+	1,  // 22: UserCenter.EntAuth:output_type -> EntAuthResp
+	4,  // 23: UserCenter.EntExamine:output_type -> ExamineResp
+	7,  // 24: UserCenter.EntList:output_type -> EntListResp
+	11, // 25: UserCenter.ExamineList:output_type -> ExamineListResp
+	15, // 26: UserCenter.CheckEnt:output_type -> CheckEntResp
+	17, // 27: UserCenter.EntInfo:output_type -> EntInfoResp
+	4,  // 28: UserCenter.EntUpdate:output_type -> ExamineResp
+	17, // 29: UserCenter.ExamineInfo:output_type -> EntInfoResp
+	22, // 30: UserCenter.GetStatusByCode:output_type -> GetStatusByCodeResp
+	25, // 31: UserCenter.UserAdd:output_type -> UserAddResp
+	4,  // 32: UserCenter.UserUpdate:output_type -> ExamineResp
+	4,  // 33: UserCenter.UserDel:output_type -> ExamineResp
+	22, // [22:34] is the sub-list for method output_type
+	10, // [10:22] is the sub-list for method input_type
+	10, // [10:10] is the sub-list for extension type_name
+	10, // [10:10] is the sub-list for extension extendee
+	0,  // [0:10] is the sub-list for field type_name
 }
 
 func init() { file_userCenter_proto_init() }
@@ -2828,6 +2959,30 @@ func file_userCenter_proto_init() {
 			}
 		}
 		file_userCenter_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*UserAddResp); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_userCenter_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*UserAdds); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_userCenter_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*UserIdReq); i {
 			case 0:
 				return &v.state
@@ -2846,7 +3001,7 @@ func file_userCenter_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_userCenter_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   26,
+			NumMessages:   28,
 			NumExtensions: 0,
 			NumServices:   1,
 		},
@@ -2891,7 +3046,7 @@ type UserCenterClient interface {
 	//根据统一社会信用代码查询企业状态
 	GetStatusByCode(ctx context.Context, in *GetStatusByCodeReq, opts ...grpc.CallOption) (*GetStatusByCodeResp, error)
 	//新增用户
-	UserAdd(ctx context.Context, in *UserAddReq, opts ...grpc.CallOption) (*ExamineResp, error)
+	UserAdd(ctx context.Context, in *UserAddReq, opts ...grpc.CallOption) (*UserAddResp, error)
 	//更新用户
 	UserUpdate(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*ExamineResp, error)
 	//删除用户
@@ -2987,8 +3142,8 @@ func (c *userCenterClient) GetStatusByCode(ctx context.Context, in *GetStatusByC
 	return out, nil
 }
 
-func (c *userCenterClient) UserAdd(ctx context.Context, in *UserAddReq, opts ...grpc.CallOption) (*ExamineResp, error) {
-	out := new(ExamineResp)
+func (c *userCenterClient) UserAdd(ctx context.Context, in *UserAddReq, opts ...grpc.CallOption) (*UserAddResp, error) {
+	out := new(UserAddResp)
 	err := c.cc.Invoke(ctx, "/UserCenter/UserAdd", in, out, opts...)
 	if err != nil {
 		return nil, err
@@ -3035,7 +3190,7 @@ type UserCenterServer interface {
 	//根据统一社会信用代码查询企业状态
 	GetStatusByCode(context.Context, *GetStatusByCodeReq) (*GetStatusByCodeResp, error)
 	//新增用户
-	UserAdd(context.Context, *UserAddReq) (*ExamineResp, error)
+	UserAdd(context.Context, *UserAddReq) (*UserAddResp, error)
 	//更新用户
 	UserUpdate(context.Context, *UserIdReq) (*ExamineResp, error)
 	//删除用户
@@ -3073,7 +3228,7 @@ func (*UnimplementedUserCenterServer) ExamineInfo(context.Context, *CheckExamine
 func (*UnimplementedUserCenterServer) GetStatusByCode(context.Context, *GetStatusByCodeReq) (*GetStatusByCodeResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method GetStatusByCode not implemented")
 }
-func (*UnimplementedUserCenterServer) UserAdd(context.Context, *UserAddReq) (*ExamineResp, error) {
+func (*UnimplementedUserCenterServer) UserAdd(context.Context, *UserAddReq) (*UserAddResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method UserAdd not implemented")
 }
 func (*UnimplementedUserCenterServer) UserUpdate(context.Context, *UserIdReq) (*ExamineResp, error) {

+ 1 - 1
rpc/test/ent_test.go

@@ -74,7 +74,7 @@ func Test_EntInfo(t *testing.T) {
 	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
 	FileSystem := usercenterclient.NewUserCenter(zrpc.MustNewClient(c.FileSystemConf))
 	req := &pb.CheckEntReq{
-		EntId: 14823,
+		EntId: 14783,
 	}
 	res, err := FileSystem.EntInfo(ctx, req)
 	log.Println("err ", err)

+ 27 - 0
rpc/test/user_test.go

@@ -0,0 +1,27 @@
+package test
+
+import (
+	"context"
+	"log"
+	"testing"
+	"time"
+
+	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
+	usercenterclient "bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/usercenter"
+	"github.com/zeromicro/go-zero/zrpc"
+)
+
+// go test -v -run Test_UserAdd
+func Test_UserAdd(t *testing.T) {
+	ctx, _ := context.WithTimeout(context.Background(), 2*time.Second)
+	FileSystem := usercenterclient.NewUserCenter(zrpc.MustNewClient(c.FileSystemConf))
+	req := &pb.UserAddReq{
+		Appid:    "10000",
+		Phone:    "18530014520",
+		Nickname: "xx",
+		Company:  "郑州森曼木材有限公司",
+	}
+	res, err := FileSystem.UserAdd(ctx, req)
+	log.Println("err ", err)
+	log.Println("res:", res)
+}

+ 18 - 2
rpc/test/usercenter.yaml

@@ -1,5 +1,5 @@
 Name: usercenter.rpc
-ListenOn: 127.0.0.1:1001
+ListenOn: 127.0.0.1:8080
 Redis:
   Host: 127.0.0.1
   addr: 127.0.0.1:6379
@@ -27,4 +27,20 @@ Mysql:
   userName: root
   passWord: Topnet123
   maxOpenConns: 5
-  maxIdleConns: 5
+  maxIdleConns: 5
+BaseMysql:
+  dbName: base_service  
+  address: 192.168.3.11:3366
+  userName: root
+  passWord: Topnet123
+  maxOpenConns: 5
+  maxIdleConns: 5
+Logx:
+  Mode: console #console|file|volume
+  Path: logs
+  Level: info #info|error|severe
+  KeepDays: 100
+IsRun: true
+CheckEntIsExpire: 00:00
+DoMain: https://jybx-webtest.jydev.jianyu360.com
+Timeout:  5000

+ 12 - 1
rpc/userCenter.proto

@@ -214,6 +214,17 @@ message UserAddReq {
 	string unionid = 9;
 }
 
+message UserAddResp {
+	int64   error_code = 1;
+	string  error_msg = 2;
+	UserAdds data = 3;
+}
+
+message UserAdds {
+	int64 status = 1;
+	int64 id = 2;
+}
+
 message UserIdReq {
 	string appid = 1;
 	int64 id = 2; 
@@ -247,7 +258,7 @@ service UserCenter {
 	//根据统一社会信用代码查询企业状态
 	rpc GetStatusByCode(GetStatusByCodeReq) returns (GetStatusByCodeResp);
 	//新增用户
-	rpc UserAdd (UserAddReq) returns (ExamineResp);
+	rpc UserAdd (UserAddReq) returns (UserAddResp);
 	//更新用户
 	rpc UserUpdate (UserIdReq) returns (ExamineResp);
 	//删除用户

+ 21 - 19
rpc/usercenter/usercenter.go

@@ -15,31 +15,33 @@ import (
 
 type (
 	EntListReq          = pb.EntListReq
-	EntListResp         = pb.EntListResp
+	UserAddResp         = pb.UserAddResp
+	ExamineReq          = pb.ExamineReq
 	EntInfoData         = pb.EntInfoData
-	GetStatusByCodeResp = pb.GetStatusByCodeResp
-	CheckExamineReq     = pb.CheckExamineReq
-	GetStatusByCodeReq  = pb.GetStatusByCodeReq
-	EntAuthData         = pb.EntAuthData
-	ExamineListResp     = pb.ExamineListResp
+	ExamineResp         = pb.ExamineResp
+	EntData             = pb.EntData
 	ExamineListData     = pb.ExamineListData
-	CheckEntReq         = pb.CheckEntReq
-	CheckEntResp        = pb.CheckEntResp
+	UserAdds            = pb.UserAdds
+	UserIdReq           = pb.UserIdReq
+	EntList             = pb.EntList
+	ExamineListReq      = pb.ExamineListReq
+	GetStatusByCodeReq  = pb.GetStatusByCodeReq
+	GetStatusByCodeResp = pb.GetStatusByCodeResp
+	EntAuthResp         = pb.EntAuthResp
+	ExamineList         = pb.ExamineList
 	CheckData           = pb.CheckData
+	CheckExamineReq     = pb.CheckExamineReq
 	GetStatusByCode     = pb.GetStatusByCode
-	EntList             = pb.EntList
+	CheckEntReq         = pb.CheckEntReq
 	EntInfoResp         = pb.EntInfoResp
 	EntUpdateReq        = pb.EntUpdateReq
-	UserAddReq          = pb.UserAddReq
-	UserIdReq           = pb.UserIdReq
-	ExamineListReq      = pb.ExamineListReq
-	ExamineList         = pb.ExamineList
 	EntAuthReq          = pb.EntAuthReq
-	EntAuthResp         = pb.EntAuthResp
-	ExamineReq          = pb.ExamineReq
-	ExamineResp         = pb.ExamineResp
+	EntAuthData         = pb.EntAuthData
+	EntListResp         = pb.EntListResp
+	CheckEntResp        = pb.CheckEntResp
+	UserAddReq          = pb.UserAddReq
 	ExamineData         = pb.ExamineData
-	EntData             = pb.EntData
+	ExamineListResp     = pb.ExamineListResp
 
 	UserCenter interface {
 		// 企业认证
@@ -61,7 +63,7 @@ type (
 		// 根据统一社会信用代码查询企业状态
 		GetStatusByCode(ctx context.Context, in *GetStatusByCodeReq) (*GetStatusByCodeResp, error)
 		// 新增用户
-		UserAdd(ctx context.Context, in *UserAddReq) (*ExamineResp, error)
+		UserAdd(ctx context.Context, in *UserAddReq) (*UserAddResp, error)
 		// 更新用户
 		UserUpdate(ctx context.Context, in *UserIdReq) (*ExamineResp, error)
 		// 删除用户
@@ -134,7 +136,7 @@ func (m *defaultUserCenter) GetStatusByCode(ctx context.Context, in *GetStatusBy
 }
 
 // 新增用户
-func (m *defaultUserCenter) UserAdd(ctx context.Context, in *UserAddReq) (*ExamineResp, error) {
+func (m *defaultUserCenter) UserAdd(ctx context.Context, in *UserAddReq) (*UserAddResp, error) {
 	client := pb.NewUserCenterClient(m.cli.Conn())
 	return client.UserAdd(ctx, in)
 }

+ 23 - 17
service/user.go

@@ -8,8 +8,8 @@ import (
 	. "bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/usercenter"
 )
 
-func UserAdd(this *UserAddReq) *ExamineResp {
-	userId := entity.Mysql.Insert(entity.UserTable, map[string]interface{}{
+func UserAdd(this *UserAddReq) *UserAddResp {
+	userId := entity.BaseMysql.Insert(entity.UserTable, map[string]interface{}{
 		"appid":       this.Appid,
 		"phone":       this.Phone,
 		"nickname":    this.Nickname,
@@ -21,46 +21,52 @@ func UserAdd(this *UserAddReq) *ExamineResp {
 		"unionid":     this.Unionid,
 		"create_time": time.Now().Format("2006-01-02 15:04:05"),
 	})
-	status := 0
+	status, msg := 0, ""
 	if userId > 0 {
 		status = 1
+	} else {
+		msg = "新增用户失败"
 	}
-	return &ExamineResp{
+	return &UserAddResp{
 		ErrorCode: 1,
-		ErrorMsg:  "成功",
-		Data:      &ExamineData{Status: int64(status)},
+		ErrorMsg:  msg,
+		Data:      &UserAdds{Status: int64(status), Id: userId},
 	}
 }
 
 func UserUpdate(this *UserIdReq) *ExamineResp {
 	ok := UserUpdates(this)
-	status := 0
+	status, msg := 0, ""
 	if ok {
 		status = 1
+	} else {
+		msg = "更新用户失败"
 	}
 	return &ExamineResp{
 		ErrorCode: 1,
-		ErrorMsg:  "成功",
+		ErrorMsg:  msg,
 		Data:      &ExamineData{Status: int64(status)},
 	}
 }
 
 func UserDel(this *UserIdReq) *ExamineResp {
 	ok := UserDels(this)
-	status := 0
+	status, msg := 0, ""
 	if ok {
 		status = 1
+	} else {
+		msg = "删除用户失败"
 	}
 	return &ExamineResp{
 		ErrorCode: 1,
-		ErrorMsg:  "成功",
+		ErrorMsg:  msg,
 		Data:      &ExamineData{Status: int64(status)},
 	}
 }
 
 func UserUpdates(this *UserIdReq) bool {
 	ok := false
-	flag := entity.Mysql.ExecTx("", func(tx *sql.Tx) bool {
+	flag := entity.BaseMysql.ExecTx("", func(tx *sql.Tx) bool {
 		set := map[string]interface{}{}
 		if this.Phone != "" {
 			set["phone"] = this.Phone
@@ -86,8 +92,8 @@ func UserUpdates(this *UserIdReq) bool {
 		if this.Unionid != "" {
 			set["unionid"] = this.Unionid
 		}
-		ok1 := entity.Mysql.UpdateByTx(tx, entity.UserTable, map[string]interface{}{"id": this.Id}, set)
-		snapshot := entity.Mysql.InsertByTx(tx, entity.UserSnapshotTable, map[string]interface{}{
+		ok1 := entity.BaseMysql.UpdateByTx(tx, entity.UserTable, map[string]interface{}{"id": this.Id}, set)
+		snapshot := entity.BaseMysql.InsertByTx(tx, entity.UserSnapshotTable, map[string]interface{}{
 			"appid":       this.Appid,
 			"user_id":     this.Id,
 			"phone":       this.Phone,
@@ -110,12 +116,12 @@ func UserUpdates(this *UserIdReq) bool {
 
 func UserDels(this *UserIdReq) bool {
 	ok := false
-	userData := entity.Mysql.FindOne(entity.UserTable, map[string]interface{}{"id": this.Id}, "", "")
+	userData := entity.BaseMysql.FindOne(entity.UserTable, map[string]interface{}{"id": this.Id}, "", "")
 	if userData != nil && len(*userData) > 0 {
-		flag := entity.Mysql.ExecTx("", func(tx *sql.Tx) bool {
+		flag := entity.BaseMysql.ExecTx("", func(tx *sql.Tx) bool {
 			thisdata := *userData
-			ok1 := entity.Mysql.DeleteByTx(tx, entity.UserTable, map[string]interface{}{"id": this.Id})
-			snapshot := entity.Mysql.InsertByTx(tx, entity.UserSnapshotTable, map[string]interface{}{
+			ok1 := entity.BaseMysql.DeleteByTx(tx, entity.UserTable, map[string]interface{}{"id": this.Id})
+			snapshot := entity.BaseMysql.InsertByTx(tx, entity.UserSnapshotTable, map[string]interface{}{
 				"appid":       thisdata["appid"],
 				"user_id":     this.Id,
 				"phone":       thisdata["phone"],