request = $request; $this->configService = $configService; } /** * 获取配置 * * @return \Illuminate\Http\Response */ public function get() { $key = $this->request->get('key'); $config = $this->configService->get($key); return res($config, '获取配置', 201); } /** * 修改配置 * * @return \Illuminate\Http\Response */ public function set() { $key = $this->request->get('key'); $value = $this->request->get('value'); $config = $this->configService->set($key, $value); return res(true, '配置成功'); } }