Attachment has pool

This commit is contained in:
2024-08-18 14:09:52 +08:00
parent dd0f7399a6
commit a82fb3a49c
11 changed files with 102 additions and 32 deletions

View File

@@ -21,6 +21,14 @@ func GetAttachmentPool(id uint) (models.AttachmentPool, error) {
return pool, nil
}
func GetAttachmentPoolByAlias(alias string) (models.AttachmentPool, error) {
var pool models.AttachmentPool
if err := database.C.Where("alias = ?", alias).First(&pool).Error; err != nil {
return pool, err
}
return pool, nil
}
func GetAttachmentPoolWithUser(id uint, userId uint) (models.AttachmentPool, error) {
var pool models.AttachmentPool
if err := database.C.Where("id = ? AND account_id = ?", id, userId).First(&pool).Error; err != nil {