(c *gin.Context)
| 99 | } |
| 100 | |
| 101 | func GetLogsStat(c *gin.Context) { |
| 102 | logType, _ := strconv.Atoi(c.Query("type")) |
| 103 | startTimestamp, _ := strconv.ParseInt(c.Query("start_timestamp"), 10, 64) |
| 104 | endTimestamp, _ := strconv.ParseInt(c.Query("end_timestamp"), 10, 64) |
| 105 | tokenName := c.Query("token_name") |
| 106 | username := c.Query("username") |
| 107 | modelName := c.Query("model_name") |
| 108 | channel, _ := strconv.Atoi(c.Query("channel")) |
| 109 | group := c.Query("group") |
| 110 | stat := model.SumUsedQuota(logType, startTimestamp, endTimestamp, modelName, username, tokenName, channel, group) |
| 111 | //tokenNum := model.SumUsedToken(logType, startTimestamp, endTimestamp, modelName, username, "") |
| 112 | c.JSON(http.StatusOK, gin.H{ |
| 113 | "success": true, |
| 114 | "message": "", |
| 115 | "data": gin.H{ |
| 116 | "quota": stat.Quota, |
| 117 | "rpm": stat.Rpm, |
| 118 | "tpm": stat.Tpm, |
| 119 | }, |
| 120 | }) |
| 121 | return |
| 122 | } |
| 123 | |
| 124 | func GetLogsSelfStat(c *gin.Context) { |
| 125 | username := c.GetString("username") |
nothing calls this directly
no test coverage detected