System inform (#2263)

* feat: Bind Notification Pipe (#2229)

* chore: account page add bind notification modal

* feat: timerlock schema and type

* feat(fe): bind notification method modal

* chore: fe adjust

* feat: clean useless code

* fix: cron lock

* chore: adjust the code

* chore: rename api

* chore: remove unused code

* chore: fe adjust

* perf: bind inform ux

* fix: time ts

* chore: notification (#2251)

* perf: send message code

* perf: sub schema index

* fix: timezone plugin

* fix: format

---------

Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
This commit is contained in:
Archer
2024-08-05 00:29:14 +08:00
committed by GitHub
parent 998e7833e8
commit 56f6e69bc7
31 changed files with 344 additions and 171 deletions

View File

@@ -4,14 +4,21 @@ export enum TimerIdEnum {
checkInvalidVector = 'checkInvalidVector',
clearExpiredSubPlan = 'clearExpiredSubPlan',
updateStandardPlan = 'updateStandardPlan',
scheduleTriggerApp = 'scheduleTriggerApp'
scheduleTriggerApp = 'scheduleTriggerApp',
notification = 'notification'
}
export const timerIdMap = {
[TimerIdEnum.checkInValidDatasetFiles]: 'checkInValidDatasetFiles',
[TimerIdEnum.checkInvalidDatasetData]: 'checkInvalidDatasetData',
[TimerIdEnum.checkInvalidVector]: 'checkInvalidVector',
[TimerIdEnum.clearExpiredSubPlan]: 'clearExpiredSubPlan',
[TimerIdEnum.updateStandardPlan]: 'updateStandardPlan',
[TimerIdEnum.scheduleTriggerApp]: 'scheduleTriggerApp'
};
export enum LockNotificationEnum {
NotificationExpire = 'notification_expire',
NotificationFreeClean = 'notification_free_clean',
NotificationLackOfPoints = 'notification_lack_of_points'
}
export type LockType = `${LockNotificationEnum}`;
// add a new type enum example:
// export enum ExampleLockEnum {
// ExampleLockType1 = 'example_lock_type1'
// }
//
// export type LockType = `${NotificationLockEnum}` | `${ExampleLockEnum}`

View File

@@ -1,6 +1,5 @@
import { connectionMongo, getMongoModel, type Model } from '../../mongo';
import { timerIdMap } from './constants';
const { Schema, model, models } = connectionMongo;
import { connectionMongo, getMongoModel } from '../../mongo';
const { Schema } = connectionMongo;
import { TimerLockSchemaType } from './type.d';
export const collectionName = 'systemtimerlocks';
@@ -9,8 +8,7 @@ const TimerLockSchema = new Schema({
timerId: {
type: String,
required: true,
unique: true,
enum: Object.keys(timerIdMap)
unique: true
},
expiredTime: {
type: Date,

View File

@@ -1,4 +1,3 @@
import { TimerIdEnum } from './constants';
import { MongoTimerLock } from './schema';
import { addMinutes } from 'date-fns';
@@ -9,7 +8,7 @@ export const checkTimerLock = async ({
timerId,
lockMinuted
}: {
timerId: TimerIdEnum;
timerId: string;
lockMinuted: number;
}) => {
try {