<?php

namespace App\Http\Controllers\strategy;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Support\Facades\Validator;
use App\Http\Controllers\Tool;
//use App\Http\Requests\StrategySetCreateRequest;

class StrategySetController extends Controller
{
    use ValidatesRequests;
    use Tool;
    
    public function index(){
        dd('策略列表');
    }
    
    public function store(Request $request){
        $validator = Validator::make($request->all(), [
            'name' => 'required|max:30',
            'user_sn' => 'required',
            'call_number' => 'required',
            'day_type' => 'required',
            'frequency_type' => 'required',
            'call_time_set' => 'required',
            'project_sn' => 'required',
            'upload' => 'size:'//上传文件限制不超过8M
        ]);
        
        /* if ($validator->fails()) {
            return $this->errorWithInfo('表单验证失败', 401);
        } */
        
        $path = $request->file('upload')->store('upload');
        
        dd($path);
        dd('策略添加');
    }
    
    public function create()
    {
        dd('dddd');
    }
}
