域名服务增加访问日志

This commit is contained in:
刘祥超
2021-06-02 11:53:24 +08:00
parent e9e4abff03
commit 442dd195ca
17 changed files with 829 additions and 121 deletions

View 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
}