(c *gin.Context)
| 10 | ) |
| 11 | |
| 12 | func GetAllLogs(c *gin.Context) { |
| 13 | pageInfo := common.GetPageQuery(c) |
| 14 | logType, _ := strconv.Atoi(c.Query("type")) |
| 15 | startTimestamp, _ := strconv.ParseInt(c.Query("start_timestamp"), 10, 64) |
| 16 | endTimestamp, _ := strconv.ParseInt(c.Query("end_timestamp"), 10, 64) |
| 17 | username := c.Query("username") |
| 18 | tokenName := c.Query("token_name") |
| 19 | modelName := c.Query("model_name") |
| 20 | channel, _ := strconv.Atoi(c.Query("channel")) |
| 21 | group := c.Query("group") |
| 22 | logs, total, err := model.GetAllLogs(logType, startTimestamp, endTimestamp, modelName, username, tokenName, pageInfo.GetStartIdx(), pageInfo.GetPageSize(), channel, group) |
| 23 | if err != nil { |
| 24 | common.ApiError(c, err) |
| 25 | return |
| 26 | } |
| 27 | pageInfo.SetTotal(int(total)) |
| 28 | pageInfo.SetItems(logs) |
| 29 | common.ApiSuccess(c, pageInfo) |
| 30 | return |
| 31 | } |
| 32 | |
| 33 | func GetUserLogs(c *gin.Context) { |
| 34 | pageInfo := common.GetPageQuery(c) |
nothing calls this directly
no test coverage detected