def __init__(self): self.env = env self.dbuser = env.postgreSql_dbuser self.dbpswd = env.postgreSql_dbpswd self.dbhost = env.postgreSql_dbhost self.dbport = env.postgreSql_dbport self.dbname = env.postgreSql_dbname self.tableconversation = env.postgreSql_table_conversation self.successfactor_username = env.successfactor_username self.successfactor_password = env.successfactor_password self.successfactor_host = env.successfactor_host self.psdatabase = Utility()
def __init__(self): self.env = env self.psdatabase = Utility()
from sanic import response import json from config.env import env from postgreSql.connection import Utility from mail.sendMail import generateEmail _connectionDB = Utility() email = generateEmail() def triggerMail(function): def inner_function(request): if request.method == 'POST': dbCountQuery = "SELECT count(*) FROM o360_employee WHERE empid ~* '^[A-Z]'" present_count = int(("".join( json.dumps( _connectionDB.connect_execute(env.select_query_type, dbCountQuery)))).strip("[]")) dbCountQuery = "select license_count from param" max_count = int(("".join( json.dumps( _connectionDB.connect_execute(env.select_query_type, dbCountQuery)))).strip("[]")) if present_count > max_count: # email.SendMail() return response.json({"message": "User limit exceeded"}) else: return function(request) else: return function(request)
import json from reports.postgreDashboard import DashBoard from config.env import env from postgreSql.connection import Utility from postgreSql.postgresqlQuery import EmployeeDetails psdatabase = Utility() _dashBoard = DashBoard() _employeeDetails = EmployeeDetails() class analyticsappi(): def __init__(self): self.env = env self.psdatabase = Utility() def getSupportAndLiveChatDetails(self): previousId = """select table_id from dashboard_api_logDetails where type='Support and Live Chat Details'""" id = ("".join( json.dumps( psdatabase.connect_execute( query_type="select", dbQuery=previousId)))).strip("[]").strip('"') if len(id) == 0: support_chat_data = """select id ,intent_name,data from conversation_event where intent_name is not null and intent_name!='feedback'""" else:
def __init__(self): self._connectionDB = Utility() self.dbProcessUtil = DBProcessUtil()