add recorder
This commit is contained in:
parent
7098529421
commit
ef4ad92e35
|
@ -394,5 +394,9 @@ func Init(ctx context.Context, cbs ...Option) (err error) {
|
|||
return
|
||||
}
|
||||
}
|
||||
if !opts.disableRecorder {
|
||||
//启用操作记录
|
||||
NewActivityRecorder(ctx, opts.db).Recoder()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
7
types.go
7
types.go
|
@ -28,6 +28,7 @@ type (
|
|||
vuePath string //生成Vue文件的路径,如果指定了启动的时候会自动生成Vue的文件
|
||||
translate Translate
|
||||
disableDefault bool
|
||||
disableRecorder bool
|
||||
httpServer *http.Server
|
||||
restOpts []rest.Option
|
||||
}
|
||||
|
@ -68,6 +69,12 @@ func WithoutDefault() Option {
|
|||
}
|
||||
}
|
||||
|
||||
func WithoutRecorder() Option {
|
||||
return func(o *options) {
|
||||
o.disableRecorder = true
|
||||
}
|
||||
}
|
||||
|
||||
func WithHttpServer(server *http.Server) Option {
|
||||
return func(o *options) {
|
||||
o.httpServer = server
|
||||
|
|
Loading…
Reference in New Issue