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

Function GetAllMidjourney

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

Source from the content-addressed store, hash-verified

213}
214
215func GetAllMidjourney(c *gin.Context) {
216 pageInfo := common.GetPageQuery(c)
217
218 // 解析其他查询参数
219 queryParams := model.TaskQueryParams{
220 ChannelID: c.Query("channel_id"),
221 MjID: c.Query("mj_id"),
222 StartTimestamp: c.Query("start_timestamp"),
223 EndTimestamp: c.Query("end_timestamp"),
224 }
225
226 items := model.GetAllTasks(pageInfo.GetStartIdx(), pageInfo.GetPageSize(), queryParams)
227 total := model.CountAllTasks(queryParams)
228
229 if setting.MjForwardUrlEnabled {
230 for i, midjourney := range items {
231 midjourney.ImageUrl = setting.ServerAddress + "/mj/image/" + midjourney.MjId
232 items[i] = midjourney
233 }
234 }
235 pageInfo.SetTotal(int(total))
236 pageInfo.SetItems(items)
237 common.ApiSuccess(c, pageInfo)
238}
239
240func GetUserMidjourney(c *gin.Context) {
241 pageInfo := common.GetPageQuery(c)

Callers

nothing calls this directly

Calls 8

GetPageQueryFunction · 0.92
GetAllTasksFunction · 0.92
CountAllTasksFunction · 0.92
ApiSuccessFunction · 0.92
GetStartIdxMethod · 0.80
GetPageSizeMethod · 0.80
SetTotalMethod · 0.80
SetItemsMethod · 0.80

Tested by

no test coverage detected