diff --git a/server/.env.development b/server/.env.development index 488910a2..d5d1d565 100644 --- a/server/.env.development +++ b/server/.env.development @@ -1,3 +1,20 @@ -XIAOJU_SURVEY_REPORT=true +XIAOJU_SURVEY_MONGO_DB_NAME=xiaojuSurvey XIAOJU_SURVEY_MONGO_URL=mongodb://127.0.0.1:27017 +XIAOJU_SURVEY_MONGO_AUTH_SOURCE=admin +XIAOJU_SURVEY_REDIS_HOST= +XIAOJU_SURVEY_REDIS_PORT= +XIAOJU_SURVEY_REDIS_USERNAME= +XIAOJU_SURVEY_REDIS_PASSWORD= +XIAOJU_SURVEY_REDIS_DB= + + +XIAOJU_SURVEY_RESPONSE_AES_ENCRYPT_SECRET_KEY=dataAesEncryptSecretKey +XIAOJU_SURVEY_HTTP_DATA_ENCRYPT_TYPE=rsa + +XIAOJU_SURVEY_JWT_SECRET=xiaojuSurveyJwtSecret +XIAOJU_SURVEY_JWT_EXPIRES_IN=8h + +XIAOJU_SURVEY_LOGGER_FILENAME=./logs/app.log + +XIAOJU_SURVEY_REPORT=true diff --git a/server/package.json b/server/package.json index 3ef50f27..27a929ca 100644 --- a/server/package.json +++ b/server/package.json @@ -1,7 +1,7 @@ { - "name": "server", - "version": "0.0.1", - "description": "", + "name": "xiaoju-survey-server", + "version": "1.3.0", + "description": "XIAOJUSURVEY的server端", "author": "", "scripts": { "build": "nest build", diff --git a/server/src/modules/upgrade/services/upgrade.service.ts b/server/src/modules/upgrade/services/upgrade.service.ts index 1eaa21f2..0364932b 100644 --- a/server/src/modules/upgrade/services/upgrade.service.ts +++ b/server/src/modules/upgrade/services/upgrade.service.ts @@ -76,7 +76,7 @@ export class UpgradeService { doc.updatedAt = new Date(doc.updateDate); delete doc.updateDate; } else { - doc.createdAt = new Date(); + doc.updatedAt = new Date(); } } }; @@ -143,7 +143,15 @@ export class UpgradeService { const save = async ({ doc, repository }) => { const entity = repository.create(doc); - await repository.save(entity); + await repository.updateOne( + { + _id: entity._id, + }, + { + $set: entity, + }, + ); + // this.logger.info(JSON.stringify(updateRes)); }; this.logger.info(`upgrading...`); for (const repository of repositories) {