Skip to content

Commit

Permalink
fix: fix compile err
Browse files Browse the repository at this point in the history
  • Loading branch information
setcy committed Jun 10, 2023
1 parent aaf2152 commit bdf87eb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions campusapis/teaching/v1/query.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
package teachingv1

import (
"context"
"errors"

"github.com/hduhelp/api_open_sdk/campusapis/schoolTime"
"github.com/hduhelp/api_open_sdk/campusapis/staff"
)

type CourseQuery struct {
ctx context.Context

QueryStaff *staff.Staff
Queries []Queryable

Expand All @@ -30,7 +33,7 @@ func (q CourseQuery) GetOptionShowMemberOption() OptionShowMember {
}

type Queryable interface {
GetCourses(staff *staff.Staff, semester *schoolTime.Semester, schoolYear *schoolTime.SchoolYear) ([]CourseReader, error)
GetCourses(ctx context.Context, staff *staff.Staff, semester *schoolTime.Semester, schoolYear *schoolTime.SchoolYear) ([]CourseReader, error)
}

func NewCourseQuery(staff *staff.Staff, st *schoolTime.SchoolDate, q ...Queryable) *CourseQuery {
Expand All @@ -55,7 +58,7 @@ func (q *CourseQuery) GetCourses() (*CourseQuery, error) {
//从课程信息接口查询对应学期课程信息
q.Courses = make([]CourseReader, 0)
for _, v := range q.Queries {
courses, err := v.GetCourses(q.QueryStaff, q.SchoolDate.Semester, q.SchoolDate.SchoolYear)
courses, err := v.GetCourses(q.ctx, q.QueryStaff, q.SchoolDate.Semester, q.SchoolDate.SchoolYear)
if err != nil {
return q, err
}
Expand Down

0 comments on commit bdf87eb

Please sign in to comment.