阶段性提交

This commit is contained in:
GoEdgeLab
2020-12-23 10:30:42 +08:00
parent 589cde7511
commit 21159b97db
18 changed files with 2115 additions and 770 deletions

36
pkg/rpc/dao/log_dao.go Normal file
View File

@@ -0,0 +1,36 @@
package dao
import (
"context"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
var SharedLogDAO = NewLogDAO()
type LogDAO struct {
BaseDAO
}
func NewLogDAO() *LogDAO {
return &LogDAO{}
}
func (this *LogDAO) CreateUserLog(ctx context.Context, level string, action string, description string, ip string) error {
_, err := this.RPC().LogRPC().CreateLog(ctx, &pb.CreateLogRequest{
Level: level,
Description: description,
Action: action,
Ip: ip,
})
return err
}
func (this *LogDAO) CreateAdminLog(ctx context.Context, level string, action string, description string, ip string) error {
_, err := this.RPC().LogRPC().CreateLog(ctx, &pb.CreateLogRequest{
Level: level,
Description: description,
Action: action,
Ip: ip,
})
return err
}