const system = require("../../system");
const ServiceBase = require("../sve.base");
const moment = require("moment");

class LDUserService extends ServiceBase {
  constructor() {
    super(ServiceBase.getDaoName(LDUserService));
  }

  async loginH5(params) {
    let p_id = params.p_id;
    let p_user_id = params.p_user_id;
    let user = await this.dao.findOne({p_id: p_id, p_user_id: p_user_id});
    if (!user) {
      user = await this.dao.create(params);
    }
    return user;
  }
}

module.exports = LDUserService;