-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
1,046 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package db | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/rs/zerolog/log" | ||
"go.mongodb.org/mongo-driver/bson" | ||
) | ||
|
||
type MucDaiExam struct { | ||
PrimussAncode int `bson:"Nr"` | ||
Module string `bson:"Modulname"` | ||
ExamType string `bson:"Prüfungsform"` | ||
Grading string `bson:"Bewertung"` | ||
Duration int `bson:"Dauer"` | ||
MainExamer string `bson:"Erstpruefender"` | ||
SecondExamer string `bson:"Zweitpruefender"` | ||
IsRepeaterExam string `bson:"IstWiederholung"` | ||
Program string `bson:"Studiengruppe"` | ||
Planer string `bson:"Prüfungsplanung"` | ||
} | ||
|
||
func (db *DB) MucDaiExamsForProgram(ctx context.Context, program string) ([]*MucDaiExam, error) { | ||
collection := db.getMucDaiCollection(program) | ||
|
||
cur, err := collection.Find(ctx, bson.D{}) | ||
if err != nil { | ||
log.Error().Err(err).Str("program", program).Msg("cannot get exams for MUC.DAI program") | ||
return nil, err | ||
} | ||
defer cur.Close(ctx) | ||
|
||
exams := make([]*MucDaiExam, 0) | ||
err = cur.All(ctx, &exams) | ||
if err != nil { | ||
log.Error().Err(err).Str("program", program).Msg("cannot decode exams for MUC.DAI program") | ||
return nil, err | ||
} | ||
|
||
return exams, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.