Skip to content

Commit

Permalink
Merge pull request #55 from juzibot/feat/room-anti-spam
Browse files Browse the repository at this point in the history
Feat/room anti spam
  • Loading branch information
hcfw007 authored Jan 11, 2024
2 parents b7a5f68 + ab2f394 commit 2af4356
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@juzi/wechaty-grpc",
"version": "1.0.74",
"version": "1.0.75",
"description": "gRPC for Wechaty",
"type": "module",
"exports": {
Expand Down
19 changes: 19 additions & 0 deletions proto/wechaty/puppet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,25 @@ service Puppet {
};
}

rpc GetRoomAntiSpamStrategyList (puppet.GetRoomAntiSpamStrategyListRequest) returns (puppet.GetRoomAntiSpamStrategyListResponse) {
option (google.api.http) = {
get: "/wecom/roomAntiSpamStrategyList"
};
}

rpc GetRoomAntiSpamStrategyEffectRoomList (puppet.GetRoomAntiSpamStrategyEffectRoomListRequest) returns (puppet.GetRoomAntiSpamStrategyEffectRoomListResponse) {
option (google.api.http) = {
get: "/wecom/roomAntiSpamStrategy/{strategy_id}/rooms"
};
}

rpc ApplyRoomAntiSpamStrategy (puppet.ApplyRoomAntiSpamStrategyRequest) returns (puppet.ApplyRoomAntiSpamStrategyResponse) {
option (google.api.http) = {
post: "/wecom/roomAntiSpamStrategy/apply",
body: "*"
};
}

/**
* File/Blob download & upload
*/
Expand Down
27 changes: 27 additions & 0 deletions proto/wechaty/puppet/wecom.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ message ContactExternalUserIdPair {
string external_user_id = 2;
}

message RoomAntiSpamStrategy {
string id = 1;
string name = 2;
}

message GetContactExternalUserIdRequest {
repeated string contact_ids = 1;
string service_provider_id = 2;
Expand All @@ -18,3 +23,25 @@ message GetContactExternalUserIdRequest {
message GetContactExternalUserIdResponse {
repeated ContactExternalUserIdPair contact_external_user_id_pairs = 1;
}

message GetRoomAntiSpamStrategyListRequest {}

message GetRoomAntiSpamStrategyListResponse {
repeated RoomAntiSpamStrategy strategies = 1;
}

message GetRoomAntiSpamStrategyEffectRoomListRequest {
string strategy_id = 1;
}

message GetRoomAntiSpamStrategyEffectRoomListResponse {
repeated string room_ids = 1;
}

message ApplyRoomAntiSpamStrategyRequest {
string strategy_id = 1;
repeated string room_ids = 2;
bool active = 3;
}

message ApplyRoomAntiSpamStrategyResponse {}
18 changes: 18 additions & 0 deletions tests/puppet-server-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,24 @@ export const puppetServerImpl: IPuppetServer = {
throw new Error('not implemented.')
},

getRoomAntiSpamStrategyList: (call, callback) => {
void call
void callback
throw new Error('not implemented.')
},

getRoomAntiSpamStrategyEffectRoomList: (call, callback) => {
void call
void callback
throw new Error('not implemented.')
},

applyRoomAntiSpamStrategy: (call, callback) => {
void call
void callback
throw new Error('not implemented.')
},

download: (call) => {
void call
throw new Error('not implemented.')
Expand Down

0 comments on commit 2af4356

Please sign in to comment.