mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-14 23:00:27 +00:00
feat: able to query test log
This commit is contained in:
@@ -37,6 +37,7 @@ const (
|
||||
LogTypeConsume
|
||||
LogTypeManage
|
||||
LogTypeSystem
|
||||
LogTypeTest
|
||||
)
|
||||
|
||||
func recordLogHelper(ctx context.Context, log *Log) {
|
||||
@@ -86,6 +87,12 @@ func RecordConsumeLog(ctx context.Context, log *Log) {
|
||||
recordLogHelper(ctx, log)
|
||||
}
|
||||
|
||||
func RecordTestLog(ctx context.Context, log *Log) {
|
||||
log.CreatedAt = helper.GetTimestamp()
|
||||
log.Type = LogTypeTest
|
||||
recordLogHelper(ctx, log)
|
||||
}
|
||||
|
||||
func GetAllLogs(logType int, startTimestamp int64, endTimestamp int64, modelName string, username string, tokenName string, startIdx int, num int, channel int) (logs []*Log, err error) {
|
||||
var tx *gorm.DB
|
||||
if logType == LogTypeUnknown {
|
||||
|
Reference in New Issue
Block a user