<?php

namespace plugin\admin\app\controller;

use plugin\admin\app\model\SignGood;
use support\Request;
use support\Response;
use plugin\admin\app\model\Good;
use plugin\admin\app\controller\Crud;
use support\exception\BusinessException;

/**
 * 产品列表 
 */
class SignGoodController extends Crud
{
    
    /**
     * @var SignGood
     */
    protected $model = null;

    /**
     * 构造函数
     * @return void
     */
    public function __construct()
    {
        $this->model = new SignGood;
    }
    
    /**
     * 浏览
     * @return Response
     */
    public function index(): Response
    {
        return view('signgood/index');
    }

    /**
     * 插入
     * @param Request $request
     * @return Response
     * @throws BusinessException
     */
    public function insert(Request $request): Response
    {
        if ($request->method() === 'POST') {
            return parent::insert($request);
        }
        return view('signgood/insert');
    }

    /**
     * 更新
     * @param Request $request
     * @return Response
     * @throws BusinessException
    */
    public function update(Request $request): Response
    {
        if ($request->method() === 'POST') {
            return parent::update($request);
        }
        return view('signgood/update');
    }


}
