增加查询最大签到天数的接口

This commit is contained in:
CounterFire2023 2024-01-09 10:35:48 +08:00
parent 0bb8709fcd
commit 24a3ce1329
2 changed files with 11 additions and 1 deletions

View File

@ -41,5 +41,16 @@ class TaskController extends BaseController {
}
return result
}
@role('anon')
@router('post /task/check_in/max_seq')
async maxSeqCheckin(req, res) {
let { address } = req.params
if (!address) {
throw new ZError(10, 'params mismatch')
}
const record = await CheckIn.findOne({from: address.toLowerCase()}).sort({count: -1})
return record.toJson()
}
}
export default TaskController

View File

@ -3,7 +3,6 @@ import logger from 'logger/logger'
import { RedisClient } from 'redis/RedisClient'
const envFile = process.env.NODE_ENV && process.env.NODE_ENV === 'production' ? `.env.production` : '.env.development'
dotenv.config({ path: envFile })
import { EventSyncSvr } from 'service/event.sync.service'
import {IScriptionCfg, SCRIPTIONS_CFG} from 'config/scriptions_cfg'