image_service_delete.py 1.3 KB
# coding=utf-8
#author:        4N
#createtime:    2021/9/17
#email:         nheweijun@sina.com


from app.util.component.ApiTemplate import ApiTemplate
import requests

class Api(ApiTemplate):

    api_name = "删除ImageService服务"

    def process(self):
        # 返回结果
        res = {}
        try:
            url = "{}/API/Service/Delete".format(self.para.get("url"))
            response:requests.Response = requests.post(url,data=self.para)
            if not response.json().get("result"):
                raise Exception("由于{},影像服务删除失败!".format(response.json().get("msg")))
            res["result"] = True
        except Exception as e:
            raise e
        return res

    api_doc = {
        "tags": ["影像服务接口"],
        "parameters": [
            {"name": "guid",
             "in": "formData",
             "type": "string",
             "description": "guid"},
            {"name": "url",
             "in": "formData",
             "type": "string",
             "description": "url"},
        ],
        "responses": {
            200: {
                "schema": {
                    "properties": {
                    }
                }
            }
        }
    }