(c *gin.Context)
| 31 | } |
| 32 | |
| 33 | func GetUserLogs(c *gin.Context) { |
| 34 | pageInfo := common.GetPageQuery(c) |
| 35 | userId := c.GetInt("id") |
| 36 | logType, _ := strconv.Atoi(c.Query("type")) |
| 37 | startTimestamp, _ := strconv.ParseInt(c.Query("start_timestamp"), 10, 64) |
| 38 | endTimestamp, _ := strconv.ParseInt(c.Query("end_timestamp"), 10, 64) |
| 39 | tokenName := c.Query("token_name") |
| 40 | modelName := c.Query("model_name") |
| 41 | group := c.Query("group") |
| 42 | logs, total, err := model.GetUserLogs(userId, logType, startTimestamp, endTimestamp, modelName, tokenName, pageInfo.GetStartIdx(), pageInfo.GetPageSize(), group) |
| 43 | if err != nil { |
| 44 | common.ApiError(c, err) |
| 45 | return |
| 46 | } |
| 47 | pageInfo.SetTotal(int(total)) |
| 48 | pageInfo.SetItems(logs) |
| 49 | common.ApiSuccess(c, pageInfo) |
| 50 | return |
| 51 | } |
| 52 | |
| 53 | func SearchAllLogs(c *gin.Context) { |
| 54 | keyword := c.Query("keyword") |
nothing calls this directly
no test coverage detected