Work on Stripe log
This commit is contained in:
45
app/routers/e_stripe.py
Normal file
45
app/routers/e_stripe.py
Normal file
@@ -0,0 +1,45 @@
|
||||
import datetime, time
|
||||
from fastapi import APIRouter, Body, Depends, Header, HTTPException, Query, Response, status
|
||||
from pydantic import BaseModel, EmailStr, Field
|
||||
from typing import Dict, List, Optional, Set, Union
|
||||
|
||||
from app.lib_general import log, logging, common_route_params, Common_Route_Params
|
||||
from app.config import settings
|
||||
from app.db_sql import sql_enable_part, sql_insert, sql_update, sql_insert_or_update, sql_limit_offset_part, sql_select, sql_delete, redis_lookup_id_random
|
||||
|
||||
from app.routers.api_crud import delete_obj_template, get_obj_template, get_obj_li_template, patch_obj_template, post_obj_template
|
||||
|
||||
# from app.methods.stripe_methods import email_stripe_log_review_url, get_stripe_log_rec_list, load_stripe_log_obj, email_stripe_log_review_url
|
||||
|
||||
from app.models.e_stripe_models import Stripe_Log_Base, Stripe_Log_Base_In
|
||||
from app.models.response_models import Resp_Body_Base, mk_resp
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.post('/log', response_model=Resp_Body_Base)
|
||||
async def post_stripe_log_obj(
|
||||
obj: Stripe_Log_Base,
|
||||
|
||||
# x_account_id: str = Header(...),
|
||||
# return_obj: Optional[bool] = True,
|
||||
# by_alias: Optional[bool] = True,
|
||||
# exclude_unset: Optional[bool] = True,
|
||||
# response: Response = Response,
|
||||
|
||||
commons: Common_Route_Params = Depends(common_route_params),
|
||||
):
|
||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
obj_type = 'stripe_log'
|
||||
obj_data_dict = obj.dict(by_alias=False, exclude_unset=True)
|
||||
result = post_obj_template(
|
||||
obj_type = obj_type,
|
||||
data = obj_data_dict,
|
||||
return_obj = True,
|
||||
by_alias = True,
|
||||
exclude_unset = True,
|
||||
)
|
||||
return result
|
||||
Reference in New Issue
Block a user