const { init: settingInit } = require('./models/Setting');
const { init: userInit } = require('./models/User');
const Logs = require('./libs/logs');

(() => {
  settingInit({
    innerDefaultAmount: 10000,
    minProfitAmount: 0,
    innerRebateRatio: 0,
    obRebateRatio: 0,
    hgRebateRatio: 0,
    runWorkerEnabled: false,
  })
  .then(() => {
    Logs.out('初始化设置完成');
  })
  .catch(err => {
    Logs.errDev('初始化设置失败:', err);
  });

  userInit({
    username: 'admin',
    password: '123456'
  })
  .then(() => {
    Logs.out('初始化用户完成');
  })
  .catch(err => {
    Logs.errDev('初始化用户失败:', err);
  });
})();