'use strict';

/**
 * 自动填充时间戳
 *
 * @author CaiAoLin
 * @date 2017/10/25
 * @version
 */

module.exports = options => {
    return function* datetimeFill(next) {
        let currentTime = new Date().getTime() / 1000;
        currentTime = parseInt(currentTime);
        this.request.body.create_time = currentTime;
        yield next;
    };
};
