1
This commit is contained in:
@@ -56,8 +56,22 @@ module.exports = {
|
||||
*/
|
||||
'POST /account/list': async (ctx) => {
|
||||
const body = ctx.getBody();
|
||||
const { key, value, platform_type, is_online } = body;
|
||||
const { limit, offset } = ctx.getPageSize();
|
||||
|
||||
// 支持两种参数格式:直接传参或通过 seachOption 传递
|
||||
const seachOption = body.seachOption || {};
|
||||
const pageOption = body.pageOption || {};
|
||||
|
||||
// 获取搜索参数(优先使用 seachOption,兼容直接传参)
|
||||
const key = seachOption.key || body.key;
|
||||
const value = seachOption.value || body.value;
|
||||
const platform_type = seachOption.platform_type || body.platform_type;
|
||||
const is_online = seachOption.is_online !== undefined ? seachOption.is_online : body.is_online;
|
||||
|
||||
// 获取分页参数
|
||||
const page = pageOption.page || body.page || 1;
|
||||
const pageSize = pageOption.pageSize || body.pageSize || 20;
|
||||
const limit = pageSize;
|
||||
const offset = (page - 1) * pageSize;
|
||||
|
||||
const result = await plaAccountService.getAccountList({
|
||||
key,
|
||||
|
||||
Reference in New Issue
Block a user