package initialize

import (
	"github.com/robfig/cron"
	"server/dao"
	"server/global"
)

func MyJob() {
	c := cron.New()

	c.AddFunc("0 0 1 * * ? ", func() {
		err := dao.CreateProjectMonthFee()
		if err != nil {
			global.GVA_LOG.Error("CreateProjectMonthFee ====== " + err.Error())
		}
		err = dao.CreateMonthExpenses()
		if err != nil {
			global.GVA_LOG.Error("CreateMonthExpenses ====== " + err.Error())
		}
	})

	c.Start()
}
