正在显示
33 个修改的文件
包含
121 行增加
和
49 行删除
| @@ -12,7 +12,7 @@ from app.models import db | @@ -12,7 +12,7 @@ from app.models import db | ||
| 12 | from app.modules.auth.oauth2 import config_oauth, myCodeIDToken | 12 | from app.modules.auth.oauth2 import config_oauth, myCodeIDToken |
| 13 | from flasgger import Swagger | 13 | from flasgger import Swagger |
| 14 | import logging | 14 | import logging |
| 15 | -from app.util.component.StructuredPrint import StructurePrint | 15 | +from app.util.component.StructurePrint import StructurePrint |
| 16 | from app.util.component.PGUtil import PGUtil | 16 | from app.util.component.PGUtil import PGUtil |
| 17 | import os | 17 | import os |
| 18 | from app.modules.monitor.schedule import start_schedule | 18 | from app.modules.monitor.schedule import start_schedule |
| @@ -15,7 +15,7 @@ from app.util.component.ApiTemplate import ApiTemplate | @@ -15,7 +15,7 @@ from app.util.component.ApiTemplate import ApiTemplate | ||
| 15 | from app.util.component.PGUtil import PGUtil | 15 | from app.util.component.PGUtil import PGUtil |
| 16 | from app.util.component.SQLUtil import SQLUtil | 16 | from app.util.component.SQLUtil import SQLUtil |
| 17 | from app.util.component.GeometryAdapter import GeometryAdapter | 17 | from app.util.component.GeometryAdapter import GeometryAdapter |
| 18 | -from app.util.component.StructuredPrint import StructurePrint | 18 | +from app.util.component.StructurePrint import StructurePrint |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | class Api(ApiTemplate): | 21 | class Api(ApiTemplate): |
| @@ -16,7 +16,7 @@ import configure | @@ -16,7 +16,7 @@ import configure | ||
| 16 | from app.util.component.ApiTemplate import ApiTemplate | 16 | from app.util.component.ApiTemplate import ApiTemplate |
| 17 | from app.util.component.PGUtil import PGUtil | 17 | from app.util.component.PGUtil import PGUtil |
| 18 | from app.util.component.ZipUtil import ZipUtil | 18 | from app.util.component.ZipUtil import ZipUtil |
| 19 | -from app.util.component.StructuredPrint import StructurePrint | 19 | +from app.util.component.StructurePrint import StructurePrint |
| 20 | import multiprocessing | 20 | import multiprocessing |
| 21 | import datetime | 21 | import datetime |
| 22 | from app.util.component.TaskController import TaskController | 22 | from app.util.component.TaskController import TaskController |
| @@ -13,7 +13,7 @@ import json | @@ -13,7 +13,7 @@ import json | ||
| 13 | import re | 13 | import re |
| 14 | from app.util.component.ApiTemplate import ApiTemplate | 14 | from app.util.component.ApiTemplate import ApiTemplate |
| 15 | from app.util.component.PGUtil import PGUtil | 15 | from app.util.component.PGUtil import PGUtil |
| 16 | -from app.util.component.StructuredPrint import StructurePrint | 16 | +from app.util.component.StructurePrint import StructurePrint |
| 17 | from sqlalchemy.orm import Session | 17 | from sqlalchemy.orm import Session |
| 18 | import configure | 18 | import configure |
| 19 | import datetime | 19 | import datetime |
| @@ -7,7 +7,7 @@ import uuid | @@ -7,7 +7,7 @@ import uuid | ||
| 7 | import shutil | 7 | import shutil |
| 8 | from app.modules.data.models import * | 8 | from app.modules.data.models import * |
| 9 | from app.util.component.PGUtil import PGUtil | 9 | from app.util.component.PGUtil import PGUtil |
| 10 | -from app.util.component.StructuredPrint import StructurePrint | 10 | +from app.util.component.StructurePrint import StructurePrint |
| 11 | from sqlalchemy.orm import Session | 11 | from sqlalchemy.orm import Session |
| 12 | import configure | 12 | import configure |
| 13 | import traceback | 13 | import traceback |
| @@ -20,6 +20,7 @@ from . import table_view | @@ -20,6 +20,7 @@ from . import table_view | ||
| 20 | from . import table_vacuate | 20 | from . import table_vacuate |
| 21 | from . import table_vacuate_one | 21 | from . import table_vacuate_one |
| 22 | from . import table_vacuate_info | 22 | from . import table_vacuate_info |
| 23 | +from . import table_vacuate_detail | ||
| 23 | from . import table_vacuate_ref | 24 | from . import table_vacuate_ref |
| 24 | from . import table_vacuate_delete | 25 | from . import table_vacuate_delete |
| 25 | from . import field_value | 26 | from . import field_value |
| @@ -163,6 +164,15 @@ class DataManager(BlueprintApi): | @@ -163,6 +164,15 @@ class DataManager(BlueprintApi): | ||
| 163 | return table_vacuate_info.Api().result | 164 | return table_vacuate_info.Api().result |
| 164 | 165 | ||
| 165 | @staticmethod | 166 | @staticmethod |
| 167 | + @bp.route('/TableVacuateDetail', methods=['GET']) | ||
| 168 | + @swag_from(table_vacuate_detail.Api.api_doc) | ||
| 169 | + def api_table_vacuate_detail(): | ||
| 170 | + """ | ||
| 171 | + 数据抽稀详情 | ||
| 172 | + """ | ||
| 173 | + return table_vacuate_detail.Api().result | ||
| 174 | + | ||
| 175 | + @staticmethod | ||
| 166 | @bp.route('/TableVacuateRef', methods=['POST']) | 176 | @bp.route('/TableVacuateRef', methods=['POST']) |
| 167 | @swag_from(table_vacuate_ref.Api.api_doc) | 177 | @swag_from(table_vacuate_ref.Api.api_doc) |
| 168 | def api_table_vacuate_ref(): | 178 | def api_table_vacuate_ref(): |
| @@ -21,6 +21,8 @@ class Api(ApiTemplate): | @@ -21,6 +21,8 @@ class Api(ApiTemplate): | ||
| 21 | raise Exception("数据不存在!") | 21 | raise Exception("数据不存在!") |
| 22 | pg_ds = PGUtil.open_pg_data_source(0,DES.decode(table.relate_database.sqlalchemy_uri)) | 22 | pg_ds = PGUtil.open_pg_data_source(0,DES.decode(table.relate_database.sqlalchemy_uri)) |
| 23 | layer:Layer = pg_ds.GetLayerByName(table.name) | 23 | layer:Layer = pg_ds.GetLayerByName(table.name) |
| 24 | + if not layer: | ||
| 25 | + raise Exception("数据异常!") | ||
| 24 | append_dict ={"srid":None,"sr_wkt":None,"sr_proj4":None,"exist":1,"schema":"public","geomfield":layer.GetGeometryColumn()} | 26 | append_dict ={"srid":None,"sr_wkt":None,"sr_proj4":None,"exist":1,"schema":"public","geomfield":layer.GetGeometryColumn()} |
| 25 | if layer: | 27 | if layer: |
| 26 | sr:SpatialReference = layer.GetSpatialRef() | 28 | sr:SpatialReference = layer.GetSpatialRef() |
| @@ -10,7 +10,7 @@ import uuid | @@ -10,7 +10,7 @@ import uuid | ||
| 10 | from sqlalchemy.orm import Session | 10 | from sqlalchemy.orm import Session |
| 11 | from app.util.component.SQLUtil import SQLUtil | 11 | from app.util.component.SQLUtil import SQLUtil |
| 12 | from app.util.component.PGUtil import PGUtil | 12 | from app.util.component.PGUtil import PGUtil |
| 13 | -from app.util.component.StructuredPrint import StructurePrint | 13 | +from app.util.component.StructurePrint import StructurePrint |
| 14 | from app.util.component.ApiTemplate import ApiTemplate | 14 | from app.util.component.ApiTemplate import ApiTemplate |
| 15 | from app.util.component.GeometryAdapter import GeometryAdapter | 15 | from app.util.component.GeometryAdapter import GeometryAdapter |
| 16 | from app.util.component.TaskController import TaskController | 16 | from app.util.component.TaskController import TaskController |
| @@ -12,7 +12,7 @@ import configure | @@ -12,7 +12,7 @@ import configure | ||
| 12 | from ..models import Table, Database, Task,db,TableVacuate,Process,DES | 12 | from ..models import Table, Database, Task,db,TableVacuate,Process,DES |
| 13 | 13 | ||
| 14 | from app.util.component.ApiTemplate import ApiTemplate | 14 | from app.util.component.ApiTemplate import ApiTemplate |
| 15 | -from app.util.component.StructuredPrint import StructurePrint | 15 | +from app.util.component.StructurePrint import StructurePrint |
| 16 | from app.util.component.PGUtil import PGUtil | 16 | from app.util.component.PGUtil import PGUtil |
| 17 | from app.util.component.VacuateConf import VacuateConf | 17 | from app.util.component.VacuateConf import VacuateConf |
| 18 | from app.util.component.GeometryAdapter import GeometryAdapter | 18 | from app.util.component.GeometryAdapter import GeometryAdapter |
| 1 | +# author: 4N | ||
| 2 | +# createtime: 2021/1/27 | ||
| 3 | +# email: nheweijun@sina.com | ||
| 4 | + | ||
| 5 | + | ||
| 6 | +from ..models import Table,TableVacuate,Task | ||
| 7 | +from app.util.component.ApiTemplate import ApiTemplate | ||
| 8 | +from app.util.component.VacuateConf import VacuateConf | ||
| 9 | + | ||
| 10 | + | ||
| 11 | +import copy | ||
| 12 | +class Api(ApiTemplate): | ||
| 13 | + api_name = "抽稀Detail" | ||
| 14 | + def process(self): | ||
| 15 | + | ||
| 16 | + res = {} | ||
| 17 | + try: | ||
| 18 | + res["data"] = [] | ||
| 19 | + table_guids = self.para.get("table_guids") | ||
| 20 | + | ||
| 21 | + for table_guid in table_guids.split(","): | ||
| 22 | + | ||
| 23 | + detail = {"table_guid":table_guid} | ||
| 24 | + table: Table = Table.query.filter_by(guid=table_guid).one_or_none() | ||
| 25 | + if table: | ||
| 26 | + tvs = TableVacuate.query.filter_by(table_guid=table_guid).all() | ||
| 27 | + detail["table_name"] = table.name | ||
| 28 | + detail["vacuate_count"] = len(tvs) | ||
| 29 | + detail["table_vacuate"] = [{"name":tv.name,"pixel_distance":tv.pixel_distance,"connectstr":tv.connectstr} for tv in tvs] | ||
| 30 | + | ||
| 31 | + res["data"].append(detail) | ||
| 32 | + res["result"] = True | ||
| 33 | + except Exception as e: | ||
| 34 | + raise e | ||
| 35 | + return res | ||
| 36 | + | ||
| 37 | + api_doc = { | ||
| 38 | + "tags": ["管理接口"], | ||
| 39 | + "parameters": [ | ||
| 40 | + {"name": "table_guids", | ||
| 41 | + "in": "formData", | ||
| 42 | + "type": "string", | ||
| 43 | + "description": "表guid", "required": "true"}, | ||
| 44 | + ], | ||
| 45 | + "responses": { | ||
| 46 | + 200: { | ||
| 47 | + "schema": { | ||
| 48 | + "properties": { | ||
| 49 | + } | ||
| 50 | + } | ||
| 51 | + } | ||
| 52 | + } | ||
| 53 | + } |
| @@ -8,7 +8,7 @@ import traceback | @@ -8,7 +8,7 @@ import traceback | ||
| 8 | from ..models import Table, Database, DES,Task,db,TableVacuate | 8 | from ..models import Table, Database, DES,Task,db,TableVacuate |
| 9 | from app.util.component.ApiTemplate import ApiTemplate | 9 | from app.util.component.ApiTemplate import ApiTemplate |
| 10 | from app.util.component.PGUtil import PGUtil | 10 | from app.util.component.PGUtil import PGUtil |
| 11 | -from app.util.component.StructuredPrint import StructurePrint | 11 | +from app.util.component.StructurePrint import StructurePrint |
| 12 | import multiprocessing | 12 | import multiprocessing |
| 13 | import uuid | 13 | import uuid |
| 14 | import configure | 14 | import configure |
| @@ -10,7 +10,7 @@ from app.util.component.ApiTemplate import ApiTemplate | @@ -10,7 +10,7 @@ from app.util.component.ApiTemplate import ApiTemplate | ||
| 10 | from app.util.component.PGUtil import PGUtil | 10 | from app.util.component.PGUtil import PGUtil |
| 11 | 11 | ||
| 12 | from app.util.component.GeometryAdapter import GeometryAdapter | 12 | from app.util.component.GeometryAdapter import GeometryAdapter |
| 13 | -from app.util.component.StructuredPrint import StructurePrint | 13 | +from app.util.component.StructurePrint import StructurePrint |
| 14 | 14 | ||
| 15 | from osgeo.ogr import DataSource | 15 | from osgeo.ogr import DataSource |
| 16 | 16 |
| @@ -19,7 +19,7 @@ import datetime | @@ -19,7 +19,7 @@ import datetime | ||
| 19 | 19 | ||
| 20 | from ..models import Table, Database, DES,Task,db,TableVacuate,Process | 20 | from ..models import Table, Database, DES,Task,db,TableVacuate,Process |
| 21 | 21 | ||
| 22 | -from app.util.component.StructuredPrint import StructurePrint | 22 | +from app.util.component.StructurePrint import StructurePrint |
| 23 | 23 | ||
| 24 | from osgeo.ogr import DataSource,Layer,Geometry | 24 | from osgeo.ogr import DataSource,Layer,Geometry |
| 25 | 25 |
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | 5 | ||
| 6 | from ..models import db,Task,Table,InsertingLayerName,Process | 6 | from ..models import db,Task,Table,InsertingLayerName,Process |
| 7 | from app.util.component.ApiTemplate import ApiTemplate | 7 | from app.util.component.ApiTemplate import ApiTemplate |
| 8 | -from app.util.component.StructuredPrint import StructurePrint | 8 | +from app.util.component.StructurePrint import StructurePrint |
| 9 | import os | 9 | import os |
| 10 | import signal | 10 | import signal |
| 11 | import platform | 11 | import platform |
| @@ -8,7 +8,7 @@ import socket | @@ -8,7 +8,7 @@ import socket | ||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | from app.util.component.ApiTemplate import ApiTemplate | 10 | from app.util.component.ApiTemplate import ApiTemplate |
| 11 | -from app.util.component.StructuredPrint import StructurePrint | 11 | +from app.util.component.StructurePrint import StructurePrint |
| 12 | class Api(ApiTemplate): | 12 | class Api(ApiTemplate): |
| 13 | 13 | ||
| 14 | def process(self): | 14 | def process(self): |
| @@ -13,7 +13,7 @@ import schedule | @@ -13,7 +13,7 @@ import schedule | ||
| 13 | from app.util.component.RunContinuous import run_continuously | 13 | from app.util.component.RunContinuous import run_continuously |
| 14 | from app.util.component.PGUtil import PGUtil | 14 | from app.util.component.PGUtil import PGUtil |
| 15 | import configure | 15 | import configure |
| 16 | -from app.util.component.StructuredPrint import StructurePrint | 16 | +from app.util.component.StructurePrint import StructurePrint |
| 17 | import traceback | 17 | import traceback |
| 18 | import requests | 18 | import requests |
| 19 | 19 |
| @@ -31,8 +31,6 @@ class Api(ApiTemplate): | @@ -31,8 +31,6 @@ class Api(ApiTemplate): | ||
| 31 | else: | 31 | else: |
| 32 | image_services.extend(response.json()["data"]["list"]) | 32 | image_services.extend(response.json()["data"]["list"]) |
| 33 | 33 | ||
| 34 | - | ||
| 35 | - | ||
| 36 | for cata in catalogs: | 34 | for cata in catalogs: |
| 37 | catalog_guids = [c.guid for c in ServiceCatalog.query.filter(ServiceCatalog.path.like("%" + cata.guid + "%")).all()] | 35 | catalog_guids = [c.guid for c in ServiceCatalog.query.filter(ServiceCatalog.path.like("%" + cata.guid + "%")).all()] |
| 38 | service_count = Service.query.filter(Service.catalog_guid.in_(catalog_guids)).count() | 36 | service_count = Service.query.filter(Service.catalog_guid.in_(catalog_guids)).count() |
| @@ -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 ServiceEngine | 7 | from app.modules.service.models import ServiceEngine |
| 8 | -from app.util.component.StructuredPrint import StructurePrint | 8 | +from app.util.component.StructurePrint import StructurePrint |
| 9 | import requests | 9 | import requests |
| 10 | import uuid | 10 | import uuid |
| 11 | 11 |
| @@ -55,7 +55,7 @@ class Api(ApiTemplate): | @@ -55,7 +55,7 @@ class Api(ApiTemplate): | ||
| 55 | db.session.commit() | 55 | db.session.commit() |
| 56 | res["result"] = True | 56 | res["result"] = True |
| 57 | except Exception as e: | 57 | except Exception as e: |
| 58 | - raise Exception("引擎已注册!") | 58 | + raise e |
| 59 | return res | 59 | return res |
| 60 | 60 | ||
| 61 | 61 |
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | from app.util.component.ApiTemplate import ApiTemplate | 7 | from app.util.component.ApiTemplate import ApiTemplate |
| 8 | -from app.util.component.StructuredPrint import StructurePrint | 8 | +from app.util.component.StructurePrint import StructurePrint |
| 9 | from app.models import db | 9 | from app.models import db |
| 10 | from app.modules.data.models import Task | 10 | from app.modules.data.models import Task |
| 11 | import multiprocessing | 11 | import multiprocessing |
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | 6 | ||
| 7 | from app.modules.service.models import TileScheme | 7 | from app.modules.service.models import TileScheme |
| 8 | from app.util.component.ModelVisitor import ModelVisitor | 8 | from app.util.component.ModelVisitor import ModelVisitor |
| 9 | -from app.util.component.StructuredPrint import StructurePrint | 9 | +from app.util.component.StructurePrint import StructurePrint |
| 10 | import json | 10 | import json |
| 11 | import base64 | 11 | import base64 |
| 12 | 12 |
| @@ -9,7 +9,7 @@ import os | @@ -9,7 +9,7 @@ import os | ||
| 9 | from app.util.component.FileProcess import FileProcess | 9 | from app.util.component.FileProcess import FileProcess |
| 10 | from app.util.component.SliceScheme import SliceScheme | 10 | from app.util.component.SliceScheme import SliceScheme |
| 11 | import shutil | 11 | import shutil |
| 12 | -from app.util.component.StructuredPrint import StructurePrint | 12 | +from app.util.component.StructurePrint import StructurePrint |
| 13 | 13 | ||
| 14 | class Api(ApiTemplate): | 14 | class Api(ApiTemplate): |
| 15 | api_name = "解析方案" | 15 | api_name = "解析方案" |
| @@ -64,26 +64,29 @@ class Api(ApiTemplate): | @@ -64,26 +64,29 @@ class Api(ApiTemplate): | ||
| 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"}) | ||
| 68 | - if not response.json().get("result"): | ||
| 69 | - raise Exception("获取影像地图失败!") | ||
| 70 | - else: | ||
| 71 | - raw_json = response.json()["data"]["list"] | ||
| 72 | - if state: | ||
| 73 | - raw_json = [ service for service in raw_json if service["state"] == int(state)] | ||
| 74 | - if type: | ||
| 75 | - raw_json = [service for service in raw_json if service["type"] == type] | ||
| 76 | - if catalog_guid: | ||
| 77 | - raw_json = [service for service in raw_json if service["catalog_guid"] == catalog_guid] | ||
| 78 | - # 并集 | ||
| 79 | - if title and name: | ||
| 80 | - raw_json = [service for service in raw_json if re.search(name, service["name"]) or re.search(title, service["title"])] | 67 | + try: |
| 68 | + response:requests.Response = requests.post(url,{"page_size":"9999","page_index":"0"}) | ||
| 69 | + if not response.json().get("result"): | ||
| 70 | + raise Exception("获取影像地图失败!") | ||
| 81 | else: | 71 | else: |
| 82 | - if title: | ||
| 83 | - raw_json = [service for service in raw_json if re.search(title, service["title"])] | ||
| 84 | - if name: | ||
| 85 | - raw_json = [service for service in raw_json if re.search(name, service["name"])] | ||
| 86 | - services_json.extend(raw_json) | 72 | + raw_json = response.json()["data"]["list"] |
| 73 | + if state: | ||
| 74 | + raw_json = [ service for service in raw_json if service["state"] == int(state)] | ||
| 75 | + if type: | ||
| 76 | + raw_json = [service for service in raw_json if service["type"] == type] | ||
| 77 | + if catalog_guid: | ||
| 78 | + raw_json = [service for service in raw_json if service["catalog_guid"] == catalog_guid] | ||
| 79 | + # 并集 | ||
| 80 | + if title and name: | ||
| 81 | + raw_json = [service for service in raw_json if re.search(name, service["name"]) or re.search(title, service["title"])] | ||
| 82 | + else: | ||
| 83 | + if title: | ||
| 84 | + raw_json = [service for service in raw_json if re.search(title, service["title"])] | ||
| 85 | + if name: | ||
| 86 | + raw_json = [service for service in raw_json if re.search(name, service["name"])] | ||
| 87 | + services_json.extend(raw_json) | ||
| 88 | + except: | ||
| 89 | + pass | ||
| 87 | 90 | ||
| 88 | # 筛选服务能力 | 91 | # 筛选服务能力 |
| 89 | if function_type: | 92 | if function_type: |
| @@ -34,7 +34,13 @@ class Api(ApiTemplate): | @@ -34,7 +34,13 @@ class Api(ApiTemplate): | ||
| 34 | #地图服务 | 34 | #地图服务 |
| 35 | map_services = MapService.query.all() | 35 | map_services = MapService.query.all() |
| 36 | for ms in map_services: | 36 | for ms in map_services: |
| 37 | - res["data"]["list"].append(ModelVisitor.object_to_json(ms)) | 37 | + para = ModelVisitor.object_to_json(ms) |
| 38 | + para[""] | ||
| 39 | + | ||
| 40 | + res["data"]["list"].append(para) | ||
| 41 | + | ||
| 42 | + | ||
| 43 | + | ||
| 38 | 44 | ||
| 39 | res["data"]["count"] = len(tile_services)+len(map_services) | 45 | res["data"]["count"] = len(tile_services)+len(map_services) |
| 40 | res["result"] = True | 46 | res["result"] = True |
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | #email: nheweijun@sina.com | 4 | #email: nheweijun@sina.com |
| 5 | 5 | ||
| 6 | from app.util.component.ApiTemplate import ApiTemplate | 6 | from app.util.component.ApiTemplate import ApiTemplate |
| 7 | -from app.util.component.StructuredPrint import StructurePrint | 7 | +from app.util.component.StructurePrint import StructurePrint |
| 8 | from app.util.component.ModelVisitor import ModelVisitor | 8 | from app.util.component.ModelVisitor import ModelVisitor |
| 9 | import uuid | 9 | import uuid |
| 10 | from ..models import TileService,Service,db,ServiceFunction,TileScheme | 10 | from ..models import TileService,Service,db,ServiceFunction,TileScheme |
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | from app.util.component.ApiTemplate import ApiTemplate | 7 | from app.util.component.ApiTemplate import ApiTemplate |
| 8 | -from app.util.component.StructuredPrint import StructurePrint | 8 | +from app.util.component.StructurePrint import StructurePrint |
| 9 | import uuid | 9 | import uuid |
| 10 | from ..models import TileService,Service,db,ServiceFunction,TileScheme | 10 | from ..models import TileService,Service,db,ServiceFunction,TileScheme |
| 11 | 11 |
| @@ -10,7 +10,7 @@ import configure | @@ -10,7 +10,7 @@ import configure | ||
| 10 | from app.util.component.ModelVisitor import ModelVisitor | 10 | from app.util.component.ModelVisitor import ModelVisitor |
| 11 | 11 | ||
| 12 | from .util.ProjectFile import ProjectFile | 12 | from .util.ProjectFile import ProjectFile |
| 13 | - | 13 | +from ..util.ServiceType import ServiceType |
| 14 | 14 | ||
| 15 | class Api(ApiTemplate): | 15 | class Api(ApiTemplate): |
| 16 | 16 | ||
| @@ -25,7 +25,7 @@ class Api(ApiTemplate): | @@ -25,7 +25,7 @@ class Api(ApiTemplate): | ||
| 25 | res["data"]["list"] = [] | 25 | res["data"]["list"] = [] |
| 26 | 26 | ||
| 27 | #切片服务 | 27 | #切片服务 |
| 28 | - tile_services = TileService.query.join(Service).filter(Service.type == "切片服务").all() | 28 | + tile_services = TileService.query.join(Service).filter(Service.type == ServiceType.tile_service.value).all() |
| 29 | for ts in tile_services: | 29 | for ts in tile_services: |
| 30 | project_file = ProjectFile.create(ModelVisitor.object_to_json(ts)) | 30 | project_file = ProjectFile.create(ModelVisitor.object_to_json(ts)) |
| 31 | service:Service = Service.query.filter_by(guid=ts.service_guid).one_or_none() | 31 | service:Service = Service.query.filter_by(guid=ts.service_guid).one_or_none() |
| @@ -9,7 +9,7 @@ import os | @@ -9,7 +9,7 @@ import os | ||
| 9 | from app.util.component.FileProcess import FileProcess | 9 | from app.util.component.FileProcess import FileProcess |
| 10 | from app.util.component.SliceScheme import SliceScheme | 10 | from app.util.component.SliceScheme import SliceScheme |
| 11 | import shutil | 11 | import shutil |
| 12 | -from app.util.component.StructuredPrint import StructurePrint | 12 | +from app.util.component.StructurePrint import StructurePrint |
| 13 | from flask import request | 13 | from flask import request |
| 14 | import uuid | 14 | import uuid |
| 15 | import configure | 15 | import configure |
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | 6 | ||
| 7 | from app.modules.service.models import TileScheme | 7 | from app.modules.service.models import TileScheme |
| 8 | from app.util.component.ModelVisitor import ModelVisitor | 8 | from app.util.component.ModelVisitor import ModelVisitor |
| 9 | -from app.util.component.StructuredPrint import StructurePrint | 9 | +from app.util.component.StructurePrint import StructurePrint |
| 10 | import json | 10 | import json |
| 11 | import base64 | 11 | import base64 |
| 12 | 12 |
| @@ -8,7 +8,7 @@ import uuid | @@ -8,7 +8,7 @@ import uuid | ||
| 8 | import os | 8 | import os |
| 9 | import stat | 9 | import stat |
| 10 | import platform | 10 | import platform |
| 11 | -from app.util.component.StructuredPrint import StructurePrint | 11 | +from app.util.component.StructurePrint import StructurePrint |
| 12 | class FileProcess: | 12 | class FileProcess: |
| 13 | @classmethod | 13 | @classmethod |
| 14 | def save(cls,parent): | 14 | def save(cls,parent): |
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | #email: nheweijun@sina.com | 4 | #email: nheweijun@sina.com |
| 5 | 5 | ||
| 6 | from app.modules.data.models import Task | 6 | from app.modules.data.models import Task |
| 7 | -from app.util.component.StructuredPrint import StructurePrint | 7 | +from app.util.component.StructurePrint import StructurePrint |
| 8 | import configure | 8 | import configure |
| 9 | import time | 9 | import time |
| 10 | from app.util.component.PGUtil import PGUtil | 10 | from app.util.component.PGUtil import PGUtil |
请
注册
或
登录
后发表评论