forked from engineering/cloudservices
14 lines
362 B
TypeScript
14 lines
362 B
TypeScript
import { TCPHandler, Context } from '../class';
|
|
|
|
export default class UserInfo extends TCPHandler {
|
|
constructor() {
|
|
super();
|
|
this.endpoint = 'userinfo';
|
|
}
|
|
|
|
public async handle(ctx: Context) {
|
|
const account = await ctx.client.db.Account.findOne({ username: ctx.data.username }).lean().exec();
|
|
return ctx.send(JSON.stringify(account));
|
|
}
|
|
}
|