后台:礼包码
This commit is contained in:
@@ -127,4 +127,44 @@ export default class UserController extends Controller {
|
||||
const { selectedRowKeys: roleIdAndIds, count } = ctx.request.body;
|
||||
ctx.body = await ctx.service.users.setItemCount(roleIdAndIds, count);
|
||||
}
|
||||
|
||||
public async getGiftCodeList() {
|
||||
const { ctx } = this;
|
||||
const { page, pageSize, sortField, sortOrder, form } = ctx.request.body;
|
||||
ctx.body = await ctx.service.users.getGiftCodeList(page, pageSize, sortField, sortOrder, form);
|
||||
}
|
||||
|
||||
public async updateGiftCode() {
|
||||
const { ctx } = this;
|
||||
const { id, values } = ctx.request.body;
|
||||
ctx.body = await ctx.service.users.updateGiftCode(id, values);
|
||||
}
|
||||
|
||||
public async generateGiftCode() {
|
||||
const { ctx } = this;
|
||||
const { id, generateType, code, generateNum, codeLen } = ctx.request.body;
|
||||
if(generateType == 1) {
|
||||
if(!generateNum) {
|
||||
ctx.body = ctx.service.utils.resResult(STATUS.WRONG_PARMS);
|
||||
return
|
||||
}
|
||||
} else if (generateType == 2) {
|
||||
if(!code) {
|
||||
ctx.body = ctx.service.utils.resResult(STATUS.WRONG_PARMS);
|
||||
return
|
||||
}
|
||||
} else {
|
||||
ctx.body = ctx.service.utils.resResult(STATUS.WRONG_PARMS);
|
||||
return
|
||||
}
|
||||
|
||||
ctx.body = await ctx.service.users.generateGiftCode(id, generateType, code, generateNum, codeLen);
|
||||
}
|
||||
|
||||
public async getGiftCodeDetails() {
|
||||
const { ctx } = this;
|
||||
const { id } = ctx.params;
|
||||
ctx.body = await ctx.service.users.getGiftCodeDetails(parseInt(id));
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user