AutoRpa/rpa_oms/app/inbound/repo.py

22 lines
590 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""收件仓库契约。
DuplicateOmsId:oms_id 已存在,调用方回 DUPLICATE,不更新。
DuplicateFid:接口 3 来源 fid 已存在,调用方回 DUPLICATE,不更新。
RepoUnavailable:连不上库或未配置,整包 HTTP 503,一条都不落。
"""
class DuplicateOmsId(Exception):
def __init__(self, oms_id: int):
self.oms_id = oms_id
class DuplicateFid(Exception):
def __init__(self, fid: int):
self.fid = fid
class RepoUnavailable(Exception):
def __init__(self, message: str = "数据库不可用"):
self.message = message