域名服务增加访问日志

This commit is contained in:
GoEdgeLab
2021-06-02 11:53:24 +08:00
parent b4bdf7ba8f
commit 637193a270
17 changed files with 829 additions and 121 deletions

View File

@@ -5,6 +5,7 @@ import (
_ "github.com/go-sql-driver/mysql"
"github.com/iwind/TeaGo/Tea"
"github.com/iwind/TeaGo/dbs"
timeutil "github.com/iwind/TeaGo/utils/time"
"time"
)
@@ -81,3 +82,15 @@ func (this *AuthorityKeyDAO) ResetKey(tx *dbs.Tx) error {
Delete()
return err
}
// IsPlus 判断是否为企业版
func (this *AuthorityKeyDAO) IsPlus(tx *dbs.Tx) (bool, error) {
key, err := this.ReadKey(tx)
if err != nil {
return false, err
}
if key == nil {
return false, nil
}
return key.DayTo >= timeutil.Format("Y-m-d"), nil
}