syntax = "proto3";

package iam;

option go_package = "./iam";

service Iam {
  // 校验Token
  rpc CheckToken(CheckTokenReq) returns (CheckTokenResp) {}
  // 删除Token
  rpc DeleteToken(DeleteTokenReq) returns (DeleteTokenResp) {}
  // 根据ID获取管理员信息
  rpc GetAdminUserByID(GetAdminUserByIDReq) returns (GetAdminUserByIDResp) {}
  // 批量获取管理员信息
  rpc BatchGetAdminUser(BatchGetAdminUserReq) returns (BatchGetAdminUserResp) {}
  // 根据昵称获取管理员信息
  rpc GetAdminUserByNickName(GetAdminUserByNickNameReq) returns (GetAdminUserByNickNameResp) {}
  // 获取角色拥有的系统权限
  rpc GetRoleSystems(GetRoleSystemsReq) returns (GetRoleSystemsResp) {}
}

message CheckTokenReq {
  string Token = 1;
}

message CheckTokenResp {
  int64 Code = 1;
  string Msg = 2;
  AdminUserInfo Data = 3;
}

message DeleteTokenReq {
  string Token = 1;
}
message DeleteTokenResp {
  int64 Code = 1;
  string Msg = 2;
}

message GetAdminUserByIDReq {
  int64 UID = 1;
}

message GetAdminUserByIDResp {
  int64 Code = 1;
  string Msg = 2;
  AdminUserInfo Data = 3;
}

message BatchGetAdminUserReq {
  repeated int64 UIds = 1;
}

message AdminUserInfo  {
  int64 ID = 1;
  int64 RoleID = 2;
  string UserName = 3;
  string NickName = 4;
  int64 Status = 5;
  string Avatar = 6;
}

message BatchGetAdminUserResp {
  int64 Code = 1;
  string Msg = 2;
  repeated AdminUserInfo Data = 3;
}

message GetAdminUserByNickNameReq  {
  string NickName = 1;
}

message GetAdminUserByNickNameResp  {
  int64 Code = 1;
  string Msg = 2;
  AdminUserInfo Data = 3;
}

message GetRoleSystemsReq {
  int64 RoleID = 1;
}

message SystemInfo {
  int64 ID = 1;
  string Name = 2;
  string Url = 3;
}

message GetRoleSystemsResp {
  int64 Code = 1;
  string Msg = 2;
  repeated SystemInfo Data = 3;
}


