generated from tailored/router-template
temp
This commit is contained in:
33
src/services/xhs-task.ts
Normal file
33
src/services/xhs-task.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { Queue } from 'bullmq';
|
||||
import { app } from '@kevisual/xhs/index';
|
||||
import { QueryRouterServer } from '@kevisual/router';
|
||||
|
||||
type XhsTaskOptions = {
|
||||
queue: Queue;
|
||||
};
|
||||
export class XhsTask {
|
||||
queue: Queue;
|
||||
constructor(opts: XhsTaskOptions) {
|
||||
this.queue = opts.queue;
|
||||
}
|
||||
async getUnread() {
|
||||
const res = await app.call({
|
||||
path: 'mention',
|
||||
key: 'getUnread',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const qs = new QueryRouterServer();
|
||||
|
||||
qs.route({
|
||||
path: 'task',
|
||||
key: 'getUnread',
|
||||
})
|
||||
.define(async (ctx) => {
|
||||
const unread_count = 0;
|
||||
if (unread_count > 0) {
|
||||
|
||||
}
|
||||
})
|
||||
.addTo(qs);
|
||||
Reference in New Issue
Block a user