<?php

namespace app\api\controller;

use app\api\lists\OrderEffectiveLogLists;
use app\api\logic\OrderEffectiveLogLogic;
use app\api\validate\OrderEffectiveLogValidate;

class OrderEffectiveController extends BaseApiController
{
    public array $notNeedLogin = ['submitEffective'];
    public function lists()
    {
        return $this->dataLists(new OrderEffectiveLogLists());
    }


    /**
     * 提交保修申请
     * @return \think\response\Json
     */
    public function submitEffective()
    {
        $params = (new OrderEffectiveLogValidate())->post()->goCheck('applyFor', [
            'user_id' => $this->userId,
            'user_info' => $this->userInfo
        ]);
        $result = OrderEffectiveLogLogic::submitEffective($params);
        if (false === $result) {
            return $this->fail(OrderEffectiveLogLogic::getError());
        }
        return $this->success('提交成功', [], 1, 1);
    }




}