mirror of
				https://github.com/TeaOSLab/EdgeAPI.git
				synced 2025-11-04 07:50:25 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			324 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			324 B
		
	
	
	
		
			Go
		
	
	
	
	
	
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(this.Content, p)
 | 
						|
	if err != nil {
 | 
						|
		return nil, err
 | 
						|
	}
 | 
						|
	p.RequestId = this.RequestId
 | 
						|
	return p, nil
 | 
						|
}
 |