mstar-webserver/storage/models/link.go
mstar 2920dcbfec
Some checks failed
/ docker (push) Failing after 58s
Add counting for link visits
Because funny
2025-03-24 18:05:27 +01:00

21 lines
351 B
Go

package models
import (
"gorm.io/gorm"
)
type Link struct {
gorm.Model
Link string
Count uint64
}
type ILink interface {
// UPDATE @@table SET count = count + 1 WHERE link = @link
// If (NOT EXISTS(SELECT * FROM @@table WHERE link = @link))
// BEGIN
// INSERT INTO @@table(@link)
// IncrementLinkCount(link string) ([]gen.T, error)
}