增加操作日志查看界面

This commit is contained in:
刘祥超
2020-11-10 20:30:47 +08:00
parent b1059b6e09
commit 2e51574ee7
13 changed files with 101 additions and 47 deletions

View File

@@ -0,0 +1,30 @@
package models
import (
"context"
"github.com/TeaOSLab/EdgeAdmin/internal/rpc"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
var SharedLogDAO = NewLogDAO()
type LogDAO struct {
}
func NewLogDAO() *LogDAO {
return &LogDAO{}
}
func (this *LogDAO) CreateAdminLog(ctx context.Context, level string, action string, description string, ip string) error {
client, err := rpc.SharedRPC()
if err != nil {
return err
}
_, err = client.LogRPC().CreateLog(ctx, &pb.CreateLogRequest{
Level: level,
Description: description,
Action: action,
Ip: ip,
})
return err
}