Esempio n. 1
0
def find_own_copyto_workflow():
    """
        find_own_copyto_workflow
        return {"data":[]
                , "status":{"code":0, "message":"success"}}
    """
    pagination = int(request.form['p'])
    workflow_service = Workflow_Service(MONGO)
    data, code, message = workflow_service.find_own_copyto_workflow(pagination)
    return __result(data, code, message)
Esempio n. 2
0
def cancel():
    """
        cancel workflow
        return {"data":[]
                , "status":{"code":0, "message":"success"}}
    """
    _id = request.form['_id']
    workflow_service = Workflow_Service(MONGO)
    data, code, message = workflow_service.cancel(_id)
    return __result(data, code, message)
Esempio n. 3
0
def add():
    """
        add workflow
        return {"data":[]
                , "status":{"code":0, "message":"success"}}
    """
    solution_id = request.form['solution_id']
    fields = json.loads(request.form['fields'])
    workflow_service = Workflow_Service(MONGO)
    data, code, message = workflow_service.add(solution_id, fields)
    return __result(data, code, message)
Esempio n. 4
0
def audit():
    """
        audit
        return {"data":[]
                , "status":{"code":0, "message":"success"}}
    """
    _id = request.form['_id']
    status = bool(int(request.form['status']))
    content = request.form['content']
    workflow_service = Workflow_Service(MONGO)
    data, code, message = workflow_service.audit(_id, status, content)
    return __result(data, code, message)
Esempio n. 5
0
def comment():
    """
        comment
        return {"data":[]
                , "status":{"code":0, "message":"success"}}
    """
    _id = request.form['_id']
    picture = json.loads(request.form['picture'])
    attachment = json.loads(request.form['attachment'])
    content = request.form['content']
    workflow_service = Workflow_Service(MONGO)
    data, code, message = workflow_service.comment(_id, content, picture,
                                                   attachment)
    return __result(data, code, message)