mirror of
https://github.com/whyour/qinglong.git
synced 2025-07-07 11:56:08 +08:00
修复 QLAPI 系统通知响应
This commit is contained in:
parent
ad6e08525c
commit
6775f5d123
|
@ -57,7 +57,6 @@ message SystemNotifyRequest {
|
||||||
string title = 1;
|
string title = 1;
|
||||||
string content = 2;
|
string content = 2;
|
||||||
}
|
}
|
||||||
message SystemNotifyResponse {}
|
|
||||||
|
|
||||||
service Api {
|
service Api {
|
||||||
rpc GetEnvs(GetEnvsRequest) returns (EnvsResponse) {}
|
rpc GetEnvs(GetEnvsRequest) returns (EnvsResponse) {}
|
||||||
|
@ -69,5 +68,5 @@ service Api {
|
||||||
rpc EnableEnvs(EnableEnvsRequest) returns (Response) {}
|
rpc EnableEnvs(EnableEnvsRequest) returns (Response) {}
|
||||||
rpc UpdateEnvNames(UpdateEnvNamesRequest) returns (Response) {}
|
rpc UpdateEnvNames(UpdateEnvNamesRequest) returns (Response) {}
|
||||||
rpc GetEnvById(GetEnvByIdRequest) returns (EnvResponse) {}
|
rpc GetEnvById(GetEnvByIdRequest) returns (EnvResponse) {}
|
||||||
rpc SystemNotify(SystemNotifyRequest) returns (SystemNotifyResponse) {}
|
rpc SystemNotify(SystemNotifyRequest) returns (Response) {}
|
||||||
}
|
}
|
|
@ -91,9 +91,6 @@ export interface SystemNotifyRequest {
|
||||||
content: string;
|
content: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SystemNotifyResponse {
|
|
||||||
}
|
|
||||||
|
|
||||||
function createBaseEnvItem(): EnvItem {
|
function createBaseEnvItem(): EnvItem {
|
||||||
return {
|
return {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
|
@ -1171,49 +1168,6 @@ export const SystemNotifyRequest = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function createBaseSystemNotifyResponse(): SystemNotifyResponse {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
export const SystemNotifyResponse = {
|
|
||||||
encode(_: SystemNotifyResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
||||||
return writer;
|
|
||||||
},
|
|
||||||
|
|
||||||
decode(input: _m0.Reader | Uint8Array, length?: number): SystemNotifyResponse {
|
|
||||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
|
||||||
const message = createBaseSystemNotifyResponse();
|
|
||||||
while (reader.pos < end) {
|
|
||||||
const tag = reader.uint32();
|
|
||||||
switch (tag >>> 3) {
|
|
||||||
}
|
|
||||||
if ((tag & 7) === 4 || tag === 0) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
reader.skipType(tag & 7);
|
|
||||||
}
|
|
||||||
return message;
|
|
||||||
},
|
|
||||||
|
|
||||||
fromJSON(_: any): SystemNotifyResponse {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
|
|
||||||
toJSON(_: SystemNotifyResponse): unknown {
|
|
||||||
const obj: any = {};
|
|
||||||
return obj;
|
|
||||||
},
|
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<SystemNotifyResponse>, I>>(base?: I): SystemNotifyResponse {
|
|
||||||
return SystemNotifyResponse.fromPartial(base ?? ({} as any));
|
|
||||||
},
|
|
||||||
fromPartial<I extends Exact<DeepPartial<SystemNotifyResponse>, I>>(_: I): SystemNotifyResponse {
|
|
||||||
const message = createBaseSystemNotifyResponse();
|
|
||||||
return message;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export type ApiService = typeof ApiService;
|
export type ApiService = typeof ApiService;
|
||||||
export const ApiService = {
|
export const ApiService = {
|
||||||
getEnvs: {
|
getEnvs: {
|
||||||
|
@ -1303,8 +1257,8 @@ export const ApiService = {
|
||||||
responseStream: false,
|
responseStream: false,
|
||||||
requestSerialize: (value: SystemNotifyRequest) => Buffer.from(SystemNotifyRequest.encode(value).finish()),
|
requestSerialize: (value: SystemNotifyRequest) => Buffer.from(SystemNotifyRequest.encode(value).finish()),
|
||||||
requestDeserialize: (value: Buffer) => SystemNotifyRequest.decode(value),
|
requestDeserialize: (value: Buffer) => SystemNotifyRequest.decode(value),
|
||||||
responseSerialize: (value: SystemNotifyResponse) => Buffer.from(SystemNotifyResponse.encode(value).finish()),
|
responseSerialize: (value: Response) => Buffer.from(Response.encode(value).finish()),
|
||||||
responseDeserialize: (value: Buffer) => SystemNotifyResponse.decode(value),
|
responseDeserialize: (value: Buffer) => Response.decode(value),
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
@ -1318,7 +1272,7 @@ export interface ApiServer extends UntypedServiceImplementation {
|
||||||
enableEnvs: handleUnaryCall<EnableEnvsRequest, Response>;
|
enableEnvs: handleUnaryCall<EnableEnvsRequest, Response>;
|
||||||
updateEnvNames: handleUnaryCall<UpdateEnvNamesRequest, Response>;
|
updateEnvNames: handleUnaryCall<UpdateEnvNamesRequest, Response>;
|
||||||
getEnvById: handleUnaryCall<GetEnvByIdRequest, EnvResponse>;
|
getEnvById: handleUnaryCall<GetEnvByIdRequest, EnvResponse>;
|
||||||
systemNotify: handleUnaryCall<SystemNotifyRequest, SystemNotifyResponse>;
|
systemNotify: handleUnaryCall<SystemNotifyRequest, Response>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ApiClient extends Client {
|
export interface ApiClient extends Client {
|
||||||
|
@ -1459,18 +1413,18 @@ export interface ApiClient extends Client {
|
||||||
): ClientUnaryCall;
|
): ClientUnaryCall;
|
||||||
systemNotify(
|
systemNotify(
|
||||||
request: SystemNotifyRequest,
|
request: SystemNotifyRequest,
|
||||||
callback: (error: ServiceError | null, response: SystemNotifyResponse) => void,
|
callback: (error: ServiceError | null, response: Response) => void,
|
||||||
): ClientUnaryCall;
|
): ClientUnaryCall;
|
||||||
systemNotify(
|
systemNotify(
|
||||||
request: SystemNotifyRequest,
|
request: SystemNotifyRequest,
|
||||||
metadata: Metadata,
|
metadata: Metadata,
|
||||||
callback: (error: ServiceError | null, response: SystemNotifyResponse) => void,
|
callback: (error: ServiceError | null, response: Response) => void,
|
||||||
): ClientUnaryCall;
|
): ClientUnaryCall;
|
||||||
systemNotify(
|
systemNotify(
|
||||||
request: SystemNotifyRequest,
|
request: SystemNotifyRequest,
|
||||||
metadata: Metadata,
|
metadata: Metadata,
|
||||||
options: Partial<CallOptions>,
|
options: Partial<CallOptions>,
|
||||||
callback: (error: ServiceError | null, response: SystemNotifyResponse) => void,
|
callback: (error: ServiceError | null, response: Response) => void,
|
||||||
): ClientUnaryCall;
|
): ClientUnaryCall;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@ import {
|
||||||
MoveEnvRequest,
|
MoveEnvRequest,
|
||||||
Response,
|
Response,
|
||||||
SystemNotifyRequest,
|
SystemNotifyRequest,
|
||||||
SystemNotifyResponse,
|
|
||||||
UpdateEnvNamesRequest,
|
UpdateEnvNamesRequest,
|
||||||
UpdateEnvRequest,
|
UpdateEnvRequest,
|
||||||
} from '../protos/api';
|
} from '../protos/api';
|
||||||
|
@ -161,13 +160,13 @@ export const getEnvById = async (
|
||||||
};
|
};
|
||||||
|
|
||||||
export const systemNotify = async (
|
export const systemNotify = async (
|
||||||
call: ServerUnaryCall<SystemNotifyRequest, SystemNotifyResponse>,
|
call: ServerUnaryCall<SystemNotifyRequest, Response>,
|
||||||
callback: sendUnaryData<SystemNotifyResponse>,
|
callback: sendUnaryData<Response>,
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
const systemService = Container.get(SystemService);
|
const systemService = Container.get(SystemService);
|
||||||
const data = await systemService.notify(call.request);
|
const data = await systemService.notify(call.request);
|
||||||
callback(null, { code: 200, data });
|
callback(null, data);
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
callback(e);
|
callback(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user