def delete_address(id, user_id): address = Address.get_or_404(id=id, user_id=user_id) address.delete()
def get_address(id): '''查询「配送信息」''' address = Address.get_or_404(id=id, error_code=6001, msg='配送地址不存在') return Success(address)
def update_address(id, user_id, **form): address = Address.get_or_404(id=id, user_id=user_id) address.update(**form)