<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Web\AntihackLogControl;

class AntiHackController extends Controller
{
    public function ActionBanAccountUseHack(Request $request)
    {
        $validator = \Validator::make($request->all(), [
            'UUID' => 'required',
            'Motivo' => 'required',
            'Filename' => 'required'
        ], [], [
            'UUID' => '',
            'Motivo' => '',
            'Filename' => ''
        ]);

        if(!$validator->passes())
            return response()->json(['code' => -1, 'msg' => $validator->errors() ], 400);

        $data = AntihackLogControl::Create($request);
        if($data == 0){
            return response()->json(['code' => -1, 'msg' => 'Sucesso!' ], 200);
        }
        return response()->json(['code' => -1, 'msg' => 'Erro!' ], 400);
    }
}
