zhihao
09-25-2020, 01:15 AM
procone.py is used for generating analysis result for one case.
在某一案例内容中搜索key{1,2,3},构建"keys": []。
deleteIfMatch()
selectIfMatch()
query()
delete_one_case():
---
20210813/zhihao: update blank_json
20210811/zhihao: add selectIfMatch
20210811/zhihao: add delete_one_case
20200926/zhihao: add switch in main()
在某一案例内容中搜索key{1,2,3},构建"keys": []。
Code:
main() {
set $tycajson_pfn as a insert.json
get $reqtype from $tycajson_pfn
switch ($reqtype) {
case "delete":
deleteIfMatch()
case "select"
selectIfMatch()
deault:
query()
}
}
deleteIfMatch()
Code:
casecnt: current case count
biboext: $bibo_share/bibo-ext.pcf , records current case count
tycajson_pfn: file of json cases
blank_json: the value of is {"opstatus":"deleted"}
deleteIfMatch() {
rr=0
if $reqcaseid matches $caseid{
rid --insitu $tycajson_pfn
create file $tycajson_pfn with $blank_json
pcf --pcf $biboext --add bibo_doc_cnt ${casecnt}+1
coolauntie rm $tycano
rr = 105
}
return rr
}
selectIfMatch()
Code:
tycajson_pfn: file of json cases
reqcaseid: reqest case id
caseid: id of existing case
tycano: case number it selects
selectIfMatch() {
if $reqcaseid matches $caseid
return tycano
}
query()
Code:
query() {
generate query response
}
delete_one_case():
Code:
fw: file handler of one result file
newftexts: request content
insblock: content of insert block of the case in the corpus
blank_json: the value of is {"opstatus":"deleted"}
delete_one_case(fw, newftexts, insblock){
caseid = get caseid from insblock
newcaseid = get caseid from newftexts
if ($caseid == $newcaseid){
write $blank_json to $fw
}
}
---
20210813/zhihao: update blank_json
20210811/zhihao: add selectIfMatch
20210811/zhihao: add delete_one_case
20200926/zhihao: add switch in main()