101 lines
3.2 KiB
TypeScript
101 lines
3.2 KiB
TypeScript
import { Controller } from 'egg';
|
|
import { GetGuildInfoByUserParam, GetRoleByServerParam, GetRoleByUidParam, GetServerAndUidParam, GetServerListParam, GetServerParam, GuildNameCallBackParam, IOSRefundParam, PayCallback37Data, RoleNameCallBackParam, SendGiftCodeParam } from '../../../shared/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;
|
|
}
|
|
|
|
public async wjxCallback() {
|
|
const { ctx } = this;
|
|
|
|
ctx.body = await ctx.service.wjx.wjxCallback(ctx.request.body);
|
|
return;
|
|
}
|
|
|
|
public async sendGiftCode() {
|
|
const { ctx } = this;
|
|
const params = new SendGiftCodeParam(ctx.request.body);
|
|
ctx.body = await ctx.service.sdk.sendGiftCode(params);
|
|
return;
|
|
}
|
|
|
|
public async getRoleByUidAndServer() {
|
|
const { ctx } = this;
|
|
const params = new GetRoleByServerParam(ctx.query);
|
|
ctx.body = await ctx.service.sdk.getRoleByUidAndServer(params);
|
|
return;
|
|
}
|
|
|
|
public async getRoleByUidAndServerForLogin() {
|
|
const { ctx } = this;
|
|
const params = new GetServerAndUidParam(ctx.query||ctx.request.body);
|
|
ctx.body = await ctx.service.sdk.getRoleByUidAndServerForLogin(params);
|
|
return;
|
|
}
|
|
|
|
|
|
public async getRoleByUid() {
|
|
const { ctx } = this;
|
|
const params = new GetRoleByUidParam(ctx.query);
|
|
ctx.body = await ctx.service.sdk.getRoleByUid(params);
|
|
return;
|
|
}
|
|
|
|
public async getServerInfo() {
|
|
const { ctx } = this;
|
|
const params = new GetServerParam(ctx.query);
|
|
ctx.body = await ctx.service.sdk.getServerInfo(params);
|
|
return;
|
|
}
|
|
}
|