This commit is contained in:
张成
2025-11-21 16:53:49 +08:00
commit 8309808835
286 changed files with 32656 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
const { plu_upgrade, op } = require("../../middleware/baseModel");
module.exports = {
"POST /upgrade/add": async (ctx, next) => {
let row = ctx.getBody();
let { fingerPrintKey, newVersion, oldVersion } = row;
let upgradeRow = await plu_upgrade.findOne({ where: { fingerPrintKey, newVersion } });
if (upgradeRow) {
await plu_upgrade.update({ fingerPrintKey, newVersion, oldVersion, whetherTip: true }, { where: { id: upgradeRow.id }, individualHooks: true });
return ctx.success();
} else {
const res = await plu_upgrade.create(row);
return ctx.success(res);
}
},
"GET /upgrade/detail": async (ctx, next) => {
let fingerPrintKey = ctx.get("fingerPrintKey");
let newVersion = ctx.get("newVersion");
const res = await plu_upgrade.findOne({ where: { fingerPrintKey, newVersion } });
return ctx.success(res);
},
};