Преглед изворни кода

feat: user 相关接口添加 user_test 和 user_white 关联数据

f-dev пре 5 дана
родитељ
комит
cfc3a008c2
4 измењених фајлова са 92 додато и 14 уклоњено
  1. 9 10
      pb/constant/user.go
  2. 7 0
      pb/gorpc.proto
  3. 69 4
      pb/pb/gorpc.pb.go
  4. 7 0
      pb/user.proto

+ 9 - 10
pb/constant/user.go

@@ -35,16 +35,15 @@ const (
 	UserMemberAccountLevel  = 2
 )
 
-//type UserLevel int64
-
-// 用户等级 用pb.UserLevel ???
-//const (
-//	UserUnknown       UserLevel = 0    // 未知
-//	UserLevelTrial    UserLevel = 1    // 试用 1
-//	UserLevelFree     UserLevel = 2    // 免费 2
-//	UserLevelMember   UserLevel = 3    // 会员 3
-//	UserLevelInternal UserLevel = 9999 // 内部 9999
-//)
+// 从哪里注册
+const (
+	RegistFromUnknown = 0    // 未知
+	RegistFromGuest   = 1    // 游客
+	RegistFromApp     = 2    // App
+	RegistFromWeb     = 3    // Web
+	RegistFromPc      = 4    // pc
+	RegistFromInvalid = 9999 // invalid
+)
 
 const (
 	AccountActivate   = 1

+ 7 - 0
pb/gorpc.proto

@@ -2707,6 +2707,11 @@ message UserVo {
   Status status = 13;         // 状态 1: 正常 2: 冻结
   int64 createTime = 14;      // 创建时间
   int64 updateTime = 15;      // 修改时间
+  int64 whitelistUser = 16;   // 白名单用户 1:是 2:否(来自 user_white,userType=2)
+  int64 testUser = 17;        // 测试用户 1:是 2:否(来自 user_test,userType=2)
+  string mockCountry = 18;    // 指定国家(来自 user_test.area)
+  string mockApi = 19;        // 指定API(来自 user_test.apis)
+  string mockRouter = 20;     // 指定路由(来自 user_test.routers)
 }
 
 message UserAddReq { UserVo vo = 1; }
@@ -2728,6 +2733,8 @@ message UserListReq {
   repeated string uuids = 5;        // 用户唯一ID
   repeated string deviceIds = 6;    // 设备ID (device 表的 id)
   string credentialKeyword = 7;     // 登录凭证模糊搜索(匹配 user_credential.identifier)
+  int64 whitelistUser = 8;          // 筛选白名单:1=白名单用户 2=普通用户
+  int64 testUser = 9;               // 筛选测试用户:1=测试用户 2=普通用户
 }
 message UserListResp {
   int64 total = 1;

+ 69 - 4
pb/pb/gorpc.pb.go

@@ -22533,6 +22533,11 @@ type UserVo struct {
 	Status          Status                 `protobuf:"varint,13,opt,name=status,proto3,enum=gorpc.Status" json:"status,omitempty"` // 状态 1: 正常 2: 冻结
 	CreateTime      int64                  `protobuf:"varint,14,opt,name=createTime,proto3" json:"createTime,omitempty"`           // 创建时间
 	UpdateTime      int64                  `protobuf:"varint,15,opt,name=updateTime,proto3" json:"updateTime,omitempty"`           // 修改时间
+	WhitelistUser   int64                  `protobuf:"varint,16,opt,name=whitelistUser,proto3" json:"whitelistUser,omitempty"`     // 白名单用户 1:是 2:否(来自 user_white,userType=2)
+	TestUser        int64                  `protobuf:"varint,17,opt,name=testUser,proto3" json:"testUser,omitempty"`               // 测试用户 1:是 2:否(来自 user_test,userType=2)
+	MockCountry     string                 `protobuf:"bytes,18,opt,name=mockCountry,proto3" json:"mockCountry,omitempty"`          // 指定国家(来自 user_test.area)
+	MockApi         string                 `protobuf:"bytes,19,opt,name=mockApi,proto3" json:"mockApi,omitempty"`                  // 指定API(来自 user_test.apis)
+	MockRouter      string                 `protobuf:"bytes,20,opt,name=mockRouter,proto3" json:"mockRouter,omitempty"`            // 指定路由(来自 user_test.routers)
 	unknownFields   protoimpl.UnknownFields
 	sizeCache       protoimpl.SizeCache
 }
@@ -22672,6 +22677,41 @@ func (x *UserVo) GetUpdateTime() int64 {
 	return 0
 }
 
+func (x *UserVo) GetWhitelistUser() int64 {
+	if x != nil {
+		return x.WhitelistUser
+	}
+	return 0
+}
+
+func (x *UserVo) GetTestUser() int64 {
+	if x != nil {
+		return x.TestUser
+	}
+	return 0
+}
+
+func (x *UserVo) GetMockCountry() string {
+	if x != nil {
+		return x.MockCountry
+	}
+	return ""
+}
+
+func (x *UserVo) GetMockApi() string {
+	if x != nil {
+		return x.MockApi
+	}
+	return ""
+}
+
+func (x *UserVo) GetMockRouter() string {
+	if x != nil {
+		return x.MockRouter
+	}
+	return ""
+}
+
 type UserAddReq struct {
 	state         protoimpl.MessageState `protogen:"open.v1"`
 	Vo            *UserVo                `protobuf:"bytes,1,opt,name=vo,proto3" json:"vo,omitempty"`
@@ -22989,6 +23029,8 @@ type UserListReq struct {
 	Uuids             []string               `protobuf:"bytes,5,rep,name=uuids,proto3" json:"uuids,omitempty"`                         // 用户唯一ID
 	DeviceIds         []string               `protobuf:"bytes,6,rep,name=deviceIds,proto3" json:"deviceIds,omitempty"`                 // 设备ID (device 表的 id)
 	CredentialKeyword string                 `protobuf:"bytes,7,opt,name=credentialKeyword,proto3" json:"credentialKeyword,omitempty"` // 登录凭证模糊搜索(匹配 user_credential.identifier)
+	WhitelistUser     int64                  `protobuf:"varint,8,opt,name=whitelistUser,proto3" json:"whitelistUser,omitempty"`        // 筛选白名单:1=白名单用户 2=普通用户
+	TestUser          int64                  `protobuf:"varint,9,opt,name=testUser,proto3" json:"testUser,omitempty"`                  // 筛选测试用户:1=测试用户 2=普通用户
 	unknownFields     protoimpl.UnknownFields
 	sizeCache         protoimpl.SizeCache
 }
@@ -23072,6 +23114,20 @@ func (x *UserListReq) GetCredentialKeyword() string {
 	return ""
 }
 
+func (x *UserListReq) GetWhitelistUser() int64 {
+	if x != nil {
+		return x.WhitelistUser
+	}
+	return 0
+}
+
+func (x *UserListReq) GetTestUser() int64 {
+	if x != nil {
+		return x.TestUser
+	}
+	return 0
+}
+
 type UserListResp struct {
 	state         protoimpl.MessageState `protogen:"open.v1"`
 	Total         int64                  `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
@@ -34630,7 +34686,7 @@ const file_gorpc_proto_rawDesc = "" +
 	"\x02vo\x18\x02 \x01(\v2\x16.gorpc.UserAppConfigVoR\x02vo\"X\n" +
 	"\x14UserAppConfigListRes\x12\x14\n" +
 	"\x05total\x18\x01 \x01(\x03R\x05total\x12*\n" +
-	"\x04list\x18\x02 \x03(\v2\x16.gorpc.UserAppConfigVoR\x04list\"\xcd\x03\n" +
+	"\x04list\x18\x02 \x03(\v2\x16.gorpc.UserAppConfigVoR\x04list\"\xeb\x04\n" +
 	"\x06UserVo\x12\x0e\n" +
 	"\x02id\x18\x01 \x01(\x03R\x02id\x12 \n" +
 	"\vproductCode\x18\x02 \x01(\tR\vproductCode\x12\x12\n" +
@@ -34655,7 +34711,14 @@ const file_gorpc_proto_rawDesc = "" +
 	"createTime\x12\x1e\n" +
 	"\n" +
 	"updateTime\x18\x0f \x01(\x03R\n" +
-	"updateTime\"+\n" +
+	"updateTime\x12$\n" +
+	"\rwhitelistUser\x18\x10 \x01(\x03R\rwhitelistUser\x12\x1a\n" +
+	"\btestUser\x18\x11 \x01(\x03R\btestUser\x12 \n" +
+	"\vmockCountry\x18\x12 \x01(\tR\vmockCountry\x12\x18\n" +
+	"\amockApi\x18\x13 \x01(\tR\amockApi\x12\x1e\n" +
+	"\n" +
+	"mockRouter\x18\x14 \x01(\tR\n" +
+	"mockRouter\"+\n" +
 	"\n" +
 	"UserAddReq\x12\x1d\n" +
 	"\x02vo\x18\x01 \x01(\v2\r.gorpc.UserVoR\x02vo\",\n" +
@@ -34672,7 +34735,7 @@ const file_gorpc_proto_rawDesc = "" +
 	"UserGetReq\x12\x1d\n" +
 	"\x02vo\x18\x01 \x01(\v2\r.gorpc.UserVoR\x02vo\",\n" +
 	"\vUserGetResp\x12\x1d\n" +
-	"\x02vo\x18\x01 \x01(\v2\r.gorpc.UserVoR\x02vo\"\xf3\x01\n" +
+	"\x02vo\x18\x01 \x01(\v2\r.gorpc.UserVoR\x02vo\"\xb5\x02\n" +
 	"\vUserListReq\x12\x1f\n" +
 	"\x04page\x18\x01 \x01(\v2\v.gorpc.PageR\x04page\x12\x1d\n" +
 	"\x02vo\x18\x02 \x01(\v2\r.gorpc.UserVoR\x02vo\x12\x1e\n" +
@@ -34682,7 +34745,9 @@ const file_gorpc_proto_rawDesc = "" +
 	"\fproductCodes\x18\x04 \x03(\tR\fproductCodes\x12\x14\n" +
 	"\x05uuids\x18\x05 \x03(\tR\x05uuids\x12\x1c\n" +
 	"\tdeviceIds\x18\x06 \x03(\tR\tdeviceIds\x12,\n" +
-	"\x11credentialKeyword\x18\a \x01(\tR\x11credentialKeyword\"G\n" +
+	"\x11credentialKeyword\x18\a \x01(\tR\x11credentialKeyword\x12$\n" +
+	"\rwhitelistUser\x18\b \x01(\x03R\rwhitelistUser\x12\x1a\n" +
+	"\btestUser\x18\t \x01(\x03R\btestUser\"G\n" +
 	"\fUserListResp\x12\x14\n" +
 	"\x05total\x18\x01 \x01(\x03R\x05total\x12!\n" +
 	"\x04list\x18\x02 \x03(\v2\r.gorpc.UserVoR\x04list\"\xe7\x02\n" +

+ 7 - 0
pb/user.proto

@@ -274,6 +274,11 @@ message UserVo {
   Status status = 13;         // 状态 1: 正常 2: 冻结
   int64 createTime = 14;      // 创建时间
   int64 updateTime = 15;      // 修改时间
+  int64 whitelistUser = 16;   // 白名单用户 1:是 2:否(来自 user_white,userType=2)
+  int64 testUser = 17;        // 测试用户 1:是 2:否(来自 user_test,userType=2)
+  string mockCountry = 18;    // 指定国家(来自 user_test.area)
+  string mockApi = 19;        // 指定API(来自 user_test.apis)
+  string mockRouter = 20;     // 指定路由(来自 user_test.routers)
 }
 
 message UserAddReq { UserVo vo = 1; }
@@ -295,6 +300,8 @@ message UserListReq {
   repeated string uuids = 5;        // 用户唯一ID
   repeated string deviceIds = 6;    // 设备ID (device 表的 id)
   string credentialKeyword = 7;     // 登录凭证模糊搜索(匹配 user_credential.identifier)
+  int64 whitelistUser = 8;          // 筛选白名单:1=白名单用户 2=普通用户
+  int64 testUser = 9;               // 筛选测试用户:1=测试用户 2=普通用户
 }
 message UserListResp {
   int64 total = 1;