├── .github └── ISSUE_TEMPLATE │ └── bug_report.md ├── .gitignore ├── .mvn └── wrapper │ └── maven-wrapper.properties ├── DETAIL.md ├── Dockerfile ├── LICENSE ├── README.md ├── doc ├── DifyAPI.md ├── swagger.png ├── 主页1.jpg ├── 主页2.jpg ├── 学习任务.jpg ├── 对话1.jpg ├── 对话2.jpg ├── 对话详情页.jpg ├── 我的页面1.jpg ├── 我的页面2.jpg ├── 我的页面3.jpg ├── 课程.jpg ├── 课程学习页.jpg └── 课程表.jpg ├── docker-compose.yml ├── mvnw ├── mvnw.cmd ├── pom.xml ├── settings.xml ├── sql ├── create_table.sql └── post_es_mapping.json └── src ├── main ├── java │ └── com │ │ └── ubanillx │ │ └── smartclass │ │ ├── MainApplication.java │ │ ├── annotation │ │ └── AuthCheck.java │ │ ├── aop │ │ ├── AuthInterceptor.java │ │ └── LogInterceptor.java │ │ ├── common │ │ ├── BaseResponse.java │ │ ├── DeleteRequest.java │ │ ├── ErrorCode.java │ │ ├── PageRequest.java │ │ └── ResultUtils.java │ │ ├── config │ │ ├── CorsConfig.java │ │ ├── CosClientConfig.java │ │ ├── DifyConfig.java │ │ ├── JsonConfig.java │ │ ├── MyBatisPlusConfig.java │ │ └── WxOpenConfig.java │ │ ├── constant │ │ ├── CommonConstant.java │ │ ├── FileConstant.java │ │ └── UserConstant.java │ │ ├── controller │ │ ├── AiAvatarChatController.java │ │ ├── AiAvatarController.java │ │ ├── AnnouncementController.java │ │ ├── CourseCategoryController.java │ │ ├── CourseChapterController.java │ │ ├── CourseController.java │ │ ├── CourseFavouriteController.java │ │ ├── CourseMaterialController.java │ │ ├── CourseReviewController.java │ │ ├── CourseSectionController.java │ │ ├── DailyArticleController.java │ │ ├── DailyArticleFavourController.java │ │ ├── DailyArticleThumbController.java │ │ ├── DailyWordController.java │ │ ├── DailyWordFavourController.java │ │ ├── DailyWordLearningController.java │ │ ├── DailyWordThumbController.java │ │ ├── FileController.java │ │ ├── PostController.java │ │ ├── PostFavourController.java │ │ ├── PostThumbController.java │ │ ├── TeacherController.java │ │ ├── UserAiAvatarController.java │ │ ├── UserController.java │ │ ├── UserLearningRecordController.java │ │ ├── UserLearningStatsController.java │ │ ├── UserLevelController.java │ │ └── WxMpController.java │ │ ├── esdao │ │ └── PostEsDao.java │ │ ├── exception │ │ ├── BusinessException.java │ │ ├── GlobalExceptionHandler.java │ │ └── ThrowUtils.java │ │ ├── generate │ │ └── CodeGenerator.java │ │ ├── job │ │ ├── cycle │ │ │ └── IncSyncPostToEs.java │ │ └── once │ │ │ └── FullSyncPostToEs.java │ │ ├── manager │ │ └── CosManager.java │ │ ├── mapper │ │ ├── AchievementMapper.java │ │ ├── AiAvatarChatHistoryMapper.java │ │ ├── AiAvatarMapper.java │ │ ├── AnnouncementMapper.java │ │ ├── CourseCategoryMapper.java │ │ ├── CourseChapterMapper.java │ │ ├── CourseFavouriteMapper.java │ │ ├── CourseMapper.java │ │ ├── CourseMaterialMapper.java │ │ ├── CourseReviewMapper.java │ │ ├── CourseSectionMapper.java │ │ ├── DailyArticleMapper.java │ │ ├── DailyWordMapper.java │ │ ├── PostFavourMapper.java │ │ ├── PostMapper.java │ │ ├── PostThumbMapper.java │ │ ├── TeacherMapper.java │ │ ├── UserAiAvatarMapper.java │ │ ├── UserAnnouncementReaderMapper.java │ │ ├── UserArticleRecordMapper.java │ │ ├── UserDailyArticleMapper.java │ │ ├── UserDailyWordMapper.java │ │ ├── UserLearningRecordMapper.java │ │ ├── UserLearningStatsMapper.java │ │ ├── UserLevelMapper.java │ │ └── UserMapper.java │ │ ├── model │ │ ├── dto │ │ │ ├── DeleteRequest.java │ │ │ ├── UserArticleRecord.java │ │ │ ├── achievement │ │ │ │ ├── AchievementAddRequest.java │ │ │ │ ├── AchievementQueryRequest.java │ │ │ │ └── AchievementUpdateRequest.java │ │ │ ├── aiavatar │ │ │ │ ├── AiAvatarAddRequest.java │ │ │ │ ├── AiAvatarQueryRequest.java │ │ │ │ └── AiAvatarUpdateRequest.java │ │ │ ├── announcement │ │ │ │ ├── AnnouncementAddRequest.java │ │ │ │ ├── AnnouncementQueryRequest.java │ │ │ │ └── AnnouncementUpdateRequest.java │ │ │ ├── chat │ │ │ │ ├── ChatMessageAddRequest.java │ │ │ │ ├── ChatMessageQueryRequest.java │ │ │ │ ├── ChatSessionQueryRequest.java │ │ │ │ ├── ChatSessionUpdateRequest.java │ │ │ │ ├── StopStreamingRequest.java │ │ │ │ ├── TextToAudioRequest.java │ │ │ │ ├── UploadFileRequest.java │ │ │ │ └── UploadFileResponse.java │ │ │ ├── course │ │ │ │ ├── CourseAddRequest.java │ │ │ │ ├── CourseFavourAddRequest.java │ │ │ │ ├── CourseQueryRequest.java │ │ │ │ └── CourseUpdateRequest.java │ │ │ ├── dailyarticle │ │ │ │ ├── DailyArticleAddRequest.java │ │ │ │ ├── DailyArticleQueryRequest.java │ │ │ │ └── DailyArticleUpdateRequest.java │ │ │ ├── dailyword │ │ │ │ ├── DailyWordAddRequest.java │ │ │ │ ├── DailyWordQueryRequest.java │ │ │ │ └── DailyWordUpdateRequest.java │ │ │ ├── dify │ │ │ │ ├── DifyChatRequest.java │ │ │ │ ├── DifyChatResponse.java │ │ │ │ └── DifyStreamChunk.java │ │ │ ├── file │ │ │ │ ├── UploadFileRequest.java │ │ │ │ └── UploadVideoRequest.java │ │ │ ├── learningrecord │ │ │ │ ├── UserLearningRecordAddRequest.java │ │ │ │ ├── UserLearningRecordQueryRequest.java │ │ │ │ └── UserLearningRecordUpdateRequest.java │ │ │ ├── post │ │ │ │ ├── PostAddRequest.java │ │ │ │ ├── PostEditRequest.java │ │ │ │ ├── PostEsDTO.java │ │ │ │ ├── PostQueryRequest.java │ │ │ │ └── PostUpdateRequest.java │ │ │ ├── postfavour │ │ │ │ ├── PostFavourAddRequest.java │ │ │ │ └── PostFavourQueryRequest.java │ │ │ ├── postthumb │ │ │ │ └── PostThumbAddRequest.java │ │ │ ├── teacher │ │ │ │ ├── TeacherAddRequest.java │ │ │ │ ├── TeacherQueryRequest.java │ │ │ │ └── TeacherUpdateRequest.java │ │ │ ├── user │ │ │ │ ├── UserAddRequest.java │ │ │ │ ├── UserLoginByPhoneRequest.java │ │ │ │ ├── UserLoginRequest.java │ │ │ │ ├── UserQueryRequest.java │ │ │ │ ├── UserRegisterByPhoneRequest.java │ │ │ │ ├── UserRegisterRequest.java │ │ │ │ ├── UserUpdateMyRequest.java │ │ │ │ └── UserUpdateRequest.java │ │ │ ├── useraiavatar │ │ │ │ ├── UserAiAvatarAddRequest.java │ │ │ │ ├── UserAiAvatarQueryRequest.java │ │ │ │ └── UserAiAvatarUpdateRequest.java │ │ │ └── userlevel │ │ │ │ ├── UserLevelAddRequest.java │ │ │ │ ├── UserLevelQueryRequest.java │ │ │ │ └── UserLevelUpdateRequest.java │ │ ├── entity │ │ │ ├── Achievement.java │ │ │ ├── AiAvatar.java │ │ │ ├── AiAvatarChatHistory.java │ │ │ ├── Announcement.java │ │ │ ├── Course.java │ │ │ ├── CourseCategory.java │ │ │ ├── CourseChapter.java │ │ │ ├── CourseFavourite.java │ │ │ ├── CourseMaterial.java │ │ │ ├── CourseReview.java │ │ │ ├── CourseSection.java │ │ │ ├── DailyArticle.java │ │ │ ├── DailyWord.java │ │ │ ├── Post.java │ │ │ ├── PostFavour.java │ │ │ ├── PostThumb.java │ │ │ ├── Teacher.java │ │ │ ├── User.java │ │ │ ├── UserAiAvatar.java │ │ │ ├── UserAnnouncementReader.java │ │ │ ├── UserDailyArticle.java │ │ │ ├── UserDailyWord.java │ │ │ ├── UserLearningRecord.java │ │ │ ├── UserLearningStats.java │ │ │ └── UserLevel.java │ │ ├── enums │ │ │ ├── FileUploadBizEnum.java │ │ │ ├── UserGenderEnum.java │ │ │ └── UserRoleEnum.java │ │ └── vo │ │ │ ├── AchievementVO.java │ │ │ ├── AiAvatarBriefVO.java │ │ │ ├── AiAvatarVO.java │ │ │ ├── AnnouncementVO.java │ │ │ ├── ChatHistoryListVO.java │ │ │ ├── ChatMessageVO.java │ │ │ ├── ChatSessionVO.java │ │ │ ├── CourseReviewVO.java │ │ │ ├── CourseVO.java │ │ │ ├── DailyArticleVO.java │ │ │ ├── DailyWordVO.java │ │ │ ├── LoginUserVO.java │ │ │ ├── PostVO.java │ │ │ ├── TeacherVO.java │ │ │ ├── UserAiAvatarVO.java │ │ │ ├── UserLearningRecordVO.java │ │ │ ├── UserLevelVO.java │ │ │ └── UserVO.java │ │ ├── service │ │ ├── AchievementService.java │ │ ├── AiAvatarChatHistoryService.java │ │ ├── AiAvatarService.java │ │ ├── AnnouncementService.java │ │ ├── CourseCategoryService.java │ │ ├── CourseChapterService.java │ │ ├── CourseFavouriteService.java │ │ ├── CourseMaterialService.java │ │ ├── CourseReviewService.java │ │ ├── CourseSectionService.java │ │ ├── CourseService.java │ │ ├── DailyArticleFavourService.java │ │ ├── DailyArticleService.java │ │ ├── DailyArticleThumbService.java │ │ ├── DailyWordFavourService.java │ │ ├── DailyWordService.java │ │ ├── DailyWordThumbService.java │ │ ├── DifyService.java │ │ ├── PostFavourService.java │ │ ├── PostService.java │ │ ├── PostThumbService.java │ │ ├── TeacherService.java │ │ ├── UserAiAvatarService.java │ │ ├── UserAnnouncementReaderService.java │ │ ├── UserArticleRecordService.java │ │ ├── UserDailyArticleService.java │ │ ├── UserDailyWordService.java │ │ ├── UserLearningRecordService.java │ │ ├── UserLearningStatsService.java │ │ ├── UserLevelService.java │ │ ├── UserService.java │ │ └── impl │ │ │ ├── AiAvatarChatHistoryServiceImpl.java │ │ │ ├── AiAvatarServiceImpl.java │ │ │ ├── AnnouncementServiceImpl.java │ │ │ ├── CourseCategoryServiceImpl.java │ │ │ ├── CourseChapterServiceImpl.java │ │ │ ├── CourseFavouriteServiceImpl.java │ │ │ ├── CourseMaterialServiceImpl.java │ │ │ ├── CourseReviewServiceImpl.java │ │ │ ├── CourseSectionServiceImpl.java │ │ │ ├── CourseServiceImpl.java │ │ │ ├── DailyArticleFavourServiceImpl.java │ │ │ ├── DailyArticleServiceImpl.java │ │ │ ├── DailyArticleThumbServiceImpl.java │ │ │ ├── DailyWordFavourServiceImpl.java │ │ │ ├── DailyWordServiceImpl.java │ │ │ ├── DailyWordThumbServiceImpl.java │ │ │ ├── DifyServiceImpl.java │ │ │ ├── PostFavourServiceImpl.java │ │ │ ├── PostServiceImpl.java │ │ │ ├── PostThumbServiceImpl.java │ │ │ ├── TeacherServiceImpl.java │ │ │ ├── UserAiAvatarServiceImpl.java │ │ │ ├── UserDailyWordServiceImpl.java │ │ │ ├── UserLearningRecordServiceImpl.java │ │ │ ├── UserLearningStatsServiceImpl.java │ │ │ ├── UserLevelServiceImpl.java │ │ │ └── UserServiceImpl.java │ │ ├── util │ │ ├── ChatMessageHelper.java │ │ └── OkHttpUtils.java │ │ ├── utils │ │ ├── FileUtil.java │ │ ├── NetUtils.java │ │ ├── SpringContextUtils.java │ │ └── SqlUtils.java │ │ └── wxmp │ │ ├── WxMpConstant.java │ │ ├── WxMpMsgRouter.java │ │ └── handler │ │ ├── EventHandler.java │ │ ├── MessageHandler.java │ │ └── SubscribeHandler.java └── resources │ ├── META-INF │ └── additional-spring-configuration-metadata.json │ ├── application-prod.yml │ ├── application-test.yml │ ├── application.yml │ ├── mapper │ ├── AchievementMapper.xml │ ├── AiAvatarChatHistoryMapper.xml │ ├── AiAvatarMapper.xml │ ├── AnnouncementMapper.xml │ ├── CourseCategoryMapper.xml │ ├── CourseChapterMapper.xml │ ├── CourseFavouriteMapper.xml │ ├── CourseMapper.xml │ ├── CourseMaterialMapper.xml │ ├── CourseReviewMapper.xml │ ├── CourseSectionMapper.xml │ ├── DailyArticleMapper.xml │ ├── DailyWordMapper.xml │ ├── PostFavourMapper.xml │ ├── PostMapper.xml │ ├── PostThumbMapper.xml │ ├── TeacherMapper.xml │ ├── UserAiAvatarMapper.xml │ ├── UserAnnouncementReaderMapper.xml │ ├── UserArticleRecordMapper.xml │ ├── UserDailyArticleMapper.xml │ ├── UserDailyWordMapper.xml │ ├── UserLearningRecordMapper.xml │ ├── UserLearningStatsMapper.xml │ ├── UserLevelMapper.xml │ └── UserMapper.xml │ ├── templates │ ├── TemplateController.java.ftl │ ├── TemplateService.java.ftl │ ├── TemplateServiceImpl.java.ftl │ └── model │ │ ├── TemplateAddRequest.java.ftl │ │ ├── TemplateEditRequest.java.ftl │ │ ├── TemplateQueryRequest.java.ftl │ │ ├── TemplateUpdateRequest.java.ftl │ │ └── TemplateVO.java.ftl │ └── test_excel.xlsx └── test └── java └── com └── ubanillx └── smartclass ├── MainApplicationTests.java ├── manager └── CosManagerTest.java ├── mapper ├── PostFavourMapperTest.java └── PostMapperTest.java ├── service ├── PostFavourServiceTest.java ├── PostThumbServiceTest.java └── UserServiceTest.java └── utils └── EasyExcelTest.java /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 3 | -------------------------------------------------------------------------------- /doc/swagger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ubanillx/smartclass-backend/7dfe2c0377280c53209f8388f062e3a1062dc153/doc/swagger.png -------------------------------------------------------------------------------- /doc/主页1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ubanillx/smartclass-backend/7dfe2c0377280c53209f8388f062e3a1062dc153/doc/主页1.jpg -------------------------------------------------------------------------------- /doc/主页2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ubanillx/smartclass-backend/7dfe2c0377280c53209f8388f062e3a1062dc153/doc/主页2.jpg -------------------------------------------------------------------------------- /doc/学习任务.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ubanillx/smartclass-backend/7dfe2c0377280c53209f8388f062e3a1062dc153/doc/学习任务.jpg -------------------------------------------------------------------------------- /doc/对话1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ubanillx/smartclass-backend/7dfe2c0377280c53209f8388f062e3a1062dc153/doc/对话1.jpg -------------------------------------------------------------------------------- /doc/对话2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ubanillx/smartclass-backend/7dfe2c0377280c53209f8388f062e3a1062dc153/doc/对话2.jpg -------------------------------------------------------------------------------- /doc/对话详情页.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ubanillx/smartclass-backend/7dfe2c0377280c53209f8388f062e3a1062dc153/doc/对话详情页.jpg -------------------------------------------------------------------------------- /doc/我的页面1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ubanillx/smartclass-backend/7dfe2c0377280c53209f8388f062e3a1062dc153/doc/我的页面1.jpg -------------------------------------------------------------------------------- /doc/我的页面2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ubanillx/smartclass-backend/7dfe2c0377280c53209f8388f062e3a1062dc153/doc/我的页面2.jpg -------------------------------------------------------------------------------- /doc/我的页面3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ubanillx/smartclass-backend/7dfe2c0377280c53209f8388f062e3a1062dc153/doc/我的页面3.jpg -------------------------------------------------------------------------------- /doc/课程.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ubanillx/smartclass-backend/7dfe2c0377280c53209f8388f062e3a1062dc153/doc/课程.jpg -------------------------------------------------------------------------------- /doc/课程学习页.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ubanillx/smartclass-backend/7dfe2c0377280c53209f8388f062e3a1062dc153/doc/课程学习页.jpg -------------------------------------------------------------------------------- /doc/课程表.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ubanillx/smartclass-backend/7dfe2c0377280c53209f8388f062e3a1062dc153/doc/课程表.jpg -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | 3 | services: 4 | # 应用服务 5 | smartclass-app: 6 | build: 7 | context: . 8 | dockerfile: Dockerfile 9 | container_name: smartclass-app 10 | ports: 11 | - "8101:8101" 12 | environment: 13 | - SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/smart_class?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai 14 | - SPRING_DATASOURCE_USERNAME=root 15 | - SPRING_DATASOURCE_PASSWORD=mysql_5TDxKc 16 | - SPRING_REDIS_HOST=redis 17 | - SPRING_REDIS_PORT=6379 18 | - SPRING_REDIS_PASSWORD=redis_wKaQkb 19 | - SPRING_PROFILES_ACTIVE=prod 20 | depends_on: 21 | - mysql 22 | - redis 23 | networks: 24 | - smartclass-network 25 | restart: always 26 | 27 | # MySQL服务 28 | mysql: 29 | image: mysql:8.0 30 | container_name: smartclass-mysql 31 | command: --default-authentication-plugin=mysql_native_password 32 | environment: 33 | - MYSQL_ROOT_PASSWORD=mysql_5TDxKc 34 | - MYSQL_DATABASE=smart_class 35 | ports: 36 | - "3306:3306" 37 | volumes: 38 | - mysql-data:/var/lib/mysql 39 | - ./sql:/docker-entrypoint-initdb.d 40 | networks: 41 | - smartclass-network 42 | restart: always 43 | 44 | # Redis服务 45 | redis: 46 | image: redis:6.2 47 | container_name: smartclass-redis 48 | command: redis-server --requirepass redis_wKaQkb 49 | ports: 50 | - "6379:6379" 51 | volumes: 52 | - redis-data:/data 53 | networks: 54 | - smartclass-network 55 | restart: always 56 | 57 | # 数据卷 58 | volumes: 59 | mysql-data: 60 | redis-data: 61 | 62 | # 网络配置 63 | networks: 64 | smartclass-network: 65 | driver: bridge -------------------------------------------------------------------------------- /settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | aliyunmaven 9 | central 10 | 阿里云公共仓库 11 | https://maven.aliyun.com/repository/public 12 | 13 | 14 | aliyunmaven2 15 | central 16 | 阿里云仓库2 17 | https://maven.aliyun.com/repository/central 18 | 19 | 20 | aliyunmaven3 21 | central 22 | 阿里云仓库3 23 | https://maven.aliyun.com/repository/spring 24 | 25 | 26 | 27 | 28 | 29 | jdk-1.8 30 | 31 | true 32 | 1.8 33 | 34 | 35 | 1.8 36 | 1.8 37 | 1.8 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /sql/post_es_mapping.json: -------------------------------------------------------------------------------- 1 | { 2 | "aliases": { 3 | "post": {} 4 | }, 5 | "mappings": { 6 | "properties": { 7 | "title": { 8 | "type": "text", 9 | "analyzer": "ik_max_word", 10 | "search_analyzer": "ik_smart", 11 | "fields": { 12 | "keyword": { 13 | "type": "keyword", 14 | "ignore_above": 256 15 | } 16 | } 17 | }, 18 | "content": { 19 | "type": "text", 20 | "analyzer": "ik_max_word", 21 | "search_analyzer": "ik_smart", 22 | "fields": { 23 | "keyword": { 24 | "type": "keyword", 25 | "ignore_above": 256 26 | } 27 | } 28 | }, 29 | "tags": { 30 | "type": "keyword" 31 | }, 32 | "thumbNum": { 33 | "type": "long" 34 | }, 35 | "favourNum": { 36 | "type": "long" 37 | }, 38 | "userId": { 39 | "type": "keyword" 40 | }, 41 | "createTime": { 42 | "type": "date" 43 | }, 44 | "updateTime": { 45 | "type": "date" 46 | }, 47 | "isDelete": { 48 | "type": "keyword" 49 | } 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; 7 | import org.springframework.context.annotation.EnableAspectJAutoProxy; 8 | import org.springframework.scheduling.annotation.EnableScheduling; 9 | 10 | /** 11 | * 主类(项目启动入口) 12 | */ 13 | // todo 如需开启 Redis,须移除 exclude 中的内容 14 | //@SpringBootApplication(exclude = {RedisAutoConfiguration.class}) 15 | @SpringBootApplication() 16 | @MapperScan("com.ubanillx.smartclass.mapper") 17 | @EnableScheduling 18 | @EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true) 19 | public class MainApplication { 20 | 21 | public static void main(String[] args) { 22 | SpringApplication.run(MainApplication.class, args); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/annotation/AuthCheck.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.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 | /** 9 | * 权限校验 10 | */ 11 | @Target(ElementType.METHOD) 12 | @Retention(RetentionPolicy.RUNTIME) 13 | public @interface AuthCheck { 14 | 15 | /** 16 | * 必须有某个角色 17 | * 18 | * @return 19 | */ 20 | String mustRole() default ""; 21 | 22 | } 23 | 24 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/common/BaseResponse.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.common; 2 | 3 | import java.io.Serializable; 4 | import lombok.Data; 5 | 6 | /** 7 | * 通用返回类 8 | * 9 | * @param 10 | 11 | */ 12 | @Data 13 | public class BaseResponse implements Serializable { 14 | 15 | private int code; 16 | 17 | private T data; 18 | 19 | private String message; 20 | 21 | public BaseResponse(int code, T data, String message) { 22 | this.code = code; 23 | this.data = data; 24 | this.message = message; 25 | } 26 | 27 | public BaseResponse(int code, T data) { 28 | this(code, data, ""); 29 | } 30 | 31 | public BaseResponse(ErrorCode errorCode) { 32 | this(errorCode.getCode(), null, errorCode.getMessage()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/common/DeleteRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.common; 2 | 3 | import java.io.Serializable; 4 | import lombok.Data; 5 | 6 | /** 7 | * 删除请求 8 | */ 9 | @Data 10 | public class DeleteRequest implements Serializable { 11 | 12 | /** 13 | * id 14 | */ 15 | private Long id; 16 | 17 | private static final long serialVersionUID = 1L; 18 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/common/ErrorCode.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.common; 2 | 3 | /** 4 | * 自定义错误码 5 | */ 6 | public enum ErrorCode { 7 | 8 | SUCCESS(0, "ok"), 9 | PARAMS_ERROR(40000, "请求参数错误"), 10 | NOT_LOGIN_ERROR(40100, "未登录"), 11 | NO_AUTH_ERROR(40101, "无权限"), 12 | NOT_FOUND_ERROR(40400, "请求数据不存在"), 13 | FORBIDDEN_ERROR(40300, "禁止访问"), 14 | SYSTEM_ERROR(50000, "系统内部异常"), 15 | OPERATION_ERROR(50001, "操作失败"); 16 | 17 | /** 18 | * 状态码 19 | */ 20 | private final int code; 21 | 22 | /** 23 | * 信息 24 | */ 25 | private final String message; 26 | 27 | ErrorCode(int code, String message) { 28 | this.code = code; 29 | this.message = message; 30 | } 31 | 32 | public int getCode() { 33 | return code; 34 | } 35 | 36 | public String getMessage() { 37 | return message; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/common/PageRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.common; 2 | 3 | import com.ubanillx.smartclass.constant.CommonConstant; 4 | import lombok.Data; 5 | 6 | /** 7 | * 分页请求 8 | */ 9 | @Data 10 | public class PageRequest { 11 | 12 | /** 13 | * 当前页号 14 | */ 15 | private int current = 1; 16 | 17 | /** 18 | * 页面大小 19 | */ 20 | private int pageSize = 10; 21 | 22 | /** 23 | * 排序字段 24 | */ 25 | private String sortField; 26 | 27 | /** 28 | * 排序顺序(默认升序) 29 | */ 30 | private String sortOrder = CommonConstant.SORT_ORDER_ASC; 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/common/ResultUtils.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.common; 2 | 3 | /** 4 | * 返回工具类 5 | */ 6 | @SuppressWarnings("unchecked") 7 | public class ResultUtils { 8 | 9 | /** 10 | * 成功 11 | * 12 | * @param data 数据 13 | * @param 泛型 14 | * @return 通用返回类 15 | */ 16 | public static BaseResponse success(T data) { 17 | return new BaseResponse<>(0, data, "ok"); 18 | } 19 | 20 | /** 21 | * 失败 22 | * 23 | * @param errorCode 错误码 24 | * @param 泛型 25 | * @return 通用返回类 26 | */ 27 | public static BaseResponse error(ErrorCode errorCode) { 28 | return new BaseResponse<>(errorCode); 29 | } 30 | 31 | /** 32 | * 失败 33 | * 34 | * @param code 错误码 35 | * @param message 错误信息 36 | * @param 泛型 37 | * @return 通用返回类 38 | */ 39 | public static BaseResponse error(int code, String message) { 40 | return new BaseResponse<>(code, null, message); 41 | } 42 | 43 | /** 44 | * 失败 45 | * 46 | * @param errorCode 错误码 47 | * @param message 错误信息 48 | * @param 泛型 49 | * @return 通用返回类 50 | */ 51 | public static BaseResponse error(ErrorCode errorCode, String message) { 52 | return new BaseResponse<>(errorCode.getCode(), null, message); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/config/CorsConfig.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 6 | 7 | /** 8 | * 全局跨域配置 9 | */ 10 | @Configuration 11 | public class CorsConfig implements WebMvcConfigurer { 12 | 13 | @Override 14 | public void addCorsMappings(CorsRegistry registry) { 15 | // 覆盖所有请求 16 | registry.addMapping("/**") 17 | // 允许发送 Cookie 18 | .allowCredentials(true) 19 | // 放行哪些域名(必须用 patterns,否则 * 会和 allowCredentials 冲突) 20 | .allowedOriginPatterns("*") 21 | .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") 22 | .allowedHeaders("*") 23 | .exposedHeaders("*"); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/config/DifyConfig.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | /** 8 | * Dify配置 9 | */ 10 | @Configuration 11 | @ConfigurationProperties(prefix = "dify") 12 | @Data 13 | public class DifyConfig { 14 | 15 | /** 16 | * Dify API基础URL 17 | */ 18 | private String baseUrl = "http://10.0.124.181/v1"; 19 | 20 | /** 21 | * 聊天消息路径 22 | */ 23 | private String chatMessagesPath = "/chat-messages"; 24 | 25 | /** 26 | * 默认User标识前缀 27 | */ 28 | private String userPrefix = "smartclass_"; 29 | 30 | /** 31 | * 是否启用详细的流式日志记录 32 | */ 33 | private boolean enableStreamingVerboseLog = false; 34 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/config/JsonConfig.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.config; 2 | 3 | import com.fasterxml.jackson.databind.ObjectMapper; 4 | import com.fasterxml.jackson.databind.module.SimpleModule; 5 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 6 | import org.springframework.boot.jackson.JsonComponent; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; 9 | 10 | /** 11 | * Spring MVC Json 配置 12 | */ 13 | @JsonComponent 14 | public class JsonConfig { 15 | 16 | /** 17 | * 添加 Long 转 json 精度丢失的配置 18 | */ 19 | @Bean 20 | public ObjectMapper jacksonObjectMapper(Jackson2ObjectMapperBuilder builder) { 21 | ObjectMapper objectMapper = builder.createXmlMapper(false).build(); 22 | SimpleModule module = new SimpleModule(); 23 | module.addSerializer(Long.class, ToStringSerializer.instance); 24 | module.addSerializer(Long.TYPE, ToStringSerializer.instance); 25 | objectMapper.registerModule(module); 26 | return objectMapper; 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/config/MyBatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.config; 2 | 3 | import com.baomidou.mybatisplus.annotation.DbType; 4 | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; 5 | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | /** 10 | * MyBatis Plus 配置 11 | * 12 | */ 13 | @Configuration 14 | public class MyBatisPlusConfig { 15 | 16 | /** 17 | * 拦截器配置 18 | * 19 | * @return 20 | */ 21 | @Bean 22 | public MybatisPlusInterceptor mybatisPlusInterceptor() { 23 | MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); 24 | // 分页插件 25 | interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); 26 | return interceptor; 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/config/WxOpenConfig.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.config; 2 | 3 | import lombok.Data; 4 | import lombok.extern.slf4j.Slf4j; 5 | import me.chanjar.weixin.mp.api.WxMpService; 6 | import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl; 7 | import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl; 8 | import org.springframework.boot.context.properties.ConfigurationProperties; 9 | import org.springframework.context.annotation.Configuration; 10 | 11 | /** 12 | * 微信开放平台配置 13 | */ 14 | @Slf4j 15 | @Configuration 16 | @ConfigurationProperties(prefix = "wx.open") 17 | @Data 18 | public class WxOpenConfig { 19 | 20 | private String appId; 21 | 22 | private String appSecret; 23 | 24 | private WxMpService wxMpService; 25 | 26 | /** 27 | * 单例模式(不用 @Bean 是为了防止和公众号的 service 冲突) 28 | * 29 | * @return 30 | */ 31 | public WxMpService getWxMpService() { 32 | if (wxMpService != null) { 33 | return wxMpService; 34 | } 35 | synchronized (this) { 36 | if (wxMpService != null) { 37 | return wxMpService; 38 | } 39 | WxMpDefaultConfigImpl config = new WxMpDefaultConfigImpl(); 40 | config.setAppId(appId); 41 | config.setSecret(appSecret); 42 | WxMpService service = new WxMpServiceImpl(); 43 | service.setWxMpConfigStorage(config); 44 | wxMpService = service; 45 | return wxMpService; 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/constant/CommonConstant.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.constant; 2 | 3 | /** 4 | * 通用常量 5 | */ 6 | public interface CommonConstant { 7 | 8 | /** 9 | * 升序 10 | */ 11 | String SORT_ORDER_ASC = "ascend"; 12 | 13 | /** 14 | * 降序 15 | */ 16 | String SORT_ORDER_DESC = " descend"; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/constant/FileConstant.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.constant; 2 | 3 | /** 4 | * 文件常量 5 | */ 6 | public interface FileConstant { 7 | 8 | /** 9 | * 1MB大小 10 | */ 11 | long ONE_MB = 1024 * 1024L; 12 | 13 | /** 14 | * 10MB大小 15 | */ 16 | long TEN_MB = 10 * 1024 * 1024L; 17 | 18 | /** 19 | * 50MB大小 20 | */ 21 | long FIFTY_MB = 50 * 1024 * 1024L; 22 | 23 | /** 24 | * 100MB大小 25 | */ 26 | long ONE_HUNDRED_MB = 100 * 1024 * 1024L; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/constant/UserConstant.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.constant; 2 | 3 | /** 4 | * 用户常量 5 | */ 6 | public interface UserConstant { 7 | 8 | /** 9 | * 用户登录态键 10 | */ 11 | String USER_LOGIN_STATE = "user_login"; 12 | 13 | // region 权限 14 | 15 | /** 16 | * 默认角色 17 | */ 18 | String DEFAULT_ROLE = "user"; 19 | 20 | /** 21 | * 管理员角色 22 | */ 23 | String ADMIN_ROLE = "admin"; 24 | 25 | /** 26 | * 被封号 27 | */ 28 | String BAN_ROLE = "ban"; 29 | 30 | // endregion 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/esdao/PostEsDao.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.esdao; 2 | 3 | import com.ubanillx.smartclass.model.dto.post.PostEsDTO; 4 | import java.util.List; 5 | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; 6 | 7 | /** 8 | * 帖子 ES 操作 9 | */ 10 | public interface PostEsDao extends ElasticsearchRepository { 11 | 12 | List findByUserId(Long userId); 13 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/exception/BusinessException.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.exception; 2 | 3 | import com.ubanillx.smartclass.common.ErrorCode; 4 | 5 | /** 6 | * 自定义异常类 7 | */ 8 | public class BusinessException extends RuntimeException { 9 | 10 | /** 11 | * 错误码 12 | */ 13 | private final int code; 14 | 15 | public BusinessException(int code, String message) { 16 | super(message); 17 | this.code = code; 18 | } 19 | 20 | public BusinessException(ErrorCode errorCode) { 21 | super(errorCode.getMessage()); 22 | this.code = errorCode.getCode(); 23 | } 24 | 25 | public BusinessException(ErrorCode errorCode, String message) { 26 | super(message); 27 | this.code = errorCode.getCode(); 28 | } 29 | 30 | public int getCode() { 31 | return code; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/exception/GlobalExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.exception; 2 | 3 | import com.ubanillx.smartclass.common.BaseResponse; 4 | import com.ubanillx.smartclass.common.ErrorCode; 5 | import com.ubanillx.smartclass.common.ResultUtils; 6 | import lombok.extern.slf4j.Slf4j; 7 | import org.springframework.web.bind.annotation.ExceptionHandler; 8 | import org.springframework.web.bind.annotation.RestControllerAdvice; 9 | 10 | /** 11 | * 全局异常处理器 12 | */ 13 | @RestControllerAdvice 14 | @Slf4j 15 | public class GlobalExceptionHandler { 16 | 17 | @ExceptionHandler(BusinessException.class) 18 | public BaseResponse businessExceptionHandler(BusinessException e) { 19 | log.error("BusinessException", e); 20 | return ResultUtils.error(e.getCode(), e.getMessage()); 21 | } 22 | 23 | @ExceptionHandler(RuntimeException.class) 24 | public BaseResponse runtimeExceptionHandler(RuntimeException e) { 25 | log.error("RuntimeException", e); 26 | return ResultUtils.error(ErrorCode.SYSTEM_ERROR, "系统错误"); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/exception/ThrowUtils.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.exception; 2 | 3 | import com.ubanillx.smartclass.common.ErrorCode; 4 | 5 | /** 6 | * 抛异常工具类 7 | */ 8 | public class ThrowUtils { 9 | 10 | /** 11 | * 条件成立则抛异常 12 | * 13 | * @param condition 14 | * @param runtimeException 15 | */ 16 | public static void throwIf(boolean condition, RuntimeException runtimeException) { 17 | if (condition) { 18 | throw runtimeException; 19 | } 20 | } 21 | 22 | /** 23 | * 条件成立则抛异常 24 | * 25 | * @param condition 26 | * @param errorCode 27 | */ 28 | public static void throwIf(boolean condition, ErrorCode errorCode) { 29 | throwIf(condition, new BusinessException(errorCode)); 30 | } 31 | 32 | /** 33 | * 条件成立则抛异常 34 | * 35 | * @param condition 36 | * @param errorCode 37 | * @param message 38 | */ 39 | public static void throwIf(boolean condition, ErrorCode errorCode, String message) { 40 | throwIf(condition, new BusinessException(errorCode, message)); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/job/once/FullSyncPostToEs.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.job.once; 2 | 3 | import com.ubanillx.smartclass.esdao.PostEsDao; 4 | import com.ubanillx.smartclass.model.dto.post.PostEsDTO; 5 | import com.ubanillx.smartclass.model.entity.Post; 6 | import com.ubanillx.smartclass.service.PostService; 7 | import java.util.List; 8 | import java.util.stream.Collectors; 9 | import javax.annotation.Resource; 10 | import lombok.extern.slf4j.Slf4j; 11 | import cn.hutool.core.collection.CollUtil; 12 | import org.springframework.boot.CommandLineRunner; 13 | 14 | /** 15 | * 全量同步帖子到 es 16 | */ 17 | // todo 取消注释开启任务 18 | //@Component 19 | @Slf4j 20 | public class FullSyncPostToEs implements CommandLineRunner { 21 | 22 | @Resource 23 | private PostService postService; 24 | 25 | @Resource 26 | private PostEsDao postEsDao; 27 | 28 | @Override 29 | public void run(String... args) { 30 | List postList = postService.list(); 31 | if (CollUtil.isEmpty(postList)) { 32 | return; 33 | } 34 | List postEsDTOList = postList.stream().map(PostEsDTO::objToDto).collect(Collectors.toList()); 35 | final int pageSize = 500; 36 | int total = postEsDTOList.size(); 37 | log.info("FullSyncPostToEs start, total {}", total); 38 | for (int i = 0; i < total; i += pageSize) { 39 | int end = Math.min(i + pageSize, total); 40 | log.info("sync from {} to {}", i, end); 41 | postEsDao.saveAll(postEsDTOList.subList(i, end)); 42 | } 43 | log.info("FullSyncPostToEs end, total {}", total); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/AchievementMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.ubanillx.smartclass.model.entity.Achievement; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | * @author liulo 8 | * @description 针对表【achievement(成就定义)】的数据库操作Mapper 9 | * @createDate 2025-03-18 23:08:38 10 | * @Entity com.ubanillx.smartclass.model.entity.Achievement 11 | */ 12 | public interface AchievementMapper extends BaseMapper { 13 | 14 | } 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/AiAvatarChatHistoryMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.ubanillx.smartclass.model.entity.AiAvatarChatHistory; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | * @author liulo 8 | * @description 针对表【ai_avatar_chat_history(AI分身对话历史)】的数据库操作Mapper 9 | * @createDate 2025-03-24 21:35:44 10 | * @Entity com.ubanillx.smartclass.model.entity.AiAvatarChatHistory 11 | */ 12 | public interface AiAvatarChatHistoryMapper extends BaseMapper { 13 | 14 | } 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/AiAvatarMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.ubanillx.smartclass.model.entity.AiAvatar; 5 | 6 | /** 7 | * @author liulo 8 | * @description 针对表【ai_avatar(AI分身)】的数据库操作Mapper 9 | * @createDate 2025-03-24 21:35:44 10 | * @Entity com.ubanillx.smartclass.model.entity.AiAvatar 11 | */ 12 | public interface AiAvatarMapper extends BaseMapper { 13 | 14 | } 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/AnnouncementMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.ubanillx.smartclass.model.entity.Announcement; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | * @author liulo 8 | * @description 针对表【announcement(系统公告)】的数据库操作Mapper 9 | * @createDate 2025-03-18 23:08:38 10 | * @Entity com.ubanillx.smartclass.model.entity.Announcement 11 | */ 12 | public interface AnnouncementMapper extends BaseMapper { 13 | 14 | } 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/CourseCategoryMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.ubanillx.smartclass.model.entity.CourseCategory; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | * @author liulo 8 | * @description 针对表【course_category(课程分类)】的数据库操作Mapper 9 | * @createDate 2025-03-21 15:14:50 10 | * @Entity com.ubanillx.smartclass.model.entity.CourseCategory 11 | */ 12 | public interface CourseCategoryMapper extends BaseMapper { 13 | 14 | } 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/CourseChapterMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.ubanillx.smartclass.model.entity.CourseChapter; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | * @author liulo 8 | * @description 针对表【course_chapter(课程章节)】的数据库操作Mapper 9 | * @createDate 2025-03-21 15:14:50 10 | * @Entity com.ubanillx.smartclass.model.entity.CourseChapter 11 | */ 12 | public interface CourseChapterMapper extends BaseMapper { 13 | 14 | } 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/CourseFavouriteMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.ubanillx.smartclass.model.entity.CourseFavourite; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | * @author liulo 8 | * @description 针对表【course_favourite(课程收藏)】的数据库操作Mapper 9 | * @createDate 2025-03-21 15:14:50 10 | * @Entity com.ubanillx.smartclass.model.entity.CourseFavourite 11 | */ 12 | public interface CourseFavouriteMapper extends BaseMapper { 13 | 14 | } 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/CourseMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.ubanillx.smartclass.model.entity.Course; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | * @author liulo 8 | * @description 针对表【course(课程)】的数据库操作Mapper 9 | * @createDate 2025-03-18 23:08:38 10 | * @Entity com.ubanillx.smartclass.model.entity.Course 11 | */ 12 | public interface CourseMapper extends BaseMapper { 13 | 14 | } 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/CourseMaterialMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.ubanillx.smartclass.model.entity.CourseMaterial; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | * @author liulo 8 | * @description 针对表【course_material(课程资料)】的数据库操作Mapper 9 | * @createDate 2025-03-21 15:14:50 10 | * @Entity com.ubanillx.smartclass.model.entity.CourseMaterial 11 | */ 12 | public interface CourseMaterialMapper extends BaseMapper { 13 | 14 | } 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/CourseReviewMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.ubanillx.smartclass.model.entity.CourseReview; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | * @author liulo 8 | * @description 针对表【course_review(课程评价)】的数据库操作Mapper 9 | * @createDate 2025-03-21 15:14:50 10 | * @Entity com.ubanillx.smartclass.model.entity.CourseReview 11 | */ 12 | public interface CourseReviewMapper extends BaseMapper { 13 | 14 | } 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/CourseSectionMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.ubanillx.smartclass.model.entity.CourseSection; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | * @author liulo 8 | * @description 针对表【course_section(课程小节)】的数据库操作Mapper 9 | * @createDate 2025-03-21 15:14:50 10 | * @Entity com.ubanillx.smartclass.model.entity.CourseSection 11 | */ 12 | public interface CourseSectionMapper extends BaseMapper { 13 | 14 | } 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/DailyArticleMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.ubanillx.smartclass.model.entity.DailyArticle; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | * @author liulo 8 | * @description 针对表【daily_article(每日文章)】的数据库操作Mapper 9 | * @createDate 2025-03-19 00:03:09 10 | * @Entity com.ubanillx.smartclass.model.entity.DailyArticle 11 | */ 12 | public interface DailyArticleMapper extends BaseMapper { 13 | 14 | } 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/DailyWordMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.ubanillx.smartclass.model.entity.DailyWord; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | * @author liulo 8 | * @description 针对表【daily_word(每日单词)】的数据库操作Mapper 9 | * @createDate 2025-03-19 00:03:09 10 | * @Entity com.ubanillx.smartclass.model.entity.DailyWord 11 | */ 12 | public interface DailyWordMapper extends BaseMapper { 13 | 14 | } 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/PostFavourMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.Wrapper; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.baomidou.mybatisplus.core.metadata.IPage; 6 | import com.baomidou.mybatisplus.core.toolkit.Constants; 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 8 | import com.ubanillx.smartclass.model.entity.Post; 9 | import com.ubanillx.smartclass.model.entity.PostFavour; 10 | import org.apache.ibatis.annotations.Param; 11 | 12 | /** 13 | * 帖子收藏数据库操作 14 | */ 15 | public interface PostFavourMapper extends BaseMapper { 16 | 17 | /** 18 | * 分页查询收藏帖子列表 19 | * 20 | * @param page 21 | * @param queryWrapper 22 | * @param favourUserId 23 | * @return 24 | */ 25 | Page listFavourPostByPage(IPage page, @Param(Constants.WRAPPER) Wrapper queryWrapper, 26 | long favourUserId); 27 | 28 | } 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/PostMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.ubanillx.smartclass.model.entity.Post; 5 | import java.util.Date; 6 | import java.util.List; 7 | 8 | /** 9 | * 帖子数据库操作 10 | */ 11 | public interface PostMapper extends BaseMapper { 12 | 13 | /** 14 | * 查询帖子列表(包括已被删除的数据) 15 | */ 16 | List listPostWithDelete(Date minUpdateTime); 17 | 18 | } 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/PostThumbMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.ubanillx.smartclass.model.entity.PostThumb; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | * 帖子点赞数据库操作 8 | */ 9 | public interface PostThumbMapper extends BaseMapper { 10 | 11 | } 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/TeacherMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.ubanillx.smartclass.model.entity.Teacher; 5 | 6 | /** 7 | * 讲师数据库操作 8 | */ 9 | public interface TeacherMapper extends BaseMapper { 10 | 11 | } 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/UserAiAvatarMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.ubanillx.smartclass.model.entity.UserAiAvatar; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | * @author liulo 8 | * @description 针对表【user_ai_avatar(用户AI分身关联)】的数据库操作Mapper 9 | * @createDate 2025-03-24 21:35:44 10 | * @Entity com.ubanillx.smartclass.model.entity.UserAiAvatar 11 | */ 12 | public interface UserAiAvatarMapper extends BaseMapper { 13 | 14 | } 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/UserAnnouncementReaderMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.ubanillx.smartclass.model.entity.UserAnnouncementReader; 5 | 6 | /** 7 | * 用户公告阅读记录Mapper 8 | */ 9 | public interface UserAnnouncementReaderMapper extends BaseMapper { 10 | } 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/UserArticleRecordMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.ubanillx.smartclass.model.dto.UserArticleRecord; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | * @author liulo 8 | * @description 针对表【user_article_record(用户文章阅读记录)】的数据库操作Mapper 9 | * @createDate 2025-03-20 14:36:38 10 | * @Entity com.ubanillx.smartclass.model.dto.UserArticleRecord 11 | */ 12 | public interface UserArticleRecordMapper extends BaseMapper { 13 | 14 | } 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/UserDailyArticleMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.Wrapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.core.toolkit.Constants; 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 7 | import com.ubanillx.smartclass.model.entity.DailyArticle; 8 | import com.ubanillx.smartclass.model.entity.UserDailyArticle; 9 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 10 | import org.apache.ibatis.annotations.Param; 11 | 12 | /** 13 | * @author liulo 14 | * @description 针对表【user_daily_article(用户与每日文章关联)】的数据库操作Mapper 15 | * @createDate 2025-03-20 14:25:20 16 | * @Entity com.ubanillx.smartclass.model.entity.UserDailyArticle 17 | */ 18 | public interface UserDailyArticleMapper extends BaseMapper { 19 | 20 | /** 21 | * 获取用户收藏的文章分页列表 22 | * 23 | * @param page 24 | * @param queryWrapper 25 | * @param favourUserId 26 | * @return 27 | */ 28 | Page listFavourArticleByPage(IPage page, 29 | @Param(Constants.WRAPPER) Wrapper queryWrapper, 30 | @Param("favourUserId") long favourUserId); 31 | 32 | /** 33 | * 获取用户点赞的文章分页列表 34 | * 35 | * @param page 36 | * @param queryWrapper 37 | * @param thumbUserId 38 | * @return 39 | */ 40 | Page listThumbArticleByPage(IPage page, 41 | @Param(Constants.WRAPPER) Wrapper queryWrapper, 42 | @Param("thumbUserId") long thumbUserId); 43 | } 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/UserDailyWordMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.Wrapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.core.toolkit.Constants; 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 7 | import com.ubanillx.smartclass.model.entity.DailyWord; 8 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 9 | import com.ubanillx.smartclass.model.entity.UserDailyWord; 10 | import org.apache.ibatis.annotations.Param; 11 | 12 | /** 13 | * @author liulo 14 | * @description 针对表【user_daily_word(用户与每日单词关联)】的数据库操作Mapper 15 | * @createDate 2025-03-20 14:25:20 16 | * @Entity com.ubanillx.smartclass.model.entity.UserDailyWord 17 | */ 18 | public interface UserDailyWordMapper extends BaseMapper { 19 | 20 | /** 21 | * 获取用户收藏的单词分页列表 22 | * 23 | * @param page 24 | * @param queryWrapper 25 | * @param favourUserId 26 | * @return 27 | */ 28 | Page listFavourWordByPage(IPage page, 29 | @Param(Constants.WRAPPER) Wrapper queryWrapper, 30 | @Param("favourUserId") long favourUserId); 31 | 32 | /** 33 | * 获取用户点赞的单词分页列表 34 | * 35 | * @param page 36 | * @param queryWrapper 37 | * @param thumbUserId 38 | * @return 39 | */ 40 | Page listThumbWordByPage(IPage page, 41 | @Param(Constants.WRAPPER) Wrapper queryWrapper, 42 | @Param("thumbUserId") long thumbUserId); 43 | } 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/UserLearningStatsMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.ubanillx.smartclass.model.entity.UserLearningStats; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | * @author liulo 8 | * @description 针对表【user_learning_stats(用户学习统计)】的数据库操作Mapper 9 | * @createDate 2025-03-21 15:14:50 10 | * @Entity com.ubanillx.smartclass.model.entity.UserLearningStats 11 | */ 12 | public interface UserLearningStatsMapper extends BaseMapper { 13 | 14 | } 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/UserLevelMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.ubanillx.smartclass.model.entity.UserLevel; 5 | 6 | /** 7 | * 用户等级数据库操作 8 | */ 9 | public interface UserLevelMapper extends BaseMapper { 10 | 11 | } 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.ubanillx.smartclass.model.entity.User; 5 | 6 | /** 7 | * 用户数据库操作 8 | */ 9 | public interface UserMapper extends BaseMapper { 10 | 11 | } 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/DeleteRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 删除请求 9 | */ 10 | @Data 11 | public class DeleteRequest implements Serializable { 12 | 13 | /** 14 | * id 15 | */ 16 | private Long id; 17 | 18 | private static final long serialVersionUID = 1L; 19 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/UserArticleRecord.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | import lombok.Data; 10 | 11 | /** 12 | * 用户文章阅读记录 13 | * @TableName user_article_record 14 | */ 15 | @TableName(value ="user_article_record") 16 | @Data 17 | public class UserArticleRecord implements Serializable { 18 | /** 19 | * id 20 | */ 21 | @TableId(type = IdType.AUTO) 22 | private Long id; 23 | 24 | /** 25 | * 用户id 26 | */ 27 | private Long userId; 28 | 29 | /** 30 | * 文章id 31 | */ 32 | private Long articleId; 33 | 34 | /** 35 | * 阅读状态:0-未读,1-阅读中,2-已读完 36 | */ 37 | private Integer readStatus; 38 | 39 | /** 40 | * 阅读进度(百分比) 41 | */ 42 | private Integer readProgress; 43 | 44 | /** 45 | * 是否点赞 46 | */ 47 | private Integer isLiked; 48 | 49 | /** 50 | * 用户笔记 51 | */ 52 | private String userNotes; 53 | 54 | /** 55 | * 创建时间 56 | */ 57 | private Date createTime; 58 | 59 | /** 60 | * 更新时间 61 | */ 62 | private Date updateTime; 63 | 64 | @TableField(exist = false) 65 | private static final long serialVersionUID = 1L; 66 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/aiavatar/AiAvatarAddRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.aiavatar; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.math.BigDecimal; 7 | 8 | /** 9 | * AI分身添加请求 10 | */ 11 | @Data 12 | public class AiAvatarAddRequest implements Serializable { 13 | 14 | /** 15 | * AI分身名称 16 | */ 17 | private String name; 18 | 19 | /** 20 | * 请求地址 21 | */ 22 | private String baseUrl; 23 | 24 | /** 25 | * AI分身描述 26 | */ 27 | private String description; 28 | 29 | /** 30 | * AI分身头像URL 31 | */ 32 | private String avatarImgUrl; 33 | 34 | /** 35 | * AI分身鉴权,一串随机字符 36 | */ 37 | private String avatarAuth; 38 | 39 | /** 40 | * 标签,JSON数组格式 41 | */ 42 | private String tags; 43 | 44 | /** 45 | * 性格特点描述 46 | */ 47 | private String personality; 48 | 49 | /** 50 | * 能力描述 51 | */ 52 | private String abilities; 53 | 54 | /** 55 | * 是否公开:0-否,1-是 56 | */ 57 | private Integer isPublic; 58 | 59 | /** 60 | * 排序,数字越小排序越靠前 61 | */ 62 | private Integer sort; 63 | 64 | private static final long serialVersionUID = 1L; 65 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/aiavatar/AiAvatarUpdateRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.aiavatar; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.math.BigDecimal; 7 | 8 | /** 9 | * AI分身更新请求 10 | */ 11 | @Data 12 | public class AiAvatarUpdateRequest implements Serializable { 13 | 14 | /** 15 | * id 16 | */ 17 | private Long id; 18 | 19 | /** 20 | * AI分身名称 21 | */ 22 | private String name; 23 | 24 | /** 25 | * 请求地址 26 | */ 27 | private String baseUrl; 28 | 29 | /** 30 | * AI分身描述 31 | */ 32 | private String description; 33 | 34 | /** 35 | * AI分身头像URL 36 | */ 37 | private String avatarImgUrl; 38 | 39 | /** 40 | * AI分身鉴权,一串随机字符 41 | */ 42 | private String avatarAuth; 43 | 44 | /** 45 | * 标签,JSON数组格式 46 | */ 47 | private String tags; 48 | 49 | /** 50 | * 性格特点描述 51 | */ 52 | private String personality; 53 | 54 | /** 55 | * 能力描述 56 | */ 57 | private String abilities; 58 | 59 | /** 60 | * 是否公开:0-否,1-是 61 | */ 62 | private Integer isPublic; 63 | 64 | /** 65 | * 状态:0-禁用,1-启用 66 | */ 67 | private Integer status; 68 | 69 | /** 70 | * 排序,数字越小排序越靠前 71 | */ 72 | private Integer sort; 73 | 74 | private static final long serialVersionUID = 1L; 75 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/announcement/AnnouncementAddRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.announcement; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | 8 | /** 9 | * 公告添加请求 10 | */ 11 | @Data 12 | public class AnnouncementAddRequest implements Serializable { 13 | 14 | /** 15 | * 公告标题 16 | */ 17 | private String title; 18 | 19 | /** 20 | * 公告内容 21 | */ 22 | private String content; 23 | 24 | /** 25 | * 优先级,数字越大优先级越高 26 | */ 27 | private Integer priority; 28 | 29 | /** 30 | * 状态:0-草稿,1-已发布,2-已下线 31 | */ 32 | private Integer status; 33 | 34 | /** 35 | * 公告开始展示时间 36 | */ 37 | private Date startTime; 38 | 39 | /** 40 | * 公告结束展示时间 41 | */ 42 | private Date endTime; 43 | 44 | /** 45 | * 封面图片URL 46 | */ 47 | private String coverImage; 48 | 49 | private static final long serialVersionUID = 1L; 50 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/announcement/AnnouncementQueryRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.announcement; 2 | 3 | import com.ubanillx.smartclass.common.PageRequest; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | 10 | /** 11 | * 公告查询请求 12 | */ 13 | @EqualsAndHashCode(callSuper = true) 14 | @Data 15 | public class AnnouncementQueryRequest extends PageRequest implements Serializable { 16 | /** 17 | * id 18 | */ 19 | private Long id; 20 | 21 | /** 22 | * 公告标题 23 | */ 24 | private String title; 25 | 26 | /** 27 | * 公告内容 28 | */ 29 | private String content; 30 | 31 | /** 32 | * 优先级,数字越大优先级越高 33 | */ 34 | private Integer priority; 35 | 36 | /** 37 | * 状态:0-草稿,1-已发布,2-已下线 38 | */ 39 | private Integer status; 40 | 41 | /** 42 | * 公告开始展示时间 43 | */ 44 | private Date startTime; 45 | 46 | /** 47 | * 公告结束展示时间 48 | */ 49 | private Date endTime; 50 | 51 | /** 52 | * 封面图片URL 53 | */ 54 | private String coverImage; 55 | 56 | /** 57 | * 发布管理员id 58 | */ 59 | private Long adminId; 60 | 61 | /** 62 | * 创建时间 63 | */ 64 | private Date createTime; 65 | 66 | private static final long serialVersionUID = 1L; 67 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/announcement/AnnouncementUpdateRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.announcement; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | 8 | /** 9 | * 公告更新请求 10 | */ 11 | @Data 12 | public class AnnouncementUpdateRequest implements Serializable { 13 | /** 14 | * id 15 | */ 16 | private Long id; 17 | 18 | /** 19 | * 公告标题 20 | */ 21 | private String title; 22 | 23 | /** 24 | * 公告内容 25 | */ 26 | private String content; 27 | 28 | /** 29 | * 优先级,数字越大优先级越高 30 | */ 31 | private Integer priority; 32 | 33 | /** 34 | * 状态:0-草稿,1-已发布,2-已下线 35 | */ 36 | private Integer status; 37 | 38 | /** 39 | * 公告开始展示时间 40 | */ 41 | private Date startTime; 42 | 43 | /** 44 | * 公告结束展示时间 45 | */ 46 | private Date endTime; 47 | 48 | /** 49 | * 封面图片URL 50 | */ 51 | private String coverImage; 52 | 53 | private static final long serialVersionUID = 1L; 54 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/chat/ChatMessageAddRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.chat; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.List; 7 | 8 | /** 9 | * 聊天消息添加请求 10 | */ 11 | @Data 12 | public class ChatMessageAddRequest implements Serializable { 13 | 14 | /** 15 | * AI分身ID 16 | */ 17 | private Long aiAvatarId; 18 | 19 | /** 20 | * 会话ID,如果为空则创建新会话 21 | */ 22 | private String sessionId; 23 | 24 | /** 25 | * 消息类型:user/ai 26 | */ 27 | private String messageType; 28 | 29 | /** 30 | * 消息内容 31 | */ 32 | private String content; 33 | 34 | /** 35 | * 文件ID列表,用于多模态对话 36 | */ 37 | private List fileIds; 38 | 39 | /** 40 | * 是否结束对话,结束对话时会获取会话总结 41 | */ 42 | private boolean endChat; 43 | 44 | private static final long serialVersionUID = 1L; 45 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/chat/ChatMessageQueryRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.chat; 2 | 3 | import com.ubanillx.smartclass.common.PageRequest; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | * 聊天消息查询请求 11 | */ 12 | @EqualsAndHashCode(callSuper = true) 13 | @Data 14 | public class ChatMessageQueryRequest extends PageRequest implements Serializable { 15 | 16 | /** 17 | * 会话ID 18 | */ 19 | private String sessionId; 20 | 21 | /** 22 | * AI分身ID (可选) 23 | */ 24 | private Long aiAvatarId; 25 | 26 | /** 27 | * 消息类型:user/ai 28 | */ 29 | private String messageType; 30 | 31 | /** 32 | * 消息内容(模糊搜索) 33 | */ 34 | private String content; 35 | 36 | private static final long serialVersionUID = 1L; 37 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/chat/ChatSessionQueryRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.chat; 2 | 3 | import com.ubanillx.smartclass.common.PageRequest; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | * 聊天会话查询请求 11 | */ 12 | @EqualsAndHashCode(callSuper = true) 13 | @Data 14 | public class ChatSessionQueryRequest extends PageRequest implements Serializable { 15 | 16 | /** 17 | * 用户ID 18 | */ 19 | private Long userId; 20 | 21 | /** 22 | * AI分身ID 23 | */ 24 | private Long aiAvatarId; 25 | 26 | /** 27 | * 会话ID 28 | */ 29 | private String sessionId; 30 | 31 | /** 32 | * 会话名称(模糊搜索) 33 | */ 34 | private String sessionName; 35 | 36 | private static final long serialVersionUID = 1L; 37 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/chat/ChatSessionUpdateRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.chat; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 聊天会话更新请求 9 | */ 10 | @Data 11 | public class ChatSessionUpdateRequest implements Serializable { 12 | 13 | /** 14 | * 会话ID 15 | */ 16 | private String sessionId; 17 | 18 | /** 19 | * 会话名称 20 | */ 21 | private String sessionName; 22 | 23 | private static final long serialVersionUID = 1L; 24 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/chat/StopStreamingRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.chat; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 停止流式响应请求DTO 9 | */ 10 | @Data 11 | public class StopStreamingRequest implements Serializable { 12 | 13 | /** 14 | * AI分身ID 15 | */ 16 | private Long aiAvatarId; 17 | 18 | /** 19 | * 任务ID,从流式响应中获取 20 | */ 21 | private String taskId; 22 | 23 | private static final long serialVersionUID = 1L; 24 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/chat/TextToAudioRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.chat; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 文字转语音请求DTO 9 | */ 10 | @Data 11 | public class TextToAudioRequest implements Serializable { 12 | 13 | /** 14 | * AI分身ID 15 | */ 16 | private Long aiAvatarId; 17 | 18 | /** 19 | * 要转换的文本内容 20 | */ 21 | private String text; 22 | 23 | /** 24 | * 消息ID,如果提供则优先使用(不需要传文本内容) 25 | */ 26 | private String messageId; 27 | 28 | private static final long serialVersionUID = 1L; 29 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/chat/UploadFileRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.chat; 2 | 3 | import lombok.Data; 4 | import org.springframework.web.multipart.MultipartFile; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 上传文件请求DTO 10 | */ 11 | @Data 12 | public class UploadFileRequest implements Serializable { 13 | 14 | /** 15 | * AI分身ID 16 | */ 17 | private Long aiAvatarId; 18 | 19 | /** 20 | * 上传的文件 21 | */ 22 | private MultipartFile file; 23 | 24 | private static final long serialVersionUID = 1L; 25 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/chat/UploadFileResponse.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.chat; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 上传文件响应DTO 9 | */ 10 | @Data 11 | public class UploadFileResponse implements Serializable { 12 | 13 | /** 14 | * 文件ID 15 | */ 16 | private String fileId; 17 | 18 | /** 19 | * 文件名 20 | */ 21 | private String fileName; 22 | 23 | /** 24 | * 文件大小(字节) 25 | */ 26 | private Integer fileSize; 27 | 28 | /** 29 | * 文件类型 30 | */ 31 | private String mimeType; 32 | 33 | /** 34 | * 文件扩展名 35 | */ 36 | private String extension; 37 | 38 | /** 39 | * 上传时间 40 | */ 41 | private Long createdAt; 42 | 43 | private static final long serialVersionUID = 1L; 44 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/course/CourseFavourAddRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.course; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 课程收藏请求 9 | */ 10 | @Data 11 | public class CourseFavourAddRequest implements Serializable { 12 | 13 | /** 14 | * 课程id 15 | */ 16 | private Long courseId; 17 | 18 | private static final long serialVersionUID = 1L; 19 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/course/CourseQueryRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.course; 2 | 3 | import com.ubanillx.smartclass.common.PageRequest; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | import java.io.Serializable; 8 | import java.math.BigDecimal; 9 | import java.util.Date; 10 | 11 | /** 12 | * 课程查询请求 13 | */ 14 | @EqualsAndHashCode(callSuper = true) 15 | @Data 16 | public class CourseQueryRequest extends PageRequest implements Serializable { 17 | /** 18 | * id 19 | */ 20 | private Long id; 21 | 22 | /** 23 | * 课程标题 24 | */ 25 | private String title; 26 | 27 | /** 28 | * 课程类型:0-公开课,1-付费课,2-会员课 29 | */ 30 | private Integer courseType; 31 | 32 | /** 33 | * 难度等级:1-入门,2-初级,3-中级,4-高级,5-专家 34 | */ 35 | private Integer difficulty; 36 | 37 | /** 38 | * 状态:0-未发布,1-已发布,2-已下架 39 | */ 40 | private Integer status; 41 | 42 | /** 43 | * 课程分类id 44 | */ 45 | private Long categoryId; 46 | 47 | /** 48 | * 讲师id 49 | */ 50 | private Long teacherId; 51 | 52 | /** 53 | * 创建者id 54 | */ 55 | private Long userId; 56 | 57 | /** 58 | * 标签,JSON数组格式 59 | */ 60 | private String tags; 61 | 62 | /** 63 | * 最小价格 64 | */ 65 | private BigDecimal minPrice; 66 | 67 | /** 68 | * 最大价格 69 | */ 70 | private BigDecimal maxPrice; 71 | 72 | /** 73 | * 创建时间 74 | */ 75 | private Date createTime; 76 | 77 | /** 78 | * 更新时间 79 | */ 80 | private Date updateTime; 81 | 82 | private static final long serialVersionUID = 1L; 83 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/dailyarticle/DailyArticleAddRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.dailyarticle; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | 8 | /** 9 | * 每日文章创建请求 10 | */ 11 | @Data 12 | public class DailyArticleAddRequest implements Serializable { 13 | 14 | /** 15 | * 文章标题 16 | */ 17 | private String title; 18 | 19 | /** 20 | * 文章内容 21 | */ 22 | private String content; 23 | 24 | /** 25 | * 文章摘要 26 | */ 27 | private String summary; 28 | 29 | /** 30 | * 封面图片URL 31 | */ 32 | private String coverImage; 33 | 34 | /** 35 | * 作者 36 | */ 37 | private String author; 38 | 39 | /** 40 | * 来源 41 | */ 42 | private String source; 43 | 44 | /** 45 | * 原文链接 46 | */ 47 | private String sourceUrl; 48 | 49 | /** 50 | * 文章分类 51 | */ 52 | private String category; 53 | 54 | /** 55 | * 标签,JSON数组格式 56 | */ 57 | private String tags; 58 | 59 | /** 60 | * 难度等级:1-简单,2-中等,3-困难 61 | */ 62 | private Integer difficulty; 63 | 64 | /** 65 | * 预计阅读时间(分钟) 66 | */ 67 | private Integer readTime; 68 | 69 | /** 70 | * 发布日期 71 | */ 72 | private Date publishDate; 73 | 74 | private static final long serialVersionUID = 1L; 75 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/dailyarticle/DailyArticleQueryRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.dailyarticle; 2 | 3 | import com.ubanillx.smartclass.common.PageRequest; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | 10 | /** 11 | * 每日文章查询请求 12 | */ 13 | @EqualsAndHashCode(callSuper = true) 14 | @Data 15 | public class DailyArticleQueryRequest extends PageRequest implements Serializable { 16 | /** 17 | * id 18 | */ 19 | private Long id; 20 | 21 | /** 22 | * 文章标题 23 | */ 24 | private String title; 25 | 26 | /** 27 | * 文章摘要(模糊查询) 28 | */ 29 | private String summary; 30 | 31 | /** 32 | * 作者 33 | */ 34 | private String author; 35 | 36 | /** 37 | * 来源 38 | */ 39 | private String source; 40 | 41 | /** 42 | *.文章分类 43 | */ 44 | private String category; 45 | 46 | /** 47 | * 标签,JSON数组格式 48 | */ 49 | private String tags; 50 | 51 | /** 52 | * 难度等级:1-简单,2-中等,3-困难 53 | */ 54 | private Integer difficulty; 55 | 56 | /** 57 | * 发布日期起始 58 | */ 59 | private Date publishDateStart; 60 | 61 | /** 62 | * 发布日期结束 63 | */ 64 | private Date publishDateEnd; 65 | 66 | /** 67 | * 创建管理员id 68 | */ 69 | private Long adminId; 70 | 71 | /** 72 | * 最小阅读时间 73 | */ 74 | private Integer minReadTime; 75 | 76 | /** 77 | * 最大阅读时间 78 | */ 79 | private Integer maxReadTime; 80 | 81 | /** 82 | * 最小查看次数 83 | */ 84 | private Integer minViewCount; 85 | 86 | /** 87 | * 创建时间 88 | */ 89 | private Date createTime; 90 | 91 | private static final long serialVersionUID = 1L; 92 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/dailyarticle/DailyArticleUpdateRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.dailyarticle; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | 8 | /** 9 | * 每日文章更新请求 10 | */ 11 | @Data 12 | public class DailyArticleUpdateRequest implements Serializable { 13 | /** 14 | * id 15 | */ 16 | private Long id; 17 | 18 | /** 19 | * 文章标题 20 | */ 21 | private String title; 22 | 23 | /** 24 | * 文章内容 25 | */ 26 | private String content; 27 | 28 | /** 29 | * 文章摘要 30 | */ 31 | private String summary; 32 | 33 | /** 34 | * 封面图片URL 35 | */ 36 | private String coverImage; 37 | 38 | /** 39 | * 作者 40 | */ 41 | private String author; 42 | 43 | /** 44 | * 来源 45 | */ 46 | private String source; 47 | 48 | /** 49 | * 原文链接 50 | */ 51 | private String sourceUrl; 52 | 53 | /** 54 | * 文章分类 55 | */ 56 | private String category; 57 | 58 | /** 59 | * 标签,JSON数组格式 60 | */ 61 | private String tags; 62 | 63 | /** 64 | * 难度等级:1-简单,2-中等,3-困难 65 | */ 66 | private Integer difficulty; 67 | 68 | /** 69 | * 预计阅读时间(分钟) 70 | */ 71 | private Integer readTime; 72 | 73 | /** 74 | * 发布日期 75 | */ 76 | private Date publishDate; 77 | 78 | /** 79 | * 查看次数 80 | */ 81 | private Integer viewCount; 82 | 83 | /** 84 | * 点赞次数 85 | */ 86 | private Integer likeCount; 87 | 88 | private static final long serialVersionUID = 1L; 89 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/dailyword/DailyWordAddRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.dailyword; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | 8 | /** 9 | * 添加每日单词请求 10 | */ 11 | @Data 12 | public class DailyWordAddRequest implements Serializable { 13 | 14 | /** 15 | * 单词 16 | */ 17 | private String word; 18 | 19 | /** 20 | * 音标 21 | */ 22 | private String pronunciation; 23 | 24 | /** 25 | * 发音音频URL 26 | */ 27 | private String audioUrl; 28 | 29 | /** 30 | * 翻译 31 | */ 32 | private String translation; 33 | 34 | /** 35 | * 例句 36 | */ 37 | private String example; 38 | 39 | /** 40 | * 例句翻译 41 | */ 42 | private String exampleTranslation; 43 | 44 | /** 45 | * 难度等级:1-简单,2-中等,3-困难 46 | */ 47 | private Integer difficulty; 48 | 49 | /** 50 | * 单词分类 51 | */ 52 | private String category; 53 | 54 | /** 55 | * 单词笔记或补充说明 56 | */ 57 | private String notes; 58 | 59 | /** 60 | * 发布日期 61 | */ 62 | private Date publishDate; 63 | 64 | private static final long serialVersionUID = 1L; 65 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/dailyword/DailyWordQueryRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.dailyword; 2 | 3 | import com.ubanillx.smartclass.common.PageRequest; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | 10 | /** 11 | * 查询每日单词请求 12 | */ 13 | @EqualsAndHashCode(callSuper = true) 14 | @Data 15 | public class DailyWordQueryRequest extends PageRequest implements Serializable { 16 | 17 | /** 18 | * id 19 | */ 20 | private Long id; 21 | 22 | /** 23 | * 单词 24 | */ 25 | private String word; 26 | 27 | /** 28 | * 翻译 29 | */ 30 | private String translation; 31 | 32 | /** 33 | * 难度等级:1-简单,2-中等,3-困难 34 | */ 35 | private Integer difficulty; 36 | 37 | /** 38 | * 单词分类 39 | */ 40 | private String category; 41 | 42 | /** 43 | * 发布日期开始 44 | */ 45 | private Date publishDateStart; 46 | 47 | /** 48 | * 发布日期结束 49 | */ 50 | private Date publishDateEnd; 51 | 52 | /** 53 | * 创建管理员id 54 | */ 55 | private Long adminId; 56 | 57 | /** 58 | * 创建时间 59 | */ 60 | private Date createTime; 61 | 62 | private static final long serialVersionUID = 1L; 63 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/dailyword/DailyWordUpdateRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.dailyword; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | 8 | /** 9 | * 更新每日单词请求 10 | */ 11 | @Data 12 | public class DailyWordUpdateRequest implements Serializable { 13 | 14 | /** 15 | * id 16 | */ 17 | private Long id; 18 | 19 | /** 20 | * 单词 21 | */ 22 | private String word; 23 | 24 | /** 25 | * 音标 26 | */ 27 | private String pronunciation; 28 | 29 | /** 30 | * 发音音频URL 31 | */ 32 | private String audioUrl; 33 | 34 | /** 35 | * 翻译 36 | */ 37 | private String translation; 38 | 39 | /** 40 | * 例句 41 | */ 42 | private String example; 43 | 44 | /** 45 | * 例句翻译 46 | */ 47 | private String exampleTranslation; 48 | 49 | /** 50 | * 难度等级:1-简单,2-中等,3-困难 51 | */ 52 | private Integer difficulty; 53 | 54 | /** 55 | * 单词分类 56 | */ 57 | private String category; 58 | 59 | /** 60 | * 单词笔记或补充说明 61 | */ 62 | private String notes; 63 | 64 | /** 65 | * 发布日期 66 | */ 67 | private Date publishDate; 68 | 69 | private static final long serialVersionUID = 1L; 70 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/dify/DifyChatRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.dify; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.List; 7 | import java.util.Map; 8 | 9 | /** 10 | * Dify聊天请求DTO 11 | */ 12 | @Data 13 | public class DifyChatRequest implements Serializable { 14 | 15 | /** 16 | * 用户输入/提问内容 17 | */ 18 | private String query; 19 | 20 | /** 21 | * 应用变量值 22 | */ 23 | private Map inputs; 24 | 25 | /** 26 | * 响应模式:streaming(流式)或blocking(阻塞) 27 | */ 28 | private String response_mode; 29 | 30 | /** 31 | * 用户标识 32 | */ 33 | private String user; 34 | 35 | /** 36 | * 会话ID 37 | */ 38 | private String conversation_id; 39 | 40 | /** 41 | * 自动生成标题 42 | */ 43 | private Boolean auto_generate_name; 44 | 45 | /** 46 | * 文件列表,支持图片等多模态输入 47 | * 格式:[{"type":"image","transfer_method":"local_file","upload_file_id":"FILE_ID"}] 48 | */ 49 | private List> files; 50 | 51 | private static final long serialVersionUID = 1L; 52 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/dify/DifyStreamChunk.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.dify; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * Dify流式响应块DTO 9 | */ 10 | @Data 11 | public class DifyStreamChunk implements Serializable { 12 | 13 | /** 14 | * 事件类型,如message 15 | */ 16 | private String event; 17 | 18 | /** 19 | * 任务ID 20 | */ 21 | private String task_id; 22 | 23 | /** 24 | * 消息ID 25 | */ 26 | private String id; 27 | 28 | /** 29 | * 消息内容 30 | */ 31 | private String answer; 32 | 33 | /** 34 | * 会话ID 35 | */ 36 | private String conversation_id; 37 | 38 | /** 39 | * 创建时间 40 | */ 41 | private Long created_at; 42 | 43 | private static final long serialVersionUID = 1L; 44 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/file/UploadFileRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.file; 2 | 3 | import java.io.Serializable; 4 | import lombok.Data; 5 | 6 | /** 7 | * 文件上传请求 8 | */ 9 | @Data 10 | public class UploadFileRequest implements Serializable { 11 | 12 | /** 13 | * 业务 14 | */ 15 | private String biz; 16 | 17 | /** 18 | * 文件名称(可选) 19 | */ 20 | private String filename; 21 | 22 | /** 23 | * 文件描述(可选) 24 | */ 25 | private String description; 26 | 27 | /** 28 | * Base64编码的文件内容(可选) 29 | */ 30 | private String base64Data; 31 | 32 | private static final long serialVersionUID = 1L; 33 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/file/UploadVideoRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.file; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 视频上传请求 9 | */ 10 | @Data 11 | public class UploadVideoRequest implements Serializable { 12 | 13 | /** 14 | * 课程ID 15 | */ 16 | private Long courseId; 17 | 18 | /** 19 | * 章节ID 20 | */ 21 | private Long chapterId; 22 | 23 | /** 24 | * 课时ID 25 | */ 26 | private Long sectionId; 27 | 28 | /** 29 | * 视频标题 30 | */ 31 | private String title; 32 | 33 | /** 34 | * 视频描述 35 | */ 36 | private String description; 37 | 38 | /** 39 | * 排序序号 40 | */ 41 | private Integer sort; 42 | 43 | private static final long serialVersionUID = 1L; 44 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/learningrecord/UserLearningRecordAddRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.learningrecord; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.math.BigDecimal; 7 | import java.util.Date; 8 | 9 | /** 10 | * 添加用户学习记录请求 11 | */ 12 | @Data 13 | public class UserLearningRecordAddRequest implements Serializable { 14 | /** 15 | * 记录日期,不传则默认为当前日期 16 | */ 17 | private Date recordDate; 18 | 19 | /** 20 | * 记录类型,如:word_card, listening, course等 21 | */ 22 | private String recordType; 23 | 24 | /** 25 | * 关联ID,如单词ID、课程ID等 26 | */ 27 | private Long relatedId; 28 | 29 | /** 30 | * 课程中的课次或子活动编号 31 | */ 32 | private Integer lessonNumber; 33 | 34 | /** 35 | * 学习时长(秒) 36 | */ 37 | private Integer duration; 38 | 39 | /** 40 | * 学习数量 41 | */ 42 | private Integer count; 43 | 44 | /** 45 | * 获得积分 46 | */ 47 | private Integer points; 48 | 49 | /** 50 | * 获得经验值 51 | */ 52 | private Integer experience; 53 | 54 | /** 55 | * 正确率(百分比) 56 | */ 57 | private BigDecimal accuracy; 58 | 59 | /** 60 | * 活动状态,如:in_progress, completed, failed 61 | */ 62 | private String status; 63 | 64 | /** 65 | * 备注 66 | */ 67 | private String remark; 68 | 69 | private static final long serialVersionUID = 1L; 70 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/learningrecord/UserLearningRecordUpdateRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.learningrecord; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.math.BigDecimal; 7 | import java.util.Date; 8 | 9 | /** 10 | * 更新用户学习记录请求 11 | */ 12 | @Data 13 | public class UserLearningRecordUpdateRequest implements Serializable { 14 | /** 15 | * id 16 | */ 17 | private Long id; 18 | 19 | /** 20 | * 记录日期 21 | */ 22 | private Date recordDate; 23 | 24 | /** 25 | * 记录类型,如:word_card, listening, course等 26 | */ 27 | private String recordType; 28 | 29 | /** 30 | * 关联ID,如单词ID、课程ID等 31 | */ 32 | private Long relatedId; 33 | 34 | /** 35 | * 课程中的课次或子活动编号 36 | */ 37 | private Integer lessonNumber; 38 | 39 | /** 40 | * 学习时长(秒) 41 | */ 42 | private Integer duration; 43 | 44 | /** 45 | * 学习数量 46 | */ 47 | private Integer count; 48 | 49 | /** 50 | * 获得积分 51 | */ 52 | private Integer points; 53 | 54 | /** 55 | * 获得经验值 56 | */ 57 | private Integer experience; 58 | 59 | /** 60 | * 正确率(百分比) 61 | */ 62 | private BigDecimal accuracy; 63 | 64 | /** 65 | * 活动状态,如:in_progress, completed, failed 66 | */ 67 | private String status; 68 | 69 | /** 70 | * 备注 71 | */ 72 | private String remark; 73 | 74 | private static final long serialVersionUID = 1L; 75 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/post/PostAddRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.post; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | import lombok.Data; 6 | 7 | /** 8 | * 创建请求 9 | */ 10 | @Data 11 | public class PostAddRequest implements Serializable { 12 | 13 | /** 14 | * 标题 15 | */ 16 | private String title; 17 | 18 | /** 19 | * 内容 20 | */ 21 | private String content; 22 | 23 | /** 24 | * 标签列表 25 | */ 26 | private List tags; 27 | 28 | private static final long serialVersionUID = 1L; 29 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/post/PostEditRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.post; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | import lombok.Data; 6 | 7 | /** 8 | * 编辑请求 9 | */ 10 | @Data 11 | public class PostEditRequest implements Serializable { 12 | 13 | /** 14 | * id 15 | */ 16 | private Long id; 17 | 18 | /** 19 | * 标题 20 | */ 21 | private String title; 22 | 23 | /** 24 | * 内容 25 | */ 26 | private String content; 27 | 28 | /** 29 | * 标签列表 30 | */ 31 | private List tags; 32 | 33 | private static final long serialVersionUID = 1L; 34 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/post/PostQueryRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.post; 2 | 3 | import com.ubanillx.smartclass.common.PageRequest; 4 | import java.io.Serializable; 5 | import java.util.List; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | 9 | /** 10 | * 查询请求 11 | */ 12 | @EqualsAndHashCode(callSuper = true) 13 | @Data 14 | public class PostQueryRequest extends PageRequest implements Serializable { 15 | 16 | /** 17 | * id 18 | */ 19 | private Long id; 20 | 21 | /** 22 | * id 23 | */ 24 | private Long notId; 25 | 26 | /** 27 | * 搜索词 28 | */ 29 | private String searchText; 30 | 31 | /** 32 | * 标题 33 | */ 34 | private String title; 35 | 36 | /** 37 | * 内容 38 | */ 39 | private String content; 40 | 41 | /** 42 | * 标签列表 43 | */ 44 | private List tags; 45 | 46 | /** 47 | * 至少有一个标签 48 | */ 49 | private List orTags; 50 | 51 | /** 52 | * 创建用户 id 53 | */ 54 | private Long userId; 55 | 56 | /** 57 | * 收藏用户 id 58 | */ 59 | private Long favourUserId; 60 | 61 | private static final long serialVersionUID = 1L; 62 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/post/PostUpdateRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.post; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | import lombok.Data; 6 | 7 | /** 8 | * 更新请求 9 | */ 10 | @Data 11 | public class PostUpdateRequest implements Serializable { 12 | 13 | /** 14 | * id 15 | */ 16 | private Long id; 17 | 18 | /** 19 | * 标题 20 | */ 21 | private String title; 22 | 23 | /** 24 | * 内容 25 | */ 26 | private String content; 27 | 28 | /** 29 | * 标签列表 30 | */ 31 | private List tags; 32 | 33 | private static final long serialVersionUID = 1L; 34 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/postfavour/PostFavourAddRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.postfavour; 2 | 3 | import java.io.Serializable; 4 | import lombok.Data; 5 | 6 | /** 7 | * 帖子收藏 / 取消收藏请求 8 | */ 9 | @Data 10 | public class PostFavourAddRequest implements Serializable { 11 | 12 | /** 13 | * 帖子 id 14 | */ 15 | private Long postId; 16 | 17 | private static final long serialVersionUID = 1L; 18 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/postfavour/PostFavourQueryRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.postfavour; 2 | 3 | import com.ubanillx.smartclass.common.PageRequest; 4 | import com.ubanillx.smartclass.model.dto.post.PostQueryRequest; 5 | import java.io.Serializable; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | 9 | /** 10 | * 帖子收藏查询请求 11 | */ 12 | @Data 13 | @EqualsAndHashCode(callSuper = true) 14 | public class PostFavourQueryRequest extends PageRequest implements Serializable { 15 | 16 | /** 17 | * 帖子查询请求 18 | */ 19 | private PostQueryRequest postQueryRequest; 20 | 21 | /** 22 | * 用户 id 23 | */ 24 | private Long userId; 25 | 26 | private static final long serialVersionUID = 1L; 27 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/postthumb/PostThumbAddRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.postthumb; 2 | 3 | import java.io.Serializable; 4 | import lombok.Data; 5 | 6 | /** 7 | * 帖子点赞请求 8 | */ 9 | @Data 10 | public class PostThumbAddRequest implements Serializable { 11 | 12 | /** 13 | * 帖子 id 14 | */ 15 | private Long postId; 16 | 17 | private static final long serialVersionUID = 1L; 18 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/teacher/TeacherAddRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.teacher; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 添加讲师请求 9 | */ 10 | @Data 11 | public class TeacherAddRequest implements Serializable { 12 | 13 | /** 14 | * 讲师姓名 15 | */ 16 | private String name; 17 | 18 | /** 19 | * 讲师头像URL 20 | */ 21 | private String avatar; 22 | 23 | /** 24 | * 讲师职称 25 | */ 26 | private String title; 27 | 28 | /** 29 | * 讲师简介 30 | */ 31 | private String introduction; 32 | 33 | /** 34 | * 专业领域,JSON数组格式 35 | */ 36 | private String expertise; 37 | 38 | /** 39 | * 关联的用户id,如果讲师也是平台用户 40 | */ 41 | private Long userId; 42 | 43 | private static final long serialVersionUID = 1L; 44 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/teacher/TeacherQueryRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.teacher; 2 | 3 | import com.ubanillx.smartclass.common.PageRequest; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | * 查询讲师请求 11 | */ 12 | @EqualsAndHashCode(callSuper = true) 13 | @Data 14 | public class TeacherQueryRequest extends PageRequest implements Serializable { 15 | /** 16 | * id 17 | */ 18 | private Long id; 19 | 20 | /** 21 | * 讲师姓名 22 | */ 23 | private String name; 24 | 25 | /** 26 | * 讲师职称 27 | */ 28 | private String title; 29 | 30 | /** 31 | * 专业领域 32 | */ 33 | private String expertise; 34 | 35 | /** 36 | * 关联的用户id 37 | */ 38 | private Long userId; 39 | 40 | /** 41 | * 创建管理员id 42 | */ 43 | private Long adminId; 44 | 45 | /** 46 | * 排序字段 47 | */ 48 | private String sortField; 49 | 50 | /** 51 | * 排序顺序(默认升序) 52 | */ 53 | private String sortOrder; 54 | 55 | private static final long serialVersionUID = 1L; 56 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/teacher/TeacherUpdateRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.teacher; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 更新讲师请求 9 | */ 10 | @Data 11 | public class TeacherUpdateRequest implements Serializable { 12 | /** 13 | * id 14 | */ 15 | private Long id; 16 | 17 | /** 18 | * 讲师姓名 19 | */ 20 | private String name; 21 | 22 | /** 23 | * 讲师头像URL 24 | */ 25 | private String avatar; 26 | 27 | /** 28 | * 讲师职称 29 | */ 30 | private String title; 31 | 32 | /** 33 | * 讲师简介 34 | */ 35 | private String introduction; 36 | 37 | /** 38 | * 专业领域,JSON数组格式 39 | */ 40 | private String expertise; 41 | 42 | /** 43 | * 关联的用户id,如果讲师也是平台用户 44 | */ 45 | private Long userId; 46 | 47 | private static final long serialVersionUID = 1L; 48 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/user/UserAddRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.user; 2 | 3 | import java.io.Serializable; 4 | import lombok.Data; 5 | 6 | /** 7 | * 用户创建请求 8 | */ 9 | @Data 10 | public class UserAddRequest implements Serializable { 11 | 12 | /** 13 | * 用户昵称 14 | */ 15 | private String userName; 16 | 17 | /** 18 | * 账号 19 | */ 20 | private String userAccount; 21 | 22 | /** 23 | * 用户角色: user, admin 24 | */ 25 | private String userRole; 26 | 27 | private static final long serialVersionUID = 1L; 28 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/user/UserLoginByPhoneRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.user; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 用户登录请求 9 | */ 10 | @Data 11 | public class UserLoginByPhoneRequest implements Serializable { 12 | 13 | private static final long serialVersionUID = 3191241716373120793L; 14 | 15 | private String userPhone; 16 | 17 | private String userPassword; 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/user/UserLoginRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.user; 2 | 3 | import java.io.Serializable; 4 | import lombok.Data; 5 | 6 | /** 7 | * 用户登录请求 8 | */ 9 | @Data 10 | public class UserLoginRequest implements Serializable { 11 | 12 | private static final long serialVersionUID = 3191241716373120793L; 13 | 14 | private String userAccount; 15 | 16 | private String userPassword; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/user/UserQueryRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.user; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import com.ubanillx.smartclass.common.PageRequest; 6 | import java.io.Serializable; 7 | import java.util.Date; 8 | 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | 12 | /** 13 | * 用户查询请求 14 | */ 15 | @EqualsAndHashCode(callSuper = true) 16 | @Data 17 | public class UserQueryRequest extends PageRequest implements Serializable { 18 | /** 19 | * id 20 | */ 21 | private Long id; 22 | 23 | /** 24 | * 账号 25 | */ 26 | private String userAccount; 27 | 28 | 29 | /** 30 | * 用户性别 0-男 1-女 2-保密 31 | */ 32 | private Integer userGender; 33 | 34 | /** 35 | * 手机号 36 | */ 37 | private String userPhone; 38 | 39 | /** 40 | * 微信开放平台id 41 | */ 42 | private String unionId; 43 | 44 | /** 45 | * 公众号openId 46 | */ 47 | private String mpOpenId; 48 | 49 | /** 50 | * 用户昵称 51 | */ 52 | private String userName; 53 | 54 | /** 55 | * 用户简介 56 | */ 57 | private String userProfile; 58 | 59 | 60 | /** 61 | * 用户角色:student/teacher/admin/ban 62 | */ 63 | private String userRole; 64 | 65 | /** 66 | * 用户邮箱 67 | */ 68 | private String userEmail; 69 | 70 | /** 71 | * 用户微信号 72 | */ 73 | private String wechatId; 74 | 75 | /** 76 | * 用户生日 77 | */ 78 | private Date birthday; 79 | 80 | 81 | /** 82 | * 创建时间 83 | */ 84 | private Date createTime; 85 | 86 | 87 | private static final long serialVersionUID = 1L; 88 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/user/UserRegisterByPhoneRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.user; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 用户注册请求体 9 | */ 10 | @Data 11 | public class UserRegisterByPhoneRequest implements Serializable { 12 | 13 | private static final long serialVersionUID = 3191241716373120793L; 14 | 15 | private String userPhone; 16 | 17 | private String userPassword; 18 | 19 | private String checkPassword; 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/user/UserRegisterRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.user; 2 | 3 | import java.io.Serializable; 4 | import lombok.Data; 5 | 6 | /** 7 | * 用户注册请求体 8 | */ 9 | @Data 10 | public class UserRegisterRequest implements Serializable { 11 | 12 | private static final long serialVersionUID = 3191241716373120793L; 13 | 14 | private String userAccount; 15 | 16 | private String userPassword; 17 | 18 | private String checkPassword; 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/user/UserUpdateMyRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.user; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | import lombok.Data; 7 | 8 | /** 9 | * 用户更新个人信息请求 10 | */ 11 | @Data 12 | public class UserUpdateMyRequest implements Serializable { 13 | 14 | /** 15 | * 用户昵称 16 | */ 17 | private String userName; 18 | 19 | /** 20 | * 用户头像 21 | */ 22 | private String userAvatar; 23 | 24 | /** 25 | * 简介 26 | */ 27 | private String userProfile; 28 | 29 | /** 30 | * 手机号 31 | */ 32 | private String userPhone; 33 | 34 | /** 35 | * 用户邮箱 36 | */ 37 | private String userEmail; 38 | 39 | /** 40 | * 用户微信号 41 | */ 42 | private String wechatId; 43 | 44 | /** 45 | * 用户所在省份 46 | */ 47 | private String province; 48 | 49 | /** 50 | * 用户所在城市 51 | */ 52 | private String city; 53 | 54 | /** 55 | * 用户所在区县 56 | */ 57 | private String district; 58 | 59 | /** 60 | * 用户密码 61 | */ 62 | private String userPassword; 63 | 64 | /** 65 | * 用户角色:student/teacher 66 | */ 67 | private String userRole; 68 | 69 | /** 70 | * 用户生日 71 | */ 72 | private Date birthday; 73 | 74 | /** 75 | * 用户性别:0-男 1-女 2-保密 76 | */ 77 | private int userGender; 78 | 79 | 80 | private static final long serialVersionUID = 1L; 81 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/user/UserUpdateRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.user; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | import lombok.Data; 7 | 8 | /** 9 | * 用户更新请求 10 | */ 11 | @Data 12 | public class UserUpdateRequest implements Serializable { 13 | /** 14 | * id 15 | */ 16 | private Long id; 17 | /** 18 | * 用户昵称 19 | */ 20 | private String userName; 21 | 22 | /** 23 | * 用户头像 24 | */ 25 | private String userAvatar; 26 | 27 | /** 28 | * 简介 29 | */ 30 | private String userProfile; 31 | 32 | /** 33 | * 手机号 34 | */ 35 | private String userPhone; 36 | 37 | /** 38 | * 用户邮箱 39 | */ 40 | private String userEmail; 41 | 42 | /** 43 | * 用户微信号 44 | */ 45 | private String wechatId; 46 | 47 | /** 48 | * 用户所在省份 49 | */ 50 | private String province; 51 | 52 | /** 53 | * 用户所在城市 54 | */ 55 | private String city; 56 | 57 | /** 58 | * 用户所在区县 59 | */ 60 | private String district; 61 | 62 | /** 63 | * 用户密码 64 | */ 65 | private String userPassword; 66 | 67 | /** 68 | * 用户角色:student/teacher 69 | */ 70 | private String userRole; 71 | 72 | /** 73 | * 用户生日 74 | */ 75 | private Date birthday; 76 | 77 | /** 78 | * 用户性别:0-男 1-女 2-保密 79 | */ 80 | private int userGender; 81 | 82 | /** 83 | * 用户角色:0-管理员 1-student 2-teacher 84 | */ 85 | private int role; 86 | 87 | private static final long serialVersionUID = 1L; 88 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/useraiavatar/UserAiAvatarAddRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.useraiavatar; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.math.BigDecimal; 7 | 8 | /** 9 | * 用户AI分身关联添加请求 10 | */ 11 | @Data 12 | public class UserAiAvatarAddRequest implements Serializable { 13 | 14 | /** 15 | * 用户id 16 | */ 17 | private Long userId; 18 | 19 | /** 20 | * AI分身id 21 | */ 22 | private Long aiAvatarId; 23 | 24 | /** 25 | * 是否收藏:0-否,1-是 26 | */ 27 | private Integer isFavorite; 28 | 29 | /** 30 | * 用户评分,1-5分 31 | */ 32 | private BigDecimal userRating; 33 | 34 | /** 35 | * 用户反馈 36 | */ 37 | private String userFeedback; 38 | 39 | /** 40 | * 用户自定义设置,JSON格式 41 | */ 42 | private String customSettings; 43 | 44 | private static final long serialVersionUID = 1L; 45 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/useraiavatar/UserAiAvatarQueryRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.useraiavatar; 2 | 3 | import com.ubanillx.smartclass.common.PageRequest; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | import java.io.Serializable; 8 | import java.math.BigDecimal; 9 | import java.util.Date; 10 | 11 | /** 12 | * 用户AI分身关联查询请求 13 | */ 14 | @EqualsAndHashCode(callSuper = true) 15 | @Data 16 | public class UserAiAvatarQueryRequest extends PageRequest implements Serializable { 17 | 18 | /** 19 | * id 20 | */ 21 | private Long id; 22 | 23 | /** 24 | * 用户id 25 | */ 26 | private Long userId; 27 | 28 | /** 29 | * AI分身id 30 | */ 31 | private Long aiAvatarId; 32 | 33 | /** 34 | * 是否收藏:0-否,1-是 35 | */ 36 | private Integer isFavorite; 37 | 38 | /** 39 | * 用户评分,1-5分 40 | */ 41 | private BigDecimal userRating; 42 | 43 | /** 44 | * 创建时间 45 | */ 46 | private Date createTime; 47 | 48 | private static final long serialVersionUID = 1L; 49 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/useraiavatar/UserAiAvatarUpdateRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.useraiavatar; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.math.BigDecimal; 7 | 8 | /** 9 | * 用户AI分身关联更新请求 10 | */ 11 | @Data 12 | public class UserAiAvatarUpdateRequest implements Serializable { 13 | 14 | /** 15 | * id 16 | */ 17 | private Long id; 18 | 19 | /** 20 | * 是否收藏:0-否,1-是 21 | */ 22 | private Integer isFavorite; 23 | 24 | /** 25 | * 用户评分,1-5分 26 | */ 27 | private BigDecimal userRating; 28 | 29 | /** 30 | * 用户反馈 31 | */ 32 | private String userFeedback; 33 | 34 | /** 35 | * 用户自定义设置,JSON格式 36 | */ 37 | private String customSettings; 38 | 39 | private static final long serialVersionUID = 1L; 40 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/userlevel/UserLevelAddRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.userlevel; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 添加用户等级请求 9 | */ 10 | @Data 11 | public class UserLevelAddRequest implements Serializable { 12 | 13 | /** 14 | * 等级数值 15 | */ 16 | private Integer level; 17 | 18 | /** 19 | * 等级名称 20 | */ 21 | private String levelName; 22 | 23 | /** 24 | * 等级图标URL 25 | */ 26 | private String iconUrl; 27 | 28 | /** 29 | * 最小经验值 30 | */ 31 | private Integer minExperience; 32 | 33 | /** 34 | * 最大经验值 35 | */ 36 | private Integer maxExperience; 37 | 38 | /** 39 | * 等级描述 40 | */ 41 | private String description; 42 | 43 | /** 44 | * 等级特权,JSON格式 45 | */ 46 | private String privileges; 47 | 48 | private static final long serialVersionUID = 1L; 49 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/userlevel/UserLevelQueryRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.userlevel; 2 | 3 | import com.ubanillx.smartclass.common.PageRequest; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | * 查询用户等级请求 11 | */ 12 | @EqualsAndHashCode(callSuper = true) 13 | @Data 14 | public class UserLevelQueryRequest extends PageRequest implements Serializable { 15 | /** 16 | * id 17 | */ 18 | private Long id; 19 | 20 | /** 21 | * 等级数值 22 | */ 23 | private Integer level; 24 | 25 | /** 26 | * 等级名称 27 | */ 28 | private String levelName; 29 | 30 | /** 31 | * 最小经验值范围(起始值) 32 | */ 33 | private Integer minExperienceStart; 34 | 35 | /** 36 | * 最小经验值范围(结束值) 37 | */ 38 | private Integer minExperienceEnd; 39 | 40 | /** 41 | * 最大经验值范围(起始值) 42 | */ 43 | private Integer maxExperienceStart; 44 | 45 | /** 46 | * 最大经验值范围(结束值) 47 | */ 48 | private Integer maxExperienceEnd; 49 | 50 | /** 51 | * 排序字段 52 | */ 53 | private String sortField; 54 | 55 | /** 56 | * 排序顺序(默认升序) 57 | */ 58 | private String sortOrder; 59 | 60 | private static final long serialVersionUID = 1L; 61 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/dto/userlevel/UserLevelUpdateRequest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.dto.userlevel; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 更新用户等级请求 9 | */ 10 | @Data 11 | public class UserLevelUpdateRequest implements Serializable { 12 | 13 | /** 14 | * id 15 | */ 16 | private Long id; 17 | 18 | /** 19 | * 等级数值 20 | */ 21 | private Integer level; 22 | 23 | /** 24 | * 等级名称 25 | */ 26 | private String levelName; 27 | 28 | /** 29 | * 等级图标URL 30 | */ 31 | private String iconUrl; 32 | 33 | /** 34 | * 最小经验值 35 | */ 36 | private Integer minExperience; 37 | 38 | /** 39 | * 最大经验值 40 | */ 41 | private Integer maxExperience; 42 | 43 | /** 44 | * 等级描述 45 | */ 46 | private String description; 47 | 48 | /** 49 | * 等级特权,JSON格式 50 | */ 51 | private String privileges; 52 | 53 | private static final long serialVersionUID = 1L; 54 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/entity/AiAvatarChatHistory.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | import lombok.Data; 10 | 11 | /** 12 | * AI分身对话历史 13 | * @TableName ai_avatar_chat_history 14 | */ 15 | @TableName(value ="ai_avatar_chat_history") 16 | @Data 17 | public class AiAvatarChatHistory implements Serializable { 18 | /** 19 | * id 20 | */ 21 | @TableId(type = IdType.AUTO) 22 | private Long id; 23 | 24 | /** 25 | * 用户id 26 | */ 27 | private Long userId; 28 | 29 | /** 30 | * AI分身id 31 | */ 32 | private Long aiAvatarId; 33 | 34 | /** 35 | * 会话ID 36 | */ 37 | private String sessionId; 38 | 39 | /** 40 | * 会话总结标题 41 | */ 42 | private String sessionName; 43 | 44 | /** 45 | * 消息类型:user/ai 46 | */ 47 | private String messageType; 48 | 49 | /** 50 | * 消息内容 51 | */ 52 | private String content; 53 | 54 | /** 55 | * 消息token数 56 | */ 57 | private Integer tokens; 58 | 59 | /** 60 | * 创建时间 61 | */ 62 | private Date createTime; 63 | 64 | @TableField(exist = false) 65 | private static final long serialVersionUID = 1L; 66 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/entity/Announcement.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | import lombok.Data; 8 | 9 | /** 10 | * 系统公告 11 | * @TableName announcement 12 | */ 13 | @TableName(value ="announcement") 14 | @Data 15 | public class Announcement implements Serializable { 16 | /** 17 | * id 18 | */ 19 | @TableId(type = IdType.AUTO) 20 | private Long id; 21 | 22 | /** 23 | * 公告标题 24 | */ 25 | private String title; 26 | 27 | /** 28 | * 公告内容 29 | */ 30 | private String content; 31 | 32 | /** 33 | * 优先级,数字越大优先级越高 34 | */ 35 | private Integer priority; 36 | 37 | /** 38 | * 状态:0-草稿,1-已发布,2-已下线 39 | */ 40 | private Integer status; 41 | 42 | /** 43 | * 公告开始展示时间 44 | */ 45 | private Date startTime; 46 | 47 | /** 48 | * 公告结束展示时间 49 | */ 50 | private Date endTime; 51 | 52 | /** 53 | * 封面图片URL 54 | */ 55 | private String coverImage; 56 | 57 | /** 58 | * 发布管理员id 59 | */ 60 | private Long adminId; 61 | 62 | /** 63 | * 查看次数 64 | */ 65 | private Integer viewCount; 66 | 67 | /** 68 | * 创建时间 69 | */ 70 | private Date createTime; 71 | 72 | /** 73 | * 更新时间 74 | */ 75 | private Date updateTime; 76 | 77 | /** 78 | * 是否删除 79 | */ 80 | @TableLogic 81 | private Integer isDelete; 82 | 83 | @TableField(exist = false) 84 | private static final long serialVersionUID = 1L; 85 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/entity/CourseCategory.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | import lombok.Data; 10 | 11 | /** 12 | * 课程分类 13 | * @TableName course_category 14 | */ 15 | @TableName(value ="course_category") 16 | @Data 17 | public class CourseCategory implements Serializable { 18 | /** 19 | * id 20 | */ 21 | @TableId(type = IdType.AUTO) 22 | private Long id; 23 | 24 | /** 25 | * 分类名称 26 | */ 27 | private String name; 28 | 29 | /** 30 | * 分类描述 31 | */ 32 | private String description; 33 | 34 | /** 35 | * 分类图标URL 36 | */ 37 | private String icon; 38 | 39 | /** 40 | * 排序权重,数字越大排序越靠前 41 | */ 42 | private Integer sort; 43 | 44 | /** 45 | * 父分类id,0表示一级分类 46 | */ 47 | private Long parentId; 48 | 49 | /** 50 | * 创建管理员id 51 | */ 52 | private Long adminId; 53 | 54 | /** 55 | * 创建时间 56 | */ 57 | private Date createTime; 58 | 59 | /** 60 | * 更新时间 61 | */ 62 | private Date updateTime; 63 | 64 | /** 65 | * 是否删除 66 | */ 67 | private Integer isDelete; 68 | 69 | @TableField(exist = false) 70 | private static final long serialVersionUID = 1L; 71 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/entity/CourseChapter.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | import lombok.Data; 10 | 11 | /** 12 | * 课程章节 13 | * @TableName course_chapter 14 | */ 15 | @TableName(value ="course_chapter") 16 | @Data 17 | public class CourseChapter implements Serializable { 18 | /** 19 | * id 20 | */ 21 | @TableId(type = IdType.AUTO) 22 | private Long id; 23 | 24 | /** 25 | * 课程id 26 | */ 27 | private Long courseId; 28 | 29 | /** 30 | * 章节标题 31 | */ 32 | private String title; 33 | 34 | /** 35 | * 章节描述 36 | */ 37 | private String description; 38 | 39 | /** 40 | * 排序,数字越小排序越靠前 41 | */ 42 | private Integer sort; 43 | 44 | /** 45 | * 创建管理员id 46 | */ 47 | private Long adminId; 48 | 49 | /** 50 | * 创建时间 51 | */ 52 | private Date createTime; 53 | 54 | /** 55 | * 更新时间 56 | */ 57 | private Date updateTime; 58 | 59 | /** 60 | * 是否删除 61 | */ 62 | private Integer isDelete; 63 | 64 | @TableField(exist = false) 65 | private static final long serialVersionUID = 1L; 66 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/entity/CourseFavourite.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | import lombok.Data; 10 | 11 | /** 12 | * 课程收藏 13 | * @TableName course_favourite 14 | */ 15 | @TableName(value ="course_favourite") 16 | @Data 17 | public class CourseFavourite implements Serializable { 18 | /** 19 | * id 20 | */ 21 | @TableId(type = IdType.AUTO) 22 | private Long id; 23 | 24 | /** 25 | * 用户id 26 | */ 27 | private Long userId; 28 | 29 | /** 30 | * 课程id 31 | */ 32 | private Long courseId; 33 | 34 | /** 35 | * 创建时间 36 | */ 37 | private Date createTime; 38 | 39 | /** 40 | * 更新时间 41 | */ 42 | private Date updateTime; 43 | 44 | @TableField(exist = false) 45 | private static final long serialVersionUID = 1L; 46 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/entity/CourseMaterial.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | import lombok.Data; 10 | 11 | /** 12 | * 课程资料 13 | * @TableName course_material 14 | */ 15 | @TableName(value ="course_material") 16 | @Data 17 | public class CourseMaterial implements Serializable { 18 | /** 19 | * id 20 | */ 21 | @TableId(type = IdType.AUTO) 22 | private Long id; 23 | 24 | /** 25 | * 课程id 26 | */ 27 | private Long courseId; 28 | 29 | /** 30 | * 资料标题 31 | */ 32 | private String title; 33 | 34 | /** 35 | * 资料描述 36 | */ 37 | private String description; 38 | 39 | /** 40 | * 文件URL 41 | */ 42 | private String fileUrl; 43 | 44 | /** 45 | * 文件大小(字节) 46 | */ 47 | private Long fileSize; 48 | 49 | /** 50 | * 文件类型 51 | */ 52 | private String fileType; 53 | 54 | /** 55 | * 下载次数 56 | */ 57 | private Integer downloadCount; 58 | 59 | /** 60 | * 排序,数字越小排序越靠前 61 | */ 62 | private Integer sort; 63 | 64 | /** 65 | * 创建管理员id 66 | */ 67 | private Long adminId; 68 | 69 | /** 70 | * 创建时间 71 | */ 72 | private Date createTime; 73 | 74 | /** 75 | * 更新时间 76 | */ 77 | private Date updateTime; 78 | 79 | /** 80 | * 是否删除 81 | */ 82 | private Integer isDelete; 83 | 84 | @TableField(exist = false) 85 | private static final long serialVersionUID = 1L; 86 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/entity/CourseReview.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | import lombok.Data; 10 | 11 | /** 12 | * 课程评价 13 | * @TableName course_review 14 | */ 15 | @TableName(value ="course_review") 16 | @Data 17 | public class CourseReview implements Serializable { 18 | /** 19 | * id 20 | */ 21 | @TableId(type = IdType.AUTO) 22 | private Long id; 23 | 24 | /** 25 | * 用户id 26 | */ 27 | private Long userId; 28 | 29 | /** 30 | * 课程id 31 | */ 32 | private Long courseId; 33 | 34 | /** 35 | * 评价内容 36 | */ 37 | private String content; 38 | 39 | /** 40 | * 评分(1-5分) 41 | */ 42 | private Integer rating; 43 | 44 | /** 45 | * 点赞数 46 | */ 47 | private Integer likeCount; 48 | 49 | /** 50 | * 回复数 51 | */ 52 | private Integer replyCount; 53 | 54 | /** 55 | * 管理员回复 56 | */ 57 | private String adminReply; 58 | 59 | /** 60 | * 管理员回复时间 61 | */ 62 | private Date adminReplyTime; 63 | 64 | /** 65 | * 状态:0-待审核,1-已发布,2-已拒绝 66 | */ 67 | private Integer status; 68 | 69 | /** 70 | * 创建时间 71 | */ 72 | private Date createTime; 73 | 74 | /** 75 | * 更新时间 76 | */ 77 | private Date updateTime; 78 | 79 | /** 80 | * 是否删除 81 | */ 82 | private Integer isDelete; 83 | 84 | @TableField(exist = false) 85 | private static final long serialVersionUID = 1L; 86 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/entity/Post.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableLogic; 7 | import com.baomidou.mybatisplus.annotation.TableName; 8 | import java.io.Serializable; 9 | import java.util.Date; 10 | import lombok.Data; 11 | 12 | /** 13 | * 帖子 14 | */ 15 | @TableName(value = "post") 16 | @Data 17 | public class Post implements Serializable { 18 | 19 | /** 20 | * id 21 | */ 22 | @TableId(type = IdType.ASSIGN_ID) 23 | private Long id; 24 | 25 | /** 26 | * 标题 27 | */ 28 | private String title; 29 | 30 | /** 31 | * 内容 32 | */ 33 | private String content; 34 | 35 | /** 36 | * 标签列表 json 37 | */ 38 | private String tags; 39 | 40 | /** 41 | * 点赞数 42 | */ 43 | private Integer thumbNum; 44 | 45 | /** 46 | * 收藏数 47 | */ 48 | private Integer favourNum; 49 | 50 | /** 51 | * 创建用户 id 52 | */ 53 | private Long userId; 54 | 55 | /** 56 | * 创建时间 57 | */ 58 | private Date createTime; 59 | 60 | /** 61 | * 更新时间 62 | */ 63 | private Date updateTime; 64 | 65 | /** 66 | * 是否删除 67 | */ 68 | @TableLogic 69 | private Integer isDelete; 70 | 71 | @TableField(exist = false) 72 | private static final long serialVersionUID = 1L; 73 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/entity/PostFavour.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | import lombok.Data; 10 | 11 | /** 12 | * 帖子收藏 13 | * 14 | 15 | **/ 16 | @TableName(value = "post_favour") 17 | @Data 18 | public class PostFavour implements Serializable { 19 | 20 | /** 21 | * id 22 | */ 23 | @TableId(type = IdType.AUTO) 24 | private Long id; 25 | 26 | /** 27 | * 帖子 id 28 | */ 29 | private Long postId; 30 | 31 | /** 32 | * 创建用户 id 33 | */ 34 | private Long userId; 35 | 36 | /** 37 | * 创建时间 38 | */ 39 | private Date createTime; 40 | 41 | /** 42 | * 更新时间 43 | */ 44 | private Date updateTime; 45 | 46 | @TableField(exist = false) 47 | private static final long serialVersionUID = 1L; 48 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/entity/PostThumb.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | import lombok.Data; 10 | 11 | /** 12 | * 帖子点赞 13 | */ 14 | @TableName(value = "post_thumb") 15 | @Data 16 | public class PostThumb implements Serializable { 17 | 18 | /** 19 | * id 20 | */ 21 | @TableId(type = IdType.AUTO) 22 | private Long id; 23 | 24 | /** 25 | * 帖子 id 26 | */ 27 | private Long postId; 28 | 29 | /** 30 | * 创建用户 id 31 | */ 32 | private Long userId; 33 | 34 | /** 35 | * 创建时间 36 | */ 37 | private Date createTime; 38 | 39 | /** 40 | * 更新时间 41 | */ 42 | private Date updateTime; 43 | 44 | @TableField(exist = false) 45 | private static final long serialVersionUID = 1L; 46 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/entity/Teacher.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | import lombok.Data; 8 | 9 | /** 10 | * 讲师 11 | * @TableName teacher 12 | */ 13 | @TableName(value ="teacher") 14 | @Data 15 | public class Teacher implements Serializable { 16 | /** 17 | * id 18 | */ 19 | @TableId(type = IdType.AUTO) 20 | private Long id; 21 | 22 | /** 23 | * 讲师姓名 24 | */ 25 | private String name; 26 | 27 | /** 28 | * 讲师头像URL 29 | */ 30 | private String avatar; 31 | 32 | /** 33 | * 讲师职称 34 | */ 35 | private String title; 36 | 37 | /** 38 | * 讲师简介 39 | */ 40 | private String introduction; 41 | 42 | /** 43 | * 专业领域,JSON数组格式 44 | */ 45 | private String expertise; 46 | 47 | /** 48 | * 关联的用户id,如果讲师也是平台用户 49 | */ 50 | private Long userId; 51 | 52 | /** 53 | * 创建管理员id 54 | */ 55 | private Long adminId; 56 | 57 | /** 58 | * 创建时间 59 | */ 60 | private Date createTime; 61 | 62 | /** 63 | * 更新时间 64 | */ 65 | private Date updateTime; 66 | 67 | /** 68 | * 是否删除 69 | */ 70 | @TableLogic 71 | private Integer isDelete; 72 | 73 | @TableField(exist = false) 74 | private static final long serialVersionUID = 1L; 75 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/entity/UserAiAvatar.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.io.Serializable; 8 | import java.math.BigDecimal; 9 | import java.util.Date; 10 | import lombok.Data; 11 | 12 | /** 13 | * 用户AI分身关联 14 | * @TableName user_ai_avatar 15 | */ 16 | @TableName(value ="user_ai_avatar") 17 | @Data 18 | public class UserAiAvatar implements Serializable { 19 | /** 20 | * id 21 | */ 22 | @TableId(type = IdType.AUTO) 23 | private Long id; 24 | 25 | /** 26 | * 用户id 27 | */ 28 | private Long userId; 29 | 30 | /** 31 | * AI分身id 32 | */ 33 | private Long aiAvatarId; 34 | 35 | /** 36 | * 是否收藏:0-否,1-是 37 | */ 38 | private Integer isFavorite; 39 | 40 | /** 41 | * 最后使用时间 42 | */ 43 | private Date lastUseTime; 44 | 45 | /** 46 | * 使用次数 47 | */ 48 | private Integer useCount; 49 | 50 | /** 51 | * 用户评分,1-5分 52 | */ 53 | private BigDecimal userRating; 54 | 55 | /** 56 | * 用户反馈 57 | */ 58 | private String userFeedback; 59 | 60 | /** 61 | * 用户自定义设置,JSON格式 62 | */ 63 | private String customSettings; 64 | 65 | /** 66 | * 创建时间 67 | */ 68 | private Date createTime; 69 | 70 | /** 71 | * 更新时间 72 | */ 73 | private Date updateTime; 74 | 75 | @TableField(exist = false) 76 | private static final long serialVersionUID = 1L; 77 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/entity/UserAnnouncementReader.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | import lombok.Data; 10 | 11 | /** 12 | * 用户公告阅读记录 13 | * @TableName user_announcement_reader 14 | */ 15 | @TableName(value ="user_announcement_reader") 16 | @Data 17 | public class UserAnnouncementReader implements Serializable { 18 | /** 19 | * id 20 | */ 21 | @TableId(type = IdType.AUTO) 22 | private Long id; 23 | 24 | /** 25 | * 用户id 26 | */ 27 | private Long userId; 28 | 29 | /** 30 | * 公告id 31 | */ 32 | private Long announcementId; 33 | 34 | /** 35 | * 阅读时间 36 | */ 37 | private Date readTime; 38 | 39 | /** 40 | * 创建时间 41 | */ 42 | private Date createTime; 43 | 44 | /** 45 | * 更新时间 46 | */ 47 | private Date updateTime; 48 | 49 | @TableField(exist = false) 50 | private static final long serialVersionUID = 1L; 51 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/entity/UserDailyArticle.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | import lombok.Data; 10 | 11 | /** 12 | * 用户与每日文章关联 13 | * @TableName user_daily_article 14 | */ 15 | @TableName(value ="user_daily_article") 16 | @Data 17 | public class UserDailyArticle implements Serializable { 18 | /** 19 | * id 20 | */ 21 | @TableId(type = IdType.AUTO) 22 | private Long id; 23 | 24 | /** 25 | * 用户id 26 | */ 27 | private Long userId; 28 | 29 | /** 30 | * 文章id 31 | */ 32 | private Long articleId; 33 | 34 | /** 35 | * 是否阅读:0-否,1-是 36 | */ 37 | private Integer isRead; 38 | 39 | /** 40 | * 阅读时间 41 | */ 42 | private Date readTime; 43 | 44 | /** 45 | * 是否点赞:0-否,1-是 46 | */ 47 | private Integer isLiked; 48 | 49 | /** 50 | * 点赞时间 51 | */ 52 | private Date likeTime; 53 | 54 | /** 55 | * 是否收藏:0-否,1-是 56 | */ 57 | private Integer isCollected; 58 | 59 | /** 60 | * 收藏时间 61 | */ 62 | private Date collectTime; 63 | 64 | /** 65 | * 评论内容 66 | */ 67 | private String commentContent; 68 | 69 | /** 70 | * 评论时间 71 | */ 72 | private Date commentTime; 73 | 74 | /** 75 | * 创建时间 76 | */ 77 | private Date createTime; 78 | 79 | /** 80 | * 更新时间 81 | */ 82 | private Date updateTime; 83 | 84 | @TableField(exist = false) 85 | private static final long serialVersionUID = 1L; 86 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/entity/UserLevel.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | import lombok.Data; 10 | 11 | /** 12 | * 用户等级 13 | * @TableName user_level 14 | */ 15 | @TableName(value ="user_level") 16 | @Data 17 | public class UserLevel implements Serializable { 18 | /** 19 | * id 20 | */ 21 | @TableId(type = IdType.AUTO) 22 | private Long id; 23 | 24 | /** 25 | * 等级数值 26 | */ 27 | private Integer level; 28 | 29 | /** 30 | * 等级名称 31 | */ 32 | private String levelName; 33 | 34 | /** 35 | * 等级图标URL 36 | */ 37 | private String iconUrl; 38 | 39 | /** 40 | * 最小经验值 41 | */ 42 | private Integer minExperience; 43 | 44 | /** 45 | * 最大经验值 46 | */ 47 | private Integer maxExperience; 48 | 49 | /** 50 | * 等级描述 51 | */ 52 | private String description; 53 | 54 | /** 55 | * 等级特权,JSON格式 56 | */ 57 | private String privileges; 58 | 59 | /** 60 | * 创建时间 61 | */ 62 | private Date createTime; 63 | 64 | /** 65 | * 更新时间 66 | */ 67 | private Date updateTime; 68 | 69 | /** 70 | * 是否删除 71 | */ 72 | private Integer isDelete; 73 | 74 | @TableField(exist = false) 75 | private static final long serialVersionUID = 1L; 76 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/enums/FileUploadBizEnum.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.enums; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | import java.util.stream.Collectors; 6 | import org.apache.commons.lang3.ObjectUtils; 7 | 8 | /** 9 | * 文件上传业务类型枚举 10 | */ 11 | public enum FileUploadBizEnum { 12 | 13 | USER_AVATAR("用户头像", "user_avatar"), 14 | VIDEO("课程视频", "course_video"), 15 | DOCUMENT("课程文档", "course_document"), 16 | MATERIAL("课程资料", "course_material"); 17 | 18 | 19 | private final String text; 20 | 21 | private final String value; 22 | 23 | FileUploadBizEnum(String text, String value) { 24 | this.text = text; 25 | this.value = value; 26 | } 27 | 28 | /** 29 | * 获取值列表 30 | * 31 | * @return 32 | */ 33 | public static List getValues() { 34 | return Arrays.stream(values()).map(item -> item.value).collect(Collectors.toList()); 35 | } 36 | 37 | /** 38 | * 根据 value 获取枚举 39 | * 40 | * @param value 41 | * @return 42 | */ 43 | public static FileUploadBizEnum getEnumByValue(String value) { 44 | if (ObjectUtils.isEmpty(value)) { 45 | return null; 46 | } 47 | for (FileUploadBizEnum anEnum : FileUploadBizEnum.values()) { 48 | if (anEnum.value.equals(value)) { 49 | return anEnum; 50 | } 51 | } 52 | return null; 53 | } 54 | 55 | public String getValue() { 56 | return value; 57 | } 58 | 59 | public String getText() { 60 | return text; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/enums/UserGenderEnum.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.enums; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | import java.util.stream.Collectors; 6 | import org.apache.commons.lang3.ObjectUtils; 7 | 8 | /** 9 | * 用户性别枚举 10 | */ 11 | public enum UserGenderEnum { 12 | 13 | MALE("男", 0), 14 | FEMALE("女", 1), 15 | SECRET("保密", 2); 16 | 17 | private final String text; 18 | 19 | private final Integer value; 20 | 21 | UserGenderEnum(String text, Integer value) { 22 | this.text = text; 23 | this.value = value; 24 | } 25 | 26 | /** 27 | * 获取值列表 28 | * 29 | * @return 30 | */ 31 | public static List getValues() { 32 | return Arrays.stream(values()).map(item -> item.value).collect(Collectors.toList()); 33 | } 34 | 35 | /** 36 | * 根据 value 获取枚举 37 | * 38 | * @param value 39 | * @return 40 | */ 41 | public static UserGenderEnum getEnumByValue(Integer value) { 42 | if (ObjectUtils.isEmpty(value)) { 43 | return null; 44 | } 45 | for (UserGenderEnum anEnum : UserGenderEnum.values()) { 46 | if (anEnum.value.equals(value)) { 47 | return anEnum; 48 | } 49 | } 50 | return null; 51 | } 52 | 53 | public Integer getValue() { 54 | return value; 55 | } 56 | 57 | public String getText() { 58 | return text; 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/enums/UserRoleEnum.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.enums; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | import java.util.stream.Collectors; 6 | import org.apache.commons.lang3.ObjectUtils; 7 | 8 | /** 9 | * 用户角色枚举 10 | */ 11 | public enum UserRoleEnum { 12 | 13 | USER("用户", "student"), 14 | TEACHER("教师", "teacher"), 15 | ADMIN("管理员", "admin"), 16 | BAN("被封号", "ban"); 17 | 18 | private final String text; 19 | 20 | private final String value; 21 | 22 | UserRoleEnum(String text, String value) { 23 | this.text = text; 24 | this.value = value; 25 | } 26 | 27 | /** 28 | * 获取值列表 29 | * 30 | * @return 31 | */ 32 | public static List getValues() { 33 | return Arrays.stream(values()).map(item -> item.value).collect(Collectors.toList()); 34 | } 35 | 36 | /** 37 | * 根据 value 获取枚举 38 | * 39 | * @param value 40 | * @return 41 | */ 42 | public static UserRoleEnum getEnumByValue(String value) { 43 | if (ObjectUtils.isEmpty(value)) { 44 | return null; 45 | } 46 | for (UserRoleEnum anEnum : UserRoleEnum.values()) { 47 | if (anEnum.value.equals(value)) { 48 | return anEnum; 49 | } 50 | } 51 | return null; 52 | } 53 | 54 | public String getValue() { 55 | return value; 56 | } 57 | 58 | public String getText() { 59 | return text; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/vo/AiAvatarBriefVO.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * AI分身简要信息视图对象 9 | */ 10 | @Data 11 | public class AiAvatarBriefVO implements Serializable { 12 | 13 | /** 14 | * id 15 | */ 16 | private Long id; 17 | 18 | /** 19 | * AI分身名称 20 | */ 21 | private String name; 22 | 23 | /** 24 | * AI分身头像URL 25 | */ 26 | private String avatarImgUrl; 27 | 28 | /** 29 | * AI分身描述 30 | */ 31 | private String description; 32 | 33 | /** 34 | * 标签,JSON数组格式 35 | */ 36 | private String tags; 37 | 38 | /** 39 | * 状态:0-禁用(离线),1-启用(在线) 40 | */ 41 | private Integer status; 42 | 43 | private static final long serialVersionUID = 1L; 44 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/vo/AnnouncementVO.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | 8 | /** 9 | * 系统公告视图 10 | */ 11 | @Data 12 | public class AnnouncementVO implements Serializable { 13 | 14 | /** 15 | * id 16 | */ 17 | private Long id; 18 | 19 | /** 20 | * 公告标题 21 | */ 22 | private String title; 23 | 24 | /** 25 | * 公告内容 26 | */ 27 | private String content; 28 | 29 | /** 30 | * 优先级,数字越大优先级越高 31 | */ 32 | private Integer priority; 33 | 34 | /** 35 | * 状态:0-草稿,1-已发布,2-已下线 36 | */ 37 | private Integer status; 38 | 39 | /** 40 | * 公告开始展示时间 41 | */ 42 | private Date startTime; 43 | 44 | /** 45 | * 公告结束展示时间 46 | */ 47 | private Date endTime; 48 | 49 | /** 50 | * 封面图片URL 51 | */ 52 | private String coverImage; 53 | 54 | /** 55 | * 查看次数 56 | */ 57 | private Integer viewCount; 58 | 59 | /** 60 | * 创建时间 61 | */ 62 | private Date createTime; 63 | 64 | /** 65 | * 是否已读(针对当前登录用户) 66 | */ 67 | private Boolean hasRead; 68 | 69 | private static final long serialVersionUID = 1L; 70 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/vo/ChatHistoryListVO.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | 8 | /** 9 | * 聊天历史列表视图对象 10 | */ 11 | @Data 12 | public class ChatHistoryListVO implements Serializable { 13 | 14 | /** 15 | * 会话ID 16 | */ 17 | private String sessionId; 18 | 19 | /** 20 | * AI分身ID 21 | */ 22 | private Long aiAvatarId; 23 | 24 | /** 25 | * AI分身名称 26 | */ 27 | private String aiAvatarName; 28 | 29 | /** 30 | * AI分身头像 31 | */ 32 | private String aiAvatarImgUrl; 33 | 34 | /** 35 | * 对话摘要 (最近的一条消息内容或会话标题) 36 | */ 37 | private String summary; 38 | 39 | /** 40 | * 消息内容 (最后一条对话内容) 41 | */ 42 | private String lastMessage; 43 | 44 | /** 45 | * 对话最后更新时间 46 | */ 47 | private Date lastUpdateTime; 48 | 49 | /** 50 | * 对话消息总数 51 | */ 52 | private Integer messageCount; 53 | 54 | private static final long serialVersionUID = 1L; 55 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/vo/ChatMessageVO.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | 8 | /** 9 | * 聊天消息视图对象 10 | */ 11 | @Data 12 | public class ChatMessageVO implements Serializable { 13 | 14 | /** 15 | * 消息ID 16 | */ 17 | private Long id; 18 | 19 | /** 20 | * 用户ID 21 | */ 22 | private Long userId; 23 | 24 | /** 25 | * 用户名称 26 | */ 27 | private String userName; 28 | 29 | /** 30 | * 用户头像 31 | */ 32 | private String userAvatar; 33 | 34 | /** 35 | * AI分身ID 36 | */ 37 | private Long aiAvatarId; 38 | 39 | /** 40 | * AI分身名称 41 | */ 42 | private String aiAvatarName; 43 | 44 | /** 45 | * AI分身头像 46 | */ 47 | private String aiAvatarImgUrl; 48 | 49 | /** 50 | * 会话ID 51 | */ 52 | private String sessionId; 53 | 54 | /** 55 | * 消息类型:user/ai 56 | */ 57 | private String messageType; 58 | 59 | /** 60 | * 消息内容 61 | */ 62 | private String content; 63 | 64 | /** 65 | * 消息token数 66 | */ 67 | private Integer tokens; 68 | 69 | /** 70 | * 创建时间 71 | */ 72 | private Date createTime; 73 | 74 | private static final long serialVersionUID = 1L; 75 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/vo/ChatSessionVO.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | 8 | /** 9 | * 聊天会话视图对象 10 | */ 11 | @Data 12 | public class ChatSessionVO implements Serializable { 13 | 14 | /** 15 | * 会话ID 16 | */ 17 | private String sessionId; 18 | 19 | /** 20 | * 会话名称 21 | */ 22 | private String sessionName; 23 | 24 | /** 25 | * AI分身ID 26 | */ 27 | private Long aiAvatarId; 28 | 29 | /** 30 | * AI分身名称 31 | */ 32 | private String aiAvatarName; 33 | 34 | /** 35 | * AI分身头像 36 | */ 37 | private String aiAvatarImgUrl; 38 | 39 | /** 40 | * 最后一条消息内容 41 | */ 42 | private String lastMessage; 43 | 44 | /** 45 | * 最后一条消息时间 46 | */ 47 | private Date lastMessageTime; 48 | 49 | /** 50 | * 会话消息数量 51 | */ 52 | private Integer messageCount; 53 | 54 | private static final long serialVersionUID = 1L; 55 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/vo/CourseReviewVO.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | 8 | /** 9 | * 课程评论视图对象 10 | */ 11 | @Data 12 | public class CourseReviewVO implements Serializable { 13 | 14 | /** 15 | * id 16 | */ 17 | private Long id; 18 | 19 | /** 20 | * 用户id 21 | */ 22 | private Long userId; 23 | 24 | /** 25 | * 用户昵称 26 | */ 27 | private String userName; 28 | 29 | /** 30 | * 用户头像 31 | */ 32 | private String userAvatar; 33 | 34 | /** 35 | * 课程id 36 | */ 37 | private Long courseId; 38 | 39 | /** 40 | * 课程标题 41 | */ 42 | private String courseTitle; 43 | 44 | /** 45 | * 内容 46 | */ 47 | private String content; 48 | 49 | /** 50 | * 评分 1-5 51 | */ 52 | private Integer rating; 53 | 54 | /** 55 | * 点赞数 56 | */ 57 | private Integer likeCount; 58 | 59 | /** 60 | * 回复数 61 | */ 62 | private Integer replyCount; 63 | 64 | /** 65 | * 管理员回复 66 | */ 67 | private String adminReply; 68 | 69 | /** 70 | * 管理员回复时间 71 | */ 72 | private Date adminReplyTime; 73 | 74 | /** 75 | * 状态(0-待审核, 1-已发布, 2-驳回) 76 | */ 77 | private Integer status; 78 | 79 | /** 80 | * 创建时间 81 | */ 82 | private Date createTime; 83 | 84 | /** 85 | * 更新时间 86 | */ 87 | private Date updateTime; 88 | 89 | private static final long serialVersionUID = 1L; 90 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/vo/DailyArticleVO.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.vo; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | import lombok.Data; 6 | 7 | /** 8 | * 每日文章视图 9 | */ 10 | @Data 11 | public class DailyArticleVO implements Serializable { 12 | 13 | /** 14 | * id 15 | */ 16 | private Long id; 17 | 18 | /** 19 | * 文章标题 20 | */ 21 | private String title; 22 | 23 | /** 24 | * 文章内容 25 | */ 26 | private String content; 27 | 28 | /** 29 | * 文章摘要 30 | */ 31 | private String summary; 32 | 33 | /** 34 | * 封面图片URL 35 | */ 36 | private String coverImage; 37 | 38 | /** 39 | * 作者 40 | */ 41 | private String author; 42 | 43 | /** 44 | * 来源 45 | */ 46 | private String source; 47 | 48 | /** 49 | * 原文链接 50 | */ 51 | private String sourceUrl; 52 | 53 | /** 54 | * 文章分类 55 | */ 56 | private String category; 57 | 58 | /** 59 | * 标签,JSON数组格式 60 | */ 61 | private String tags; 62 | 63 | /** 64 | * 难度等级:1-简单,2-中等,3-困难 65 | */ 66 | private Integer difficulty; 67 | 68 | /** 69 | * 预计阅读时间(分钟) 70 | */ 71 | private Integer readTime; 72 | 73 | /** 74 | * 发布日期 75 | */ 76 | private Date publishDate; 77 | 78 | /** 79 | * 查看次数 80 | */ 81 | private Integer viewCount; 82 | 83 | /** 84 | * 点赞次数 85 | */ 86 | private Integer likeCount; 87 | 88 | /** 89 | * 创建时间 90 | */ 91 | private Date createTime; 92 | 93 | private static final long serialVersionUID = 1L; 94 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/vo/DailyWordVO.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.vo; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | import lombok.Data; 6 | 7 | /** 8 | * 每日单词视图 9 | */ 10 | @Data 11 | public class DailyWordVO implements Serializable { 12 | 13 | /** 14 | * id 15 | */ 16 | private Long id; 17 | 18 | /** 19 | * 单词 20 | */ 21 | private String word; 22 | 23 | /** 24 | * 音标 25 | */ 26 | private String pronunciation; 27 | 28 | /** 29 | * 发音音频URL 30 | */ 31 | private String audioUrl; 32 | 33 | /** 34 | * 翻译 35 | */ 36 | private String translation; 37 | 38 | /** 39 | * 例句 40 | */ 41 | private String example; 42 | 43 | /** 44 | * 例句翻译 45 | */ 46 | private String exampleTranslation; 47 | 48 | /** 49 | * 难度等级:1-简单,2-中等,3-困难 50 | */ 51 | private Integer difficulty; 52 | 53 | /** 54 | * 单词分类 55 | */ 56 | private String category; 57 | 58 | /** 59 | * 单词笔记或补充说明 60 | */ 61 | private String notes; 62 | 63 | /** 64 | * 发布日期 65 | */ 66 | private Date publishDate; 67 | 68 | /** 69 | * 点赞次数 70 | */ 71 | private Integer likeCount; 72 | 73 | /** 74 | * 创建时间 75 | */ 76 | private Date createTime; 77 | 78 | private static final long serialVersionUID = 1L; 79 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/vo/LoginUserVO.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.vo; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | import lombok.Data; 6 | 7 | /** 8 | * 已登录用户视图(脱敏) 9 | * 10 | 11 | **/ 12 | @Data 13 | public class LoginUserVO implements Serializable { 14 | 15 | /** 16 | * 用户 id 17 | */ 18 | private Long id; 19 | 20 | /** 21 | * 用户昵称 22 | */ 23 | private String userName; 24 | 25 | /** 26 | * 用户头像 27 | */ 28 | private String userAvatar; 29 | 30 | /** 31 | * 用户简介 32 | */ 33 | private String userProfile; 34 | 35 | /** 36 | * 用户角色:user/admin/ban 37 | */ 38 | private String userRole; 39 | 40 | /** 41 | * 创建时间 42 | */ 43 | private Date createTime; 44 | 45 | /** 46 | * 更新时间 47 | */ 48 | private Date updateTime; 49 | 50 | private static final long serialVersionUID = 1L; 51 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/vo/TeacherVO.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.vo; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | import lombok.Data; 6 | 7 | /** 8 | * 讲师视图(脱敏) 9 | */ 10 | @Data 11 | public class TeacherVO implements Serializable { 12 | 13 | /** 14 | * id 15 | */ 16 | private Long id; 17 | 18 | /** 19 | * 讲师姓名 20 | */ 21 | private String name; 22 | 23 | /** 24 | * 讲师头像URL 25 | */ 26 | private String avatar; 27 | 28 | /** 29 | * 讲师职称 30 | */ 31 | private String title; 32 | 33 | /** 34 | * 讲师简介 35 | */ 36 | private String introduction; 37 | 38 | /** 39 | * 专业领域,JSON数组格式 40 | */ 41 | private String expertise; 42 | 43 | /** 44 | * 关联的用户信息,如果讲师也是平台用户 45 | */ 46 | private UserVO userVO; 47 | 48 | /** 49 | * 课程数量 50 | */ 51 | private Integer courseCount; 52 | 53 | /** 54 | * 学生数量 55 | */ 56 | private Integer studentCount; 57 | 58 | /** 59 | * 平均评分 60 | */ 61 | private Double averageRating; 62 | 63 | /** 64 | * 创建时间 65 | */ 66 | private Date createTime; 67 | 68 | private static final long serialVersionUID = 1L; 69 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/vo/UserAiAvatarVO.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.math.BigDecimal; 7 | import java.util.Date; 8 | 9 | /** 10 | * 用户AI分身关联视图对象 11 | */ 12 | @Data 13 | public class UserAiAvatarVO implements Serializable { 14 | 15 | /** 16 | * id 17 | */ 18 | private Long id; 19 | 20 | /** 21 | * 用户id 22 | */ 23 | private Long userId; 24 | 25 | /** 26 | * 用户名称 27 | */ 28 | private String userName; 29 | 30 | /** 31 | * 用户头像 32 | */ 33 | private String userAvatar; 34 | 35 | /** 36 | * AI分身id 37 | */ 38 | private Long aiAvatarId; 39 | 40 | /** 41 | * AI分身名称 42 | */ 43 | private String aiAvatarName; 44 | 45 | /** 46 | * AI分身头像URL 47 | */ 48 | private String aiAvatarImgUrl; 49 | 50 | /** 51 | * AI分身描述 52 | */ 53 | private String aiAvatarDescription; 54 | 55 | /** 56 | * 是否收藏:0-否,1-是 57 | */ 58 | private Integer isFavorite; 59 | 60 | /** 61 | * 最后使用时间 62 | */ 63 | private Date lastUseTime; 64 | 65 | /** 66 | * 使用次数 67 | */ 68 | private Integer useCount; 69 | 70 | /** 71 | * 用户评分,1-5分 72 | */ 73 | private BigDecimal userRating; 74 | 75 | /** 76 | * 用户反馈 77 | */ 78 | private String userFeedback; 79 | 80 | /** 81 | * 用户自定义设置,JSON格式 82 | */ 83 | private String customSettings; 84 | 85 | /** 86 | * 创建时间 87 | */ 88 | private Date createTime; 89 | 90 | /** 91 | * 更新时间 92 | */ 93 | private Date updateTime; 94 | 95 | private static final long serialVersionUID = 1L; 96 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/vo/UserLevelVO.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.vo; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | import lombok.Data; 6 | 7 | /** 8 | * 用户等级视图 9 | */ 10 | @Data 11 | public class UserLevelVO implements Serializable { 12 | 13 | /** 14 | * id 15 | */ 16 | private Long id; 17 | 18 | /** 19 | * 等级数值 20 | */ 21 | private Integer level; 22 | 23 | /** 24 | * 等级名称 25 | */ 26 | private String levelName; 27 | 28 | /** 29 | * 等级图标URL 30 | */ 31 | private String iconUrl; 32 | 33 | /** 34 | * 最小经验值 35 | */ 36 | private Integer minExperience; 37 | 38 | /** 39 | * 最大经验值 40 | */ 41 | private Integer maxExperience; 42 | 43 | /** 44 | * 等级描述 45 | */ 46 | private String description; 47 | 48 | /** 49 | * 等级特权,JSON格式 50 | */ 51 | private String privileges; 52 | 53 | /** 54 | * 创建时间 55 | */ 56 | private Date createTime; 57 | 58 | /** 59 | * 更新时间 60 | */ 61 | private Date updateTime; 62 | 63 | private static final long serialVersionUID = 1L; 64 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/model/vo/UserVO.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.model.vo; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | import lombok.Data; 6 | 7 | /** 8 | * 用户视图(脱敏) 9 | */ 10 | @Data 11 | public class UserVO implements Serializable { 12 | 13 | /** 14 | * id 15 | */ 16 | private Long id; 17 | /** 18 | * 用户手机号 19 | */ 20 | private String userPhone; 21 | 22 | /** 23 | * 用户昵称 24 | */ 25 | private String userName; 26 | 27 | /** 28 | * 用户头像 29 | */ 30 | private String userAvatar; 31 | 32 | /** 33 | * 用户简介 34 | */ 35 | private String userProfile; 36 | 37 | /** 38 | * 用户角色:user/admin/ban 39 | */ 40 | private String userRole; 41 | 42 | /** 43 | * 创建时间 44 | */ 45 | private Date createTime; 46 | 47 | private static final long serialVersionUID = 1L; 48 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/service/AchievementService.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.service; 2 | 3 | import com.ubanillx.smartclass.model.entity.Achievement; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | /** 7 | * @author liulo 8 | * @description 针对表【achievement(成就定义)】的数据库操作Service 9 | * @createDate 2025-03-18 23:08:38 10 | */ 11 | public interface AchievementService extends IService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/service/AiAvatarService.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.service; 2 | 3 | import com.ubanillx.smartclass.model.entity.AiAvatar; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | import com.ubanillx.smartclass.model.vo.AiAvatarBriefVO; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @author liulo 11 | * @description 针对表【ai_avatar(AI分身)】的数据库操作Service 12 | * @createDate 2025-03-18 23:08:38 13 | */ 14 | public interface AiAvatarService extends IService { 15 | 16 | /** 17 | * 获取所有AI分身的简要信息列表 18 | * 19 | * @return AI分身简要信息列表 20 | */ 21 | List listAllAiAvatarBrief(); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/service/CourseCategoryService.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.service; 2 | 3 | import com.ubanillx.smartclass.model.entity.CourseCategory; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author liulo 10 | * @description 针对表【course_category(课程分类)】的数据库操作Service 11 | * @createDate 2025-03-21 15:14:50 12 | */ 13 | public interface CourseCategoryService extends IService { 14 | 15 | /** 16 | * 添加课程分类 17 | * 18 | * @param courseCategory 课程分类 19 | * @param adminId 管理员ID 20 | * @return 分类ID 21 | */ 22 | long addCourseCategory(CourseCategory courseCategory, Long adminId); 23 | 24 | /** 25 | * 获取一级分类列表 26 | * 27 | * @return 一级分类列表 28 | */ 29 | List getTopCategories(); 30 | 31 | /** 32 | * 获取子分类 33 | * 34 | * @param parentId 父分类ID 35 | * @return 子分类列表 36 | */ 37 | List getSubCategories(Long parentId); 38 | 39 | /** 40 | * 获取分类及其子分类 41 | * 42 | * @param categoryId 分类ID 43 | * @return 分类及其子分类列表 44 | */ 45 | List getCategoryWithChildren(Long categoryId); 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/service/CourseChapterService.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.service; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | import com.ubanillx.smartclass.model.entity.CourseChapter; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @author liulo 11 | * @description 针对表【course_chapter(课程章节)】的数据库操作Service 12 | * @createDate 2025-03-21 15:14:50 13 | */ 14 | public interface CourseChapterService extends IService { 15 | 16 | /** 17 | * 根据课程ID获取章节列表 18 | * 19 | * @param courseId 课程ID 20 | * @return 章节列表 21 | */ 22 | List getChaptersByCourseId(Long courseId); 23 | 24 | /** 25 | * 添加课程章节 26 | * 27 | * @param courseChapter 课程章节 28 | * @param adminId 管理员ID 29 | * @return 章节ID 30 | */ 31 | long addCourseChapter(CourseChapter courseChapter, Long adminId); 32 | 33 | /** 34 | * 校验课程章节 35 | * 36 | * @param courseChapter 课程章节 37 | * @param add 是否为添加操作 38 | */ 39 | void validCourseChapter(CourseChapter courseChapter, boolean add); 40 | 41 | /** 42 | * 获取查询条件 43 | * 44 | * @param courseId 课程ID 45 | * @return 查询条件 46 | */ 47 | QueryWrapper getQueryWrapper(Long courseId); 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/service/CourseFavouriteService.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.service; 2 | 3 | import com.ubanillx.smartclass.model.entity.CourseFavourite; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author liulo 10 | * @description 针对表【course_favourite(课程收藏)】的数据库操作Service 11 | * @createDate 2025-03-21 15:14:50 12 | */ 13 | public interface CourseFavouriteService extends IService { 14 | 15 | /** 16 | * 收藏课程 17 | * 18 | * @param userId 用户ID 19 | * @param courseId 课程ID 20 | * @return 收藏记录ID 21 | */ 22 | long favourCourse(Long userId, Long courseId); 23 | 24 | /** 25 | * 取消收藏 26 | * 27 | * @param userId 用户ID 28 | * @param courseId 课程ID 29 | * @return 是否成功 30 | */ 31 | boolean unfavourCourse(Long userId, Long courseId); 32 | 33 | /** 34 | * 判断用户是否收藏课程 35 | * 36 | * @param userId 用户ID 37 | * @param courseId 课程ID 38 | * @return 是否收藏 39 | */ 40 | boolean hasFavoured(Long userId, Long courseId); 41 | 42 | /** 43 | * 获取用户收藏的课程ID列表 44 | * 45 | * @param userId 用户ID 46 | * @return 课程ID列表 47 | */ 48 | List getUserFavouriteCourseIds(Long userId); 49 | 50 | /** 51 | * 获取用户收藏的课程数量 52 | * 53 | * @param userId 用户ID 54 | * @return 收藏数量 55 | */ 56 | long getUserFavouriteCount(Long userId); 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/service/CourseMaterialService.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.service; 2 | 3 | import com.ubanillx.smartclass.model.entity.CourseMaterial; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @author liulo 11 | * @description 针对表【course_material(课程资料)】的数据库操作Service 12 | * @createDate 2025-03-21 15:14:50 13 | */ 14 | public interface CourseMaterialService extends IService { 15 | 16 | /** 17 | * 添加课程资料 18 | * 19 | * @param courseMaterial 课程资料 20 | * @param adminId 管理员ID 21 | * @return 资料ID 22 | */ 23 | long addCourseMaterial(CourseMaterial courseMaterial, Long adminId); 24 | 25 | /** 26 | * 根据课程ID获取资料列表 27 | * 28 | * @param courseId 课程ID 29 | * @return 资料列表 30 | */ 31 | List getMaterialsByCourseId(Long courseId); 32 | 33 | /** 34 | * 分页获取课程资料 35 | * 36 | * @param courseId 课程ID 37 | * @param current 当前页码 38 | * @param size 页面大小 39 | * @return 分页结果 40 | */ 41 | Page listMaterialsByPage(Long courseId, long current, long size); 42 | 43 | /** 44 | * 增加资料下载次数 45 | * 46 | * @param materialId 资料ID 47 | * @return 是否成功 48 | */ 49 | boolean incrementDownloadCount(Long materialId); 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/service/DailyArticleFavourService.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.service; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.Wrapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.baomidou.mybatisplus.extension.service.IService; 7 | import com.ubanillx.smartclass.model.entity.DailyArticle; 8 | import com.ubanillx.smartclass.model.entity.User; 9 | import com.ubanillx.smartclass.model.entity.UserDailyArticle; 10 | import com.ubanillx.smartclass.model.vo.DailyArticleVO; 11 | 12 | /** 13 | * 每日文章收藏服务 14 | */ 15 | public interface DailyArticleFavourService extends IService { 16 | 17 | /** 18 | * 收藏/取消收藏每日文章 19 | * 20 | * @param articleId 21 | * @param loginUser 22 | * @return 1-收藏,-1-取消收藏,0-失败 23 | */ 24 | int doArticleFavour(long articleId, User loginUser); 25 | 26 | /** 27 | * 分页获取用户收藏的每日文章列表 28 | * 29 | * @param page 30 | * @param queryWrapper 31 | * @param favourUserId 32 | * @return 33 | */ 34 | Page listFavourArticleByPage(IPage page, Wrapper queryWrapper, 35 | long favourUserId); 36 | 37 | /** 38 | * 判断用户是否收藏了文章 39 | * 40 | * @param articleId 41 | * @param userId 42 | * @return 43 | */ 44 | boolean isFavourArticle(long articleId, long userId); 45 | 46 | /** 47 | * 收藏/取消收藏每日文章(内部事务方法) 48 | * 49 | * @param userId 50 | * @param articleId 51 | * @return 1-收藏,-1-取消收藏,0-失败 52 | */ 53 | int doArticleFavourInner(long userId, long articleId); 54 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/service/DailyArticleThumbService.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.ubanillx.smartclass.model.entity.DailyArticle; 5 | import com.ubanillx.smartclass.model.entity.User; 6 | import com.ubanillx.smartclass.model.entity.UserDailyArticle; 7 | 8 | /** 9 | * 每日文章点赞服务 10 | */ 11 | public interface DailyArticleThumbService extends IService { 12 | 13 | /** 14 | * 点赞/取消点赞文章 15 | * 16 | * @param articleId 17 | * @param loginUser 18 | * @return 1-点赞,-1-取消点赞,0-失败 19 | */ 20 | int doArticleThumb(long articleId, User loginUser); 21 | 22 | /** 23 | * 文章点赞(内部事务方法) 24 | * 25 | * @param userId 26 | * @param articleId 27 | * @return 1-点赞,-1-取消点赞,0-失败 28 | */ 29 | int doArticleThumbInner(long userId, long articleId); 30 | 31 | /** 32 | * 判断用户是否点赞了文章 33 | * 34 | * @param articleId 35 | * @param userId 36 | * @return 37 | */ 38 | boolean isThumbArticle(long articleId, long userId); 39 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/service/DailyWordThumbService.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.ubanillx.smartclass.model.entity.User; 5 | import com.ubanillx.smartclass.model.entity.UserDailyWord; 6 | 7 | /** 8 | * 每日单词点赞服务 9 | */ 10 | public interface DailyWordThumbService extends IService { 11 | 12 | /** 13 | * 点赞/取消点赞单词 14 | * 15 | * @param wordId 16 | * @param loginUser 17 | * @return 1-点赞,-1-取消点赞,0-失败 18 | */ 19 | int doWordThumb(long wordId, User loginUser); 20 | 21 | /** 22 | * 单词点赞(内部事务方法) 23 | * 24 | * @param userId 25 | * @param wordId 26 | * @return 1-点赞,-1-取消点赞,0-失败 27 | */ 28 | int doWordThumbInner(long userId, long wordId); 29 | 30 | /** 31 | * 判断用户是否点赞了单词 32 | * 33 | * @param wordId 34 | * @param userId 35 | * @return 36 | */ 37 | boolean isThumbWord(long wordId, long userId); 38 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/service/PostFavourService.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.service; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.Wrapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.baomidou.mybatisplus.extension.service.IService; 7 | import com.ubanillx.smartclass.model.entity.Post; 8 | import com.ubanillx.smartclass.model.entity.PostFavour; 9 | import com.ubanillx.smartclass.model.entity.User; 10 | 11 | /** 12 | * 帖子收藏服务 13 | */ 14 | public interface PostFavourService extends IService { 15 | 16 | /** 17 | * 帖子收藏 18 | * 19 | * @param postId 20 | * @param loginUser 21 | * @return 22 | */ 23 | int doPostFavour(long postId, User loginUser); 24 | 25 | /** 26 | * 分页获取用户收藏的帖子列表 27 | * 28 | * @param page 29 | * @param queryWrapper 30 | * @param favourUserId 31 | * @return 32 | */ 33 | Page listFavourPostByPage(IPage page, Wrapper queryWrapper, 34 | long favourUserId); 35 | 36 | /** 37 | * 帖子收藏(内部服务) 38 | * 39 | * @param userId 40 | * @param postId 41 | * @return 42 | */ 43 | int doPostFavourInner(long userId, long postId); 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/service/PostService.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.service; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.baomidou.mybatisplus.extension.service.IService; 6 | import com.ubanillx.smartclass.model.dto.post.PostQueryRequest; 7 | import com.ubanillx.smartclass.model.entity.Post; 8 | import com.ubanillx.smartclass.model.vo.PostVO; 9 | import javax.servlet.http.HttpServletRequest; 10 | 11 | /** 12 | * 帖子服务 13 | */ 14 | public interface PostService extends IService { 15 | 16 | /** 17 | * 校验 18 | * 19 | * @param post 20 | * @param add 21 | */ 22 | void validPost(Post post, boolean add); 23 | 24 | /** 25 | * 获取查询条件 26 | * 27 | * @param postQueryRequest 28 | * @return 29 | */ 30 | QueryWrapper getQueryWrapper(PostQueryRequest postQueryRequest); 31 | 32 | /** 33 | * 从 ES 查询 34 | * 35 | * @param postQueryRequest 36 | * @return 37 | */ 38 | Page searchFromEs(PostQueryRequest postQueryRequest); 39 | 40 | /** 41 | * 获取帖子封装 42 | * 43 | * @param post 44 | * @param request 45 | * @return 46 | */ 47 | PostVO getPostVO(Post post, HttpServletRequest request); 48 | 49 | /** 50 | * 分页获取帖子封装 51 | * 52 | * @param postPage 53 | * @param request 54 | * @return 55 | */ 56 | Page getPostVOPage(Page postPage, HttpServletRequest request); 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/service/PostThumbService.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.service; 2 | 3 | import com.ubanillx.smartclass.model.entity.PostThumb; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | import com.ubanillx.smartclass.model.entity.User; 6 | 7 | /** 8 | * 帖子点赞服务 9 | */ 10 | public interface PostThumbService extends IService { 11 | 12 | /** 13 | * 点赞 14 | * 15 | * @param postId 16 | * @param loginUser 17 | * @return 18 | */ 19 | int doPostThumb(long postId, User loginUser); 20 | 21 | /** 22 | * 帖子点赞(内部服务) 23 | * 24 | * @param userId 25 | * @param postId 26 | * @return 27 | */ 28 | int doPostThumbInner(long userId, long postId); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/service/UserAnnouncementReaderService.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.service; 2 | 3 | import com.ubanillx.smartclass.model.entity.UserAnnouncementReader; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | /** 7 | * @author liulo 8 | * @description 针对表【user_announcement_reader(用户公告阅读记录)】的数据库操作Service 9 | * @createDate 2025-03-20 15:14:27 10 | */ 11 | public interface UserAnnouncementReaderService extends IService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/service/UserArticleRecordService.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.service; 2 | 3 | import com.ubanillx.smartclass.model.dto.UserArticleRecord; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | /** 7 | * @author liulo 8 | * @description 针对表【user_article_record(用户文章阅读记录)】的数据库操作Service 9 | * @createDate 2025-03-20 14:36:38 10 | */ 11 | public interface UserArticleRecordService extends IService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/service/UserDailyArticleService.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.ubanillx.smartclass.model.entity.UserDailyArticle; 5 | 6 | /** 7 | * @author liulo 8 | * @description 针对表【user_daily_article(用户与每日文章关联)】的数据库操作Service 9 | * @createDate 2025-03-20 14:25:20 10 | */ 11 | public interface UserDailyArticleService extends IService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/service/UserDailyWordService.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.ubanillx.smartclass.model.entity.UserDailyWord; 5 | 6 | /** 7 | * 用户与每日单词关联服务 8 | */ 9 | public interface UserDailyWordService extends IService { 10 | 11 | /** 12 | * 标记单词为已学习 13 | * 14 | * @param wordId 15 | * @param userId 16 | * @return 17 | */ 18 | boolean markWordAsStudied(long wordId, long userId); 19 | 20 | /** 21 | * 更新单词掌握程度 22 | * 23 | * @param wordId 24 | * @param userId 25 | * @param masteryLevel 26 | * @return 27 | */ 28 | boolean updateMasteryLevel(long wordId, long userId, int masteryLevel); 29 | 30 | /** 31 | * 保存单词学习笔记 32 | * 33 | * @param wordId 34 | * @param userId 35 | * @param noteContent 36 | * @return 37 | */ 38 | boolean saveWordNote(long wordId, long userId, String noteContent); 39 | 40 | /** 41 | * 获取用户单词学习记录 42 | * 43 | * @param wordId 44 | * @param userId 45 | * @return 46 | */ 47 | UserDailyWord getUserDailyWord(long wordId, long userId); 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/service/impl/AiAvatarServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.service.impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 5 | import com.ubanillx.smartclass.model.entity.AiAvatar; 6 | import com.ubanillx.smartclass.mapper.AiAvatarMapper; 7 | import com.ubanillx.smartclass.model.vo.AiAvatarBriefVO; 8 | import com.ubanillx.smartclass.service.AiAvatarService; 9 | import org.springframework.beans.BeanUtils; 10 | import org.springframework.stereotype.Service; 11 | 12 | import java.util.List; 13 | import java.util.stream.Collectors; 14 | 15 | /** 16 | * @author liulo 17 | * @description 针对表【ai_avatar(AI分身)】的数据库操作Service实现 18 | * @createDate 2025-03-18 23:08:38 19 | */ 20 | @Service 21 | public class AiAvatarServiceImpl extends ServiceImpl 22 | implements AiAvatarService { 23 | 24 | @Override 25 | public List listAllAiAvatarBrief() { 26 | // 查询所有未删除且已启用的AI分身 27 | QueryWrapper queryWrapper = new QueryWrapper<>(); 28 | queryWrapper.eq("isDelete", 0) 29 | .orderByAsc("sort"); // 按排序字段升序排列 30 | 31 | List aiAvatarList = this.list(queryWrapper); 32 | 33 | // 转换为简要视图对象 34 | return aiAvatarList.stream().map(aiAvatar -> { 35 | AiAvatarBriefVO briefVO = new AiAvatarBriefVO(); 36 | BeanUtils.copyProperties(aiAvatar, briefVO); 37 | return briefVO; 38 | }).collect(Collectors.toList()); 39 | } 40 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/utils/NetUtils.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.utils; 2 | 3 | import java.net.InetAddress; 4 | import javax.servlet.http.HttpServletRequest; 5 | 6 | /** 7 | * 网络工具类 8 | */ 9 | public class NetUtils { 10 | 11 | /** 12 | * 获取客户端 IP 地址 13 | * 14 | * @param request 15 | * @return 16 | */ 17 | public static String getIpAddress(HttpServletRequest request) { 18 | String ip = request.getHeader("x-forwarded-for"); 19 | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { 20 | ip = request.getHeader("Proxy-Client-IP"); 21 | } 22 | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { 23 | ip = request.getHeader("WL-Proxy-Client-IP"); 24 | } 25 | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { 26 | ip = request.getRemoteAddr(); 27 | if (ip.equals("127.0.0.1")) { 28 | // 根据网卡取本机配置的 IP 29 | InetAddress inet = null; 30 | try { 31 | inet = InetAddress.getLocalHost(); 32 | } catch (Exception e) { 33 | e.printStackTrace(); 34 | } 35 | if (inet != null) { 36 | ip = inet.getHostAddress(); 37 | } 38 | } 39 | } 40 | // 多个代理的情况,第一个IP为客户端真实IP,多个IP按照','分割 41 | if (ip != null && ip.length() > 15) { 42 | if (ip.indexOf(",") > 0) { 43 | ip = ip.substring(0, ip.indexOf(",")); 44 | } 45 | } 46 | if (ip == null) { 47 | return "127.0.0.1"; 48 | } 49 | return ip; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/utils/SpringContextUtils.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.utils; 2 | 3 | import org.jetbrains.annotations.NotNull; 4 | import org.springframework.beans.BeansException; 5 | import org.springframework.context.ApplicationContext; 6 | import org.springframework.context.ApplicationContextAware; 7 | import org.springframework.stereotype.Component; 8 | 9 | /** 10 | * Spring 上下文获取工具 11 | */ 12 | @Component 13 | public class SpringContextUtils implements ApplicationContextAware { 14 | 15 | private static ApplicationContext applicationContext; 16 | 17 | @Override 18 | public void setApplicationContext(@NotNull ApplicationContext applicationContext) throws BeansException { 19 | SpringContextUtils.applicationContext = applicationContext; 20 | } 21 | 22 | /** 23 | * 通过名称获取 Bean 24 | * 25 | * @param beanName 26 | * @return 27 | */ 28 | public static Object getBean(String beanName) { 29 | return applicationContext.getBean(beanName); 30 | } 31 | 32 | /** 33 | * 通过 class 获取 Bean 34 | * 35 | * @param beanClass 36 | * @param 37 | * @return 38 | */ 39 | public static T getBean(Class beanClass) { 40 | return applicationContext.getBean(beanClass); 41 | } 42 | 43 | /** 44 | * 通过名称和类型获取 Bean 45 | * 46 | * @param beanName 47 | * @param beanClass 48 | * @param 49 | * @return 50 | */ 51 | public static T getBean(String beanName, Class beanClass) { 52 | return applicationContext.getBean(beanName, beanClass); 53 | } 54 | } -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/utils/SqlUtils.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.utils; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import org.apache.commons.lang3.StringUtils; 5 | 6 | /** 7 | * SQL 工具 8 | */ 9 | public class SqlUtils { 10 | 11 | /** 12 | * 校验排序字段是否合法(防止 SQL 注入) 13 | * 14 | * @param sortField 15 | * @return 16 | */ 17 | public static boolean validSortField(String sortField) { 18 | if (StringUtils.isBlank(sortField)) { 19 | return false; 20 | } 21 | return !StringUtils.containsAny(sortField, "=", "(", ")", " "); 22 | } 23 | 24 | /** 25 | * 设置默认排序 26 | * 27 | * @param queryWrapper 查询条件 28 | * @param sortField 排序字段 29 | * @param sortOrder 排序顺序 30 | * @param 查询实体类型 31 | */ 32 | public static void setDefaultOrder(QueryWrapper queryWrapper, String sortField, String sortOrder) { 33 | if (SqlUtils.validSortField(sortField)) { 34 | queryWrapper.orderBy(true, "asc".equalsIgnoreCase(sortOrder), sortField); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/wxmp/WxMpConstant.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.wxmp; 2 | 3 | /** 4 | * 微信公众号相关常量 5 | * 6 | 7 | **/ 8 | public class WxMpConstant { 9 | 10 | /** 11 | * 点击菜单 key 12 | */ 13 | public static final String CLICK_MENU_KEY = "CLICK_MENU_KEY"; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/wxmp/handler/EventHandler.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.wxmp.handler; 2 | 3 | import java.util.Map; 4 | import me.chanjar.weixin.common.error.WxErrorException; 5 | import me.chanjar.weixin.common.session.WxSessionManager; 6 | import me.chanjar.weixin.mp.api.WxMpMessageHandler; 7 | import me.chanjar.weixin.mp.api.WxMpService; 8 | import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; 9 | import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; 10 | import org.springframework.stereotype.Component; 11 | 12 | /** 13 | * 事件处理器 14 | * 15 | 16 | **/ 17 | @Component 18 | public class EventHandler implements WxMpMessageHandler { 19 | 20 | @Override 21 | public WxMpXmlOutMessage handle(WxMpXmlMessage wxMpXmlMessage, Map map, WxMpService wxMpService, 22 | WxSessionManager wxSessionManager) throws WxErrorException { 23 | final String content = "您点击了菜单"; 24 | // 调用接口,返回验证码 25 | return WxMpXmlOutMessage.TEXT().content(content) 26 | .fromUser(wxMpXmlMessage.getToUser()) 27 | .toUser(wxMpXmlMessage.getFromUser()) 28 | .build(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/wxmp/handler/MessageHandler.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.wxmp.handler; 2 | 3 | import java.util.Map; 4 | import me.chanjar.weixin.common.error.WxErrorException; 5 | import me.chanjar.weixin.common.session.WxSessionManager; 6 | import me.chanjar.weixin.mp.api.WxMpMessageHandler; 7 | import me.chanjar.weixin.mp.api.WxMpService; 8 | import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; 9 | import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; 10 | import org.springframework.stereotype.Component; 11 | 12 | /** 13 | * 消息处理器 14 | * 15 | 16 | **/ 17 | @Component 18 | public class MessageHandler implements WxMpMessageHandler { 19 | 20 | @Override 21 | public WxMpXmlOutMessage handle(WxMpXmlMessage wxMpXmlMessage, Map map, 22 | WxMpService wxMpService, WxSessionManager wxSessionManager) throws WxErrorException { 23 | String content = "我是复读机:" + wxMpXmlMessage.getContent(); 24 | return WxMpXmlOutMessage.TEXT().content(content) 25 | .fromUser(wxMpXmlMessage.getToUser()) 26 | .toUser(wxMpXmlMessage.getFromUser()) 27 | .build(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/ubanillx/smartclass/wxmp/handler/SubscribeHandler.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.wxmp.handler; 2 | 3 | import java.util.Map; 4 | import me.chanjar.weixin.common.error.WxErrorException; 5 | import me.chanjar.weixin.common.session.WxSessionManager; 6 | import me.chanjar.weixin.mp.api.WxMpMessageHandler; 7 | import me.chanjar.weixin.mp.api.WxMpService; 8 | import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; 9 | import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; 10 | import org.springframework.stereotype.Component; 11 | 12 | /** 13 | * 关注处理器 14 | * 15 | 16 | **/ 17 | @Component 18 | public class SubscribeHandler implements WxMpMessageHandler { 19 | 20 | @Override 21 | public WxMpXmlOutMessage handle(WxMpXmlMessage wxMpXmlMessage, Map map, 22 | WxMpService wxMpService, WxSessionManager wxSessionManager) throws WxErrorException { 23 | final String content = "感谢关注"; 24 | // 调用接口,返回验证码 25 | return WxMpXmlOutMessage.TEXT().content(content) 26 | .fromUser(wxMpXmlMessage.getToUser()) 27 | .toUser(wxMpXmlMessage.getFromUser()) 28 | .build(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/additional-spring-configuration-metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "properties": [ 3 | { 4 | "name": "cos.client.accessKey", 5 | "type": "java.lang.String", 6 | "description": "Description for cos.client.accessKey." 7 | }, 8 | { 9 | "name": "cos.client.secretKey", 10 | "type": "java.lang.String", 11 | "description": "Description for cos.client.secretKey." 12 | }, 13 | { 14 | "name": "cos.client.region", 15 | "type": "java.lang.String", 16 | "description": "Description for cos.client.region." 17 | }, 18 | { 19 | "name": "cos.client.bucket", 20 | "type": "java.lang.String", 21 | "description": "Description for cos.client.bucket." 22 | }, 23 | { 24 | "name": "wx.open.appId", 25 | "type": "java.lang.String", 26 | "description": "Description for wx.open.appId." 27 | }, 28 | { 29 | "name": "wx.open.appSecret", 30 | "type": "java.lang.String", 31 | "description": "Description for wx.open.appSecret." 32 | } 33 | ] 34 | } -------------------------------------------------------------------------------- /src/main/resources/application-prod.yml: -------------------------------------------------------------------------------- 1 | # 线上配置文件 2 | server: 3 | port: 8101 4 | spring: 5 | # 数据库配置 6 | # todo 需替换配置 7 | datasource: 8 | driver-class-name: com.mysql.cj.jdbc.Driver 9 | url: jdbc:mysql://1Panel-mysql-hMmB:3306/smart_class 10 | username: root 11 | password: mysql_5TDxKc 12 | # Redis 配置 13 | # todo 需替换配置 14 | redis: 15 | database: 0 16 | host: 1Panel-redis-kOgw 17 | port: 6379 18 | timeout: 5000 19 | password: redis_wKaQkb 20 | # Elasticsearch 配置 21 | # todo 需替换配置 22 | elasticsearch: 23 | uris: http://localhost:9200 24 | username: root 25 | password: 123456 26 | mybatis-plus: 27 | configuration: 28 | # 生产环境关闭日志 29 | log-impl: '' 30 | # 接口文档配置 31 | knife4j: 32 | basic: 33 | enable: true 34 | username: root 35 | password: 123456 36 | -------------------------------------------------------------------------------- /src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | # 测试配置文件 2 | server: 3 | port: 8101 4 | spring: 5 | # 数据库配置 6 | # todo 需替换配置 7 | datasource: 8 | driver-class-name: com.mysql.cj.jdbc.Driver 9 | url: jdbc:mysql://localhost:3306/my_db 10 | username: root 11 | password: 123456 12 | # Redis 配置 13 | # todo 需替换配置 14 | redis: 15 | database: 1 16 | host: localhost 17 | port: 6379 18 | timeout: 5000 19 | password: 123456 20 | # Elasticsearch 配置 21 | # todo 需替换配置 22 | elasticsearch: 23 | uris: http://localhost:9200 24 | username: root 25 | password: 123456 -------------------------------------------------------------------------------- /src/main/resources/mapper/AiAvatarChatHistoryMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | id,userId,aiAvatarId,sessionId,sessionName,messageType, 21 | content,tokens,createTime 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/main/resources/mapper/AnnouncementMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | id,title,content,priority,status,startTime, 25 | endTime,coverImage,adminId,viewCount,createTime, 26 | updateTime,isDelete 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/main/resources/mapper/CourseCategoryMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | id,name,description,icon,sort,parentId, 22 | adminId,createTime,updateTime,isDelete 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/resources/mapper/CourseChapterMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | id,courseId,title,description,sort,adminId, 21 | createTime,updateTime,isDelete 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/main/resources/mapper/CourseFavouriteMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | id,userId,courseId,createTime,updateTime 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/resources/mapper/CourseMaterialMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | id,courseId,title,description,fileUrl,fileSize, 25 | fileType,downloadCount,sort,adminId,createTime, 26 | updateTime,isDelete 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/main/resources/mapper/CourseReviewMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | id,userId,courseId,content,rating,likeCount, 25 | replyCount,adminReply,adminReplyTime,status,createTime, 26 | updateTime,isDelete 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/main/resources/mapper/CourseSectionMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | id,courseId,chapterId,title,description,videoUrl, 27 | duration,sort,isFree,resourceType,resourceUrl, 28 | adminId,createTime,updateTime,isDelete 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/main/resources/mapper/DailyWordMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | id,word,pronunciation,audioUrl,translation,example, 28 | exampleTranslation,difficulty,category,notes,publishDate, 29 | adminId,likeCount,createTime,updateTime,isDelete 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/main/resources/mapper/PostFavourMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | id,postId,userId, 18 | createTime,updateTime 19 | 20 | 21 | 28 | 29 | -------------------------------------------------------------------------------- /src/main/resources/mapper/PostMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | id,title,content,tags, 23 | thumbNum,favourNum,userId, 24 | createTime,updateTime,isDelete 25 | 26 | 27 | 32 | 33 | -------------------------------------------------------------------------------- /src/main/resources/mapper/PostThumbMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | id,postId, 18 | userId,createTime,updateTime 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/main/resources/mapper/TeacherMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | id,name,avatar,title,introduction,expertise, 23 | userId,adminId,createTime,updateTime,isDelete 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/resources/mapper/UserAiAvatarMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | id,userId,aiAvatarId,isFavorite,lastUseTime,useCount, 23 | userRating,userFeedback,customSettings,createTime,updateTime 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/resources/mapper/UserAnnouncementReaderMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | id,userId,announcementId, 18 | readTime,createTime,updateTime 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/main/resources/mapper/UserArticleRecordMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | id,userId,articleId,readStatus,readProgress,isLiked, 21 | userNotes,createTime,updateTime 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/main/resources/mapper/UserLearningRecordMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | id,userId,recordDate,recordType,relatedId,lessonNumber, 27 | duration,count,points,experience,accuracy, 28 | status,remark,createTime,updateTime 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/main/resources/mapper/UserLearningStatsMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | id,userId,level,experience,nextLevelExp,learningDays, 25 | continuousCheckIn,totalCheckIn,totalPoints,totalBadges,lastCheckInTime, 26 | createTime,updateTime 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/main/resources/mapper/UserLevelMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | id,level,levelName,iconUrl,minExperience,maxExperience, 23 | description,privileges,createTime,updateTime,isDelete 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/resources/mapper/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | id,unionId,mpOpenId, 32 | userName,userAvatar,userProfile, 33 | userRole,createTime,updateTime,isDelete 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/main/resources/templates/TemplateService.java.ftl: -------------------------------------------------------------------------------- 1 | package ${packageName}.service; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.baomidou.mybatisplus.extension.service.IService; 6 | import ${packageName}.model.dto.${dataKey}.${upperDataKey}QueryRequest; 7 | import ${packageName}.model.entity.${upperDataKey}; 8 | import ${packageName}.model.vo.${upperDataKey}VO; 9 | 10 | import javax.servlet.http.HttpServletRequest; 11 | 12 | /** 13 | * ${dataName}服务 14 | * 15 | * @author 程序员鱼皮 16 | * @from 编程导航学习圈 17 | */ 18 | public interface ${upperDataKey}Service extends IService<${upperDataKey}> { 19 | 20 | /** 21 | * 校验数据 22 | * 23 | * @param ${dataKey} 24 | * @param add 对创建的数据进行校验 25 | */ 26 | void valid${upperDataKey}(${upperDataKey} ${dataKey}, boolean add); 27 | 28 | /** 29 | * 获取查询条件 30 | * 31 | * @param ${dataKey}QueryRequest 32 | * @return 33 | */ 34 | QueryWrapper<${upperDataKey}> getQueryWrapper(${upperDataKey}QueryRequest ${dataKey}QueryRequest); 35 | 36 | /** 37 | * 获取${dataName}封装 38 | * 39 | * @param ${dataKey} 40 | * @param request 41 | * @return 42 | */ 43 | ${upperDataKey}VO get${upperDataKey}VO(${upperDataKey} ${dataKey}, HttpServletRequest request); 44 | 45 | /** 46 | * 分页获取${dataName}封装 47 | * 48 | * @param ${dataKey}Page 49 | * @param request 50 | * @return 51 | */ 52 | Page<${upperDataKey}VO> get${upperDataKey}VOPage(Page<${upperDataKey}> ${dataKey}Page, HttpServletRequest request); 53 | } 54 | -------------------------------------------------------------------------------- /src/main/resources/templates/model/TemplateAddRequest.java.ftl: -------------------------------------------------------------------------------- 1 | package ${packageName}.model.dto.${dataKey}; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.List; 7 | 8 | /** 9 | * 创建${dataName}请求 10 | * 11 | * @author 程序员鱼皮 12 | * @from 编程导航学习圈 13 | */ 14 | @Data 15 | public class ${upperDataKey}AddRequest implements Serializable { 16 | 17 | /** 18 | * 标题 19 | */ 20 | private String title; 21 | 22 | /** 23 | * 内容 24 | */ 25 | private String content; 26 | 27 | /** 28 | * 标签列表 29 | */ 30 | private List tags; 31 | 32 | private static final long serialVersionUID = 1L; 33 | } -------------------------------------------------------------------------------- /src/main/resources/templates/model/TemplateEditRequest.java.ftl: -------------------------------------------------------------------------------- 1 | package ${packageName}.model.dto.${dataKey}; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.List; 7 | 8 | /** 9 | * 编辑${dataName}请求 10 | * 11 | * @author 程序员鱼皮 12 | * @from 编程导航学习圈 13 | */ 14 | @Data 15 | public class ${upperDataKey}EditRequest implements Serializable { 16 | 17 | /** 18 | * id 19 | */ 20 | private Long id; 21 | 22 | /** 23 | * 标题 24 | */ 25 | private String title; 26 | 27 | /** 28 | * 内容 29 | */ 30 | private String content; 31 | 32 | /** 33 | * 标签列表 34 | */ 35 | private List tags; 36 | 37 | private static final long serialVersionUID = 1L; 38 | } -------------------------------------------------------------------------------- /src/main/resources/templates/model/TemplateQueryRequest.java.ftl: -------------------------------------------------------------------------------- 1 | package ${packageName}.model.dto.${dataKey}; 2 | 3 | import ${packageName}.common.PageRequest; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | import java.io.Serializable; 8 | import java.util.List; 9 | 10 | /** 11 | * 查询${dataName}请求 12 | * 13 | * @author 程序员鱼皮 14 | * @from 编程导航学习圈 15 | */ 16 | @EqualsAndHashCode(callSuper = true) 17 | @Data 18 | public class ${upperDataKey}QueryRequest extends PageRequest implements Serializable { 19 | 20 | /** 21 | * id 22 | */ 23 | private Long id; 24 | 25 | /** 26 | * id 27 | */ 28 | private Long notId; 29 | 30 | /** 31 | * 搜索词 32 | */ 33 | private String searchText; 34 | 35 | /** 36 | * 标题 37 | */ 38 | private String title; 39 | 40 | /** 41 | * 内容 42 | */ 43 | private String content; 44 | 45 | /** 46 | * 标签列表 47 | */ 48 | private List tags; 49 | 50 | /** 51 | * 创建用户 id 52 | */ 53 | private Long userId; 54 | 55 | private static final long serialVersionUID = 1L; 56 | } -------------------------------------------------------------------------------- /src/main/resources/templates/model/TemplateUpdateRequest.java.ftl: -------------------------------------------------------------------------------- 1 | package ${packageName}.model.dto.${dataKey}; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.List; 7 | 8 | /** 9 | * 更新${dataName}请求 10 | * 11 | * @author 程序员鱼皮 12 | * @from 编程导航学习圈 13 | */ 14 | @Data 15 | public class ${upperDataKey}UpdateRequest implements Serializable { 16 | 17 | /** 18 | * id 19 | */ 20 | private Long id; 21 | 22 | /** 23 | * 标题 24 | */ 25 | private String title; 26 | 27 | /** 28 | * 内容 29 | */ 30 | private String content; 31 | 32 | /** 33 | * 标签列表 34 | */ 35 | private List tags; 36 | 37 | private static final long serialVersionUID = 1L; 38 | } -------------------------------------------------------------------------------- /src/main/resources/test_excel.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ubanillx/smartclass-backend/7dfe2c0377280c53209f8388f062e3a1062dc153/src/main/resources/test_excel.xlsx -------------------------------------------------------------------------------- /src/test/java/com/ubanillx/smartclass/MainApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | /** 7 | * 主类测试 8 | */ 9 | @SpringBootTest 10 | class MainApplicationTests { 11 | 12 | @Test 13 | void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/test/java/com/ubanillx/smartclass/manager/CosManagerTest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.manager; 2 | 3 | import javax.annotation.Resource; 4 | import org.junit.jupiter.api.Test; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | 7 | /** 8 | * Cos 操作测试 9 | */ 10 | @SpringBootTest 11 | class CosManagerTest { 12 | 13 | @Resource 14 | private CosManager cosManager; 15 | 16 | @Test 17 | void putObject() { 18 | cosManager.putObject("test", "test.json"); 19 | } 20 | } -------------------------------------------------------------------------------- /src/test/java/com/ubanillx/smartclass/mapper/PostFavourMapperTest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.ubanillx.smartclass.model.entity.Post; 7 | import javax.annotation.Resource; 8 | import org.junit.jupiter.api.Assertions; 9 | import org.junit.jupiter.api.Test; 10 | import org.springframework.boot.test.context.SpringBootTest; 11 | 12 | /** 13 | * 帖子收藏数据库操作测试 14 | */ 15 | @SpringBootTest 16 | class PostFavourMapperTest { 17 | 18 | @Resource 19 | private PostFavourMapper postFavourMapper; 20 | 21 | @Test 22 | void listUserFavourPostByPage() { 23 | IPage page = new Page<>(2, 1); 24 | QueryWrapper queryWrapper = new QueryWrapper<>(); 25 | queryWrapper.eq("id", 1); 26 | queryWrapper.like("content", "a"); 27 | IPage result = postFavourMapper.listFavourPostByPage(page, queryWrapper, 1); 28 | Assertions.assertNotNull(result); 29 | } 30 | } -------------------------------------------------------------------------------- /src/test/java/com/ubanillx/smartclass/mapper/PostMapperTest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.mapper; 2 | 3 | import com.ubanillx.smartclass.model.entity.Post; 4 | import java.util.Date; 5 | import java.util.List; 6 | import javax.annotation.Resource; 7 | import org.junit.jupiter.api.Assertions; 8 | import org.junit.jupiter.api.Test; 9 | import org.springframework.boot.test.context.SpringBootTest; 10 | 11 | /** 12 | * 帖子数据库操作测试 13 | */ 14 | @SpringBootTest 15 | class PostMapperTest { 16 | 17 | @Resource 18 | private PostMapper postMapper; 19 | 20 | @Test 21 | void listPostWithDelete() { 22 | List postList = postMapper.listPostWithDelete(new Date()); 23 | Assertions.assertNotNull(postList); 24 | } 25 | } -------------------------------------------------------------------------------- /src/test/java/com/ubanillx/smartclass/service/PostFavourServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.service; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.ubanillx.smartclass.model.entity.Post; 6 | 7 | import javax.annotation.Resource; 8 | 9 | import com.ubanillx.smartclass.model.entity.User; 10 | import org.junit.jupiter.api.Assertions; 11 | import org.junit.jupiter.api.BeforeAll; 12 | import org.junit.jupiter.api.Test; 13 | import org.springframework.boot.test.context.SpringBootTest; 14 | 15 | /** 16 | * 帖子收藏服务测试 17 | */ 18 | @SpringBootTest 19 | class PostFavourServiceTest { 20 | 21 | @Resource 22 | private PostFavourService postFavourService; 23 | 24 | private static final User loginUser = new User(); 25 | 26 | @BeforeAll 27 | static void setUp() { 28 | loginUser.setId(1L); 29 | } 30 | 31 | @Test 32 | void doPostFavour() { 33 | int i = postFavourService.doPostFavour(1L, loginUser); 34 | Assertions.assertTrue(i >= 0); 35 | } 36 | 37 | @Test 38 | void listFavourPostByPage() { 39 | QueryWrapper postQueryWrapper = new QueryWrapper<>(); 40 | postQueryWrapper.eq("id", 1L); 41 | postFavourService.listFavourPostByPage(Page.of(0, 1), postQueryWrapper, loginUser.getId()); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/test/java/com/ubanillx/smartclass/service/PostThumbServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.service; 2 | 3 | import javax.annotation.Resource; 4 | 5 | import com.ubanillx.smartclass.model.entity.User; 6 | import org.junit.jupiter.api.Assertions; 7 | import org.junit.jupiter.api.BeforeAll; 8 | import org.junit.jupiter.api.Test; 9 | import org.springframework.boot.test.context.SpringBootTest; 10 | 11 | /** 12 | * 帖子点赞服务测试 13 | */ 14 | @SpringBootTest 15 | class PostThumbServiceTest { 16 | 17 | @Resource 18 | private PostThumbService postThumbService; 19 | 20 | private static final User loginUser = new User(); 21 | 22 | @BeforeAll 23 | static void setUp() { 24 | loginUser.setId(1L); 25 | } 26 | 27 | @Test 28 | void doPostThumb() { 29 | int i = postThumbService.doPostThumb(1L, loginUser); 30 | Assertions.assertTrue(i >= 0); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/com/ubanillx/smartclass/service/UserServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.service; 2 | 3 | import javax.annotation.Resource; 4 | import org.junit.jupiter.api.Assertions; 5 | import org.junit.jupiter.api.Test; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | 8 | /** 9 | * 用户服务测试 10 | */ 11 | @SpringBootTest 12 | public class UserServiceTest { 13 | 14 | @Resource 15 | private UserService userService; 16 | 17 | @Test 18 | void userRegister() { 19 | String userAccount = "yupi"; 20 | String userPassword = ""; 21 | String checkPassword = "123456"; 22 | try { 23 | long result = userService.userRegister(userAccount, userPassword, checkPassword); 24 | Assertions.assertEquals(-1, result); 25 | userAccount = "yu"; 26 | result = userService.userRegister(userAccount, userPassword, checkPassword); 27 | Assertions.assertEquals(-1, result); 28 | } catch (Exception e) { 29 | 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/com/ubanillx/smartclass/utils/EasyExcelTest.java: -------------------------------------------------------------------------------- 1 | package com.ubanillx.smartclass.utils; 2 | 3 | import com.alibaba.excel.EasyExcel; 4 | import com.alibaba.excel.support.ExcelTypeEnum; 5 | import org.junit.jupiter.api.Test; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | import org.springframework.util.ResourceUtils; 8 | 9 | import java.io.File; 10 | import java.io.FileNotFoundException; 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | /** 15 | * EasyExcel 测试 16 | */ 17 | @SpringBootTest 18 | public class EasyExcelTest { 19 | 20 | @Test 21 | public void doImport() throws FileNotFoundException { 22 | File file = ResourceUtils.getFile("classpath:test_excel.xlsx"); 23 | List> list = EasyExcel.read(file) 24 | .excelType(ExcelTypeEnum.XLSX) 25 | .sheet() 26 | .headRowNumber(0) 27 | .doReadSync(); 28 | System.out.println(list); 29 | } 30 | 31 | } --------------------------------------------------------------------------------