<?php

namespace App\Utils;

class FunctionResponse
{
    public static function success($code = 200, $data = [], $message = '操作成功')
    {
        return [
            'status' => 'success',
            'code' => $code,
            'data' => $data,
            'message' => $message
        ];
    }

    public static function error($code = 400, $data = [], $message = '操作失败')
    {
        return [
            'status' => 'error',
            'code' => $code,
            'message' => $message,
            'data' => $data
        ];
    }
}
