privchat_protocol/rpc/group/role_set.rs
1// Copyright 2025 Shanghai Boyu Information Technology Co., Ltd.
2// https://privchat.dev
3//
4// Author: zoujiaqing <zoujiaqing@gmail.com>
5//
6// Licensed under the Apache License, Version 2.0 (the "License");
7// you may not use this file except in compliance with the License.
8// You may obtain a copy of the License at
9//
10// http://www.apache.org/licenses/LICENSE-2.0
11//
12// Unless required by applicable law or agreed to in writing, software
13// distributed under the License is distributed on an "AS IS" BASIS,
14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15// See the License for the specific language governing permissions and
16// limitations under the License.
17
18/// 设置群组成员角色 RPC
19///
20/// RPC路由: `group/role/set`
21use serde::{Deserialize, Serialize};
22
23/// 设置群组成员角色请求
24#[derive(Debug, Clone, Serialize, Deserialize)]
25pub struct GroupRoleSetRequest {
26 /// 群组ID
27 pub group_id: u64,
28 /// 操作者ID(必须是群主)
29 pub operator_id: u64,
30 /// 目标成员ID
31 pub user_id: u64,
32 /// 目标角色: "admin" | "member"
33 pub role: String,
34}
35
36/// 设置群组成员角色响应
37///
38/// RPC路由: `group/role/set`
39#[derive(Debug, Clone, Serialize, Deserialize)]
40pub struct GroupRoleSetResponse {
41 pub group_id: u64,
42 pub user_id: u64,
43 pub role: String,
44 pub updated_at: Option<String>, // ISO 8601,可选
45}