json #25
This commit is contained in:
@ -1 +1,17 @@
|
||||
echo mongoexport --jsonArray -d=ismism -c=user -o=json/user.json
|
||||
mongoexport --jsonArray -d=ismism -c=user -o=json/user.json
|
||||
|
||||
echo mongoexport --jsonArray -d=ismism -c=soc -o=json/soc.json
|
||||
mongoexport --jsonArray -d=ismism -c=soc -o=json/soc.json
|
||||
|
||||
echo mongoexport --jsonArray -d=ismism -c=agenda -o=json/agenda.json
|
||||
mongoexport --jsonArray -d=ismism -c=agenda -o=json/agenda.json
|
||||
|
||||
echo mongoexport --jsonArray -d=ismism -c=work -o=json/work.json
|
||||
mongoexport --jsonArray -d=ismism -c=work -o=json/work.json
|
||||
|
||||
echo mongoexport --jsonArray -d=ismism -c=fund -o=json/fund.json
|
||||
mongoexport --jsonArray -d=ismism -c=fund -o=json/fund.json
|
||||
|
||||
echo mongoexport --jsonArray -d=ismism -c=dat -o=json/dat.json
|
||||
mongoexport --jsonArray -d=ismism -c=dat -o=json/dat.json
|
||||
|
@ -1 +1,17 @@
|
||||
echo mongoimport --jsonArray -d=ismism -c=user --file=json/user.json
|
||||
mongoimport --jsonArray -d=ismism -c=user --file=json/user.json
|
||||
|
||||
echo mongoimport --jsonArray -d=ismism -c=soc --file=json/soc.json
|
||||
mongoimport --jsonArray -d=ismism -c=soc --file=json/soc.json
|
||||
|
||||
echo mongoimport --jsonArray -d=ismism -c=agenda --file=json/agenda.json
|
||||
mongoimport --jsonArray -d=ismism -c=agenda --file=json/agenda.json
|
||||
|
||||
echo mongoimport --jsonArray -d=ismism -c=work --file=json/work.json
|
||||
mongoimport --jsonArray -d=ismism -c=work --file=json/work.json
|
||||
|
||||
echo mongoimport --jsonArray -d=ismism -c=fund --file=json/fund.json
|
||||
mongoimport --jsonArray -d=ismism -c=fund --file=json/fund.json
|
||||
|
||||
echo mongoimport --jsonArray -d=ismism -c=dat --file=json/dat.json
|
||||
mongoimport --jsonArray -d=ismism -c=dat --file=json/dat.json
|
||||
|
16
cli/jsonfix.ts
Normal file
16
cli/jsonfix.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { User, Work } from "../ismism.ts/src/typ.ts";
|
||||
|
||||
const user: User[] = JSON.parse(Deno.readTextFileSync("json/user.json"))
|
||||
const work: Work[] = JSON.parse(Deno.readTextFileSync("json/work.json"))
|
||||
|
||||
let n = 0
|
||||
for (const w of work) {
|
||||
w._id = ++n
|
||||
if (typeof w.uid === "number") continue
|
||||
const u = user.find(u => u.name === w.uid as unknown as string)
|
||||
console.log(`uid: ${w.uid} -> ${u?._id}`)
|
||||
if (u) w.uid = u._id
|
||||
}
|
||||
console.log(`scanned ${n} work records`)
|
||||
|
||||
Deno.writeTextFileSync("json/work-fix.json", JSON.stringify(work))
|
@ -58,6 +58,11 @@ export type Work = {
|
||||
op: "work",
|
||||
aid: number,
|
||||
msg: string
|
||||
} | {
|
||||
op: "video",
|
||||
aid: number[],
|
||||
title: string,
|
||||
src: string,
|
||||
})
|
||||
|
||||
export type Fund = {
|
||||
|
@ -830,7 +830,7 @@
|
||||
nimg: 0,
|
||||
stat: {
|
||||
fund: 0, budget: 0, expense: 0,
|
||||
detail: "https://docs.qq.com/sheet/DZWNvbXV3S0FDV0Nx?tab=zh23xc",
|
||||
detail: "https://docs.qq.com/sheet/DZWNvbXV3S0FDV0Nx",
|
||||
progress: [
|
||||
{ goal: "厨房改造", pct: 5 },
|
||||
{ goal: "2022十一月营养餐食", pct: 0 },
|
||||
|
Reference in New Issue
Block a user