接入proto

This commit is contained in:
chen wei bo
2025-08-14 00:16:34 +08:00
parent 45456135e9
commit 10e90791b7
9 changed files with 213 additions and 178 deletions
+64 -62
View File
@@ -1,3 +1,5 @@
declare namespace proto {
// DO NOT EDIT! This is a generated file. Edit the JSDoc in src/*.js instead and run 'npm run build:types'.
@@ -21,17 +23,17 @@ export class LoginReq implements ILoginReq {
constructor(properties?: ILoginReq);
/** LoginReq username. */
public username: string;
username: string;
/** LoginReq password. */
public password: string;
password: string;
/**
* Creates a new LoginReq instance using the specified properties.
* @param [properties] Properties to set
* @returns LoginReq instance
*/
public static create(properties?: ILoginReq): LoginReq;
static create(properties?: ILoginReq): LoginReq;
/**
* Encodes the specified LoginReq message. Does not implicitly {@link LoginReq.verify|verify} messages.
@@ -39,7 +41,7 @@ export class LoginReq implements ILoginReq {
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: ILoginReq, writer?: $protobuf.Writer): $protobuf.Writer;
static encode(message: ILoginReq, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified LoginReq message, length delimited. Does not implicitly {@link LoginReq.verify|verify} messages.
@@ -47,7 +49,7 @@ export class LoginReq implements ILoginReq {
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: ILoginReq, writer?: $protobuf.Writer): $protobuf.Writer;
static encodeDelimited(message: ILoginReq, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a LoginReq message from the specified reader or buffer.
@@ -57,7 +59,7 @@ export class LoginReq implements ILoginReq {
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): LoginReq;
static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): LoginReq;
/**
* Decodes a LoginReq message from the specified reader or buffer, length delimited.
@@ -66,21 +68,21 @@ export class LoginReq implements ILoginReq {
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): LoginReq;
static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): LoginReq;
/**
* Verifies a LoginReq message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a LoginReq message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns LoginReq
*/
public static fromObject(object: { [k: string]: any }): LoginReq;
static fromObject(object: { [k: string]: any }): LoginReq;
/**
* Creates a plain object from a LoginReq message. Also converts values to other types if specified.
@@ -88,20 +90,20 @@ export class LoginReq implements ILoginReq {
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: LoginReq, options?: $protobuf.IConversionOptions): { [k: string]: any };
static toObject(message: LoginReq, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this LoginReq to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
toJSON(): { [k: string]: any };
/**
* Gets the default type url for LoginReq
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of a LoginRes. */
@@ -127,20 +129,20 @@ export class LoginRes implements ILoginRes {
constructor(properties?: ILoginRes);
/** LoginRes success. */
public success: boolean;
success: boolean;
/** LoginRes token. */
public token: string;
token: string;
/** LoginRes message. */
public message: string;
message: string;
/**
* Creates a new LoginRes instance using the specified properties.
* @param [properties] Properties to set
* @returns LoginRes instance
*/
public static create(properties?: ILoginRes): LoginRes;
static create(properties?: ILoginRes): LoginRes;
/**
* Encodes the specified LoginRes message. Does not implicitly {@link LoginRes.verify|verify} messages.
@@ -148,7 +150,7 @@ export class LoginRes implements ILoginRes {
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: ILoginRes, writer?: $protobuf.Writer): $protobuf.Writer;
static encode(message: ILoginRes, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified LoginRes message, length delimited. Does not implicitly {@link LoginRes.verify|verify} messages.
@@ -156,7 +158,7 @@ export class LoginRes implements ILoginRes {
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: ILoginRes, writer?: $protobuf.Writer): $protobuf.Writer;
static encodeDelimited(message: ILoginRes, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a LoginRes message from the specified reader or buffer.
@@ -166,7 +168,7 @@ export class LoginRes implements ILoginRes {
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): LoginRes;
static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): LoginRes;
/**
* Decodes a LoginRes message from the specified reader or buffer, length delimited.
@@ -175,21 +177,21 @@ export class LoginRes implements ILoginRes {
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): LoginRes;
static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): LoginRes;
/**
* Verifies a LoginRes message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a LoginRes message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns LoginRes
*/
public static fromObject(object: { [k: string]: any }): LoginRes;
static fromObject(object: { [k: string]: any }): LoginRes;
/**
* Creates a plain object from a LoginRes message. Also converts values to other types if specified.
@@ -197,20 +199,20 @@ export class LoginRes implements ILoginRes {
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: LoginRes, options?: $protobuf.IConversionOptions): { [k: string]: any };
static toObject(message: LoginRes, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this LoginRes to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
toJSON(): { [k: string]: any };
/**
* Gets the default type url for LoginRes
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Namespace user. */
@@ -239,20 +241,20 @@ export namespace user {
constructor(properties?: user.IUserInfo);
/** UserInfo id. */
public id: number;
id: number;
/** UserInfo nickname. */
public nickname: string;
nickname: string;
/** UserInfo email. */
public email: string;
email: string;
/**
* Creates a new UserInfo instance using the specified properties.
* @param [properties] Properties to set
* @returns UserInfo instance
*/
public static create(properties?: user.IUserInfo): user.UserInfo;
static create(properties?: user.IUserInfo): user.UserInfo;
/**
* Encodes the specified UserInfo message. Does not implicitly {@link user.UserInfo.verify|verify} messages.
@@ -260,7 +262,7 @@ export namespace user {
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: user.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer;
static encode(message: user.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified UserInfo message, length delimited. Does not implicitly {@link user.UserInfo.verify|verify} messages.
@@ -268,7 +270,7 @@ export namespace user {
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: user.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer;
static encodeDelimited(message: user.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a UserInfo message from the specified reader or buffer.
@@ -278,7 +280,7 @@ export namespace user {
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): user.UserInfo;
static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): user.UserInfo;
/**
* Decodes a UserInfo message from the specified reader or buffer, length delimited.
@@ -287,21 +289,21 @@ export namespace user {
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): user.UserInfo;
static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): user.UserInfo;
/**
* Verifies a UserInfo message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a UserInfo message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns UserInfo
*/
public static fromObject(object: { [k: string]: any }): user.UserInfo;
static fromObject(object: { [k: string]: any }): user.UserInfo;
/**
* Creates a plain object from a UserInfo message. Also converts values to other types if specified.
@@ -309,20 +311,20 @@ export namespace user {
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: user.UserInfo, options?: $protobuf.IConversionOptions): { [k: string]: any };
static toObject(message: user.UserInfo, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this UserInfo to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
toJSON(): { [k: string]: any };
/**
* Gets the default type url for UserInfo
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of a GetUserReq. */
@@ -342,14 +344,14 @@ export namespace user {
constructor(properties?: user.IGetUserReq);
/** GetUserReq id. */
public id: number;
id: number;
/**
* Creates a new GetUserReq instance using the specified properties.
* @param [properties] Properties to set
* @returns GetUserReq instance
*/
public static create(properties?: user.IGetUserReq): user.GetUserReq;
static create(properties?: user.IGetUserReq): user.GetUserReq;
/**
* Encodes the specified GetUserReq message. Does not implicitly {@link user.GetUserReq.verify|verify} messages.
@@ -357,7 +359,7 @@ export namespace user {
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: user.IGetUserReq, writer?: $protobuf.Writer): $protobuf.Writer;
static encode(message: user.IGetUserReq, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified GetUserReq message, length delimited. Does not implicitly {@link user.GetUserReq.verify|verify} messages.
@@ -365,7 +367,7 @@ export namespace user {
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: user.IGetUserReq, writer?: $protobuf.Writer): $protobuf.Writer;
static encodeDelimited(message: user.IGetUserReq, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a GetUserReq message from the specified reader or buffer.
@@ -375,7 +377,7 @@ export namespace user {
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): user.GetUserReq;
static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): user.GetUserReq;
/**
* Decodes a GetUserReq message from the specified reader or buffer, length delimited.
@@ -384,21 +386,21 @@ export namespace user {
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): user.GetUserReq;
static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): user.GetUserReq;
/**
* Verifies a GetUserReq message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a GetUserReq message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns GetUserReq
*/
public static fromObject(object: { [k: string]: any }): user.GetUserReq;
static fromObject(object: { [k: string]: any }): user.GetUserReq;
/**
* Creates a plain object from a GetUserReq message. Also converts values to other types if specified.
@@ -406,20 +408,20 @@ export namespace user {
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: user.GetUserReq, options?: $protobuf.IConversionOptions): { [k: string]: any };
static toObject(message: user.GetUserReq, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this GetUserReq to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
toJSON(): { [k: string]: any };
/**
* Gets the default type url for GetUserReq
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of a GetUserRes. */
@@ -445,20 +447,20 @@ export namespace user {
constructor(properties?: user.IGetUserRes);
/** GetUserRes success. */
public success: boolean;
success: boolean;
/** GetUserRes data. */
public data?: (user.IUserInfo|null);
data?: (user.IUserInfo|null);
/** GetUserRes message. */
public message: string;
message: string;
/**
* Creates a new GetUserRes instance using the specified properties.
* @param [properties] Properties to set
* @returns GetUserRes instance
*/
public static create(properties?: user.IGetUserRes): user.GetUserRes;
static create(properties?: user.IGetUserRes): user.GetUserRes;
/**
* Encodes the specified GetUserRes message. Does not implicitly {@link user.GetUserRes.verify|verify} messages.
@@ -466,7 +468,7 @@ export namespace user {
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: user.IGetUserRes, writer?: $protobuf.Writer): $protobuf.Writer;
static encode(message: user.IGetUserRes, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified GetUserRes message, length delimited. Does not implicitly {@link user.GetUserRes.verify|verify} messages.
@@ -474,7 +476,7 @@ export namespace user {
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: user.IGetUserRes, writer?: $protobuf.Writer): $protobuf.Writer;
static encodeDelimited(message: user.IGetUserRes, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a GetUserRes message from the specified reader or buffer.
@@ -484,7 +486,7 @@ export namespace user {
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): user.GetUserRes;
static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): user.GetUserRes;
/**
* Decodes a GetUserRes message from the specified reader or buffer, length delimited.
@@ -493,21 +495,21 @@ export namespace user {
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): user.GetUserRes;
static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): user.GetUserRes;
/**
* Verifies a GetUserRes message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a GetUserRes message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns GetUserRes
*/
public static fromObject(object: { [k: string]: any }): user.GetUserRes;
static fromObject(object: { [k: string]: any }): user.GetUserRes;
/**
* Creates a plain object from a GetUserRes message. Also converts values to other types if specified.
@@ -515,20 +517,20 @@ export namespace user {
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: user.GetUserRes, options?: $protobuf.IConversionOptions): { [k: string]: any };
static toObject(message: user.GetUserRes, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this GetUserRes to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
toJSON(): { [k: string]: any };
/**
* Gets the default type url for GetUserRes
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
static getTypeUrl(typeUrlPrefix?: string): string;
}
}