2637309949 %!s(int64=4) %!d(string=hai) anos
pai
achega
5014d7d653
Modificáronse 3 ficheiros con 24 adicións e 33 borrados
  1. 3 2
      internal/logic/getuserlogic.go
  2. 4 5
      transform.proto
  3. 17 26
      transform/transform.pb.go

+ 3 - 2
internal/logic/getuserlogic.go

@@ -49,12 +49,13 @@ func (l *GetUserLogic) GetUser(in *transform.UserRequest) (*transform.UserRespon
 	ext, err := l.svcCtx.ErpUtil.InRoles(user.Id, "TMKZHUGUAN", "LAMK", "TMKmanager", "TMKassistant", "NetTMKdirector", "NetTMKassistant", "LAMKM", "LATMK")
 	if err != nil {
 		return &tfr, nil
+	} else if ext {
+		tfr.ErpType = 1
 	}
-	tfr.IsJzMk = ext
 	if in.Phone != "" {
 		mk, err := l.svcCtx.MktPartTimeUser.FindOneByPhone(in.Phone)
 		if err == nil && mk.Id != 0 {
-			tfr.IsJzMem = true
+			tfr.ErpType = 2
 			return &tfr, nil
 		}
 	}

+ 4 - 5
transform.proto

@@ -9,11 +9,10 @@ message UserRequest {
 
 message UserResponse {
   string id = 1;
-  string phone = 2;
-  string roles = 3;
-  int64 status = 4;
-  bool isJzMem = 5;
-  bool isJzMk  = 6;
+  string phone  = 2;
+  string roles  = 3;
+  int64 status  = 4;
+  int64 erpType = 5;
 }
 
 service Transform {

+ 17 - 26
transform/transform.pb.go

@@ -76,8 +76,7 @@ type UserResponse struct {
 	Phone                string   `protobuf:"bytes,2,opt,name=phone,proto3" json:"phone,omitempty"`
 	Roles                string   `protobuf:"bytes,3,opt,name=roles,proto3" json:"roles,omitempty"`
 	Status               int64    `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"`
-	IsJzMem              bool     `protobuf:"varint,5,opt,name=isJzMem,proto3" json:"isJzMem,omitempty"`
-	IsJzMk               bool     `protobuf:"varint,6,opt,name=isJzMk,proto3" json:"isJzMk,omitempty"`
+	ErpType              int64    `protobuf:"varint,5,opt,name=erpType,proto3" json:"erpType,omitempty"`
 	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 	XXX_unrecognized     []byte   `json:"-"`
 	XXX_sizecache        int32    `json:"-"`
@@ -136,18 +135,11 @@ func (m *UserResponse) GetStatus() int64 {
 	return 0
 }
 
-func (m *UserResponse) GetIsJzMem() bool {
+func (m *UserResponse) GetErpType() int64 {
 	if m != nil {
-		return m.IsJzMem
+		return m.ErpType
 	}
-	return false
-}
-
-func (m *UserResponse) GetIsJzMk() bool {
-	if m != nil {
-		return m.IsJzMk
-	}
-	return false
+	return 0
 }
 
 func init() {
@@ -158,20 +150,19 @@ func init() {
 func init() { proto.RegisterFile("transform.proto", fileDescriptor_cb4a498eeb2ba07d) }
 
 var fileDescriptor_cb4a498eeb2ba07d = []byte{
-	// 203 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2f, 0x29, 0x4a, 0xcc,
-	0x2b, 0x4e, 0xcb, 0x2f, 0xca, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x84, 0x0b, 0x28,
-	0x19, 0x73, 0x71, 0x87, 0x16, 0xa7, 0x16, 0x05, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x08, 0xf1,
-	0x71, 0x31, 0x65, 0xa6, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x31, 0x65, 0xa6, 0x08, 0x89,
-	0x70, 0xb1, 0x16, 0x64, 0xe4, 0xe7, 0xa5, 0x4a, 0x30, 0x81, 0x85, 0x20, 0x1c, 0xa5, 0x29, 0x8c,
-	0x5c, 0x3c, 0x10, 0x5d, 0xc5, 0x05, 0xf9, 0x79, 0xc5, 0xa9, 0xc4, 0x69, 0x03, 0x89, 0x16, 0xe5,
-	0xe7, 0xa4, 0x16, 0x4b, 0x30, 0x43, 0x44, 0xc1, 0x1c, 0x21, 0x31, 0x2e, 0xb6, 0xe2, 0x92, 0xc4,
-	0x92, 0xd2, 0x62, 0x09, 0x16, 0x05, 0x46, 0x0d, 0xe6, 0x20, 0x28, 0x4f, 0x48, 0x82, 0x8b, 0x3d,
-	0xb3, 0xd8, 0xab, 0xca, 0x37, 0x35, 0x57, 0x82, 0x55, 0x81, 0x51, 0x83, 0x23, 0x08, 0xc6, 0x05,
-	0xe9, 0x00, 0x33, 0xb3, 0x25, 0xd8, 0xc0, 0x12, 0x50, 0x9e, 0x91, 0x3b, 0x17, 0x67, 0x08, 0xcc,
-	0x63, 0x42, 0x56, 0x5c, 0xec, 0xee, 0xa9, 0x25, 0x20, 0x57, 0x0a, 0x89, 0xe9, 0x21, 0x02, 0x00,
-	0xc9, 0xb3, 0x52, 0xe2, 0x18, 0xe2, 0x10, 0xef, 0x24, 0xb1, 0x81, 0x83, 0xc9, 0x18, 0x10, 0x00,
-	0x00, 0xff, 0xff, 0x14, 0x18, 0x85, 0x2f, 0x39, 0x01, 0x00, 0x00,
+	// 188 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0xc1, 0x0a, 0x82, 0x40,
+	0x10, 0x86, 0x51, 0x53, 0x71, 0x8a, 0x82, 0x25, 0x6c, 0xe9, 0x24, 0x9e, 0x3c, 0x79, 0xc8, 0x5b,
+	0x2f, 0xe0, 0x5d, 0xec, 0x01, 0x0c, 0x27, 0x12, 0xca, 0xdd, 0x76, 0xd6, 0x43, 0xd0, 0xc3, 0x87,
+	0xbb, 0x59, 0x41, 0x97, 0x8e, 0xdf, 0x37, 0xfc, 0xf0, 0xff, 0x03, 0x2b, 0xad, 0x9a, 0x9e, 0x4e,
+	0x42, 0x5d, 0x73, 0xa9, 0x84, 0x16, 0x2c, 0x7a, 0x8b, 0xb4, 0x80, 0xf9, 0x81, 0x50, 0x55, 0x78,
+	0x1b, 0x90, 0x34, 0x5b, 0x82, 0xdb, 0xb5, 0xdc, 0x49, 0x9c, 0x2c, 0xaa, 0xdc, 0xae, 0x65, 0x6b,
+	0xf0, 0xe5, 0x59, 0xf4, 0xc8, 0x5d, 0xa3, 0x2c, 0xa4, 0x0f, 0x58, 0xd8, 0x10, 0x49, 0xd1, 0x13,
+	0xfe, 0x97, 0x1a, 0xad, 0x12, 0x17, 0x24, 0xee, 0x59, 0x6b, 0x80, 0xc5, 0x10, 0x90, 0x6e, 0xf4,
+	0x40, 0x7c, 0x96, 0x38, 0x99, 0x57, 0xbd, 0x88, 0x71, 0x08, 0x51, 0xc9, 0xfa, 0x2e, 0x91, 0xfb,
+	0xe6, 0x30, 0xe1, 0xae, 0x84, 0xa8, 0x9e, 0xfa, 0xb3, 0x3d, 0x84, 0x25, 0xea, 0xb1, 0x0d, 0x8b,
+	0xf3, 0xcf, 0xce, 0xaf, 0x4d, 0xdb, 0xcd, 0x8f, 0xb7, 0xb5, 0x8f, 0x81, 0xf9, 0x46, 0xf1, 0x0c,
+	0x00, 0x00, 0xff, 0xff, 0xf2, 0x7a, 0x44, 0x91, 0x20, 0x01, 0x00, 0x00,
 }
 
 // Reference imports to suppress errors if they are not otherwise used.