Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created mentor endpoints #573

Merged
merged 3 commits into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions HIAPI/Models/Mentor.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// MentorService.swift
// HackIllinois
//
// Created by HackIllinois Team on 2/10/24.
// Copyright © 2024 HackIllinois. All rights reserved.
// This file is part of the Hackillinois iOS App.
// The Hackillinois iOS App is open source software, released under the University of
// Illinois/NCSA Open Source License. You should have received a copy of
// this license in a file with the distribution.
//

import Foundation
import APIManager

public struct MentorAttendanceContainer: Codable, APIReturnable {
public let status: String
}
29 changes: 29 additions & 0 deletions HIAPI/Services/MentorService.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// MentorService.swift
// HackIllinois
//
// Created by HackIllinois Team on 2/10/24.
// Copyright © 2024 HackIllinois. All rights reserved.
// This file is part of the Hackillinois iOS App.
// The Hackillinois iOS App is open source software, released under the University of
// Illinois/NCSA Open Source License. You should have received a copy of
// this license in a file with the distribution.
//

import Foundation
import APIManager

public final class MentorService: BaseService {
public override static var baseURL: String {
return super.baseURL + "mentor/"
}

public static func recordMentorAttendance(userToken: String, mentorId: String) -> APIRequest<MentorAttendanceContainer> {
var headers = HTTPHeaders()
headers["Authorization"] = userToken
var body = HTTPBody()
body["mentorId"] = userToken
return APIRequest<MentorAttendanceContainer>(service: self, endpoint: "attendance/", body: body, headers: headers, method: .POST)
}

}
8 changes: 8 additions & 0 deletions HackIllinois.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@
D12B40FF2AC0B0BD001BCB05 /* HIScanAttendanceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12B40FE2AC0B0BD001BCB05 /* HIScanAttendanceViewController.swift */; };
D134D30F296B3F56006EA589 /* Montserrat-VariableFont_wght.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D134D30E296B3F56006EA589 /* Montserrat-VariableFont_wght.ttf */; };
D14D3AE3295FBDA200EB7995 /* HIBannerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D14D3AE2295FBDA100EB7995 /* HIBannerViewController.swift */; };
D187BF5A2B78317600AD7356 /* Mentor.swift in Sources */ = {isa = PBXBuildFile; fileRef = D187BF592B78317600AD7356 /* Mentor.swift */; };
D187BF5C2B78318000AD7356 /* MentorService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D187BF5B2B78318000AD7356 /* MentorService.swift */; };
D1BE81172AC8FC680042C078 /* HIAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 95E3142A21FAD5B30092C22E /* HIAPI.framework */; };
D1BE81182AC8FC690042C078 /* HIAPI.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 95E3142A21FAD5B30092C22E /* HIAPI.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
D1C5B6582B732E44000E766D /* refresh.json in Resources */ = {isa = PBXBuildFile; fileRef = D1C5B6572B732E44000E766D /* refresh.json */; };
Expand Down Expand Up @@ -343,6 +345,8 @@
D12B40FE2AC0B0BD001BCB05 /* HIScanAttendanceViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HIScanAttendanceViewController.swift; sourceTree = "<group>"; };
D134D30E296B3F56006EA589 /* Montserrat-VariableFont_wght.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Montserrat-VariableFont_wght.ttf"; sourceTree = "<group>"; };
D14D3AE2295FBDA100EB7995 /* HIBannerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HIBannerViewController.swift; sourceTree = "<group>"; };
D187BF592B78317600AD7356 /* Mentor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Mentor.swift; sourceTree = "<group>"; };
D187BF5B2B78318000AD7356 /* MentorService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MentorService.swift; sourceTree = "<group>"; };
D1C5B6572B732E44000E766D /* refresh.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = refresh.json; sourceTree = "<group>"; };
D1F146392B605C57004E7FC9 /* Hack_Mushroom_Loading.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = Hack_Mushroom_Loading.json; sourceTree = "<group>"; };
D3A309BA221116A600CBA351 /* HackIllinois.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = HackIllinois.entitlements; sourceTree = "<group>"; };
Expand Down Expand Up @@ -704,6 +708,7 @@
95E3146121FAF1740092C22E /* BaseService.swift */,
95B12042220BEA9D00E024BB /* CheckInService.swift */,
95E3145F21FAF1740092C22E /* EventService.swift */,
D187BF5B2B78318000AD7356 /* MentorService.swift */,
AC3B620F25E85D18002386A2 /* ProfileService.swift */,
95E3145C21FAF1740092C22E /* PassService.swift */,
95E3146321FAF1740092C22E /* RegistrationService.swift */,
Expand All @@ -727,6 +732,7 @@
AC3B620D25E85CAD002386A2 /* Profile.swift */,
95E3146621FAF1740092C22E /* SimpleRequest.swift */,
95E3146721FAF1740092C22E /* User.swift */,
D187BF592B78317600AD7356 /* Mentor.swift */,
3C26401C23ADE8A5004E1DBE /* Project.swift */,
3C8F62D3238F9639001A5DAF /* Time.swift */,
ACB53AE6261B874A007B1643 /* Interest.swift */,
Expand Down Expand Up @@ -1146,10 +1152,12 @@
95E3146A21FAF1740092C22E /* AnnouncementService.swift in Sources */,
95E3147221FAF1740092C22E /* RegistrationService.swift in Sources */,
95E3147421FAF1740092C22E /* SimpleRequest.swift in Sources */,
D187BF5C2B78318000AD7356 /* MentorService.swift in Sources */,
2FA73B502B58CAC3002658C0 /* Item.swift in Sources */,
A5163FED221F283C003C543E /* StatsService.swift in Sources */,
95B12045220BEAD700E024BB /* TrackingService.swift in Sources */,
3C8F62D6238F9825001A5DAF /* TimeService.swift in Sources */,
D187BF5A2B78317600AD7356 /* Mentor.swift in Sources */,
95E3145921FAD71E0092C22E /* Error.swift in Sources */,
3C26401D23ADE8A5004E1DBE /* Project.swift in Sources */,
);
Expand Down
Loading