github.com/infraboard/keyauth@v0.8.1/apps/user/pb/request.proto (about)

     1  syntax = "proto3";
     2  
     3  package infraboard.keyauth.user;
     4  option go_package = "github.com/infraboard/keyauth/apps/user";
     5  
     6  import "github.com/infraboard/mcube/pb/page/page.proto";
     7  import "apps/user/pb/enum.proto";
     8  import "apps/user/pb/types.proto";
     9  import "common/types/types.proto";
    10  
    11  // Profile todo
    12  message Profile {
    13      // 用户真实姓名
    14      // @gotags: bson:"real_name" json:"real_name" validate:"lte=10"
    15      string real_name = 1;
    16      // 用户昵称, 用于在界面进行展示
    17      // @gotags: bson:"nick_name" json:"nick_name" validate:"lte=30"
    18      string nick_name = 2;
    19      // 手机号码, 用户可以通过手机进行注册和密码找回, 还可以通过手机号进行登录
    20      // @gotags: bson:"phone" json:"phone" validate:"lte=30"
    21      string phone = 3;
    22      // 邮箱, 用户可以通过邮箱进行注册和照明密码
    23      // @gotags: bson:"email" json:"email" validate:"lte=30"
    24      string email = 4;
    25      // 用户住址
    26      // @gotags: bson:"address" json:"address" validate:"lte=120"
    27      string address = 5;
    28      // 性别
    29      // @gotags: bson:"gender" json:"gender" validate:"lte=10"
    30      Gender gender = 6;
    31      // 头像
    32      // @gotags: bson:"avatar" json:"avatar" validate:"lte=300"
    33      string avatar = 7;
    34      // 用户使用的语言
    35      // @gotags: bson:"language" json:"language" validate:"lte=40"
    36      string language = 8;
    37      // 用户所在的城市
    38      // @gotags: bson:"city" json:"city" validate:"lte=40"
    39      string city = 9;
    40      // 用户所在的省
    41      // @gotags: bson:"province" json:"province" validate:"lte=40"
    42      string province = 10;                
    43  }
    44  
    45  // CreateAccountRequest 创建用户请求
    46  message CreateAccountRequest {
    47      // 域信息
    48      // @gotags: json:"domain" validate:"required"
    49      string domain = 9;
    50      // 创建方式
    51      // @gotags: json:"create_type"
    52      CreateType create_type = 1;
    53      // 用户类型
    54      // @gotags: json:"user_type"
    55      UserType user_type = 2;
    56      // 用户所属部门
    57      // @gotags: json:"department_id" validate:"lte=200"
    58      string department_id = 3;
    59      // 用户账号名称
    60      // @gotags: json:"account" validate:"required,lte=60"
    61      string account = 4;
    62      // 用户多久未登录时(天), 冻结改用户, 防止僵尸用户的账号被利用'
    63      // @gotags: json:"expires_days"
    64      int32 expires_days = 5;
    65      // 用户描述
    66      // @gotags: json:"description"
    67      string description = 6;
    68      // 数据
    69      // @gotags: json:"profile"
    70      Profile profile = 7;
    71      // 密码相关信息
    72      // @gotags: json:"password" validate:"required,lte=80"
    73      string password = 8;
    74  }
    75  
    76  // DescribeAccountRequest 查询用户详情请求
    77  message DescribeAccountRequest {
    78      // 用户账号名称
    79      // @gotags: json:"account" validate:"required,lte=60"
    80      string account = 1;
    81  }
    82  
    83  // QueryAccountRequest 获取子账号列表
    84  message QueryAccountRequest {
    85      // @gotags: json:"page"
    86     infraboard.mcube.page.PageRequest page = 1;
    87      // @gotags: json:"accounts"
    88      repeated string accounts = 2;
    89      // @gotags: json:"user_type"
    90      UserType user_type = 3;
    91      // @gotags: json:"namespace_id"
    92      string namespace_id = 4;
    93      // @gotags: json:"with_department"
    94      bool with_department = 5;
    95      // @gotags: json:"department_id"
    96      string department_id = 6;
    97      // @gotags: json:"with_all_sub"
    98      bool with_all_sub = 7;
    99      // @gotags: json:"skip_items"
   100      bool skip_items = 8;
   101      // @gotags: json:"keywords"
   102      string keywords = 9;
   103      // @gotags: json:"domain"
   104      string domain = 10;
   105  }
   106  
   107  // UpdateAccountRequest todo
   108  message UpdateAccountRequest {
   109      // 更新模式
   110      // @gotags: json:"update_mode"
   111      infraboard.keyauth.types.UpdateMode update_mode = 1;
   112      // 用户账号名称
   113      // @gotags: json:"account" validate:"required,lte=120"
   114      string account = 2;
   115      // 用户所属部门
   116      // @gotags: json:"department_id"
   117      string department_id = 3;
   118      // profile 账号profile
   119      // @gotags: json:"profile"
   120  	Profile profile = 4;
   121  }
   122  
   123  // UpdatePasswordRequest todo
   124  message UpdatePasswordRequest {
   125      // @gotags: json:"account"
   126      string account = 1;
   127      // @gotags: json:"old_pass"
   128      string old_pass = 2;
   129      // @gotags: json:"new_pass"
   130      string new_pass = 3;
   131      // @gotags: json:"is_reset"
   132      bool is_reset = 4;
   133  }
   134  
   135  // GeneratePasswordRequest todo
   136  message GeneratePasswordRequest {
   137      // @gotags: json:"length"
   138      int32 length = 1;
   139      // @gotags: json:"domain"
   140      string domain = 2;
   141  }
   142  
   143  // GeneratePasswordResponse todo
   144  message GeneratePasswordResponse {
   145      // @gotags: json:"password"
   146      string password = 1;
   147  }
   148  
   149  // BlockAccountRequest 冻结用户
   150  message BlockAccountRequest {
   151      // @gotags: json:"account"
   152      string account = 1;
   153      // @gotags: json:"reason"
   154      string reason = 2;
   155  }
   156  
   157  // UnBlockAccountRequest 解冻用户
   158  message UnBlockAccountRequest {
   159      // @gotags: json:"account"
   160      string account = 1;
   161  }
   162  
   163  // DeleteAccountRequest 删除账户
   164  message DeleteAccountRequest {
   165      // @gotags: json:"account"
   166      string account = 1;
   167  }