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

Function GetUserLogs

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

Source from the content-addressed store, hash-verified

31}
32
33func 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
53func SearchAllLogs(c *gin.Context) {
54 keyword := c.Query("keyword")

Callers

nothing calls this directly

Calls 8

GetPageQueryFunction · 0.92
GetUserLogsFunction · 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