<?php

namespace app\api\controller\v1;

use app\api\controller\Api;

class Customized extends Api{


    public $restMethodList = 'post';

//    public function index(){
//
//
//    }

    public function save($json){

        $Verification=is_json($json);
//        var_dump($Verification);die;
        if($Verification==false){
            return self::returnmsg(400,[],["Access-Control-Allow-Origin" => $this->restMethodList]);
        }
//var_dump($json);die;
        $json=json_decode($json);

//        var_dump($json);die;
        $groupModel = model('Customized');
        $list=$groupModel->add($json);
        $result=new Api();
//        $list=1;
        if($list){
//            echo"1";
            return $result->sendSuccess($list,'SUCCESS','200');
        }else{
            //抛出异常
//            echo"1";
            return self::returnmsg(400,[],["Access-Control-Allow-Origin" => $this->restMethodList]);
//           return $result->_empty();
//            return $result->sendSuccess($list,'SUCCESS','200');
        }


    }


}