image_wms_kv.py 1.5 KB
# coding=utf-8
#author:        4N
#createtime:    2021/3/24
#email:         nheweijun@sina.com

from app.util.component.ApiTemplate import ApiTemplate


from .util.ImageWMSServer import ImageWMSServer
class Api(ApiTemplate):

    api_name = "WMS"

    def process(self):
        try:
            instance = ImageWMSServer()
            if self.para.get("guid"):
                response = instance.wms(self.para.get("service_name"),self.para)
            else:
                response = instance.wms(self.para.get("guid"), self.para,type="guid")
        except Exception as e:
           raise e
        return response

    api_doc = {
        "tags": ["影像接口"],
        "parameters": [
            {"name": "guid",
             "in": "query",
             "type": "string"},
            {"name": "service_name",
             "in": "query",
             "type": "string"},
            {"name": "bbox",
             "in": "query",
             "type": "string"},
            {"name": "width",
             "in": "query",
             "type": "string"},
            {"name": "height",
             "in": "query",
             "type": "string"},
            {"name": "format",
             "in": "query",
             "type": "string"},
            {"name": "quality",
             "in": "query",
             "type": "string"}
        ],
        "responses": {
            200: {
                "schema": {
                    "properties": {
                    }
                }
            }
        }
    }