提交 30f451f6226340a5fa83f40858fbc213e8b1930a

作者 LJH 李佳桓
1 个父辈 e7537c78

add

  1 +
  2 +# coding=utf-8
  3 +"""" Simple SERVICE custom implementation
  4 +
  5 +http://localhost:8080/cgi-bin/qgis_mapserv.cgi?MAP=/qgis-server/projects/helloworld.qgs&SERVICE=CUSTOM
  6 +
  7 +.. note:: This program is free software; you can redistribute it and/or modify
  8 + it under the terms of the GNU General Public License as published by
  9 + the Free Software Foundation; either version 2 of the License, or
  10 + (at your option) any later version.
  11 +
  12 +"""
  13 +
  14 +__author__ = 'elpaso@itopen.it'
  15 +__date__ = '2019-08-26'
  16 +__copyright__ = 'Copyright 2019, ItOpen'
  17 +
  18 +from dmap_server import *
  19 +
  20 +class CustomServiceService(DmpService):
  21 +
  22 + def __init__(self):
  23 + DmpService.__init__(self)
  24 +
  25 + def name(self):
  26 + return "CUSTOM"
  27 +
  28 + def version(self):
  29 + return "1.0.0"
  30 +
  31 + def allow_method(self):
  32 + return True
  33 +
  34 + def execute_request(self, request, response):
  35 + response.status_code = 200
  36 + response.write("Custom service executeRequest")
  37 +
  38 +class CustomService():
  39 +
  40 + def __init__(self, serverIface):
  41 + self.serv = CustomServiceService()
  42 + serverIface.service_registry().register_service(CustomServiceService())
  43 +
... ...
注册登录 后发表评论