package
0.0.0-20231018214133-0b8e4f06e59d
Repository: https://github.com/kronborg6/simsvendapi.git
Documentation: pkg.go.dev
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
func (repo *MatchRepo) SetGameScore(Score models.Results) (models.Results, error) {
var game models.Results
var match models.Match
if err := repo.db.Debug().Where("id = ?", Score.MatchID).Find(&match).Error; err != nil {
return game, err
}
if match.Don {
return game, errors.New("game is allready don")
}
if err := repo.db.Debug().Model(&Score).Where("match_id = ?", Score.MatchID).Updates(&Score).Error; err != nil {
return game, err
}
match.Don = true
if err := repo.db.Debug().Model(&match).Where("id = ?", Score.MatchID).Updates(&match).Error; err != nil {
return game, err
}
return game, nil
}
*/
func (repo *MatchRepo) NewCasualGame(game models.Matchs) (models.Matchs, error) {
// var game models.Matchs
if err := repo.db.Create(&game).Error; err != nil {
return game, err
}
return game, nil
}
func (repo *MatchRepo) AddResualtCasualGame(game models.Matchs) (models.Matchs, error) {
if err := repo.db.Model(&game).Where("id = ?", game.ID).Updates(&game).Error; err != nil {
return game, nil
}
return game, nil
}
*/.
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author