module.exports = {
  success(data = null, message = '操作成功') {
    return { code: 0, message, data };
  },
  
  fail(message = '操作失败', code = 1) {
    return { code, message, data: null };
  },

  page(list, total, page, pageSize) {
    return {
      code: 0,
      message: '操作成功',
      data: {
        list,
        total,
        page,
        pageSize,
        totalPages: Math.ceil(total / pageSize)
      }
    };
  }
};
