MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / GetLogsSelfStat

Function GetLogsSelfStat

controller/log.go:124–146  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

122}
123
124func GetLogsSelfStat(c *gin.Context) {
125 username := c.GetString("username")
126 logType, _ := strconv.Atoi(c.Query("type"))
127 startTimestamp, _ := strconv.ParseInt(c.Query("start_timestamp"), 10, 64)
128 endTimestamp, _ := strconv.ParseInt(c.Query("end_timestamp"), 10, 64)
129 tokenName := c.Query("token_name")
130 modelName := c.Query("model_name")
131 channel, _ := strconv.Atoi(c.Query("channel"))
132 group := c.Query("group")
133 quotaNum := model.SumUsedQuota(logType, startTimestamp, endTimestamp, modelName, username, tokenName, channel, group)
134 //tokenNum := model.SumUsedToken(logType, startTimestamp, endTimestamp, modelName, username, tokenName)
135 c.JSON(200, gin.H{
136 "success": true,
137 "message": "",
138 "data": gin.H{
139 "quota": quotaNum.Quota,
140 "rpm": quotaNum.Rpm,
141 "tpm": quotaNum.Tpm,
142 //"token": tokenNum,
143 },
144 })
145 return
146}
147
148func DeleteHistoryLogs(c *gin.Context) {
149 // 获取开始和结束时间戳参数

Callers

nothing calls this directly

Calls 1

SumUsedQuotaFunction · 0.92

Tested by

no test coverage detected