mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-01-24 19:50:19 +08:00
32 lines
541 B
Go
32 lines
541 B
Go
// Package hook
|
|
// @Link https://github.com/bufanyun/hotgo
|
|
// @Copyright Copyright (c) 2023 HotGo CLI
|
|
// @Author Ms <133814250@qq.com>
|
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
|
package hook
|
|
|
|
import (
|
|
"github.com/gogf/gf/v2/net/ghttp"
|
|
"hotgo/internal/service"
|
|
)
|
|
|
|
type sHook struct {
|
|
}
|
|
|
|
func init() {
|
|
service.RegisterHook(New())
|
|
}
|
|
|
|
func New() *sHook {
|
|
return &sHook{}
|
|
}
|
|
|
|
func (s *sHook) BeforeServe(r *ghttp.Request) {
|
|
|
|
}
|
|
|
|
func (s *sHook) AfterOutput(r *ghttp.Request) {
|
|
s.accessLog(r)
|
|
s.lastAdminActive(r)
|
|
}
|