package service import ( "confrontation-training/global" "confrontation-training/models" ) type AnswerService struct { } func (a *AnswerService) CreateNewAnswer(param models.CreateAnswer) (models.Answer, int64) { answer := models.Answer{ Answer: param.Answer, QuestionId: param.QuestionId, NextQuestionId: param.NextQuestionId, } count := global.Db.Create(&answer).RowsAffected return answer, count }