├── .editorconfig ├── .github ├── ISSUE_TEMPLATE │ ├── BUG_REPORT.md │ ├── FEATURE.md │ └── NEW_FEATURE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── README.md ├── flyway.example.properties ├── pom.xml └── src └── main ├── java └── koreatech │ └── in │ ├── annotation │ ├── ApiOff.java │ ├── Auth.java │ ├── AuthExcept.java │ ├── AuthTemporary.java │ ├── Login.java │ ├── OwnerRegistrationInfomation.java │ ├── ParamValid.java │ ├── ValidationGroups.java │ └── XssFilter.java │ ├── aop │ ├── SlackCrash.java │ ├── ValidParameters.java │ └── XssPrevent.java │ ├── argumentresolver │ └── UserArgumentResolver.java │ ├── config │ └── WebConfig.java │ ├── controller │ ├── ActivityController.java │ ├── BusController.java │ ├── CalendarController.java │ ├── CallvanController.java │ ├── CircleController.java │ ├── CommunityController.java │ ├── DeptController.java │ ├── DiningController.java │ ├── EventController.java │ ├── FaqController.java │ ├── GlobalExceptionHandler.java │ ├── KakaoBotController.java │ ├── LandController.java │ ├── LostAndFoundController.java │ ├── MarketPlaceController.java │ ├── MemberController.java │ ├── OwnerController.java │ ├── OwnerShopController.java │ ├── PageResourceController.java │ ├── SampleController.java │ ├── SearchController.java │ ├── ShopController.java │ ├── SlackBotController.java │ ├── TemporaryCommunityController.java │ ├── TimeTableController.java │ ├── TrackController.java │ ├── UploadController.java │ ├── UserController.java │ ├── VersionController.java │ └── admin │ │ ├── AdminActivityController.java │ │ ├── AdminCalendarController.java │ │ ├── AdminCallvanController.java │ │ ├── AdminCircleController.java │ │ ├── AdminCommunityController.java │ │ ├── AdminFaqController.java │ │ ├── AdminLandController.java │ │ ├── AdminLostAndFoundController.java │ │ ├── AdminMarketPlaceController.java │ │ ├── AdminMemberController.java │ │ ├── AdminPageResourceController.java │ │ ├── AdminShopController.java │ │ ├── AdminTrackController.java │ │ ├── AdminUserController.java │ │ └── AdminVersionController.java │ ├── converter │ └── DomainEnumConvertor.java │ ├── domain │ ├── Auth │ │ ├── JWTKeys.java │ │ ├── LoginResult.java │ │ ├── RefreshResult.java │ │ └── RefreshToken.java │ ├── Authority.java │ ├── BeanSerializer.java │ ├── BokDuck │ │ ├── Land.java │ │ ├── LandComment.java │ │ └── LandResponseType.java │ ├── Bus │ │ ├── Bus.java │ │ ├── BusNodeEnum.java │ │ ├── BusRemainTime.java │ │ ├── BusTerminalEnum.java │ │ ├── BusTimetable.java │ │ ├── BusTypeEnum.java │ │ ├── CityBus.java │ │ ├── CityBusArrivalInfo.java │ │ ├── CommutingBus.java │ │ ├── IntercityBus.java │ │ ├── IntercityBusArrivalInfo.java │ │ ├── IntercityBusTimetable.java │ │ ├── MajorStationEnum.java │ │ ├── RegionEnum.java │ │ ├── SchoolBus.java │ │ ├── SchoolBusArrivalInfo.java │ │ ├── SchoolBusCourse.java │ │ ├── SchoolBusTimetable.java │ │ ├── ShuttleBus.java │ │ └── SingleBusTime.java │ ├── Callvan │ │ ├── CallvanResponseType.java │ │ ├── Company.java │ │ ├── Participant.java │ │ └── Room.java │ ├── Circle │ │ ├── Circle.java │ │ └── CircleResponseType.java │ ├── Community │ │ ├── Article.java │ │ ├── ArticleResponseType.java │ │ ├── ArticleViewLog.java │ │ ├── Board.java │ │ ├── BoardResponseType.java │ │ ├── Comment.java │ │ ├── CommentResponseType.java │ │ └── CommunityResponseType.java │ ├── Criteria │ │ ├── Criteria.java │ │ ├── SearchCriteria.java │ │ └── StudentCriteria.java │ ├── Dept │ │ ├── DeptInfoVO.java │ │ ├── DeptInfoWithNum.java │ │ └── DeptNum.java │ ├── Dining │ │ ├── DiningMenu.java │ │ ├── DiningMenuDTO.java │ │ └── DiningTimeEnum.java │ ├── DomainToMap.java │ ├── ErrorMessage.java │ ├── Event │ │ ├── EventArticle.java │ │ ├── EventArticleViewLog.java │ │ ├── EventComment.java │ │ └── ShopAdmin.java │ ├── Faq │ │ ├── Faq.java │ │ └── FaqResponseType.java │ ├── Global │ │ └── UpdatedAt.java │ ├── Homepage │ │ ├── Activity.java │ │ ├── Member.java │ │ ├── TechStack.java │ │ └── Track.java │ ├── LostAndFound │ │ ├── LostItem.java │ │ ├── LostItemComment.java │ │ ├── LostItemCommentResponseType.java │ │ ├── LostItemResponseType.java │ │ └── LostItemViewLog.java │ ├── Mail │ │ ├── Mail.java │ │ └── MailForm.java │ ├── MarketPlace │ │ ├── Item.java │ │ ├── ItemComment.java │ │ ├── ItemCommentResponseType.java │ │ ├── ItemResponseType.java │ │ └── ItemViewLog.java │ ├── NotiSlack.java │ ├── Notice.java │ ├── PageResource │ │ └── PageResource.java │ ├── RedisOwnerKeyPrefix.java │ ├── Search │ │ ├── SearchArticles.java │ │ ├── SearchArticlesMinified.java │ │ ├── SearchComments.java │ │ ├── SearchCommentsMinified.java │ │ └── SearchEnum.java │ ├── Shop │ │ ├── Menu.java │ │ ├── Shop.java │ │ ├── ShopCategory.java │ │ ├── ShopCategoryMap.java │ │ ├── ShopImage.java │ │ ├── ShopMenu.java │ │ ├── ShopMenuCategory.java │ │ ├── ShopMenuCategoryMap.java │ │ ├── ShopMenuDetail.java │ │ ├── ShopMenuImage.java │ │ ├── ShopMenuProfile.java │ │ ├── ShopOpen.java │ │ ├── ShopProfile.java │ │ ├── ShopResponseType.java │ │ └── ShopViewLog.java │ ├── TemporaryCommunity │ │ ├── TempArticle.java │ │ ├── TempArticleResponseType.java │ │ ├── TempComment.java │ │ ├── TempCommentResponseType.java │ │ └── TempCommunityResponseType.java │ ├── TimeTable │ │ ├── Lecture.java │ │ ├── Semester.java │ │ └── TimeTable.java │ ├── Upload │ │ ├── ByteSize.java │ │ ├── ContentType.java │ │ ├── ContentTypes.java │ │ ├── DomainEnum.java │ │ ├── FileExtensionName.java │ │ ├── PreSignedUrlResult.java │ │ ├── UploadFile.java │ │ ├── UploadFileFullName.java │ │ ├── UploadFileFullPath.java │ │ ├── UploadFileLocation.java │ │ ├── UploadFileMetaData.java │ │ ├── UploadFiles.java │ │ └── UploadFilesLocation.java │ ├── User │ │ ├── AuthResult.java │ │ ├── AuthToken.java │ │ ├── Domain.java │ │ ├── EmailAddress.java │ │ ├── LocalParts.java │ │ ├── PageInfo.java │ │ ├── User.java │ │ ├── UserCode.java │ │ ├── UserResponseType.java │ │ ├── UserType.java │ │ ├── Users.java │ │ ├── owner │ │ │ ├── CertificationCode.java │ │ │ ├── Owner.java │ │ │ ├── OwnerAttachment.java │ │ │ ├── OwnerAttachments.java │ │ │ ├── OwnerInCertification.java │ │ │ ├── OwnerInVerification.java │ │ │ ├── OwnerIncludingShop.java │ │ │ ├── OwnerPartition.java │ │ │ └── OwnerShop.java │ │ └── student │ │ │ └── Student.java │ ├── Version │ │ ├── BatchVersion.java │ │ ├── Version.java │ │ └── VersionTypeEnum.java │ └── kut │ │ └── Calendar.java │ ├── dto │ ├── EmptyResponse.java │ ├── ExceptionResponse.java │ ├── RequestDataInvalidResponse.java │ ├── admin │ │ ├── auth │ │ │ ├── TokenRefreshRequest.java │ │ │ └── TokenRefreshResponse.java │ │ ├── land │ │ │ ├── request │ │ │ │ ├── CreateLandRequest.java │ │ │ │ ├── LandsCondition.java │ │ │ │ └── UpdateLandRequest.java │ │ │ └── response │ │ │ │ ├── LandResponse.java │ │ │ │ └── LandsResponse.java │ │ ├── member │ │ │ ├── request │ │ │ │ ├── CreateMemberRequest.java │ │ │ │ ├── MembersCondition.java │ │ │ │ └── UpdateMemberRequest.java │ │ │ └── response │ │ │ │ ├── MemberResponse.java │ │ │ │ └── MembersResponse.java │ │ ├── shop │ │ │ ├── request │ │ │ │ ├── CreateShopCategoryRequest.java │ │ │ │ ├── CreateShopMenuCategoryRequest.java │ │ │ │ ├── CreateShopMenuRequest.java │ │ │ │ ├── CreateShopRequest.java │ │ │ │ ├── ShopCategoriesCondition.java │ │ │ │ ├── ShopsCondition.java │ │ │ │ ├── UpdateShopCategoryRequest.java │ │ │ │ ├── UpdateShopMenuCategoryRequest.java │ │ │ │ ├── UpdateShopMenuRequest.java │ │ │ │ └── UpdateShopRequest.java │ │ │ └── response │ │ │ │ ├── AllMenuCategoriesOfShopResponse.java │ │ │ │ ├── AllMenusOfShopResponse.java │ │ │ │ ├── ShopCategoriesResponse.java │ │ │ │ ├── ShopCategoryResponse.java │ │ │ │ ├── ShopMenuResponse.java │ │ │ │ ├── ShopResponse.java │ │ │ │ └── ShopsResponse.java │ │ └── user │ │ │ ├── owner │ │ │ ├── request │ │ │ │ └── OwnerUpdateRequest.java │ │ │ └── response │ │ │ │ ├── OwnerUpdateResponse.java │ │ │ │ └── OwnersResponse.java │ │ │ ├── request │ │ │ ├── LoginRequest.java │ │ │ ├── NewOwnersCondition.java │ │ │ ├── OwnersCondition.java │ │ │ └── UserUpdateRequest.java │ │ │ ├── response │ │ │ ├── LoginResponse.java │ │ │ ├── NewOwnersResponse.java │ │ │ ├── OwnerResponse.java │ │ │ ├── UserResponse.java │ │ │ └── UserUpdateResponse.java │ │ │ └── student │ │ │ ├── request │ │ │ └── StudentUpdateRequest.java │ │ │ └── response │ │ │ ├── StudentResponse.java │ │ │ ├── StudentUpdateResponse.java │ │ │ └── StudentsResponse.java │ ├── global │ │ └── AttachmentUrlRequest.java │ └── normal │ │ ├── auth │ │ ├── TokenRefreshRequest.java │ │ └── TokenRefreshResponse.java │ │ ├── bus │ │ └── BusTimetableResponse.java │ │ ├── mail │ │ └── Mail.java │ │ ├── shop │ │ ├── request │ │ │ ├── CreateMenuCategoryRequest.java │ │ │ ├── CreateMenuRequest.java │ │ │ ├── CreateShopRequest.java │ │ │ ├── UpdateMenuCategoryRequest.java │ │ │ ├── UpdateMenuRequest.java │ │ │ └── UpdateShopRequest.java │ │ └── response │ │ │ ├── AllMenuCategoriesOfShopResponse.java │ │ │ ├── AllMenusOfShopResponse.java │ │ │ ├── AllShopCategoriesResponse.java │ │ │ ├── AllShopsOfOwnerResponse.java │ │ │ ├── AllShopsResponse.java │ │ │ ├── MenuResponse.java │ │ │ └── ShopResponse.java │ │ ├── upload │ │ ├── request │ │ │ ├── PreSignedUrlRequest.java │ │ │ ├── UploadFileRequest.java │ │ │ └── UploadFilesRequest.java │ │ └── response │ │ │ ├── PreSignedUrlResponse.java │ │ │ ├── UploadFileResponse.java │ │ │ └── UploadFilesResponse.java │ │ └── user │ │ ├── owner │ │ ├── request │ │ │ ├── OwnerChangePasswordRequest.java │ │ │ ├── OwnerRegisterRequest.java │ │ │ ├── OwnerUpdateRequest.java │ │ │ ├── VerifyCodeRequest.java │ │ │ └── VerifyEmailRequest.java │ │ └── response │ │ │ ├── OwnerResponse.java │ │ │ └── VerifyCodeResponse.java │ │ ├── request │ │ ├── AuthTokenRequest.java │ │ ├── CheckExistsEmailRequest.java │ │ ├── FindPasswordRequest.java │ │ ├── LoginRequest.java │ │ ├── UpdateUserRequest.java │ │ ├── UserRegisterRequest.java │ │ └── UserUpdateRequest.java │ │ ├── response │ │ ├── AuthResponse.java │ │ ├── LoginResponse.java │ │ ├── UserResponse.java │ │ └── UsersResponse.java │ │ └── student │ │ ├── request │ │ ├── StudentRegisterRequest.java │ │ └── StudentUpdateRequest.java │ │ └── response │ │ └── StudentResponse.java │ ├── exception │ ├── BadRequestException.java │ ├── BaseException.java │ ├── ConflictException.java │ ├── ExceptionInformation.java │ ├── ForbiddenException.java │ ├── NotFoundException.java │ ├── ParentException.java │ ├── PreconditionFailedException.java │ ├── RequestDataInvalidException.java │ ├── UnauthorizeException.java │ └── ValidationException.java │ ├── interceptor │ └── AuthInterceptor.java │ ├── mapstruct │ ├── OwnerConverter.java │ ├── UserConverter.java │ ├── admin │ │ ├── auto │ │ │ └── AuthConverter.java │ │ ├── land │ │ │ └── AdminLandConverter.java │ │ ├── member │ │ │ └── AdminMemberConverter.java │ │ ├── shop │ │ │ ├── AdminShopCategoryConverter.java │ │ │ ├── AdminShopConverter.java │ │ │ ├── AdminShopMenuConverter.java │ │ │ └── AdminShopOpenConverter.java │ │ └── user │ │ │ ├── OwnerConverter.java │ │ │ ├── StudentConverter.java │ │ │ └── UserConverter.java │ └── normal │ │ ├── auto │ │ └── AuthConverter.java │ │ ├── bus │ │ ├── IntercityBusTimetableConverter.java │ │ └── SchoolBusCourseConverter.java │ │ ├── dining │ │ └── DiningMenuConverter.java │ │ ├── shop │ │ ├── ShopConverter.java │ │ ├── ShopMenuConverter.java │ │ └── ShopOpenConverter.java │ │ └── upload │ │ └── UploadFileConverter.java │ ├── repository │ ├── ActivityMapper.java │ ├── AuthenticationMapper.java │ ├── AuthorityMapper.java │ ├── BusRepository.java │ ├── CalendarMapper.java │ ├── CallvanMapper.java │ ├── CircleMapper.java │ ├── CommunityMapper.java │ ├── DeptMapper.java │ ├── DiningMapper.java │ ├── EventMapper.java │ ├── FaqMapper.java │ ├── LandMapper.java │ ├── LostAndFoundMapper.java │ ├── MarketPlaceMapper.java │ ├── MemberMapper.java │ ├── PageResourceMapper.java │ ├── RedisAuthenticationMapper.java │ ├── RedisOwnerMapper.java │ ├── SearchMapper.java │ ├── ShopMapper.java │ ├── TemporaryCommunityMapper.java │ ├── TimeTableMapper.java │ ├── TrackMapper.java │ ├── VersionMapper.java │ ├── admin │ │ ├── AdminShopMapper.java │ │ └── AdminUserMapper.java │ └── user │ │ ├── OwnerMapper.java │ │ ├── StudentMapper.java │ │ └── UserMapper.java │ ├── schedule │ ├── BusTago.java │ └── CachedHotArticles.java │ ├── service │ ├── AbstractJwtValidator.java │ ├── AccessJwtValidator.java │ ├── ActivityService.java │ ├── ActivityServiceImpl.java │ ├── BusService.java │ ├── BusServiceImpl.java │ ├── CalendarService.java │ ├── CalendarServiceImpl.java │ ├── CallvanService.java │ ├── CallvanServiceImpl.java │ ├── CircleService.java │ ├── CircleServiceImpl.java │ ├── CommunityService.java │ ├── CommunityServiceImpl.java │ ├── DeptService.java │ ├── DeptServiceImpl.java │ ├── DiningService.java │ ├── DiningServiceImpl.java │ ├── EventService.java │ ├── EventServiceImpl.java │ ├── FaqService.java │ ├── FaqServiceImpl.java │ ├── JwtGenerator.java │ ├── JwtValidator.java │ ├── KakaoBotService.java │ ├── KakaoBotServiceImpl.java │ ├── LandService.java │ ├── LandServiceImpl.java │ ├── LostAndFoundService.java │ ├── LostAndFoundServiceImpl.java │ ├── MailService.java │ ├── MarketPlaceService.java │ ├── MarketPlaceServiceImpl.java │ ├── MemberService.java │ ├── MemberServiceImpl.java │ ├── OwnerService.java │ ├── OwnerServiceImpl.java │ ├── OwnerShopService.java │ ├── OwnerShopServiceImpl.java │ ├── PageResourceService.java │ ├── PageResourceServiceImpl.java │ ├── RefreshJwtValidator.java │ ├── S3UploadServiceImpl.java │ ├── SearchService.java │ ├── SearchServiceImpl.java │ ├── ShopService.java │ ├── ShopServiceImpl.java │ ├── SlackBotService.java │ ├── SlackBotServiceImpl.java │ ├── TemporaryAccessJwtGenerator.java │ ├── TemporaryCommunityService.java │ ├── TemporaryCommunityServiceImpl.java │ ├── TimeTableService.java │ ├── TimeTableServiceImpl.java │ ├── TrackService.java │ ├── TrackServiceImpl.java │ ├── UploadService.java │ ├── UserAccessJwtGenerator.java │ ├── UserRefreshJwtGenerator.java │ ├── UserService.java │ ├── UserServiceImpl.java │ ├── VersionService.java │ ├── VersionServiceImpl.java │ └── admin │ │ ├── AdminShopService.java │ │ ├── AdminShopServiceImpl.java │ │ ├── AdminUserService.java │ │ └── AdminUserServiceImpl.java │ ├── skillresponse │ ├── KakaoBot.java │ └── SkillResponse.java │ ├── swagger │ └── SwaggerConfig.java │ ├── util │ ├── ApplicationContextProvider.java │ ├── AwsSesConfig.java │ ├── BeanUtil.java │ ├── DateUtil.java │ ├── HttpHeaderValue.java │ ├── HttpHeaderValueAttacher.java │ ├── IframeListener.java │ ├── JsonConstructor.java │ ├── RandomGenerator.java │ ├── S3Util.java │ ├── SHA256Util.java │ ├── SearchUtil.java │ ├── SesMailSender.java │ ├── SlackNotiSender.java │ ├── StringRedisUtil.java │ ├── StringRedisUtilObj.java │ ├── StringRedisUtilStr.java │ ├── StringXssChecker.java │ ├── UploadFileUtils.java │ ├── filter │ │ ├── AllowedOrigins.java │ │ ├── CORSFilter.java │ │ └── Origin.java │ └── jwt │ │ ├── JwtKeyManager.java │ │ └── JwtUtil.java │ └── validator │ └── OwnerValidator.java ├── resources ├── common │ ├── application_context_provider.xml │ ├── config.xml │ ├── context-datasource.xml │ ├── context-mapper.xml │ ├── context-scheduler.xml │ ├── mailSend.xml │ ├── mybatis.xml │ ├── redis.xml │ ├── search.xml │ ├── security.xml │ ├── sesMailSender.xml │ └── slack_noti.xml ├── config │ └── config.example.properties ├── db │ └── migration │ │ ├── V10__alter_and_insert_version_in_versions_table.sql │ │ ├── V11__create_activities_table.sql │ │ ├── V12__create_members_table.sql │ │ ├── V13__create_tracks_table.sql │ │ ├── V14__create_tech_stacks_table.sql │ │ ├── V15__alter_add_grant_bcsdlab_in_admins_table.sql │ │ ├── V16__create_shop_view_logs_table.sql │ │ ├── V17__alter_add_hits_in_shops_table.sql │ │ ├── V18__change_comment_count_unsigned.sql │ │ ├── V19__alter_thumbnail_length_in_items_tables.sql │ │ ├── V1__alter_design_score_in_lectures_table.sql │ │ ├── V20__create_search_articles_table.sql │ │ ├── V21__create_holidays_table.sql │ │ ├── V22__create_event_board.sql │ │ ├── V23__create_event_articles.sql │ │ ├── V24__create_event_articles_view_logs.sql │ │ ├── V25__create_users_owners.sql │ │ ├── V26__create_event_comments.sql │ │ ├── V27__add_grant_event.sql │ │ ├── V28__create_shop_owners.sql │ │ ├── V2__alter_professor_in_lectures_table.sql │ │ ├── V30__alter_add_weekend_time_in_shops_table.sql │ │ ├── V31__create_courses_table.sql │ │ ├── V32__create_and_add_departments.sql │ │ ├── V33__create_student_table.sql │ │ ├── V34__insert_users_data_to_students_table.sql │ │ ├── V35__alter_users_table.sql │ │ ├── V36__create_owner_table.sql │ │ ├── V37__alter_add_usertype_delete_remember_token_and_identity_in_users_table.sql │ │ ├── V38__add_identity_to_students_table.sql │ │ ├── V39__alter_company_registration_number_image_url_name_and_delete_is_authed_owners_table.sql │ │ ├── V3__alter_target_in_lectures_table.sql │ │ ├── V40__add_owner_id_to_shops_table.sql │ │ ├── V41__alter_portal_account_to_account_in_users_table.sql │ │ ├── V42__add_email__to_users_table.sql │ │ ├── V43__update_users_account_data_to_email.sql │ │ ├── V44__alter_comment_to_every_table.sql │ │ ├── V45__alter_students_token_info_to_user_table.sql │ │ ├── V46__remove_unique_constraint_of_users_table.sql │ │ ├── V47__update_user_type_to_student_of_all_row.sql │ │ ├── V48__alter_is_graduated_to_nullable_in_students_table.sql │ │ ├── V49__add_nickname_unique_constraint_of_users_table.sql │ │ ├── V4__create_timetables_table.sql │ │ ├── V50__add_account_unique_constraint_of_users_table.sql │ │ ├── V51__create_owner_shop_attachment_table.sql │ │ ├── V52__add_email_unique_constraint_of_users_table.sql │ │ ├── V53__create_shop_menu_details_table.sql │ │ ├── V54__create_shop_menu_images_table.sql │ │ ├── V55__create_shop_menu_categories_table.sql │ │ ├── V56__create_shop_menu_category_map_table.sql │ │ ├── V57__create_shop_images_table.sql │ │ ├── V58__create_shop_categories_table.sql │ │ ├── V59__create_shop_category_map_table.sql │ │ ├── V5__create_semester_table.sql │ │ ├── V60__create_shop_opens_table.sql │ │ ├── V61__add_unique_constraint_to_shop_category_map_table.sql │ │ ├── V62__add_unique_constraint_to_shop_images_table.sql │ │ ├── V63__add_unique_constraint_to_shop_menu_category_map_table.sql │ │ ├── V64__add_unique_constraint_to_shop_menu_images_table.sql │ │ ├── V65__add_unique_constraint_to_shop_menu_details_table.sql │ │ ├── V66__insert_full_view_category_relation_into_shop_category_map_table.sql │ │ ├── V67__alter_shops_table.sql │ │ ├── V68__alter_shop_menus_table.sql │ │ ├── V69.000__alter_drop_user_account.sql │ │ ├── V69.001__alter_remove_notnull_owner_url.sql │ │ ├── V6__alter_add_is_deleted_in_timetables.sql │ │ ├── V70.000__drop_fk_owner_attachment_shop_id.sql │ │ ├── V70.001__drop_column_owner_attachment_shop_id.sql │ │ ├── V70.002__change_table_name_owner_attachment.sql │ │ ├── V71.000__increase_version_type_size.sql │ │ ├── V72__alter_owners_company_registration_number_is_nullable.sql │ │ ├── V73.000__add_auto_incremet_semester.sql │ │ ├── V74__add_column_owner_attachments_table_created_at.sql │ │ ├── V7__alter_add_timestamp_in_timetables_table.sql │ │ ├── V8__alter_add_grades_in_timetables_table.sql │ │ └── V9__alter_add_more_columns_in_timetables_table.sql ├── lucy-xss-sax.xml ├── lucy-xss-servlet-filter-rule.xml ├── lucy-xss-superset-sax.xml ├── mail │ ├── change_password_certificate_button.vm │ ├── change_password_certificate_number.vm │ ├── owner_certificate_number.vm │ └── register_authenticate.vm ├── mapper │ ├── admin │ │ ├── AdminLandMapper.xml │ │ ├── AdminMemberMapper.xml │ │ ├── AdminShopMapper.xml │ │ ├── AdminTrackMapper.xml │ │ └── AdminUserMapper.xml │ └── normal │ │ ├── OwnerMapper.xml │ │ ├── ShopMapper.xml │ │ ├── StudentMapper.xml │ │ └── UserMapper.xml ├── white-url.xml └── xssfilter-extension.properties └── webapp ├── WEB-INF ├── resources │ └── js │ │ ├── password.check.js │ │ └── sha256.min.js ├── root-context.xml ├── servlet-context.xml ├── views │ ├── home.jsp │ └── mail │ │ ├── change_password_certificate_button.jsp │ │ ├── change_password_certificate_number.jsp │ │ ├── change_password_config.jsp │ │ ├── error_config.jsp │ │ ├── owner_certificate_number.jsp │ │ ├── register_authenticate.jsp │ │ ├── success_change_password_config.jsp │ │ └── success_register_config.jsp └── web.xml └── index.jsp /.editorconfig: -------------------------------------------------------------------------------- 1 | # top-most EditorConfig file 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | insert_final_newline = true 8 | 9 | [*.bat] 10 | end_of_line = crlf 11 | 12 | [*.adoc] 13 | indent_style = space 14 | indent_size = 4 15 | tab_width = 4 16 | trim_trailing_whitespace = true 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/BUG_REPORT.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Service's Bug report. 4 | title: '' 5 | labels: "bug" 6 | assignees: '' 7 | --- 8 | 9 | ## Description 10 | 11 | 12 | ## Remark 13 | 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/FEATURE.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature 3 | about: A feature with a list of APIs 4 | title: '' 5 | labels: "enhancement" 6 | assignees: '' 7 | --- 8 | 9 | ## Description 10 | 11 | 12 | ## Task List 13 | 14 | 15 | - [ ] Task1 16 | 17 | ## Remark 18 | 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/NEW_FEATURE.md: -------------------------------------------------------------------------------- 1 | ## 📛Feature Name 2 | 3 | ## ✅Progress 4 | 5 | ## ⚠️Precautions 6 | 7 | ## 📜References 8 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## ▶ Request 2 | ### Content 3 | 4 | ### as-is 5 | 6 | ### to-be 7 | 8 | 9 | ## ✅ Check List 10 | - [ ] 의도치 않은 변경이 일어나지 않았는지. 11 | - 실수로 라이브러리(`pom.xml`) 변경이 일어나지 않았는지 12 | - 병합시 컴파일 & 런타임 에러가 발생하지 않는지 13 | - 기존 클라이언트와의 호환성 고려가 잘 이루어졌는지 14 | - [ ] 작성한 코드가 프로젝트에 반영됨을 명심하였는지 15 | - 타인도 알아보고 변경할 수 있는 코드를 작성하였는지 16 | - 코드 & 커밋 컨벤션을 준수하였는지 17 | - (필요한) 문서화가 진행되었는지 18 | - [ ] (기능 추가의 경우) 클라이언트의 입장에 대한 충분한 고려가 이루어졌는지 19 | - 클라이언트 측과 협의가 된 내용인 경우 20 | - 클라이언트의 요구사항을 잘 반영하는지 21 | - API 문서에 논리적인 오류 & 가시성이 떨어지는 내용이 없는지 22 | 23 | 24 | ## 📸 API Document ScreenShot 25 | 26 | 27 | ## 🧪 Test 28 | 29 | - [ ] ` ` 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # IntelliJ 2 | .idea/ 3 | projectName.iml 4 | /*.classpath 5 | /.classpath 6 | /.springBeans 7 | *.DS_Store 8 | *.iml 9 | /build 10 | /local.properties 11 | target/ 12 | out/ 13 | 14 | # properties file 15 | src/main/resources/config/config.properties 16 | flyway.properties 17 | 18 | classes/* 19 | lib/* -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # KOIN_API 2 | KOIN Community (ver. Spring Framework) 3 | -------------------------------------------------------------------------------- /flyway.example.properties: -------------------------------------------------------------------------------- 1 | flyway.url= 2 | flyway.user= 3 | flyway.password= -------------------------------------------------------------------------------- /src/main/java/koreatech/in/annotation/ApiOff.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target({ElementType.TYPE, ElementType.METHOD}) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface ApiOff { 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/annotation/Auth.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target({ElementType.TYPE, ElementType.METHOD}) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface Auth { 11 | enum Role { ADMIN, USER, STUDENT, OWNER, NONE } 12 | enum Authority { USER, CALLVAN, LAND, COMMUNITY, SHOP, VERSION, MARKET, CIRCLE, LOST, SURVEY, BCSDLAB, EVENT, NONE } 13 | 14 | Role role() default Role.NONE; 15 | Authority authority() default Authority.NONE; 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/annotation/AuthExcept.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target(ElementType.METHOD) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface AuthExcept { 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/annotation/AuthTemporary.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target(ElementType.METHOD) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface AuthTemporary { 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/annotation/Login.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.annotation; 2 | 3 | 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Target({ElementType.PARAMETER}) 10 | @Retention(RetentionPolicy.RUNTIME) 11 | public @interface Login { 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/annotation/OwnerRegistrationInfomation.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.annotation; 2 | 3 | import koreatech.in.validator.OwnerValidator; 4 | 5 | import javax.validation.Constraint; 6 | import javax.validation.Payload; 7 | import java.lang.annotation.Documented; 8 | import java.lang.annotation.ElementType; 9 | import java.lang.annotation.Retention; 10 | import java.lang.annotation.RetentionPolicy; 11 | import java.lang.annotation.Target; 12 | 13 | @Documented 14 | @Constraint(validatedBy = OwnerValidator.class) 15 | @Target( { ElementType.TYPE }) 16 | @Retention(RetentionPolicy.RUNTIME) 17 | public @interface OwnerRegistrationInfomation { 18 | String message() default "사업자등록번호와 첨부파일에 대해 아무것도 입력 안하거나 혹은 모두 입력해야합니다."; 19 | Class[] groups() default {}; 20 | Class[] payload() default {}; 21 | 22 | String companyNumber(); 23 | String attachmentUrls(); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/annotation/ParamValid.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target(ElementType.METHOD) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface ParamValid { } 11 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/annotation/ValidationGroups.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.annotation; 2 | 3 | import javax.validation.groups.Default; 4 | 5 | /** 6 | * Utility classes to distinct CRUD validations.
7 | *
8 | * Used with the 9 | * {@link org.springframework.validation.annotation.Validated @Validated} 10 | * Spring annotation. 11 | */ 12 | public final class ValidationGroups { 13 | 14 | private ValidationGroups() { } 15 | 16 | // Standard groups 17 | 18 | public interface Create extends Default {}; 19 | public interface Update extends Default {}; 20 | 21 | // Admin groups 22 | 23 | public interface CreateAdmin extends Default {}; 24 | public interface UpdateAdmin extends Default {}; 25 | } -------------------------------------------------------------------------------- /src/main/java/koreatech/in/annotation/XssFilter.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target({ElementType.METHOD}) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface XssFilter { 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/config/WebConfig.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.config; 2 | 3 | import java.util.Collections; 4 | 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.context.support.ConversionServiceFactoryBean; 8 | import org.springframework.web.servlet.config.annotation.EnableWebMvc; 9 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 10 | 11 | import koreatech.in.converter.DomainEnumConvertor; 12 | 13 | @Configuration 14 | @EnableWebMvc 15 | public class WebConfig extends WebMvcConfigurerAdapter { 16 | @Bean 17 | public ConversionServiceFactoryBean conversionService() { 18 | ConversionServiceFactoryBean conversionService = new ConversionServiceFactoryBean(); 19 | conversionService.setConverters(Collections.singleton(new DomainEnumConvertor())); 20 | return conversionService; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/controller/ActivityController.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import io.swagger.annotations.ApiParam; 5 | import koreatech.in.service.ActivityService; 6 | import org.springframework.http.HttpStatus; 7 | import org.springframework.http.ResponseEntity; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestMethod; 11 | import org.springframework.web.bind.annotation.RequestParam; 12 | import org.springframework.web.bind.annotation.ResponseBody; 13 | 14 | import javax.annotation.Resource; 15 | import java.util.Map; 16 | 17 | @Api(tags = "(Normal) Activity", description = "BCSDLab 활동") 18 | @Controller 19 | public class ActivityController { 20 | @Resource(name = "activityService") 21 | private ActivityService activityService; 22 | 23 | @RequestMapping(value = "/activities", method = RequestMethod.GET) 24 | public @ResponseBody 25 | ResponseEntity getActivities(@ApiParam(value = "optional", required = false) @RequestParam(value = "year", required = false) String year) throws Exception { 26 | return new ResponseEntity>(activityService.getActivities(year), HttpStatus.OK); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/controller/DiningController.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import io.swagger.annotations.ApiParam; 5 | import koreatech.in.domain.Dining.DiningMenuDTO; 6 | import koreatech.in.service.DiningService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.http.HttpStatus; 9 | import org.springframework.http.ResponseEntity; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestMethod; 13 | import org.springframework.web.bind.annotation.RequestParam; 14 | 15 | import java.util.List; 16 | 17 | @Api(tags = "(Normal) Dining", description = "식단") 18 | @Controller 19 | public class DiningController { 20 | @Autowired 21 | private DiningService diningService; 22 | 23 | @RequestMapping(value = "/dinings", method = RequestMethod.GET) 24 | public ResponseEntity> getDinings(@ApiParam(required = false) 25 | @RequestParam(value = "date", required = false) 26 | String date) throws Exception { 27 | 28 | return new ResponseEntity<>(diningService.getDinings(date), HttpStatus.OK); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/controller/PageResourceController.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import koreatech.in.annotation.ApiOff; 5 | import koreatech.in.domain.PageResource.PageResource; 6 | import koreatech.in.service.PageResourceService; 7 | import org.springframework.http.HttpStatus; 8 | import org.springframework.http.ResponseEntity; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestMethod; 12 | import org.springframework.web.bind.annotation.ResponseBody; 13 | import springfox.documentation.annotations.ApiIgnore; 14 | 15 | import javax.inject.Inject; 16 | 17 | @ApiOff @ApiIgnore @Deprecated 18 | @Api(tags = "(Normal) PageResource", description = "페이지 리소스") 19 | @Controller 20 | public class PageResourceController { 21 | 22 | @Inject 23 | private PageResourceService pageResourceService; 24 | 25 | @ApiOff 26 | @RequestMapping(value = "/cardNews", method = RequestMethod.GET) 27 | public @ResponseBody 28 | ResponseEntity getCardNews() throws Exception { 29 | return new ResponseEntity(pageResourceService.getCardNews(), HttpStatus.OK); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/controller/SampleController.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import koreatech.in.annotation.ApiOff; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RequestMethod; 8 | import org.springframework.web.bind.annotation.ResponseBody; 9 | import springfox.documentation.annotations.ApiIgnore; 10 | 11 | @ApiOff @ApiIgnore @Deprecated 12 | @Api(tags = "(Normal) Sample", description = "샘플") 13 | @Controller 14 | public class SampleController { 15 | 16 | @ApiOff 17 | @RequestMapping(value = "/test", method = RequestMethod.GET) 18 | public @ResponseBody String test() { 19 | return null; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/controller/SlackBotController.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import koreatech.in.service.SlackBotService; 5 | import org.springframework.http.HttpStatus; 6 | import org.springframework.http.ResponseEntity; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestMethod; 10 | import org.springframework.web.bind.annotation.RequestParam; 11 | import org.springframework.web.bind.annotation.ResponseBody; 12 | import springfox.documentation.annotations.ApiIgnore; 13 | 14 | import javax.inject.Inject; 15 | import java.util.Map; 16 | 17 | @Api(tags = "Slack Bot", description = "슬랙 봇") 18 | @ApiIgnore 19 | @Controller 20 | public class SlackBotController { 21 | @Inject 22 | private SlackBotService slackBotService; 23 | 24 | @RequestMapping(value = "/slackbot/message", method = RequestMethod.GET, produces = "text/plain;charset=UTF-8") 25 | public @ResponseBody 26 | ResponseEntity sendSlackMessage(@RequestParam Map params) throws Exception { 27 | String result = slackBotService.sendMessage(params); 28 | return new ResponseEntity(result, HttpStatus.OK); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/converter/DomainEnumConvertor.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.converter; 2 | 3 | import org.springframework.core.convert.converter.Converter; 4 | 5 | import koreatech.in.domain.Upload.DomainEnum; 6 | 7 | public class DomainEnumConvertor implements Converter { 8 | @Override 9 | public DomainEnum convert(String domainPathVariable) { 10 | return DomainEnum.mappingFor(domainPathVariable.toUpperCase()); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Auth/JWTKeys.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Auth; 2 | 3 | 4 | import javax.crypto.SecretKey; 5 | import lombok.Getter; 6 | 7 | @Getter 8 | public class JWTKeys { 9 | 10 | private final SecretKey accessKey; 11 | private final SecretKey refreshKey; 12 | 13 | private JWTKeys(SecretKey accessKey, SecretKey refreshKey) { 14 | this.accessKey = accessKey; 15 | this.refreshKey = refreshKey; 16 | } 17 | 18 | public static JWTKeys of(SecretKey accessKey, SecretKey refreshKey) { 19 | return new JWTKeys(accessKey, refreshKey); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Auth/LoginResult.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Auth; 2 | 3 | import lombok.Builder; 4 | import lombok.Getter; 5 | 6 | @Getter 7 | @Builder 8 | public class LoginResult { 9 | private final String accessToken; 10 | private final String refreshToken; 11 | private final String userType; 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Auth/RefreshResult.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Auth; 2 | 3 | import lombok.Builder; 4 | import lombok.Getter; 5 | 6 | @Getter 7 | @Builder 8 | public class RefreshResult { 9 | private final String accessToken; 10 | private final String refreshToken; 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Auth/RefreshToken.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Auth; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | @Getter 7 | @AllArgsConstructor 8 | public class RefreshToken { 9 | 10 | private String token; 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/BokDuck/LandResponseType.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.BokDuck; 2 | 3 | public class LandResponseType { 4 | private static String[] toAdminArray = new String[] { 5 | }; 6 | 7 | private static String[] toArray = new String[] { 8 | "class", 9 | "size", 10 | "phone", 11 | "image_urls", 12 | "address", 13 | "description", 14 | "floor", 15 | "deposit", 16 | "management_fee", 17 | "opt_refrigerator", 18 | "opt_closet", 19 | "opt_tv", 20 | "opt_microwave", 21 | "opt_gas_range", 22 | "opt_induction", 23 | "opt_water_purifier", 24 | "opt_air_conditioner", 25 | "opt_washer", 26 | "opt_bed", 27 | "opt_desk", 28 | "opt_shoe_closet", 29 | "opt_electronic_door_locks", 30 | "opt_bidet", 31 | "opt_veranda", 32 | "opt_elevator", 33 | "is_deleted", 34 | "created_at", 35 | "updated_at", 36 | }; 37 | 38 | public static String[] getAdminArray () { 39 | return toAdminArray; 40 | } 41 | 42 | public static String[] getArray () { 43 | return toArray; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Bus/BusTerminalEnum.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Bus; 2 | 3 | import lombok.AccessLevel; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Getter; 6 | 7 | @Getter 8 | @AllArgsConstructor(access = AccessLevel.PRIVATE) 9 | public enum BusTerminalEnum { 10 | 11 | KOREATECH(MajorStationEnum.KOREATECH, "NAI3125301"), 12 | TERMINAL(MajorStationEnum.TERMINAL, "NAI3112001"), 13 | ; 14 | 15 | private final MajorStationEnum terminal; 16 | 17 | private final String terminalID; 18 | 19 | public static BusTerminalEnum findByTerminalName(String terminalName) throws IllegalArgumentException { 20 | for (BusTerminalEnum busTerminalEnum : BusTerminalEnum.values()) { 21 | if (busTerminalEnum.getTerminal().getEngName().equalsIgnoreCase(terminalName)) { 22 | return busTerminalEnum; 23 | } 24 | } 25 | throw new IllegalArgumentException(); 26 | } 27 | 28 | public static BusTerminalEnum findByTerminalID(String terminalID) throws IllegalArgumentException { 29 | for (BusTerminalEnum busTerminalEnum : BusTerminalEnum.values()) { 30 | if (busTerminalEnum.getTerminalID().equalsIgnoreCase(terminalID)) { 31 | return busTerminalEnum; 32 | } 33 | } 34 | throw new IllegalArgumentException(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Bus/BusTimetable.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Bus; 2 | 3 | public abstract class BusTimetable { 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Bus/CityBusArrivalInfo.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Bus; 2 | 3 | import lombok.Getter; 4 | import lombok.ToString; 5 | 6 | @Getter 7 | @ToString 8 | public class CityBusArrivalInfo implements Comparable { 9 | 10 | // 남은 정거장 개수 11 | private int arrprevstationcnt; 12 | 13 | // 도착까지 남은 시간 14 | private int arrtime; 15 | 16 | private String nodeid; 17 | 18 | private String nodenm; 19 | 20 | private String routeid; 21 | 22 | // 버스 번호 23 | private int routeno; 24 | 25 | // 버스 종류 26 | private String routetp; 27 | 28 | // 차량 종류 29 | private String vehicletp; 30 | 31 | @Override 32 | public int compareTo(CityBusArrivalInfo o) { 33 | return this.arrtime - o.arrtime; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Bus/CommutingBus.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Bus; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | @Component 6 | public class CommutingBus extends SchoolBus { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Bus/IntercityBusArrivalInfo.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Bus; 2 | 3 | import lombok.Getter; 4 | import lombok.ToString; 5 | 6 | @Getter 7 | @ToString 8 | public class IntercityBusArrivalInfo { 9 | 10 | private String arrPlaceNm; 11 | 12 | private String arrPlandTime; 13 | 14 | private String depPlaceNm; 15 | 16 | private int charge; 17 | 18 | private String depPlandTime; 19 | 20 | private String gradeNm; 21 | 22 | private String routeId; 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Bus/IntercityBusTimetable.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Bus; 2 | 3 | import lombok.Getter; 4 | import lombok.ToString; 5 | 6 | @Getter 7 | @ToString 8 | public class IntercityBusTimetable extends BusTimetable implements Comparable { 9 | 10 | private final String departure; 11 | 12 | private final String arrival; 13 | 14 | private final int charge; 15 | 16 | public IntercityBusTimetable(String departure, String arrival, int charge) { 17 | this.departure = departure; 18 | this.arrival = arrival; 19 | this.charge = charge; 20 | } 21 | 22 | @Override 23 | public int compareTo(IntercityBusTimetable o) { 24 | return departure.compareTo(o.departure); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Bus/RegionEnum.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Bus; 2 | 3 | import lombok.AccessLevel; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Getter; 6 | 7 | import java.util.Arrays; 8 | 9 | @Getter 10 | @AllArgsConstructor(access = AccessLevel.PRIVATE) 11 | public enum RegionEnum { 12 | 13 | 천안("cheonan"), 14 | 청주("cheongju"), 15 | 대전("daejeon"), 16 | 서울("seoul"), 17 | 세종("sejong"), 18 | ; 19 | 20 | private final String region; 21 | 22 | public static RegionEnum findByEngName(String region) { 23 | return Arrays.stream(RegionEnum.values()) 24 | .filter(regionEnum -> regionEnum.region.equalsIgnoreCase(region)) 25 | .findFirst() 26 | .orElseThrow(IllegalArgumentException::new); 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Bus/SchoolBusArrivalInfo.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Bus; 2 | 3 | import lombok.Getter; 4 | import lombok.ToString; 5 | import org.springframework.data.annotation.Id; 6 | import org.springframework.data.mongodb.core.mapping.Document; 7 | 8 | import java.util.List; 9 | 10 | @Document(collection = "bus_timetables") 11 | @Getter 12 | @ToString 13 | public class SchoolBusArrivalInfo { 14 | 15 | @Id 16 | private String id; 17 | 18 | private String bus_type; 19 | 20 | private String direction; 21 | 22 | private String region; 23 | 24 | private List routes; 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Bus/SchoolBusCourse.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Bus; 2 | 3 | import lombok.Getter; 4 | import lombok.ToString; 5 | 6 | @Getter 7 | @ToString 8 | public class SchoolBusCourse { 9 | 10 | private final String bus_type; 11 | 12 | private final String direction; 13 | 14 | private final String region; 15 | 16 | public SchoolBusCourse(String bus_type, String direction, String region) { 17 | this.bus_type = bus_type; 18 | this.direction = direction; 19 | this.region = region; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Bus/SchoolBusTimetable.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Bus; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnore; 4 | import lombok.Getter; 5 | import lombok.ToString; 6 | 7 | import java.util.List; 8 | 9 | @Getter 10 | @ToString 11 | public class SchoolBusTimetable extends BusTimetable { 12 | 13 | private String route_name; 14 | 15 | @JsonIgnore 16 | private List running_days; 17 | 18 | private List arrival_info; 19 | 20 | @Getter 21 | @ToString 22 | public static class ArrivalNode implements Comparable { 23 | 24 | private String node_name; 25 | 26 | private String arrival_time; 27 | 28 | @Override 29 | public int compareTo(ArrivalNode o) { 30 | return arrival_time.compareTo(o.arrival_time); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Bus/ShuttleBus.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Bus; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | @Component 6 | public class ShuttleBus extends SchoolBus { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Bus/SingleBusTime.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Bus; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategy; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Getter; 7 | import lombok.ToString; 8 | 9 | @Getter 10 | @ToString 11 | @AllArgsConstructor 12 | @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) 13 | public class SingleBusTime { 14 | 15 | private final String busName; 16 | 17 | private final String busTime; 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Callvan/CallvanResponseType.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Callvan; 2 | 3 | public class CallvanResponseType { 4 | private static String[] toAdminArray = new String[] { 5 | }; 6 | 7 | private static String[] toArray = new String[] { 8 | "class", 9 | "is_deleted", 10 | }; 11 | 12 | public static String[] getAdminArray () { 13 | return toAdminArray; 14 | } 15 | 16 | public static String[] getArray () { 17 | return toArray; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Circle/CircleResponseType.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Circle; 2 | 3 | public class CircleResponseType { 4 | private static String[] toAdminArray = new String[] { 5 | }; 6 | 7 | private static String[] toArray = new String[] { 8 | "class", 9 | "is_deleted", 10 | "created_at", 11 | "updated_at", 12 | }; 13 | 14 | private static String[] toArrayList = new String[] { 15 | "class", 16 | "is_deleted", 17 | "created_at", 18 | "updated_at", 19 | "description", 20 | "link_urls", 21 | }; 22 | 23 | public static String[] getAdminArray () { 24 | return toAdminArray; 25 | } 26 | 27 | public static String[] getArray () { 28 | return toArray; 29 | } 30 | 31 | public static String[] getArrayList () { return toArrayList; } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Community/ArticleResponseType.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Community; 2 | 3 | import java.util.*; 4 | 5 | public class ArticleResponseType { 6 | private static String[] toAdminArray = new String[] { 7 | }; 8 | 9 | private static String[] toArray = new String[] { 10 | "class", 11 | "is_deleted", 12 | "user_id", 13 | "ip", 14 | "summary", 15 | "notice_article_id", 16 | "meta", 17 | }; 18 | 19 | private static String[] toHotArticleArray = new String[]{ 20 | "class", 21 | "meta", 22 | "content", 23 | "user_id", 24 | "nickname", 25 | "ip", 26 | "is_solved", 27 | "is_deleted", 28 | "meta", 29 | "is_notice", 30 | "notice_article_id", 31 | "summary", 32 | "updated_at", 33 | }; 34 | 35 | 36 | public static String[] getAdminArray () { 37 | return toAdminArray; 38 | } 39 | 40 | public static String[] getArray () { 41 | return toArray; 42 | } 43 | 44 | public static String[] getHotArticleArray () { 45 | return toHotArticleArray; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Community/BoardResponseType.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Community; 2 | 3 | public class BoardResponseType { 4 | private static String[] toAdminArray = new String[] { 5 | }; 6 | 7 | private static String[] toArray = new String[] { 8 | "class", 9 | "is_deleted", 10 | "created_at", 11 | "updated_at", 12 | "parent_id", 13 | "children", 14 | }; 15 | 16 | private static String[] toArrayList = new String[] { 17 | "class", 18 | "is_deleted", 19 | "created_at", 20 | "updated_at", 21 | "parent_id", 22 | }; 23 | 24 | public static String[] getAdminArray () { 25 | return toAdminArray; 26 | } 27 | 28 | public static String[] getArray () { 29 | return toArray; 30 | } 31 | 32 | public static String[] getArrayList () { 33 | return toArrayList; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Community/CommentResponseType.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Community; 2 | 3 | public class CommentResponseType { 4 | private static String[] toAdminArray = new String[] { 5 | }; 6 | 7 | private static String[] toArray = new String[] { 8 | "class", 9 | "user_id", 10 | "is_deleted", 11 | "article_id", 12 | }; 13 | 14 | public static String[] getAdminArray () { 15 | return toAdminArray; 16 | } 17 | 18 | public static String[] getArray () { 19 | return toArray; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Community/CommunityResponseType.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Community; 2 | 3 | import java.util.*; 4 | 5 | public class CommunityResponseType { 6 | private static String[] toAdminArray = new String[] { 7 | }; 8 | 9 | private static String[] toArray = new String[] { 10 | "meta", 11 | }; 12 | 13 | private static String[] toHotArticleArray = new String[]{ 14 | "meta", 15 | "content", 16 | "user_id", 17 | "nickname", 18 | "ip", 19 | "is_solved", 20 | "is_deleted", 21 | "comment_count", 22 | "meta", 23 | "is_notice", 24 | "notice_article_id", 25 | "summary", 26 | "created_at", 27 | "updated_at", 28 | }; 29 | 30 | 31 | public static String[] getAdminArray () { 32 | return toAdminArray; 33 | } 34 | 35 | public static String[] getArray () { 36 | return toArray; 37 | } 38 | 39 | public static String[] getHotArticleArray () { 40 | return toHotArticleArray; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Criteria/Criteria.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Criteria; 2 | 3 | import io.swagger.annotations.ApiParam; 4 | import lombok.Getter; 5 | import springfox.documentation.annotations.ApiIgnore; 6 | 7 | @ApiIgnore 8 | @Getter 9 | public class Criteria { 10 | public static final int MAX_LIMIT = 50; 11 | public static final int MIN_LIMIT = 1; 12 | @ApiParam(value = "페이지 \n" + 13 | "- null일 경우 기본값: 1 \n" + 14 | "- 1 미만의 값으로 요청할 경우 1로 요청됨") 15 | private Integer page = 1; 16 | @ApiParam(value = "페이지당 조회할 최대 개수 \n" + 17 | "- null일 경우 기본값: 10 \n" + 18 | "- 50보다 초과된 값으로 요청할 경우 50으로 요청됨") 19 | private Integer limit = 10; 20 | 21 | public void setLimit(Integer limit) { 22 | if (limit > MAX_LIMIT) { 23 | this.limit = MAX_LIMIT; 24 | } else if (limit < MIN_LIMIT) { 25 | this.limit = MIN_LIMIT; 26 | } else { 27 | this.limit = limit; 28 | } 29 | } 30 | 31 | public void setPage(Integer page) { 32 | this.page = page < 1 ? 1 : page; 33 | } 34 | 35 | public Integer getCursor() { 36 | return (page - 1) * limit; 37 | } 38 | 39 | public Integer extractTotalPage(Integer totalCount) { 40 | return totalCount.equals(0) ? 1 : (int) Math.ceil((double) totalCount / this.limit); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Criteria/SearchCriteria.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Criteria; 2 | 3 | import io.swagger.annotations.ApiParam; 4 | import springfox.documentation.annotations.ApiIgnore; 5 | 6 | @ApiIgnore 7 | public class SearchCriteria extends Criteria { 8 | @ApiParam(required = true) 9 | private Integer searchType = 0; 10 | 11 | @ApiParam(required = true) 12 | private String query; 13 | 14 | public Integer getSearchType() { 15 | return searchType; 16 | } 17 | 18 | public void setSearchType(Integer searchType) { 19 | this.searchType = searchType; 20 | } 21 | 22 | public String getQuery() { 23 | return query; 24 | } 25 | 26 | public void setQuery(String query) { 27 | this.query = query.trim(); 28 | } 29 | 30 | @Override 31 | public String toString() { 32 | return "Criteria{" + 33 | "searchType=" + searchType + 34 | ", query=" + query + 35 | '}'; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Criteria/StudentCriteria.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Criteria; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | import springfox.documentation.annotations.ApiIgnore; 6 | 7 | @ApiIgnore 8 | @Getter 9 | @Setter 10 | public class StudentCriteria extends Criteria{ 11 | 12 | private Boolean is_authed; 13 | 14 | private String nickname; 15 | 16 | private String email; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Dept/DeptInfoVO.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Dept; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Getter; 6 | 7 | import java.util.ArrayList; 8 | 9 | @Getter 10 | @AllArgsConstructor 11 | public class DeptInfoVO { 12 | 13 | @ApiModelProperty(name = "학과명", example = "컴퓨터공학부", readOnly = true) 14 | private String name; 15 | 16 | @ApiModelProperty(name = "교육과정 링크", example = "https://~", readOnly = true) 17 | private String curriculum_link; 18 | 19 | @ApiModelProperty(name = "허용되는 학과 번호들", readOnly = true) 20 | private ArrayList dept_nums; 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Dept/DeptInfoWithNum.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Dept; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnore; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | @Getter 9 | @Setter 10 | public class DeptInfoWithNum { 11 | 12 | @ApiModelProperty(name = "학과명", example = "컴퓨터공학부", readOnly = true) 13 | private String name; 14 | 15 | @ApiModelProperty(name = "교육과정 링크", example = "https://~", readOnly = true) 16 | private String curriculum_link; 17 | 18 | @ApiModelProperty(hidden = true) 19 | @JsonIgnore 20 | private Boolean is_deleted; 21 | 22 | @ApiModelProperty(name = "학과 번호", example = "36", readOnly = true) 23 | private String dept_num; 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Dept/DeptNum.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Dept; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAlias; 4 | import com.fasterxml.jackson.annotation.JsonGetter; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import io.swagger.annotations.ApiModelProperty; 7 | import lombok.Getter; 8 | import lombok.Setter; 9 | 10 | @Getter 11 | @Setter 12 | public class DeptNum { 13 | 14 | @ApiModelProperty(name = "학과명", example = "컴퓨터공학부", readOnly = true) 15 | @JsonProperty(value = "name") 16 | private String dept_name; 17 | 18 | @ApiModelProperty(name = "학과 번호", example = "36", readOnly = true) 19 | private String dept_num; 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Dining/DiningMenu.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Dining; 2 | 3 | import lombok.Getter; 4 | import lombok.ToString; 5 | 6 | import java.util.Date; 7 | 8 | @Getter 9 | @ToString 10 | public class DiningMenu { 11 | 12 | private Integer id; 13 | 14 | private String date; 15 | 16 | private String type; 17 | 18 | private String place; 19 | 20 | private Integer price_card; 21 | 22 | private Integer price_cash; 23 | 24 | private Integer kcal; 25 | 26 | private String menu; 27 | 28 | private Date created_at; 29 | 30 | private Date updated_at; 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Dining/DiningTimeEnum.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Dining; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | import java.util.Arrays; 7 | 8 | @Getter 9 | @AllArgsConstructor 10 | public enum DiningTimeEnum { 11 | BREAKFAST("아침"), 12 | LUNCH("점심"), 13 | DINNER("저녁"), 14 | ; 15 | 16 | private final String diningTimeKor; 17 | 18 | public static DiningTimeEnum findByKorName(String korName) throws IllegalArgumentException { 19 | return Arrays.stream(DiningTimeEnum.values()) 20 | .filter(diningTimeEnum -> diningTimeEnum.getDiningTimeKor().equalsIgnoreCase(korName)) 21 | .findFirst() 22 | .orElseThrow(IllegalArgumentException::new); 23 | } 24 | 25 | public static String convertToEngName(String korName) throws IllegalArgumentException { 26 | return findByKorName(korName).name(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/ErrorMessage.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class ErrorMessage { 7 | private Map map; 8 | private String message; 9 | private int code; 10 | 11 | public ErrorMessage(String message, int code) { 12 | this.message = message; 13 | this.code = code; 14 | 15 | update(); 16 | } 17 | 18 | private void update() { 19 | map = new HashMap(); 20 | map.put("error", new HashMap() {{ 21 | put("message", message); 22 | put("code", code); 23 | }}); 24 | } 25 | 26 | public Map getMap() { 27 | return map; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Faq/FaqResponseType.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Faq; 2 | 3 | public class FaqResponseType { 4 | private static String[] toAdminArray = new String[] { 5 | }; 6 | 7 | private static String[] toArray = new String[] { 8 | "class", 9 | "created_at", 10 | "is_deleted", 11 | "updated_at", 12 | }; 13 | 14 | public static String[] getAdminArray () { 15 | return toAdminArray; 16 | } 17 | 18 | public static String[] getArray () { 19 | return toArray; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Global/UpdatedAt.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Global; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | import lombok.RequiredArgsConstructor; 6 | 7 | @RequiredArgsConstructor(staticName = "from") 8 | public class UpdatedAt { 9 | private static final String DATE_FORM = "yyyy-MM-dd"; 10 | private static final SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat(DATE_FORM); 11 | 12 | private final Date updatedAt; 13 | 14 | public String dateForm() { 15 | return SIMPLE_DATE_FORMAT.format(updatedAt); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/LostAndFound/LostItemCommentResponseType.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.LostAndFound; 2 | 3 | public class LostItemCommentResponseType { 4 | private static String[] toAdminArray = new String[] { 5 | }; 6 | 7 | private static String[] toArray = new String[] { 8 | "class", 9 | "user_id", 10 | "is_deleted", 11 | "lost_item_id", 12 | }; 13 | 14 | public static String[] getAdminArray () { 15 | return toAdminArray; 16 | } 17 | 18 | public static String[] getArray () { 19 | return toArray; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/LostAndFound/LostItemResponseType.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.LostAndFound; 2 | 3 | public class LostItemResponseType { 4 | private static String[] toAdminArray = new String[] { 5 | }; 6 | 7 | private static String[] toArray = new String[] { 8 | "class", 9 | "user_id", 10 | "is_deleted", 11 | "ip", 12 | }; 13 | 14 | public static String[] getAdminArray () { 15 | return toAdminArray; 16 | } 17 | 18 | public static String[] getArray () { 19 | return toArray; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Mail/MailForm.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Mail; 2 | 3 | public enum MailForm { 4 | OWNER_REGISTRATION_MAIL_FORM("코인 사장님 회원가입 이메일 인증", "mail/owner_certificate_number.vm"), 5 | OWNER_FIND_PASSWORD_MAIL_FORM("코인 사장님 비밀번호 찾기 이메일 인증", "mail/change_password_certificate_number.vm"); 6 | 7 | private final String subject; 8 | private final String path; 9 | 10 | MailForm(String subject, String path) { 11 | this.subject = subject; 12 | this.path = path; 13 | } 14 | 15 | public String getSubject() { 16 | return subject; 17 | } 18 | 19 | public String getPath() { 20 | return path; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/MarketPlace/ItemCommentResponseType.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.MarketPlace; 2 | 3 | public class ItemCommentResponseType { 4 | private static String[] toAdminArray = new String[] { 5 | }; 6 | 7 | private static String[] toArray = new String[] { 8 | "class", 9 | "user_id", 10 | "is_deleted", 11 | "item_id", 12 | }; 13 | 14 | public static String[] getAdminArray () { 15 | return toAdminArray; 16 | } 17 | 18 | public static String[] getArray () { 19 | return toArray; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/MarketPlace/ItemResponseType.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.MarketPlace; 2 | 3 | public class ItemResponseType { 4 | private static String[] toAdminArray = new String[] { 5 | }; 6 | 7 | private static String[] toArray = new String[] { 8 | "class", 9 | "user_id", 10 | "is_deleted", 11 | "ip", 12 | }; 13 | 14 | public static String[] getAdminArray () { 15 | return toAdminArray; 16 | } 17 | 18 | public static String[] getArray () { 19 | return toArray; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/MarketPlace/ItemViewLog.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.MarketPlace; 2 | 3 | import java.util.Date; 4 | 5 | public class ItemViewLog { 6 | private Integer id; 7 | private Integer item_id; 8 | private Integer user_id; 9 | private Date expired_at; 10 | private String ip; 11 | 12 | public Integer getId() { 13 | return id; 14 | } 15 | 16 | public void setId(Integer id) { 17 | this.id = id; 18 | } 19 | 20 | public Integer getItem_id() { 21 | return item_id; 22 | } 23 | 24 | public void setItem_id(Integer item_id) { 25 | this.item_id = item_id; 26 | } 27 | 28 | public Integer getUser_id() { 29 | return user_id; 30 | } 31 | 32 | public void setUser_id(Integer user_id) { 33 | this.user_id = user_id; 34 | } 35 | 36 | public Date getExpired_at() { 37 | return expired_at; 38 | } 39 | 40 | public void setExpired_at(Date expired_at) { 41 | this.expired_at = expired_at; 42 | } 43 | 44 | public String getIp() { 45 | return ip; 46 | } 47 | 48 | public void setIp(String ip) { 49 | this.ip = ip; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/RedisOwnerKeyPrefix.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain; 2 | 3 | public enum RedisOwnerKeyPrefix { 4 | ownerAuthPrefix("owner@"), 5 | ownerChangePasswordAuthPrefix("owner_password_change@"); 6 | 7 | private final String prefixOfKey; 8 | 9 | RedisOwnerKeyPrefix(String prefixOfKey) { 10 | this.prefixOfKey = prefixOfKey; 11 | } 12 | 13 | public String getKey(String suffix) { 14 | return prefixOfKey+suffix; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Shop/ShopOpen.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Shop; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | 8 | import java.time.DayOfWeek; 9 | import java.util.*; 10 | 11 | @Getter @Builder 12 | @NoArgsConstructor 13 | @AllArgsConstructor 14 | public class ShopOpen { 15 | private Integer id; 16 | private Integer shop_id; 17 | private DayOfWeek day_of_week; 18 | private Boolean closed; 19 | private String open_time; 20 | private String close_time; 21 | private Boolean is_deleted; 22 | private Date created_at; 23 | private Date updated_at; 24 | 25 | public static ShopOpen of(Integer shopId, DayOfWeek dayOfWeek, Boolean closed, String openTime, String closeTime) { 26 | return new ShopOpen(shopId, dayOfWeek, closed, openTime, closeTime); 27 | } 28 | 29 | private ShopOpen(Integer shopId, DayOfWeek dayOfWeek, Boolean closed, String openTime, String closeTime) { 30 | this.shop_id = shopId; 31 | this.day_of_week = dayOfWeek; 32 | this.closed = closed; 33 | this.open_time = openTime; 34 | this.close_time = closeTime; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Shop/ShopResponseType.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Shop; 2 | 3 | public class ShopResponseType { 4 | private static String[] toAdminArray = new String[] { 5 | }; 6 | 7 | private static String[] toArray = new String[] { 8 | "class", 9 | "created_at", 10 | "updated_at", 11 | "internal_name", 12 | }; 13 | 14 | public static String[] getAdminArray () { 15 | return toAdminArray; 16 | } 17 | 18 | public static String[] getArray () { 19 | return toArray; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/TemporaryCommunity/TempArticleResponseType.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.TemporaryCommunity; 2 | 3 | public class TempArticleResponseType { 4 | private static String[] toAdminArray = new String[] { 5 | }; 6 | 7 | private static String[] toArray = new String[] { 8 | "class", 9 | "is_deleted", 10 | "password", 11 | }; 12 | 13 | public static String[] getAdminArray () { 14 | return toAdminArray; 15 | } 16 | 17 | public static String[] getArray () { 18 | return toArray; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/TemporaryCommunity/TempCommentResponseType.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.TemporaryCommunity; 2 | 3 | public class TempCommentResponseType { 4 | private static String[] toAdminArray = new String[] { 5 | }; 6 | 7 | private static String[] toArray = new String[] { 8 | "class", 9 | "article_id", 10 | "is_deleted", 11 | "password", 12 | }; 13 | 14 | public static String[] getAdminArray () { 15 | return toAdminArray; 16 | } 17 | 18 | public static String[] getArray () { 19 | return toArray; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/TemporaryCommunity/TempCommunityResponseType.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.TemporaryCommunity; 2 | 3 | public class TempCommunityResponseType { 4 | private static String[] toAdminArray = new String[] { 5 | }; 6 | 7 | private static String[] toArray = new String[] { 8 | "password", 9 | }; 10 | 11 | private static String[] toCommentArray = new String[] { 12 | "password", 13 | }; 14 | 15 | public static String[] getAdminArray () { 16 | return toAdminArray; 17 | } 18 | 19 | public static String[] getArray () { 20 | return toArray; 21 | } 22 | 23 | public static String[] getCommentArray () { 24 | return toCommentArray; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/TimeTable/Semester.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.TimeTable; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | 5 | import java.util.Arrays; 6 | import java.util.regex.Pattern; 7 | 8 | public class Semester { 9 | @ApiModelProperty(notes = "id", example = "1") 10 | private Integer id; 11 | 12 | @ApiModelProperty(notes = "학기", example = "20192") 13 | private String semester; 14 | 15 | public Integer getId() { 16 | return id; 17 | } 18 | 19 | public String getSemester() { 20 | return semester; 21 | } 22 | 23 | public void setId(Integer id) { 24 | this.id = id; 25 | } 26 | 27 | public void setSemester(String semester) { 28 | this.semester = semester; 29 | } 30 | } -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Upload/ByteSize.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Upload; 2 | 3 | import koreatech.in.exception.BaseException; 4 | import koreatech.in.exception.ExceptionInformation; 5 | import lombok.RequiredArgsConstructor; 6 | 7 | @RequiredArgsConstructor 8 | public class ByteSize { 9 | 10 | private static final long ZERO = 0L; 11 | private static final int RIGHT_IS_BIGGER = -1; 12 | 13 | private Long getSize() { 14 | return size; 15 | } 16 | 17 | public void validateAcceptable(ByteSize candidate) { 18 | if (getSize().compareTo(candidate.getSize()) == RIGHT_IS_BIGGER) { 19 | throw new BaseException(ExceptionInformation.FILE_SIZE_OVER); 20 | } 21 | } 22 | 23 | private final Long size; 24 | 25 | public static ByteSize from(Long size) { 26 | validates(size); 27 | return new ByteSize(size); 28 | } 29 | 30 | private static void validates(Long size) { 31 | if(size.compareTo(ZERO) == RIGHT_IS_BIGGER) { 32 | throw new BaseException(ExceptionInformation.FILE_INVALID); 33 | } 34 | } 35 | 36 | public static final Long _10_MB = 10_000_000L; 37 | public static ByteSize DEFAULT = from(_10_MB); 38 | public static ByteSize OWNER_MAX_SIZE = from(_10_MB); 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Upload/ContentTypes.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Upload; 2 | 3 | import static java.util.Arrays.asList; 4 | import static java.util.Collections.singletonList; 5 | 6 | import java.util.List; 7 | import koreatech.in.exception.BaseException; 8 | import koreatech.in.exception.ExceptionInformation; 9 | import lombok.RequiredArgsConstructor; 10 | 11 | @RequiredArgsConstructor 12 | public class ContentTypes { 13 | 14 | private final List contentTypes; 15 | 16 | public static ContentTypes from(List contentTypes) { 17 | return new ContentTypes(contentTypes); 18 | } 19 | 20 | public void validateAcceptable(ContentType candidate) { 21 | contentTypes.stream() 22 | .filter(c -> c.isAcceptable(candidate)).findAny() 23 | .orElseThrow(() -> new BaseException(ExceptionInformation.UNEXPECTED_FILE_CONTENT_TYPE)); 24 | } 25 | 26 | public static ContentTypes ALL = from(singletonList(ContentType.ALL)); 27 | public static ContentTypes DEFAULT = ALL; 28 | public static ContentTypes IMAGE_ALL = from(singletonList(ContentType.IMAGE_ALL)); 29 | public static ContentTypes OWNER_LIMIT = from(asList(ContentType.IMAGE_ALL, ContentType.PDF)); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Upload/FileExtensionName.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Upload; 2 | 3 | import lombok.RequiredArgsConstructor; 4 | 5 | @RequiredArgsConstructor(staticName = "from") 6 | public class FileExtensionName { 7 | private final String originalFileName; 8 | 9 | static private final String EXTENSION_SEPARATOR = "."; 10 | static private final String NO_EXTENSION = ""; 11 | 12 | public String getExtensionWithSeparator() { 13 | 14 | int extensionStartIndex = originalFileName.lastIndexOf(EXTENSION_SEPARATOR) + 1; 15 | 16 | if (!hasExtension(extensionStartIndex)) { 17 | return NO_EXTENSION; 18 | } 19 | 20 | return EXTENSION_SEPARATOR + originalFileName.substring(extensionStartIndex); 21 | } 22 | 23 | //"test", ".gitignore" 같은 경우 false 반환 24 | private boolean hasExtension(int extensionStartIndex) { 25 | return extensionStartIndex > 1; 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Upload/PreSignedUrlResult.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Upload; 2 | 3 | import java.util.Date; 4 | 5 | import lombok.Getter; 6 | import lombok.RequiredArgsConstructor; 7 | 8 | @Getter 9 | @RequiredArgsConstructor(staticName = "of") 10 | public class PreSignedUrlResult { 11 | 12 | private final String url; 13 | private final Date expiration; 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Upload/UploadFile.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Upload; 2 | 3 | import java.io.IOException; 4 | 5 | import org.springframework.web.multipart.MultipartFile; 6 | 7 | import lombok.AllArgsConstructor; 8 | 9 | 10 | @AllArgsConstructor 11 | public class UploadFile { 12 | 13 | private final UploadFileFullPath fullPath; 14 | private final byte[] data; 15 | 16 | public String getFullPath() { 17 | return fullPath.unixValue(); 18 | } 19 | 20 | public byte[] getData() { 21 | return data; 22 | } 23 | 24 | public String getFileName() { 25 | return fullPath.getFileFullName(); 26 | } 27 | 28 | public static UploadFile of(MultipartFile multipartFile, String domainPath) throws IOException { 29 | UploadFileFullPath uploadFileFullPath = UploadFileFullPath.of(domainPath, multipartFile.getOriginalFilename()); 30 | 31 | return new UploadFile(uploadFileFullPath, multipartFile.getBytes()); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Upload/UploadFileLocation.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Upload; 2 | 3 | import lombok.Getter; 4 | 5 | @Getter 6 | public class UploadFileLocation { 7 | 8 | private static final String HTTPS_PROTOCOL = "https://"; 9 | 10 | private final String fileUrl; 11 | private final String fileName; 12 | 13 | private UploadFileLocation(String fileUrl, String fileName) { 14 | this.fileUrl = fileUrl; 15 | this.fileName = fileName; 16 | } 17 | 18 | public static UploadFileLocation of(String domainName, UploadFile uploadFile) { 19 | return new UploadFileLocation(HTTPS_PROTOCOL + domainName + UploadFileFullPath.SLASH + uploadFile.getFullPath(), 20 | uploadFile.getFileName()); 21 | } 22 | 23 | public static UploadFileLocation of(String domainName, UploadFileFullPath uploadFileFullPath) { 24 | return new UploadFileLocation( 25 | HTTPS_PROTOCOL + domainName + UploadFileFullPath.SLASH + uploadFileFullPath.unixValue(), 26 | uploadFileFullPath.getFileFullName()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Upload/UploadFileMetaData.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Upload; 2 | 3 | import lombok.Getter; 4 | import lombok.RequiredArgsConstructor; 5 | 6 | @RequiredArgsConstructor 7 | @Getter 8 | public class UploadFileMetaData { 9 | 10 | private final String fileName; 11 | private final String contentType; 12 | private final Long contentLength; 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Upload/UploadFiles.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Upload; 2 | 3 | import java.io.IOException; 4 | import java.util.Collections; 5 | import java.util.List; 6 | import java.util.stream.Collectors; 7 | 8 | import org.springframework.web.multipart.MultipartFile; 9 | 10 | import koreatech.in.exception.BaseException; 11 | import koreatech.in.exception.ExceptionInformation; 12 | import lombok.AllArgsConstructor; 13 | 14 | @AllArgsConstructor 15 | public class UploadFiles { 16 | private final List uploadFiles; 17 | 18 | public static UploadFiles of(List multipartFiles, String domainPath) { 19 | List files = multipartFiles.stream() 20 | .map(multipartFile -> makeFile(multipartFile, domainPath)) 21 | .collect(Collectors.toList()); 22 | 23 | return new UploadFiles(files); 24 | } 25 | 26 | private static UploadFile makeFile(MultipartFile multipartFile, String domainPath) { 27 | try { 28 | return UploadFile.of(multipartFile, domainPath); 29 | } catch (IOException e) { 30 | throw new BaseException(ExceptionInformation.FILE_INVALID); 31 | } 32 | } 33 | 34 | public List getUploadFiles() { 35 | return Collections.unmodifiableList(uploadFiles); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Upload/UploadFilesLocation.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Upload; 2 | 3 | import java.util.List; 4 | import lombok.Getter; 5 | import lombok.RequiredArgsConstructor; 6 | 7 | @Getter 8 | @RequiredArgsConstructor(staticName = "from") 9 | public class UploadFilesLocation { 10 | private final List uploadFilesResult; 11 | 12 | public void append(UploadFileLocation uploadFileLocation) { 13 | uploadFilesResult.add(uploadFileLocation); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/User/AuthResult.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.User; 2 | 3 | import lombok.Getter; 4 | import lombok.RequiredArgsConstructor; 5 | import lombok.Setter; 6 | 7 | @Getter() 8 | @Setter 9 | @RequiredArgsConstructor(staticName = "of") 10 | public class AuthResult { 11 | 12 | private final boolean isSuccess; 13 | private final String errorMessage; 14 | 15 | 16 | public static AuthResult USER_NOT_FOUND = AuthResult.of( 17 | false, "토큰에 해당하는 사용자를 찾을 수 없습니다."); 18 | public static AuthResult ALREADY_AUTHENTICATION = AuthResult.of( 19 | false, "이미 인증된 사용자입니다."); 20 | public static AuthResult TOKEN_EXPIRED = AuthResult.of( 21 | false, "이미 만료된 토큰입니다."); 22 | public static AuthResult SUCCESS = AuthResult.of( 23 | true , null); 24 | 25 | public static AuthResult from(User user) { 26 | if(user == null) { 27 | return USER_NOT_FOUND; 28 | } 29 | if(user.isAuthenticated()) { 30 | return ALREADY_AUTHENTICATION; 31 | } 32 | if(user.isAuthTokenExpired()) { 33 | return TOKEN_EXPIRED; 34 | } 35 | return SUCCESS; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/User/AuthToken.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.User; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Getter 7 | @Setter 8 | public class AuthToken { 9 | 10 | private String token; 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/User/LocalParts.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.User; 2 | 3 | import lombok.Getter; 4 | 5 | @Getter 6 | public class LocalParts { 7 | public static final int BEGIN_INDEX = 0; 8 | 9 | private final String value; 10 | 11 | private LocalParts(String value) { 12 | this.value = value; 13 | } 14 | 15 | private static String localPartsFor(String fullAddress) { 16 | return fullAddress.substring(BEGIN_INDEX, EmailAddress.getSeparateIndex(fullAddress)); 17 | } 18 | 19 | public static LocalParts from(String fullAddress) { 20 | EmailAddress.validates(fullAddress); 21 | 22 | return new LocalParts(localPartsFor(fullAddress)); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/User/PageInfo.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.User; 2 | 3 | import koreatech.in.exception.BaseException; 4 | import lombok.Builder; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | import static koreatech.in.exception.ExceptionInformation.PAGE_NOT_FOUND; 9 | 10 | @Getter 11 | public class PageInfo { 12 | Integer totalPage; 13 | Integer totalCount; 14 | Integer currentCount; 15 | Integer currentPage; 16 | Integer limit; 17 | 18 | @Builder 19 | private PageInfo(Integer totalCount, Integer currentCount, Integer currentPage, Integer limit) { 20 | this.totalCount = totalCount; 21 | this.currentCount = currentCount; 22 | this.currentPage = currentPage; 23 | this.limit = limit; 24 | this.totalPage = extractTotalPage(); 25 | validatePageInfo(); 26 | } 27 | 28 | private Integer extractTotalPage() { 29 | return totalCount.equals(0) ? 1 : (int) Math.ceil((double) totalCount / this.limit); 30 | } 31 | 32 | private void validatePageInfo() { 33 | if (currentPage > totalPage) { 34 | throw new BaseException(PAGE_NOT_FOUND); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/User/UserResponseType.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.User; 2 | 3 | public class UserResponseType { 4 | private static String[] toAdminArray = new String[] { 5 | }; 6 | 7 | private static String[] toArray = new String[] { 8 | "class", 9 | "password", 10 | "remember_token", 11 | "created_at", 12 | "updated_at", 13 | "is_authed", 14 | "auth_token", 15 | "auth_expired_at", 16 | "reset_token", 17 | "reset_expired_at", 18 | "last_logged_at", 19 | "is_deleted", 20 | }; 21 | 22 | public static String[] getAdminArray () { 23 | return toAdminArray; 24 | } 25 | 26 | public static String[] getArray () { 27 | return toArray; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/User/UserType.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.User; 2 | 3 | import java.util.Arrays; 4 | import koreatech.in.domain.User.owner.Owner; 5 | import koreatech.in.domain.User.student.Student; 6 | import lombok.Getter; 7 | import lombok.RequiredArgsConstructor; 8 | 9 | @RequiredArgsConstructor 10 | @Getter 11 | public enum UserType { 12 | OWNER(Owner.class, "사장님"), 13 | STUDENT(Student.class, "학생"), 14 | USER(User.class, "사용자"); 15 | 16 | private final Class userClass; 17 | private final String text; 18 | 19 | public static UserType mappingFor(User user) { 20 | Class currClass = user.getClass(); 21 | return mappingFor(currClass); 22 | } 23 | 24 | private static UserType mappingFor(Class currClass) { 25 | return Arrays.stream(values()) 26 | .filter(userType -> userType.userClass.equals(currClass)) 27 | .findAny() 28 | .orElseGet(() -> mappingFor((Class) currClass.getSuperclass())); 29 | } 30 | } -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/User/Users.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.User; 2 | 3 | import java.util.List; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | @Getter 8 | @Setter 9 | public class Users { 10 | 11 | private List users; 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/User/owner/CertificationCode.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.User.owner; 2 | 3 | import lombok.Getter; 4 | 5 | @Getter 6 | public class CertificationCode { 7 | 8 | private final String value; 9 | 10 | private CertificationCode(String value) { 11 | this.value = value; 12 | } 13 | 14 | public static CertificationCode from(String value) { 15 | return new CertificationCode(value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/User/owner/OwnerAttachment.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.User.owner; 2 | 3 | import java.util.Date; 4 | import koreatech.in.domain.Upload.UploadFileFullName; 5 | import koreatech.in.domain.Upload.UploadFileFullPath; 6 | import koreatech.in.exception.BaseException; 7 | import koreatech.in.exception.ExceptionInformation; 8 | import lombok.AllArgsConstructor; 9 | import lombok.Builder; 10 | import lombok.Getter; 11 | import lombok.NoArgsConstructor; 12 | import lombok.Setter; 13 | 14 | @Getter @Setter 15 | @Builder 16 | @NoArgsConstructor @AllArgsConstructor 17 | public class OwnerAttachment { 18 | 19 | private Integer id; 20 | private Integer ownerId; 21 | private String fileUrl; 22 | private Boolean isDeleted; 23 | private Date updateAt; 24 | 25 | public String fileName() { 26 | //TODO 23.02.25. 박한수 해당 위치에서, 파일 도메인이 `owners`인지 검사를 추가해야 할지..? 27 | String separator = UploadFileFullPath.SLASH; 28 | int separateIndex = fileUrl.lastIndexOf(separator); 29 | 30 | if (separateIndex == UploadFileFullName.NOT_FOUND_INDEX) { 31 | throw new BaseException(ExceptionInformation.UPLOAD_FILE_URL_INVALID); 32 | } 33 | 34 | return fileUrl.substring(separateIndex + separator.length()); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/User/owner/OwnerInCertification.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.User.owner; 2 | 3 | import koreatech.in.domain.User.EmailAddress; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Getter; 6 | 7 | @Getter 8 | @AllArgsConstructor 9 | public class OwnerInCertification extends Owner { 10 | 11 | private final String certificationCode; 12 | 13 | private OwnerInCertification(String emailFullPath, String certificationCode) { 14 | this.email = emailFullPath; 15 | this.certificationCode = certificationCode; 16 | } 17 | 18 | public static OwnerInCertification from(EmailAddress emailAddress, CertificationCode certificationCode) { 19 | return new OwnerInCertification(emailAddress.getEmailAddress(), certificationCode.getValue()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/User/owner/OwnerIncludingShop.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.User.owner; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Builder; 7 | import lombok.Getter; 8 | import lombok.NoArgsConstructor; 9 | import lombok.Setter; 10 | 11 | @Getter 12 | @Setter 13 | @NoArgsConstructor 14 | public class OwnerIncludingShop extends Owner { 15 | private Integer shop_id; 16 | private String shop_name; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/User/owner/OwnerPartition.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.User.owner; 2 | 3 | import java.util.List; 4 | 5 | public class OwnerPartition extends Owner { 6 | @Override 7 | public void setCompany_registration_number(String company_registration_number) { 8 | throw new UnsupportedOperationException(); 9 | } 10 | 11 | @Override 12 | public void setAttachments(List attachments) { 13 | throw new UnsupportedOperationException(); 14 | } 15 | 16 | @Override 17 | public boolean hasRegistrationInformation() { 18 | return false; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/User/owner/OwnerShop.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.User.owner; 2 | 3 | import com.fasterxml.jackson.annotation.JsonCreator; 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Builder; 8 | import lombok.Getter; 9 | import lombok.RequiredArgsConstructor; 10 | import lombok.Setter; 11 | 12 | @Getter 13 | @Setter 14 | @Builder 15 | @JsonIgnoreProperties(ignoreUnknown = true) 16 | public class OwnerShop { 17 | private Integer owner_id; 18 | private Integer shop_id; 19 | private String shop_name; 20 | 21 | @JsonCreator 22 | public OwnerShop(@JsonProperty("owner_id") Integer owner_id, 23 | @JsonProperty("shop_id") Integer shop_id, 24 | @JsonProperty("shop_name") String shop_name) { 25 | this.owner_id = owner_id; 26 | this.shop_id = shop_id; 27 | this.shop_name = shop_name; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Version/BatchVersion.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Version; 2 | 3 | import koreatech.in.util.DateUtil; 4 | import lombok.Getter; 5 | 6 | @Getter 7 | public class BatchVersion { 8 | private static final Character ZERO_PADDING = '0'; 9 | private final String version; 10 | private final VersionTypeEnum type; 11 | 12 | private BatchVersion(String version, VersionTypeEnum type) { 13 | this.version = version; 14 | this.type = type; 15 | } 16 | 17 | public static BatchVersion from(VersionTypeEnum type) { 18 | return new BatchVersion(makeVersion(), type); 19 | } 20 | 21 | private static String makeVersion() { 22 | return String.format("%s%c_%d", DateUtil.getYearOfNow(), ZERO_PADDING, DateUtil.getTimeStampSecondOfNow() ); 23 | } 24 | public String getType() { 25 | return type.getType(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/domain/Version/VersionTypeEnum.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.domain.Version; 2 | 3 | import java.util.Arrays; 4 | import java.util.Set; 5 | import java.util.stream.Collectors; 6 | import koreatech.in.exception.BaseException; 7 | import koreatech.in.exception.ExceptionInformation; 8 | 9 | public enum VersionTypeEnum { 10 | ANDROID("android"), 11 | TIMETABLE("timetable"), 12 | SHUTTLE("shuttle_bus_timetable"), 13 | CITY("city_bus_timetable"), 14 | EXPRESS("express_bus_timetable"), 15 | ; 16 | 17 | private final String type; 18 | 19 | VersionTypeEnum(String type) { 20 | this.type = type; 21 | } 22 | 23 | public String getType() { 24 | return type; 25 | } 26 | 27 | public static void validates(String typeName) { 28 | Set types = Arrays.stream(VersionTypeEnum.values()) 29 | .map(VersionTypeEnum::getType) 30 | .collect(Collectors.toSet()); 31 | 32 | if(types.contains(typeName)) { 33 | return; 34 | } 35 | 36 | throw new BaseException(ExceptionInformation.VERSION_TYPE_NOT_FOUND); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/EmptyResponse.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto; 2 | 3 | /* 4 | 200번대(성공) 응답시 사용 5 | */ 6 | public class EmptyResponse { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/ExceptionResponse.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Getter; 6 | 7 | @Getter 8 | @AllArgsConstructor 9 | public class ExceptionResponse { 10 | @ApiModelProperty(notes = "에러 코드", required = true) 11 | private Integer code; 12 | @ApiModelProperty(notes = "에러 메시지", required = true) 13 | private String message; 14 | 15 | public static ExceptionResponse of(Integer code, String message) { 16 | return new ExceptionResponse(code, message); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/RequestDataInvalidResponse.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto; 2 | 3 | import lombok.Getter; 4 | 5 | import java.util.List; 6 | 7 | @Getter 8 | public class RequestDataInvalidResponse extends ExceptionResponse { 9 | private final List violations; 10 | 11 | private RequestDataInvalidResponse(Integer code, String message, List violations) { 12 | super(code, message); 13 | this.violations = violations; 14 | } 15 | 16 | public static RequestDataInvalidResponse of(Integer code, String message, List violations) { 17 | return new RequestDataInvalidResponse(code, message, violations); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/admin/auth/TokenRefreshRequest.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.admin.auth; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategy; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | 10 | @Getter 11 | @Setter 12 | @NoArgsConstructor 13 | @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) 14 | public class TokenRefreshRequest { 15 | @ApiModelProperty( 16 | required = true, 17 | notes = "리프레시 토큰", 18 | example = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" 19 | ) 20 | private String refreshToken; 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/admin/auth/TokenRefreshResponse.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.admin.auth; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategy; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import io.swagger.annotations.ApiModelProperty; 7 | import lombok.Getter; 8 | import lombok.NoArgsConstructor; 9 | import lombok.experimental.SuperBuilder; 10 | 11 | @Getter 12 | @SuperBuilder 13 | @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) 14 | @NoArgsConstructor 15 | public class TokenRefreshResponse { 16 | @ApiModelProperty( 17 | required = true, 18 | notes = "신규 액세스 토큰", 19 | example = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" 20 | ) 21 | @JsonProperty("token") // 버전 호환성 위해 token으로 응답 22 | private String accessToken; 23 | 24 | @ApiModelProperty( 25 | required = true, 26 | notes = "신규 리프레시 토큰", 27 | example = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" 28 | ) 29 | private String refreshToken; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/admin/member/response/MemberResponse.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.admin.member.response; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Builder; 5 | import lombok.Getter; 6 | 7 | @Getter @Builder 8 | public class MemberResponse { 9 | @ApiModelProperty(notes = "고유 id", example = "1", required = true) 10 | private Integer id; 11 | 12 | @ApiModelProperty(notes = "이름", example = "김주원", required = true) 13 | private String name; 14 | 15 | @ApiModelProperty(notes = "학번", example = "2019136037") 16 | private String student_number; 17 | 18 | @ApiModelProperty(notes = "트랙 이름", example = "BackEnd", required = true) 19 | private String track; 20 | 21 | @ApiModelProperty(notes = "직책", example = "Regular", required = true) 22 | private String position; 23 | 24 | @ApiModelProperty(notes = "이메일", example = "damiano102777@naver.com") 25 | private String email; 26 | 27 | @ApiModelProperty(notes = "이미지 url", example = "https://static.koreatech.in/example.png") 28 | private String image_url; 29 | 30 | @ApiModelProperty(notes = "삭제(soft delete) 여부", example = "false", required = true) 31 | private Boolean is_deleted; 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/admin/shop/request/CreateShopCategoryRequest.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.admin.shop.request; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | import javax.validation.constraints.NotNull; 8 | import javax.validation.constraints.Size; 9 | 10 | @Getter @Setter 11 | public class CreateShopCategoryRequest { 12 | @Size(min = 1, max = 25, message = "이름의 길이는 1자 이상 25자 이하입니다.") 13 | @NotNull(message = "이름은 필수입니다.") 14 | @ApiModelProperty(notes = "카테고리명 \n" + 15 | "- not null \n" + 16 | "- 1자 이상 25자 이하", example = "햄버거", required = true) 17 | private String name; 18 | 19 | @Size(max = 255, message = "이미지 URL은 초대 255자입니다.") 20 | @NotNull(message = "이미지는 필수입니다.") 21 | @ApiModelProperty(notes = "이미지 URL \n" + 22 | "- not null \n" + 23 | "- 최대 255자", example = "https://static.koreatech.in/test.png", required = true) 24 | private String image_url; 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/admin/shop/request/CreateShopMenuCategoryRequest.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.admin.shop.request; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | import javax.validation.constraints.NotNull; 8 | import javax.validation.constraints.Size; 9 | 10 | @Getter @Setter 11 | public class CreateShopMenuCategoryRequest { 12 | @Size(min = 1, max = 15, message = "이름의 길이는 1자 이상 15자 이하입니다.") 13 | @NotNull(message = "이름은 필수입니다.") 14 | @ApiModelProperty(notes = "카테고리명 \n" + 15 | "- not null \n" + 16 | "- 1자 이상 15자 이하", example = "사이드 메뉴", required = true) 17 | private String name; 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/admin/shop/request/UpdateShopCategoryRequest.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.admin.shop.request; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | import javax.validation.constraints.NotNull; 8 | import javax.validation.constraints.Size; 9 | 10 | @Getter @Setter 11 | public class UpdateShopCategoryRequest { 12 | @Size(min = 1, max = 25, message = "이름의 길이는 1자 이상 25자 이하입니다.") 13 | @NotNull(message = "이름은 필수입니다.") 14 | @ApiModelProperty(notes = "카테고리명 \n" + 15 | "- not null \n" + 16 | "- 1자 이상 25자 이하", example = "햄버거", required = true) 17 | private String name; 18 | 19 | @Size(max = 255, message = "이미지 URL의 길이는 최대 255자입니다.") 20 | @NotNull(message = "이미지는 필수입니다.") 21 | @ApiModelProperty(notes = "이미지 URL \n" + 22 | "- not null \n" + 23 | "- 최대 255자", example = "https://static.koreatech.in/test.png", required = true) 24 | private String image_url; 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/admin/shop/request/UpdateShopMenuCategoryRequest.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.admin.shop.request; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import javax.validation.constraints.NotNull; 5 | import javax.validation.constraints.Size; 6 | import lombok.Getter; 7 | import lombok.Setter; 8 | 9 | @Getter @Setter 10 | public class UpdateShopMenuCategoryRequest { 11 | @ApiModelProperty(notes = "상점 카테고리 고유 id", example = "1", required = true) 12 | private Integer id; 13 | 14 | @Size(min = 1, max = 15, message = "이름의 길이는 1자 이상 15자 이하입니다.") 15 | @NotNull(message = "이름은 필수입니다.") 16 | @ApiModelProperty(notes = "카테고리명 \n" + 17 | "- not null \n" + 18 | "- 1자 이상 15자 이하", example = "사이드 메뉴", required = true) 19 | private String name; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/admin/shop/response/ShopCategoryResponse.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.admin.shop.response; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Builder; 5 | import lombok.Getter; 6 | 7 | @Getter @Builder 8 | public class ShopCategoryResponse { 9 | @ApiModelProperty(notes = "고유 id", required = true) 10 | private Integer id; 11 | 12 | @ApiModelProperty(notes = "이름", required = true) 13 | private String name; 14 | 15 | @ApiModelProperty(notes = "이미지 URL", required = true) 16 | private String image_url; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/admin/user/owner/response/OwnerUpdateResponse.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.admin.user.owner.response; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategy; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import io.swagger.annotations.ApiModel; 6 | import io.swagger.annotations.ApiModelProperty; 7 | import koreatech.in.dto.admin.user.response.UserUpdateResponse; 8 | import lombok.Getter; 9 | import lombok.NoArgsConstructor; 10 | import lombok.experimental.SuperBuilder; 11 | 12 | @Getter 13 | @SuperBuilder 14 | @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) 15 | @NoArgsConstructor 16 | @ApiModel("AdminOwnerUpdateResponse") 17 | public class OwnerUpdateResponse extends UserUpdateResponse { 18 | @ApiModelProperty(notes = "사업자등록번호" + "- 최대 12자", example = "012-34-56789") 19 | private String company_registration_number; 20 | 21 | @ApiModelProperty(notes = "상점 수정 권한", example = "false") 22 | private Boolean grant_shop; 23 | 24 | @ApiModelProperty(notes = "이벤트수정권한", example = "false") 25 | private Boolean grant_event; 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/admin/user/request/LoginRequest.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.admin.user.request; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import javax.validation.constraints.Email; 6 | import javax.validation.constraints.NotNull; 7 | import lombok.Getter; 8 | import lombok.Setter; 9 | 10 | @Getter @Setter @ApiModel("AdminLoginRequest") 11 | public class LoginRequest { 12 | // TODO 23.02.12. Admin의 이메일을 이용가능한 동아리 내 메일로 변경하기. 13 | @Email(message = "이메일 형식이 올바르지 않습니다.") 14 | @NotNull(message = "이메일은 필수입니다.") 15 | @ApiModelProperty(notes = "이메일 주소 \n" 16 | + "- not null \n" 17 | + "- 이메일 형식이어야 함" 18 | , required = true 19 | , example = "abcd@gmail.com" 20 | ) 21 | private String email; 22 | 23 | @NotNull(message = "비밀번호는 필수입니다.") 24 | @ApiModelProperty(notes = "비밀번호", required = true) 25 | private String password; 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/admin/user/response/LoginResponse.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.admin.user.response; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategy; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import io.swagger.annotations.ApiModel; 7 | import io.swagger.annotations.ApiModelProperty; 8 | import lombok.Getter; 9 | import lombok.experimental.SuperBuilder; 10 | 11 | @Getter 12 | @SuperBuilder 13 | @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) 14 | @ApiModel("AdminLoginResponse") 15 | public class LoginResponse { 16 | @ApiModelProperty( 17 | notes = "액세스 토큰", 18 | required = true, 19 | example = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" 20 | ) 21 | @JsonProperty("token") // 버전 호환성 위해 token으로 응답 22 | private final String accessToken; 23 | 24 | @ApiModelProperty( 25 | notes = "리프레시 토큰", 26 | required = true, 27 | example = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" 28 | ) 29 | private final String refreshToken; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/admin/user/response/OwnerResponse.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.admin.user.response; 2 | 3 | import java.util.List; 4 | 5 | import javax.validation.Valid; 6 | 7 | import com.fasterxml.jackson.databind.PropertyNamingStrategy; 8 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 9 | 10 | import io.swagger.annotations.ApiModel; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Getter; 13 | import lombok.experimental.SuperBuilder; 14 | 15 | @Getter 16 | @SuperBuilder 17 | @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) 18 | @ApiModel("Admin_OwnerResponse") 19 | public class OwnerResponse extends UserResponse{ 20 | @ApiModelProperty(value = "이름 " + "(50자 이내)", example = "정보혁", required = true) 21 | private String name; 22 | 23 | @ApiModelProperty(notes = "사업자 등록 번호", example = "012-34-56789", required = true) 24 | private String companyRegistrationNumber; 25 | 26 | @ApiModelProperty(notes = "첨부파일 url 목록") 27 | @Valid 28 | private List attachmentsUrl; 29 | 30 | @ApiModelProperty(notes = "가게 id 목록") 31 | @Valid 32 | private List shopsId; 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/admin/user/response/UserUpdateResponse.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.admin.user.response; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategy; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.experimental.SuperBuilder; 9 | 10 | @Getter 11 | @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) 12 | @NoArgsConstructor 13 | @SuperBuilder 14 | public class UserUpdateResponse { 15 | 16 | @ApiModelProperty(notes = "이메일 주소 \n" 17 | , required = true 18 | , example = "koin123@koreatech.ac.kr" 19 | ) 20 | private String email; 21 | 22 | @ApiModelProperty(notes = "이름 \n" 23 | , example = "정보혁" 24 | ) 25 | private String name; 26 | 27 | @ApiModelProperty(notes = "닉네임", example = "사장님 닉네임") 28 | private String nickname; 29 | 30 | @ApiModelProperty(notes = "휴대전화", example = "010-0000-0000") 31 | private String phone_number; 32 | 33 | @ApiModelProperty(notes = "성별") 34 | private Integer gender; 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/admin/user/student/response/StudentResponse.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.admin.user.student.response; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import koreatech.in.dto.admin.user.response.UserResponse; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.experimental.SuperBuilder; 9 | 10 | @Getter 11 | @SuperBuilder 12 | @NoArgsConstructor 13 | @ApiModel("AdminStudentResponse") 14 | public class StudentResponse extends UserResponse { 15 | 16 | @ApiModelProperty(value = "익명 닉네임 " + "(255자 이내)", example = "익명_1676688416361") 17 | private String anonymous_nickname; 18 | 19 | @ApiModelProperty(value = "학번", example = "2029136012") 20 | private String student_number; 21 | 22 | @ApiModelProperty(value = "전공{기계공학부, 컴퓨터공학부, 메카트로닉스공학부, 전기전자통신공학부, 디자인건축공학부, 에너지신소재화학공학부, 산업경영학부}", 23 | example = "컴퓨터공학부") 24 | private String major; 25 | 26 | @ApiModelProperty(value = "졸업X:false, 졸업O:true", example = "false") 27 | private Boolean is_graduated; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/global/AttachmentUrlRequest.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.global; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategy; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import javax.validation.constraints.NotBlank; 7 | import lombok.Getter; 8 | import lombok.Setter; 9 | import lombok.ToString; 10 | import org.hibernate.validator.constraints.URL; 11 | 12 | @Getter 13 | @Setter 14 | @ToString 15 | @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) 16 | public class AttachmentUrlRequest { 17 | 18 | @NotBlank 19 | @URL(protocol = "https", regexp = ".*static\\.koreatech\\.in.*" 20 | , message = "코인 파일 저장 형식이 아닙니다.") 21 | @ApiModelProperty(notes = " \n" 22 | + "- not blank \n" 23 | + "- 코인 파일 저장 형식이어야 함" 24 | , required = true 25 | , example = "https://static.koreatech.in/assets/img/logo_white.png" 26 | ) 27 | private String fileUrl; 28 | } -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/normal/auth/TokenRefreshRequest.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.normal.auth; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategy; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | 10 | @Getter 11 | @Setter 12 | @NoArgsConstructor 13 | @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) 14 | public class TokenRefreshRequest { 15 | @ApiModelProperty( 16 | required = true, 17 | notes = "리프레시 토큰", 18 | example = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" 19 | ) 20 | private String refreshToken; 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/normal/auth/TokenRefreshResponse.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.normal.auth; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategy; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import io.swagger.annotations.ApiModelProperty; 7 | import lombok.Getter; 8 | import lombok.NoArgsConstructor; 9 | import lombok.experimental.SuperBuilder; 10 | 11 | @Getter 12 | @SuperBuilder 13 | @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) 14 | @NoArgsConstructor 15 | public class TokenRefreshResponse { 16 | @ApiModelProperty( 17 | required = true, 18 | notes = "신규 액세스 토큰", 19 | example = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" 20 | ) 21 | @JsonProperty("token") // 버전 호환성 위해 token으로 응답 22 | private String accessToken; 23 | 24 | @ApiModelProperty( 25 | required = true, 26 | notes = "신규 리프레시 토큰", 27 | example = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" 28 | ) 29 | private String refreshToken; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/normal/bus/BusTimetableResponse.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.normal.bus; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import com.fasterxml.jackson.databind.PropertyNamingStrategy.SnakeCaseStrategy; 8 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 9 | 10 | import koreatech.in.domain.Bus.BusTimetable; 11 | import lombok.Builder; 12 | import lombok.Getter; 13 | 14 | @Getter 15 | @Builder 16 | @JsonNaming(SnakeCaseStrategy.class) 17 | public class BusTimetableResponse { 18 | private List busTimetables; 19 | 20 | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "Asia/Seoul") 21 | private Date updatedAt; 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/normal/shop/request/CreateMenuCategoryRequest.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.normal.shop.request; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | import javax.validation.constraints.NotNull; 8 | import javax.validation.constraints.Size; 9 | 10 | @Getter @Setter 11 | public class CreateMenuCategoryRequest { 12 | @Size(min = 1, max = 15, message = "이름의 길이는 1자 이상 15자 이하입니다.") 13 | @NotNull(message = "name은 필수입니다.") 14 | @ApiModelProperty(notes = "카테고리명 \n" + 15 | "- not null \n" + 16 | "- 1자 이상 15자 이하", example = "사이드 메뉴", required = true) 17 | private String name; 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/normal/shop/request/UpdateMenuCategoryRequest.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.normal.shop.request; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import javax.validation.constraints.NotNull; 5 | import javax.validation.constraints.Size; 6 | import lombok.Getter; 7 | import lombok.Setter; 8 | 9 | @Getter @Setter 10 | public class UpdateMenuCategoryRequest { 11 | @ApiModelProperty(notes = "상점 카테고리 고유 id", example = "1", required = true) 12 | private Integer id; 13 | 14 | @Size(min = 1, max = 15, message = "이름의 길이는 1자 이상 15자 이하입니다.") 15 | @NotNull(message = "이름은 필수입니다.") 16 | @ApiModelProperty(notes = "카테고리명 \n" + 17 | "- not null \n" + 18 | "- 1자 이상 15자 이하", example = "사이드 메뉴", required = true) 19 | private String name; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/normal/upload/request/UploadFileRequest.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.normal.upload.request; 2 | 3 | import java.io.IOException; 4 | import koreatech.in.exception.BaseException; 5 | import koreatech.in.exception.ExceptionInformation; 6 | import lombok.Getter; 7 | import lombok.RequiredArgsConstructor; 8 | import org.springframework.web.multipart.MultipartFile; 9 | 10 | @Getter 11 | @RequiredArgsConstructor 12 | public class UploadFileRequest { 13 | private final String domain; 14 | private final String originalFileName; 15 | private final byte[] data; 16 | 17 | public static UploadFileRequest of(String domain, MultipartFile multipartFile) { 18 | return new UploadFileRequest(domain, 19 | multipartFile.getOriginalFilename(), 20 | dataFor(multipartFile)); 21 | } 22 | 23 | private static byte[] dataFor(MultipartFile multipartFile) { 24 | if (multipartFile == null || multipartFile.isEmpty()) { 25 | throw new BaseException(ExceptionInformation.FILE_INVALID); 26 | } 27 | try { 28 | return multipartFile.getBytes(); 29 | } catch (IOException e) { 30 | throw new BaseException(ExceptionInformation.FILE_INVALID); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/normal/upload/response/UploadFileResponse.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.normal.upload.response; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategy; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Getter; 8 | 9 | @Getter 10 | @AllArgsConstructor 11 | @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) 12 | public class UploadFileResponse { 13 | @ApiModelProperty(notes = "업로드된 파일 url", 14 | example = "https://static.koreatech.in/example.png", 15 | required = true 16 | ) 17 | private final String fileUrl; 18 | 19 | // @ApiModelProperty(notes = "업로드된 파일 명", 20 | // example = "example.png", 21 | // required = true 22 | // ) 23 | // private final String fileName; 24 | 25 | public static UploadFileResponse from(String fileUrl) { 26 | return new UploadFileResponse(fileUrl); 27 | } 28 | 29 | // public static UploadFileResponse of(String fileUrl, String fileName) { 30 | // return new UploadFileResponse(fileUrl, fileName); 31 | // } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/normal/upload/response/UploadFilesResponse.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.normal.upload.response; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategy; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import java.util.Collections; 7 | import java.util.List; 8 | import lombok.AllArgsConstructor; 9 | 10 | @AllArgsConstructor 11 | @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) 12 | public class UploadFilesResponse { 13 | @ApiModelProperty(notes = "업로드된 파일 url 리스트", 14 | // dataType = "[Lkoreatech.in.dto.normal.upload.response.UploadFileResponse;" 15 | example = "[\"https://static.koreatech.in/example1.png\", \"https://static.koreatech.in/example2.png\"]", required = true 16 | ) 17 | private final List fileUrls; 18 | 19 | public List getFileUrls() { 20 | return Collections.unmodifiableList(fileUrls); 21 | } 22 | 23 | // private final List fileUrls; 24 | 25 | // public List getFileUrls() { 26 | // return Collections.unmodifiableList(fileUrls); 27 | // } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/normal/user/owner/request/OwnerChangePasswordRequest.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.normal.user.owner.request; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | import javax.validation.constraints.Email; 8 | import javax.validation.constraints.NotNull; 9 | 10 | @Getter 11 | @Setter 12 | public class OwnerChangePasswordRequest { 13 | 14 | @NotNull(message = "비밀번호는 비워둘 수 없습니다.") 15 | @ApiModelProperty(notes = "비밀번호 \n" 16 | + "- not null" 17 | , required = true 18 | , example = "a0240120305812krlakdsflsa;1235" 19 | ) 20 | private String password; 21 | 22 | @Email(message = "이메일 형식이 올바르지 않습니다.") 23 | @NotNull(message = "이메일은 필수입니다.") 24 | @ApiModelProperty(notes = "이메일 주소 \n" 25 | + "- not null \n" 26 | + "- 이메일 형식이어야 함" 27 | , required = true 28 | , example = "abcd@gmail.com" 29 | ) 30 | private String address; 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/normal/user/owner/request/OwnerUpdateRequest.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.normal.user.owner.request; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategy; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import java.util.List; 7 | import javax.validation.Valid; 8 | import javax.validation.constraints.Size; 9 | import koreatech.in.dto.global.AttachmentUrlRequest; 10 | import lombok.Getter; 11 | import lombok.Setter; 12 | 13 | 14 | @Getter 15 | @Setter 16 | @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) 17 | public class OwnerUpdateRequest // extends UserUpdateRequest // 사장님 Update에 대한 요청이 정확히 확인되지 않아, 필수적인 첨부파일만 넘기도록 함. 18 | { 19 | 20 | @Size(min = 1, max = 5, message = "이미지는 사업자등록증, 영업신고증, 통장사본을 포함하여 최소 1개 최대 5개까지 가능합니다.") 21 | @ApiModelProperty(notes = "첨부 이미지들 \n" 22 | + "- not null \n" 23 | + "- 이미지는 최소 1개 최대 5개까지 허용됨 \n" 24 | + "- 모든 이미지들이 코인 이미지 형식이어야 함 \n" 25 | , dataType = "[Lkoreatech.in.dto.global.AttachmentUrlRequest;" 26 | ) 27 | @Valid 28 | private List attachmentUrls; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/normal/user/owner/request/VerifyCodeRequest.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.normal.user.owner.request; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategy; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import javax.validation.constraints.Digits; 7 | import javax.validation.constraints.Email; 8 | import javax.validation.constraints.NotBlank; 9 | import javax.validation.constraints.NotNull; 10 | import lombok.Getter; 11 | import lombok.Setter; 12 | 13 | @Getter 14 | @Setter 15 | @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) 16 | public class VerifyCodeRequest { 17 | 18 | @Email(message = "이메일 형식이 올바르지 않습니다.") 19 | @NotNull(message = "이메일은 필수입니다.") 20 | @ApiModelProperty(notes = "이메일 주소 \n" + 21 | "- not null \n" + 22 | "- 이메일 형식이어야 함", required = true) 23 | private String address; 24 | 25 | @NotBlank(message = "인증 코드는 필수입니다.") 26 | @Digits(integer = 6, fraction = 0, message = "인증 코드는 6자리 정수여야 합니다.") 27 | @ApiModelProperty(notes = "인증코드 \n" + 28 | "- not blank \n" + 29 | "- 6자리 정수여야 함", required = true) 30 | private String certificationCode; 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/normal/user/owner/request/VerifyEmailRequest.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.normal.user.owner.request; 2 | 3 | import javax.validation.constraints.Email; 4 | import javax.validation.constraints.NotNull; 5 | 6 | import io.swagger.annotations.ApiModelProperty; 7 | import lombok.Getter; 8 | import lombok.Setter; 9 | 10 | @Getter 11 | @Setter 12 | public class VerifyEmailRequest { 13 | 14 | @Email(message = "이메일 형식이 올바르지 않습니다.") 15 | @NotNull(message = "이메일은 필수입니다.") 16 | @ApiModelProperty(notes = "이메일 주소 \n" + 17 | "- not null \n" + 18 | "- 이메일 형식이어야 함", required = true) 19 | private String address; 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/normal/user/owner/response/VerifyCodeResponse.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.normal.user.owner.response; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Getter; 6 | import lombok.experimental.SuperBuilder; 7 | 8 | @Getter 9 | @SuperBuilder 10 | public class VerifyCodeResponse { 11 | @ApiModelProperty( 12 | required = true, 13 | notes = "임시 액세스 토큰", 14 | example = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" 15 | ) 16 | @JsonProperty("token") // 버전 호환성 위해 token으로 응답 17 | private String accessToken; 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/normal/user/request/AuthTokenRequest.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.normal.user.request; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import javax.validation.constraints.NotNull; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | 10 | @Getter 11 | @Setter 12 | @NoArgsConstructor 13 | @AllArgsConstructor 14 | public class AuthTokenRequest { 15 | 16 | @NotNull(message = "토큰은 필수입니다.") 17 | @ApiModelProperty(notes 18 | = "인증 토큰\n" 19 | + "- not null \n" 20 | , required = true 21 | ) 22 | private String token; 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/normal/user/request/CheckExistsEmailRequest.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.normal.user.request; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import javax.validation.constraints.Email; 5 | import javax.validation.constraints.NotNull; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Getter; 8 | import lombok.NoArgsConstructor; 9 | import lombok.Setter; 10 | 11 | @Getter 12 | @Setter 13 | @NoArgsConstructor 14 | @AllArgsConstructor 15 | public class CheckExistsEmailRequest { 16 | 17 | @Email(message = "이메일 형식이 올바르지 않습니다.") 18 | @NotNull(message = "이메일은 필수입니다.") 19 | @ApiModelProperty(notes = "이메일 주소 \n" + 20 | "- not null \n" + 21 | "- 이메일 형식이어야 함", required = true) 22 | private String address; 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/normal/user/request/FindPasswordRequest.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.normal.user.request; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | import javax.validation.constraints.Email; 8 | import javax.validation.constraints.NotNull; 9 | 10 | @Getter @Setter 11 | public class FindPasswordRequest { 12 | @Email(message = "이메일 형식이 올바르지 않습니다.") 13 | @NotNull(message = "이메일은 필수입니다.") 14 | @ApiModelProperty(notes = "이메일 주소 \n" 15 | + "- not null \n" 16 | + "- 이메일 형식이어야 함" 17 | , required = true 18 | , example = "abcd@gmail.com" 19 | ) 20 | private String email; 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/normal/user/request/LoginRequest.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.normal.user.request; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import javax.validation.constraints.Email; 5 | import javax.validation.constraints.NotNull; 6 | import lombok.Getter; 7 | import lombok.Setter; 8 | 9 | @Getter @Setter 10 | public class LoginRequest { 11 | @Email(message = "이메일 형식이 올바르지 않습니다.") 12 | @NotNull(message = "이메일은 필수입니다.") 13 | @ApiModelProperty(notes = "이메일 주소 \n" + 14 | "- not null \n" + 15 | "- 이메일 형식이어야 함 \n", required = true, example = "abcd@gmail.com") 16 | private String email; 17 | 18 | @NotNull(message = "비밀번호는 필수입니다.") 19 | @ApiModelProperty(notes = "비밀번호 \n" + 20 | "- not null", required = true, example = "samplepassword") 21 | private String password; 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/normal/user/request/UserUpdateRequest.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.normal.user.request; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategy; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | 10 | @Getter 11 | @Setter 12 | @NoArgsConstructor 13 | @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) 14 | public class UserUpdateRequest { 15 | 16 | @ApiModelProperty(notes = "비밀번호", example = "a0240120305812krlakdsflsa;1235") 17 | private String password; 18 | 19 | 20 | @ApiModelProperty(notes = "이름 \n", example = "정보혁") 21 | private String name; 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/normal/user/response/AuthResponse.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.normal.user.response; 2 | 3 | import lombok.Getter; 4 | import lombok.RequiredArgsConstructor; 5 | 6 | @Getter 7 | @RequiredArgsConstructor 8 | public class AuthResponse { 9 | private final boolean isSuccess; 10 | private final String errorMessage; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/normal/user/response/UserResponse.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.normal.user.response; 2 | 3 | 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategy; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import io.swagger.annotations.ApiModelProperty; 7 | import koreatech.in.domain.User.User; 8 | import lombok.Getter; 9 | import lombok.NoArgsConstructor; 10 | import lombok.experimental.SuperBuilder; 11 | 12 | @Getter 13 | @SuperBuilder 14 | @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) 15 | @NoArgsConstructor 16 | public class UserResponse { 17 | 18 | @ApiModelProperty(notes = "이메일 주소 \n" 19 | , required = true 20 | , example = "koin123@koreatech.ac.kr" 21 | ) 22 | private String email; 23 | 24 | @ApiModelProperty(notes = "이름 \n" 25 | , example = "정보혁" 26 | ) 27 | private String name; 28 | 29 | public UserResponse(User user) { 30 | this.email = user.getEmail(); 31 | this.name = user.getName(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/dto/normal/user/response/UsersResponse.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.dto.normal.user.response; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Builder; 5 | import lombok.Getter; 6 | 7 | import java.util.List; 8 | 9 | @Getter @Builder 10 | public class UsersResponse { 11 | private Integer total_count; 12 | private Integer current_count; 13 | private Integer total_page; 14 | private Integer current_page; 15 | private List users; 16 | 17 | @Getter 18 | public static final class User { 19 | @ApiModelProperty(notes = "고유 id", example = "1", required = true) 20 | private Integer id; 21 | 22 | @ApiModelProperty(notes = "이메일", example = "asdf1234@koreatech.ac.kr", required = true) 23 | private String email; 24 | 25 | @ApiModelProperty(notes = "닉네임", example = "1") 26 | private String nickname; 27 | 28 | @ApiModelProperty(notes = "이름", example = "김철수") 29 | private String name; 30 | 31 | @ApiModelProperty(notes = "전공", example = "컴퓨터공학부") 32 | private String major; 33 | 34 | @ApiModelProperty(notes = "학번", example = "2019136001") 35 | private String student_number; 36 | 37 | @ApiModelProperty(notes = "삭제(soft delete) 여부", example = "false", required = true) 38 | private Boolean is_deleted; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/exception/BadRequestException.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.exception; 2 | 3 | import koreatech.in.domain.ErrorMessage; 4 | 5 | public class BadRequestException extends ParentException { 6 | private ErrorMessage errorMessage; 7 | 8 | public BadRequestException(ErrorMessage errorMessage) { 9 | this.errorMessage = errorMessage; 10 | } 11 | 12 | public ErrorMessage getErrorMessage() { 13 | return errorMessage; 14 | } 15 | 16 | @Override 17 | public String toString() { 18 | return "BadRequestException{" + 19 | "errorMessage=" + errorMessage.getMap() + 20 | '}'; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/exception/BaseException.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.exception; 2 | 3 | import lombok.Getter; 4 | import org.springframework.http.HttpStatus; 5 | 6 | @Getter 7 | public class BaseException extends ParentException { 8 | private final Integer errorCode; 9 | private final HttpStatus httpStatus; 10 | 11 | public BaseException(ExceptionInformation exceptionInformation) { 12 | super(exceptionInformation.getMessage()); 13 | this.errorCode = exceptionInformation.getCode(); 14 | this.httpStatus = exceptionInformation.getHttpStatus(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/exception/ConflictException.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.exception; 2 | 3 | import koreatech.in.domain.ErrorMessage; 4 | 5 | public class ConflictException extends ParentException { 6 | private ErrorMessage errorMessage; 7 | 8 | public ConflictException(ErrorMessage errorMessage) { 9 | this.errorMessage = errorMessage; 10 | } 11 | 12 | public ErrorMessage getErrorMessage() { 13 | return errorMessage; 14 | } 15 | 16 | @Override 17 | public String toString() { 18 | return "ConflictException{" + 19 | "errorMessage=" + errorMessage.getMap() + 20 | '}'; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/exception/ForbiddenException.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.exception; 2 | 3 | import koreatech.in.domain.ErrorMessage; 4 | 5 | public class ForbiddenException extends ParentException { 6 | private ErrorMessage errorMessage; 7 | 8 | public ForbiddenException(ErrorMessage errorMessage) { 9 | this.errorMessage = errorMessage; 10 | } 11 | 12 | public ErrorMessage getErrorMessage() { 13 | return errorMessage; 14 | } 15 | 16 | @Override 17 | public String toString() { 18 | return "ForbiddenException{" + 19 | "errorMessage=" + errorMessage.getMap() + 20 | '}'; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/exception/NotFoundException.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.exception; 2 | 3 | import koreatech.in.domain.ErrorMessage; 4 | 5 | public class NotFoundException extends ParentException { 6 | private ErrorMessage errorMessage; 7 | 8 | public NotFoundException(ErrorMessage errorMessage) { 9 | this.errorMessage = errorMessage; 10 | } 11 | 12 | public ErrorMessage getErrorMessage() { 13 | return errorMessage; 14 | } 15 | 16 | @Override 17 | public String toString() { 18 | return "NotFoundException{" + 19 | "errorMessage=" + errorMessage.getMap() + 20 | '}'; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/exception/ParentException.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.exception; 2 | 3 | import lombok.NoArgsConstructor; 4 | 5 | @NoArgsConstructor 6 | public class ParentException extends RuntimeException { 7 | public ParentException(String message) { 8 | super(message); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/exception/PreconditionFailedException.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.exception; 2 | 3 | import koreatech.in.domain.ErrorMessage; 4 | 5 | public class PreconditionFailedException extends ParentException { 6 | private ErrorMessage errorMessage; 7 | 8 | public PreconditionFailedException(ErrorMessage errorMessage) { 9 | this.errorMessage = errorMessage; 10 | } 11 | 12 | public ErrorMessage getErrorMessage() { 13 | return errorMessage; 14 | } 15 | 16 | @Override 17 | public String toString() { 18 | return "PreconditionFailedException{" + 19 | "errorMessage=" + errorMessage.getMap() + 20 | '}'; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/exception/RequestDataInvalidException.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.exception; 2 | 3 | import lombok.Getter; 4 | 5 | import java.util.List; 6 | 7 | import static koreatech.in.exception.ExceptionInformation.REQUEST_DATA_INVALID; 8 | 9 | @Getter 10 | public class RequestDataInvalidException extends BaseException { 11 | private final List violations; 12 | 13 | public RequestDataInvalidException(List violations) { 14 | super(REQUEST_DATA_INVALID); 15 | this.violations = violations; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/exception/UnauthorizeException.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.exception; 2 | 3 | import koreatech.in.domain.ErrorMessage; 4 | 5 | public class UnauthorizeException extends ParentException { 6 | private ErrorMessage errorMessage; 7 | 8 | public UnauthorizeException(ErrorMessage errorMessage) { 9 | this.errorMessage = errorMessage; 10 | } 11 | 12 | public ErrorMessage getErrorMessage() { 13 | return errorMessage; 14 | } 15 | 16 | @Override 17 | public String toString() { 18 | return "UnauthorizeException{" + 19 | "errorMessage=" + errorMessage.getMap() + 20 | '}'; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/exception/ValidationException.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.exception; 2 | 3 | import koreatech.in.domain.ErrorMessage; 4 | 5 | public class ValidationException extends ParentException { 6 | private ErrorMessage errorMessage; 7 | 8 | public ValidationException (ErrorMessage errorMessage) { 9 | this.errorMessage = errorMessage; 10 | } 11 | 12 | public ErrorMessage getErrorMessage() { 13 | return errorMessage; 14 | } 15 | 16 | @Override 17 | public String toString() { 18 | return "ValidationException {" + 19 | "errorMessage=" + errorMessage.getMap() + 20 | '}'; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/mapstruct/admin/auto/AuthConverter.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.mapstruct.admin.auto; 2 | 3 | import koreatech.in.domain.Auth.LoginResult; 4 | import koreatech.in.domain.Auth.RefreshResult; 5 | import koreatech.in.domain.Auth.RefreshToken; 6 | import koreatech.in.dto.admin.auth.TokenRefreshRequest; 7 | import koreatech.in.dto.admin.auth.TokenRefreshResponse; 8 | import koreatech.in.dto.admin.user.response.LoginResponse; 9 | import org.mapstruct.Mapper; 10 | import org.mapstruct.Mapping; 11 | import org.mapstruct.factory.Mappers; 12 | 13 | @Mapper 14 | public interface AuthConverter { 15 | AuthConverter INSTANCE = Mappers.getMapper(AuthConverter.class); 16 | 17 | LoginResponse toLoginResponse(LoginResult loginResult); 18 | 19 | @Mapping(source = "refreshToken", target = "token") 20 | RefreshToken toToken(TokenRefreshRequest request); 21 | 22 | TokenRefreshResponse toTokenRefreshResponse(RefreshResult refreshResult); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/mapstruct/admin/member/AdminMemberConverter.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.mapstruct.admin.member; 2 | 3 | import koreatech.in.domain.Homepage.Member; 4 | import koreatech.in.dto.admin.member.request.CreateMemberRequest; 5 | import koreatech.in.dto.admin.member.response.MemberResponse; 6 | import koreatech.in.dto.admin.member.response.MembersResponse; 7 | import org.mapstruct.Mapper; 8 | import org.mapstruct.factory.Mappers; 9 | 10 | @Mapper 11 | public interface AdminMemberConverter { 12 | AdminMemberConverter INSTANCE = Mappers.getMapper(AdminMemberConverter.class); 13 | 14 | Member toMember(CreateMemberRequest request); 15 | 16 | MemberResponse toMemberResponse(Member member); 17 | 18 | MembersResponse.Member toMembersResponse$Member(Member member); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/mapstruct/admin/shop/AdminShopCategoryConverter.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.mapstruct.admin.shop; 2 | 3 | import koreatech.in.domain.Shop.ShopCategory; 4 | import koreatech.in.dto.admin.shop.request.CreateShopCategoryRequest; 5 | import koreatech.in.dto.admin.shop.response.ShopCategoryResponse; 6 | import org.mapstruct.Mapper; 7 | import org.mapstruct.factory.Mappers; 8 | 9 | @Mapper 10 | public interface AdminShopCategoryConverter { 11 | AdminShopCategoryConverter INSTANCE = Mappers.getMapper(AdminShopCategoryConverter.class); 12 | 13 | ShopCategory toShopCategory(CreateShopCategoryRequest request); 14 | 15 | ShopCategoryResponse toShopCategoryResponse(ShopCategory shopCategory); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/mapstruct/admin/shop/AdminShopOpenConverter.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.mapstruct.admin.shop; 2 | 3 | import koreatech.in.domain.Shop.ShopOpen; 4 | import koreatech.in.dto.admin.shop.request.CreateShopRequest; 5 | import koreatech.in.dto.admin.shop.request.UpdateShopRequest; 6 | import org.mapstruct.Mapper; 7 | import org.mapstruct.Mapping; 8 | import org.mapstruct.factory.Mappers; 9 | 10 | @Mapper 11 | public interface AdminShopOpenConverter { 12 | AdminShopOpenConverter INSTANCE = Mappers.getMapper(AdminShopOpenConverter.class); 13 | 14 | @Mapping(source = "shopId", target = "shop_id") 15 | ShopOpen toShopOpen(CreateShopRequest.Open open, Integer shopId); 16 | 17 | @Mapping(source = "shopId", target = "shop_id") 18 | ShopOpen toShopOpen(UpdateShopRequest.Open open, Integer shopId); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/mapstruct/admin/user/StudentConverter.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.mapstruct.admin.user; 2 | 3 | import koreatech.in.domain.User.student.Student; 4 | import koreatech.in.dto.admin.user.student.request.StudentUpdateRequest; 5 | import koreatech.in.dto.admin.user.student.response.StudentResponse; 6 | import koreatech.in.dto.admin.user.student.response.StudentUpdateResponse; 7 | import koreatech.in.dto.admin.user.student.response.StudentsResponse; 8 | import org.mapstruct.Mapper; 9 | import org.mapstruct.Mapping; 10 | import org.mapstruct.Mappings; 11 | import org.mapstruct.factory.Mappers; 12 | 13 | @Mapper 14 | public interface StudentConverter { 15 | StudentConverter INSTANCE = Mappers.getMapper(StudentConverter.class); 16 | 17 | StudentResponse toStudentResponse(Student student); 18 | 19 | Student toStudent(StudentUpdateRequest student); 20 | 21 | @Mappings({ 22 | @Mapping(source = "phone_number", target = "phoneNumber"), 23 | @Mapping(source = "student_number", target = "studentNumber"), 24 | @Mapping(source = "identity", target = "identity"), 25 | @Mapping(source = "is_graduated", target = "isGraduated") 26 | }) 27 | StudentUpdateResponse toStudentUpdateResponse(Student student); 28 | 29 | StudentsResponse.Students toStudentsResponse$Students(Student student); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/mapstruct/admin/user/UserConverter.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.mapstruct.admin.user; 2 | 3 | import koreatech.in.domain.Criteria.Criteria; 4 | import koreatech.in.domain.User.PageInfo; 5 | import koreatech.in.dto.admin.user.request.OwnersCondition; 6 | import org.mapstruct.Mapper; 7 | import org.mapstruct.Mapping; 8 | import org.mapstruct.Mappings; 9 | import org.mapstruct.factory.Mappers; 10 | 11 | @Mapper 12 | public interface UserConverter { 13 | UserConverter INSTANCE = Mappers.getMapper(UserConverter.class); 14 | 15 | @Mappings({ 16 | @Mapping(source = "source.page", target = "currentPage"), 17 | @Mapping(source = "source.limit", target = "limit"), 18 | @Mapping(source = "totalCount", target = "totalCount"), 19 | @Mapping(source = "currentCount", target = "currentCount") 20 | }) 21 | PageInfo toPageInfo(Criteria source, Integer totalCount, Integer currentCount); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/mapstruct/normal/auto/AuthConverter.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.mapstruct.normal.auto; 2 | 3 | import koreatech.in.domain.Auth.LoginResult; 4 | import koreatech.in.domain.Auth.RefreshResult; 5 | import koreatech.in.domain.Auth.RefreshToken; 6 | import koreatech.in.dto.normal.auth.TokenRefreshResponse; 7 | import koreatech.in.dto.normal.auth.TokenRefreshRequest; 8 | import koreatech.in.dto.normal.user.response.LoginResponse; 9 | import org.mapstruct.Mapper; 10 | import org.mapstruct.Mapping; 11 | import org.mapstruct.factory.Mappers; 12 | 13 | @Mapper 14 | public interface AuthConverter { 15 | AuthConverter INSTANCE = Mappers.getMapper(AuthConverter.class); 16 | 17 | LoginResponse toLoginResponse(LoginResult loginResult); 18 | 19 | @Mapping(source = "refreshToken", target = "token") 20 | RefreshToken toToken(TokenRefreshRequest request); 21 | 22 | TokenRefreshResponse toTokenRefreshResponse(RefreshResult refreshResult); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/mapstruct/normal/bus/SchoolBusCourseConverter.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.mapstruct.normal.bus; 2 | 3 | import koreatech.in.domain.Bus.SchoolBusArrivalInfo; 4 | import koreatech.in.domain.Bus.SchoolBusCourse; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.Mapping; 7 | import org.mapstruct.Mappings; 8 | import org.mapstruct.factory.Mappers; 9 | 10 | import java.util.List; 11 | 12 | @Mapper 13 | public interface SchoolBusCourseConverter { 14 | 15 | SchoolBusCourseConverter INSTANCE = Mappers.getMapper(SchoolBusCourseConverter.class); 16 | 17 | @Mappings({ 18 | @Mapping(source = "region", target = "region") 19 | }) 20 | SchoolBusCourse toSchoolBusCourse(SchoolBusArrivalInfo schoolBusArrivalInfo); 21 | 22 | List toSchoolBusCourse(List schoolBusArrivalInfo); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/mapstruct/normal/shop/ShopConverter.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.mapstruct.normal.shop; 2 | 3 | import koreatech.in.domain.Shop.Shop; 4 | import koreatech.in.domain.Shop.ShopProfile; 5 | import koreatech.in.dto.normal.shop.request.CreateShopRequest; 6 | import koreatech.in.dto.normal.shop.response.AllShopsResponse; 7 | import koreatech.in.dto.normal.shop.response.ShopResponse; 8 | import org.mapstruct.Mapper; 9 | import org.mapstruct.Mapping; 10 | import org.mapstruct.factory.Mappers; 11 | 12 | @Mapper 13 | public interface ShopConverter { 14 | 15 | ShopConverter INSTANCE = Mappers.getMapper(ShopConverter.class); 16 | 17 | @Mapping(target = "description", defaultValue = "-") 18 | ShopResponse toShopResponse(ShopProfile shopProfile); 19 | 20 | @Mapping(target = "category_ids", expression = "java(shopProfile.getShopCategoryIds())") 21 | AllShopsResponse.Shop toAllShopsResponse$Shop(ShopProfile shopProfile); 22 | 23 | @Mapping(source = "ownerId", target = "owner_id") 24 | Shop toShop(CreateShopRequest request, Integer ownerId); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/mapstruct/normal/shop/ShopMenuConverter.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.mapstruct.normal.shop; 2 | 3 | import koreatech.in.domain.Shop.ShopMenu; 4 | import koreatech.in.domain.Shop.ShopMenuProfile; 5 | import koreatech.in.dto.normal.shop.request.CreateMenuRequest; 6 | import koreatech.in.dto.normal.shop.response.AllMenusOfShopResponse; 7 | import koreatech.in.dto.normal.shop.response.MenuResponse; 8 | import org.mapstruct.Mapper; 9 | import org.mapstruct.Mapping; 10 | import org.mapstruct.Mappings; 11 | import org.mapstruct.factory.Mappers; 12 | 13 | @Mapper 14 | public interface ShopMenuConverter { 15 | ShopMenuConverter INSTANCE = Mappers.getMapper(ShopMenuConverter.class); 16 | 17 | AllMenusOfShopResponse.Menu toAllMenusOfShopResponse$Menu(ShopMenuProfile shopMenuProfile); 18 | 19 | @Mappings({ 20 | @Mapping(target = "is_hidden", constant = "false"), 21 | @Mapping(source = "shopId", target = "shop_id") 22 | }) 23 | ShopMenu toShopMenu(CreateMenuRequest request, Integer shopId); 24 | 25 | MenuResponse toMenuResponse(ShopMenuProfile shopMenuProfile); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/mapstruct/normal/shop/ShopOpenConverter.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.mapstruct.normal.shop; 2 | 3 | import koreatech.in.domain.Shop.ShopOpen; 4 | import koreatech.in.dto.normal.shop.request.CreateShopRequest; 5 | import koreatech.in.dto.normal.shop.request.UpdateShopRequest; 6 | import org.mapstruct.Mapper; 7 | import org.mapstruct.Mapping; 8 | import org.mapstruct.factory.Mappers; 9 | 10 | @Mapper 11 | public interface ShopOpenConverter { 12 | ShopOpenConverter INSTANCE = Mappers.getMapper(ShopOpenConverter.class); 13 | 14 | @Mapping(source = "shopId", target = "shop_id") 15 | ShopOpen toShopOpenForCreate(CreateShopRequest.Open open, Integer shopId); 16 | 17 | @Mapping(source = "shopId", target = "shop_id") 18 | ShopOpen toShopOpenForUpdate(UpdateShopRequest.Open open, Integer shopId); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/repository/AuthenticationMapper.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.repository; 2 | 3 | import java.io.IOException; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository 7 | public interface AuthenticationMapper { 8 | void setRefreshToken(String refreshToken, Integer userId); 9 | 10 | String getRefreshToken(Integer userId) throws IOException; 11 | 12 | void deleteRefreshToken(Integer userId); 13 | //TODO 사장님 인증 + 메모리DB 부분도 여기로 추출할 것 14 | 15 | String getDeprecatedAccessTokenKey(); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/repository/BusRepository.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.repository; 2 | 3 | import koreatech.in.domain.Bus.SchoolBusArrivalInfo; 4 | import org.springframework.data.mongodb.repository.MongoRepository; 5 | import org.springframework.data.mongodb.repository.Query; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.List; 9 | 10 | @Repository 11 | public interface BusRepository extends MongoRepository { 12 | 13 | @Query(value = "{}", fields = "{ '_id': false, 'routes': false }") 14 | List findOnlyCourses(); 15 | 16 | @Query(value = "{ 'bus_type': ?0, 'direction': ?1, 'region': ?2}") 17 | SchoolBusArrivalInfo findByCourse(String busType, String direction, String region); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/repository/CalendarMapper.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.repository; 2 | 3 | import koreatech.in.domain.kut.Calendar; 4 | import org.apache.ibatis.annotations.Select; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | @Repository 10 | public interface CalendarMapper { 11 | @Select("SELECT * FROM koin.calendar_universities WHERE year = #{year}") 12 | public List getCalendarsByYear(String year); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/repository/DeptMapper.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.repository; 2 | 3 | import koreatech.in.domain.Dept.DeptInfoWithNum; 4 | import koreatech.in.domain.Dept.DeptNum; 5 | import org.apache.ibatis.annotations.Param; 6 | import org.apache.ibatis.annotations.Select; 7 | import org.springframework.stereotype.Repository; 8 | 9 | import java.util.ArrayList; 10 | 11 | @Repository 12 | public interface DeptMapper { 13 | 14 | @Select("SELECT a.*, b.dept_num FROM koin.dept_infos AS a " + 15 | "INNER JOIN koin.dept_nums AS b " + 16 | "ON a.name = b.dept_name AND a.is_deleted = 0 " + 17 | "ORDER BY b.dept_num") 18 | ArrayList getAllDeptInfo(); 19 | 20 | @Select("SELECT a.* FROM koin.dept_nums AS a " + 21 | "JOIN koin.dept_infos AS b " + 22 | "ON a.dept_name = b.name AND b.is_deleted = 0 " + 23 | "WHERE a.dept_num = #{deptNum}") 24 | DeptNum findDeptByDeptNum(@Param("deptNum") String deptNum); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/repository/DiningMapper.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.repository; 2 | 3 | import koreatech.in.domain.Dining.DiningMenu; 4 | import org.apache.ibatis.annotations.Param; 5 | import org.apache.ibatis.annotations.Select; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.List; 9 | 10 | @Repository 11 | public interface DiningMapper { 12 | @Select("SELECT * FROM koin.dining_menus WHERE date=#{date} ORDER BY id") 13 | List getList(@Param("date") String date); 14 | } -------------------------------------------------------------------------------- /src/main/java/koreatech/in/repository/PageResourceMapper.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.repository; 2 | 3 | // Empty Mapper for naming preoccupancy 4 | public interface PageResourceMapper { 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/repository/user/StudentMapper.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.repository.user; 2 | 3 | import koreatech.in.domain.User.student.Student; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository 7 | public interface StudentMapper { 8 | void insertStudent(Student student); 9 | Student getStudentById(Integer id); 10 | Integer getStudentIdentity(Integer id); 11 | void deleteStudent(Integer id); 12 | // TODO 쿼리 추가 필요 13 | void updateStudent(Student student); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/schedule/BusTago.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.schedule; 2 | 3 | import koreatech.in.domain.Bus.CityBus; 4 | import koreatech.in.domain.Bus.IntercityBus; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.scheduling.annotation.Scheduled; 7 | import org.springframework.stereotype.Component; 8 | 9 | @Component("busTagoSchedule") 10 | public class BusTago { 11 | 12 | @Autowired 13 | private CityBus cityBus; 14 | 15 | @Autowired 16 | private IntercityBus intercityBus; 17 | 18 | @Scheduled(cron = "0 */1 * * * *") 19 | public void handleCityBus() { 20 | cityBus.cacheBusArrivalInfo(); 21 | } 22 | 23 | // 하루에 한 번으로 지정하려했지만, 공공 데이터 API 호출 결과 00시에 바로 업데이트 되지 않음을 확인 24 | // 이전보다 더 잦게 스케줄링하도록 변경 25 | // @Scheduled(cron = "0 */2 * * * *") 26 | public void handleIntercityBus() { 27 | intercityBus.cacheBusArrivalInfo(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/AccessJwtValidator.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import javax.crypto.SecretKey; 4 | import koreatech.in.domain.User.User; 5 | import koreatech.in.repository.user.UserMapper; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | @Service 10 | public class AccessJwtValidator extends AbstractJwtValidator { 11 | @Autowired 12 | private UserMapper userMapper; 13 | 14 | @Override 15 | protected SecretKey getKey() { 16 | return jwtKeyManager.getAccessKey(); 17 | } 18 | 19 | @Override 20 | protected void validateData(String token, Integer userId) {} 21 | 22 | public User validateAndGetUserFromAccessToken(String accessToken) { 23 | Integer userId = getUserIdInToken(accessToken); 24 | return userMapper.getAuthedUserById(userId); 25 | } 26 | } -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/ActivityService.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import koreatech.in.domain.Homepage.Activity; 4 | 5 | import java.util.Map; 6 | 7 | public interface ActivityService { 8 | Map getActivities(String year) throws Exception; 9 | 10 | // ===== ADMIN APIs ===== 11 | Map getActivitiesForAdmin(String year) throws Exception; 12 | 13 | Activity getActivityForAdmin(int id) throws Exception; 14 | 15 | Activity createActivityForAdmin(Activity activity) throws Exception; 16 | 17 | Activity updateActivityForAdmin(Activity activity, int id) throws Exception; 18 | 19 | Map deleteActivityForAdmin(int id) throws Exception; 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/BusService.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import koreatech.in.domain.Bus.BusTimetable; 4 | import koreatech.in.domain.Bus.BusRemainTime; 5 | import koreatech.in.domain.Bus.SchoolBusCourse; 6 | import koreatech.in.domain.Bus.SingleBusTime; 7 | import koreatech.in.dto.normal.bus.BusTimetableResponse; 8 | 9 | import java.util.List; 10 | 11 | 12 | public interface BusService { 13 | BusRemainTime getRemainTime(String busType, String depart, String arrival) throws Exception; 14 | 15 | List getCourses(); 16 | 17 | List getTimetable(String busType, String direction, String region); 18 | 19 | List searchTimetable(String date, String time, String depart, String arrival); 20 | 21 | BusTimetableResponse getTimetableWithUpdatedAt(String busType, String direction, String region); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/CalendarService.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | 4 | import koreatech.in.domain.kut.Calendar; 5 | 6 | import java.io.IOException; 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | public interface CalendarService { 11 | List getCalendars(String year); 12 | 13 | Map getTerm() throws Exception; 14 | 15 | String createTermForAdmin(String term) throws IOException; 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/CallvanService.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import koreatech.in.domain.Callvan.Company; 4 | import koreatech.in.domain.Callvan.Participant; 5 | import koreatech.in.domain.Callvan.Room; 6 | 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | public interface CallvanService { 11 | List getCompanies(); 12 | Company getCompany(int id); 13 | Company increaseCallCount(int id); 14 | Company createCompanyForAdmin(Company company); 15 | Company updateCompanyForAdmin(Company company, int id); 16 | Map deleteCompanyForAdmin(int id); 17 | 18 | List getRooms(); 19 | Room createRoom(Room room); 20 | Room getRoom(int id); 21 | Room updateRoom(Room room, int id); 22 | Map deleteRoom(int id); 23 | 24 | Room participateRoom(Participant participant); 25 | Room unParticipateRoom(Participant participant); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/CircleService.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import koreatech.in.domain.Circle.Circle; 4 | import koreatech.in.domain.Criteria.Criteria; 5 | 6 | import java.util.Map; 7 | 8 | public interface CircleService { 9 | Map getCirclesForAdmin(Criteria criteria) throws Exception; 10 | 11 | Circle createCircleForAdmin(Circle circle) throws Exception; 12 | 13 | Map getCircles(Criteria criteria) throws Exception; 14 | 15 | Map getCircle(int page, int limit, int id) throws Exception; 16 | 17 | Circle getCircleForAdmin(int id) throws Exception; 18 | 19 | Circle updateCircleForAdmin(Circle circle, int id) throws Exception; 20 | 21 | Map deleteCircleForAdmin(int id) throws Exception; 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/DeptService.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import koreatech.in.domain.Dept.DeptInfoVO; 4 | import koreatech.in.domain.Dept.DeptNum; 5 | 6 | import java.util.ArrayList; 7 | 8 | public interface DeptService { 9 | 10 | ArrayList getAllDeptInfo(); 11 | 12 | DeptNum findDept(String deptNum); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/DiningService.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import koreatech.in.domain.Dining.DiningMenuDTO; 4 | 5 | import java.util.List; 6 | 7 | public interface DiningService { 8 | List getDinings(String date) throws Exception; 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/FaqService.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import koreatech.in.domain.Criteria.Criteria; 4 | import koreatech.in.domain.Faq.Faq; 5 | 6 | import java.util.Map; 7 | 8 | public interface FaqService { 9 | Faq createFaqForAdmin(Faq faq) throws Exception; 10 | 11 | Faq updateFaqForAdmin(Faq faq, int id) throws Exception; 12 | 13 | Map deleteFaqForAdmin(int id) throws Exception; 14 | 15 | Map getFaqList(Criteria criteria) throws Exception; 16 | 17 | Faq getFaq(int id) throws Exception; 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/JwtGenerator.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import java.util.Date; 4 | import javax.crypto.SecretKey; 5 | import koreatech.in.util.DateUtil; 6 | import koreatech.in.util.jwt.JwtKeyManager; 7 | import koreatech.in.util.jwt.JwtUtil; 8 | import org.apache.commons.lang.StringUtils; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | 12 | @Service 13 | public abstract class JwtGenerator { 14 | @Autowired 15 | protected JwtKeyManager jwtKeyManager; 16 | 17 | private final JwtUtil jwtUtil = new JwtUtil(); 18 | 19 | public String generate(T data) { 20 | String subject = castToSubject(data); 21 | if(StringUtils.isEmpty(subject)) { 22 | return jwtUtil.generateToken(makeExpiration(), getKey()); 23 | } 24 | 25 | return jwtUtil.generateToken(subject, makeExpiration(), getKey()); 26 | } 27 | 28 | protected abstract String castToSubject(T data); 29 | 30 | protected Date makeExpiration() { 31 | return DateUtil.addHoursToJavaUtilDate(new Date(), (int) getExpirationHour()); 32 | } 33 | 34 | protected abstract long getExpirationHour(); 35 | 36 | protected abstract SecretKey getKey(); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/KakaoBotService.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | public interface KakaoBotService { 4 | 5 | String getDiningMenus(String mealtimeKorean) throws Exception; 6 | 7 | String getBusRemainTime(String departKor, String arrivalKor) throws Exception; 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/MemberService.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import koreatech.in.domain.Homepage.Member; 4 | import koreatech.in.dto.admin.member.request.CreateMemberRequest; 5 | import koreatech.in.dto.admin.member.request.MembersCondition; 6 | import koreatech.in.dto.admin.member.request.UpdateMemberRequest; 7 | import koreatech.in.dto.admin.member.response.MemberResponse; 8 | import koreatech.in.dto.admin.member.response.MembersResponse; 9 | 10 | import java.util.List; 11 | 12 | public interface MemberService { 13 | void createMemberForAdmin(CreateMemberRequest request) throws Exception; 14 | 15 | MemberResponse getMemberForAdmin(Integer memberId) throws Exception; 16 | 17 | MembersResponse getMembersForAdmin(MembersCondition condition) throws Exception; 18 | 19 | void updateMemberForAdmin(Integer memberId, UpdateMemberRequest request) throws Exception; 20 | 21 | void deleteMemberForAdmin(Integer memberId) throws Exception; 22 | 23 | void undeleteMemberForAdmin(Integer memberId) throws Exception; 24 | 25 | List getMembers() throws Exception; 26 | 27 | Member getMember(Integer memberId) throws Exception; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/PageResourceService.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import koreatech.in.domain.PageResource.PageResource; 4 | 5 | public interface PageResourceService { 6 | 7 | PageResource getCardNews() throws Exception; 8 | 9 | PageResource updateCardNewsForAdmin(PageResource pageResource) throws Exception; 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/RefreshJwtValidator.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import io.jsonwebtoken.ExpiredJwtException; 4 | import java.io.IOException; 5 | import javax.crypto.SecretKey; 6 | import koreatech.in.exception.BaseException; 7 | import koreatech.in.exception.ExceptionInformation; 8 | import koreatech.in.repository.AuthenticationMapper; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | 12 | @Service 13 | public class RefreshJwtValidator extends AbstractJwtValidator { 14 | @Autowired 15 | private AuthenticationMapper authenticationMapper; 16 | 17 | @Override 18 | protected SecretKey getKey() { 19 | return jwtKeyManager.getRefreshKey(); 20 | } 21 | 22 | @Override 23 | protected void validateData(String token, Integer userId) { 24 | try { 25 | String tokenInRedis = authenticationMapper.getRefreshToken(userId); 26 | if (!token.equals(tokenInRedis)) { 27 | throw new BaseException(ExceptionInformation.TOKEN_EXPIRED); 28 | } 29 | } catch (IOException e) { 30 | throw new ExpiredJwtException(null, null, null, e); 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/SearchService.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import koreatech.in.domain.Criteria.SearchCriteria; 4 | 5 | import java.util.Map; 6 | 7 | public interface SearchService { 8 | Map searchShop(SearchCriteria searchCriteria) throws Exception; 9 | 10 | Map searchCommunity(SearchCriteria searchCriteria) throws Exception; 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/ShopService.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import koreatech.in.dto.normal.shop.response.*; 4 | 5 | public interface ShopService { 6 | AllShopCategoriesResponse getAllShopCategories(); 7 | 8 | ShopResponse getShop(Integer shopId); 9 | 10 | AllShopsResponse getAllShops(); 11 | 12 | AllMenusOfShopResponse getAllMenusOfShop(Integer shopId); 13 | 14 | MenuResponse getMenu(Integer shopId, Integer menuId); 15 | 16 | AllMenuCategoriesOfShopResponse getAllMenuCategoriesOfShop(Integer shopId); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/SlackBotService.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import java.util.Map; 4 | 5 | public interface SlackBotService { 6 | String sendMessage(Map params) throws Exception; 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/SlackBotServiceImpl.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import koreatech.in.util.SlackNotiSender; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Service; 6 | 7 | import java.util.Map; 8 | import java.util.Optional; 9 | 10 | @Service 11 | public class SlackBotServiceImpl implements SlackBotService { 12 | @Autowired 13 | private SlackNotiSender slackNotiSender; 14 | 15 | @Override 16 | public String sendMessage(Map params) { 17 | String messageText = Optional.ofNullable(params.get("text")).map(String::valueOf).orElse(""); 18 | 19 | return slackNotiSender.noticeQuestion(messageText); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/TemporaryAccessJwtGenerator.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import javax.crypto.SecretKey; 4 | import org.springframework.stereotype.Service; 5 | 6 | @Service 7 | public class TemporaryAccessJwtGenerator extends JwtGenerator { 8 | private static final int PREV_ACCESS_TOKEN_VALID_HOUR = 2; 9 | 10 | @Override 11 | protected String castToSubject(Void data) { 12 | return null; 13 | } 14 | 15 | @Override 16 | protected long getExpirationHour() { 17 | return PREV_ACCESS_TOKEN_VALID_HOUR; 18 | } 19 | 20 | @Override 21 | protected SecretKey getKey() { 22 | return super.jwtKeyManager.getAccessKey(); 23 | } 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/TimeTableService.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import koreatech.in.domain.TimeTable.Lecture; 4 | import koreatech.in.domain.TimeTable.Semester; 5 | import koreatech.in.domain.TimeTable.TimeTable; 6 | 7 | import java.util.ArrayList; 8 | import java.util.Map; 9 | 10 | public interface TimeTableService { 11 | ArrayList getLectureList(String semester_date) throws Exception; 12 | 13 | ArrayList getSemesterList() throws Exception; 14 | 15 | Map getTimeTables(String semester) throws Exception; 16 | 17 | Map createTimeTables(String timetable_log) throws Exception; 18 | 19 | Map updateTimeTable(String timetable_log) throws Exception; 20 | 21 | Map deleteTimeTableAll(String semester) throws Exception; 22 | 23 | Map deleteTimeTableById(int id) throws Exception; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/TrackService.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | 4 | import koreatech.in.domain.Homepage.TechStack; 5 | import koreatech.in.domain.Homepage.Track; 6 | 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | public interface TrackService { 11 | List getTracks() throws Exception; 12 | 13 | Map getTrackInfo(Integer trackId) throws Exception; 14 | 15 | // ===== ADMIN APIs ===== 16 | List getTracksForAdmin() throws Exception; 17 | 18 | Map getTrackInfoForAdmin(int id) throws Exception; 19 | 20 | Track createTrackForAdmin(Track track) throws Exception; 21 | 22 | Track updateTrackForAdmin(Track track, int id) throws Exception; 23 | 24 | Map deleteTrackForAdmin(int id) throws Exception; 25 | 26 | TechStack createTechStackForAdmin(TechStack techStack, String trackName) throws Exception; 27 | 28 | TechStack updateTechStackForAdmin(TechStack techStack, String trackName, int id) throws Exception; 29 | 30 | Map deleteTechStackForAdmin(int id) throws Exception; 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/UploadService.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import java.io.IOException; 4 | import java.util.List; 5 | 6 | import org.springframework.web.multipart.MultipartFile; 7 | 8 | import koreatech.in.domain.Upload.DomainEnum; 9 | import koreatech.in.dto.normal.upload.request.PreSignedUrlRequest; 10 | import koreatech.in.dto.normal.upload.response.PreSignedUrlResponse; 11 | import koreatech.in.dto.normal.upload.response.UploadFileResponse; 12 | import koreatech.in.dto.normal.upload.response.UploadFilesResponse; 13 | 14 | public interface UploadService { 15 | UploadFileResponse uploadAndGetUrl(MultipartFile multipartFile, DomainEnum domain) throws IOException; 16 | 17 | UploadFileResponse uploadAndGetUrlForAdmin(MultipartFile multipartFile, DomainEnum domain) throws IOException; 18 | 19 | UploadFilesResponse uploadAndGetUrls(List multipartFiles, DomainEnum domain); 20 | 21 | UploadFilesResponse uploadAndGetUrlsForAdmin(List multipartFiles, DomainEnum domain); 22 | 23 | PreSignedUrlResponse generatePreSignedUrl(DomainEnum domain, PreSignedUrlRequest preSignedUrlRequest); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/UserAccessJwtGenerator.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import javax.crypto.SecretKey; 4 | import org.springframework.stereotype.Service; 5 | 6 | @Service 7 | public class UserAccessJwtGenerator extends JwtGenerator { 8 | private static final int PREV_ACCESS_TOKEN_VALID_HOUR = 72; 9 | 10 | protected String castToSubject(Integer data) { 11 | return String.valueOf(data); 12 | } 13 | 14 | @Override 15 | protected long getExpirationHour() { 16 | return PREV_ACCESS_TOKEN_VALID_HOUR; 17 | } 18 | 19 | @Override 20 | protected SecretKey getKey() { 21 | return super.jwtKeyManager.getAccessKey(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/UserRefreshJwtGenerator.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import java.util.concurrent.TimeUnit; 4 | import javax.crypto.SecretKey; 5 | import org.springframework.stereotype.Service; 6 | 7 | @Service 8 | public class UserRefreshJwtGenerator extends JwtGenerator { 9 | private static final long REFRESH_TOKEN_VALID_DAYS = 14; 10 | 11 | @Override 12 | protected String castToSubject(Integer data) { 13 | return String.valueOf(data); 14 | } 15 | 16 | @Override 17 | protected long getExpirationHour() { 18 | return TimeUnit.DAYS.toHours(REFRESH_TOKEN_VALID_DAYS); 19 | } 20 | 21 | @Override 22 | protected final SecretKey getKey() { 23 | return super.jwtKeyManager.getRefreshKey(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/service/VersionService.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.service; 2 | 3 | import koreatech.in.domain.Version.Version; 4 | 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | public interface VersionService { 9 | Version getVersion(String type) throws Exception; 10 | 11 | List getVersionsForAdmin() throws Exception; 12 | 13 | Version createVersionForAdmin(Version version) throws Exception; 14 | 15 | Version updateVersionForAdmin(Version version, String type) throws Exception; 16 | 17 | Map deleteVersionForAdmin(String type) throws Exception; 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/util/ApplicationContextProvider.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.util; 2 | 3 | import org.springframework.beans.BeansException; 4 | import org.springframework.context.ApplicationContext; 5 | import org.springframework.context.ApplicationContextAware; 6 | 7 | public class ApplicationContextProvider implements ApplicationContextAware { 8 | 9 | private static ApplicationContext applicationContext = null; 10 | 11 | public static ApplicationContext getApplicationContext() { 12 | return applicationContext; 13 | } 14 | 15 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { 16 | this.applicationContext = applicationContext; 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /src/main/java/koreatech/in/util/AwsSesConfig.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.util; 2 | 3 | import com.amazonaws.auth.AWSStaticCredentialsProvider; 4 | import com.amazonaws.auth.BasicAWSCredentials; 5 | import com.amazonaws.regions.Regions; 6 | import com.amazonaws.services.simpleemail.AmazonSimpleEmailServiceAsync; 7 | import com.amazonaws.services.simpleemail.AmazonSimpleEmailServiceAsyncClient; 8 | import org.springframework.beans.factory.annotation.Value; 9 | import org.springframework.context.annotation.Bean; 10 | import org.springframework.context.annotation.Configuration; 11 | 12 | /** 13 | * @author Lim, Hee Seong 14 | * @since 2018-05-02 15 | */ 16 | @Configuration 17 | public class AwsSesConfig { 18 | 19 | @Value("${AWS_ACCESS_KEY_ID}") 20 | private String AWS_ACCESS_KEY_ID; 21 | 22 | @Value("${AWS_SECRET_KEY}") 23 | private String AWS_SECRET_KEY; 24 | 25 | @Bean 26 | public AmazonSimpleEmailServiceAsync amazonSimpleEmailServiceAsync() { 27 | BasicAWSCredentials basicAWSCredentials = new BasicAWSCredentials(AWS_ACCESS_KEY_ID, AWS_SECRET_KEY); 28 | 29 | return AmazonSimpleEmailServiceAsyncClient.asyncBuilder() 30 | .withCredentials(new AWSStaticCredentialsProvider(basicAWSCredentials)) 31 | .withRegion(Regions.US_WEST_2) 32 | .build(); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/koreatech/in/util/BeanUtil.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.util; 2 | 3 | import org.springframework.context.ApplicationContext; 4 | 5 | public class BeanUtil { 6 | private static final ApplicationContext applicationContext = ApplicationContextProvider.getApplicationContext(); 7 | 8 | public static Object getBean(String beanName) { 9 | 10 | return applicationContext.getBean(beanName); 11 | } 12 | 13 | public static T getBean(Class beanClass) { 14 | 15 | return applicationContext.getBean(beanClass); 16 | } 17 | } -------------------------------------------------------------------------------- /src/main/java/koreatech/in/util/DateUtil.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.util; 2 | 3 | import java.time.Instant; 4 | import java.time.LocalDateTime; 5 | import java.time.ZoneId; 6 | import java.util.Calendar; 7 | import java.util.Date; 8 | 9 | public class DateUtil { 10 | public static final ZoneId KST_TIMEZONE = ZoneId.of("Asia/Seoul"); 11 | 12 | public static Integer getYearOfNow() { 13 | return LocalDateTime.ofInstant(Instant.now(), KST_TIMEZONE).getYear(); 14 | } 15 | 16 | public static Long getTimeStampSecondOfNow() { 17 | return Instant.now().getEpochSecond(); 18 | } 19 | 20 | public static Date addHoursToJavaUtilDate(Date date, int hours) { 21 | Calendar calendar = Calendar.getInstance(); 22 | calendar.setTime(date); 23 | calendar.add(Calendar.HOUR_OF_DAY, hours); 24 | return calendar.getTime(); 25 | } 26 | 27 | public static Date addMinute(Date date, int amount) { 28 | Calendar calendar = Calendar.getInstance(); 29 | 30 | calendar.setTime(date); 31 | calendar.add(Calendar.MINUTE, amount); 32 | 33 | return calendar.getTime(); 34 | } 35 | 36 | public static Boolean isExpired(Date origin, Date candidate) { 37 | return origin.compareTo(candidate) < 0; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/util/HttpHeaderValue.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.util; 2 | 3 | public class HttpHeaderValue { 4 | public static final String NO_CACHE = "no-cache"; 5 | public static final String NO_STORE = "no-store"; 6 | public static final String MUST_REVALIDATE = "must-revalidate"; 7 | public static final String ZERO = "0"; 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/util/HttpHeaderValueAttacher.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.util; 2 | 3 | public class HttpHeaderValueAttacher { 4 | private final StringBuilder stringBuilder = new StringBuilder(); 5 | private static final String COMMA = ", "; 6 | 7 | public static HttpHeaderValueAttacher start() { 8 | return new HttpHeaderValueAttacher(); 9 | } 10 | 11 | public HttpHeaderValueAttacher attach(String headerValue) { 12 | if (this.stringBuilder.length() != 0) { 13 | stringBuilder.append(COMMA); 14 | } 15 | stringBuilder.append(headerValue); 16 | 17 | return this; 18 | } 19 | 20 | public String end() { 21 | return this.stringBuilder.toString(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/util/IframeListener.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.util; 2 | 3 | import com.nhncorp.lucy.security.xss.event.ElementListener; 4 | import com.nhncorp.lucy.security.xss.listener.SecurityUtils; 5 | import com.nhncorp.lucy.security.xss.listener.WhiteUrlList; 6 | import com.nhncorp.lucy.security.xss.markup.Element; 7 | 8 | public class IframeListener implements ElementListener { 9 | public IframeListener() { 10 | } 11 | 12 | public void handleElement(Element element) { 13 | if (!element.isDisabled()) { 14 | String srcUrl = element.getAttributeValue("src"); 15 | boolean isWhiteUrl = this.isWhiteUrl(srcUrl); 16 | boolean isVulnerable = SecurityUtils.checkVulnerable(element, srcUrl, isWhiteUrl); 17 | if (isVulnerable) { 18 | element.setEnabled(false); 19 | } 20 | else { 21 | if (!isWhiteUrl && !srcUrl.isEmpty()) { 22 | element.setEnabled(false); 23 | } 24 | } 25 | } 26 | } 27 | 28 | private boolean isWhiteUrl(String url) { 29 | WhiteUrlList list = WhiteUrlList.getInstance(); 30 | return list != null && list.contains(url); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/util/RandomGenerator.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.util; 2 | 3 | import java.util.concurrent.ThreadLocalRandom; 4 | import koreatech.in.domain.User.owner.CertificationCode; 5 | 6 | public class RandomGenerator { 7 | public static final int CERTIFICATION_NUMBER_ORIGIN = 0; 8 | private static final int CERTIFICATION_NUMBER_BOUND = 1_000_000; 9 | 10 | private static int getCertificationCodeNumber() { 11 | return ThreadLocalRandom.current().nextInt(CERTIFICATION_NUMBER_ORIGIN, CERTIFICATION_NUMBER_BOUND); 12 | } 13 | 14 | public static CertificationCode getCertificationCode() { 15 | return CertificationCode.from(String.format("%06d", getCertificationCodeNumber())); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/util/StringRedisUtil.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.util; 2 | 3 | import com.fasterxml.jackson.databind.ObjectMapper; 4 | import java.util.concurrent.TimeUnit; 5 | import org.springframework.data.redis.core.SetOperations; 6 | import org.springframework.data.redis.core.ValueOperations; 7 | import org.springframework.stereotype.Component; 8 | 9 | import java.io.IOException; 10 | import java.util.ArrayList; 11 | 12 | @Component 13 | public abstract class StringRedisUtil { 14 | protected ValueOperations valOps; 15 | 16 | protected SetOperations setOps; 17 | 18 | protected static final ObjectMapper objectMapper = new ObjectMapper(); 19 | 20 | public abstract void setDataAsString(String key, T data) throws IOException; 21 | 22 | public abstract void setDataAsString(String key, T data, Long time, TimeUnit timeUnit) throws IOException; 23 | 24 | public abstract T getDataAsString(String key, Class classType) throws IOException; 25 | 26 | public abstract void setDataAsSet(String key, T data) throws IOException; 27 | 28 | public abstract ArrayList getDataAsSet(String key, Class classType) throws IOException; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/koreatech/in/util/filter/AllowedOrigins.java: -------------------------------------------------------------------------------- 1 | package koreatech.in.util.filter; 2 | 3 | import java.util.List; 4 | import java.util.Set; 5 | import java.util.stream.Collectors; 6 | import org.apache.commons.lang.StringUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.beans.factory.annotation.Value; 9 | import org.springframework.stereotype.Component; 10 | 11 | @Component 12 | public class AllowedOrigins { 13 | private final Set origins; 14 | 15 | @Autowired 16 | public AllowedOrigins(@Value("#{'${allowed.origins}'.split(',')}") List allowedOrigins) { 17 | this.origins = transformOrigins(allowedOrigins); 18 | } 19 | 20 | public boolean include(String clientOrigin) { 21 | if (StringUtils.isEmpty(clientOrigin)) { 22 | return false; 23 | } 24 | return origins.contains(Origin.from(clientOrigin)); 25 | } 26 | 27 | private Set transformOrigins(List allowDomains) { 28 | return allowDomains.stream() 29 | .map(Origin::from) 30 | .collect(Collectors.toSet()); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/resources/common/application_context_provider.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /src/main/resources/common/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/common/context-scheduler.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/resources/common/mybatis.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/main/resources/common/redis.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | 19 | 20 | 21 | 29 | 30 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/common/search.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/main/resources/common/sesMailSender.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/resources/common/slack_noti.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/main/resources/config/config.example.properties: -------------------------------------------------------------------------------- 1 | jdbc.driverClassName = com.mysql.jdbc.Driver 2 | jdbc.url = jdbc:mysql://localhost:3306/koin?characterEncoding=utf8&useUnicode=true&mysqlEncoding=utf8&zeroDateTimeBehavior=convertToNull 3 | jdbc.username = 4 | jdbc.password = 5 | 6 | mongo.host = localhost 7 | mongo.port = 27017 8 | mongo.username = 9 | mongo.password = 10 | mongo.database = koin 11 | 12 | smtp.host = smtp.gmail.com 13 | smtp.port = 587 14 | smtp.username = 15 | smtp.password = 16 | redis.host = 17 | redis.port = 18 | redis.key.login_prefix = user@ 19 | 20 | s3.key= 21 | s3.secret= 22 | s3.bucket= 23 | s3.custom_domain= 24 | slack.notify_koin_url = 25 | slack.notify_crash_url = 26 | slack.notify_question_url = 27 | 28 | project.env = 29 | project.domain = 30 | 31 | allowed.origins = https://example.com,https://example.com:8080,http://example.co.kr:3000,http://example.co.kr 32 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V10__alter_and_insert_version_in_versions_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`versions` 2 | CHANGE COLUMN `version` `version` VARCHAR(20) NOT NULL; 3 | 4 | INSERT INTO `koin`.`versions` (`version`, `type`) VALUES ('semester_timestamp', 'timetable'); 5 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V11__create_activities_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `koin`.`activities` ( 2 | `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, 3 | `title` VARCHAR(255) NOT NULL, 4 | `description` TEXT NULL DEFAULT NULL, 5 | `image_urls` TEXT NULL DEFAULT NULL, 6 | `date` DATE NOT NULL, 7 | `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', 8 | `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, 9 | `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 10 | PRIMARY KEY (`id`)) 11 | ENGINE = InnoDB 12 | DEFAULT CHARACTER SET = utf8 13 | COLLATE = utf8_bin; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V12__create_members_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `koin`.`members` ( 2 | `id` INT(10) NOT NULL AUTO_INCREMENT, 3 | `name` VARCHAR(50) NOT NULL, 4 | `student_number` VARCHAR(20) NULL DEFAULT NULL, 5 | `track_id` INT(10) UNSIGNED NOT NULL, 6 | `position` VARCHAR(20) NOT NULL, 7 | `email` VARCHAR(100) NULL, 8 | `image_url` TEXT NULL DEFAULT NULL, 9 | `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', 10 | `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, 11 | `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 12 | PRIMARY KEY (`id`)) 13 | ENGINE = InnoDB 14 | DEFAULT CHARACTER SET = utf8 15 | COLLATE = utf8_bin; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V13__create_tracks_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `koin`.`tracks` ( 2 | `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, 3 | `name` VARCHAR(50) NOT NULL, 4 | `headcount` int(10) unsigned NOT NULL DEFAULT '0', 5 | `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', 6 | `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, 7 | `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 8 | PRIMARY KEY (`id`)) 9 | ENGINE = InnoDB 10 | DEFAULT CHARACTER SET = utf8 11 | COLLATE = utf8_bin; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V14__create_tech_stacks_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `koin`.`tech_stacks` ( 2 | `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, 3 | `image_url` TEXT NULL, 4 | `name` VARCHAR(50) NOT NULL, 5 | `description` VARCHAR(100) NULL, 6 | `track_id` INT(10) UNSIGNED NOT NULL, 7 | `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', 8 | `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, 9 | `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 10 | PRIMARY KEY (`id`)) 11 | ENGINE = InnoDB 12 | DEFAULT CHARACTER SET = utf8 13 | COLLATE = utf8_bin; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V15__alter_add_grant_bcsdlab_in_admins_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`admins` 2 | ADD COLUMN `grant_bcsdlab` TINYINT(1) NOT NULL DEFAULT '0' AFTER `grant_survey`; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V16__create_shop_view_logs_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `koin`.`shop_view_logs` ( 2 | `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, 3 | `shop_id` INT(10) UNSIGNED NOT NULL, 4 | `user_id` INT(10) UNSIGNED NULL DEFAULT NULL, 5 | `expired_at` TIMESTAMP NULL DEFAULT NULL, 6 | `ip` VARCHAR(45) NOT NULL, 7 | PRIMARY KEY (`id`)) 8 | ENGINE = InnoDB 9 | DEFAULT CHARACTER SET = utf8 10 | COLLATE = utf8_bin; 11 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V17__alter_add_hits_in_shops_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`shops` 2 | ADD COLUMN `hit` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `remarks`; 3 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V18__change_comment_count_unsigned.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`articles` 2 | CHANGE COLUMN `comment_count` `comment_count` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'; 3 | 4 | ALTER TABLE `koin`.`lost_items` 5 | CHANGE COLUMN `comment_count` `comment_count` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'; 6 | 7 | ALTER TABLE `koin`.`temp_articles` 8 | CHANGE COLUMN `comment_count` `comment_count` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V19__alter_thumbnail_length_in_items_tables.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`items` 2 | CHANGE COLUMN `thumbnail` `thumbnail` VARCHAR(510) NULL DEFAULT NULL ; 3 | 4 | ALTER TABLE `koin`.`lost_items` 5 | CHANGE COLUMN `thumbnail` `thumbnail` VARCHAR(510) NULL DEFAULT NULL ; 6 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V1__alter_design_score_in_lectures_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`lectures` 2 | CHANGE COLUMN `design_score` `design_score` VARCHAR(4) NOT NULL; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V20__create_search_articles_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `koin`.`search_articles` ( 2 | `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, 3 | `table_id` INT UNSIGNED NOT NULL, 4 | `article_id` INT UNSIGNED NOT NULL, 5 | `title` VARCHAR(255) NOT NULL, 6 | `content` TEXT, 7 | `user_id` INT(10) UNSIGNED, 8 | `nickname` VARCHAR(50) NOT NULL, 9 | `is_deleted` TINYINT(1) NOT NULL DEFAULT 0, 10 | `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, 11 | `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 12 | PRIMARY KEY (`id`), 13 | UNIQUE INDEX pk(id), 14 | UNIQUE INDEX idx_unique(table_id, article_id), 15 | INDEX idx_timestamp(created_at), 16 | INDEX idx_is_deleted(is_deleted), 17 | INDEX idx_nickname(nickname, is_deleted, created_at)) 18 | ENGINE = InnoDB 19 | DEFAULT CHARACTER SET = utf8 20 | COLLATE = utf8_bin; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V21__create_holidays_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `koin`.`holidays` ( 2 | `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, 3 | `name` VARCHAR(45) NOT NULL, 4 | `date` DATE NOT NULL, 5 | PRIMARY KEY (`id`)) 6 | ENGINE = InnoDB 7 | DEFAULT CHARACTER SET = utf8 8 | COLLATE = utf8_bin; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V22__create_event_board.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO `koin`.`boards` (`tag`, `name`, `is_anonymous`, `seq`) VALUES ('EA001', '홍보게시판', '0', '6'); -------------------------------------------------------------------------------- /src/main/resources/db/migration/V23__create_event_articles.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `koin`.`event_articles` ( 2 | `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, 3 | `shop_id` INT(10) UNSIGNED NOT NULL, 4 | `title` VARCHAR(20) NOT NULL, 5 | `event_title` VARCHAR(50) NOT NULL, 6 | `content` TEXT NOT NULL, 7 | `user_id` INT(10) NOT NULL, 8 | `nickname` VARCHAR(50) NOT NULL, 9 | `thumbnail` VARCHAR(255) DEFAULT NULL, 10 | `hit` INT(10) NOT NULL DEFAULT '0', 11 | `ip` VARCHAR(45) NOT NULL, 12 | `start_date` DATE NOT NULL, 13 | `end_date` DATE NOT NULL, 14 | `comment_count` TINYINT(1) NOT NULL DEFAULT '0', 15 | `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', 16 | `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, 17 | `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 18 | PRIMARY KEY (`id`), 19 | UNIQUE INDEX pk(id), 20 | INDEX idx_timestamp(created_at), 21 | INDEX idx_is_deleted(is_deleted)) 22 | ENGINE = InnoDB 23 | DEFAULT CHARACTER SET = utf8 24 | COLLATE = utf8_bin; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V24__create_event_articles_view_logs.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `koin`.`event_articles_view_logs` ( 2 | `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, 3 | `event_articles_id` INT(10) UNSIGNED NOT NULL, 4 | `user_id` INT(10) UNSIGNED DEFAULT NULL, 5 | `expired_at` TIMESTAMP NULL DEFAULT NULL, 6 | `ip` VARCHAR(45) NOT NULL, 7 | PRIMARY KEY (`id`), 8 | UNIQUE INDEX idx_unique(event_articles_id, user_id)) 9 | ENGINE = InnoDB 10 | DEFAULT CHARACTER SET = utf8 11 | COLLATE = utf8_bin; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V25__create_users_owners.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `koin`.`users_owners` ( 2 | `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, 3 | `user_id` INT(10) UNSIGNED NOT NULL, 4 | `email` VARCHAR(125) NULL DEFAULT NULL, 5 | PRIMARY KEY (`id`), 6 | UNIQUE INDEX `email_UNIQUE` (`email` ASC), 7 | UNIQUE INDEX `user_id_UNIQUE` (`user_id` ASC), 8 | CONSTRAINT `users_owners_fk_user_id` 9 | FOREIGN KEY (`user_id`) 10 | REFERENCES `koin`.`users` (`id`) 11 | ON DELETE CASCADE 12 | ON UPDATE NO ACTION) 13 | ENGINE = InnoDB 14 | DEFAULT CHARACTER SET = utf8 15 | COLLATE = utf8_bin; 16 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V26__create_event_comments.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `koin`.`event_comments` ( 2 | `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, 3 | `article_id` INT(10) UNSIGNED NOT NULL, 4 | `content` TEXT NOT NULL, 5 | `user_id` INT(10) UNSIGNED NOT NULL, 6 | `nickname` VARCHAR(50) NOT NULL, 7 | `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', 8 | `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, 9 | `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 10 | PRIMARY KEY (`id`)) 11 | ENGINE = InnoDB 12 | DEFAULT CHARACTER SET = utf8 13 | COLLATE = utf8_bin; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V27__add_grant_event.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`admins` 2 | ADD COLUMN `grant_event` TINYINT(1) NOT NULL DEFAULT '0' AFTER `grant_bcsdlab`; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V28__create_shop_owners.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `koin`.`shop_owners` ( 2 | `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, 3 | `shop_id` INT(10) UNSIGNED NOT NULL, 4 | `user_id` INT(10) UNSIGNED NOT NULL, 5 | `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', 6 | `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, 7 | `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 8 | PRIMARY KEY (`id`), 9 | UNIQUE `user_email_idx`(`user_id`, `shop_id`), 10 | CONSTRAINT `shop_owners_fk_shop_id` FOREIGN KEY(`shop_id`) REFERENCES `koin`.`shops`(`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, 11 | CONSTRAINT `shop_owners_fk_user_id` FOREIGN KEY(`user_id`) REFERENCES `koin`.`users`(`id`) ON DELETE CASCADE ON UPDATE NO ACTION 12 | ) 13 | ENGINE = InnoDB 14 | DEFAULT CHARACTER SET = utf8 15 | COLLATE = utf8_bin; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V2__alter_professor_in_lectures_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`lectures` 2 | CHANGE COLUMN `professor` `professor` VARCHAR(30) NULL DEFAULT NULL; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V30__alter_add_weekend_time_in_shops_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE shops ADD weekend_close_time varchar(10) DEFAULT NULL after close_time; 2 | ALTER TABLE shops ADD weekend_open_time varchar(10) DEFAULT NULL after close_time; 3 | 4 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V31__create_courses_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `courses` 2 | ( 3 | `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 4 | `region` varchar(10) COLLATE utf8mb4_bin NOT NULL, 5 | `bus_type` varchar(15) COLLATE utf8mb4_bin NOT NULL, 6 | `is_deleted` tinyint(1) NOT NULL DEFAULT '0', 7 | PRIMARY KEY (`id`) 8 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin -------------------------------------------------------------------------------- /src/main/resources/db/migration/V33__create_student_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `students` ( 2 | `user_id` int NOT NULL, 3 | `anonymous_nickname` varchar(255) DEFAULT NULL, 4 | `student_number` varchar(20) DEFAULT NULL, 5 | `major` varchar(50) DEFAULT NULL, 6 | `is_graduated` tinyint(1) NOT NULL DEFAULT '0', 7 | `auth_token` varchar(255) DEFAULT NULL, 8 | `auth_expired_at` varchar(255) DEFAULT NULL, 9 | `reset_token` varchar(255) DEFAULT NULL, 10 | `reset_expired_at` varchar(255) DEFAULT NULL, 11 | PRIMARY KEY (`user_id`), 12 | UNIQUE KEY `anonymous_nickname_UNIQUE` (`anonymous_nickname`)) 13 | ENGINE = InnoDB 14 | DEFAULT CHARSET = utf8 15 | COLLATE = utf8_bin; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V34__insert_users_data_to_students_table.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO students 2 | (user_id, anonymous_nickname, student_number, major, is_graduated, auth_token, auth_expired_at, reset_token, reset_expired_at) 3 | SELECT id, anonymous_nickname, student_number, major, is_graduated, auth_token, auth_expired_at, reset_token, reset_expired_at 4 | from users; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V35__alter_users_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`users` 2 | DROP COLUMN `reset_expired_at`, 3 | DROP COLUMN `reset_token`, 4 | DROP COLUMN `auth_expired_at`, 5 | DROP COLUMN `auth_token`, 6 | DROP COLUMN `is_graduated`, 7 | DROP COLUMN `major`, 8 | DROP COLUMN `student_number`, 9 | DROP COLUMN `anonymous_nickname`, 10 | DROP INDEX `users_anonymous_nickname_unique`; 11 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V36__create_owner_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `owners` ( 2 | `user_id` int NOT NULL, 3 | `company_registration_number` varchar(12) NOT NULL, 4 | `company_registration_number_image_url` varchar(255) NOT NULL, 5 | `is_authed` tinyint DEFAULT '0', 6 | `grant_shop` tinyint DEFAULT '0', 7 | `grant_event` tinyint DEFAULT '0', 8 | PRIMARY KEY (`user_id`), 9 | UNIQUE KEY `company_registration_number_UNIQUE` (`company_registration_number`) 10 | ) 11 | ENGINE = InnoDB 12 | DEFAULT CHARSET = utf8 13 | COLLATE = utf8_bin; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V37__alter_add_usertype_delete_remember_token_and_identity_in_users_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`users` 2 | DROP COLUMN `remember_token`, 3 | DROP COLUMN `identity`, 4 | ADD COLUMN `user_type` VARCHAR(20) NOT NULL AFTER `phone_number`; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V38__add_identity_to_students_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`students` 2 | ADD COLUMN `identity` SMALLINT NULL AFTER `major`; 3 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V39__alter_company_registration_number_image_url_name_and_delete_is_authed_owners_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`owners` 2 | DROP COLUMN `is_authed`, 3 | CHANGE COLUMN `company_registration_number_image_url` `company_registration_certificate_image_url` VARCHAR(255) NOT NULL ; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V3__alter_target_in_lectures_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`lectures` 2 | CHANGE COLUMN `target` `target` VARCHAR(200) NOT NULL; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V40__add_owner_id_to_shops_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`shops` 2 | ADD COLUMN `owner_id` INT NULL AFTER `id`; 3 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V41__alter_portal_account_to_account_in_users_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`users` 2 | CHANGE COLUMN `portal_account` `account` VARCHAR(50) NOT NULL ; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V42__add_email__to_users_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`users` 2 | ADD COLUMN `email` VARCHAR(100) NOT NULL COMMENT '학교 email' AFTER `user_type` ; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V43__update_users_account_data_to_email.sql: -------------------------------------------------------------------------------- 1 | UPDATE users 2 | SET email = concat(account, '@koreatech.ac.kr'); -------------------------------------------------------------------------------- /src/main/resources/db/migration/V45__alter_students_token_info_to_user_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`users` 2 | ADD COLUMN `auth_token` VARCHAR(255) NULL DEFAULT NULL COMMENT '이메일 인증 토큰' AFTER `profile_image_url`, 3 | ADD COLUMN `auth_expired_at` VARCHAR(255) NULL DEFAULT NULL COMMENT '이메일 인증 토큰 만료 시간' AFTER `auth_token`, 4 | ADD COLUMN `reset_token` VARCHAR(255) NULL DEFAULT NULL COMMENT '비밀번호 초기화 토큰' AFTER `auth_expired_at`, 5 | ADD COLUMN `reset_expired_at` VARCHAR(255) NULL DEFAULT NULL COMMENT '비밀번호 초기화 토큰 만료 시간' AFTER `reset_token`, 6 | CHANGE COLUMN `profile_image_url` `profile_image_url` VARCHAR(255) NULL DEFAULT NULL COMMENT '프로필 이미지 s3 url' AFTER `last_logged_at`; 7 | 8 | ALTER TABLE `koin`.`students` 9 | DROP COLUMN `reset_expired_at`, 10 | DROP COLUMN `reset_token`, 11 | DROP COLUMN `auth_expired_at`, 12 | DROP COLUMN `auth_token`; 13 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V46__remove_unique_constraint_of_users_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`users` 2 | DROP INDEX `users_nickname_unique` , 3 | DROP INDEX `users_portal_account_unique` ; 4 | ; 5 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V47__update_user_type_to_student_of_all_row.sql: -------------------------------------------------------------------------------- 1 | UPDATE `koin`.`users` 2 | SET `user_type` = 'STUDENT'; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V48__alter_is_graduated_to_nullable_in_students_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`students` 2 | CHANGE COLUMN `is_graduated` `is_graduated` TINYINT(1) NULL DEFAULT NULL COMMENT '졸업 여부' ; 3 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V49__add_nickname_unique_constraint_of_users_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`users` 2 | ADD UNIQUE INDEX `nickname_UNIQUE` (`nickname` ASC); 3 | ; 4 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V4__create_timetables_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `koin`.`timetables` ( 2 | `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, 3 | `user_id` INT UNSIGNED NOT NULL, 4 | `semester_id` INT UNSIGNED NOT NULL, 5 | `class_title` VARCHAR(50) NOT NULL, 6 | `class_time` VARCHAR(100) NOT NULL, 7 | `class_place` VARCHAR(30) NULL, 8 | `professor` VARCHAR(30) NULL, 9 | `memo` VARCHAR(200) NULL, 10 | PRIMARY KEY (`id`)) 11 | ENGINE = InnoDB 12 | DEFAULT CHARACTER SET = utf8 13 | COLLATE = utf8_bin; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V50__add_account_unique_constraint_of_users_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`users` 2 | ADD UNIQUE INDEX `account_UNIQUE` (`account` ASC); 3 | ; 4 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V51__create_owner_shop_attachment_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `owner_shop_attachment` 2 | ( 3 | `id` int unsigned NOT NULL AUTO_INCREMENT, 4 | `shop_id` int unsigned, 5 | `owner_id` int unsigned NOT NULL, 6 | `url` TEXT NOT NULL, 7 | `is_deleted` tinyint(1) NOT NULL DEFAULT '0', 8 | `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 9 | PRIMARY KEY (`id`), 10 | CONSTRAINT `owner_shop_attachment_fk_shop_id` FOREIGN KEY (`shop_id`) REFERENCES `shops` (`id`), 11 | CONSTRAINT `owner_shop_attachment_fk_owner_id` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`) 12 | ) ENGINE = InnoDB 13 | DEFAULT CHARSET = utf8 14 | COLLATE = utf8_bin; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V52__add_email_unique_constraint_of_users_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`users` 2 | ADD UNIQUE INDEX `email_UNIQUE` (`email` ASC); 3 | ; 4 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V53__create_shop_menu_details_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `koin`.`shop_menu_details` ( 2 | `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'shop_menu_details 고유 id', 3 | `shop_menu_id` int unsigned NOT NULL COMMENT 'shop_menus 고유 id', 4 | `option` varchar(255) DEFAULT NULL COMMENT '옵션 이름', 5 | `price` int unsigned NOT NULL COMMENT '가격', 6 | `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', 7 | `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', 8 | `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', 9 | PRIMARY KEY (`id`) 10 | ) 11 | ENGINE = InnoDB 12 | DEFAULT CHARSET = utf8 13 | COLLATE = utf8_bin; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V54__create_shop_menu_images_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `koin`.`shop_menu_images` ( 2 | `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'shop_menu_images 고유 id', 3 | `shop_menu_id` int unsigned NOT NULL COMMENT 'shop_menus 고유 id', 4 | `image_url` varchar(255) NOT NULL COMMENT '이미지 URL', 5 | `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', 6 | `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', 7 | `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', 8 | PRIMARY KEY (`id`) 9 | ) 10 | ENGINE = InnoDB 11 | DEFAULT CHARSET = utf8 12 | COLLATE = utf8_bin; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V55__create_shop_menu_categories_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `koin`.`shop_menu_categories` ( 2 | `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'shop_menu_categories 고유 id', 3 | `shop_id` int unsigned NOT NULL COMMENT 'shops 고유 id', 4 | `name` varchar(255) NOT NULL COMMENT '카테고리 이름', 5 | `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', 6 | `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', 7 | `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', 8 | PRIMARY KEY (`id`) 9 | ) 10 | ENGINE = InnoDB 11 | DEFAULT CHARSET = utf8 12 | COLLATE = utf8_bin; 13 | 14 | INSERT INTO `koin`.`shop_menu_categories` (`shop_id`, `name`) 15 | SELECT `id`, '이벤트 메뉴' FROM `koin`.`shops`; 16 | 17 | INSERT INTO `koin`.`shop_menu_categories` (`shop_id`, `name`) 18 | SELECT `id`, '대표 메뉴' FROM `koin`.`shops`; 19 | 20 | INSERT INTO `koin`.`shop_menu_categories` (`shop_id`, `name`) 21 | SELECT `id`, '사이드 메뉴' FROM `koin`.`shops`; 22 | 23 | INSERT INTO `koin`.`shop_menu_categories` (`shop_id`, `name`) 24 | SELECT `id`, '세트 메뉴' FROM `koin`.`shops`; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V56__create_shop_menu_category_map_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `koin`.`shop_menu_category_map` ( 2 | `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'shop_menu_category_map 고유 id', 3 | `shop_menu_id` int unsigned NOT NULL COMMENT 'shop_menus 고유 id', 4 | `shop_menu_category_id` int unsigned NOT NULL COMMENT 'shop_menu_categories 고유 id', 5 | `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', 6 | `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', 7 | `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', 8 | PRIMARY KEY (`id`) 9 | ) 10 | ENGINE = InnoDB 11 | DEFAULT CHARSET = utf8 12 | COLLATE = utf8_bin; 13 | 14 | INSERT INTO `koin`.`shop_menu_category_map` (`shop_menu_id`, `shop_menu_category_id`) 15 | SELECT sm.`id`, smc.`id` 16 | FROM `koin`.`shop_menus` sm 17 | INNER JOIN `koin`.`shop_menu_categories` smc 18 | ON sm.`shop_id` = smc.`shop_id` AND smc.`name` = '대표 메뉴' 19 | WHERE sm.`is_deleted` = 0 AND smc.`is_deleted` = 0; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V57__create_shop_images_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `koin`.`shop_images` ( 2 | `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'shop_images 고유 id', 3 | `shop_id` int unsigned NOT NULL COMMENT 'shops 고유 id', 4 | `image_url` varchar(255) DEFAULT NULL COMMENT '이미지 URL', 5 | `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', 6 | `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', 7 | `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', 8 | PRIMARY KEY (`id`) 9 | ) 10 | ENGINE = InnoDB 11 | DEFAULT CHARSET = utf8 12 | COLLATE = utf8_bin; 13 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V59__create_shop_category_map_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `koin`.`shop_category_map` ( 2 | `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'shop_category_map 고유 id', 3 | `shop_id` int unsigned NOT NULL COMMENT 'shops 고유 id', 4 | `shop_category_id` int unsigned NOT NULL COMMENT 'shop_categories 고유 id', 5 | `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', 6 | `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', 7 | `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', 8 | PRIMARY KEY (`id`) 9 | ) 10 | ENGINE = InnoDB 11 | DEFAULT CHARSET = utf8 12 | COLLATE = utf8_bin; 13 | 14 | INSERT INTO `koin`.`shop_category_map` (`shop_id`, `shop_category_id`) 15 | SELECT `id`, ( 16 | CASE 17 | WHEN `category` = 'S001' THEN 10 18 | WHEN `category` = 'S002' THEN 4 19 | WHEN `category` = 'S003' THEN 5 20 | WHEN `category` = 'S004' THEN 6 21 | WHEN `category` = 'S005' THEN 2 22 | WHEN `category` = 'S006' THEN 3 23 | WHEN `category` = 'S008' THEN 7 24 | WHEN `category` = 'S009' THEN 9 25 | WHEN `category` = 'S010' THEN 8 26 | ELSE 10 27 | END 28 | ) 29 | FROM `koin`.`shops`; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V5__create_semester_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `koin`.`semester` ( 2 | `id` INT UNSIGNED NOT NULL, 3 | `semester` VARCHAR(10) NOT NULL, 4 | PRIMARY KEY (`id`), 5 | UNIQUE INDEX `semester_UNIQUE` (`semester` ASC)) 6 | ENGINE = InnoDB 7 | DEFAULT CHARACTER SET = utf8 8 | COLLATE = utf8_bin; 9 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V61__add_unique_constraint_to_shop_category_map_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`shop_category_map` 2 | DROP COLUMN `is_deleted`, 3 | ADD UNIQUE INDEX `SHOP_ID_AND_SHOP_CATEGORY_ID` (`shop_id` ASC, `shop_category_id` ASC); 4 | ; 5 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V62__add_unique_constraint_to_shop_images_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`shop_images` 2 | DROP COLUMN `is_deleted`, 3 | ADD UNIQUE INDEX `SHOP_ID_AND_IMAGE_URL` (`shop_id` ASC, `image_url` ASC); 4 | ; 5 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V63__add_unique_constraint_to_shop_menu_category_map_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`shop_menu_category_map` 2 | DROP COLUMN `is_deleted`, 3 | ADD UNIQUE INDEX `SHOP_MENU_ID_AND_SHOP_MENU_CATEGORY_ID` (`shop_menu_id` ASC, `shop_menu_category_id` ASC); 4 | ; 5 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V64__add_unique_constraint_to_shop_menu_images_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`shop_menu_images` 2 | DROP COLUMN `is_deleted`, 3 | ADD UNIQUE INDEX `SHOP_MENU_ID_AND_IMAGE_URL` (`shop_menu_id` ASC, `image_url` ASC); 4 | ; 5 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V65__add_unique_constraint_to_shop_menu_details_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`shop_menu_details` 2 | DROP COLUMN `is_deleted`, 3 | ADD UNIQUE INDEX `SHOP_MENU_ID_AND_OPTION_AND_PRICE` (`shop_menu_id` ASC, `option` ASC, `price` ASC); 4 | ; 5 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V66__insert_full_view_category_relation_into_shop_category_map_table.sql: -------------------------------------------------------------------------------- 1 | INSERT IGNORE INTO `koin`.`shop_category_map` (`shop_id`, `shop_category_id`) 2 | SELECT `id`, 1 3 | FROM `koin`.`shops` -------------------------------------------------------------------------------- /src/main/resources/db/migration/V67__alter_shops_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`shops` 2 | DROP COLUMN `image_urls`, 3 | DROP COLUMN `weekend_close_time`, 4 | DROP COLUMN `weekend_open_time`, 5 | DROP COLUMN `close_time`, 6 | DROP COLUMN `open_time`, 7 | DROP COLUMN `category`, 8 | DROP INDEX `ux_name` ; 9 | ; 10 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V68__alter_shop_menus_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`shop_menus` 2 | DROP COLUMN `price_type`, 3 | ADD COLUMN `description` VARCHAR(255) NULL COMMENT '메뉴 구성' AFTER `name`, 4 | ADD COLUMN `is_hidden` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '숨김 여부' AFTER `description`; 5 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V69.000__alter_drop_user_account.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`users` 2 | DROP COLUMN `account` 3 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V69.001__alter_remove_notnull_owner_url.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`owners` 2 | MODIFY `company_registration_certificate_image_url` VARCHAR(255) NULL ; 3 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V6__alter_add_is_deleted_in_timetables.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`timetables` 2 | ADD COLUMN `is_deleted` TINYINT(1) NOT NULL DEFAULT 0 AFTER `memo`; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V70.000__drop_fk_owner_attachment_shop_id.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE koin.owner_shop_attachment 2 | DROP FOREIGN KEY owner_shop_attachment_fk_shop_id; 3 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V70.001__drop_column_owner_attachment_shop_id.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE koin.owner_shop_attachment 2 | DROP COLUMN shop_id; 3 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V70.002__change_table_name_owner_attachment.sql: -------------------------------------------------------------------------------- 1 | RENAME TABLE 2 | owner_shop_attachment TO owner_attachments; 3 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V71.000__increase_version_type_size.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE versions MODIFY COLUMN `type` VARCHAR(255); 2 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V72__alter_owners_company_registration_number_is_nullable.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`owners` 2 | CHANGE COLUMN `company_registration_number` `company_registration_number` VARCHAR(12) CHARACTER SET 'utf8mb3' NULL COMMENT '사업자등록번호'; 3 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V73.000__add_auto_incremet_semester.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `semester` MODIFY COLUMN `id` INT UNSIGNED NOT NULL AUTO_INCREMENT; 2 | 3 | ALTER TABLE `semester` AUTO_INCREMENT = 100; 4 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V74__add_column_owner_attachments_table_created_at.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `owner_attachments` ADD `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `is_deleted` 2 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V7__alter_add_timestamp_in_timetables_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`timetables` 2 | ADD COLUMN `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `is_deleted`, 3 | ADD COLUMN `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER `created_at`; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V8__alter_add_grades_in_timetables_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`timetables` 2 | ADD COLUMN `grades` VARCHAR(2) NOT NULL AFTER `professor`; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V9__alter_add_more_columns_in_timetables_table.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `koin`.`timetables` 2 | ADD COLUMN `code` VARCHAR(10) AFTER `semester_id`, 3 | ADD COLUMN `lecture_class` VARCHAR(3) AFTER `grades`, 4 | ADD COLUMN `target` VARCHAR(200) AFTER `lecture_class`, 5 | ADD COLUMN `regular_number` VARCHAR(4) AFTER `target`, 6 | ADD COLUMN `design_score` VARCHAR(4) AFTER `regular_number`, 7 | ADD COLUMN `department` VARCHAR(30) AFTER `design_score`; -------------------------------------------------------------------------------- /src/main/resources/mapper/admin/AdminTrackMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | -------------------------------------------------------------------------------- /src/main/resources/xssfilter-extension.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCSDLab/KOIN_API/64504c61164b11db5f302cdd9302d05d5857e168/src/main/resources/xssfilter-extension.properties -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resources/js/sha256.min.js: -------------------------------------------------------------------------------- 1 | var sha256=function a(b){function c(a,b){return a>>>b|a<<32-b}for(var d,e,f=Math.pow,g=f(2,32),h="length",i="",j=[],k=8*b[h],l=a.h=a.h||[],m=a.k=a.k||[],n=m[h],o={},p=2;64>n;p++)if(!o[p]){for(d=0;313>d;d+=p)o[d]=p;l[n]=f(p,.5)*g|0,m[n++]=f(p,1/3)*g|0}for(b+="\x80";b[h]%64-56;)b+="\x00";for(d=0;d>8)return;j[d>>2]|=e<<(3-d)%4*8}for(j[j[h]]=k/g|0,j[j[h]]=k,e=0;ed;d++){var s=q[d-15],t=q[d-2],u=l[0],v=l[4],w=l[7]+(c(v,6)^c(v,11)^c(v,25))+(v&l[5]^~v&l[6])+m[d]+(q[d]=16>d?q[d]:q[d-16]+(c(s,7)^c(s,18)^s>>>3)+q[d-7]+(c(t,17)^c(t,19)^t>>>10)|0),x=(c(u,2)^c(u,13)^c(u,22))+(u&l[1]^u&l[2]^l[1]&l[2]);l=[w+x|0].concat(l),l[4]=l[4]+w|0}for(d=0;8>d;d++)l[d]=l[d]+r[d]|0}for(d=0;8>d;d++)for(e=3;e+1;e--){var y=l[d]>>8*e&255;i+=(16>y?0:"")+y.toString(16)}return i}; -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/home.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: jungbohyuk 4 | Date: 16/02/2019 5 | Time: 2:52 PM 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 9 | 10 | 11 | ${Title} 12 | 13 | 14 | ${Body} 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/mail/error_config.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | <%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %> 3 | 4 | 5 | 6 | 7 | 코인 이메일 인증 폼 8 | 9 | 10 | 11 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: jungbohyuk 4 | Date: 16/02/2019 5 | Time: 2:52 PM 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 9 | 10 | 11 | Title 12 | 13 | 14 | Spring Project 15 | 16 | 17 | --------------------------------------------------------------------------------