<?php

namespace App\Http\Controllers\Api\mini;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class BaseController extends Controller
{
    public function error($data = [])
    {
        return $this->response(collect(['code' => -1])->merge(collect($data)));
    }

    public function success($data = [])
    {
        return $this->response(collect(['code' => 0, 'msg' => '操作成功'])->merge(collect($data)));
    }

    public function response($data = [])
    {
        return response()->json($data);
    }

    public function transMoney($money) {
        return round($money * 100);
    }
}
