luma create and list api is ready

This commit is contained in:
RockYang
2024-09-02 18:08:50 +08:00
parent dfc6c87250
commit 2e5bd238b7
9 changed files with 311 additions and 115 deletions

View File

@@ -166,8 +166,8 @@ func (h *SunoHandler) Create(c *gin.Context) {
func (h *SunoHandler) List(c *gin.Context) {
userId := h.GetLoginUserId(c)
page := h.GetInt(c, "page", 0)
pageSize := h.GetInt(c, "page_size", 0)
page := h.GetInt(c, "page", 1)
pageSize := h.GetInt(c, "page_size", 20)
session := h.DB.Session(&gorm.Session{}).Where("user_id", userId)
// 统计总数