(c *gin.Context)
| 122 | } |
| 123 | |
| 124 | func 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 | |
| 148 | func DeleteHistoryLogs(c *gin.Context) { |
| 149 | // 获取开始和结束时间戳参数 |
nothing calls this directly
no test coverage detected