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

Function GetUserMidjourney

controller/midjourney.go:240–263  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

238}
239
240func GetUserMidjourney(c *gin.Context) {
241 pageInfo := common.GetPageQuery(c)
242
243 userId := c.GetInt("id")
244
245 queryParams := model.TaskQueryParams{
246 MjID: c.Query("mj_id"),
247 StartTimestamp: c.Query("start_timestamp"),
248 EndTimestamp: c.Query("end_timestamp"),
249 }
250
251 items := model.GetAllUserTask(userId, pageInfo.GetStartIdx(), pageInfo.GetPageSize(), queryParams)
252 total := model.CountAllUserTask(userId, queryParams)
253
254 if setting.MjForwardUrlEnabled {
255 for i, midjourney := range items {
256 midjourney.ImageUrl = setting.ServerAddress + "/mj/image/" + midjourney.MjId
257 items[i] = midjourney
258 }
259 }
260 pageInfo.SetTotal(int(total))
261 pageInfo.SetItems(items)
262 common.ApiSuccess(c, pageInfo)
263}

Callers

nothing calls this directly

Calls 8

GetPageQueryFunction · 0.92
GetAllUserTaskFunction · 0.92
CountAllUserTaskFunction · 0.92
ApiSuccessFunction · 0.92
GetStartIdxMethod · 0.80
GetPageSizeMethod · 0.80
SetTotalMethod · 0.80
SetItemsMethod · 0.80

Tested by

no test coverage detected