/**
 * 短信提示
 * 
 */

import {Schema} from 'mongoose';
import { baseDB } from '../../db/mongo/dbInit';


const smsPointOutSchema = new Schema({
    month:Number,
    year:Number,
    type:Number,
    sendMs:Number
});


var smsPointOutModel;
export function initModel(){
    smsPointOutModel = baseDB.model('smspointout', smsPointOutSchema);
}

export async function createSmsPointOutData(month:number, year:number, type:number) {
    return await smsPointOutModel.create({
        month, year, type, sendMs:new Date().valueOf()
    });
}

export async function findSmsPointOutData(month:number, year:number) {
    return await smsPointOutModel.findOne({month, year});
}
