feat:dish

This commit is contained in:
LAPTOP-7SGDREK0\shiweijun
2025-02-06 15:30:15 +08:00
parent c0b032d706
commit c0dffe3dc7
5 changed files with 228 additions and 8 deletions

View File

@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
namespace App\Request\Api;
use Hyperf\Validation\Request\FormRequest;
class DishRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
'limit' => 'required|integer',
'dish_name' => 'sometimes|string',
'cycle_id' => 'sometimes|integer|exists:cycle,id',
'city_id' => 'sometimes|integer|exists:system_city,id',
'kitchen_id' => 'sometimes|integer|exists:kitchen,id',
];
}
protected array $scenes = [
'add' => ['dish_name','profile','pre_quantity','price','side_dish','flavor','cycle_id','city_id','kitchen_id'],
'edit' => ['id','dish_name','profile','pre_quantity','price','side_dish','flavor'],
'list' =>['limit']
];
}