正在显示
2 个修改的文件
包含
0 行增加
和
304 行删除
| ... | ... | @@ -41,42 +41,12 @@ void DmpManagerApiHandler::HandleRequest(const DmpServerApiContext &context) con |
| 41 | 41 | else if (OperationId().compare("stopservice") == 0) { |
| 42 | 42 | stopService(context); |
| 43 | 43 | } |
| 44 | - else if(OperationId().compare("regtileservice") == 0) { | |
| 45 | - RegTileService(context); | |
| 46 | - } | |
| 47 | - else if(OperationId().compare("getservicelist") == 0) { | |
| 48 | - GetServiceList(context); | |
| 49 | - } | |
| 50 | - else if(OperationId().compare("getservicedetail") == 0) { | |
| 51 | - GetServiceDetail(context); | |
| 52 | - } | |
| 53 | 44 | else if(OperationId().compare("getcapabilities") == 0) { |
| 54 | 45 | getCapabilities(context); |
| 55 | 46 | } |
| 56 | - else if(OperationId().compare("updateservice") == 0) { | |
| 57 | - UpdateService(context); | |
| 58 | - } | |
| 59 | 47 | else if(OperationId().compare("deleteservice") == 0) { |
| 60 | 48 | deleteService(context); |
| 61 | 49 | } |
| 62 | - else if(OperationId().compare("gettileserviceinfo") == 0) { | |
| 63 | - GetTileServiceInfo(context); | |
| 64 | - } | |
| 65 | - else if(OperationId().compare("addcatalog") == 0) { | |
| 66 | - AddCatalog(context); | |
| 67 | - } | |
| 68 | - else if(OperationId().compare("deletecatalog") == 0) { | |
| 69 | - DeleteCatalog(context); | |
| 70 | - } | |
| 71 | - else if(OperationId().compare("getservicesmatrixsets") == 0) { | |
| 72 | - GetServicesMatrixSets(context); | |
| 73 | - } | |
| 74 | - else if(OperationId().compare("deletecache") == 0) { | |
| 75 | - DeleteCache(context); | |
| 76 | - } | |
| 77 | - else if(OperationId().compare("updatecache") == 0) { | |
| 78 | - UpdateCache(context); | |
| 79 | - } | |
| 80 | 50 | else if(OperationId().compare("reloadservices") == 0) { |
| 81 | 51 | reloadServices(context); |
| 82 | 52 | } |
| ... | ... | @@ -206,54 +176,7 @@ void DmpManagerApiHandler::stopService(const DmpServerApiContext &context) const |
| 206 | 176 | } |
| 207 | 177 | } |
| 208 | 178 | } |
| 209 | -void DmpManagerApiHandler::RegTileService(const DmpServerApiContext &context) const | |
| 210 | -{ | |
| 211 | - switch (context.request()->method()) | |
| 212 | - { | |
| 213 | - case DmpServerRequest::Method::GET_METHOD: | |
| 214 | - { | |
| 215 | - context.response()->write("{\"status\":\"true\",\"message\":\"切片服务发布测试——————GET\"}"); | |
| 216 | - break; | |
| 217 | - } | |
| 218 | - case DmpServerRequest::Method::POST_METHOD: | |
| 219 | - { | |
| 220 | - context.response()->write("{\"status\":\"true\",\"message\":\"切片服务发布测试——————POST\"}"); | |
| 221 | - break; | |
| 222 | - } | |
| 223 | - default: | |
| 224 | - { | |
| 225 | - | |
| 226 | - } | |
| 227 | - } | |
| 228 | -} | |
| 229 | -void DmpManagerApiHandler::GetServiceList(const DmpServerApiContext &context) const | |
| 230 | -{ | |
| 231 | -} | |
| 232 | - | |
| 233 | -void DmpManagerApiHandler::GetServiceDetail(const DmpServerApiContext &context) const | |
| 234 | -{ | |
| 235 | -} | |
| 236 | 179 | |
| 237 | -void DmpManagerApiHandler::UpdateService(const DmpServerApiContext &context) const | |
| 238 | -{ | |
| 239 | - switch (context.request()->method()) | |
| 240 | - { | |
| 241 | - case DmpServerRequest::Method::GET_METHOD: | |
| 242 | - { | |
| 243 | - context.response()->write("{\"status\":\"true\",\"message\":\"更新服务信息——————GET\"}"); | |
| 244 | - break; | |
| 245 | - } | |
| 246 | - case DmpServerRequest::Method::POST_METHOD: | |
| 247 | - { | |
| 248 | - context.response()->write("{\"status\":\"true\",\"message\":\"更新服务信息——————POST\"}"); | |
| 249 | - break; | |
| 250 | - } | |
| 251 | - default: | |
| 252 | - { | |
| 253 | - | |
| 254 | - } | |
| 255 | - } | |
| 256 | -} | |
| 257 | 180 | |
| 258 | 181 | void DmpManagerApiHandler::deleteService(const DmpServerApiContext &context) const |
| 259 | 182 | { |
| ... | ... | @@ -284,210 +207,7 @@ void DmpManagerApiHandler::deleteService(const DmpServerApiContext &context) con |
| 284 | 207 | } |
| 285 | 208 | } |
| 286 | 209 | } |
| 287 | -//获取配置文件切片信息 | |
| 288 | -void DmpManagerApiHandler::GetTileServiceInfo(const DmpServerApiContext &context) const | |
| 289 | -{ | |
| 290 | - switch (context.request()->method()) | |
| 291 | - { | |
| 292 | - case DmpServerRequest::Method::GET_METHOD: | |
| 293 | - { | |
| 294 | - context.response()->write("{\"status\":\"true\",\"message\":\"获取切片配置信息——————GET\"}"); | |
| 295 | - break; | |
| 296 | - } | |
| 297 | - case DmpServerRequest::Method::POST_METHOD: | |
| 298 | - { | |
| 299 | - context.response()->write("{\"status\":\"true\",\"message\":\"获取切片配置信息——————POST\"}"); | |
| 300 | - break; | |
| 301 | - } | |
| 302 | - default: | |
| 303 | - { | |
| 304 | - | |
| 305 | - } | |
| 306 | - } | |
| 307 | -} | |
| 308 | - | |
| 309 | -//判断服务是否存在 | |
| 310 | -void DmpManagerApiHandler::IsExistServiceName(const DmpServerApiContext &context) const | |
| 311 | -{ | |
| 312 | - switch (context.request()->method()) | |
| 313 | - { | |
| 314 | - case DmpServerRequest::Method::GET_METHOD: | |
| 315 | - { | |
| 316 | - context.response()->write("{\"status\":\"true\",\"message\":\"——————GET\"}"); | |
| 317 | - break; | |
| 318 | - } | |
| 319 | - case DmpServerRequest::Method::POST_METHOD: | |
| 320 | - { | |
| 321 | - context.response()->write("{\"status\":\"true\",\"message\":\"——————POST\"}"); | |
| 322 | - break; | |
| 323 | - } | |
| 324 | - default: | |
| 325 | - { | |
| 326 | - | |
| 327 | - } | |
| 328 | - } | |
| 329 | -} | |
| 330 | - | |
| 331 | -//新增目录 | |
| 332 | -void DmpManagerApiHandler::AddCatalog(const DmpServerApiContext &context) const | |
| 333 | -{ | |
| 334 | - switch (context.request()->method()) | |
| 335 | - { | |
| 336 | - case DmpServerRequest::Method::GET_METHOD: | |
| 337 | - { | |
| 338 | - context.response()->write("{\"status\":\"true\",\"message\":\"新增目录——————GET\"}"); | |
| 339 | - break; | |
| 340 | - } | |
| 341 | - case DmpServerRequest::Method::POST_METHOD: | |
| 342 | - { | |
| 343 | - context.response()->write("{\"status\":\"true\",\"message\":\"新增目录——————POST\"}"); | |
| 344 | - break; | |
| 345 | - } | |
| 346 | - default: | |
| 347 | - { | |
| 348 | - | |
| 349 | - } | |
| 350 | - } | |
| 351 | -} | |
| 352 | 210 | |
| 353 | -//删除目录 | |
| 354 | -void DmpManagerApiHandler::DeleteCatalog(const DmpServerApiContext &context) const | |
| 355 | -{ | |
| 356 | - switch (context.request()->method()) | |
| 357 | - { | |
| 358 | - case DmpServerRequest::Method::GET_METHOD: | |
| 359 | - { | |
| 360 | - context.response()->write("{\"status\":\"true\",\"message\":\"删除目录——————GET\"}"); | |
| 361 | - break; | |
| 362 | - } | |
| 363 | - case DmpServerRequest::Method::POST_METHOD: | |
| 364 | - { | |
| 365 | - context.response()->write("{\"status\":\"true\",\"message\":\"删除目录——————POST\"}"); | |
| 366 | - break; | |
| 367 | - } | |
| 368 | - default: | |
| 369 | - { | |
| 370 | - | |
| 371 | - } | |
| 372 | - } | |
| 373 | -} | |
| 374 | - | |
| 375 | -void DmpManagerApiHandler::GetServicesMatrixSets(const DmpServerApiContext &context) const | |
| 376 | -{ | |
| 377 | - switch (context.request()->method()) | |
| 378 | - { | |
| 379 | - case DmpServerRequest::Method::GET_METHOD: | |
| 380 | - { | |
| 381 | - context.response()->write("{\"status\":\"true\",\"message\":\"删除目录——————GET\"}"); | |
| 382 | - break; | |
| 383 | - } | |
| 384 | - case DmpServerRequest::Method::POST_METHOD: | |
| 385 | - { | |
| 386 | - context.response()->write("{\"status\":\"true\",\"message\":\"删除目录——————POST\"}"); | |
| 387 | - break; | |
| 388 | - } | |
| 389 | - default: | |
| 390 | - { | |
| 391 | - | |
| 392 | - } | |
| 393 | - } | |
| 394 | -} | |
| 395 | -void DmpManagerApiHandler::GetCatalogList(const DmpServerApiContext &context) const | |
| 396 | -{ | |
| 397 | - switch (context.request()->method()) | |
| 398 | - { | |
| 399 | - case DmpServerRequest::Method::GET_METHOD: | |
| 400 | - { | |
| 401 | - context.response()->write("{\"status\":\"true\",\"message\":\"获取目录列表——————GET\"}"); | |
| 402 | - break; | |
| 403 | - } | |
| 404 | - case DmpServerRequest::Method::POST_METHOD: | |
| 405 | - { | |
| 406 | - context.response()->write("{\"status\":\"true\",\"message\":\"获取目录列表——————POST\"}"); | |
| 407 | - break; | |
| 408 | - } | |
| 409 | - default: | |
| 410 | - { | |
| 411 | - | |
| 412 | - } | |
| 413 | - } | |
| 414 | -} | |
| 415 | -void DmpManagerApiHandler::UpdateCache(const DmpServerApiContext &context)const | |
| 416 | -{ | |
| 417 | - switch (context.request()->method()) | |
| 418 | - { | |
| 419 | - case DmpServerRequest::Method::GET_METHOD: | |
| 420 | - { | |
| 421 | - std::string serviceName_; | |
| 422 | - const DmpServerParameters params_ (context.request()->serverParameters()); | |
| 423 | - CIMap paramsMap=params_.parameters(); | |
| 424 | - std::map<std::string, std::string>::const_iterator iter; | |
| 425 | - iter =paramsMap.find("SERVICENAME"); | |
| 426 | - if (iter != paramsMap.end()) | |
| 427 | - { | |
| 428 | - try | |
| 429 | - { | |
| 430 | - serviceName_ = boost::lexical_cast<std::string>(iter->second); | |
| 431 | - } | |
| 432 | - catch (boost::bad_lexical_cast &e) | |
| 433 | - { | |
| 434 | - LOGGER_ERROR(e.what()); | |
| 435 | - context.response()->write("{\"status\":\"true\",\"message\":\"获取参数信息错误——————GET\"}"); | |
| 436 | - return; | |
| 437 | - } | |
| 438 | - } | |
| 439 | - | |
| 440 | - break; | |
| 441 | - } | |
| 442 | - case DmpServerRequest::Method::POST_METHOD: | |
| 443 | - { | |
| 444 | - context.response()->write("{\"status\":\"true\",\"message\":\"更新缓存——————POST\"}"); | |
| 445 | - break; | |
| 446 | - } | |
| 447 | - default: | |
| 448 | - { | |
| 449 | - | |
| 450 | - } | |
| 451 | - } | |
| 452 | -} | |
| 453 | -void DmpManagerApiHandler::DeleteCache(const DmpServerApiContext &context)const | |
| 454 | -{ | |
| 455 | - switch (context.request()->method()) | |
| 456 | - { | |
| 457 | - case DmpServerRequest::Method::GET_METHOD: | |
| 458 | - { | |
| 459 | - std::string serviceName_; | |
| 460 | - const DmpServerParameters params_ (context.request()->serverParameters()); | |
| 461 | - CIMap paramsMap=params_.parameters(); | |
| 462 | - std::map<std::string, std::string>::const_iterator iter; | |
| 463 | - iter =paramsMap.find("SERVICENAME"); | |
| 464 | - if (iter != paramsMap.end()) | |
| 465 | - { | |
| 466 | - try | |
| 467 | - { | |
| 468 | - serviceName_ = boost::lexical_cast<std::string>(iter->second); | |
| 469 | - } | |
| 470 | - catch (boost::bad_lexical_cast &e) | |
| 471 | - { | |
| 472 | - LOGGER_ERROR(e.what()); | |
| 473 | - context.response()->write("{\"status\":\"true\",\"message\":\"获取参数信息错误——————GET\"}"); | |
| 474 | - return; | |
| 475 | - } | |
| 476 | - } | |
| 477 | - | |
| 478 | - break; | |
| 479 | - } | |
| 480 | - case DmpServerRequest::Method::POST_METHOD: | |
| 481 | - { | |
| 482 | - context.response()->write("{\"status\":\"true\",\"message\":\"删除缓存——————POST\"}"); | |
| 483 | - break; | |
| 484 | - } | |
| 485 | - default: | |
| 486 | - { | |
| 487 | - | |
| 488 | - } | |
| 489 | - } | |
| 490 | -} | |
| 491 | 211 | |
| 492 | 212 | void DmpManagerApiHandler::getCapabilities(const DmpServerApiContext &context) const |
| 493 | 213 | { | ... | ... |
| ... | ... | @@ -24,34 +24,10 @@ public: |
| 24 | 24 | void regService(const DmpServerApiContext &context) const; |
| 25 | 25 | void startService(const DmpServerApiContext &context) const; |
| 26 | 26 | void stopService(const DmpServerApiContext &context) const; |
| 27 | - //注册切片服务 | |
| 28 | - void RegTileService(const DmpServerApiContext &context) const; | |
| 29 | - //获取服务列表 | |
| 30 | - void GetServiceList(const DmpServerApiContext &context) const; | |
| 31 | - //获取服务详细信息 | |
| 32 | - void GetServiceDetail(const DmpServerApiContext &context) const; | |
| 33 | 27 | //更新服务信息 |
| 34 | 28 | void UpdateService(const DmpServerApiContext &context) const; |
| 35 | 29 | //删除服务 |
| 36 | 30 | void deleteService(const DmpServerApiContext &context) const; |
| 37 | - //获取切片服务信息 | |
| 38 | - void GetTileServiceInfo(const DmpServerApiContext &context) const; | |
| 39 | - //判断服务是否存在 | |
| 40 | - void IsExistServiceName(const DmpServerApiContext &context) const; | |
| 41 | - //新增目录 | |
| 42 | - void AddCatalog(const DmpServerApiContext &context) const; | |
| 43 | - //删除目录 | |
| 44 | - void DeleteCatalog(const DmpServerApiContext &context) const; | |
| 45 | - //获取调用切片信息 | |
| 46 | - void GetServicesMatrixSets(const DmpServerApiContext &context) const; | |
| 47 | - //获取目录列表 | |
| 48 | - void GetCatalogList(const DmpServerApiContext &context) const; | |
| 49 | - void UpdateServiceStatue(const DmpServerApiContext &context) const; | |
| 50 | - | |
| 51 | - //缓存操作 | |
| 52 | - void UpdateCache(const DmpServerApiContext &context)const; | |
| 53 | - void DeleteCache(const DmpServerApiContext &context)const; | |
| 54 | - | |
| 55 | 31 | void getCapabilities(const DmpServerApiContext &context)const; |
| 56 | 32 | void reloadServices(const DmpServerApiContext &context)const; |
| 57 | 33 | ... | ... |
请
注册
或
登录
后发表评论