mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-20 04:50:24 +08:00
域名服务增加访问日志
This commit is contained in:
17
internal/db/models/ns_access_log_model_ext.go
Normal file
17
internal/db/models/ns_access_log_model_ext.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
)
|
||||
|
||||
// ToPB 转换成PB对象
|
||||
func (this *NSAccessLog) ToPB() (*pb.NSAccessLog, error) {
|
||||
p := &pb.NSAccessLog{}
|
||||
err := json.Unmarshal([]byte(this.Content), p)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
p.RequestId = this.RequestId
|
||||
return p, nil
|
||||
}
|
||||
Reference in New Issue
Block a user