def apiDeleteCustom(request): intResult = 0 strID = request.POST.get('i') intResult = LDataCtrl.funDeleteCustom(strID) resp = {'intBack': intResult} return HttpResponse(content=json.dumps(resp), content_type='application/json;charset = utf-8', charset='utf-8')
def apiGetKWEmo(request): intResult = 1 strkw = request.POST.get('kw') arrEMOWithKW = LDataCtrl.funLoadKW(strkw) resp = {'intBack': intResult, 'arrKWsEMO': arrEMOWithKW} return HttpResponse(content=json.dumps(resp), content_type='application/json;charset = utf-8', charset='utf-8')
def apiGetCustom(request): intResult = 0 arrAllData = LDataCtrl.funListAllCustom() intResult = 1 resp = {'intBack': intResult, 'arrData': arrAllData} return HttpResponse(content=json.dumps(resp), content_type='application/json;charset = utf-8', charset='utf-8')
def apiLoadAllTableCount(request): intResult = 0 strDataCount = LDataCtrl.funLoadCountOfNumber() intResult = 1 resp = {'intBack': intResult, 'strFB': strDataCount} return HttpResponse(content=json.dumps(resp), content_type='application/json;charset = utf-8', charset='utf-8')
def apiInsertReusableSite(request): intResult = 0 strURL = request.POST.get('u') intResult = LDataCtrl.funInsertReusableSite(strURL) resp = {'intBack': intResult} return HttpResponse(content=json.dumps(resp), content_type='application/json;charset = utf-8', charset='utf-8')
def apiGetReusableSite(request): intResult = 0 arrAllSite = LDataCtrl.funListAllReusable() intResult = 1 resp = {'intBack': intResult, 'arrSite': arrAllSite} return HttpResponse(content=json.dumps(resp), content_type='application/json;charset = utf-8', charset='utf-8')
def apiInsertSample(request): intEmo = int(request.POST.get('e')) strSampleID = request.POST.get('ct') intResult = LDataCtrl.funInsertSample(intEmo, strSampleID) resp = {'intBack': intResult} return HttpResponse(content=json.dumps(resp), content_type='application/json;charset = utf-8', charset='utf-8')
def apiLoadRandSample(request): intResult = 0 dictResult = LDataCtrl.funLoadOneSampleWhatEver() if not dictResult['_id'] == '1024': intResult = 1 resp = {'intBack': intResult, 'dictData': dictResult} return HttpResponse(content=json.dumps(resp), content_type='application/json;charset = utf-8', charset='utf-8')
def apiInsertCustom(request): intResult = 0 strTag = request.POST.get('t') strKeyURL = request.POST.get('u') intResult = LDataCtrl.funInsertCustom(strTag, strKeyURL) resp = {'intBack': intResult} return HttpResponse(content=json.dumps(resp), content_type='application/json;charset = utf-8', charset='utf-8')
def apiDeleteSampleWithKeyW(request): intResult = 0 strKW = request.POST.get('kw') intDeleteCount = LDataCtrl.funDeleteSampleWithKW(strKW) intResult = 1 resp = {'intBack': intResult, 'intDeleteCount': intDeleteCount} return HttpResponse(content=json.dumps(resp), content_type='application/json;charset = utf-8', charset='utf-8')