m
This commit is contained in:
@@ -200,3 +200,56 @@ export class TargetInfo {
|
||||
return new TargetInfo($$parsedSource as Partial<TargetInfo>);
|
||||
}
|
||||
}
|
||||
|
||||
export class User {
|
||||
"id": number;
|
||||
"username": string;
|
||||
"password": string;
|
||||
"nickname": string;
|
||||
"phone": string;
|
||||
|
||||
/**
|
||||
* 'pending', 'approved', 'rejected'
|
||||
*/
|
||||
"status": string;
|
||||
"apiKey": string;
|
||||
"createdAt": string;
|
||||
|
||||
/** Creates a new User instance. */
|
||||
constructor($$source: Partial<User> = {}) {
|
||||
if (!("id" in $$source)) {
|
||||
this["id"] = 0;
|
||||
}
|
||||
if (!("username" in $$source)) {
|
||||
this["username"] = "";
|
||||
}
|
||||
if (!("password" in $$source)) {
|
||||
this["password"] = "";
|
||||
}
|
||||
if (!("nickname" in $$source)) {
|
||||
this["nickname"] = "";
|
||||
}
|
||||
if (!("phone" in $$source)) {
|
||||
this["phone"] = "";
|
||||
}
|
||||
if (!("status" in $$source)) {
|
||||
this["status"] = "";
|
||||
}
|
||||
if (!("apiKey" in $$source)) {
|
||||
this["apiKey"] = "";
|
||||
}
|
||||
if (!("createdAt" in $$source)) {
|
||||
this["createdAt"] = "";
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new User instance from a string or object.
|
||||
*/
|
||||
static createFrom($$source: any = {}): User {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new User($$parsedSource as Partial<User>);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user