58 lines
1.8 KiB
TypeScript
58 lines
1.8 KiB
TypeScript
import { Controller } from 'egg';
|
|
import { GetGuildInfoByUserParam, GetServerListParam, GuildNameCallBackParam, IOSRefundParam, 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 pay37IosCallback() {
|
|
// const { ctx } = this;
|
|
// const params = new PayCallback37Data(ctx.request.body);
|
|
// ctx.body = await ctx.service.sdk.pay37IOSCallback(params);
|
|
// return;
|
|
// }
|
|
|
|
public async refundIOSCallback() {
|
|
const { ctx } = this;
|
|
const params = new IOSRefundParam(ctx.request.body);
|
|
ctx.body = await ctx.service.sdk.refundIOSCallback(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;
|
|
}
|
|
}
|