All files / example/models/service/data User.js

100% Statements 8/8
100% Branches 2/2
100% Functions 2/2
100% Lines 8/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22    1x 1x         2x 2x       2x 2x 2x         1x  
'use strict';
 
const Lark = require('../../../..');
const $    = global.$;
 
class User extends Lark.Model {
 
    constructor(name) {
        super();
        this.name = name || 'Anonymous';
    }
 
    async getInfo() {
        const info = await $.dao.user.getInfoByName(this.name);
        info.age = $.lib.mosaic(info.age);
        return info;
    }
 
}
 
module.exports = User;