正在显示
20 个修改的文件
包含
198 行增加
和
189 行删除
| @@ -150,7 +150,7 @@ class Api(ApiTemplate): | @@ -150,7 +150,7 @@ class Api(ApiTemplate): | ||
| 150 | if count%10000==0: | 150 | if count%10000==0: |
| 151 | StructurePrint().print("{}图层已抽稀{}个对象".format(table.name, count)) | 151 | StructurePrint().print("{}图层已抽稀{}个对象".format(table.name, count)) |
| 152 | 152 | ||
| 153 | - vacuate_process.set_vacuate_count() | 153 | + #vacuate_process.set_vacuate_count() |
| 154 | 154 | ||
| 155 | #新增 | 155 | #新增 |
| 156 | if configure.VACUATE_DB_URI: | 156 | if configure.VACUATE_DB_URI: |
| @@ -386,6 +386,7 @@ class VacuateProcess: | @@ -386,6 +386,7 @@ class VacuateProcess: | ||
| 386 | field_dict = feature.items() | 386 | field_dict = feature.items() |
| 387 | for field_name in field_dict: | 387 | for field_name in field_dict: |
| 388 | feat.SetField(field_name, field_dict[field_name]) | 388 | feat.SetField(field_name, field_dict[field_name]) |
| 389 | + | ||
| 389 | feat.SetField("_dcigrid_name_",".".join(key.split(".")[1:])) | 390 | feat.SetField("_dcigrid_name_",".".join(key.split(".")[1:])) |
| 390 | 391 | ||
| 391 | vacuate_layer.CreateFeature(feat) | 392 | vacuate_layer.CreateFeature(feat) |
| @@ -393,6 +394,8 @@ class VacuateProcess: | @@ -393,6 +394,8 @@ class VacuateProcess: | ||
| 393 | #超大的还有机会 | 394 | #超大的还有机会 |
| 394 | elif long_extent > 10 * this_grid_len or lat_extent > 10 * this_grid_len: | 395 | elif long_extent > 10 * this_grid_len or lat_extent > 10 * this_grid_len: |
| 395 | vacuate_layer: Layer = self.vacuate_layers.get(level) | 396 | vacuate_layer: Layer = self.vacuate_layers.get(level) |
| 397 | + | ||
| 398 | + | ||
| 396 | feat = ogr.Feature(vacuate_layer.GetLayerDefn()) | 399 | feat = ogr.Feature(vacuate_layer.GetLayerDefn()) |
| 397 | feat.SetGeometry(g) | 400 | feat.SetGeometry(g) |
| 398 | 401 |
| @@ -27,7 +27,7 @@ class Api(ApiTemplate): | @@ -27,7 +27,7 @@ class Api(ApiTemplate): | ||
| 27 | url = "{}/API/Service/Delete".format(self.para.get("url")) | 27 | url = "{}/API/Service/Delete".format(self.para.get("url")) |
| 28 | response:requests.Response = requests.post(url,data=self.para) | 28 | response:requests.Response = requests.post(url,data=self.para) |
| 29 | if not response.json().get("result"): | 29 | if not response.json().get("result"): |
| 30 | - raise Exception("由于{},影像服务删除失败!".format(response.json().get("msg"))) | 30 | + raise Exception("由于{},影像地图删除失败!".format(response.json().get("msg"))) |
| 31 | res["result"] = True | 31 | res["result"] = True |
| 32 | except Exception as e: | 32 | except Exception as e: |
| 33 | raise e | 33 | raise e |
| @@ -7,6 +7,7 @@ | @@ -7,6 +7,7 @@ | ||
| 7 | from app.util.component.ApiTemplate import ApiTemplate | 7 | from app.util.component.ApiTemplate import ApiTemplate |
| 8 | import requests | 8 | import requests |
| 9 | from app.util.component.UserCheck import UserCheck | 9 | from app.util.component.UserCheck import UserCheck |
| 10 | +from ..util.ServiceType import ServiceType | ||
| 10 | 11 | ||
| 11 | class Api(ApiTemplate): | 12 | class Api(ApiTemplate): |
| 12 | 13 | ||
| @@ -27,7 +28,7 @@ class Api(ApiTemplate): | @@ -27,7 +28,7 @@ class Api(ApiTemplate): | ||
| 27 | url = "{}/API/Service/Edit".format(self.para.get("url")) | 28 | url = "{}/API/Service/Edit".format(self.para.get("url")) |
| 28 | response:requests.Response = requests.post(url,data=self.para) | 29 | response:requests.Response = requests.post(url,data=self.para) |
| 29 | if not response.json().get("result"): | 30 | if not response.json().get("result"): |
| 30 | - raise Exception("由于{},影像服务修改失败!".format(response.json().get("msg"))) | 31 | + raise Exception("由于{},影像地图修改失败!".format(response.json().get("msg"))) |
| 31 | res["result"] = True | 32 | res["result"] = True |
| 32 | except Exception as e: | 33 | except Exception as e: |
| 33 | raise e | 34 | raise e |
| @@ -45,8 +46,8 @@ class Api(ApiTemplate): | @@ -45,8 +46,8 @@ class Api(ApiTemplate): | ||
| 45 | {"name": "type", | 46 | {"name": "type", |
| 46 | "in": "formData", | 47 | "in": "formData", |
| 47 | "type": "string", | 48 | "type": "string", |
| 48 | - "enum": ["地图服务","切片服务","影像服务"], | ||
| 49 | - "description": "[地图服务,切片服务,影像服务]"}, | 49 | + "enum": [ServiceType.image_service.value], |
| 50 | + }, | ||
| 50 | 51 | ||
| 51 | {"name": "url", | 52 | {"name": "url", |
| 52 | "in": "formData", | 53 | "in": "formData", |
| @@ -56,31 +57,31 @@ class Api(ApiTemplate): | @@ -56,31 +57,31 @@ class Api(ApiTemplate): | ||
| 56 | {"name": "name", | 57 | {"name": "name", |
| 57 | "in": "formData", | 58 | "in": "formData", |
| 58 | "type": "string", | 59 | "type": "string", |
| 59 | - "description": "[地图服务,切片服务,影像服务]"}, | 60 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 60 | {"name": "title", | 61 | {"name": "title", |
| 61 | "in": "formData", | 62 | "in": "formData", |
| 62 | "type": "string", | 63 | "type": "string", |
| 63 | - "description": "[地图服务,切片服务,影像服务]"}, | 64 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 64 | {"name": "description", | 65 | {"name": "description", |
| 65 | "in": "formData", | 66 | "in": "formData", |
| 66 | "type": "string", | 67 | "type": "string", |
| 67 | - "description": "[地图服务,切片服务,影像服务]"}, | 68 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 68 | 69 | ||
| 69 | {"name": "catalog_guid", | 70 | {"name": "catalog_guid", |
| 70 | "in": "formData", | 71 | "in": "formData", |
| 71 | "type": "string", | 72 | "type": "string", |
| 72 | - "description": "[地图服务,切片服务,影像服务]"}, | 73 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 73 | 74 | ||
| 74 | {"name": "functions", | 75 | {"name": "functions", |
| 75 | "in": "formData", | 76 | "in": "formData", |
| 76 | "type": "string", | 77 | "type": "string", |
| 77 | - "description": "[地图服务,影像服务]以逗号相隔,可选WMTS,WMS"}, | 78 | + "description": "[矢量地图,影像地图]以逗号相隔,可选WMTS,WMS"}, |
| 78 | 79 | ||
| 79 | # 影像参数 | 80 | # 影像参数 |
| 80 | {"name": "image_guids", | 81 | {"name": "image_guids", |
| 81 | "in": "formData", | 82 | "in": "formData", |
| 82 | "type": "string", | 83 | "type": "string", |
| 83 | - "description": "[影像服务]影像guids,以英文逗号相隔"}, | 84 | + "description": "[影像地图]影像guids,以英文逗号相隔"}, |
| 84 | {"name": "scheme", | 85 | {"name": "scheme", |
| 85 | "in": "formData", | 86 | "in": "formData", |
| 86 | "type": "string", | 87 | "type": "string", |
| @@ -18,7 +18,7 @@ class Api(ApiTemplate): | @@ -18,7 +18,7 @@ class Api(ApiTemplate): | ||
| 18 | url = "{}/API/Service/Register".format(self.para.get("url")) | 18 | url = "{}/API/Service/Register".format(self.para.get("url")) |
| 19 | response:requests.Response = requests.post(url,data=self.para) | 19 | response:requests.Response = requests.post(url,data=self.para) |
| 20 | if not response.json().get("result"): | 20 | if not response.json().get("result"): |
| 21 | - raise Exception("由于{}影像服务注册失败!".format(response.json().get("msg"))) | 21 | + raise Exception("由于{}影像地图注册失败!".format(response.json().get("msg"))) |
| 22 | res["result"] = True | 22 | res["result"] = True |
| 23 | except Exception as e: | 23 | except Exception as e: |
| 24 | raise e | 24 | raise e |
| @@ -34,12 +34,12 @@ class Api(ApiTemplate): | @@ -34,12 +34,12 @@ class Api(ApiTemplate): | ||
| 34 | "in": "formData", | 34 | "in": "formData", |
| 35 | "type": "string", | 35 | "type": "string", |
| 36 | "required": "true", | 36 | "required": "true", |
| 37 | - "description": "[地图服务,切片服务,影像服务]"}, | 37 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 38 | 38 | ||
| 39 | {"name": "title", | 39 | {"name": "title", |
| 40 | "in": "formData", | 40 | "in": "formData", |
| 41 | "type": "string", | 41 | "type": "string", |
| 42 | - "description": "[地图服务,切片服务,影像服务]"}, | 42 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 43 | 43 | ||
| 44 | {"name": "url", | 44 | {"name": "url", |
| 45 | "in": "formData", | 45 | "in": "formData", |
| @@ -48,33 +48,33 @@ class Api(ApiTemplate): | @@ -48,33 +48,33 @@ class Api(ApiTemplate): | ||
| 48 | {"name": "description", | 48 | {"name": "description", |
| 49 | "in": "formData", | 49 | "in": "formData", |
| 50 | "type": "string", | 50 | "type": "string", |
| 51 | - "description": "[地图服务,切片服务,影像服务]"}, | 51 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 52 | {"name": "type", | 52 | {"name": "type", |
| 53 | "in": "formData", | 53 | "in": "formData", |
| 54 | "type": "string", | 54 | "type": "string", |
| 55 | - "enum":["影像服务"], | 55 | + "enum":["影像地图"], |
| 56 | "required": "true", | 56 | "required": "true", |
| 57 | - "description": "[地图服务,切片服务,影像服务]"}, | 57 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 58 | {"name": "catalog_guid", | 58 | {"name": "catalog_guid", |
| 59 | "in": "formData", | 59 | "in": "formData", |
| 60 | "type": "string", | 60 | "type": "string", |
| 61 | - "description": "[地图服务,切片服务,影像服务]"}, | 61 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 62 | 62 | ||
| 63 | #影像参数 | 63 | #影像参数 |
| 64 | {"name": "image_guids", | 64 | {"name": "image_guids", |
| 65 | "in": "formData", | 65 | "in": "formData", |
| 66 | "type": "string", | 66 | "type": "string", |
| 67 | - "description": "[影像服务]影像guids,以英文逗号相隔"}, | 67 | + "description": "[影像地图]影像guids,以英文逗号相隔"}, |
| 68 | 68 | ||
| 69 | {"name": "scheme", | 69 | {"name": "scheme", |
| 70 | "in": "formData", | 70 | "in": "formData", |
| 71 | "type": "string", | 71 | "type": "string", |
| 72 | - "description": "影像服务切片方案,json形式"}, | 72 | + "description": "影像地图切片方案,json形式"}, |
| 73 | 73 | ||
| 74 | {"name": "functions", | 74 | {"name": "functions", |
| 75 | "in": "formData", | 75 | "in": "formData", |
| 76 | "type": "string", | 76 | "type": "string", |
| 77 | - "description": "[影像服务]functions", | 77 | + "description": "[影像地图]functions", |
| 78 | "enum": ["WMS","WMTS"]}, | 78 | "enum": ["WMS","WMTS"]}, |
| 79 | 79 | ||
| 80 | ], | 80 | ], |
| @@ -8,13 +8,13 @@ from flask import Blueprint | @@ -8,13 +8,13 @@ from flask import Blueprint | ||
| 8 | from app.util import BlueprintApi | 8 | from app.util import BlueprintApi |
| 9 | from . import map_service_register, map_service_edit | 9 | from . import map_service_register, map_service_edit |
| 10 | from app.decorators.token_decorator import token_decorator | 10 | from app.decorators.token_decorator import token_decorator |
| 11 | - | 11 | +from ..util.ServiceType import ServiceType |
| 12 | 12 | ||
| 13 | class DataManager(BlueprintApi): | 13 | class DataManager(BlueprintApi): |
| 14 | 14 | ||
| 15 | bp = Blueprint("MapService", __name__, | 15 | bp = Blueprint("MapService", __name__, |
| 16 | url_prefix="/API/Service/MapService") | 16 | url_prefix="/API/Service/MapService") |
| 17 | - service_type = ["地图服务"] | 17 | + service_type = [ServiceType.map_service.value] |
| 18 | 18 | ||
| 19 | @staticmethod | 19 | @staticmethod |
| 20 | @bp.route('/Register', methods=['POST']) | 20 | @bp.route('/Register', methods=['POST']) |
| @@ -89,47 +89,47 @@ class Api(ApiTemplate): | @@ -89,47 +89,47 @@ class Api(ApiTemplate): | ||
| 89 | return res | 89 | return res |
| 90 | 90 | ||
| 91 | api_doc = { | 91 | api_doc = { |
| 92 | - "tags": ["地图服务接口"], | 92 | + "tags": ["矢量地图接口"], |
| 93 | "parameters": [ | 93 | "parameters": [ |
| 94 | 94 | ||
| 95 | {"name": "name", | 95 | {"name": "name", |
| 96 | "in": "formData", | 96 | "in": "formData", |
| 97 | "type": "string", | 97 | "type": "string", |
| 98 | "required": "true", | 98 | "required": "true", |
| 99 | - "description": "[地图服务,切片服务,影像服务]"}, | 99 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 100 | {"name": "title", | 100 | {"name": "title", |
| 101 | "in": "formData", | 101 | "in": "formData", |
| 102 | "type": "string", | 102 | "type": "string", |
| 103 | - "description": "[地图服务,切片服务,影像服务]"}, | 103 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 104 | {"name": "description", | 104 | {"name": "description", |
| 105 | "in": "formData", | 105 | "in": "formData", |
| 106 | "type": "string", | 106 | "type": "string", |
| 107 | - "description": "[地图服务,切片服务,影像服务]"}, | 107 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 108 | {"name": "catalog_guid", | 108 | {"name": "catalog_guid", |
| 109 | "in": "formData", | 109 | "in": "formData", |
| 110 | "type": "string", | 110 | "type": "string", |
| 111 | - "description": "[地图服务,切片服务,影像服务]"}, | 111 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 112 | 112 | ||
| 113 | 113 | ||
| 114 | {"name": "layer_style", | 114 | {"name": "layer_style", |
| 115 | "in": "formData", | 115 | "in": "formData", |
| 116 | "type": "string", | 116 | "type": "string", |
| 117 | - "description": "[地图服务,切片服务]图层样式"}, | 117 | + "description": "[矢量地图,电子地图]图层样式"}, |
| 118 | 118 | ||
| 119 | {"name": "functions", | 119 | {"name": "functions", |
| 120 | "in": "formData", | 120 | "in": "formData", |
| 121 | "type": "string", | 121 | "type": "string", |
| 122 | - "description": "[地图服务]服务能力,用逗号相隔"}, | 122 | + "description": "[矢量地图]服务能力,用逗号相隔"}, |
| 123 | 123 | ||
| 124 | - #地图服务参数 | 124 | + #矢量地图参数 |
| 125 | {"name": "capabilities", | 125 | {"name": "capabilities", |
| 126 | "in": "formData", | 126 | "in": "formData", |
| 127 | "type": "int", | 127 | "type": "int", |
| 128 | - "description": "[地图服务]"}, | 128 | + "description": "[矢量地图]"}, |
| 129 | {"name": "project", | 129 | {"name": "project", |
| 130 | "in": "formData", | 130 | "in": "formData", |
| 131 | "type": "string", | 131 | "type": "string", |
| 132 | - "description": "[地图服务]project"}, | 132 | + "description": "[矢量地图]project"}, |
| 133 | 133 | ||
| 134 | ], | 134 | ], |
| 135 | "responses": { | 135 | "responses": { |
| @@ -88,43 +88,43 @@ class Api(ApiTemplate): | @@ -88,43 +88,43 @@ class Api(ApiTemplate): | ||
| 88 | return res | 88 | return res |
| 89 | 89 | ||
| 90 | api_doc = { | 90 | api_doc = { |
| 91 | - "tags": ["地图服务接口"], | 91 | + "tags": ["矢量地图接口"], |
| 92 | "parameters": [ | 92 | "parameters": [ |
| 93 | 93 | ||
| 94 | {"name": "name", | 94 | {"name": "name", |
| 95 | "in": "formData", | 95 | "in": "formData", |
| 96 | "type": "string", | 96 | "type": "string", |
| 97 | "required": "true", | 97 | "required": "true", |
| 98 | - "description": "[地图服务,切片服务,影像服务]"}, | 98 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 99 | {"name": "title", | 99 | {"name": "title", |
| 100 | "in": "formData", | 100 | "in": "formData", |
| 101 | "type": "string", | 101 | "type": "string", |
| 102 | - "description": "[地图服务,切片服务,影像服务]"}, | 102 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 103 | {"name": "description", | 103 | {"name": "description", |
| 104 | "in": "formData", | 104 | "in": "formData", |
| 105 | "type": "string", | 105 | "type": "string", |
| 106 | - "description": "[地图服务,切片服务,影像服务]"}, | 106 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 107 | {"name": "type", | 107 | {"name": "type", |
| 108 | "in": "formData", | 108 | "in": "formData", |
| 109 | "type": "string", | 109 | "type": "string", |
| 110 | - "enum": ["地图服务"], | 110 | + "enum": ["矢量地图"], |
| 111 | "required": "true", | 111 | "required": "true", |
| 112 | - "description": "[地图服务,切片服务,影像服务]"}, | 112 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 113 | {"name": "catalog_guid", | 113 | {"name": "catalog_guid", |
| 114 | "in": "formData", | 114 | "in": "formData", |
| 115 | "type": "string", | 115 | "type": "string", |
| 116 | - "description": "[地图服务,切片服务,影像服务]"}, | 116 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 117 | 117 | ||
| 118 | 118 | ||
| 119 | - #地图服务参数 | 119 | + #矢量地图参数 |
| 120 | {"name": "capabilities", | 120 | {"name": "capabilities", |
| 121 | "in": "formData", | 121 | "in": "formData", |
| 122 | "type": "int", | 122 | "type": "int", |
| 123 | - "description": "[地图服务]"}, | 123 | + "description": "[矢量地图]"}, |
| 124 | {"name": "project", | 124 | {"name": "project", |
| 125 | "in": "formData", | 125 | "in": "formData", |
| 126 | "type": "string", | 126 | "type": "string", |
| 127 | - "description": "[地图服务]project"}, | 127 | + "description": "[矢量地图]project"}, |
| 128 | 128 | ||
| 129 | 129 | ||
| 130 | ], | 130 | ], |
| @@ -9,7 +9,7 @@ from app.modules.service.models import Service | @@ -9,7 +9,7 @@ from app.modules.service.models import Service | ||
| 9 | from app.modules.service.models import TileService | 9 | from app.modules.service.models import TileService |
| 10 | from app.modules.service.models import MapService | 10 | from app.modules.service.models import MapService |
| 11 | from app.util.component.UserCheck import UserCheck | 11 | from app.util.component.UserCheck import UserCheck |
| 12 | - | 12 | +from .util.ServiceType import ServiceType |
| 13 | class Api(ApiTemplate): | 13 | class Api(ApiTemplate): |
| 14 | 14 | ||
| 15 | api_name = "服务删除" | 15 | api_name = "服务删除" |
| @@ -24,7 +24,7 @@ class Api(ApiTemplate): | @@ -24,7 +24,7 @@ class Api(ApiTemplate): | ||
| 24 | s_type = self.para.get("type") | 24 | s_type = self.para.get("type") |
| 25 | 25 | ||
| 26 | #删除本地服务 | 26 | #删除本地服务 |
| 27 | - if s_type in ["切片服务","地图服务"]: | 27 | + if s_type in [ServiceType.map_service.value,ServiceType.tile_service.value]: |
| 28 | service:Service = Service.query.filter_by(guid=guid).one_or_none() | 28 | service:Service = Service.query.filter_by(guid=guid).one_or_none() |
| 29 | if service: | 29 | if service: |
| 30 | 30 | ||
| @@ -32,12 +32,12 @@ class Api(ApiTemplate): | @@ -32,12 +32,12 @@ class Api(ApiTemplate): | ||
| 32 | UserCheck.verify(service.creator) | 32 | UserCheck.verify(service.creator) |
| 33 | 33 | ||
| 34 | try: | 34 | try: |
| 35 | - if service.type.__eq__("切片服务"): | 35 | + if service.type == ServiceType.tile_service.value: |
| 36 | #调用接口 | 36 | #调用接口 |
| 37 | tile_service = TileService.query.filter_by(service_guid=guid).one_or_none() | 37 | tile_service = TileService.query.filter_by(service_guid=guid).one_or_none() |
| 38 | db.session.delete(tile_service) | 38 | db.session.delete(tile_service) |
| 39 | 39 | ||
| 40 | - if service.type.__eq__("地图服务"): | 40 | + if service.type == ServiceType.map_service.value: |
| 41 | map_service = MapService.query.filter_by(service_guid=guid).one_or_none() | 41 | map_service = MapService.query.filter_by(service_guid=guid).one_or_none() |
| 42 | db.session.delete(map_service) | 42 | db.session.delete(map_service) |
| 43 | 43 |
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | 5 | ||
| 6 | from app.util.component.ApiTemplate import ApiTemplate | 6 | from app.util.component.ApiTemplate import ApiTemplate |
| 7 | from app.modules.service.models import Service | 7 | from app.modules.service.models import Service |
| 8 | - | 8 | +from .util.ServiceType import ServiceType |
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | class Api(ApiTemplate): | 11 | class Api(ApiTemplate): |
| @@ -19,19 +19,19 @@ class Api(ApiTemplate): | @@ -19,19 +19,19 @@ class Api(ApiTemplate): | ||
| 19 | s_type = self.para.get("type") | 19 | s_type = self.para.get("type") |
| 20 | 20 | ||
| 21 | # 修改本地服务 | 21 | # 修改本地服务 |
| 22 | - if s_type in ["切片服务", "地图服务"]: | 22 | + if s_type in [ServiceType.tile_service.value, ServiceType.map_service.value]: |
| 23 | 23 | ||
| 24 | service = Service.query.filter_by(guid=guid).one_or_none() | 24 | service = Service.query.filter_by(guid=guid).one_or_none() |
| 25 | if not service: | 25 | if not service: |
| 26 | raise Exception("服务不存在!") | 26 | raise Exception("服务不存在!") |
| 27 | 27 | ||
| 28 | - if service.type.__eq__("地图服务"): | 28 | + if service.type == ServiceType.map_service.value: |
| 29 | from app.modules.service.map_service.map_service_edit import Api as RealApi | 29 | from app.modules.service.map_service.map_service_edit import Api as RealApi |
| 30 | - elif service.type.__eq__("切片服务"): | 30 | + elif service.type == ServiceType.tile_service.value: |
| 31 | from app.modules.service.tile_service.tile_service_edit import Api as RealApi | 31 | from app.modules.service.tile_service.tile_service_edit import Api as RealApi |
| 32 | else: | 32 | else: |
| 33 | return res | 33 | return res |
| 34 | - elif s_type.__eq__("影像服务"): | 34 | + elif s_type == ServiceType.image_service.value: |
| 35 | from app.modules.service.image_service.image_service_edit import Api as RealApi | 35 | from app.modules.service.image_service.image_service_edit import Api as RealApi |
| 36 | else: | 36 | else: |
| 37 | return res | 37 | return res |
| @@ -55,8 +55,8 @@ class Api(ApiTemplate): | @@ -55,8 +55,8 @@ class Api(ApiTemplate): | ||
| 55 | {"name": "type", | 55 | {"name": "type", |
| 56 | "in": "formData", | 56 | "in": "formData", |
| 57 | "type": "string", | 57 | "type": "string", |
| 58 | - "enum": ["地图服务","切片服务","影像服务"], | ||
| 59 | - "description": "[地图服务,切片服务,影像服务]"}, | 58 | + "enum": [st.value for st in ServiceType], |
| 59 | + "description": "[矢量地图,电子地图,影像地图]"}, | ||
| 60 | 60 | ||
| 61 | {"name": "url", | 61 | {"name": "url", |
| 62 | "in": "formData", | 62 | "in": "formData", |
| @@ -66,31 +66,31 @@ class Api(ApiTemplate): | @@ -66,31 +66,31 @@ class Api(ApiTemplate): | ||
| 66 | {"name": "name", | 66 | {"name": "name", |
| 67 | "in": "formData", | 67 | "in": "formData", |
| 68 | "type": "string", | 68 | "type": "string", |
| 69 | - "description": "[地图服务,切片服务,影像服务]"}, | 69 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 70 | {"name": "title", | 70 | {"name": "title", |
| 71 | "in": "formData", | 71 | "in": "formData", |
| 72 | "type": "string", | 72 | "type": "string", |
| 73 | - "description": "[地图服务,切片服务,影像服务]"}, | 73 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 74 | {"name": "description", | 74 | {"name": "description", |
| 75 | "in": "formData", | 75 | "in": "formData", |
| 76 | "type": "string", | 76 | "type": "string", |
| 77 | - "description": "[地图服务,切片服务,影像服务]"}, | 77 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 78 | 78 | ||
| 79 | {"name": "catalog_guid", | 79 | {"name": "catalog_guid", |
| 80 | "in": "formData", | 80 | "in": "formData", |
| 81 | "type": "string", | 81 | "type": "string", |
| 82 | - "description": "[地图服务,切片服务,影像服务]"}, | 82 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 83 | 83 | ||
| 84 | {"name": "functions", | 84 | {"name": "functions", |
| 85 | "in": "formData", | 85 | "in": "formData", |
| 86 | "type": "string", | 86 | "type": "string", |
| 87 | - "description": "[地图服务,影像服务]以逗号相隔,可选WMTS,WMS"}, | 87 | + "description": "[矢量地图,影像地图]以逗号相隔,可选WMTS,WMS"}, |
| 88 | 88 | ||
| 89 | # 影像参数 | 89 | # 影像参数 |
| 90 | {"name": "image_guids", | 90 | {"name": "image_guids", |
| 91 | "in": "formData", | 91 | "in": "formData", |
| 92 | "type": "string", | 92 | "type": "string", |
| 93 | - "description": "[影像服务]影像guids,以英文逗号相隔"}, | 93 | + "description": "[影像地图]影像guids,以英文逗号相隔"}, |
| 94 | {"name": "scheme", | 94 | {"name": "scheme", |
| 95 | "in": "formData", | 95 | "in": "formData", |
| 96 | "type": "string", | 96 | "type": "string", |
| @@ -100,65 +100,65 @@ class Api(ApiTemplate): | @@ -100,65 +100,65 @@ class Api(ApiTemplate): | ||
| 100 | {"name": "overview", | 100 | {"name": "overview", |
| 101 | "in": "formData", | 101 | "in": "formData", |
| 102 | "type": "string", | 102 | "type": "string", |
| 103 | - "description": "[切片服务]缩略图"}, | 103 | + "description": "[电子地图]缩略图"}, |
| 104 | {"name": "scheme_guid", | 104 | {"name": "scheme_guid", |
| 105 | "in": "formData", | 105 | "in": "formData", |
| 106 | "type": "string", | 106 | "type": "string", |
| 107 | - "description": "切片服务切片方案"}, | 107 | + "description": "电子地图切片方案"}, |
| 108 | {"name": "tile_type", | 108 | {"name": "tile_type", |
| 109 | "in": "formData", | 109 | "in": "formData", |
| 110 | "type": "string", | 110 | "type": "string", |
| 111 | - "description": "[切片服务]tile_type"}, | 111 | + "description": "[电子地图]tile_type"}, |
| 112 | {"name": "vendor", | 112 | {"name": "vendor", |
| 113 | "in": "formData", | 113 | "in": "formData", |
| 114 | "type": "string", | 114 | "type": "string", |
| 115 | - "description": "[切片服务]厂商"}, | 115 | + "description": "[电子地图]厂商"}, |
| 116 | {"name": "crs", | 116 | {"name": "crs", |
| 117 | "in": "formData", | 117 | "in": "formData", |
| 118 | "type": "string", | 118 | "type": "string", |
| 119 | - "description": "[切片服务]坐标系"}, | 119 | + "description": "[电子地图]坐标系"}, |
| 120 | {"name": "datasource", | 120 | {"name": "datasource", |
| 121 | "in": "formData", | 121 | "in": "formData", |
| 122 | "type": "string", | 122 | "type": "string", |
| 123 | - "description": "[切片服务]数据路径"}, | 123 | + "description": "[电子地图]数据路径"}, |
| 124 | {"name": "layer_name", | 124 | {"name": "layer_name", |
| 125 | "in": "formData", | 125 | "in": "formData", |
| 126 | "type": "string", | 126 | "type": "string", |
| 127 | - "description": "[切片服务]图层名"}, | 127 | + "description": "[电子地图]图层名"}, |
| 128 | {"name": "layer_alias", | 128 | {"name": "layer_alias", |
| 129 | "in": "formData", | 129 | "in": "formData", |
| 130 | "type": "string", | 130 | "type": "string", |
| 131 | - "description": "[切片服务]图层别名"}, | 131 | + "description": "[电子地图]图层别名"}, |
| 132 | {"name": "layer_title", | 132 | {"name": "layer_title", |
| 133 | "in": "formData", | 133 | "in": "formData", |
| 134 | "type": "string", | 134 | "type": "string", |
| 135 | - "description": "[切片服务]图层标题"}, | 135 | + "description": "[电子地图]图层标题"}, |
| 136 | {"name": "layer_style", | 136 | {"name": "layer_style", |
| 137 | "in": "formData", | 137 | "in": "formData", |
| 138 | "type": "string", | 138 | "type": "string", |
| 139 | - "description": "[地图服务,切片服务]图层样式"}, | 139 | + "description": "[矢量地图,电子地图]图层样式"}, |
| 140 | {"name": "layer_format", | 140 | {"name": "layer_format", |
| 141 | "in": "formData", | 141 | "in": "formData", |
| 142 | "type": "string", | 142 | "type": "string", |
| 143 | - "description": "[切片服务]图层format"}, | 143 | + "description": "[电子地图]图层format"}, |
| 144 | {"name": "layer_extent", | 144 | {"name": "layer_extent", |
| 145 | "in": "formData", | 145 | "in": "formData", |
| 146 | "type": "string", | 146 | "type": "string", |
| 147 | - "description": "[切片服务]图层范围"}, | 147 | + "description": "[电子地图]图层范围"}, |
| 148 | {"name": "layer_description", | 148 | {"name": "layer_description", |
| 149 | "in": "formData", | 149 | "in": "formData", |
| 150 | "type": "string", | 150 | "type": "string", |
| 151 | - "description": "[切片服务]图层描述"}, | 151 | + "description": "[电子地图]图层描述"}, |
| 152 | 152 | ||
| 153 | - #地图服务参数 | 153 | + #矢量地图参数 |
| 154 | {"name": "capabilities", | 154 | {"name": "capabilities", |
| 155 | "in": "formData", | 155 | "in": "formData", |
| 156 | "type": "int", | 156 | "type": "int", |
| 157 | - "description": "[地图服务]"}, | 157 | + "description": "[矢量地图]"}, |
| 158 | {"name": "project", | 158 | {"name": "project", |
| 159 | "in": "formData", | 159 | "in": "formData", |
| 160 | "type": "string", | 160 | "type": "string", |
| 161 | - "description": "[地图服务]project"}, | 161 | + "description": "[矢量地图]project"}, |
| 162 | ], | 162 | ], |
| 163 | "responses": { | 163 | "responses": { |
| 164 | 200: { | 164 | 200: { |
| @@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
| 8 | from app.util.component.ApiTemplate import ApiTemplate | 8 | from app.util.component.ApiTemplate import ApiTemplate |
| 9 | from .models import ServiceEngine | 9 | from .models import ServiceEngine |
| 10 | from app.util import find_class,BlueprintApi | 10 | from app.util import find_class,BlueprintApi |
| 11 | - | 11 | +from .util.ServiceType import ServiceType |
| 12 | 12 | ||
| 13 | class Api(ApiTemplate): | 13 | class Api(ApiTemplate): |
| 14 | api_name = "服务类型" | 14 | api_name = "服务类型" |
| @@ -24,7 +24,7 @@ class Api(ApiTemplate): | @@ -24,7 +24,7 @@ class Api(ApiTemplate): | ||
| 24 | if hasattr(api,"service_type"): | 24 | if hasattr(api,"service_type"): |
| 25 | service_types.extend(api.service_type) | 25 | service_types.extend(api.service_type) |
| 26 | if ServiceEngine.query.filter_by(type="ImageServer").first(): | 26 | if ServiceEngine.query.filter_by(type="ImageServer").first(): |
| 27 | - service_types.append("影像服务") | 27 | + service_types.append(ServiceType.image_service.value) |
| 28 | res["data"] = service_types | 28 | res["data"] = service_types |
| 29 | res["result"] = True | 29 | res["result"] = True |
| 30 | 30 |
| @@ -8,6 +8,8 @@ from app.util.component.ApiTemplate import ApiTemplate | @@ -8,6 +8,8 @@ from app.util.component.ApiTemplate import ApiTemplate | ||
| 8 | from app.util.component.ModelVisitor import ModelVisitor | 8 | from app.util.component.ModelVisitor import ModelVisitor |
| 9 | from .models import Service | 9 | from .models import Service |
| 10 | import requests | 10 | import requests |
| 11 | +from .util.ServiceType import ServiceType | ||
| 12 | + | ||
| 11 | class Api(ApiTemplate): | 13 | class Api(ApiTemplate): |
| 12 | api_name = "服务Info" | 14 | api_name = "服务Info" |
| 13 | def process(self): | 15 | def process(self): |
| @@ -17,24 +19,17 @@ class Api(ApiTemplate): | @@ -17,24 +19,17 @@ class Api(ApiTemplate): | ||
| 17 | guid = self.para.get("guid") | 19 | guid = self.para.get("guid") |
| 18 | s_type = self.para.get("type") | 20 | s_type = self.para.get("type") |
| 19 | 21 | ||
| 20 | - if s_type in ["地图服务","切片服务"]: | 22 | + if s_type in [ServiceType.map_service.value,ServiceType.tile_service.value]: |
| 21 | 23 | ||
| 22 | service = Service.query.filter_by(guid=guid).one_or_none() | 24 | service = Service.query.filter_by(guid=guid).one_or_none() |
| 23 | if not service: | 25 | if not service: |
| 24 | raise Exception("服务不存在!") | 26 | raise Exception("服务不存在!") |
| 25 | res["data"] = {} | 27 | res["data"] = {} |
| 26 | 28 | ||
| 27 | - if service.type.__eq__("影像服务"): | ||
| 28 | - speci_service = service.relate_image_service.one_or_none() | ||
| 29 | - relate_images = speci_service.images.all() | ||
| 30 | - res["data"]["speci_service"] = ModelVisitor.object_to_json(speci_service) | ||
| 31 | - res["data"]["speci_service"]["images"] = [{"name":im["name"],"guid":im["guid"]} for im in ModelVisitor.objects_to_jsonarray(relate_images)] | ||
| 32 | - res["data"]["speci_service"]["images"] = sorted(res["data"]["speci_service"]["images"], key=lambda x: x["name"]) | ||
| 33 | - | ||
| 34 | - elif service.type.__eq__("切片服务"): | 29 | + if service.type == ServiceType.tile_service.value: |
| 35 | speci_service = service.relate_tile_service.one_or_none() | 30 | speci_service = service.relate_tile_service.one_or_none() |
| 36 | res["data"]["speci_service"] = ModelVisitor.object_to_json(speci_service) | 31 | res["data"]["speci_service"] = ModelVisitor.object_to_json(speci_service) |
| 37 | - elif service.type.__eq__("地图服务"): | 32 | + elif service.type == ServiceType.map_service.value: |
| 38 | speci_service = service.relate_map_service.one_or_none() | 33 | speci_service = service.relate_map_service.one_or_none() |
| 39 | res["data"]["speci_service"] = ModelVisitor.object_to_json(speci_service) | 34 | res["data"]["speci_service"] = ModelVisitor.object_to_json(speci_service) |
| 40 | else: | 35 | else: |
| @@ -44,11 +39,12 @@ class Api(ApiTemplate): | @@ -44,11 +39,12 @@ class Api(ApiTemplate): | ||
| 44 | res["data"]["service"] = ModelVisitor.object_to_json(service) | 39 | res["data"]["service"] = ModelVisitor.object_to_json(service) |
| 45 | res["data"]["service"]["functions"] = functions | 40 | res["data"]["service"]["functions"] = functions |
| 46 | 41 | ||
| 47 | - elif s_type in ["影像服务"]: | 42 | + elif s_type in [ServiceType.image_service.value]: |
| 43 | + | ||
| 48 | edit_url = "{}/API/Service/Info".format(self.para.get("url")) | 44 | edit_url = "{}/API/Service/Info".format(self.para.get("url")) |
| 49 | response:requests.Response = requests.post(edit_url,self.para) | 45 | response:requests.Response = requests.post(edit_url,self.para) |
| 50 | if not response.json().get("result"): | 46 | if not response.json().get("result"): |
| 51 | - raise Exception("查询影像服务失败!") | 47 | + raise Exception("查询影像地图失败!") |
| 52 | res = response.json() | 48 | res = response.json() |
| 53 | else: | 49 | else: |
| 54 | pass | 50 | pass |
| @@ -69,7 +65,7 @@ class Api(ApiTemplate): | @@ -69,7 +65,7 @@ class Api(ApiTemplate): | ||
| 69 | "in": "formData", | 65 | "in": "formData", |
| 70 | "type": "string", | 66 | "type": "string", |
| 71 | "description": "type", | 67 | "description": "type", |
| 72 | - "enum":["地图服务","切片服务","影像服务"]}, | 68 | + "enum":[st.value for st in ServiceType]}, |
| 73 | {"name": "url", | 69 | {"name": "url", |
| 74 | "in": "formData", | 70 | "in": "formData", |
| 75 | "type": "string", | 71 | "type": "string", |
| @@ -10,7 +10,7 @@ from .models import Service,ServiceFunction,ServiceEngine | @@ -10,7 +10,7 @@ from .models import Service,ServiceFunction,ServiceEngine | ||
| 10 | from sqlalchemy import or_ | 10 | from sqlalchemy import or_ |
| 11 | import requests | 11 | import requests |
| 12 | import re | 12 | import re |
| 13 | -from datetime import datetime | 13 | +from .util.ServiceType import ServiceType |
| 14 | 14 | ||
| 15 | class Api(ApiTemplate): | 15 | class Api(ApiTemplate): |
| 16 | api_name = "服务列表" | 16 | api_name = "服务列表" |
| @@ -59,14 +59,14 @@ class Api(ApiTemplate): | @@ -59,14 +59,14 @@ class Api(ApiTemplate): | ||
| 59 | service_json["functions"] = sorted(ModelVisitor.objects_to_jsonarray(ServiceFunction.query.filter_by(service_guid=service_json["guid"]).all()), | 59 | service_json["functions"] = sorted(ModelVisitor.objects_to_jsonarray(ServiceFunction.query.filter_by(service_guid=service_json["guid"]).all()), |
| 60 | key=lambda x:x["type"]) | 60 | key=lambda x:x["type"]) |
| 61 | 61 | ||
| 62 | - # 影像服务 | 62 | + # 影像地图 |
| 63 | image_engines = ServiceEngine.query.filter_by(type="ImageServer").all() | 63 | image_engines = ServiceEngine.query.filter_by(type="ImageServer").all() |
| 64 | 64 | ||
| 65 | for ie in image_engines: | 65 | for ie in image_engines: |
| 66 | url = "{}/API/Service/List".format(ie.url) | 66 | url = "{}/API/Service/List".format(ie.url) |
| 67 | response:requests.Response = requests.post(url,{"page_size":"9999","page_index":"0"}) | 67 | response:requests.Response = requests.post(url,{"page_size":"9999","page_index":"0"}) |
| 68 | if not response.json().get("result"): | 68 | if not response.json().get("result"): |
| 69 | - raise Exception("修改影像服务失败!") | 69 | + raise Exception("获取影像地图失败!") |
| 70 | else: | 70 | else: |
| 71 | raw_json = response.json()["data"]["list"] | 71 | raw_json = response.json()["data"]["list"] |
| 72 | if state: | 72 | if state: |
| @@ -141,7 +141,7 @@ class Api(ApiTemplate): | @@ -141,7 +141,7 @@ class Api(ApiTemplate): | ||
| 141 | "in": "formData", | 141 | "in": "formData", |
| 142 | "type": "string", | 142 | "type": "string", |
| 143 | "description": "服务类型", | 143 | "description": "服务类型", |
| 144 | - "enum":["影像服务","切片服务","地图服务"]}, | 144 | + "enum":[st.value for st in ServiceType]}, |
| 145 | {"name": "catalog_guid", | 145 | {"name": "catalog_guid", |
| 146 | "in": "formData", | 146 | "in": "formData", |
| 147 | "type": "string", | 147 | "type": "string", |
| @@ -9,7 +9,7 @@ from app.util.component.ModelVisitor import ModelVisitor | @@ -9,7 +9,7 @@ from app.util.component.ModelVisitor import ModelVisitor | ||
| 9 | from .models import Service,ServiceFunction,ServiceEngine | 9 | from .models import Service,ServiceFunction,ServiceEngine |
| 10 | from app.util.component.GeometryAdapter import GeometryAdapter | 10 | from app.util.component.GeometryAdapter import GeometryAdapter |
| 11 | import requests | 11 | import requests |
| 12 | -import json | 12 | +from .util.ServiceType import ServiceType |
| 13 | 13 | ||
| 14 | class Api(ApiTemplate): | 14 | class Api(ApiTemplate): |
| 15 | 15 | ||
| @@ -38,7 +38,7 @@ class Api(ApiTemplate): | @@ -38,7 +38,7 @@ class Api(ApiTemplate): | ||
| 38 | if bbox: | 38 | if bbox: |
| 39 | g1 = GeometryAdapter.bbox_2_polygon([float(x) for x in bbox.split(",")]) | 39 | g1 = GeometryAdapter.bbox_2_polygon([float(x) for x in bbox.split(",")]) |
| 40 | for ser in services: | 40 | for ser in services: |
| 41 | - if ser.type.__eq__("切片服务"): | 41 | + if ser.type == ServiceType.tile_service.value: |
| 42 | layer_exetent = ser.relate_tile_service.one_or_none().layer_extent | 42 | layer_exetent = ser.relate_tile_service.one_or_none().layer_extent |
| 43 | 43 | ||
| 44 | g2 = GeometryAdapter.envelop_2_polygon([float(x) for x in layer_exetent.split(",")]) | 44 | g2 = GeometryAdapter.envelop_2_polygon([float(x) for x in layer_exetent.split(",")]) |
| @@ -54,7 +54,7 @@ class Api(ApiTemplate): | @@ -54,7 +54,7 @@ class Api(ApiTemplate): | ||
| 54 | service_json["functions"] = sorted(ModelVisitor.objects_to_jsonarray(ServiceFunction.query.filter_by(service_guid=service_json["guid"]).all()), | 54 | service_json["functions"] = sorted(ModelVisitor.objects_to_jsonarray(ServiceFunction.query.filter_by(service_guid=service_json["guid"]).all()), |
| 55 | key=lambda x:x["type"]) | 55 | key=lambda x:x["type"]) |
| 56 | 56 | ||
| 57 | - # 影像服务 | 57 | + # 影像地图 |
| 58 | image_engines = ServiceEngine.query.filter_by(type="ImageServer").all() | 58 | image_engines = ServiceEngine.query.filter_by(type="ImageServer").all() |
| 59 | 59 | ||
| 60 | for ie in image_engines: | 60 | for ie in image_engines: |
| @@ -62,7 +62,7 @@ class Api(ApiTemplate): | @@ -62,7 +62,7 @@ class Api(ApiTemplate): | ||
| 62 | response:requests.Response = requests.post(url,{"page_size":"9999","page_index":"0", | 62 | response:requests.Response = requests.post(url,{"page_size":"9999","page_index":"0", |
| 63 | "bbox":bbox,"state":state}) | 63 | "bbox":bbox,"state":state}) |
| 64 | if not response.json().get("result"): | 64 | if not response.json().get("result"): |
| 65 | - raise Exception("修改影像服务失败!") | 65 | + raise Exception("获取影像地图失败!") |
| 66 | else: | 66 | else: |
| 67 | raw_json = response.json()["data"]["list"] | 67 | raw_json = response.json()["data"]["list"] |
| 68 | fit_services_json.extend(raw_json) | 68 | fit_services_json.extend(raw_json) |
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | 5 | ||
| 6 | from app.util.component.ApiTemplate import ApiTemplate | 6 | from app.util.component.ApiTemplate import ApiTemplate |
| 7 | from .models import Service | 7 | from .models import Service |
| 8 | -import requests | 8 | +from .util.ServiceType import ServiceType |
| 9 | class Api(ApiTemplate): | 9 | class Api(ApiTemplate): |
| 10 | api_name = "注册服务" | 10 | api_name = "注册服务" |
| 11 | def process(self): | 11 | def process(self): |
| @@ -16,13 +16,13 @@ class Api(ApiTemplate): | @@ -16,13 +16,13 @@ class Api(ApiTemplate): | ||
| 16 | if service: | 16 | if service: |
| 17 | raise Exception("服务已存在!") | 17 | raise Exception("服务已存在!") |
| 18 | 18 | ||
| 19 | - if self.para.get("type").__eq__("地图服务"): | 19 | + if self.para.get("type") == ServiceType.map_service.value: |
| 20 | from app.modules.service.map_service.map_service_register import Api as RealApi | 20 | from app.modules.service.map_service.map_service_register import Api as RealApi |
| 21 | 21 | ||
| 22 | - elif self.para.get("type").__eq__("切片服务"): | 22 | + elif self.para.get("type") == ServiceType.tile_service.value: |
| 23 | from app.modules.service.tile_service.tile_service_register import Api as RealApi | 23 | from app.modules.service.tile_service.tile_service_register import Api as RealApi |
| 24 | 24 | ||
| 25 | - elif self.para.get("type").__eq__("影像服务"): | 25 | + elif self.para.get("type") == ServiceType.image_service.value: |
| 26 | from app.modules.service.image_service.image_service_register import Api as RealApi | 26 | from app.modules.service.image_service.image_service_register import Api as RealApi |
| 27 | 27 | ||
| 28 | else: | 28 | else: |
| @@ -45,12 +45,12 @@ class Api(ApiTemplate): | @@ -45,12 +45,12 @@ class Api(ApiTemplate): | ||
| 45 | "in": "formData", | 45 | "in": "formData", |
| 46 | "type": "string", | 46 | "type": "string", |
| 47 | "required": "true", | 47 | "required": "true", |
| 48 | - "description": "[地图服务,切片服务,影像服务]"}, | 48 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 49 | 49 | ||
| 50 | {"name": "title", | 50 | {"name": "title", |
| 51 | "in": "formData", | 51 | "in": "formData", |
| 52 | "type": "string", | 52 | "type": "string", |
| 53 | - "description": "[地图服务,切片服务,影像服务]"}, | 53 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 54 | 54 | ||
| 55 | {"name": "creator", | 55 | {"name": "creator", |
| 56 | "in": "formData", | 56 | "in": "formData", |
| @@ -63,97 +63,97 @@ class Api(ApiTemplate): | @@ -63,97 +63,97 @@ class Api(ApiTemplate): | ||
| 63 | {"name": "description", | 63 | {"name": "description", |
| 64 | "in": "formData", | 64 | "in": "formData", |
| 65 | "type": "string", | 65 | "type": "string", |
| 66 | - "description": "[地图服务,切片服务,影像服务]"}, | 66 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 67 | {"name": "type", | 67 | {"name": "type", |
| 68 | "in": "formData", | 68 | "in": "formData", |
| 69 | "type": "string", | 69 | "type": "string", |
| 70 | - "enum":["地图服务","切片服务","影像服务"], | 70 | + "enum":[st.value for st in ServiceType], |
| 71 | "required": "true", | 71 | "required": "true", |
| 72 | - "description": "[地图服务,切片服务,影像服务]"}, | 72 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 73 | {"name": "catalog_guid", | 73 | {"name": "catalog_guid", |
| 74 | "in": "formData", | 74 | "in": "formData", |
| 75 | "type": "string", | 75 | "type": "string", |
| 76 | - "description": "[地图服务,切片服务,影像服务]"}, | 76 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 77 | 77 | ||
| 78 | #影像参数 | 78 | #影像参数 |
| 79 | {"name": "image_guids", | 79 | {"name": "image_guids", |
| 80 | "in": "formData", | 80 | "in": "formData", |
| 81 | "type": "string", | 81 | "type": "string", |
| 82 | - "description": "[影像服务]影像guids,以英文逗号相隔"}, | 82 | + "description": "[影像地图]影像guids,以英文逗号相隔"}, |
| 83 | 83 | ||
| 84 | {"name": "scheme", | 84 | {"name": "scheme", |
| 85 | "in": "formData", | 85 | "in": "formData", |
| 86 | "type": "string", | 86 | "type": "string", |
| 87 | - "description": "[影像服务,切片服务]切片方案json"}, | 87 | + "description": "[影像地图,电子地图]切片方案json"}, |
| 88 | 88 | ||
| 89 | 89 | ||
| 90 | {"name": "functions", | 90 | {"name": "functions", |
| 91 | "in": "formData", | 91 | "in": "formData", |
| 92 | "type": "string", | 92 | "type": "string", |
| 93 | - "description": "[影像服务]functions", | 93 | + "description": "[影像地图]functions", |
| 94 | "enum": ["WMS","WMTS"]}, | 94 | "enum": ["WMS","WMTS"]}, |
| 95 | 95 | ||
| 96 | # 切片参数 | 96 | # 切片参数 |
| 97 | {"name": "overview", | 97 | {"name": "overview", |
| 98 | "in": "formData", | 98 | "in": "formData", |
| 99 | "type": "string", | 99 | "type": "string", |
| 100 | - "description": "[切片服务]缩略图"}, | 100 | + "description": "[电子地图]缩略图"}, |
| 101 | {"name": "tile_type", | 101 | {"name": "tile_type", |
| 102 | "in": "formData", | 102 | "in": "formData", |
| 103 | "type": "string", | 103 | "type": "string", |
| 104 | - "description": "[切片服务]tile_type", | 104 | + "description": "[电子地图]tile_type", |
| 105 | "enum":["WMTS","TMS"]}, | 105 | "enum":["WMTS","TMS"]}, |
| 106 | 106 | ||
| 107 | {"name": "vendor", | 107 | {"name": "vendor", |
| 108 | "in": "formData", | 108 | "in": "formData", |
| 109 | "type": "string", | 109 | "type": "string", |
| 110 | - "description": "[切片服务]厂商"}, | 110 | + "description": "[电子地图]厂商"}, |
| 111 | {"name": "crs", | 111 | {"name": "crs", |
| 112 | "in": "formData", | 112 | "in": "formData", |
| 113 | "type": "string", | 113 | "type": "string", |
| 114 | - "description": "[切片服务]坐标系"}, | 114 | + "description": "[电子地图]坐标系"}, |
| 115 | {"name": "datasource", | 115 | {"name": "datasource", |
| 116 | "in": "formData", | 116 | "in": "formData", |
| 117 | "type": "string", | 117 | "type": "string", |
| 118 | - "description": "[切片服务]数据路径"}, | 118 | + "description": "[电子地图]数据路径"}, |
| 119 | {"name": "layer_name", | 119 | {"name": "layer_name", |
| 120 | "in": "formData", | 120 | "in": "formData", |
| 121 | "type": "string", | 121 | "type": "string", |
| 122 | - "description": "[切片服务]图层名"}, | 122 | + "description": "[电子地图]图层名"}, |
| 123 | {"name": "layer_alias", | 123 | {"name": "layer_alias", |
| 124 | "in": "formData", | 124 | "in": "formData", |
| 125 | "type": "string", | 125 | "type": "string", |
| 126 | - "description": "[切片服务]图层别名"}, | 126 | + "description": "[电子地图]图层别名"}, |
| 127 | {"name": "layer_title", | 127 | {"name": "layer_title", |
| 128 | "in": "formData", | 128 | "in": "formData", |
| 129 | "type": "string", | 129 | "type": "string", |
| 130 | - "description": "[切片服务]图层标题"}, | 130 | + "description": "[电子地图]图层标题"}, |
| 131 | {"name": "layer_style", | 131 | {"name": "layer_style", |
| 132 | "in": "formData", | 132 | "in": "formData", |
| 133 | "type": "string", | 133 | "type": "string", |
| 134 | - "description": "[切片服务,地图服务]图层样式"}, | 134 | + "description": "[电子地图,矢量地图]图层样式"}, |
| 135 | {"name": "layer_format", | 135 | {"name": "layer_format", |
| 136 | "in": "formData", | 136 | "in": "formData", |
| 137 | "type": "string", | 137 | "type": "string", |
| 138 | - "description": "[切片服务]图层format"}, | 138 | + "description": "[电子地图]图层format"}, |
| 139 | {"name": "layer_extent", | 139 | {"name": "layer_extent", |
| 140 | "in": "formData", | 140 | "in": "formData", |
| 141 | "type": "string", | 141 | "type": "string", |
| 142 | - "description": "[切片服务]图层范围"}, | 142 | + "description": "[电子地图]图层范围"}, |
| 143 | {"name": "layer_description", | 143 | {"name": "layer_description", |
| 144 | "in": "formData", | 144 | "in": "formData", |
| 145 | "type": "string", | 145 | "type": "string", |
| 146 | - "description": "[切片服务]图层描述"}, | 146 | + "description": "[电子地图]图层描述"}, |
| 147 | 147 | ||
| 148 | - #地图服务参数 | 148 | + #矢量地图参数 |
| 149 | {"name": "capabilities", | 149 | {"name": "capabilities", |
| 150 | "in": "formData", | 150 | "in": "formData", |
| 151 | "type": "int", | 151 | "type": "int", |
| 152 | - "description": "[地图服务]"}, | 152 | + "description": "[矢量地图]"}, |
| 153 | {"name": "project", | 153 | {"name": "project", |
| 154 | "in": "formData", | 154 | "in": "formData", |
| 155 | "type": "string", | 155 | "type": "string", |
| 156 | - "description": "[地图服务]project"}, | 156 | + "description": "[矢量地图]project"}, |
| 157 | 157 | ||
| 158 | ], | 158 | ], |
| 159 | "responses": { | 159 | "responses": { |
| @@ -9,7 +9,7 @@ from .models import TileService,db,Service,MapService | @@ -9,7 +9,7 @@ from .models import TileService,db,Service,MapService | ||
| 9 | from app.util.component.ModelVisitor import ModelVisitor | 9 | from app.util.component.ModelVisitor import ModelVisitor |
| 10 | from .tile_service.util.ProjectFile import ProjectFile | 10 | from .tile_service.util.ProjectFile import ProjectFile |
| 11 | 11 | ||
| 12 | - | 12 | +from .util.ServiceType import ServiceType |
| 13 | class Api(ApiTemplate): | 13 | class Api(ApiTemplate): |
| 14 | 14 | ||
| 15 | api_name = "服务reload" | 15 | api_name = "服务reload" |
| @@ -22,8 +22,8 @@ class Api(ApiTemplate): | @@ -22,8 +22,8 @@ class Api(ApiTemplate): | ||
| 22 | 22 | ||
| 23 | res["data"]["list"] = [] | 23 | res["data"]["list"] = [] |
| 24 | 24 | ||
| 25 | - #切片服务 | ||
| 26 | - tile_services = TileService.query.join(Service).filter(Service.type == "切片服务").all() | 25 | + #电子地图 |
| 26 | + tile_services = TileService.query.join(Service).filter(Service.type == ServiceType.tile_service.value).all() | ||
| 27 | for ts in tile_services: | 27 | for ts in tile_services: |
| 28 | project_file = ProjectFile.create(ModelVisitor.object_to_json(ts)) | 28 | project_file = ProjectFile.create(ModelVisitor.object_to_json(ts)) |
| 29 | service:Service = Service.query.filter_by(guid=ts.service_guid).one_or_none() | 29 | service:Service = Service.query.filter_by(guid=ts.service_guid).one_or_none() |
| @@ -7,6 +7,8 @@ from app.util.component.UserCheck import UserCheck | @@ -7,6 +7,8 @@ from app.util.component.UserCheck import UserCheck | ||
| 7 | from app.util.component.ApiTemplate import ApiTemplate | 7 | from app.util.component.ApiTemplate import ApiTemplate |
| 8 | from .models import Service,db | 8 | from .models import Service,db |
| 9 | import requests | 9 | import requests |
| 10 | +from .util.ServiceType import ServiceType | ||
| 11 | + | ||
| 10 | 12 | ||
| 11 | class Api(ApiTemplate): | 13 | class Api(ApiTemplate): |
| 12 | api_name = "修改服务状态" | 14 | api_name = "修改服务状态" |
| @@ -17,7 +19,7 @@ class Api(ApiTemplate): | @@ -17,7 +19,7 @@ class Api(ApiTemplate): | ||
| 17 | state = int(self.para.get("state")) | 19 | state = int(self.para.get("state")) |
| 18 | s_type = self.para.get("type") | 20 | s_type = self.para.get("type") |
| 19 | 21 | ||
| 20 | - if s_type in ["切片服务","地图服务","地址匹配"]: | 22 | + if s_type in [ServiceType.tile_service.value,ServiceType.map_service.value]: |
| 21 | service = Service.query.filter_by(guid=guid).one_or_none() | 23 | service = Service.query.filter_by(guid=guid).one_or_none() |
| 22 | # 验证权限 | 24 | # 验证权限 |
| 23 | UserCheck.verify(service.creator) | 25 | UserCheck.verify(service.creator) |
| @@ -28,8 +30,8 @@ class Api(ApiTemplate): | @@ -28,8 +30,8 @@ class Api(ApiTemplate): | ||
| 28 | res["result"] = True | 30 | res["result"] = True |
| 29 | else: | 31 | else: |
| 30 | raise Exception("服务不存在!") | 32 | raise Exception("服务不存在!") |
| 31 | - # 删除影像服务 | ||
| 32 | - else: | 33 | + |
| 34 | + elif s_type == ServiceType.image_service.value: | ||
| 33 | user_req: requests.Response = requests.post("{}/API/Service/Info".format(self.para.get("url")), | 35 | user_req: requests.Response = requests.post("{}/API/Service/Info".format(self.para.get("url")), |
| 34 | data={"guid": self.para.get("guid")}) | 36 | data={"guid": self.para.get("guid")}) |
| 35 | if not user_req.json().get("result"): | 37 | if not user_req.json().get("result"): |
| @@ -40,7 +42,7 @@ class Api(ApiTemplate): | @@ -40,7 +42,7 @@ class Api(ApiTemplate): | ||
| 40 | url = "{}/API/Service/State".format(self.para.get("url")) | 42 | url = "{}/API/Service/State".format(self.para.get("url")) |
| 41 | response: requests.Response = requests.post(url, data=self.para) | 43 | response: requests.Response = requests.post(url, data=self.para) |
| 42 | if not response.json().get("result"): | 44 | if not response.json().get("result"): |
| 43 | - raise Exception("由于{},影像服务修改失败!".format(response.json().get("msg"))) | 45 | + raise Exception("由于{},影像地图修改失败!".format(response.json().get("msg"))) |
| 44 | res["result"] = True | 46 | res["result"] = True |
| 45 | 47 | ||
| 46 | except Exception as e: | 48 | except Exception as e: |
| @@ -58,6 +60,7 @@ class Api(ApiTemplate): | @@ -58,6 +60,7 @@ class Api(ApiTemplate): | ||
| 58 | {"name": "type", | 60 | {"name": "type", |
| 59 | "in": "formData", | 61 | "in": "formData", |
| 60 | "type": "string", | 62 | "type": "string", |
| 63 | + "enum":[st.value for st in ServiceType], | ||
| 61 | "description": "type"}, | 64 | "description": "type"}, |
| 62 | {"name": "url", | 65 | {"name": "url", |
| 63 | "in": "formData", | 66 | "in": "formData", |
| @@ -9,22 +9,13 @@ from flask import Blueprint | @@ -9,22 +9,13 @@ from flask import Blueprint | ||
| 9 | from app.util import BlueprintApi | 9 | from app.util import BlueprintApi |
| 10 | from . import upload_oview,tile_service_register,tile_service_edit,tile_service_reload | 10 | from . import upload_oview,tile_service_register,tile_service_edit,tile_service_reload |
| 11 | from app.decorators.token_decorator import token_decorator | 11 | from app.decorators.token_decorator import token_decorator |
| 12 | - | 12 | +from ..util.ServiceType import ServiceType |
| 13 | 13 | ||
| 14 | class DataManager(BlueprintApi): | 14 | class DataManager(BlueprintApi): |
| 15 | 15 | ||
| 16 | bp = Blueprint("TileService", __name__, url_prefix="/API/Service/TileService") | 16 | bp = Blueprint("TileService", __name__, url_prefix="/API/Service/TileService") |
| 17 | 17 | ||
| 18 | - service_type = ["切片服务"] | ||
| 19 | - | ||
| 20 | - # @staticmethod | ||
| 21 | - # @bp.route('/UploadOverview', methods=['POST']) | ||
| 22 | - # @swag_from(upload_oview.Api.api_doc) | ||
| 23 | - # def api_upload_oview(): | ||
| 24 | - # """ | ||
| 25 | - # 上传缩略图 | ||
| 26 | - # """ | ||
| 27 | - # return upload_oview.Api().result | 18 | + service_type = [ServiceType.tile_service.value] |
| 28 | 19 | ||
| 29 | 20 | ||
| 30 | @staticmethod | 21 | @staticmethod |
| @@ -18,7 +18,7 @@ from app.util.component.UserCheck import UserCheck | @@ -18,7 +18,7 @@ from app.util.component.UserCheck import UserCheck | ||
| 18 | 18 | ||
| 19 | class Api(ApiTemplate): | 19 | class Api(ApiTemplate): |
| 20 | 20 | ||
| 21 | - api_name = "修改切片服务" | 21 | + api_name = "修改电子地图" |
| 22 | 22 | ||
| 23 | def process(self): | 23 | def process(self): |
| 24 | res = {} | 24 | res = {} |
| @@ -66,7 +66,7 @@ class Api(ApiTemplate): | @@ -66,7 +66,7 @@ class Api(ApiTemplate): | ||
| 66 | resp.encoding="utf-8" | 66 | resp.encoding="utf-8" |
| 67 | resp_json = resp.json() | 67 | resp_json = resp.json() |
| 68 | if not resp_json["status"].__eq__("1"): | 68 | if not resp_json["status"].__eq__("1"): |
| 69 | - raise Exception("调用切片服务的注册服务接口失败!") | 69 | + raise Exception("调用电子地图的注册服务接口失败!") |
| 70 | 70 | ||
| 71 | service_update["overview"] = resp_json["url"] | 71 | service_update["overview"] = resp_json["url"] |
| 72 | #修改数据库 | 72 | #修改数据库 |
| @@ -96,7 +96,7 @@ class Api(ApiTemplate): | @@ -96,7 +96,7 @@ class Api(ApiTemplate): | ||
| 96 | return res | 96 | return res |
| 97 | 97 | ||
| 98 | api_doc = { | 98 | api_doc = { |
| 99 | - "tags": ["切片服务接口"], | 99 | + "tags": ["电子地图接口"], |
| 100 | "parameters": [ | 100 | "parameters": [ |
| 101 | {"name": "guid", | 101 | {"name": "guid", |
| 102 | "in": "formData", | 102 | "in": "formData", |
| @@ -106,76 +106,76 @@ class Api(ApiTemplate): | @@ -106,76 +106,76 @@ class Api(ApiTemplate): | ||
| 106 | {"name": "name", | 106 | {"name": "name", |
| 107 | "in": "formData", | 107 | "in": "formData", |
| 108 | "type": "string", | 108 | "type": "string", |
| 109 | - "description": "[地图服务,切片服务,影像服务]"}, | 109 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 110 | {"name": "title", | 110 | {"name": "title", |
| 111 | "in": "formData", | 111 | "in": "formData", |
| 112 | "type": "string", | 112 | "type": "string", |
| 113 | - "description": "[地图服务,切片服务,影像服务]"}, | 113 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 114 | {"name": "description", | 114 | {"name": "description", |
| 115 | "in": "formData", | 115 | "in": "formData", |
| 116 | "type": "string", | 116 | "type": "string", |
| 117 | - "description": "[地图服务,切片服务,影像服务]"}, | 117 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 118 | 118 | ||
| 119 | {"name": "catalog_guid", | 119 | {"name": "catalog_guid", |
| 120 | "in": "formData", | 120 | "in": "formData", |
| 121 | "type": "string", | 121 | "type": "string", |
| 122 | - "description": "[地图服务,切片服务,影像服务]"}, | 122 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 123 | 123 | ||
| 124 | {"name": "scheme_guid", | 124 | {"name": "scheme_guid", |
| 125 | "in": "formData", | 125 | "in": "formData", |
| 126 | "type": "string", | 126 | "type": "string", |
| 127 | - "description": "[切片服务,影像服务]切片方案"}, | 127 | + "description": "[电子地图,影像地图]切片方案"}, |
| 128 | 128 | ||
| 129 | - # 切片服务参数 | 129 | + # 电子地图参数 |
| 130 | {"name": "overview", | 130 | {"name": "overview", |
| 131 | "in": "formData", | 131 | "in": "formData", |
| 132 | "type": "string", | 132 | "type": "string", |
| 133 | - "description": "[切片服务]缩略图"}, | 133 | + "description": "[电子地图]缩略图"}, |
| 134 | {"name": "tile_type", | 134 | {"name": "tile_type", |
| 135 | "in": "formData", | 135 | "in": "formData", |
| 136 | "type": "string", | 136 | "type": "string", |
| 137 | - "description": "[切片服务]tile_type", | 137 | + "description": "[电子地图]tile_type", |
| 138 | "enum":["WMTS","TMS"]}, | 138 | "enum":["WMTS","TMS"]}, |
| 139 | {"name": "vendor", | 139 | {"name": "vendor", |
| 140 | "in": "formData", | 140 | "in": "formData", |
| 141 | "type": "string", | 141 | "type": "string", |
| 142 | - "description": "[切片服务]厂商"}, | 142 | + "description": "[电子地图]厂商"}, |
| 143 | {"name": "crs", | 143 | {"name": "crs", |
| 144 | "in": "formData", | 144 | "in": "formData", |
| 145 | "type": "string", | 145 | "type": "string", |
| 146 | - "description": "[切片服务]坐标系"}, | 146 | + "description": "[电子地图]坐标系"}, |
| 147 | {"name": "datasource", | 147 | {"name": "datasource", |
| 148 | "in": "formData", | 148 | "in": "formData", |
| 149 | "type": "string", | 149 | "type": "string", |
| 150 | - "description": "[切片服务]数据路径"}, | 150 | + "description": "[电子地图]数据路径"}, |
| 151 | {"name": "layer_name", | 151 | {"name": "layer_name", |
| 152 | "in": "formData", | 152 | "in": "formData", |
| 153 | "type": "string", | 153 | "type": "string", |
| 154 | - "description": "[切片服务]图层名"}, | 154 | + "description": "[电子地图]图层名"}, |
| 155 | {"name": "layer_alias", | 155 | {"name": "layer_alias", |
| 156 | "in": "formData", | 156 | "in": "formData", |
| 157 | "type": "string", | 157 | "type": "string", |
| 158 | - "description": "[切片服务]图层别名"}, | 158 | + "description": "[电子地图]图层别名"}, |
| 159 | {"name": "layer_title", | 159 | {"name": "layer_title", |
| 160 | "in": "formData", | 160 | "in": "formData", |
| 161 | "type": "string", | 161 | "type": "string", |
| 162 | - "description": "[切片服务]图层标题"}, | 162 | + "description": "[电子地图]图层标题"}, |
| 163 | {"name": "layer_style", | 163 | {"name": "layer_style", |
| 164 | "in": "formData", | 164 | "in": "formData", |
| 165 | "type": "string", | 165 | "type": "string", |
| 166 | - "description": "[切片服务,地图服务]图层样式"}, | 166 | + "description": "[电子地图,矢量地图]图层样式"}, |
| 167 | {"name": "layer_format", | 167 | {"name": "layer_format", |
| 168 | "in": "formData", | 168 | "in": "formData", |
| 169 | "type": "string", | 169 | "type": "string", |
| 170 | - "description": "[切片服务]图层format"}, | 170 | + "description": "[电子地图]图层format"}, |
| 171 | {"name": "layer_extent", | 171 | {"name": "layer_extent", |
| 172 | "in": "formData", | 172 | "in": "formData", |
| 173 | "type": "string", | 173 | "type": "string", |
| 174 | - "description": "[切片服务]图层范围"}, | 174 | + "description": "[电子地图]图层范围"}, |
| 175 | {"name": "layer_description", | 175 | {"name": "layer_description", |
| 176 | "in": "formData", | 176 | "in": "formData", |
| 177 | "type": "string", | 177 | "type": "string", |
| 178 | - "description": "[切片服务]图层描述"}, | 178 | + "description": "[电子地图]图层描述"}, |
| 179 | 179 | ||
| 180 | 180 | ||
| 181 | ], | 181 | ], |
| @@ -18,7 +18,7 @@ from .util.ProjectFile import ProjectFile | @@ -18,7 +18,7 @@ from .util.ProjectFile import ProjectFile | ||
| 18 | 18 | ||
| 19 | class Api(ApiTemplate): | 19 | class Api(ApiTemplate): |
| 20 | 20 | ||
| 21 | - api_name = "注册切片服务" | 21 | + api_name = "注册电子地图" |
| 22 | 22 | ||
| 23 | def process(self): | 23 | def process(self): |
| 24 | # 返回结果 | 24 | # 返回结果 |
| @@ -28,7 +28,7 @@ class Api(ApiTemplate): | @@ -28,7 +28,7 @@ class Api(ApiTemplate): | ||
| 28 | service_guid = uuid.uuid1().__str__() | 28 | service_guid = uuid.uuid1().__str__() |
| 29 | tile_service_guid = uuid.uuid1().__str__() | 29 | tile_service_guid = uuid.uuid1().__str__() |
| 30 | service_function_guid = uuid.uuid1().__str__() | 30 | service_function_guid = uuid.uuid1().__str__() |
| 31 | - # 调用切片服务的注册服务接口 | 31 | + # 调用电子地图的注册服务接口 |
| 32 | 32 | ||
| 33 | project_file = ProjectFile.create(self.para) | 33 | project_file = ProjectFile.create(self.para) |
| 34 | para = {"name":self.para.get("name"), | 34 | para = {"name":self.para.get("name"), |
| @@ -48,7 +48,7 @@ class Api(ApiTemplate): | @@ -48,7 +48,7 @@ class Api(ApiTemplate): | ||
| 48 | StructurePrint().print(resp_json) | 48 | StructurePrint().print(resp_json) |
| 49 | 49 | ||
| 50 | if not resp_json["status"]=="1": | 50 | if not resp_json["status"]=="1": |
| 51 | - raise Exception("调用切片服务的注册服务接口失败!") | 51 | + raise Exception("调用电子地图的注册服务接口失败!") |
| 52 | 52 | ||
| 53 | service = Service( | 53 | service = Service( |
| 54 | guid = service_guid, | 54 | guid = service_guid, |
| @@ -114,82 +114,82 @@ class Api(ApiTemplate): | @@ -114,82 +114,82 @@ class Api(ApiTemplate): | ||
| 114 | 114 | ||
| 115 | 115 | ||
| 116 | api_doc = { | 116 | api_doc = { |
| 117 | - "tags": ["切片服务接口"], | 117 | + "tags": ["电子地图接口"], |
| 118 | "parameters": [ | 118 | "parameters": [ |
| 119 | {"name": "name", | 119 | {"name": "name", |
| 120 | "in": "formData", | 120 | "in": "formData", |
| 121 | "type": "string", | 121 | "type": "string", |
| 122 | - "description": "[地图服务,切片服务,影像服务]"}, | 122 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 123 | {"name": "title", | 123 | {"name": "title", |
| 124 | "in": "formData", | 124 | "in": "formData", |
| 125 | "type": "string", | 125 | "type": "string", |
| 126 | - "description": "[地图服务,切片服务,影像服务]"}, | 126 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 127 | {"name": "description", | 127 | {"name": "description", |
| 128 | "in": "formData", | 128 | "in": "formData", |
| 129 | "type": "string", | 129 | "type": "string", |
| 130 | - "description": "[地图服务,切片服务,影像服务]"}, | 130 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 131 | {"name": "type", | 131 | {"name": "type", |
| 132 | "in": "formData", | 132 | "in": "formData", |
| 133 | "type": "string", | 133 | "type": "string", |
| 134 | - "description": "[地图服务,切片服务,影像服务", | ||
| 135 | - "enum":["地图服务","切片服务","影像服务"]}, | 134 | + "description": "[矢量地图,电子地图,影像地图", |
| 135 | + "enum":["矢量地图","电子地图","影像地图"]}, | ||
| 136 | {"name": "catalog_guid", | 136 | {"name": "catalog_guid", |
| 137 | "in": "formData", | 137 | "in": "formData", |
| 138 | "type": "string", | 138 | "type": "string", |
| 139 | - "description": "[地图服务,切片服务,影像服务]"}, | 139 | + "description": "[矢量地图,电子地图,影像地图]"}, |
| 140 | {"name": "scheme_guid", | 140 | {"name": "scheme_guid", |
| 141 | "in": "formData", | 141 | "in": "formData", |
| 142 | "type": "string", | 142 | "type": "string", |
| 143 | - "description": "[切片服务,影像服务]切片方案"}, | 143 | + "description": "[电子地图,影像地图]切片方案"}, |
| 144 | {"name": "overview", | 144 | {"name": "overview", |
| 145 | "in": "formData", | 145 | "in": "formData", |
| 146 | "type": "string", | 146 | "type": "string", |
| 147 | - "description": "[切片服务]缩略图"}, | 147 | + "description": "[电子地图]缩略图"}, |
| 148 | {"name": "tile_type", | 148 | {"name": "tile_type", |
| 149 | "in": "formData", | 149 | "in": "formData", |
| 150 | "type": "string", | 150 | "type": "string", |
| 151 | - "description": "[切片服务]tile_type", | 151 | + "description": "[电子地图]tile_type", |
| 152 | "enum":["WMTS","TMS"]}, | 152 | "enum":["WMTS","TMS"]}, |
| 153 | {"name": "vendor", | 153 | {"name": "vendor", |
| 154 | "in": "formData", | 154 | "in": "formData", |
| 155 | "type": "string", | 155 | "type": "string", |
| 156 | - "description": "[切片服务]厂商"}, | 156 | + "description": "[电子地图]厂商"}, |
| 157 | {"name": "crs", | 157 | {"name": "crs", |
| 158 | "in": "formData", | 158 | "in": "formData", |
| 159 | "type": "string", | 159 | "type": "string", |
| 160 | - "description": "[切片服务]坐标系"}, | 160 | + "description": "[电子地图]坐标系"}, |
| 161 | {"name": "datasource", | 161 | {"name": "datasource", |
| 162 | "in": "formData", | 162 | "in": "formData", |
| 163 | "type": "string", | 163 | "type": "string", |
| 164 | - "description": "[切片服务]数据路径"}, | 164 | + "description": "[电子地图]数据路径"}, |
| 165 | {"name": "layer_name", | 165 | {"name": "layer_name", |
| 166 | "in": "formData", | 166 | "in": "formData", |
| 167 | "type": "string", | 167 | "type": "string", |
| 168 | - "description": "[切片服务]图层名"}, | 168 | + "description": "[电子地图]图层名"}, |
| 169 | {"name": "layer_alias", | 169 | {"name": "layer_alias", |
| 170 | "in": "formData", | 170 | "in": "formData", |
| 171 | "type": "string", | 171 | "type": "string", |
| 172 | - "description": "[切片服务]图层别名"}, | 172 | + "description": "[电子地图]图层别名"}, |
| 173 | {"name": "layer_title", | 173 | {"name": "layer_title", |
| 174 | "in": "formData", | 174 | "in": "formData", |
| 175 | "type": "string", | 175 | "type": "string", |
| 176 | - "description": "[切片服务]图层标题"}, | 176 | + "description": "[电子地图]图层标题"}, |
| 177 | {"name": "layer_style", | 177 | {"name": "layer_style", |
| 178 | "in": "formData", | 178 | "in": "formData", |
| 179 | "type": "string", | 179 | "type": "string", |
| 180 | - "description": "[切片服务]图层样式"}, | 180 | + "description": "[电子地图]图层样式"}, |
| 181 | {"name": "layer_format", | 181 | {"name": "layer_format", |
| 182 | "in": "formData", | 182 | "in": "formData", |
| 183 | "type": "string", | 183 | "type": "string", |
| 184 | - "description": "[切片服务]图层format"}, | 184 | + "description": "[电子地图]图层format"}, |
| 185 | {"name": "layer_extent", | 185 | {"name": "layer_extent", |
| 186 | "in": "formData", | 186 | "in": "formData", |
| 187 | "type": "string", | 187 | "type": "string", |
| 188 | - "description": "[切片服务]图层范围"}, | 188 | + "description": "[电子地图]图层范围"}, |
| 189 | {"name": "layer_description", | 189 | {"name": "layer_description", |
| 190 | "in": "formData", | 190 | "in": "formData", |
| 191 | "type": "string", | 191 | "type": "string", |
| 192 | - "description": "[切片服务]图层描述"}, | 192 | + "description": "[电子地图]图层描述"}, |
| 193 | ], | 193 | ], |
| 194 | "responses": { | 194 | "responses": { |
| 195 | 200: { | 195 | 200: { |
app/modules/service/util/ServiceType.py
0 → 100644
请
注册
或
登录
后发表评论