feat: support batch creation of channels (close #58)

This commit is contained in:
JustSong
2023-05-13 17:08:13 +08:00
parent 5798fdac50
commit dc4a6cb711
3 changed files with 52 additions and 12 deletions

View File

@@ -53,6 +53,12 @@ func GetRandomChannel() (*Channel, error) {
return &channel, err
}
func BatchInsertChannels(channels []Channel) error {
var err error
err = DB.Create(&channels).Error
return err
}
func (channel *Channel) Insert() error {
var err error
err = DB.Create(channel).Error