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

Function GetAllLogs

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

Source from the content-addressed store, hash-verified

10)
11
12func 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
33func GetUserLogs(c *gin.Context) {
34 pageInfo := common.GetPageQuery(c)

Callers

nothing calls this directly

Calls 8

GetPageQueryFunction · 0.92
GetAllLogsFunction · 0.92
ApiErrorFunction · 0.92
ApiSuccessFunction · 0.92
GetStartIdxMethod · 0.80
GetPageSizeMethod · 0.80
SetTotalMethod · 0.80
SetItemsMethod · 0.80

Tested by

no test coverage detected