Ver código fonte

perf: user 表字段类型调整

BaiLuoYan 2 meses atrás
pai
commit
efc28926c3
3 arquivos alterados com 61 adições e 61 exclusões
  1. 29 29
      pb/gorpc.proto
  2. 3 3
      pb/pb/gorpc.pb.go
  3. 29 29
      pb/user.proto

+ 29 - 29
pb/gorpc.proto

@@ -1975,27 +1975,27 @@ service GoSysClient {
 
 
 
-//白名单表
-message UserWhiteVo{
-  int64 id = 1;                // 主键ID
-  int64 userId = 2;            // 用户
-  UserType userType = 3;       //用户类型 1 设备 2 账号
-  Status status = 4;           // 状态
-  int64 createTime = 5;        // 创建时间
-  int64 updateTime = 6;        // 更新时间
-}
-
-//测试用户表
-message UserTestVo{
-  int64 id = 1;                 // 主键ID
-  int64 userId = 2;             // 用户
-  UserType userType = 3;        //用户类型 1 设备 2 账号
-  string area = 4;              // 指定地区
-  string apis = 5;              // 指定接口
-  string routers = 6;           // 指定路由
-  Status status = 7;            // 状态
-  int64 createTime = 8;         // 创建时间
-  int64 updateTime = 9;         // 更新时间
+// 白名单表
+message UserWhiteVo {
+  int64 id = 1;          // 主键ID
+  int64 userId = 2;      // 用户
+  UserType userType = 3; // 用户类型 1 设备 2 账号
+  Status status = 4;     // 状态
+  int64 createTime = 5;  // 创建时间
+  int64 updateTime = 6;  // 更新时间
+}
+
+// 测试用户表
+message UserTestVo {
+  int64 id = 1;          // 主键ID
+  int64 userId = 2;      // 用户
+  UserType userType = 3; // 用户类型 1 设备 2 账号
+  string area = 4;       // 指定地区
+  string apis = 5;       // 指定接口
+  string routers = 6;    // 指定路由
+  Status status = 7;     // 状态
+  int64 createTime = 8;  // 创建时间
+  int64 updateTime = 9;  // 更新时间
 }
 
 // Account
@@ -2144,7 +2144,7 @@ message DeviceVo {
   string mockRouter = 28;   // 指定路由
   string referSubChannel = 29;
   string firebaseToken = 30; // firebase token
-  string appVerName = 31; // 版本
+  string appVerName = 31;    // 版本
 }
 
 message DeviceListReq {
@@ -2155,9 +2155,9 @@ message DeviceListReq {
   repeated string dateRange = 5;    // 日期范围
   int64 createStartTime = 6;        // 创建开始时间
   int64 createEndTime = 7;          // 创建结束时间
-  repeated string deviceIds = 8; // 设备IDs
-  string country = 9; // 国家
-  string vn = 10; // 运营商
+  repeated string deviceIds = 8;    // 设备IDs
+  string country = 9;               // 国家
+  string vn = 10;                   // 运营商
 }
 message DeviceListRes {
   int64 total = 1;
@@ -2188,7 +2188,7 @@ message DeviceUpdateFirebaseTokenReq {
   string deviceId = 1;
   // firebaseToken
   string firebaseToken = 2;
-  string productCode =3;
+  string productCode = 3;
 }
 
 message DeviceAddFirebaseTokenReq {
@@ -2208,7 +2208,7 @@ message UserVo {
   string productCode = 2;     // 产品标识
   string uuid = 3;            // 用户唯一ID
   string deviceId = 4;        // 注册时使用的设备ID
-  int64 accountType = 5;      // 1: device 2: account (其实可以通过查询 user_credential 中有没有登录凭证来确定此账号是已注册的账号还是游客类型的账号)
+  int64 accountType = 5;      // 值为1时表示实体尚未注册账号, 为其他值时表示实体已经注册了账号
   string registType = 6;      // 注册方式 normal email phone wechat qq google apple (其实可以通过查询 user_credential 中最早的一条记录的 identityType 来确定)
   int64 registFrom = 7;       // 从哪里注册 0: unknown 1: guest 2: app 3: web 4: pc 9999: invalid
   string referChannel = 8;    // 推广渠道
@@ -2333,9 +2333,9 @@ service GoUserClient {
   rpc DeviceDel(Ids) returns (Empty);
   rpc DeviceGet(DeviceVo) returns (DeviceVo);
   rpc DeviceList(DeviceListReq) returns (DeviceListRes);
-  rpc DeviceAddFirebaseToken (DeviceAddFirebaseTokenReq) returns (Empty);
+  rpc DeviceAddFirebaseToken(DeviceAddFirebaseTokenReq) returns (Empty);
   rpc DeviceUpdateFirebaseToken(DeviceUpdateFirebaseTokenReq) returns (Empty);
-  rpc DeviceFirebaseTokenMap (DeviceFirebaseTokenMapReq) returns (DeviceFirebaseTokenMapRes);
+  rpc DeviceFirebaseTokenMap(DeviceFirebaseTokenMapReq) returns (DeviceFirebaseTokenMapRes);
 
   // Account Model
   // AccountAdd

+ 3 - 3
pb/pb/gorpc.pb.go

@@ -14304,7 +14304,7 @@ type UserWhiteVo struct {
 	state         protoimpl.MessageState `protogen:"open.v1"`
 	Id            int64                  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`                                 // 主键ID
 	UserId        int64                  `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"`                         // 用户
-	UserType      UserType               `protobuf:"varint,3,opt,name=userType,proto3,enum=gorpc.UserType" json:"userType,omitempty"` //用户类型 1 设备 2 账号
+	UserType      UserType               `protobuf:"varint,3,opt,name=userType,proto3,enum=gorpc.UserType" json:"userType,omitempty"` // 用户类型 1 设备 2 账号
 	Status        Status                 `protobuf:"varint,4,opt,name=status,proto3,enum=gorpc.Status" json:"status,omitempty"`       // 状态
 	CreateTime    int64                  `protobuf:"varint,5,opt,name=createTime,proto3" json:"createTime,omitempty"`                 // 创建时间
 	UpdateTime    int64                  `protobuf:"varint,6,opt,name=updateTime,proto3" json:"updateTime,omitempty"`                 // 更新时间
@@ -14389,7 +14389,7 @@ type UserTestVo struct {
 	state         protoimpl.MessageState `protogen:"open.v1"`
 	Id            int64                  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`                                 // 主键ID
 	UserId        int64                  `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"`                         // 用户
-	UserType      UserType               `protobuf:"varint,3,opt,name=userType,proto3,enum=gorpc.UserType" json:"userType,omitempty"` //用户类型 1 设备 2 账号
+	UserType      UserType               `protobuf:"varint,3,opt,name=userType,proto3,enum=gorpc.UserType" json:"userType,omitempty"` // 用户类型 1 设备 2 账号
 	Area          string                 `protobuf:"bytes,4,opt,name=area,proto3" json:"area,omitempty"`                              // 指定地区
 	Apis          string                 `protobuf:"bytes,5,opt,name=apis,proto3" json:"apis,omitempty"`                              // 指定接口
 	Routers       string                 `protobuf:"bytes,6,opt,name=routers,proto3" json:"routers,omitempty"`                        // 指定路由
@@ -16883,7 +16883,7 @@ type UserVo struct {
 	ProductCode     string                 `protobuf:"bytes,2,opt,name=productCode,proto3" json:"productCode,omitempty"`           // 产品标识
 	Uuid            string                 `protobuf:"bytes,3,opt,name=uuid,proto3" json:"uuid,omitempty"`                         // 用户唯一ID
 	DeviceId        string                 `protobuf:"bytes,4,opt,name=deviceId,proto3" json:"deviceId,omitempty"`                 // 注册时使用的设备ID
-	AccountType     int64                  `protobuf:"varint,5,opt,name=accountType,proto3" json:"accountType,omitempty"`          // 1: device 2: account (其实可以通过查询 user_credential 中有没有登录凭证来确定此账号是已注册的账号还是游客类型的账号)
+	AccountType     int64                  `protobuf:"varint,5,opt,name=accountType,proto3" json:"accountType,omitempty"`          // 值为1时表示实体尚未注册账号, 为其他值时表示实体已经注册了账号
 	RegistType      string                 `protobuf:"bytes,6,opt,name=registType,proto3" json:"registType,omitempty"`             // 注册方式 normal email phone wechat qq google apple (其实可以通过查询 user_credential 中最早的一条记录的 identityType 来确定)
 	RegistFrom      int64                  `protobuf:"varint,7,opt,name=registFrom,proto3" json:"registFrom,omitempty"`            // 从哪里注册 0: unknown 1: guest 2: app 3: web 4: pc 9999: invalid
 	ReferChannel    string                 `protobuf:"bytes,8,opt,name=referChannel,proto3" json:"referChannel,omitempty"`         // 推广渠道

+ 29 - 29
pb/user.proto

@@ -5,27 +5,27 @@ option go_package = "code.clickto.dev/nomo-server/go-service-pb/client";
 
 import "pb/common.proto";
 
-//白名单表
-message UserWhiteVo{
-  int64 id = 1;                // 主键ID
-  int64 userId = 2;            // 用户
-  UserType userType = 3;       //用户类型 1 设备 2 账号
-  Status status = 4;           // 状态
-  int64 createTime = 5;        // 创建时间
-  int64 updateTime = 6;        // 更新时间
-}
-
-//测试用户表
-message UserTestVo{
-  int64 id = 1;                 // 主键ID
-  int64 userId = 2;             // 用户
-  UserType userType = 3;        //用户类型 1 设备 2 账号
-  string area = 4;              // 指定地区
-  string apis = 5;              // 指定接口
-  string routers = 6;           // 指定路由
-  Status status = 7;            // 状态
-  int64 createTime = 8;         // 创建时间
-  int64 updateTime = 9;         // 更新时间
+// 白名单表
+message UserWhiteVo {
+  int64 id = 1;          // 主键ID
+  int64 userId = 2;      // 用户
+  UserType userType = 3; // 用户类型 1 设备 2 账号
+  Status status = 4;     // 状态
+  int64 createTime = 5;  // 创建时间
+  int64 updateTime = 6;  // 更新时间
+}
+
+// 测试用户表
+message UserTestVo {
+  int64 id = 1;          // 主键ID
+  int64 userId = 2;      // 用户
+  UserType userType = 3; // 用户类型 1 设备 2 账号
+  string area = 4;       // 指定地区
+  string apis = 5;       // 指定接口
+  string routers = 6;    // 指定路由
+  Status status = 7;     // 状态
+  int64 createTime = 8;  // 创建时间
+  int64 updateTime = 9;  // 更新时间
 }
 
 // Account
@@ -174,7 +174,7 @@ message DeviceVo {
   string mockRouter = 28;   // 指定路由
   string referSubChannel = 29;
   string firebaseToken = 30; // firebase token
-  string appVerName = 31; // 版本
+  string appVerName = 31;    // 版本
 }
 
 message DeviceListReq {
@@ -185,9 +185,9 @@ message DeviceListReq {
   repeated string dateRange = 5;    // 日期范围
   int64 createStartTime = 6;        // 创建开始时间
   int64 createEndTime = 7;          // 创建结束时间
-  repeated string deviceIds = 8; // 设备IDs
-  string country = 9; // 国家
-  string vn = 10; // 运营商
+  repeated string deviceIds = 8;    // 设备IDs
+  string country = 9;               // 国家
+  string vn = 10;                   // 运营商
 }
 message DeviceListRes {
   int64 total = 1;
@@ -218,7 +218,7 @@ message DeviceUpdateFirebaseTokenReq {
   string deviceId = 1;
   // firebaseToken
   string firebaseToken = 2;
-  string productCode =3;
+  string productCode = 3;
 }
 
 message DeviceAddFirebaseTokenReq {
@@ -238,7 +238,7 @@ message UserVo {
   string productCode = 2;     // 产品标识
   string uuid = 3;            // 用户唯一ID
   string deviceId = 4;        // 注册时使用的设备ID
-  int64 accountType = 5;      // 1: device 2: account (其实可以通过查询 user_credential 中有没有登录凭证来确定此账号是已注册的账号还是游客类型的账号)
+  int64 accountType = 5;      // 值为1时表示实体尚未注册账号, 为其他值时表示实体已经注册了账号(为了让 productCode+deviceId+accountType 能唯一确定一个用户)
   string registType = 6;      // 注册方式 normal email phone wechat qq google apple (其实可以通过查询 user_credential 中最早的一条记录的 identityType 来确定)
   int64 registFrom = 7;       // 从哪里注册 0: unknown 1: guest 2: app 3: web 4: pc 9999: invalid
   string referChannel = 8;    // 推广渠道
@@ -363,9 +363,9 @@ service GoUserClient {
   rpc DeviceDel(Ids) returns (Empty);
   rpc DeviceGet(DeviceVo) returns (DeviceVo);
   rpc DeviceList(DeviceListReq) returns (DeviceListRes);
-  rpc DeviceAddFirebaseToken (DeviceAddFirebaseTokenReq) returns (Empty);
+  rpc DeviceAddFirebaseToken(DeviceAddFirebaseTokenReq) returns (Empty);
   rpc DeviceUpdateFirebaseToken(DeviceUpdateFirebaseTokenReq) returns (Empty);
-  rpc DeviceFirebaseTokenMap (DeviceFirebaseTokenMapReq) returns (DeviceFirebaseTokenMapRes);
+  rpc DeviceFirebaseTokenMap(DeviceFirebaseTokenMapReq) returns (DeviceFirebaseTokenMapRes);
 
   // Account Model
   // AccountAdd