mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 17:31:49 +08:00 
			
		
		
		
	feature: shadowsocks and more
This commit is contained in:
		
							
								
								
									
										46
									
								
								app/Http/Requests/Admin/ServerShadowsocksSave.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								app/Http/Requests/Admin/ServerShadowsocksSave.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,46 @@ | ||||
| <?php | ||||
|  | ||||
| namespace App\Http\Requests\Admin; | ||||
|  | ||||
| use Illuminate\Foundation\Http\FormRequest; | ||||
|  | ||||
| class ServerShadowsocksSave extends FormRequest | ||||
| { | ||||
|     /** | ||||
|      * Get the validation rules that apply to the request. | ||||
|      * | ||||
|      * @return array | ||||
|      */ | ||||
|     public function rules() | ||||
|     { | ||||
|         return [ | ||||
|             'show' => '', | ||||
|             'name' => 'required', | ||||
|             'group_id' => 'required|array', | ||||
|             'parent_id' => 'nullable|integer', | ||||
|             'host' => 'required', | ||||
|             'port' => 'required', | ||||
|             'server_port' => 'required', | ||||
|             'cipher' => 'required', | ||||
|             'tags' => 'nullable|array', | ||||
|             'rate' => 'required|numeric' | ||||
|         ]; | ||||
|     } | ||||
|  | ||||
|     public function messages() | ||||
|     { | ||||
|         return [ | ||||
|             'name.required' => '节点名称不能为空', | ||||
|             'group_id.required' => '权限组不能为空', | ||||
|             'group_id.array' => '权限组格式不正确', | ||||
|             'parent_id.integer' => '父节点格式不正确', | ||||
|             'host.required' => '节点地址不能为空', | ||||
|             'port.required' => '连接端口不能为空', | ||||
|             'server_port.required' => '后端服务端口不能为空', | ||||
|             'cipher.required' => '加密方式不能为空', | ||||
|             'tags.array' => '标签格式不正确', | ||||
|             'rate.required' => '倍率不能为空', | ||||
|             'rate.numeric' => '倍率格式不正确' | ||||
|         ]; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										28
									
								
								app/Http/Requests/Admin/ServerShadowsocksSort.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								app/Http/Requests/Admin/ServerShadowsocksSort.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,28 @@ | ||||
| <?php | ||||
|  | ||||
| namespace App\Http\Requests\Admin; | ||||
|  | ||||
| use Illuminate\Foundation\Http\FormRequest; | ||||
|  | ||||
| class ServerShadowsocksSort extends FormRequest | ||||
| { | ||||
|     /** | ||||
|      * Get the validation rules that apply to the request. | ||||
|      * | ||||
|      * @return array | ||||
|      */ | ||||
|     public function rules() | ||||
|     { | ||||
|         return [ | ||||
|             'server_ids' => 'required|array' | ||||
|         ]; | ||||
|     } | ||||
|  | ||||
|     public function messages() | ||||
|     { | ||||
|         return [ | ||||
|             'server_ids.required' => '服务器ID不能为空', | ||||
|             'server_ids.array' => '服务器ID格式有误' | ||||
|         ]; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										28
									
								
								app/Http/Requests/Admin/ServerShadowsocksUpdate.php
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										28
									
								
								app/Http/Requests/Admin/ServerShadowsocksUpdate.php
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,28 @@ | ||||
| <?php | ||||
|  | ||||
| namespace App\Http\Requests\Admin; | ||||
|  | ||||
| use Illuminate\Foundation\Http\FormRequest; | ||||
|  | ||||
| class ServerShadowsocksUpdate extends FormRequest | ||||
| { | ||||
|     /** | ||||
|      * Get the validation rules that apply to the request. | ||||
|      * | ||||
|      * @return array | ||||
|      */ | ||||
|  | ||||
|     public function rules() | ||||
|     { | ||||
|         return [ | ||||
|             'show' => 'in:0,1' | ||||
|         ]; | ||||
|     } | ||||
|  | ||||
|     public function messages() | ||||
|     { | ||||
|         return [ | ||||
|             'show.in' => '显示状态格式不正确' | ||||
|         ]; | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user