Spaces:
Sleeping
Sleeping
File size: 17,429 Bytes
0b355ec | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 | const { validationResult } = require('express-validator');
const knowledgeBaseService = require('../services/knowledgeBaseService');
const ugaService = require('../services/ugaService');
const logger = require('../utils/logger');
class UGAController {
async searchKnowledge(req, res) {
try {
const errors = validationResult(req);
if (!errors.isEmpty()) {
return res.status(400).json({
success: false,
errors: errors.array()
});
}
const { q: query, category = 'all' } = req.query;
const results = await knowledgeBaseService.queryKnowledgeBase(query, category);
res.json({
success: true,
data: {
query,
category,
results,
count: results.length
}
});
} catch (error) {
logger.error('Knowledge search error:', error);
res.status(500).json({
success: false,
error: 'Failed to search knowledge base'
});
}
}
async getCampusBuildings(req, res) {
try {
const buildings = {
academic: [
{ name: 'Miller Learning Center', purpose: '24/7 study space, computer labs', location: 'North Campus' },
{ name: 'Main Library', purpose: 'Primary library, archives', location: 'North Campus' },
{ name: 'Science Library', purpose: 'Science resources, group study', location: 'South Campus' },
{ name: 'Correll Hall', purpose: 'Terry College of Business', location: 'South Campus' },
{ name: 'Grady College', purpose: 'Journalism and Mass Communication', location: 'North Campus' },
{ name: 'Driftmier Engineering Center', purpose: 'Engineering programs', location: 'South Campus' }
],
administrative: [
{ name: 'Administration Building', purpose: 'University administration', location: 'North Campus' },
{ name: 'Terrell Hall', purpose: 'Financial Aid Office', location: 'North Campus' },
{ name: 'Lustrat House', purpose: 'Student Accounts', location: 'North Campus' }
],
student: [
{ name: 'Tate Student Center', purpose: 'Dining, bookstore, organizations', location: 'North Campus' },
{ name: 'Ramsey Student Center', purpose: 'Recreation and fitness', location: 'South Campus' },
{ name: 'University Health Center', purpose: 'Student health services', location: 'East Campus' }
],
athletics: [
{ name: 'Sanford Stadium', purpose: 'Football stadium', capacity: '92,746' },
{ name: 'Stegeman Coliseum', purpose: 'Basketball arena', capacity: '10,523' },
{ name: 'Foley Field', purpose: 'Baseball stadium', capacity: '3,291' }
]
};
res.json({
success: true,
data: buildings
});
} catch (error) {
logger.error('Get campus buildings error:', error);
res.status(500).json({
success: false,
error: 'Failed to fetch campus buildings'
});
}
}
async getDiningOptions(req, res) {
try {
const dining = {
diningHalls: [
{ name: 'The Niche', location: 'Memorial Hall', type: 'All-you-can-eat', hours: '7 AM - 11 PM' },
{ name: 'ECV Dining Commons', location: 'East Campus Village', type: 'All-you-can-eat', hours: '7 AM - 10 PM' },
{ name: 'Village Summit Food Court', location: 'Village Summit', type: 'Food court', hours: '7 AM - 12 AM' },
{ name: 'O-House Dining', location: 'Oglethorpe House', type: 'All-you-can-eat', hours: '7 AM - 10 PM' }
],
cafes: [
{ name: 'Bulldog Cafe', location: 'Miller Learning Center', specialty: 'Coffee, light meals' },
{ name: 'Starbucks', location: 'Tate Student Center', specialty: 'Coffee, pastries' },
{ name: 'Einstein Bros', location: 'Various locations', specialty: 'Bagels, coffee' }
],
restaurants: [
{ name: 'Chick-fil-A', location: 'Tate Student Center', type: 'Fast food' },
{ name: 'Panda Express', location: 'Tate Student Center', type: 'Asian fast food' },
{ name: 'Subway', location: 'Multiple locations', type: 'Sandwiches' }
]
};
res.json({
success: true,
data: dining
});
} catch (error) {
logger.error('Get dining options error:', error);
res.status(500).json({
success: false,
error: 'Failed to fetch dining options'
});
}
}
async getRecreationFacilities(req, res) {
try {
const recreation = {
ramseyCenter: {
name: 'Ramsey Student Center',
facilities: [
'Fitness equipment and free weights',
'25-yard swimming pool',
'Basketball and volleyball courts',
'Racquetball courts',
'Rock climbing wall',
'Group fitness studios',
'Outdoor recreation equipment rental'
],
hours: 'M-F: 5:30 AM - 12:00 AM, Weekends vary',
programs: ['Group fitness classes', 'Intramural sports', 'Personal training', 'Outdoor trips']
},
outdoorFacilities: [
{ name: 'Intramural Fields', activities: ['Flag football', 'Soccer', 'Ultimate frisbee'] },
{ name: 'Tennis Courts', location: 'Various campus locations', courts: '20+ courts' },
{ name: 'Golf Course', name: 'University of Georgia Golf Course', type: '18-hole championship course' }
],
programs: {
intramural: ['Flag football', 'Basketball', 'Soccer', 'Softball', 'Tennis', 'Swimming'],
clubSports: ['Rugby', 'Lacrosse', 'Cycling', 'Martial arts', 'Rock climbing'],
outdoorRecreation: ['Hiking', 'Camping', 'Kayaking', 'Rock climbing', 'Skiing trips']
}
};
res.json({
success: true,
data: recreation
});
} catch (error) {
logger.error('Get recreation facilities error:', error);
res.status(500).json({
success: false,
error: 'Failed to fetch recreation facilities'
});
}
}
async getAthensNeighborhoods(req, res) {
try {
const neighborhoods = {
downtown: {
description: 'Historic downtown with shops, restaurants, nightlife',
highlights: ['Georgia Theatre', 'Classic Center', 'Walking distance to campus'],
housing: 'Limited, mostly lofts and apartments',
character: 'Urban, bustling, historic'
},
fivePoints: {
description: 'Popular student area with bars and restaurants',
highlights: ['The World Famous', 'Copper Creek', 'Late night food'],
housing: 'Student apartments and houses',
character: 'College party scene, very walkable'
},
normaltown: {
description: 'Hip neighborhood east of downtown',
highlights: ['40 Watt Club', 'Local shops', 'The Grit restaurant'],
housing: 'Mix of apartments and houses',
character: 'Artsy, local music scene'
},
boulevard: {
description: 'Close to campus, mix of student and family housing',
highlights: ['Easy campus access', 'Quieter than Five Points'],
housing: 'Student apartments and rental houses',
character: 'Residential, convenient'
},
westside: {
description: 'Growing area with shopping and dining',
highlights: ['Atlanta Highway shopping', 'Chain restaurants'],
housing: 'New apartment complexes',
character: 'Suburban feel, car-dependent'
}
};
res.json({
success: true,
data: neighborhoods
});
} catch (error) {
logger.error('Get Athens neighborhoods error:', error);
res.status(500).json({
success: false,
error: 'Failed to fetch Athens neighborhoods'
});
}
}
async getStudentOrganizations(req, res) {
try {
const organizations = {
categories: {
academic: {
description: 'Professional organizations related to majors',
examples: ['Accounting Club', 'Engineering Student Council', 'Pre-Med Society', 'Journalism Club']
},
cultural: {
description: 'Organizations celebrating different cultures',
examples: ['International Student Life', 'Black Student Union', 'Hispanic Student Association', 'Asian Student Association']
},
religious: {
description: 'Faith-based organizations and ministries',
examples: ['Baptist Student Union', 'Catholic Student Association', 'Hillel', 'Muslim Student Association']
},
service: {
description: 'Community service and volunteer organizations',
examples: ['Habitat for Humanity', 'Circle K', 'Alpha Phi Omega', 'Relay for Life']
},
special: {
description: 'Special interest and hobby groups',
examples: ['Outdoor Recreation', 'Gaming Club', 'Chess Club', 'Photography Club']
},
greek: {
description: 'Fraternity and sorority life',
stats: {
participation: '25% of students',
chapters: '70+ chapters',
types: ['IFC', 'Panhellenic', 'NPHC', 'Multicultural']
}
}
},
totalOrganizations: '600+',
howToJoin: 'Involvement fair, organization websites, campus events',
benefits: ['Leadership opportunities', 'Social connections', 'Resume building', 'Community service']
};
res.json({
success: true,
data: organizations
});
} catch (error) {
logger.error('Get student organizations error:', error);
res.status(500).json({
success: false,
error: 'Failed to fetch student organizations'
});
}
}
async getUGATraditions(req, res) {
try {
const traditions = {
academic: [
{
name: 'The Arch',
description: 'Students traditionally don\'t walk under the Arch until graduation',
significance: 'Symbol of academic journey'
},
{
name: 'Ring Ceremony',
description: 'Junior year tradition celebrating academic progress',
when: 'Spring semester of junior year'
},
{
name: 'Dawg Days',
description: 'Orientation for new students',
when: 'Before fall semester'
}
],
athletic: [
{
name: 'Calling the Dawgs',
description: 'Crowd chant: "Goooooo Dawgs! Sic \'em! Woof woof woof!"',
when: 'At all athletic events'
},
{
name: 'The Dawg Walk',
description: 'Team walks through campus before home football games',
when: '2 hours before kickoff'
},
{
name: 'Between the Hedges',
description: 'Sanford Stadium\'s famous privet hedges',
significance: 'Unique stadium feature since 1929'
},
{
name: 'Ringing the Chapel Bell',
description: 'Bell rings after football victories',
tradition: 'Students gather to celebrate wins'
}
],
social: [
{
name: 'SpringFest',
description: 'Annual spring concert and festival',
when: 'Spring semester'
},
{
name: 'Homecoming',
description: 'Week of events celebrating UGA',
activities: ['Parade', 'Alumni events', 'Football game']
},
{
name: 'Wild Rumpus',
description: 'Halloween parade in downtown Athens',
participation: 'Students and community'
}
]
};
res.json({
success: true,
data: traditions
});
} catch (error) {
logger.error('Get UGA traditions error:', error);
res.status(500).json({
success: false,
error: 'Failed to fetch UGA traditions'
});
}
}
async getEmergencyInfo(req, res) {
try {
const emergency = {
emergencyNumbers: {
campusPolice: '706-542-2200',
ugaEmergency: '911 or 706-542-2200',
healthCenter: '706-542-1162',
counselingServices: '706-542-2273',
afterHoursCrisis: '706-542-2273'
},
procedures: {
medical: 'Call 911 for medical emergencies, University Health Center for non-emergency health issues',
safety: 'Use blue light emergency phones, escort services available',
weather: 'Follow UGA alerts, seek shelter in designated areas',
campusClosure: 'University will announce closures via UGA Alert system'
},
resources: {
ugaAlert: 'Emergency notification system via text/email',
escortService: 'Safe rides and walks available 24/7',
bluePhones: 'Emergency phones throughout campus',
safetyApp: 'UGA Safe mobile app for emergencies'
}
};
res.json({
success: true,
data: emergency
});
} catch (error) {
logger.error('Get emergency info error:', error);
res.status(500).json({
success: false,
error: 'Failed to fetch emergency information'
});
}
}
// Additional controller methods would be implemented here
async getLibraries(req, res) {
try {
res.json({ success: true, message: 'Libraries endpoint - to be implemented' });
} catch (error) {
res.status(500).json({ success: false, error: 'Method not implemented' });
}
}
async getParkingInfo(req, res) {
try {
res.json({ success: true, message: 'Parking info endpoint - to be implemented' });
} catch (error) {
res.status(500).json({ success: false, error: 'Method not implemented' });
}
}
async getAthensRestaurants(req, res) {
try {
res.json({ success: true, message: 'Athens restaurants endpoint - to be implemented' });
} catch (error) {
res.status(500).json({ success: false, error: 'Method not implemented' });
}
}
async getAthensTransportation(req, res) {
try {
res.json({ success: true, message: 'Athens transportation endpoint - to be implemented' });
} catch (error) {
res.status(500).json({ success: false, error: 'Method not implemented' });
}
}
async getAthensEntertainment(req, res) {
try {
res.json({ success: true, message: 'Athens entertainment endpoint - to be implemented' });
} catch (error) {
res.status(500).json({ success: false, error: 'Method not implemented' });
}
}
async getColleges(req, res) {
try {
res.json({ success: true, message: 'Colleges endpoint - to be implemented' });
} catch (error) {
res.status(500).json({ success: false, error: 'Method not implemented' });
}
}
async getAcademicCalendar(req, res) {
try {
res.json({ success: true, message: 'Academic calendar endpoint - to be implemented' });
} catch (error) {
res.status(500).json({ success: false, error: 'Method not implemented' });
}
}
async getGraduationRequirements(req, res) {
try {
res.json({ success: true, message: 'Graduation requirements endpoint - to be implemented' });
} catch (error) {
res.status(500).json({ success: false, error: 'Method not implemented' });
}
}
async getGreekLife(req, res) {
try {
res.json({ success: true, message: 'Greek life endpoint - to be implemented' });
} catch (error) {
res.status(500).json({ success: false, error: 'Method not implemented' });
}
}
async getAthleticsSchedule(req, res) {
try {
res.json({ success: true, message: 'Athletics schedule endpoint - to be implemented' });
} catch (error) {
res.status(500).json({ success: false, error: 'Method not implemented' });
}
}
async getAthleticsFacilities(req, res) {
try {
res.json({ success: true, message: 'Athletics facilities endpoint - to be implemented' });
} catch (error) {
res.status(500).json({ success: false, error: 'Method not implemented' });
}
}
async getAthleticsTraditions(req, res) {
try {
res.json({ success: true, message: 'Athletics traditions endpoint - to be implemented' });
} catch (error) {
res.status(500).json({ success: false, error: 'Method not implemented' });
}
}
async getSafetyContacts(req, res) {
try {
res.json({ success: true, message: 'Safety contacts endpoint - to be implemented' });
} catch (error) {
res.status(500).json({ success: false, error: 'Method not implemented' });
}
}
async getCampusEvents(req, res) {
try {
res.json({ success: true, message: 'Campus events endpoint - to be implemented' });
} catch (error) {
res.status(500).json({ success: false, error: 'Method not implemented' });
}
}
async getAthensEvents(req, res) {
try {
res.json({ success: true, message: 'Athens events endpoint - to be implemented' });
} catch (error) {
res.status(500).json({ success: false, error: 'Method not implemented' });
}
}
}
module.exports = new UGAController(); |