|
- syntax = "proto3";
-
- package adminserver.api.v1;
-
- option go_package = "server/admin-server/api/v1;v1";
-
-
-
- import "google/api/annotations.proto";
- import "validate/validate.proto";
- import "server/admin-server/api/v1/workspace.proto";
- import "server/common/api/v1/configkey.proto";
- import "server/common/api/v1/common.proto";
-
- service User {
- rpc ListUser (ListUserRequest) returns (ListUserReply) {
- option (google.api.http) = {
- get: "/v1/usermanage/user"
- };
- };
- rpc GetUser (GetUserRequest) returns (GetUserReply) {
- option (google.api.http) = {
- get: "/v1/usermanage/user/{userId}"
- };
- };
- rpc AddUser (AddUserRequest) returns (AddUserReply) {
- option (google.api.http) = {
- post: "/v1/usermanage/user"
- body: "*"
- };
- };
- rpc UpdateUser (UpdateUserRequest) returns (UpdateUserReply) {
- option (google.api.http) = {
- put: "/v1/usermanage/user/{userId}"
- body: "user"
- };
- };
- rpc FreezeUser (FreezeUserRequest) returns (FreezeUserReply) {
- option (google.api.http) = {
- post: "/v1/usermanage/user/{userId}/freeze"
- };
- };
- rpc ThawUser (ThawUserRequest) returns (ThawUserReply) {
- option (google.api.http) = {
- post: "/v1/usermanage/user/{userId}/thaw"
- };
- };
- // 查询配置key列表
- rpc ListUserConfigKey (ListUserConfigKeyRequest) returns (ListUserConfigKeyReply) {
- option (google.api.http) = {
- get: "/v1/usermanage/userconfigkey"
- };
- }
- // 查询用户配置
- rpc GetUserConfig (GetUserConfigRequest) returns (GetUserConfigReply) {
- option (google.api.http) = {
- get: "/v1/usermanage/user/{userId}/config"
- };
- };
-
- // 更新用户配置
- rpc UpdateUserConfig (UpdateUserConfigRequest) returns (UpdateUserConfigReply) {
- option (google.api.http) = {
- put: "/v1/usermanage/user/{userId}/config"
- body: "*"
- };
- };
-
- rpc UpdateUserMinioAccount (UpdateUserMinioAccountRequest) returns (UpdateUserMinioAccountReply) {
- option (google.api.http) = {
- put: "/v1/usermanage/user/{userId}/minioaccount"
- body: "*"
- };
- };
-
- rpc UpdateUserMinioBuckets (UpdateUserMinioBucketsRequest) returns (UpdateUserMinioBucketsReply) {
- option (google.api.http) = {
- put: "/v1/usermanage/user/{userId}/miniobuckets"
- body: "*"
- };
- };
- }
-
- message UserItem {
- string id = 1;
- int64 createdAt = 2;
- int64 updatedAt = 3;
- string fullName = 4;
- string email = 5;
- string phone = 6;
- int32 gender = 7;
- int32 status = 8;
- repeated string resourcePools = 9;
- string desc=10;
- common.api.v1.UserPermission permission = 11;
- repeated string buckets = 12;
- string minioUserName = 13;
- repeated common.api.v1.Bind bind = 14;
- }
-
- message ListUserRequest {
- uint32 pageIndex = 1 [(validate.rules).uint32 = {gte:1}];
- // 页大小,最小1条,最大100条
- uint32 pageSize = 2 [(validate.rules).uint32 = {gte:1,lte:100}];
- string sortBy = 3 [(validate.rules).string = {in: ["", "asc", "desc"]}];
- string orderBy = 4 [(validate.rules).string = {max_len: 20}];
- string fullName = 5 [(validate.rules).string = {max_len: 30}];
- string email = 6 [(validate.rules).string = {email: true, ignore_empty:true}];
- string phone = 7 [(validate.rules).string = {pattern: "^(13|14|15|17|18|19)[0-9]{9}$", ignore_empty:true}];
- string searchKey = 8 [(validate.rules).string = {max_len: 50}];
- int32 status = 9 [(validate.rules).int32 = {in: [1,2],ignore_empty: true}];
- }
-
- message ListUserReply {
- int64 totalSize = 1;
- repeated UserItem users = 2;
- }
-
- message GetUserRequest {
- string userId = 1 [(validate.rules).string = {min_len: 1, max_len: 36}];
- }
-
- message GetUserReply {
- UserItem user = 1;
- repeated adminserver.api.v1.WorkspaceItem workspaces = 2;
- }
-
- message AddUserRequest {
- string fullName = 1 [(validate.rules).string = {min_len: 1, max_len: 30}];
- string email = 2 [(validate.rules).string = {email: true}];
- string phone = 3 [(validate.rules).string = {pattern: "^(13|14|15|17|18|19)[0-9]{9}$", ignore_empty:true}];
- string password = 4 [(validate.rules).string = {min_len: 8, max_len: 30}];
- int32 gender = 5 [(validate.rules).int32 = {in: [1,2]}];
- string desc = 6 ;
- }
-
- message AddUserReply {
- string id = 1;
- }
-
- message UpdateUserRequest {
- string userId = 1 [(validate.rules).string = {min_len: 1, max_len: 36}];
- message UpdateItem {
- string fullName = 1 [(validate.rules).string = {max_len: 30}];
- string password = 2 [(validate.rules).string = {min_len: 8, max_len: 30, ignore_empty:true}];
- string phone = 3 [(validate.rules).string = {pattern: "^(13|14|15|17|18|19)[0-9]{9}$", ignore_empty:true}];
- int32 gender = 4 [(validate.rules).int32 = {in: [1,2],ignore_empty: true}];
- repeated string resourcePools = 5;
- string desc = 6 ;
- common.api.v1.UserPermission permission = 7;
- }
- UpdateItem user = 2 [(validate.rules).message.required = true];
- }
-
- message UpdateUserReply {
- UserItem user = 1;
- }
-
- message FreezeUserRequest {
- string userId = 1 [(validate.rules).string = {min_len: 1, max_len: 36}];
- }
-
- message FreezeUserReply {
- int64 freezedAt = 1;
- }
-
- message ThawUserRequest {
- string userId = 1 [(validate.rules).string = {min_len: 1, max_len: 36}];
- }
-
- message ThawUserReply {
- int64 thawedAt = 1;
- }
-
- message ListUserConfigKeyRequest {
-
- }
-
- message ListUserConfigKeyReply {
- repeated common.api.v1.ConfigKey configKeys = 1;
- }
-
- message GetUserConfigRequest {
- string userId = 1;
- }
-
- message GetUserConfigReply {
- map<string, string> config = 1;
- }
-
- message UpdateUserConfigRequest {
- string userId = 1[(validate.rules).string = {min_len: 1}];
- map<string, string> config = 2[(validate.rules).map.min_pairs = 1];
- }
-
- message UpdateUserConfigReply {
-
- }
-
- message UpdateUserMinioAccountRequest {
- string userId = 1;
- string minioUserName = 2;
- string minioPassword = 3;
- }
-
- message UpdateUserMinioAccountReply {
-
- }
-
- message UpdateUserMinioBucketsRequest {
- string userId = 1;
- repeated string buckets = 2;
- }
-
- message UpdateUserMinioBucketsReply {
-
- }
|