Files
ZYZ/web-server/app/controller/sdk.ts

44 lines
1.3 KiB
TypeScript

import { Controller } from 'egg';
import { GetGuildInfoByUserParam, GetServerListParam, GuildNameCallBackParam, PayCallback37Data, RoleNameCallBackParam } from '../domain/sdk';
export default class SdkController extends Controller {
public async pay37Callback() {
const { ctx } = this;
const params = new PayCallback37Data(ctx.request.body);
ctx.body = await ctx.service.sdk.pay37Callback(params);
return;
}
public async treatRoleName() {
const { ctx } = this;
const params = new RoleNameCallBackParam(ctx.query);
ctx.body = await ctx.service.sdk.treatRoleName(params);
return;
}
public async treatGuildName() {
const { ctx } = this;
const params = new GuildNameCallBackParam(ctx.query);
ctx.body = await ctx.service.sdk.treatGuildName(params);
return;
}
public async getGuildByUser() {
const { ctx } = this;
const params = new GetGuildInfoByUserParam(ctx.query);
ctx.body = await ctx.service.sdk.getGuildByUser(params);
return;
}
public async getServerList() {
const { ctx } = this;
const params = new GetServerListParam(ctx.method == 'GET'? ctx.query: ctx.request.body);
ctx.body = await ctx.service.sdk.getServerList(params);
return;
}
}