Parcourir la source

feat:增加更换字段

xuzhiheng il y a 3 ans
Parent
commit
28975c97d0

+ 2 - 1
api/internal/logic/useraddlogic.go

@@ -34,7 +34,8 @@ func (l *UserAddLogic) UserAdd(req types.UserAddReq) (*types.Resp, error) {
 		Company:  req.Company,
 		Position: req.Position,
 		Password: req.Password,
-		Openid:   req.Openid,
+		AOpenid:  req.AOpenid,
+		SOpenid:  req.SOpenid,
 		Unionid:  req.Unionid,
 	})
 	return &types.Resp{

+ 2 - 1
api/internal/logic/userupdatelogic.go

@@ -35,7 +35,8 @@ func (l *UserUpdateLogic) UserUpdate(req types.UserUpdateReq) (*types.Resp, erro
 		Company:  req.Company,
 		Position: req.Position,
 		Password: req.Password,
-		Openid:   req.Openid,
+		AOpenid:  req.AOpenid,
+		SOpenid:  req.SOpenid,
 		Unionid:  req.Unionid,
 	})
 	return &types.Resp{

+ 4 - 2
api/internal/types/types.go

@@ -195,7 +195,8 @@ type UserAddReq struct {
 	Company       string `json:"company,optional"`
 	Position      string `json:"position,optional"`
 	Password      string `json:"password,optional"`
-	Openid        string `json:"openid,optional"`
+	SOpenid       string `json:"s_openid,optional"`
+	AOpenid       string `json:"a_openid,optional"`
 	Unionid       string `json:"unionid,optional"`
 }
 
@@ -209,7 +210,8 @@ type UserUpdateReq struct {
 	Company       string `json:"company,optional"`
 	Position      string `json:"position,optional"`
 	Password      string `json:"password,optional"`
-	Openid        string `json:"openid,optional"`
+	SOpenid       string `json:"s_openid,optional"`
+	AOpenid       string `json:"a_openid,optional"`
 	Unionid       string `json:"unionid,optional"`
 }
 

+ 4 - 2
api/userCenter.api

@@ -208,7 +208,8 @@ type (
 		Company       string `json:"company,optional"`
 		Position      string `json:"position,optional"`
 		Password      string `json:"password,optional"`
-		Openid        string `json:"openid,optional"`
+		SOpenid       string `json:"s_openid,optional"`
+		AOpenid       string `json:"a_openid,optional"`
 		Unionid       string `json:"unionid,optional"`
 	}
 
@@ -222,7 +223,8 @@ type (
 		Company       string `json:"company,optional"`
 		Position      string `json:"position,optional"`
 		Password      string `json:"password,optional"`
-		Openid        string `json:"openid,optional"`
+		SOpenid       string `json:"s_openid,optional"`
+		AOpenid       string `json:"a_openid,optional"`
 		Unionid       string `json:"unionid,optional"`
 	}
 

+ 1 - 0
go.mod

@@ -7,6 +7,7 @@ require (
 	app.yhyue.com/moapp/jybase v0.0.0-20220421060131-a1001013ba46
 	bp.jydev.jianyu360.cn/BaseService/gateway v0.0.0-20220421060822-97590f0dd0d9
 	bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.0-20220420075831-0b59892e9982
+	github.com/golang/protobuf v1.5.2
 	github.com/zeromicro/go-zero v1.3.2
 	google.golang.org/grpc v1.45.0
 	google.golang.org/protobuf v1.28.0

+ 93 - 73
rpc/pb/userCenter.pb.go

@@ -1909,8 +1909,9 @@ type UserAddReq struct {
 	Company  string `protobuf:"bytes,5,opt,name=company,proto3" json:"company,omitempty"`
 	Position string `protobuf:"bytes,6,opt,name=position,proto3" json:"position,omitempty"`
 	Password string `protobuf:"bytes,7,opt,name=password,proto3" json:"password,omitempty"`
-	Openid   string `protobuf:"bytes,8,opt,name=openid,proto3" json:"openid,omitempty"`
-	Unionid  string `protobuf:"bytes,9,opt,name=unionid,proto3" json:"unionid,omitempty"`
+	SOpenid  string `protobuf:"bytes,8,opt,name=s_openid,json=sOpenid,proto3" json:"s_openid,omitempty"`
+	AOpenid  string `protobuf:"bytes,9,opt,name=a_openid,json=aOpenid,proto3" json:"a_openid,omitempty"`
+	Unionid  string `protobuf:"bytes,10,opt,name=unionid,proto3" json:"unionid,omitempty"`
 }
 
 func (x *UserAddReq) Reset() {
@@ -1994,9 +1995,16 @@ func (x *UserAddReq) GetPassword() string {
 	return ""
 }
 
-func (x *UserAddReq) GetOpenid() string {
+func (x *UserAddReq) GetSOpenid() string {
+	if x != nil {
+		return x.SOpenid
+	}
+	return ""
+}
+
+func (x *UserAddReq) GetAOpenid() string {
 	if x != nil {
-		return x.Openid
+		return x.AOpenid
 	}
 	return ""
 }
@@ -2139,8 +2147,9 @@ type UserIdReq struct {
 	Company  string `protobuf:"bytes,6,opt,name=company,proto3" json:"company,omitempty"`
 	Position string `protobuf:"bytes,7,opt,name=position,proto3" json:"position,omitempty"`
 	Password string `protobuf:"bytes,8,opt,name=password,proto3" json:"password,omitempty"`
-	Openid   string `protobuf:"bytes,9,opt,name=openid,proto3" json:"openid,omitempty"`
-	Unionid  string `protobuf:"bytes,10,opt,name=unionid,proto3" json:"unionid,omitempty"`
+	SOpenid  string `protobuf:"bytes,9,opt,name=s_openid,json=sOpenid,proto3" json:"s_openid,omitempty"`
+	AOpenid  string `protobuf:"bytes,10,opt,name=a_openid,json=aOpenid,proto3" json:"a_openid,omitempty"`
+	Unionid  string `protobuf:"bytes,11,opt,name=unionid,proto3" json:"unionid,omitempty"`
 }
 
 func (x *UserIdReq) Reset() {
@@ -2231,9 +2240,16 @@ func (x *UserIdReq) GetPassword() string {
 	return ""
 }
 
-func (x *UserIdReq) GetOpenid() string {
+func (x *UserIdReq) GetSOpenid() string {
+	if x != nil {
+		return x.SOpenid
+	}
+	return ""
+}
+
+func (x *UserIdReq) GetAOpenid() string {
 	if x != nil {
-		return x.Openid
+		return x.AOpenid
 	}
 	return ""
 }
@@ -2489,7 +2505,7 @@ var file_userCenter_proto_rawDesc = []byte{
 	0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x61, 0x75,
 	0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x49, 0x6e,
 	0x45, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x49, 0x6e, 0x45,
-	0x6e, 0x74, 0x22, 0xf2, 0x01, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x41, 0x64, 0x64, 0x52, 0x65,
+	0x6e, 0x74, 0x22, 0x90, 0x02, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x41, 0x64, 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, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65,
 	0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x1a, 0x0a,
@@ -2501,70 +2517,74 @@ var file_userCenter_proto_rawDesc = []byte{
 	0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 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, 0x07, 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,
-	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, 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,
+	0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x69,
+	0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x4f, 0x70, 0x65, 0x6e, 0x69, 0x64,
+	0x12, 0x19, 0x0a, 0x08, 0x61, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x07, 0x61, 0x4f, 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, 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, 0x9f, 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, 0x19, 0x0a, 0x08, 0x73, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x69,
+	0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x4f, 0x70, 0x65, 0x6e, 0x69, 0x64,
+	0x12, 0x19, 0x0a, 0x08, 0x61, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x07, 0x61, 0x4f, 0x70, 0x65, 0x6e, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x75,
+	0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x18, 0x0b, 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 (

+ 6 - 4
rpc/userCenter.proto

@@ -210,8 +210,9 @@ message UserAddReq {
 	string company = 5;
 	string position = 6;
 	string password = 7;
-	string openid = 8;
-	string unionid = 9;
+	string s_openid = 8;
+	string a_openid = 9;
+	string unionid = 10;
 }
 
 message UserAddResp {
@@ -234,8 +235,9 @@ message UserIdReq {
 	string company = 6;
 	string position = 7;
 	string password = 8;
-	string openid = 9;
-	string unionid = 10;
+	string s_openid = 9;
+	string a_openid = 10;
+	string unionid = 11;
 }
 
 service UserCenter {

+ 19 - 19
rpc/usercenter/usercenter.go

@@ -14,34 +14,34 @@ import (
 )
 
 type (
-	EntListReq          = pb.EntListReq
-	UserAddResp         = pb.UserAddResp
-	ExamineReq          = pb.ExamineReq
-	EntInfoData         = pb.EntInfoData
+	EntUpdateReq        = pb.EntUpdateReq
+	GetStatusByCode     = pb.GetStatusByCode
 	ExamineResp         = pb.ExamineResp
 	EntData             = pb.EntData
-	ExamineListData     = pb.ExamineListData
-	UserAdds            = pb.UserAdds
-	UserIdReq           = pb.UserIdReq
-	EntList             = pb.EntList
-	ExamineListReq      = pb.ExamineListReq
+	CheckEntReq         = pb.CheckEntReq
 	GetStatusByCodeReq  = pb.GetStatusByCodeReq
-	GetStatusByCodeResp = pb.GetStatusByCodeResp
 	EntAuthResp         = pb.EntAuthResp
 	ExamineList         = pb.ExamineList
-	CheckData           = pb.CheckData
-	CheckExamineReq     = pb.CheckExamineReq
-	GetStatusByCode     = pb.GetStatusByCode
-	CheckEntReq         = pb.CheckEntReq
-	EntInfoResp         = pb.EntInfoResp
-	EntUpdateReq        = pb.EntUpdateReq
+	EntInfoData         = pb.EntInfoData
+	UserAddResp         = pb.UserAddResp
+	EntListReq          = pb.EntListReq
+	ExamineListReq      = pb.ExamineListReq
+	UserAdds            = pb.UserAdds
 	EntAuthReq          = pb.EntAuthReq
 	EntAuthData         = pb.EntAuthData
-	EntListResp         = pb.EntListResp
-	CheckEntResp        = pb.CheckEntResp
-	UserAddReq          = pb.UserAddReq
+	EntInfoResp         = pb.EntInfoResp
+	GetStatusByCodeResp = pb.GetStatusByCodeResp
+	CheckData           = pb.CheckData
+	CheckExamineReq     = pb.CheckExamineReq
+	ExamineReq          = pb.ExamineReq
 	ExamineData         = pb.ExamineData
+	EntList             = pb.EntList
+	ExamineListData     = pb.ExamineListData
+	EntListResp         = pb.EntListResp
 	ExamineListResp     = pb.ExamineListResp
+	UserAddReq          = pb.UserAddReq
+	CheckEntResp        = pb.CheckEntResp
+	UserIdReq           = pb.UserIdReq
 
 	UserCenter interface {
 		// 企业认证

+ 29 - 5
service/user.go

@@ -17,7 +17,8 @@ func UserAdd(this *UserAddReq) *UserAddResp {
 		"company":     this.Company,
 		"position":    this.Position,
 		"password":    this.Password,
-		"openid":      this.Openid,
+		"s_openid":    this.SOpenid,
+		"a_openid":    this.AOpenid,
 		"unionid":     this.Unionid,
 		"create_time": time.Now().Format("2006-01-02 15:04:05"),
 	})
@@ -70,27 +71,48 @@ func UserUpdates(this *UserIdReq) bool {
 		set := map[string]interface{}{}
 		if this.Phone != "" {
 			set["phone"] = this.Phone
+		} else {
+			set["phone"] = ""
 		}
 		if this.Nickname != "" {
 			set["nickname"] = this.Nickname
+		} else {
+			set["nickname"] = ""
 		}
 		if this.Headimg != "" {
 			set["headimg"] = this.Headimg
+		} else {
+			set["headimg"] = ""
 		}
 		if this.Company != "" {
 			set["company"] = this.Company
+		} else {
+			set["company"] = ""
 		}
 		if this.Position != "" {
 			set["position"] = this.Position
+		} else {
+			set["position"] = ""
 		}
 		if this.Password != "" {
 			set["password"] = this.Password
+		} else {
+			set["password"] = ""
 		}
-		if this.Openid != "" {
-			set["openid"] = this.Openid
+		if this.AOpenid != "" {
+			set["a_openid"] = this.AOpenid
+		} else {
+			set["a_openid"] = ""
+		}
+		if this.SOpenid != "" {
+			set["s_openid"] = this.SOpenid
+		} else {
+			set["s_openid"] = ""
 		}
 		if this.Unionid != "" {
 			set["unionid"] = this.Unionid
+		} else {
+			set["unionid"] = ""
 		}
 		ok1 := entity.BaseMysql.UpdateByTx(tx, entity.UserTable, map[string]interface{}{"id": this.Id}, set)
 		snapshot := entity.BaseMysql.InsertByTx(tx, entity.UserSnapshotTable, map[string]interface{}{
@@ -102,7 +124,8 @@ func UserUpdates(this *UserIdReq) bool {
 			"company":     this.Company,
 			"position":    this.Position,
 			"password":    this.Password,
-			"openid":      this.Openid,
+			"s_openid":    this.SOpenid,
+			"a_openid":    this.AOpenid,
 			"unionid":     this.Unionid,
 			"create_time": time.Now().Format("2006-01-02 15:04:05"),
 		})
@@ -130,7 +153,8 @@ func UserDels(this *UserIdReq) bool {
 				"company":     thisdata["company"],
 				"position":    thisdata["position"],
 				"password":    thisdata["password"],
-				"openid":      thisdata["openid"],
+				"s_openid":    thisdata["s_openid"],
+				"a_openid":    thisdata["a_openid"],
 				"unionid":     thisdata["unionid"],
 				"create_time": time.Now().Format("2006-01-02 15:04:05"),
 			})