refactor(cool): 修复Logger变量名拼写错误 将全局Logger变量从Loger修正为Logger,统一日志实例命名规范, 确保所有模块中日志记录的一致性。 BREAKING CHANGE: 全局日志实例变量名从Loger改为Logger ```
40 lines
719 B
Go
40 lines
719 B
Go
package funcs
|
|
|
|
import (
|
|
"blazing/cool"
|
|
|
|
"blazing/modules/base/service"
|
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
)
|
|
|
|
type BaseFuncClearLog struct {
|
|
}
|
|
|
|
// Func
|
|
func (f *BaseFuncClearLog) Func(ctx g.Ctx, param string) (err error) {
|
|
cool.Logger.Info(ctx, "清理日志 BaseFuncClearLog.Func", "param", param)
|
|
baseSysLogService := service.NewBaseSysLogService()
|
|
if param == "true" {
|
|
err = baseSysLogService.Clear(true)
|
|
} else {
|
|
err = baseSysLogService.Clear(false)
|
|
}
|
|
return
|
|
}
|
|
|
|
// IsSingleton
|
|
func (f *BaseFuncClearLog) IsSingleton() bool {
|
|
return true
|
|
}
|
|
|
|
// IsAllWorker
|
|
func (f *BaseFuncClearLog) IsAllWorker() bool {
|
|
return false
|
|
}
|
|
|
|
// init
|
|
func init() {
|
|
cool.RegisterFunc("BaseFuncClearLog", &BaseFuncClearLog{})
|
|
}
|