From 224a6f67523abdc7f9180d557496834a6fc17663 Mon Sep 17 00:00:00 2001 From: ymnets Date: Wed, 6 Nov 2024 18:19:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E5=AE=98=E7=BD=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JAVA_MYSQL_WEBSITE/.idea/workspace.xml | 52 +- .../main/resources/mapper/WebNewsMapper.xml | 1 + JAVA_MYSQL_ZC/HELP.md | 10 + JAVA_MYSQL_ZC/jxjy-business/jxjy-business.iml | 115 +++++ JAVA_MYSQL_ZC/jxjy-business/pom.xml | 44 ++ .../com/hc/business/dto/ClassCourseDto.java | 35 ++ .../com/hc/business/dto/CourseVideoDto.java | 16 + .../com/hc/business/dto/OrderInvoicesDto.java | 62 +++ .../java/com/hc/business/dto/PaperAnswer.java | 27 + .../com/hc/business/dto/PaperCommitDTO.java | 26 + .../com/hc/business/dto/PaperResultDto.java | 19 + .../com/hc/business/dto/QuestionTypeDto.java | 16 + .../hc/business/dto/RetrievePasswordDto.java | 34 ++ .../java/com/hc/business/dto/SmsLoginDto.java | 23 + .../com/hc/business/dto/StaTimeTable.java | 17 + .../com/hc/business/dto/ThirdCourseBack.java | 48 ++ .../com/hc/business/dto/ThirdCourseDto.java | 24 + .../com/hc/business/dto/TypeCourseDto.java | 29 ++ .../com/hc/business/dto/UserCourseDto.java | 53 ++ .../java/com/hc/business/dto/UserListDto.java | 59 +++ .../com/hc/business/dto/UserPriceTotal.java | 23 + .../hc/business/dto/UserStatusClassDto.java | 45 ++ .../com/hc/business/dto/UserTimeTotal.java | 21 + .../business/mapper/AreaDistrictMapper.java | 27 + .../com/hc/business/mapper/BannerMapper.java | 18 + .../hc/business/mapper/ClassConfigMapper.java | 57 +++ .../mapper/ClassConfigSponsorMapper.java | 26 + .../hc/business/mapper/ClassCourseMapper.java | 42 ++ .../mapper/CourseChapterAnnexMapper.java | 17 + .../business/mapper/CourseChapterMapper.java | 28 + .../mapper/CourseChapterTagMapper.java | 17 + .../mapper/CourseChapterTestMapper.java | 17 + .../mapper/CourseChapterVideoMapper.java | 35 ++ .../com/hc/business/mapper/CourseMapper.java | 50 ++ .../hc/business/mapper/CourseTypeMapper.java | 29 ++ .../mapper/CourseTypeRelationMapper.java | 17 + .../com/hc/business/mapper/NewsMapper.java | 29 ++ .../com/hc/business/mapper/NewsTagMapper.java | 26 + .../business/mapper/OrderUserLogMapper.java | 38 ++ .../com/hc/business/mapper/OrdersMapper.java | 112 ++++ .../com/hc/business/mapper/PaperMapper.java | 17 + .../business/mapper/PaperQuestionMapper.java | 27 + .../business/mapper/QuestionAnswerMapper.java | 34 ++ .../hc/business/mapper/QuestionMapper.java | 50 ++ .../hc/business/mapper/QuestionTagMapper.java | 17 + .../business/mapper/QuestionTypeMapper.java | 17 + .../hc/business/mapper/ThirdCourseMapper.java | 29 ++ .../com/hc/business/mapper/ThirdMapper.java | 30 ++ .../hc/business/mapper/UserAdminMapper.java | 27 + .../hc/business/mapper/UserAdviseMapper.java | 42 ++ .../hc/business/mapper/UserCourseMapper.java | 61 +++ .../business/mapper/UserInvoicesMapper.java | 50 ++ .../com/hc/business/mapper/UserMapper.java | 99 ++++ .../mapper/UserRefundHistoryMapper.java | 26 + .../hc/business/mapper/UserStatusMapper.java | 59 +++ .../hc/business/mapper/UserTeacherMapper.java | 27 + .../mapper/UserTestHistoryMapper.java | 26 + .../mapper/UserVideoPositionMapper.java | 30 ++ .../com/hc/business/model/AreaDistrict.java | 143 ++++++ .../java/com/hc/business/model/Banner.java | 119 +++++ .../com/hc/business/model/ClassConfig.java | 202 ++++++++ .../hc/business/model/ClassConfigSponsor.java | 61 +++ .../com/hc/business/model/ClassCourse.java | 114 +++++ .../java/com/hc/business/model/Course.java | 176 +++++++ .../com/hc/business/model/CourseChapter.java | 165 ++++++ .../hc/business/model/CourseChapterAnnex.java | 115 +++++ .../hc/business/model/CourseChapterTag.java | 132 +++++ .../hc/business/model/CourseChapterTest.java | 98 ++++ .../hc/business/model/CourseChapterVideo.java | 158 ++++++ .../com/hc/business/model/CourseType.java | 65 +++ .../hc/business/model/CourseTypeRelation.java | 92 ++++ .../main/java/com/hc/business/model/News.java | 70 +++ .../java/com/hc/business/model/NewsTag.java | 66 +++ .../com/hc/business/model/OrderUserLog.java | 96 ++++ .../java/com/hc/business/model/Orders.java | 259 ++++++++++ .../java/com/hc/business/model/Paper.java | 193 +++++++ .../com/hc/business/model/PaperQuestion.java | 145 ++++++ .../java/com/hc/business/model/Question.java | 152 ++++++ .../com/hc/business/model/QuestionAnswer.java | 97 ++++ .../com/hc/business/model/QuestionTag.java | 64 +++ .../com/hc/business/model/QuestionType.java | 64 +++ .../java/com/hc/business/model/Third.java | 92 ++++ .../com/hc/business/model/ThirdCourse.java | 93 ++++ .../main/java/com/hc/business/model/User.java | 377 ++++++++++++++ .../java/com/hc/business/model/UserAdmin.java | 114 +++++ .../com/hc/business/model/UserAdvise.java | 172 +++++++ .../com/hc/business/model/UserCourse.java | 114 +++++ .../com/hc/business/model/UserInvoices.java | 302 +++++++++++ .../hc/business/model/UserRefundHistory.java | 155 ++++++ .../com/hc/business/model/UserStatus.java | 115 +++++ .../com/hc/business/model/UserTeacher.java | 130 +++++ .../hc/business/model/UserTestHistory.java | 165 ++++++ .../hc/business/model/UserVideoPosition.java | 122 +++++ .../business/model/jwt/GenerateAuthToken.java | 66 +++ .../com/hc/business/model/jwt/JWTUtil.java | 76 +++ .../hc/business/model/login/AccessEntity.java | 31 ++ .../hc/business/model/login/AuthEntity.java | 19 + .../hc/business/model/login/TokenEntity.java | 21 + .../hc/business/service/AliPayService.java | 44 ++ .../business/service/AreaDistrictService.java | 60 +++ .../hc/business/service/BannerService.java | 61 +++ .../business/service/ClassConfigService.java | 99 ++++ .../service/ClassConfigSponsorService.java | 61 +++ .../business/service/ClassCourseService.java | 69 +++ .../service/CourseChapterAnnexService.java | 60 +++ .../service/CourseChapterService.java | 66 +++ .../service/CourseChapterTagService.java | 60 +++ .../service/CourseChapterTestService.java | 60 +++ .../service/CourseChapterVideoService.java | 69 +++ .../hc/business/service/CourseService.java | 110 ++++ .../service/CourseTypeRelationService.java | 59 +++ .../business/service/CourseTypeService.java | 60 +++ .../com/hc/business/service/NewsService.java | 71 +++ .../hc/business/service/NewsTagService.java | 60 +++ .../business/service/OrderUserLogService.java | 70 +++ .../hc/business/service/OrdersService.java | 149 ++++++ .../service/PaperQuestionService.java | 70 +++ .../com/hc/business/service/PaperService.java | 78 +++ .../service/QuestionAnswerService.java | 60 +++ .../hc/business/service/QuestionService.java | 67 +++ .../business/service/QuestionTagService.java | 60 +++ .../business/service/QuestionTypeService.java | 60 +++ .../business/service/ThirdCourseService.java | 72 +++ .../com/hc/business/service/ThirdService.java | 58 +++ .../hc/business/service/UserAdminService.java | 70 +++ .../business/service/UserAdviseService.java | 71 +++ .../business/service/UserCourseService.java | 62 +++ .../business/service/UserInvoicesService.java | 86 ++++ .../service/UserRefundHistoryService.java | 59 +++ .../com/hc/business/service/UserService.java | 154 ++++++ .../business/service/UserStatusService.java | 84 +++ .../business/service/UserTeacherService.java | 70 +++ .../service/UserTestHistoryService.java | 67 +++ .../service/UserVideoPositionService.java | 94 ++++ .../service/impl/AliPayServiceImpl.java | 186 +++++++ .../service/impl/AreaDistrictServiceImpl.java | 93 ++++ .../service/impl/BannerServiceImpl.java | 84 +++ .../service/impl/ClassConfigServiceImpl.java | 145 ++++++ .../impl/ClassConfigSponsorServiceImpl.java | 93 ++++ .../service/impl/ClassCourseServiceImpl.java | 106 ++++ .../impl/CourseChapterAnnexServiceImpl.java | 83 +++ .../impl/CourseChapterServiceImpl.java | 122 +++++ .../impl/CourseChapterTagServiceImpl.java | 83 +++ .../impl/CourseChapterTestServiceImpl.java | 83 +++ .../impl/CourseChapterVideoServiceImpl.java | 98 ++++ .../service/impl/CourseServiceImpl.java | 233 +++++++++ .../impl/CourseTypeRelationServiceImpl.java | 84 +++ .../service/impl/CourseTypeServiceImpl.java | 91 ++++ .../service/impl/NewsServiceImpl.java | 94 ++++ .../service/impl/NewsTagServiceImpl.java | 79 +++ .../service/impl/OrderUserLogServiceImpl.java | 100 ++++ .../service/impl/OrdersServiceImpl.java | 184 +++++++ .../impl/PaperQuestionServiceImpl.java | 90 ++++ .../service/impl/PaperServiceImpl.java | 263 ++++++++++ .../impl/QuestionAnswerServiceImpl.java | 83 +++ .../service/impl/QuestionServiceImpl.java | 97 ++++ .../service/impl/QuestionTagServiceImpl.java | 83 +++ .../service/impl/QuestionTypeServiceImpl.java | 83 +++ .../service/impl/ThirdCourseServiceImpl.java | 163 ++++++ .../service/impl/ThirdServiceImpl.java | 88 ++++ .../service/impl/UserAdminServiceImpl.java | 125 +++++ .../service/impl/UserAdviseServiceImpl.java | 108 ++++ .../service/impl/UserCourseServiceImpl.java | 95 ++++ .../service/impl/UserInvoicesServiceImpl.java | 144 ++++++ .../impl/UserRefundHistoryServiceImpl.java | 93 ++++ .../service/impl/UserServiceImpl.java | 297 +++++++++++ .../service/impl/UserStatusServiceImpl.java | 106 ++++ .../service/impl/UserTeacherServiceImpl.java | 93 ++++ .../impl/UserTestHistoryServiceImpl.java | 88 ++++ .../impl/UserVideoPositionServiceImpl.java | 381 ++++++++++++++ .../resources/mapper/AreaDistrictMapper.xml | 31 ++ .../main/resources/mapper/BannerMapper.xml | 19 + .../resources/mapper/ClassConfigMapper.xml | 104 ++++ .../mapper/ClassConfigSponsorMapper.xml | 30 ++ .../resources/mapper/ClassCourseMapper.xml | 45 ++ .../mapper/CourseChapterAnnexMapper.xml | 21 + .../resources/mapper/CourseChapterMapper.xml | 27 + .../mapper/CourseChapterTagMapper.xml | 23 + .../mapper/CourseChapterTestMapper.xml | 19 + .../mapper/CourseChapterVideoMapper.xml | 43 ++ .../main/resources/mapper/CourseMapper.xml | 70 +++ .../resources/mapper/CourseTypeMapper.xml | 23 + .../mapper/CourseTypeRelationMapper.xml | 19 + .../src/main/resources/mapper/NewsMapper.xml | 31 ++ .../main/resources/mapper/NewsTagMapper.xml | 21 + .../resources/mapper/OrderUserLogMapper.xml | 34 ++ .../main/resources/mapper/OrdersMapper.xml | 158 ++++++ .../src/main/resources/mapper/PaperMapper.xml | 31 ++ .../resources/mapper/PaperQuestionMapper.xml | 32 ++ .../resources/mapper/QuestionAnswerMapper.xml | 32 ++ .../main/resources/mapper/QuestionMapper.xml | 61 +++ .../resources/mapper/QuestionTagMapper.xml | 15 + .../resources/mapper/QuestionTypeMapper.xml | 15 + .../resources/mapper/ThirdCourseMapper.xml | 29 ++ .../src/main/resources/mapper/ThirdMapper.xml | 28 + .../main/resources/mapper/UserAdminMapper.xml | 28 + .../resources/mapper/UserAdviseMapper.xml | 52 ++ .../resources/mapper/UserCourseMapper.xml | 68 +++ .../resources/mapper/UserInvoicesMapper.xml | 71 +++ .../src/main/resources/mapper/UserMapper.xml | 162 ++++++ .../mapper/UserRefundHistoryMapper.xml | 35 ++ .../resources/mapper/UserStatusMapper.xml | 65 +++ .../resources/mapper/UserTeacherMapper.xml | 30 ++ .../mapper/UserTestHistoryMapper.xml | 39 ++ .../mapper/UserVideoPositionMapper.xml | 26 + .../src/main/resources/mybatis-config.xml | 17 + JAVA_MYSQL_ZC/jxjy-core/jxjy-core.iml | 110 ++++ JAVA_MYSQL_ZC/jxjy-core/pom.xml | 120 +++++ .../core/utils/constants/OrderConstants.java | 11 + .../com/hc/core/utils/enums/ErrorEnum.java | 34 ++ .../com/hc/core/utils/enums/InfoEnum.java | 40 ++ .../com/hc/core/utils/enums/SuccessEnum.java | 32 ++ .../utils/exception/ResponseException.java | 33 ++ .../java/com/hc/core/utils/mapper/Mapper.java | 19 + .../com/hc/core/utils/msm/MessageService.java | 101 ++++ .../java/com/hc/core/utils/msm/MsgConfig.java | 26 + .../java/com/hc/core/utils/oss/QiNiuUtil.java | 50 ++ .../pay/browser/alipay/bean/AliPayBean.java | 50 ++ .../browser/alipay/bean/AliPayRefundBean.java | 31 ++ .../alipay/processor/AliPayProcessor.java | 92 ++++ .../pay/browser/wxpay/utils/Md5ToolUtil.java | 30 ++ .../pay/browser/wxpay/utils/WebUtils.java | 43 ++ .../pay/browser/wxpay/utils/XMLUtils.java | 51 ++ .../utils/properties/AliPayProperties.java | 31 ++ .../core/utils/properties/PayProperties.java | 36 ++ .../utils/properties/WxPayProperties.java | 37 ++ .../com/hc/core/utils/redis/RedisUtil.java | 281 +++++++++++ .../java/com/hc/core/utils/result/Result.java | 84 +++ .../hc/core/utils/status/CodeFlagEnum.java | 25 + .../hc/core/utils/status/CourseFlagEnum.java | 26 + .../hc/core/utils/status/OrdersFlagEnum.java | 28 + .../java/com/hc/core/utils/tool/Compute.java | 98 ++++ .../com/hc/core/utils/tool/IdGenerator.java | 142 ++++++ .../com/hc/core/utils/tool/JsonUtils.java | 29 ++ .../com/hc/core/utils/tool/Verification.java | 109 ++++ .../java/com/hc/core/utils/wx/MD5Utils.java | 30 ++ .../com/hc/core/utils/wx/Md5UtilTest.java | 30 ++ .../com/hc/core/utils/wx/StringUtils.java | 35 ++ .../java/com/hc/core/utils/wx/TimeUtils.java | 32 ++ .../java/com/hc/core/utils/wx/WebUtils.java | 43 ++ .../java/com/hc/core/utils/wx/XMLUtils.java | 51 ++ .../src/main/resources/application.properties | 15 + JAVA_MYSQL_ZC/jxjy-education.iml | 51 ++ JAVA_MYSQL_ZC/jxjy-web/jxjy-web.iml | 169 +++++++ JAVA_MYSQL_ZC/jxjy-web/pom.xml | 87 ++++ .../java/com/hc/web/JxjyWebApplication.java | 23 + .../java/com/hc/web/ServletInitializer.java | 13 + .../java/com/hc/web/aspect/AppUserAspect.java | 81 +++ .../com/hc/web/aspect/BackUserAspect.java | 70 +++ .../com/hc/web/aspect/FrontUserAspect.java | 83 +++ .../java/com/hc/web/config/CrossConfig.java | 36 ++ .../web/config/RedisTemplateSerializer.java | 26 + .../com/hc/web/config/Swagger3config.java | 85 ++++ .../com/hc/web/config/util/HttpRequest.java | 138 +++++ .../com/hc/web/config/util/HttpsUtil.java | 89 ++++ .../util/JEEWeiXinX509TrustManager.java | 24 + .../app/AppAreaDistrictController.java | 41 ++ .../browser/app/AppBannerController.java | 44 ++ .../browser/app/AppClassConfigController.java | 67 +++ .../browser/app/AppClassCourseController.java | 51 ++ .../browser/app/AppCourseController.java | 101 ++++ .../browser/app/AppCourseTypeController.java | 43 ++ .../browser/app/AppNewsController.java | 53 ++ .../browser/app/AppNewsTagController.java | 38 ++ .../app/AppOrderUserLogController.java | 51 ++ .../browser/app/AppOrdersController.java | 71 +++ .../browser/app/AppPaperController.java | 43 ++ .../app/AppPaperQuestionController.java | 38 ++ .../app/AppQuestionAnswerController.java | 39 ++ .../browser/app/AppQuestionController.java | 42 ++ .../browser/app/AppQuestionTagController.java | 38 ++ .../app/AppQuestionTypeController.java | 43 ++ .../browser/app/AppUserAdviseController.java | 56 ++ .../app/AppUserClassLogController.java | 30 ++ .../browser/app/AppUserController.java | 91 ++++ .../browser/app/AppUserCourseController.java | 55 ++ .../app/AppUserInvoicesController.java | 51 ++ .../app/AppUserRefundHistoryController.java | 46 ++ .../browser/app/AppUserTeacherController.java | 48 ++ .../app/AppUserTestHistoryController.java | 58 +++ .../app/AppUserVideoPositionController.java | 74 +++ .../browser/app/AppWxPayJsApiController.java | 365 ++++++++++++++ .../browser/back/BackAliPayController.java | 37 ++ .../back/BackAreaDistrictController.java | 56 ++ .../browser/back/BackBannerController.java | 65 +++ .../back/BackClassConfigController.java | 81 +++ .../BackClassConfigSponsorController.java | 65 +++ .../back/BackClassCourseController.java | 74 +++ .../browser/back/BackCourseController.java | 91 ++++ .../back/BackCourseTypeController.java | 66 +++ .../BackCourseTypeRelationController.java | 64 +++ .../browser/back/BackNewsController.java | 74 +++ .../browser/back/BackNewsTagController.java | 64 +++ .../back/BackOrderInvoicesController.java | 33 ++ .../back/BackOrderUserLogController.java | 47 ++ .../browser/back/BackOrdersController.java | 118 +++++ .../browser/back/BackPaperController.java | 64 +++ .../back/BackPaperQuestionController.java | 70 +++ .../back/BackQuestionAnswerController.java | 64 +++ .../browser/back/BackQuestionController.java | 72 +++ .../back/BackQuestionTagController.java | 64 +++ .../back/BackQuestionTypeController.java | 64 +++ .../browser/back/BackThirdController.java | 61 +++ .../back/BackThirdCourseController.java | 66 +++ .../browser/back/BackUserAdminController.java | 45 ++ .../back/BackUserAdviseController.java | 78 +++ .../browser/back/BackUserController.java | 101 ++++ .../back/BackUserCourseController.java | 67 +++ .../back/BackUserInvoicesController.java | 83 +++ .../back/BackUserRefundHistoryController.java | 64 +++ .../back/BackUserStatusController.java | 73 +++ .../back/BackUserTeacherController.java | 69 +++ .../back/BackUserTestHistoryController.java | 64 +++ .../back/CourseChapterAnnexController.java | 64 +++ .../browser/back/CourseChapterController.java | 64 +++ .../back/CourseChapterTagController.java | 64 +++ .../back/CourseChapterTestController.java | 64 +++ .../back/CourseChapterVideoController.java | 64 +++ .../browser/common/CommonController.java | 33 ++ .../browser/front/FrontAliPayController.java | 52 ++ .../front/FrontAreaDistrictController.java | 41 ++ .../browser/front/FrontBannerController.java | 44 ++ .../front/FrontClassConfigController.java | 67 +++ .../FrontClassConfigSponsorController.java | 44 ++ .../front/FrontClassCourseController.java | 51 ++ .../browser/front/FrontCourseController.java | 101 ++++ .../front/FrontCourseTypeController.java | 43 ++ .../browser/front/FrontNewsController.java | 44 ++ .../browser/front/FrontNewsTagController.java | 36 ++ .../front/FrontOrderUserLogController.java | 60 +++ .../browser/front/FrontOrdersController.java | 74 +++ .../browser/front/FrontPaperController.java | 43 ++ .../front/FrontPaperQuestionController.java | 37 ++ .../front/FrontQuestionAnswerController.java | 36 ++ .../front/FrontQuestionController.java | 42 ++ .../front/FrontQuestionTagController.java | 35 ++ .../front/FrontQuestionTypeController.java | 43 ++ .../front/FrontUserAdviseController.java | 56 ++ .../front/FrontUserClassLogController.java | 31 ++ .../browser/front/FrontUserController.java | 92 ++++ .../front/FrontUserCourseController.java | 55 ++ .../front/FrontUserInvoicesController.java | 51 ++ .../FrontUserRefundHistoryController.java | 46 ++ .../front/FrontUserTeacherController.java | 48 ++ .../front/FrontUserTestHistoryController.java | 101 ++++ .../FrontUserVideoPositionController.java | 74 +++ .../browser/third/OneThirdController.java | 38 ++ .../web/handler/ExceptionResultHandler.java | 103 ++++ .../src/main/resources/application-dev.yml | 21 + .../src/main/resources/application-pro.yml | 21 + .../src/main/resources/application.yml | 37 ++ .../com/hc/web/CourseChapterServiceTests.java | 101 ++++ .../java/com/hc/web/CourseServiceTests.java | 250 +++++++++ .../com/hc/web/CourseTypeServiceTests.java | 64 +++ .../com/hc/web/JxjyWebApplicationTests.java | 17 + .../com/hc/web/UserPositionServiceTests.java | 477 ++++++++++++++++++ JAVA_MYSQL_ZC/pom.xml | 64 +++ 357 files changed, 25529 insertions(+), 22 deletions(-) create mode 100644 JAVA_MYSQL_ZC/HELP.md create mode 100644 JAVA_MYSQL_ZC/jxjy-business/jxjy-business.iml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/pom.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/ClassCourseDto.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/CourseVideoDto.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/OrderInvoicesDto.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/PaperAnswer.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/PaperCommitDTO.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/PaperResultDto.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/QuestionTypeDto.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/RetrievePasswordDto.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/SmsLoginDto.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/StaTimeTable.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/ThirdCourseBack.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/ThirdCourseDto.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/TypeCourseDto.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/UserCourseDto.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/UserListDto.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/UserPriceTotal.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/UserStatusClassDto.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/UserTimeTotal.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/AreaDistrictMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/BannerMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/ClassConfigMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/ClassConfigSponsorMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/ClassCourseMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseChapterAnnexMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseChapterMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseChapterTagMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseChapterTestMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseChapterVideoMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseTypeMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseTypeRelationMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/NewsMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/NewsTagMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/OrderUserLogMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/OrdersMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/PaperMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/PaperQuestionMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/QuestionAnswerMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/QuestionMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/QuestionTagMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/QuestionTypeMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/ThirdCourseMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/ThirdMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserAdminMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserAdviseMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserCourseMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserInvoicesMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserRefundHistoryMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserStatusMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserTeacherMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserTestHistoryMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserVideoPositionMapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/AreaDistrict.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Banner.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/ClassConfig.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/ClassConfigSponsor.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/ClassCourse.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Course.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseChapter.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseChapterAnnex.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseChapterTag.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseChapterTest.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseChapterVideo.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseType.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseTypeRelation.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/News.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/NewsTag.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/OrderUserLog.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Orders.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Paper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/PaperQuestion.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Question.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/QuestionAnswer.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/QuestionTag.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/QuestionType.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Third.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/ThirdCourse.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/User.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserAdmin.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserAdvise.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserCourse.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserInvoices.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserRefundHistory.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserStatus.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserTeacher.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserTestHistory.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserVideoPosition.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/jwt/GenerateAuthToken.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/jwt/JWTUtil.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/login/AccessEntity.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/login/AuthEntity.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/login/TokenEntity.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/AliPayService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/AreaDistrictService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/BannerService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/ClassConfigService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/ClassConfigSponsorService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/ClassCourseService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseChapterAnnexService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseChapterService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseChapterTagService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseChapterTestService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseChapterVideoService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseTypeRelationService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseTypeService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/NewsService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/NewsTagService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/OrderUserLogService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/OrdersService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/PaperQuestionService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/PaperService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/QuestionAnswerService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/QuestionService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/QuestionTagService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/QuestionTypeService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/ThirdCourseService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/ThirdService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserAdminService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserAdviseService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserCourseService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserInvoicesService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserRefundHistoryService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserStatusService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserTeacherService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserTestHistoryService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserVideoPositionService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/AliPayServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/AreaDistrictServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/BannerServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/ClassConfigServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/ClassConfigSponsorServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/ClassCourseServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseChapterAnnexServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseChapterServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseChapterTagServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseChapterTestServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseChapterVideoServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseTypeRelationServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseTypeServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/NewsServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/NewsTagServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/OrderUserLogServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/OrdersServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/PaperQuestionServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/PaperServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/QuestionAnswerServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/QuestionServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/QuestionTagServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/QuestionTypeServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/ThirdCourseServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/ThirdServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserAdminServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserAdviseServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserCourseServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserInvoicesServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserRefundHistoryServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserStatusServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserTeacherServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserTestHistoryServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserVideoPositionServiceImpl.java create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/AreaDistrictMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/BannerMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/ClassConfigMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/ClassConfigSponsorMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/ClassCourseMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseChapterAnnexMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseChapterMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseChapterTagMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseChapterTestMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseChapterVideoMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseTypeMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseTypeRelationMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/NewsMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/NewsTagMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/OrderUserLogMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/OrdersMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/PaperMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/PaperQuestionMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/QuestionAnswerMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/QuestionMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/QuestionTagMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/QuestionTypeMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/ThirdCourseMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/ThirdMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserAdminMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserAdviseMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserCourseMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserInvoicesMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserRefundHistoryMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserStatusMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserTeacherMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserTestHistoryMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserVideoPositionMapper.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mybatis-config.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-core/jxjy-core.iml create mode 100644 JAVA_MYSQL_ZC/jxjy-core/pom.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/constants/OrderConstants.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/enums/ErrorEnum.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/enums/InfoEnum.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/enums/SuccessEnum.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/exception/ResponseException.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/mapper/Mapper.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/msm/MessageService.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/msm/MsgConfig.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/oss/QiNiuUtil.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/alipay/bean/AliPayBean.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/alipay/bean/AliPayRefundBean.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/alipay/processor/AliPayProcessor.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/wxpay/utils/Md5ToolUtil.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/wxpay/utils/WebUtils.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/wxpay/utils/XMLUtils.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/properties/AliPayProperties.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/properties/PayProperties.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/properties/WxPayProperties.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/redis/RedisUtil.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/result/Result.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/status/CodeFlagEnum.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/status/CourseFlagEnum.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/status/OrdersFlagEnum.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/tool/Compute.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/tool/IdGenerator.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/tool/JsonUtils.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/tool/Verification.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/MD5Utils.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/Md5UtilTest.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/StringUtils.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/TimeUtils.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/WebUtils.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/XMLUtils.java create mode 100644 JAVA_MYSQL_ZC/jxjy-core/src/main/resources/application.properties create mode 100644 JAVA_MYSQL_ZC/jxjy-education.iml create mode 100644 JAVA_MYSQL_ZC/jxjy-web/jxjy-web.iml create mode 100644 JAVA_MYSQL_ZC/jxjy-web/pom.xml create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/JxjyWebApplication.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/ServletInitializer.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/aspect/AppUserAspect.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/aspect/BackUserAspect.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/aspect/FrontUserAspect.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/CrossConfig.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/RedisTemplateSerializer.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/Swagger3config.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/util/HttpRequest.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/util/HttpsUtil.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/util/JEEWeiXinX509TrustManager.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppAreaDistrictController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppBannerController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppClassConfigController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppClassCourseController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppCourseController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppCourseTypeController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppNewsController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppNewsTagController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppOrderUserLogController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppOrdersController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppPaperController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppPaperQuestionController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppQuestionAnswerController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppQuestionController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppQuestionTagController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppQuestionTypeController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserAdviseController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserClassLogController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserCourseController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserInvoicesController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserRefundHistoryController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserTeacherController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserTestHistoryController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserVideoPositionController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppWxPayJsApiController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackAliPayController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackAreaDistrictController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackBannerController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackClassConfigController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackClassConfigSponsorController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackClassCourseController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackCourseController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackCourseTypeController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackCourseTypeRelationController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackNewsController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackNewsTagController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackOrderInvoicesController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackOrderUserLogController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackOrdersController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackPaperController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackPaperQuestionController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackQuestionAnswerController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackQuestionController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackQuestionTagController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackQuestionTypeController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackThirdController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackThirdCourseController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserAdminController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserAdviseController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserCourseController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserInvoicesController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserRefundHistoryController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserStatusController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserTeacherController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserTestHistoryController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/CourseChapterAnnexController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/CourseChapterController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/CourseChapterTagController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/CourseChapterTestController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/CourseChapterVideoController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/common/CommonController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontAliPayController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontAreaDistrictController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontBannerController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontClassConfigController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontClassConfigSponsorController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontClassCourseController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontCourseController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontCourseTypeController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontNewsController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontNewsTagController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontOrderUserLogController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontOrdersController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontPaperController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontPaperQuestionController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontQuestionAnswerController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontQuestionController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontQuestionTagController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontQuestionTypeController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserAdviseController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserClassLogController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserCourseController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserInvoicesController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserRefundHistoryController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserTeacherController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserTestHistoryController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserVideoPositionController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/third/OneThirdController.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/handler/ExceptionResultHandler.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/resources/application-dev.yml create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/resources/application-pro.yml create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/main/resources/application.yml create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/test/java/com/hc/web/CourseChapterServiceTests.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/test/java/com/hc/web/CourseServiceTests.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/test/java/com/hc/web/CourseTypeServiceTests.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/test/java/com/hc/web/JxjyWebApplicationTests.java create mode 100644 JAVA_MYSQL_ZC/jxjy-web/src/test/java/com/hc/web/UserPositionServiceTests.java create mode 100644 JAVA_MYSQL_ZC/pom.xml diff --git a/JAVA_MYSQL_WEBSITE/.idea/workspace.xml b/JAVA_MYSQL_WEBSITE/.idea/workspace.xml index af83bcc..0ecf253 100644 --- a/JAVA_MYSQL_WEBSITE/.idea/workspace.xml +++ b/JAVA_MYSQL_WEBSITE/.idea/workspace.xml @@ -5,9 +5,8 @@ - - + - { - "keyToString": { - "RequestMappingsPanelOrder0": "0", - "RequestMappingsPanelOrder1": "1", - "RequestMappingsPanelWidth0": "75", - "RequestMappingsPanelWidth1": "75", - "RunOnceActivity.OpenProjectViewOnStart": "true", - "RunOnceActivity.ShowReadmeOnStart": "true", - "SHARE_PROJECT_CONFIGURATION_FILES": "true", - "WebServerToolWindowFactoryState": "false", - "last_opened_file_path": "F:/02.FNSProject/JAVA_MYSQL_HCJXJY", - "settings.editor.selected.configurable": "web.server", - "spring.configuration.checksum": "420f802bde281311b05da23e05cddeda" + +}]]> @@ -100,7 +99,8 @@ - + + 1730470371982 @@ -123,7 +123,14 @@ - @@ -132,6 +139,7 @@ - \ No newline at end of file diff --git a/JAVA_MYSQL_WEBSITE/gp-business/src/main/resources/mapper/WebNewsMapper.xml b/JAVA_MYSQL_WEBSITE/gp-business/src/main/resources/mapper/WebNewsMapper.xml index 580536c..7837a6f 100644 --- a/JAVA_MYSQL_WEBSITE/gp-business/src/main/resources/mapper/WebNewsMapper.xml +++ b/JAVA_MYSQL_WEBSITE/gp-business/src/main/resources/mapper/WebNewsMapper.xml @@ -31,6 +31,7 @@ news_id, news_title, news_logo, + news_content, module_id, type_id, flag, diff --git a/JAVA_MYSQL_ZC/HELP.md b/JAVA_MYSQL_ZC/HELP.md new file mode 100644 index 0000000..326da52 --- /dev/null +++ b/JAVA_MYSQL_ZC/HELP.md @@ -0,0 +1,10 @@ +# Getting Started + +### Reference Documentation +For further reference, please consider the following sections: + +* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) +* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.2.11.RELEASE/maven-plugin/) +* [Spring Configuration Processor](https://docs.spring.io/spring-boot/docs/2.3.5.RELEASE/reference/htmlsingle/#configuration-metadata-annotation-processor) +* [Spring Boot DevTools](https://docs.spring.io/spring-boot/docs/2.3.5.RELEASE/reference/htmlsingle/#using-boot-devtools) + diff --git a/JAVA_MYSQL_ZC/jxjy-business/jxjy-business.iml b/JAVA_MYSQL_ZC/jxjy-business/jxjy-business.iml new file mode 100644 index 0000000..978e2f4 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/jxjy-business.iml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/pom.xml b/JAVA_MYSQL_ZC/jxjy-business/pom.xml new file mode 100644 index 0000000..593e516 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + + com.hc + jxjy-education + 0.0.1-SNAPSHOT + + + jxjy-business + 0.0.1-SNAPSHOT + jxjy-business + Demo project for Spring Boot + + + 11 + 1.2.5 + + + + + + com.hc + jxjy-core + 0.0.1-SNAPSHOT + + + + com.github.pagehelper + pagehelper-spring-boot-starter + ${pagehelper.version} + + + mybatis-spring-boot-starter + org.mybatis.spring.boot + + + + + + + + diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/ClassCourseDto.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/ClassCourseDto.java new file mode 100644 index 0000000..15e19d9 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/ClassCourseDto.java @@ -0,0 +1,35 @@ +package com.hc.business.dto; + +import lombok.Getter; + +/** + * @author 10696 + * @since 2020/11/25 10:41 + */ +@Getter +public class ClassCourseDto { + + private Integer classCourseId; + + private Integer classId; + + private Integer courseId; + + private Integer courseType; + + private String courseName; + + private String courseLogo; + + private String courseDesc; + + private Float courseHours; + + private String courseTeacher; + + private Integer isValid; + + private String gallery; + + private Integer reserved1; +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/CourseVideoDto.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/CourseVideoDto.java new file mode 100644 index 0000000..dee944e --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/CourseVideoDto.java @@ -0,0 +1,16 @@ +package com.hc.business.dto; + +import com.hc.business.model.CourseChapterVideo; +import com.hc.business.model.UserVideoPosition; +import lombok.Data; + +/** + * @author 10696 + * @since 2020/11/25 10:41 + */ +@Data +public class CourseVideoDto { + + private CourseChapterVideo video; + private UserVideoPosition position; +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/OrderInvoicesDto.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/OrderInvoicesDto.java new file mode 100644 index 0000000..5a95936 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/OrderInvoicesDto.java @@ -0,0 +1,62 @@ +package com.hc.business.dto; + +import lombok.Getter; +import lombok.ToString; + +/** + * @author 10696 + */ +@Getter +@ToString +public class OrderInvoicesDto { + + private Integer ordersId; + + private String orderNo; + + private Integer userId; + + private Integer classId; + + private Integer orderStatus; + + private String body; + + private String subject; + + private Double totalAmount; + + private Long createTime; + + private Long overTime; + + private String remark; + + private Integer isDe; + + private Integer userInvoicesId; + + private String invoicesHead; + + private Integer invoicesType; + + private String invoicesCode; + + private String invoicesBank; + + private String invoicesUser; + + private String invoicesNo; + + private Double invoicesPrice; + + private Integer status; + + private Long time; + + private String remarks; + + private String remarksSign; + + private String taxCode; +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/PaperAnswer.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/PaperAnswer.java new file mode 100644 index 0000000..9e508a8 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/PaperAnswer.java @@ -0,0 +1,27 @@ +package com.hc.business.dto; + +import java.io.Serializable; +import java.util.List; + +public class PaperAnswer implements Serializable{ + + private Integer questionId; + + private List answerId; + + public Integer getQuestionId() { + return questionId; + } + + public void setQuestionId(Integer questionId) { + this.questionId = questionId; + } + + public List getAnswerId() { + return answerId; + } + + public void setAnswerId(List answerId) { + this.answerId = answerId; + } +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/PaperCommitDTO.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/PaperCommitDTO.java new file mode 100644 index 0000000..b236058 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/PaperCommitDTO.java @@ -0,0 +1,26 @@ +package com.hc.business.dto; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +@Data +public class PaperCommitDTO implements Serializable { + + @NotNull(message = "用户id不可以为空") + private Integer userId; + + @NotNull(message = "试卷id不可以为空") + private Integer paperId; + + @NotNull(message = "班次id不可以为空") + private Integer classId; + + @NotNull(message = "考试时间不可以为空") + private String testTime; + + private List answerList; + +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/PaperResultDto.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/PaperResultDto.java new file mode 100644 index 0000000..c68ce7c --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/PaperResultDto.java @@ -0,0 +1,19 @@ +package com.hc.business.dto; + +import com.hc.business.model.Paper; +import lombok.Data; + +import java.util.List; + +/** + * @author 10696 + */ + +@Data +public class PaperResultDto { + + private Paper paper; + + private List questionTypeDtoList; + +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/QuestionTypeDto.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/QuestionTypeDto.java new file mode 100644 index 0000000..9a15d32 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/QuestionTypeDto.java @@ -0,0 +1,16 @@ +package com.hc.business.dto; + +import lombok.Data; + +import java.util.List; + +/** + * @author 10696 + */ +@Data +public class QuestionTypeDto { + + private String typeName; + + private List questionList; +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/RetrievePasswordDto.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/RetrievePasswordDto.java new file mode 100644 index 0000000..b1c807b --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/RetrievePasswordDto.java @@ -0,0 +1,34 @@ +package com.hc.business.dto; + +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * @author JIA + */ + +@Data +public class RetrievePasswordDto { + + @NotNull(message = "手机号不可以为空") + private String userMobile; + + @NotNull(message = "短信回执不可以为空") + private String sessionId; + + @NotNull(message = "验证码不可以为空") + private String code; + + @NotNull(message = "新密码不可以为空") + private String password; + + private String userName; + + private String userGender; + + private String userCompany; + + private String userEmail; + +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/SmsLoginDto.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/SmsLoginDto.java new file mode 100644 index 0000000..f429908 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/SmsLoginDto.java @@ -0,0 +1,23 @@ +package com.hc.business.dto; + +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * @author JIA + */ + +@Data +public class SmsLoginDto { + + @NotNull(message = "手机号不可以为空") + private String userMobile; + + @NotNull(message = "短信回执不可以为空") + private String sessionId; + + @NotNull(message = "验证码不可以为空") + private String code; + +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/StaTimeTable.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/StaTimeTable.java new file mode 100644 index 0000000..4f92735 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/StaTimeTable.java @@ -0,0 +1,17 @@ +package com.hc.business.dto; + +import lombok.Data; + +/** + * @author 10696 + * @since 2021/1/22 11:44 + */ + +@Data +public class StaTimeTable { + + private String clickDate; + + private Integer countCreate; + +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/ThirdCourseBack.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/ThirdCourseBack.java new file mode 100644 index 0000000..1f0a842 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/ThirdCourseBack.java @@ -0,0 +1,48 @@ +package com.hc.business.dto; + +import lombok.Data; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import java.io.Serializable; + +/** + * 第三方用户课程配置表(ThirdCourse)实体类 + * + * @author java + * @since 2020-06-17 17:29:30 + */ + +@Data +public class ThirdCourseBack implements Serializable { + + private static final long serialVersionUID = 819515458055433747L; + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + /** + * 第三方用户ID + */ + private Integer thirdId; + /** + * 课程ID + */ + private Integer courseId; + /** + * 是否有效,默认有效 + */ + private Integer status; + /** + * 配置时间 + */ + private Long createTime = System.currentTimeMillis(); + + + private String courseName; + private String courseLogo; +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/ThirdCourseDto.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/ThirdCourseDto.java new file mode 100644 index 0000000..356fb11 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/ThirdCourseDto.java @@ -0,0 +1,24 @@ +package com.hc.business.dto; + +import com.hc.business.model.Course; +import com.hc.business.model.CourseChapterVideo; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author 10696 + */ + +@Data +public class ThirdCourseDto implements Serializable { + + private static final long serialVersionUID = -570784181035882992L; + + private Course course; + + private List courseChapterVideoList; + + +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/TypeCourseDto.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/TypeCourseDto.java new file mode 100644 index 0000000..69ddb92 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/TypeCourseDto.java @@ -0,0 +1,29 @@ +package com.hc.business.dto; + +import lombok.Getter; + + +/** + * 用户课程表(TypeCourse)实体类 + * + * @author java + * @since 2020-11-09 10:05:18 + */ +@Getter +public class TypeCourseDto { + + private Integer courseTypeReId; + + + private Integer courseId; + + + private String courseName; + + private String courseLogo; + + + private Integer courseHours; + private String courseTeacher; + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/UserCourseDto.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/UserCourseDto.java new file mode 100644 index 0000000..ecd134b --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/UserCourseDto.java @@ -0,0 +1,53 @@ +package com.hc.business.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 用户课程表(UserCourse)实体类 + * + * @author java + * @since 2020-11-09 10:05:18 + */ +@Getter +public class UserCourseDto { + + private Integer userCourseId; + + private Integer userId; + + private Integer courseId; + + private Double coursePercent; + + private String years; + + private Integer classId; + + private String courseName; + + private String courseLogo; + + private Integer courseType; + + private Integer courseHours; + private String courseTeacher; + +// private String courseDesc; + + // private Float courseHours; + + //private String courseTeacher; + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/UserListDto.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/UserListDto.java new file mode 100644 index 0000000..b1ba12d --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/UserListDto.java @@ -0,0 +1,59 @@ +package com.hc.business.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Getter; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 用户表(User)实体类 + * + * @author java + * @since 2020-11-09 10:04:13 + */ +@Getter +public class UserListDto implements Serializable { + + + + private Integer userId; + + + private Integer userType; + + + private String userName; + + private String userMobile; + + private String userEmail; + + private String userGender; + + + private String userCompany; + + ///订单编号 + private long orderNumber; + //支付状态 + private int orderStatus; + //支付时间 + private long orderTime; + + //标题 + private String className; + + //备注 + private String userReserved; + + +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/UserPriceTotal.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/UserPriceTotal.java new file mode 100644 index 0000000..b4f4dff --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/UserPriceTotal.java @@ -0,0 +1,23 @@ +package com.hc.business.dto; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @author 10696 + * @since 2021/1/26 10:51 + */ + +@Data +public class UserPriceTotal { + + private BigDecimal totalUserCount; + + private BigDecimal todayUserCount; + + private BigDecimal monthUserCount; + + private BigDecimal yearUserCount; + +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/UserStatusClassDto.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/UserStatusClassDto.java new file mode 100644 index 0000000..3b576e4 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/UserStatusClassDto.java @@ -0,0 +1,45 @@ +package com.hc.business.dto; + +import lombok.Getter; + +/** + * @author 10696 + * @since 2020/12/6 11:50 + */ + +@Getter +public class UserStatusClassDto { + + private Integer statusId; + + private String className; + + private Float totalHours; + + private Long applyStartTime; + + private Long applyEndTime; + + private Long studyStartTime; + + private Long studyEndTime; + + private Long paperStartTime; + + private Long paperEndTime; + + private Long certStartTime; + + private Long certEndTime; + + private Integer classConfigId; + + private Integer needPaper; + + private Integer paperId; + + private Integer userId; + + private Integer status; + +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/UserTimeTotal.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/UserTimeTotal.java new file mode 100644 index 0000000..21fcec7 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/dto/UserTimeTotal.java @@ -0,0 +1,21 @@ +package com.hc.business.dto; + +import lombok.Data; + +/** + * @author 10696 + * @since 2021/1/22 13:30 + */ + +@Data +public class UserTimeTotal { + + private Integer totalUserCount; + + private Integer todayUserCount; + + private Integer monthUserCount; + + private Integer yearUserCount; + +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/AreaDistrictMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/AreaDistrictMapper.java new file mode 100644 index 0000000..86b4e60 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/AreaDistrictMapper.java @@ -0,0 +1,27 @@ +package com.hc.business.mapper; + +import com.hc.business.model.AreaDistrict; +import com.hc.core.utils.mapper.Mapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 省份表(AreaDistrict)表数据库访问层 + * + * @author java + * @since 2020-11-20 12:48:45 + */ + +@Repository +public interface AreaDistrictMapper extends Mapper { + + /** + * 依据parentId获取地区 + * + * @param parentId 父级id + * @return 实例对象数组 + */ + List queryAllByParentId(Integer parentId); + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/BannerMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/BannerMapper.java new file mode 100644 index 0000000..53b93d4 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/BannerMapper.java @@ -0,0 +1,18 @@ +package com.hc.business.mapper; + +import com.hc.business.model.Banner; +import com.hc.core.utils.mapper.Mapper; +import org.springframework.stereotype.Repository; + +/** + * 广告表 + * (Banner)表数据库访问层 + * + * @author java + * @since 2020-11-26 09:29:48 + */ + +@Repository +public interface BannerMapper extends Mapper { + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/ClassConfigMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/ClassConfigMapper.java new file mode 100644 index 0000000..0c54e55 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/ClassConfigMapper.java @@ -0,0 +1,57 @@ +package com.hc.business.mapper; + +import com.hc.business.model.ClassConfig; +import com.hc.core.utils.mapper.Mapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 班次表(ClassConfig)表数据库访问层 + * + * @author java + * @since 2020-11-19 16:12:30 + */ + +@Repository +public interface ClassConfigMapper extends Mapper { + + /** + * 条件查询培训班 + * + * @param valid 是否上线 + * @return 实例对象数组 + */ + List queryByValid(Integer valid); + + /** + * 地区id查询培训班 + * + * @param areaId 地区id + * @return 实例对象数组 + */ + List queryByAreaId(Integer areaId); + + /** + * 培训班名称查询培训班 + * + * @param name 培训班名称 + * @return 实例对象数组 + */ + List queryByClassName(String name); + + /** + * 依据开始时间查询班次 + * + * @param studyStartTime + * @return + */ + List queryByTime(Long studyStartTime); + + /** + * 获取全部的培训班 + * + * @return 实例对象数组 + */ + List queryAll(); +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/ClassConfigSponsorMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/ClassConfigSponsorMapper.java new file mode 100644 index 0000000..7906def --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/ClassConfigSponsorMapper.java @@ -0,0 +1,26 @@ +package com.hc.business.mapper; + +import com.hc.business.model.ClassConfigSponsor; +import com.hc.core.utils.mapper.Mapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * (ClassConfigSponsor)表数据库访问层 + * + * @author java + * @since 2021-05-28 14:11:29 + */ + +@Repository +public interface ClassConfigSponsorMapper extends Mapper { + + /** + * 获取班次主办方信息 + * + * @param classId 班次id + * @return 实例对象数组 + */ + List queryListByClassId(Integer classId); +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/ClassCourseMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/ClassCourseMapper.java new file mode 100644 index 0000000..2f44e3b --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/ClassCourseMapper.java @@ -0,0 +1,42 @@ +package com.hc.business.mapper; + +import com.hc.business.dto.ClassCourseDto; +import com.hc.business.model.ClassCourse; +import com.hc.core.utils.mapper.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 班次课程表(ClassCourse)表数据库访问层 + * + * @author java + * @since 2020-11-24 11:30:06 + */ + +@Repository +public interface ClassCourseMapper extends Mapper { + + /** + * 查询班级课程 + * + * @param classId 班级id + * @param courseType 类别 + * @return 实例对象数组 + */ + List queryByClassId(@Param("classId") Integer classId, + @Param("courseType") Integer courseType); + + /** + * 查询重复课程 + * + * @param classId 班级id + * @param courseId 课程id + * @return 实例对象数组 + */ + List queryByClassIdWithCourseId(@Param("classId") Integer classId, + @Param("courseId") Integer courseId); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseChapterAnnexMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseChapterAnnexMapper.java new file mode 100644 index 0000000..3a9995b --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseChapterAnnexMapper.java @@ -0,0 +1,17 @@ +package com.hc.business.mapper; + +import com.hc.business.model.CourseChapterAnnex; +import com.hc.core.utils.mapper.Mapper; +import org.springframework.stereotype.Repository; + +/** + * 章节附件表(CourseChapterAnnex)表数据库访问层 + * + * @author java + * @since 2020-11-09 10:04:49 + */ + +@Repository +public interface CourseChapterAnnexMapper extends Mapper { + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseChapterMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseChapterMapper.java new file mode 100644 index 0000000..2649c3d --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseChapterMapper.java @@ -0,0 +1,28 @@ +package com.hc.business.mapper; + +import com.hc.business.model.CourseChapter; +import org.springframework.stereotype.Repository; +import com.hc.core.utils.mapper.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 课程章节表(CourseChapter)表数据库访问层 + * + * @author java + * @since 2020-11-09 10:04:47 + */ + + +@Repository +public interface CourseChapterMapper extends Mapper { + + /** + * 改版 william + * + * @param map + * @return + */ + List getCourseChapterChildList(Map map); +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseChapterTagMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseChapterTagMapper.java new file mode 100644 index 0000000..5427cc3 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseChapterTagMapper.java @@ -0,0 +1,17 @@ +package com.hc.business.mapper; + +import com.hc.business.model.CourseChapterTag; +import org.springframework.stereotype.Repository; +import com.hc.core.utils.mapper.Mapper; + +/** + * 图书章节标签表。新建完成的图书章节,可以根据讲师不同,给不同的章节打标签,比如基础阶段,进阶阶段。。。(CourseChapterTag)表数据库访问层 + * + * @author java + * @since 2020-11-09 10:04:51 + */ + +@Repository +public interface CourseChapterTagMapper extends Mapper { + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseChapterTestMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseChapterTestMapper.java new file mode 100644 index 0000000..531485d --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseChapterTestMapper.java @@ -0,0 +1,17 @@ +package com.hc.business.mapper; + +import com.hc.business.model.CourseChapterTest; +import org.springframework.stereotype.Repository; +import com.hc.core.utils.mapper.Mapper; + +/** + * 章节测试表/随堂练习表(CourseChapterTest)表数据库访问层 + * + * @author java + * @since 2020-11-09 10:04:53 + */ + +@Repository +public interface CourseChapterTestMapper extends Mapper { + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseChapterVideoMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseChapterVideoMapper.java new file mode 100644 index 0000000..e826249 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseChapterVideoMapper.java @@ -0,0 +1,35 @@ +package com.hc.business.mapper; + +import com.hc.business.model.CourseChapterVideo; +import org.springframework.stereotype.Repository; +import com.hc.core.utils.mapper.Mapper; + +import java.util.List; + +/** + * 课程视频(CourseChapterVideo)表数据库访问层 + * + * @author java + * @since 2020-11-09 10:04:55 + */ + +@Repository +public interface CourseChapterVideoMapper extends Mapper { + + /** + * 获取章节下的所有视频 + * + * @param chapterId 章节id + * @return 实例对象数组 + */ + List selectVideoByChapterId(Integer chapterId); + + /** + * 获取图书下的所有视频 + * + * @param courseId 课程id + * @return 实例对象数组 + */ + List selectVideoByCourseId(Integer courseId); + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseMapper.java new file mode 100644 index 0000000..e6a8739 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseMapper.java @@ -0,0 +1,50 @@ +package com.hc.business.mapper; + +import com.hc.business.model.Course; +import org.springframework.stereotype.Repository; +import com.hc.core.utils.mapper.Mapper; + +import java.util.List; + +/** + * 课程表(Course)表数据库访问层 + * + * @author java + * @since 2020-11-09 10:04:45 + */ + +@Repository +public interface CourseMapper extends Mapper { + + /** + * 查询所有的课程分类id + * + * @param typeId 分类id + * @return 实例对象数组 + */ + List queryByTypeId(Integer typeId); + + /** + * 依据老师名称获取课程 + * + * @param name 老师名称 + * @return 实例对象数组 + */ + List queryTeacherName(String name); + + /** + * 依据课程名称获取课程 + * + * @param name 课程名称 + * @return 实例对象数组 + */ + List queryCourseName(String name); + + /** + * 获取全部课程 + * + * @param valid 是否上下架 + * @return 实例对象数组 + */ + List queryAll(Integer valid); +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseTypeMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseTypeMapper.java new file mode 100644 index 0000000..b98987a --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseTypeMapper.java @@ -0,0 +1,29 @@ +package com.hc.business.mapper; + +import com.hc.business.model.CourseType; +import org.springframework.stereotype.Repository; +import tk.mybatis.mapper.common.Mapper; + +import java.util.List; + +/** + * (CourseType)表数据库访问层 + * + * @author java + * @since 2020-12-17 14:12:51 + */ + +@Repository +public interface CourseTypeMapper extends Mapper { + + /** + * 查询课程分类 + * + * @param courseName 课程分类名称 + * @return 实例对象数组 + */ + List queryAllByCourseName(String courseName); + + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseTypeRelationMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseTypeRelationMapper.java new file mode 100644 index 0000000..8510251 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/CourseTypeRelationMapper.java @@ -0,0 +1,17 @@ +package com.hc.business.mapper; + +import com.hc.business.model.CourseTypeRelation; +import com.hc.core.utils.mapper.Mapper; +import org.springframework.stereotype.Repository; + +/** + * (CourseTypeRelation)表数据库访问层 + * + * @author java + * @since 2021-02-02 09:25:08 + */ + +@Repository +public interface CourseTypeRelationMapper extends Mapper { + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/NewsMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/NewsMapper.java new file mode 100644 index 0000000..f61a368 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/NewsMapper.java @@ -0,0 +1,29 @@ +package com.hc.business.mapper; + +import com.hc.business.model.News; +import com.hc.core.utils.mapper.Mapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 新闻表 + * (News)表数据库访问层 + * + * @author java + * @since 2020-11-20 11:48:36 + */ + +@Repository +public interface NewsMapper extends Mapper { + + /** + * 依据标签id查询news + * + * @param tagId 标签id + * @return 实例对象数组 + */ + List queryByTagId(Integer tagId); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/NewsTagMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/NewsTagMapper.java new file mode 100644 index 0000000..7e3ead5 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/NewsTagMapper.java @@ -0,0 +1,26 @@ +package com.hc.business.mapper; + +import com.hc.business.model.NewsTag; +import com.hc.core.utils.mapper.Mapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 新闻标签表(NewsTag)表数据库访问层 + * + * @author java + * @since 2020-11-20 12:52:32 + */ + +@Repository +public interface NewsTagMapper extends Mapper { + + /** + * 分页查询多条数据 + * + * @return 对象列表 + */ + List queryAll(); + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/OrderUserLogMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/OrderUserLogMapper.java new file mode 100644 index 0000000..578c663 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/OrderUserLogMapper.java @@ -0,0 +1,38 @@ +package com.hc.business.mapper; + +import com.hc.business.model.OrderUserLog; +import com.hc.core.utils.mapper.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * (OrderUserLog)表数据库访问层 + * + * @author java + * @since 2020-12-03 09:25:08 + */ + +@Repository +public interface OrderUserLogMapper extends Mapper { + + /** + * 依据订单id查询用户 + * + * @param ordersId 订单id + * @return 实例对象数组 + */ + List queryByOrderId(Integer ordersId); + + /** + * 依据用户id和订单id查询 + * + * @param ordersId 订单id + * @param userId 用户id + * @return 实例对象数组 + */ + List queryByUserIdAndOrderId(@Param("ordersId") Integer ordersId, + @Param("userId") Integer userId); + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/OrdersMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/OrdersMapper.java new file mode 100644 index 0000000..a2b329a --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/OrdersMapper.java @@ -0,0 +1,112 @@ +package com.hc.business.mapper; + +import com.hc.business.dto.OrderInvoicesDto; +import com.hc.business.model.Orders; +import com.hc.core.utils.mapper.Mapper; +import org.springframework.stereotype.Repository; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 订单表(Orders)表数据库访问层 + * + * @author java + * @since 2020-11-26 16:46:42 + */ + +@Repository +public interface OrdersMapper extends Mapper { + + /** + * 依据订单编号获取订单信息 + * + * @param orderNo 订单编号 + * @return 实例对象 + */ + Orders queryByOrderNo(String orderNo); + + /** + * 依据用户id 查询 + * + * @param userId 用户id + * @return 实例对象数组 + */ + List queryAllByUserId(Integer userId); + + /** + * 用户 查询多条数据 + * + * @param classId 班次id + * @return 对象列表 + */ + List queryAllByClassId(Integer classId); + + /** + * 用户 查询多条数据 + * + * @param className 班次名称 + * @return 对象列表 + */ + List queryAllByClassName(String className); + + /** + * 用户 查询多条数据 + * + * @param status 订单状态 + * @return 对象列表 + */ + List queryAllByStatus(Integer status); + + /** + * 依据发票id查询 + * + * @param userInvoicesId 发票id + * @return 实例对象数组 + */ + List queryByUserInvoicesId(Integer userInvoicesId); + + /** + * 查询总金额 + * + * @return 实例对象数组 + */ + BigDecimal countPrice(); + + /** + * 当天订单金额 + * + * @return int + */ + BigDecimal queryToday(); + + /** + * 当月订单金额 + * + * @return int + */ + BigDecimal queryMonth(); + + /** + * 当年订单金额 + * + * @return int + */ + BigDecimal queryYear(); + + /** + * 获取订单数量 + * + * @return 实例对象 + */ + Integer countOrderTotal(); + + + /** + * 查询有效的发票和订单 + * + * @return 实例对象数组 + */ + List queryAllWithInvoices(); + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/PaperMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/PaperMapper.java new file mode 100644 index 0000000..49a29ba --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/PaperMapper.java @@ -0,0 +1,17 @@ +package com.hc.business.mapper; + +import com.hc.business.model.Paper; +import com.hc.core.utils.mapper.Mapper; +import org.springframework.stereotype.Repository; + +/** + * 试卷表(Paper)表数据库访问层 + * + * @author java + * @since 2020-12-07 11:34:34 + */ + +@Repository +public interface PaperMapper extends Mapper { + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/PaperQuestionMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/PaperQuestionMapper.java new file mode 100644 index 0000000..2b42371 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/PaperQuestionMapper.java @@ -0,0 +1,27 @@ +package com.hc.business.mapper; + +import com.hc.business.model.PaperQuestion; +import com.hc.core.utils.mapper.Mapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 随机试卷问题表(PaperQuestion)表数据库访问层 + * + * @author java + * @since 2020-12-07 11:35:11 + */ + +@Repository +public interface PaperQuestionMapper extends Mapper { + + /** + * 依据试卷id获取抽题规则 + * + * @param paperId 试卷id + * @return 实例对象数组 + */ + List queryByPaperId(Integer paperId); + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/QuestionAnswerMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/QuestionAnswerMapper.java new file mode 100644 index 0000000..069dde5 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/QuestionAnswerMapper.java @@ -0,0 +1,34 @@ +package com.hc.business.mapper; + +import com.hc.business.model.QuestionAnswer; +import com.hc.core.utils.mapper.Mapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 问题答案表(QuestionAnswer)表数据库访问层 + * + * @author java + * @since 2020-12-07 11:36:19 + */ + +@Repository +public interface QuestionAnswerMapper extends Mapper { + + /** + * 获取习题答案 + * + * @param questionId 试题id + * @return 实例对象数组 + */ + List queryByQuestionId(Integer questionId); + + /** + * 依据试题id获取答案id + * + * @param questionId 试题id + * @return 实例对象数组 + */ + List selectAnswerIdListByQuestionId(Integer questionId); +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/QuestionMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/QuestionMapper.java new file mode 100644 index 0000000..c25ac93 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/QuestionMapper.java @@ -0,0 +1,50 @@ +package com.hc.business.mapper; + +import com.hc.business.model.Question; +import com.hc.core.utils.mapper.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 习题表(Question)表数据库访问层 + * + * @author java + * @since 2020-12-07 11:35:55 + */ + +@Repository +public interface QuestionMapper extends Mapper { + + + /** + * 依据主键获取题目 + * + * @param questionId 题目id + * @return 实例对象 + */ + Question queryById(Integer questionId); + + + /** + * 获取全部习题 + * + * @return 实例对象数组 + */ + List queryQuestions(); + + + /** + * 获取习题id + * + * @return 实例对象数组 + */ + List queryByTagId(@Param("questionType") Integer questionType, + @Param("questionLevel") Integer questionLevel, + @Param("questionTagId") Integer questionTagId); + + + + List queryTagId(@Param("questionTagId") Integer questionTagId); +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/QuestionTagMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/QuestionTagMapper.java new file mode 100644 index 0000000..20c1bde --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/QuestionTagMapper.java @@ -0,0 +1,17 @@ +package com.hc.business.mapper; + +import com.hc.business.model.QuestionTag; +import com.hc.core.utils.mapper.Mapper; +import org.springframework.stereotype.Repository; + +/** + * 问题标签表(QuestionTag)表数据库访问层 + * + * @author java + * @since 2020-12-07 11:36:39 + */ + +@Repository +public interface QuestionTagMapper extends Mapper { + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/QuestionTypeMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/QuestionTypeMapper.java new file mode 100644 index 0000000..fd33417 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/QuestionTypeMapper.java @@ -0,0 +1,17 @@ +package com.hc.business.mapper; + +import com.hc.business.model.QuestionType; +import com.hc.core.utils.mapper.Mapper; +import org.springframework.stereotype.Repository; + +/** + * 问题类型表(QuestionType)表数据库访问层 + * + * @author java + * @since 2020-12-07 11:37:00 + */ + +@Repository +public interface QuestionTypeMapper extends Mapper { + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/ThirdCourseMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/ThirdCourseMapper.java new file mode 100644 index 0000000..ae8a21c --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/ThirdCourseMapper.java @@ -0,0 +1,29 @@ +package com.hc.business.mapper; + +import com.hc.business.model.Course; +import com.hc.business.model.ThirdCourse; +import com.hc.core.utils.mapper.Mapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + + +/** + * 第三方用户课程配置表(ThirdCourse)表数据库访问层 + * + * @author java + * @since 2020-06-17 17:29:30 + */ + +@Repository +public interface ThirdCourseMapper extends Mapper { + + /** + * 获取课程 + * + * @param thirdId 第三方主键 + * @return 实例对象数组 + */ + List queryThreadCourse(Integer thirdId); + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/ThirdMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/ThirdMapper.java new file mode 100644 index 0000000..6d1c6ca --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/ThirdMapper.java @@ -0,0 +1,30 @@ +package com.hc.business.mapper; + +import com.hc.business.model.Third; + +import com.hc.core.utils.mapper.Mapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 第三方用户表(Third)表数据库访问层 + * + * @author java + * @since 2020-06-17 17:29:30 + */ + +@Repository +public interface ThirdMapper extends Mapper { + + /** + * 依据token 获取第三方信息 + * + * @param token 校验码 + * @return 实例对象数组 + */ + List queryThirdByToken(String token); + + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserAdminMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserAdminMapper.java new file mode 100644 index 0000000..344ade3 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserAdminMapper.java @@ -0,0 +1,27 @@ +package com.hc.business.mapper; + +import com.hc.business.model.UserAdmin; +import com.hc.core.utils.mapper.Mapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 管理员表(UserAdmin)表数据库访问层 + * + * @author java + * @since 2020-11-16 13:45:04 + */ + +@Repository +public interface UserAdminMapper extends Mapper { + + /** + * 依据用户名查找管理员 + * + * @param adminAccount 用户名 + * @return 实例对象数组 + */ + List selectUserAdmin(String adminAccount); + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserAdviseMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserAdviseMapper.java new file mode 100644 index 0000000..4b538ed --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserAdviseMapper.java @@ -0,0 +1,42 @@ +package com.hc.business.mapper; + +import com.hc.business.model.UserAdvise; +import com.hc.core.utils.mapper.Mapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 用户建议表 + * (UserAdvise)表数据库访问层 + * + * @author java + * @since 2020-11-16 14:20:02 + */ + +@Repository +public interface UserAdviseMapper extends Mapper { + + /** + * 依据用户id查询建议 + * + * @param userId 用户id + * @return 实例对象数组 + */ + List queryAllByUserId(Integer userId); + + /** + * 依据类别id查询建议 + * + * @param adviceType 类别id + * @return 实例对象数组 + */ + List queryAllByAdviceType(Integer adviceType); + + /** + * 查询所有意见信息 + * + * @return 实例对象数组 + */ + List queryAll(); +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserCourseMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserCourseMapper.java new file mode 100644 index 0000000..acfd597 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserCourseMapper.java @@ -0,0 +1,61 @@ +package com.hc.business.mapper; + +import com.hc.business.dto.UserCourseDto; +import com.hc.business.model.UserCourse; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; +import com.hc.core.utils.mapper.Mapper; + +import java.util.List; + +/** + * 用户课程表(UserCourse)表数据库访问层 + * + * @author java + * @since 2020-11-09 10:05:19 + */ + +@Repository +public interface UserCourseMapper extends Mapper { + + /** + * 依据用户id 和培训班id 获取用户课程以及进度 + * + * @param userId 用户id + * @return 实例对象数组 + */ + List selectUserCourseList(@Param("userId") Integer userId, + @Param("classId") Integer classId); + + /** + * 依据用户id 和培训班id 获取用户课程 + * + * @param userId 用户id + * @param classId 班级id + * @return 实力对象数组 + */ + List selectUserCourseListByParam(@Param("userId") Integer userId, + @Param("classId") Integer classId); + + /** + * 依据用户id 和培训班id,课程id获取某个课程进度 获取用户课程以及进度 + * + * @param userId 用户id + * @return 实例对象数组 + */ + List selectUserCourseProgress(@Param("userId") Integer userId, + @Param("classId") Integer classId, + @Param("courseId") Integer courseId); + + /** + * 用户课程 + * + * @param userId 用户id + * @param classId 班级id + * @param courseId 课程id + * @return 实例对象数组 + */ + List selectUserCourse(@Param("userId") Integer userId, + @Param("classId") Integer classId, + @Param("courseId") Integer courseId); +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserInvoicesMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserInvoicesMapper.java new file mode 100644 index 0000000..363a0d7 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserInvoicesMapper.java @@ -0,0 +1,50 @@ +package com.hc.business.mapper; + +import com.hc.business.model.UserInvoices; +import com.hc.core.utils.mapper.Mapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 用户发票表(UserInvoices)表数据库访问层 + * + * @author java + * @since 2020-12-02 10:50:34 + */ + +@Repository +public interface UserInvoicesMapper extends Mapper { + + /** + * 获取用户发票信息 + * + * @param userId 用户id + * @return 实例对象数组 + */ + List queryDetailByUserId(Integer userId); + + /** + * 查询有效发票 + * + * @return 实例对象数组 + */ + List queryAll(); + + /** + * 获取班次发票信息 + * + * @param classId 班次id + * @return 实例对象数组 + */ + List queryByClassId(Integer classId); + + /** + * 获取状态获取发票信息 + * + * @param status 状态 + * @return 实例对象数组 + */ + List queryByStatus(Integer status); + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserMapper.java new file mode 100644 index 0000000..4fcb6f9 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserMapper.java @@ -0,0 +1,99 @@ +package com.hc.business.mapper; + +import com.hc.business.dto.StaTimeTable; +import com.hc.business.dto.UserListDto; +import com.hc.business.model.User; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; +import com.hc.core.utils.mapper.Mapper; + +import java.util.List; + +/** + * 用户表(User)表数据库访问层 + * + * @author java + * @since 2020-11-09 10:04:14 + */ + +@Repository +public interface UserMapper extends Mapper { + + /** + * 手机号查询用户 + * + * @param userMobile 手机号 + * @return 实例对象数组 + */ + List queryUserByMobile(String userMobile); + + /** + * 身份证号查询用户 + * + * @param cardId 身份证号 + * @return 实例对象数组 + */ + List queryOneByCardId(String cardId); + + /** + * 姓名查询用户 + * + * @param name 身份证号 + * @return 实例对象数组 + */ + List queryUserByName(String name); + + + /** + * 姓名查询用户 + * + * @param name 身份证号 + * @return 实例对象数组 + */ + List queryUserByClassName(@Param("name")String name); + + /** + * 姓名查询用户 + * + * @param name 身份证号 + * @return 实例对象数组 + */ + List queryUserByClassNameAndPay(@Param("name")String name); + + /** + * 获取最近七天用户统计数量 + * + * @return 实例对象数组 + */ + List queryByUserCount(); + + /** + * 当天注册用户 + * + * @return int + */ + Integer queryToday(); + + /** + * 当月注册用户 + * + * @return int + */ + Integer queryMonth(); + + /** + * 当年注册用户 + * + * @return int + */ + Integer queryYear(); + + /** + * 用户总数 + * + * @return int + */ + int queryTotal(); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserRefundHistoryMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserRefundHistoryMapper.java new file mode 100644 index 0000000..55db353 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserRefundHistoryMapper.java @@ -0,0 +1,26 @@ +package com.hc.business.mapper; + +import com.hc.business.model.UserRefundHistory; +import org.springframework.stereotype.Repository; +import tk.mybatis.mapper.common.Mapper; + + +/** + * 用户退款记录表(UserRefundHistory)表数据库访问层 + * + * @author java + * @since 2020-12-10 11:31:38 + */ + +@Repository +public interface UserRefundHistoryMapper extends Mapper { + + /** + * 依据订单号查询退货单 + * + * @param orderNo 订单号 + * @return 实例对象 + */ + UserRefundHistory queryByOrderNo(String orderNo); + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserStatusMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserStatusMapper.java new file mode 100644 index 0000000..f4ccc42 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserStatusMapper.java @@ -0,0 +1,59 @@ +package com.hc.business.mapper; + +import com.hc.business.dto.UserStatusClassDto; +import com.hc.business.model.User; +import com.hc.business.model.UserStatus; +import com.hc.core.utils.mapper.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 用户班级学习进度表 + * (UserStatus)表数据库访问层 + * + * @author java + * @since 2020-12-06 11:26:42 + */ + +@Repository +public interface UserStatusMapper extends Mapper { + + /** + * 查询用户培训记录 + * + * @param userId 用户id + * @return 实例对象数组 + */ + List queryDtoByUserId(Integer userId); + + + /** + * 查询用户状态 + * + * @param userId 用户id + * @return 实例对象数组 + */ + List queryByUserId(Integer userId); + + + /** + * 查询用户状态 + * + * @param userId 用户id + * @param classId 班次id + * @return 实例对象数组 + */ + List queryByClassIdAndUserId(@Param("classId") Integer classId, + @Param("userId") Integer userId); + + /** + * 查询用户状态 + * + * @param classId 班次id + * @return 实例对象数组 + */ + List queryByClassId(Integer classId); + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserTeacherMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserTeacherMapper.java new file mode 100644 index 0000000..844eba1 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserTeacherMapper.java @@ -0,0 +1,27 @@ +package com.hc.business.mapper; + +import com.hc.business.model.UserTeacher; +import com.hc.core.utils.mapper.Mapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * (UserTeacher)表数据库访问层 + * + * @author java + * @since 2020-11-20 11:08:18 + */ + +@Repository +public interface UserTeacherMapper extends Mapper { + + /** + * 依据老师名称查询老师 + * + * @param name 老师名称 + * @return 实例对象数组 + */ + List queryByName(String name); + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserTestHistoryMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserTestHistoryMapper.java new file mode 100644 index 0000000..a9d3cc3 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserTestHistoryMapper.java @@ -0,0 +1,26 @@ +package com.hc.business.mapper; + +import com.hc.business.model.UserTestHistory; +import com.hc.core.utils.mapper.Mapper; +import org.springframework.stereotype.Repository; + +/** + * 用户考试记录表(UserTestHistory)表数据库访问层 + * + * @author java + * @since 2020-12-07 11:28:18 + */ + +@Repository +public interface UserTestHistoryMapper extends Mapper { + + /** + * 获取当前最高成绩 + * + * @param userId 用户id + * @param classId 班次id + * @return 实例对象 + */ + UserTestHistory queryMaxScore(Integer userId, Integer classId); + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserVideoPositionMapper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserVideoPositionMapper.java new file mode 100644 index 0000000..ad590e5 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/mapper/UserVideoPositionMapper.java @@ -0,0 +1,30 @@ +package com.hc.business.mapper; + +import com.hc.business.model.UserVideoPosition; +import com.hc.core.utils.mapper.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 用户视频观看记录(UserVideoPosition)表数据库访问层 + * + * @author java + * @since 2020-05-29 15:50:50 + */ + +@Repository +public interface UserVideoPositionMapper extends Mapper{ + + /** + * 查询视频观看记录 + * + * @param videoId + * @param userId + * @return + */ + List selectUserPositionByUserAndVideo(@Param("videoId") Integer videoId, + @Param("userId") Integer userId); + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/AreaDistrict.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/AreaDistrict.java new file mode 100644 index 0000000..b6af214 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/AreaDistrict.java @@ -0,0 +1,143 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Transient; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + + +/** + * 省份表(AreaDistrict)实体类 + * + * @author java + * @since 2020-11-20 12:48:44 + */ + +@ApiModel(value = "地区表") +public class AreaDistrict implements Serializable { + + private static final long serialVersionUID = -60609528264342036L; + + /** + * 地区编号 + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "地区编号") + private Integer areaId; + + /** + * 地区名称 + */ + @ApiModelProperty(value = "地区名称", required = true) + @NotNull + private String areaName; + + /** + * 父级编号 + */ + @ApiModelProperty(value = "父级编号", required = true) + @NotNull + private Integer parentId; + + /** + * 省级配图 + */ + @ApiModelProperty(value = "省级配图", required = true) + private String areaImage; + + /** + * 地区状态 0/锁定 1/开放 + */ + @ApiModelProperty(value = "地区状态 0/锁定 1/开放", required = true) + private Integer areaStatus; + + /** + * 地区索引 + */ + @ApiModelProperty(value = "地区索引", required = true) + @NotNull + private Integer areaIndex; + + /** + * 构造的 + */ + @Transient + private List areaDistrictList; + + public AreaDistrict(Integer areaId, @NotNull String areaName, + @NotNull Integer parentId, String areaImage, + Integer areaStatus, @NotNull Integer areaIndex) { + this.areaId = areaId; + this.areaName = areaName; + this.parentId = parentId; + this.areaImage = areaImage; + this.areaStatus = areaStatus; + this.areaIndex = areaIndex; + } + + public AreaDistrict() { + } + + public Integer getAreaId() { + return areaId; + } + + public void setAreaId(Integer areaId) { + this.areaId = areaId; + } + + public String getAreaName() { + return areaName; + } + + public void setAreaName(String areaName) { + this.areaName = areaName; + } + + public Integer getParentId() { + return parentId; + } + + public void setParentId(Integer parentId) { + this.parentId = parentId; + } + + public String getAreaImage() { + return areaImage; + } + + public void setAreaImage(String areaImage) { + this.areaImage = areaImage; + } + + public Integer getAreaStatus() { + return areaStatus; + } + + public void setAreaStatus(Integer areaStatus) { + this.areaStatus = areaStatus; + } + + public Integer getAreaIndex() { + return areaIndex; + } + + public void setAreaIndex(Integer areaIndex) { + this.areaIndex = areaIndex; + } + + public List getAreaDistrictList() { + return areaDistrictList; + } + + public void setAreaDistrictList(List areaDistrictList) { + this.areaDistrictList = areaDistrictList; + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Banner.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Banner.java new file mode 100644 index 0000000..9a0532c --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Banner.java @@ -0,0 +1,119 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 广告表 + * (Banner)实体类 + * + * @author java + * @since 2020-11-26 09:29:46 + */ + + +@ApiModel(value = "banner表") +public class Banner implements Serializable { + + private static final long serialVersionUID = -34877727454440687L; + + /** + * ID主键 + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "ID主键") + private Integer bannerId; + + /** + * 广告连接 + */ + @ApiModelProperty(value = "广告连接", required = true) + @NotNull + private String bannerUrl; + + /** + * 索引 + */ + @ApiModelProperty(value = "索引", required = true) + @NotNull + private Integer bannerIndex; + + + /** + * banner的位置01分表表示主banner,教师banner + */ + @ApiModelProperty(value = "banner的位置01分表表示主banner,教师banner", required = true) + @NotNull + private Integer bannerType; + + + /** + * banner的跳转位置 + */ + @ApiModelProperty(value = "banner的跳转位置", required = true) + private String bannerDest; + + public Banner(Integer bannerId, + @NotNull String bannerUrl, + @NotNull Integer bannerIndex, + @NotNull Integer bannerType, + String bannerDest) { + this.bannerId = bannerId; + this.bannerUrl = bannerUrl; + this.bannerIndex = bannerIndex; + this.bannerType = bannerType; + this.bannerDest = bannerDest; + + } + + public Banner() { + } + + public Integer getBannerId() { + return bannerId; + } + + public void setBannerId(Integer bannerId) { + this.bannerId = bannerId; + } + + public String getBannerUrl() { + return bannerUrl; + } + + public void setBannerUrl(String bannerUrl) { + this.bannerUrl = bannerUrl; + } + + public Integer getBannerIndex() { + return bannerIndex; + } + + public void setBannerIndex(Integer bannerIndex) { + this.bannerIndex = bannerIndex; + } + + public Integer getBannerType() { + return bannerType; + } + + public void setBannerType(Integer bannerType) { + this.bannerType = bannerType; + } + + public String getBannerDest() { + return bannerDest; + } + + public void setBannerDest(String bannerDest) { + this.bannerDest = bannerDest; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/ClassConfig.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/ClassConfig.java new file mode 100644 index 0000000..b77f134 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/ClassConfig.java @@ -0,0 +1,202 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Transient; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 班次表(ClassConfig)实体类 + * + * @author java + * @since 2020-11-19 16:12:27 + */ + + +@Data +@ApiModel(value = "班次表") +public class ClassConfig implements Serializable { + + private static final long serialVersionUID = 627209293304274727L; + + + /** + * 地区配置编号 + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "地区配置编号") + private Integer classConfigId; + + /** + * 班次名称名称 + */ + @ApiModelProperty(value = "班次名称名称", required = true) + @NotNull + private String className; + + /** + * 培训班介绍 + */ + @ApiModelProperty(value = "培训班介绍", required = true) + @NotNull + private String classDesc; + + /** + * 类型目前启用123,分表表示先上班看课+考试+打印证书 2.考试+打印证书 3只打印证书 23对应线下班 + */ + @ApiModelProperty(value = "类型目前启用123,分表表示先上班看课+考试+打印证书 2.考试+打印证书 3只打印证书 23对应线下班", required = true) + private Integer classType; + + + /** + * 配图地址 + */ + @ApiModelProperty(value = "配图地址", required = true) + @NotNull + private String classLogo; + + /** + * PC配图地址 + */ + @ApiModelProperty(value = "新PC配图地址") + private String classContent; + + /** + * 移动端配图地址 + */ + @ApiModelProperty(value = "移动端配图地址") + private String classMobileContent; + + /** + * 地区编号 + */ + @ApiModelProperty(value = "地区编号", required = true) + @NotNull + private Integer areaId; + + @Transient + @ApiModelProperty(value = "地区名称") + private String areaName; + + /** + * 必修课学时,根据选得必修课自动计算 + */ + @ApiModelProperty(value = "必修课学时,根据选得必修课自动计算", required = true) + private Float bxHours; + + /** + * 选修课学时,管理员录入 + */ + @ApiModelProperty(value = "选修课学时,管理员录入", required = true) + private Float xxHours; + + /** + * 考试学分,考试通过自动获取 + */ + @ApiModelProperty(value = "考试学分,考试通过自动获取", required = true) + private Float paperHours; + + /** + * 试卷 + */ + @ApiModelProperty(value = "试卷") + private Integer paperId; + + /** + * 创建时间 + */ + @ApiModelProperty(value = "创建时间") + private Long createTime; + + /** + * 年份 + */ + @ApiModelProperty(value = "年份") + private String years; + + /** + * 单价 + */ + @ApiModelProperty(value = "单价", required = true) + @NotNull + private Double price; + + /** + * 报名开始时间 + */ + @ApiModelProperty(value = "报名开始时间", required = true) + private Long applyStartTime; + + /** + * 报名结束时间 + */ + @ApiModelProperty(value = "报名结束时间", required = true) + private Long applyEndTime; + + /** + * 学习开始时间 + */ + @ApiModelProperty(value = "学习开始时间", required = true) + private Long studyStartTime; + + /** + * 学习结束时间 + */ + @ApiModelProperty(value = "学习结束时间", required = true) + private Long studyEndTime; + + /** + * 考试开始开始时间 + */ + @ApiModelProperty(value = "考试开始开始时间", required = true) + private Long paperStartTime; + + /** + * 考试结束时间 + */ + @ApiModelProperty(value = "考试结束时间", required = true) + private Long paperEndTime; + + /** + * 打印证书开始时间 + */ + @ApiModelProperty(value = "打印证书开始时间", required = true) + private Long certStartTime; + + /** + * 打印证书结束时间,可以不限制 + */ + @ApiModelProperty(value = "打印证书结束时间,可以不限制", required = true) + private Long certEndTime; + + /** + * 是否需要考试 + */ + @ApiModelProperty(value = "是否需要考试", required = true) + @NotNull + private Integer needPaper; + + /** + * 是否有效 + */ + @ApiModelProperty(value = "是否有效 0 无效 1有效 ") + private Integer valid; + + /** + * 签证时间 + */ + @ApiModelProperty(value = "签证时间") + private Long signTime; + + private String prefix; + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/ClassConfigSponsor.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/ClassConfigSponsor.java new file mode 100644 index 0000000..1c27dd0 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/ClassConfigSponsor.java @@ -0,0 +1,61 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @author jia + */ +@Data +@ApiModel(value = "班次图章表") +public class ClassConfigSponsor implements Serializable { + + private static final long serialVersionUID = 961577731337873266L; + + + /** + * 主键 + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键", required = true) + private Integer sponsorId; + + /** + * 主办方图章地址 + */ + @ApiModelProperty(value = "主办方图章地址", required = true) + private String sponsorUrl; + + /** + * 主板方名称 + */ + @ApiModelProperty(value = "主板方名称", required = true) + private String sponsorName; + + /** + * 班次id + */ + @ApiModelProperty(value = "班次id", required = true) + @NotNull + private Integer classId; + + /** + * 排序 + */ + @ApiModelProperty(value = "排序", required = true) + private Integer sponsorIndex; + + /** + * 创建时间 + */ + @ApiModelProperty(value = "创建时间", required = true) + private Long createTime; +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/ClassCourse.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/ClassCourse.java new file mode 100644 index 0000000..932afc7 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/ClassCourse.java @@ -0,0 +1,114 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 班次课程表(ClassCourse)实体类 + * + * @author java + * @since 2020-11-24 11:33:30 + */ + + +@ApiModel(value = "地区课程表") +public class ClassCourse implements Serializable { + + private static final long serialVersionUID = -67544251618141718L; + + + /** + * 地区课程编号 + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "地区课程编号") + private Integer classCourseId; + + /** + * 班次ID + */ + @ApiModelProperty(value = "班次ID", required = true) + @NotNull + private Integer classId; + + /** + * 课程编号 + */ + @ApiModelProperty(value = "课程编号", required = true) + @NotNull + private Integer courseId; + + /** + * 课程类型12分表示必选课,可选课 + */ + @ApiModelProperty(value = "课程类型12分表示必选课,可选课", required = true) + @NotNull + private Integer courseType; + + /** + * 创建时间 + */ + @ApiModelProperty(value = "创建时间") + private Long createTime; + + public ClassCourse(Integer classCourseId, @NotNull Integer classId, + @NotNull Integer courseId, + @NotNull Integer courseType, Long createTime) { + this.classCourseId = classCourseId; + this.classId = classId; + this.courseId = courseId; + this.courseType = courseType; + this.createTime = createTime; + } + + public ClassCourse() { + } + + public Integer getClassCourseId() { + return classCourseId; + } + + public void setClassCourseId(Integer classCourseId) { + this.classCourseId = classCourseId; + } + + public Integer getClassId() { + return classId; + } + + public void setClassId(Integer classId) { + this.classId = classId; + } + + public Integer getCourseId() { + return courseId; + } + + public void setCourseId(Integer courseId) { + this.courseId = courseId; + } + + public Integer getCourseType() { + return courseType; + } + + public void setCourseType(Integer courseType) { + this.courseType = courseType; + } + + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Course.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Course.java new file mode 100644 index 0000000..cbb2689 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Course.java @@ -0,0 +1,176 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 课程表(Course)实体类 + * + * @author java + * @since 2020-11-09 10:04:45 + */ + +@ApiModel(value = "课程表") +public class Course implements Serializable { + + private static final long serialVersionUID = -89648020880598418L; + + + /** + * 主键ID + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键ID") + private Integer courseId; + + /** + * 课程名称 + */ + @ApiModelProperty(value = "课程名称", required = true) + @NotNull + private String courseName; + + /** + * 图标 + */ + @ApiModelProperty(value = "图标", required = true) + @NotNull + private String courseLogo; + + /** + * 课程介绍 + */ + @ApiModelProperty(value = "课程介绍", required = true) + @NotNull + private String courseDesc; + + /** + * 课程时长 + */ + @ApiModelProperty(value = "课程时长", required = true) + private Float courseHours; + + /** + * 教师 + */ + @ApiModelProperty(value = "教师", required = true) + private String courseTeacher; + + /** + * 课程是否上架。下架后不可见 + */ + @ApiModelProperty(value = "课程是否上架。下架后不可见") + private Integer isValid; + + /** + * 如果有多张详情图,相册 + */ + @ApiModelProperty(value = "如果有多张详情图,相册") + private String gallery; + + /** + * 保留位,暂不使用 + */ + @ApiModelProperty(value = "保留位,暂不使用") + private Integer reserved1; + + public Course(Integer courseId, @NotNull String courseName, + @NotNull String courseLogo, @NotNull String courseDesc, + Float courseHours, + String courseTeacher, Integer isValid, + String gallery, Integer reserved1) { + this.courseId = courseId; + this.courseName = courseName; + this.courseLogo = courseLogo; + this.courseDesc = courseDesc; + this.courseHours = courseHours; + this.courseTeacher = courseTeacher; + this.isValid = isValid; + this.gallery = gallery; + this.reserved1 = reserved1; + } + + public Course() { + } + + public Integer getCourseId() { + return courseId; + } + + public void setCourseId(Integer courseId) { + this.courseId = courseId; + } + + public String getCourseName() { + return courseName; + } + + public void setCourseName(String courseName) { + this.courseName = courseName; + } + + public String getCourseLogo() { + return courseLogo; + } + + public void setCourseLogo(String courseLogo) { + this.courseLogo = courseLogo; + } + + public String getCourseDesc() { + return courseDesc; + } + + public void setCourseDesc(String courseDesc) { + this.courseDesc = courseDesc; + } + + public Float getCourseHours() { + return courseHours; + } + + public void setCourseHours(Float courseHours) { + this.courseHours = courseHours; + } + + public String getCourseTeacher() { + return courseTeacher; + } + + public void setCourseTeacher(String courseTeacher) { + this.courseTeacher = courseTeacher; + } + + public Integer getIsValid() { + return isValid; + } + + public void setIsValid(Integer isValid) { + this.isValid = isValid; + } + + public String getGallery() { + return gallery; + } + + public void setGallery(String gallery) { + this.gallery = gallery; + } + + public Integer getReserved1() { + return reserved1; + } + + public void setReserved1(Integer reserved1) { + this.reserved1 = reserved1; + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseChapter.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseChapter.java new file mode 100644 index 0000000..40b22bf --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseChapter.java @@ -0,0 +1,165 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Transient; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + + +/** + * 课程章节表(CourseChapter)实体类 + * + * @author java + * @since 2020-11-09 10:04:47 + */ + + +@ApiModel(value = "章节表") +public class CourseChapter implements Serializable { + + private static final long serialVersionUID = 873871660383226119L; + + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键id") + private Integer courseChapterId; + + /** + * 章节名字 + */ + @ApiModelProperty(value = "章节名字", required = true) + @NotNull + private String chapterName; + + /** + * 父节点ID + */ + @ApiModelProperty(value = "父节点ID", required = true) + @NotNull + private Integer parentId; + + /** + * 章节层级 + */ + @ApiModelProperty(value = "章节层级", required = true) + @NotNull + private Integer chapterLevel; + + /** + * 课程ID + */ + @ApiModelProperty(value = "课程ID", required = true) + @NotNull + private Integer courseId; + + /** + * 构造 + */ + @Transient + private List childChapter; + + @Transient + private CourseChapterVideo chapterVideo; + + @Transient + private CourseChapterAnnex courseChapterAnnex; + + @Transient + private UserVideoPosition userVideoPosition; + + public CourseChapter(Integer courseChapterId, @NotNull String chapterName, + @NotNull Integer parentId, + @NotNull Integer chapterLevel, + @NotNull Integer courseId) { + this.courseChapterId = courseChapterId; + this.chapterName = chapterName; + this.parentId = parentId; + this.chapterLevel = chapterLevel; + this.courseId = courseId; + } + + public CourseChapter() { + } + + public Integer getCourseChapterId() { + return courseChapterId; + } + + public void setCourseChapterId(Integer courseChapterId) { + this.courseChapterId = courseChapterId; + } + + public String getChapterName() { + return chapterName; + } + + public void setChapterName(String chapterName) { + this.chapterName = chapterName; + } + + public Integer getParentId() { + return parentId; + } + + public void setParentId(Integer parentId) { + this.parentId = parentId; + } + + public Integer getChapterLevel() { + return chapterLevel; + } + + public void setChapterLevel(Integer chapterLevel) { + this.chapterLevel = chapterLevel; + } + + public Integer getCourseId() { + return courseId; + } + + public void setCourseId(Integer courseId) { + this.courseId = courseId; + } + + public List getChildChapter() { + return childChapter; + } + + public void setChildChapter(List childChapter) { + this.childChapter = childChapter; + } + + public CourseChapterVideo getChapterVideo() { + return chapterVideo; + } + + public void setChapterVideo(CourseChapterVideo chapterVideo) { + this.chapterVideo = chapterVideo; + } + + public CourseChapterAnnex getCourseChapterAnnex() { + return courseChapterAnnex; + } + + public void setCourseChapterAnnex(CourseChapterAnnex courseChapterAnnex) { + this.courseChapterAnnex = courseChapterAnnex; + } + + public UserVideoPosition getUserVideoPosition() { + return userVideoPosition; + } + + public void setUserVideoPosition(UserVideoPosition userVideoPosition) { + this.userVideoPosition = userVideoPosition; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseChapterAnnex.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseChapterAnnex.java new file mode 100644 index 0000000..96ca425 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseChapterAnnex.java @@ -0,0 +1,115 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 章节附件表(CourseChapterAnnex)实体类 + * + * @author java + * @since 2020-11-09 10:04:48 + */ + + +@ApiModel(value = "章节附件表") +public class CourseChapterAnnex implements Serializable { + + private static final long serialVersionUID = 282553089268625985L; + + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键id") + private Integer courseChapterAnnexId; + + /** + * 附件名字 + */ + @ApiModelProperty(value = "附件名字", required = true) + @NotNull + private String annexName; + + /** + * 章节ID + */ + @ApiModelProperty(value = "章节ID", required = true) + @NotNull + private Integer courseChapterId; + + /** + * 介绍 + */ + @ApiModelProperty(value = "介绍", required = true) + @NotNull + private String annexIntroduction; + + /** + * 附件地址 + */ + @ApiModelProperty(value = "附件地址", required = true) + @NotNull + private String annexUrl; + + public CourseChapterAnnex(Integer courseChapterAnnexId, @NotNull String annexName, + @NotNull Integer courseChapterId, + @NotNull String annexIntroduction, @NotNull String annexUrl) { + this.courseChapterAnnexId = courseChapterAnnexId; + this.annexName = annexName; + this.courseChapterId = courseChapterId; + this.annexIntroduction = annexIntroduction; + this.annexUrl = annexUrl; + } + + public CourseChapterAnnex() { + } + + public Integer getCourseChapterAnnexId() { + return courseChapterAnnexId; + } + + public void setCourseChapterAnnexId(Integer courseChapterAnnexId) { + this.courseChapterAnnexId = courseChapterAnnexId; + } + + public String getAnnexName() { + return annexName; + } + + public void setAnnexName(String annexName) { + this.annexName = annexName; + } + + public Integer getCourseChapterId() { + return courseChapterId; + } + + public void setCourseChapterId(Integer courseChapterId) { + this.courseChapterId = courseChapterId; + } + + public String getAnnexIntroduction() { + return annexIntroduction; + } + + public void setAnnexIntroduction(String annexIntroduction) { + this.annexIntroduction = annexIntroduction; + } + + public String getAnnexUrl() { + return annexUrl; + } + + public void setAnnexUrl(String annexUrl) { + this.annexUrl = annexUrl; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseChapterTag.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseChapterTag.java new file mode 100644 index 0000000..302a42f --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseChapterTag.java @@ -0,0 +1,132 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 图书章节标签表。新建完成的图书章节,可以根据讲师不同,给不同的章节打标签,比如基础阶段,进阶阶段。。。(CourseChapterTag)实体类 + * + * @author java + * @since 2020-11-09 10:04:50 + */ + + +@ApiModel(value = "章节标签表") +public class CourseChapterTag implements Serializable { + + private static final long serialVersionUID = 998792510540027363L; + + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键id") + private Integer tagId; + + /** + * 标签名 + */ + @ApiModelProperty(value = "标签名", required = true) + @NotNull + private String tagName; + + /** + * 显示索引 + */ + @ApiModelProperty(value = "显示索引", required = true) + @NotNull + private Integer tagIndex; + + /** + * 章节ID + */ + @ApiModelProperty(value = "章节ID", required = true) + @NotNull + private Integer chapterId; + + /** + * 讲师 + */ + @ApiModelProperty(value = "讲师", required = true) + @NotNull + private String teacherName; + + /** + * 课程ID + */ + @ApiModelProperty(value = "课程ID", required = true) + @NotNull + private Integer courseId; + + + public CourseChapterTag(Integer tagId, @NotNull String tagName, + @NotNull Integer tagIndex, @NotNull Integer chapterId, + @NotNull String teacherName, @NotNull Integer courseId) { + this.tagId = tagId; + this.tagName = tagName; + this.tagIndex = tagIndex; + this.chapterId = chapterId; + this.teacherName = teacherName; + this.courseId = courseId; + } + + public CourseChapterTag() { + } + + public Integer getTagId() { + return tagId; + } + + public void setTagId(Integer tagId) { + this.tagId = tagId; + } + + public String getTagName() { + return tagName; + } + + public void setTagName(String tagName) { + this.tagName = tagName; + } + + public Integer getTagIndex() { + return tagIndex; + } + + public void setTagIndex(Integer tagIndex) { + this.tagIndex = tagIndex; + } + + public Integer getChapterId() { + return chapterId; + } + + public void setChapterId(Integer chapterId) { + this.chapterId = chapterId; + } + + public String getTeacherName() { + return teacherName; + } + + public void setTeacherName(String teacherName) { + this.teacherName = teacherName; + } + + public Integer getCourseId() { + return courseId; + } + + public void setCourseId(Integer courseId) { + this.courseId = courseId; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseChapterTest.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseChapterTest.java new file mode 100644 index 0000000..e4f8022 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseChapterTest.java @@ -0,0 +1,98 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 章节测试表/随堂练习表(CourseChapterTest)实体类 + * + * @author java + * @since 2020-11-09 10:04:52 + */ + + +@ApiModel(value = "章节测试表") +public class CourseChapterTest implements Serializable { + + private static final long serialVersionUID = 314641819841270641L; + + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键id") + private Integer testId; + + /** + * 习题id + */ + @ApiModelProperty(value = "习题id", required = true) + @NotNull + private Integer questionId; + + /** + * 章节id.目前得系统部分章节,默认0 + */ + @ApiModelProperty(value = "章节id.目前得系统部分章节,默认0", required = true) + @NotNull + private Integer chapterId; + + /** + * 课程ID。目前得随堂练习都是配置在图书下得 + */ + @ApiModelProperty(value = "课程ID。目前得随堂练习都是配置在图书下得", required = true) + @NotNull + private Integer courseId; + + public CourseChapterTest(Integer testId, @NotNull Integer questionId, + @NotNull Integer chapterId, @NotNull Integer courseId) { + this.testId = testId; + this.questionId = questionId; + this.chapterId = chapterId; + this.courseId = courseId; + } + + public CourseChapterTest() { + } + + public Integer getTestId() { + return testId; + } + + public void setTestId(Integer testId) { + this.testId = testId; + } + + public Integer getQuestionId() { + return questionId; + } + + public void setQuestionId(Integer questionId) { + this.questionId = questionId; + } + + public Integer getChapterId() { + return chapterId; + } + + public void setChapterId(Integer chapterId) { + this.chapterId = chapterId; + } + + public Integer getCourseId() { + return courseId; + } + + public void setCourseId(Integer courseId) { + this.courseId = courseId; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseChapterVideo.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseChapterVideo.java new file mode 100644 index 0000000..0dfc4c7 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseChapterVideo.java @@ -0,0 +1,158 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 课程视频(CourseChapterVideo)实体类 + * + * @author java + * @since 2020-11-09 10:04:54 + */ + + +@ApiModel(value = "章节视频表") +public class CourseChapterVideo implements Serializable { + + private static final long serialVersionUID = -21553514386384145L; + + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键id") + private Integer videoId; + + /** + * 章节id,目前视频直接配置在课程下,允许章节ID=NULL + */ + @ApiModelProperty(value = "章节id,目前视频直接配置在课程下,允许章节ID=NULL", required = true) + @NotNull + private Integer chapterId; + + /** + * 视频名称 + */ + @ApiModelProperty(value = "视频名称", required = true) + @NotNull + private String videoName; + + /** + * 视频地址 + */ + @ApiModelProperty(value = "视频地址", required = true) + @NotNull + private String videoUrl; + + + @ApiModelProperty(value = "${column.comment}", required = true) + private String videoOriUrl; + + /** + * 视频所属课程ID + */ + @ApiModelProperty(value = "视频所属课程ID", required = true) + @NotNull + private Integer courseId; + + /** + * 是否精品课程,精品课程允许试看 + */ + @ApiModelProperty(value = "是否精品课程,精品课程允许试看") + private Integer isFree; + + /** + * 试看时间,分钟 + */ + @ApiModelProperty(value = "试看时间,分钟") + private Integer freeTime; + + public CourseChapterVideo(Integer videoId, @NotNull Integer chapterId, + @NotNull String videoName, @NotNull String videoUrl, String videoOriUrl, + @NotNull Integer courseId, Integer isFree, Integer freeTime) { + this.videoId = videoId; + this.chapterId = chapterId; + this.videoName = videoName; + this.videoUrl = videoUrl; + this.videoOriUrl = videoOriUrl; + this.courseId = courseId; + this.isFree = isFree; + this.freeTime = freeTime; + } + + public CourseChapterVideo() { + } + + public Integer getVideoId() { + return videoId; + } + + public void setVideoId(Integer videoId) { + this.videoId = videoId; + } + + public Integer getChapterId() { + return chapterId; + } + + public void setChapterId(Integer chapterId) { + this.chapterId = chapterId; + } + + public String getVideoName() { + return videoName; + } + + public void setVideoName(String videoName) { + this.videoName = videoName; + } + + public String getVideoUrl() { + return videoUrl; + } + + public void setVideoUrl(String videoUrl) { + this.videoUrl = videoUrl; + } + + public String getVideoOriUrl() { + return videoOriUrl; + } + + public void setVideoOriUrl(String videoOriUrl) { + this.videoOriUrl = videoOriUrl; + } + + public Integer getCourseId() { + return courseId; + } + + public void setCourseId(Integer courseId) { + this.courseId = courseId; + } + + public Integer getIsFree() { + return isFree; + } + + public void setIsFree(Integer isFree) { + this.isFree = isFree; + } + + public Integer getFreeTime() { + return freeTime; + } + + public void setFreeTime(Integer freeTime) { + this.freeTime = freeTime; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseType.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseType.java new file mode 100644 index 0000000..1adbee4 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseType.java @@ -0,0 +1,65 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * (CourseType)实体类 + * + * @author java + * @since 2020-12-17 14:12:49 + */ + +@ApiModel(value = "课程分类表") +public class CourseType implements Serializable { + + private static final long serialVersionUID = -74761225011108876L; + + /** + * 主键 + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键") + private Integer courseTypeId; + + /** + * 课程分类名称 + */ + @ApiModelProperty(value = "课程分类名称", required = true) + @NotNull + private String courseName; + + + public CourseType(Integer courseTypeId, String courseName) { + this.courseTypeId = courseTypeId; + this.courseName = courseName; + } + + public CourseType() { + } + + public Integer getCourseTypeId() { + return courseTypeId; + } + + public void setCourseTypeId(Integer courseTypeId) { + this.courseTypeId = courseTypeId; + } + + public String getCourseName() { + return courseName; + } + + public void setCourseName(String courseName) { + this.courseName = courseName; + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseTypeRelation.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseTypeRelation.java new file mode 100644 index 0000000..c467603 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/CourseTypeRelation.java @@ -0,0 +1,92 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import java.io.Serializable; + +/** + * (CourseTypeRelation)实体类 + * + * @author java + * @since 2021-02-02 09:25:06 + */ + +@ApiModel(value = "课程类别关系表") +public class CourseTypeRelation implements Serializable { + + private static final long serialVersionUID = -48750814361274136L; + + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键id") + private Integer courseTypeReId; + + /** + * 课程id + */ + @ApiModelProperty(value = "课程id", required = true) + private Integer courseId; + + /** + * 类别id + */ + @ApiModelProperty(value = "类别id", required = true) + private Integer courseTypeId; + + /** + * 创建时间 + */ + @ApiModelProperty(value = "创建时间") + private Long createTime; + + public CourseTypeRelation(Integer courseTypeReId, Integer courseId, Integer courseTypeId, Long createTime) { + this.courseTypeReId = courseTypeReId; + this.courseId = courseId; + this.courseTypeId = courseTypeId; + this.createTime = createTime; + } + + public CourseTypeRelation() { + } + + public Integer getCourseTypeReId() { + return courseTypeReId; + } + + public void setCourseTypeReId(Integer courseTypeReId) { + this.courseTypeReId = courseTypeReId; + } + + public Integer getCourseId() { + return courseId; + } + + public void setCourseId(Integer courseId) { + this.courseId = courseId; + } + + public Integer getCourseTypeId() { + return courseTypeId; + } + + public void setCourseTypeId(Integer courseTypeId) { + this.courseTypeId = courseTypeId; + } + + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/News.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/News.java new file mode 100644 index 0000000..32196b8 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/News.java @@ -0,0 +1,70 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 新闻表 + * (News)实体类 + * + * @author java + * @since 2020-11-20 11:48:34 + */ +@Data +@ApiModel(value = "资讯表") +public class News implements Serializable { + + private static final long serialVersionUID = -39295514485939079L; + + + /** + * 新闻id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "新闻id") + private Integer newsId; + + /** + * 标题 + */ + @ApiModelProperty(value = "标题", required = true) + @NotNull + private String newsTitle; + + /** + * 标题配图 + */ + @ApiModelProperty(value = "标题配图", required = true) + @NotNull + private String newsLogo; + + /** + * 新闻内容 + */ + @ApiModelProperty(value = "新闻内容", required = true) + @NotNull + private String newsContent; + + /** + * 新闻时间 + */ + @ApiModelProperty(value = "新闻时间") + private Long createTime; + + /** + * 新闻类别 + */ + @ApiModelProperty(value = "新闻类别") + + private Integer tagId; + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/NewsTag.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/NewsTag.java new file mode 100644 index 0000000..a37bc4d --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/NewsTag.java @@ -0,0 +1,66 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 新闻标签表(NewsTag)实体类 + * + * @author java + * @since 2020-11-20 13:13:47 + */ + +@ApiModel(value = "资讯标签表") +public class NewsTag implements Serializable { + + private static final long serialVersionUID = -31343210313614099L; + + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键id") + private Integer tagId; + + /** + * 类别名称 + */ + @ApiModelProperty(value = "类别名称", required = true) + @NotNull + private String tagName; + + public NewsTag(Integer tagId, @NotNull String tagName) { + this.tagId = tagId; + this.tagName = tagName; + } + + public NewsTag() { + } + + public Integer getTagId() { + return tagId; + } + + public void setTagId(Integer tagId) { + this.tagId = tagId; + } + + public String getTagName() { + return tagName; + } + + public void setTagName(String tagName) { + this.tagName = tagName; + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/OrderUserLog.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/OrderUserLog.java new file mode 100644 index 0000000..50ee6c6 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/OrderUserLog.java @@ -0,0 +1,96 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * (OrderUserLog)实体类 + * + * @author java + * @since 2020-12-03 09:25:07 + */ + +@ApiModel(value = "订单详情表") +public class OrderUserLog implements Serializable { + + private static final long serialVersionUID = 666133974894655590L; + + + /** + * 主键 + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键") + private Integer orderLogId; + + /** + * 订单id + */ + @ApiModelProperty(value = "订单id", required = true) + @NotNull + private Integer orderId; + + /** + * 用户id + */ + @ApiModelProperty(value = "用户id", required = true) + @NotNull + private Integer reUserId; + + /** + * 创建时间 + */ + @ApiModelProperty(value = "创建时间") + private Long createTime; + + public OrderUserLog(Integer orderLogId, @NotNull Integer orderId, + @NotNull Integer reUserId, Long createTime) { + this.orderLogId = orderLogId; + this.orderId = orderId; + this.reUserId = reUserId; + this.createTime = createTime; + } + + public OrderUserLog() { + } + + public Integer getOrderLogId() { + return orderLogId; + } + + public void setOrderLogId(Integer orderLogId) { + this.orderLogId = orderLogId; + } + + public Integer getOrderId() { + return orderId; + } + + public void setOrderId(Integer orderId) { + this.orderId = orderId; + } + + public Integer getReUserId() { + return reUserId; + } + + public void setReUserId(Integer reUserId) { + this.reUserId = reUserId; + } + + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Orders.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Orders.java new file mode 100644 index 0000000..c1cc681 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Orders.java @@ -0,0 +1,259 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import tk.mybatis.mapper.annotation.Order; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 订单表(Orders)实体类 + * + * @author java + * @since 2020-11-26 16:46:40 + */ + +@ApiModel(value = "订单表") +public class Orders implements Serializable { + + private static final long serialVersionUID = 204802189701833123L; + + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键id") + @Order("DESC") + private Integer ordersId; + + /** + * 订单号 + */ + @ApiModelProperty(value = "订单号") + @NotBlank + private String orderNo; + + /** + * 用户id + */ + @ApiModelProperty(value = "用户id", required = true) + @NotNull + private Integer userId; + + /** + * 班级id + */ + @ApiModelProperty(value = "班级id", required = true) + @NotNull + private Integer classId; + + /** + * 订单状态 + */ + @ApiModelProperty(value = "订单状态 0 未支付 1 已支付 2 已退款") + private Integer orderStatus; + + /** + * 商品介绍 + */ + @ApiModelProperty(value = "商品介绍", required = true) + @NotNull + private String body; + + /** + * 订单名称 + */ + @ApiModelProperty(value = "订单名称", required = true) + @NotNull + private String subject; + + /** + * 订单总金额 + */ + @ApiModelProperty(value = "订单总金额", required = true) + @NotNull + private Double totalAmount; + + /** + * 创建时间 + */ + @ApiModelProperty(value = "创建时间") + private Long createTime; + + /** + * 支付宝交易号 + */ + @ApiModelProperty(value = "支付宝交易号") + private String tradeNo; + + /** + * 失效时间 + */ + @ApiModelProperty(value = "失效时间") + private Long overTime; + + /** + * 订单备注 + */ + @ApiModelProperty(value = "订单备注") + private String remark; + + /** + * 是否删除 + */ + @ApiModelProperty(value = "是否删除 1 未删除 0 已删除") + private Integer isDe; + + /** + * 发票id + */ + @ApiModelProperty(value = "发票id") + private Integer userInvoicesId; + + + public Orders(Integer ordersId, String orderNo, + @NotNull Integer userId, @NotNull Integer classId, + Integer orderStatus, @NotNull String body, @NotNull String subject, + @NotNull Double totalAmount, + Long createTime, String tradeNo, Long overTime, Integer isDe, + Integer userInvoicesId, String remark + ) { + this.ordersId = ordersId; + this.orderNo = orderNo; + this.userId = userId; + this.classId = classId; + this.orderStatus = orderStatus; + this.body = body; + this.subject = subject; + this.totalAmount = totalAmount; + this.createTime = createTime; + this.tradeNo = tradeNo; + this.overTime = overTime; + this.isDe = isDe; + this.userInvoicesId = userInvoicesId; + this.remark = remark; + } + + public Orders() { + } + + public Integer getOrdersId() { + return ordersId; + } + + public void setOrdersId(Integer ordersId) { + this.ordersId = ordersId; + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + public Integer getClassId() { + return classId; + } + + public void setClassId(Integer classId) { + this.classId = classId; + } + + public Integer getOrderStatus() { + return orderStatus; + } + + public void setOrderStatus(Integer orderStatus) { + this.orderStatus = orderStatus; + } + + public String getBody() { + return body; + } + + public void setBody(String body) { + this.body = body; + } + + public String getSubject() { + return subject; + } + + public void setSubject(String subject) { + this.subject = subject; + } + + public Double getTotalAmount() { + return totalAmount; + } + + public void setTotalAmount(Double totalAmount) { + this.totalAmount = totalAmount; + } + + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + public String getTradeNo() { + return tradeNo; + } + + public void setTradeNo(String tradeNo) { + this.tradeNo = tradeNo; + } + + public Long getOverTime() { + return overTime; + } + + public void setOverTime(Long overTime) { + this.overTime = overTime; + } + + public Integer getIsDe() { + return isDe; + } + + public void setIsDe(Integer isDe) { + this.isDe = isDe; + } + + public Integer getUserInvoicesId() { + return userInvoicesId; + } + + public void setUserInvoicesId(Integer userInvoicesId) { + this.userInvoicesId = userInvoicesId; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Paper.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Paper.java new file mode 100644 index 0000000..f0b2381 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Paper.java @@ -0,0 +1,193 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 试卷表(Paper)实体类 + * + * @author java + * @since 2020-12-07 11:34:27 + */ + +@ApiModel(value = "试卷表") +public class Paper implements Serializable { + + private static final long serialVersionUID = -88433359130256838L; + + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键id") + private Integer paperId; + + /** + * 试卷名称 + */ + @ApiModelProperty(value = "试卷名称", required = true) + @NotNull + private String paperName; + + /** + * 试卷类别 1,2分别表示随机试卷,固定试卷 + */ + @ApiModelProperty(value = "试卷类别 1,2分别表示随机试卷,固定试卷") + private Integer paperType; + + /** + * 试卷介绍 + */ + @ApiModelProperty(value = "试卷介绍", required = true) + @NotNull + private String paperIntroduction; + + /** + * 总分 + */ + @ApiModelProperty(value = "总分", required = true) + @NotNull + private Integer paperScore; + + + /** + * 及格线 + */ + @ApiModelProperty(value = "及格线", required = true) + @NotNull + private Integer paperScorePass; + + + /** + * 时长 + */ + @ApiModelProperty(value = "时长", required = true) + private Integer paperTime; + + /** + * 题目数量 + */ + @ApiModelProperty(value = "题目数量", required = true) + private Integer questionsNum; + + /** + * 失效时间 + */ + @ApiModelProperty(value = "失效时间") + private Long endTime; + + /** + * 1有效2无效 + */ + @ApiModelProperty(value = "1有效2无效") + private Integer status; + + public Paper(Integer paperId, @NotNull String paperName, + Integer paperType, @NotNull String paperIntroduction, + @NotNull Integer paperScore, @NotNull Integer paperScorePass, + Integer paperTime, + Integer questionsNum, Long endTime, Integer status) { + this.paperId = paperId; + this.paperName = paperName; + this.paperType = paperType; + this.paperIntroduction = paperIntroduction; + this.paperScore = paperScore; + this.paperScorePass = paperScorePass; + this.paperTime = paperTime; + this.questionsNum = questionsNum; + this.endTime = endTime; + this.status = status; + } + + public Paper() { + } + + public Integer getPaperId() { + return paperId; + } + + public void setPaperId(Integer paperId) { + this.paperId = paperId; + } + + public String getPaperName() { + return paperName; + } + + public void setPaperName(String paperName) { + this.paperName = paperName; + } + + public Integer getPaperType() { + return paperType; + } + + public void setPaperType(Integer paperType) { + this.paperType = paperType; + } + + public String getPaperIntroduction() { + return paperIntroduction; + } + + public void setPaperIntroduction(String paperIntroduction) { + this.paperIntroduction = paperIntroduction; + } + + public Integer getPaperScore() { + return paperScore; + } + + public void setPaperScore(Integer paperScore) { + this.paperScore = paperScore; + } + + public Integer getPaperTime() { + return paperTime; + } + + public void setPaperTime(Integer paperTime) { + this.paperTime = paperTime; + } + + public Integer getQuestionsNum() { + return questionsNum; + } + + public void setQuestionsNum(Integer questionsNum) { + this.questionsNum = questionsNum; + } + + public Long getEndTime() { + return endTime; + } + + public void setEndTime(Long endTime) { + this.endTime = endTime; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getPaperScorePass() { + return paperScorePass; + } + + public void setPaperScorePass(Integer paperScorePass) { + this.paperScorePass = paperScorePass; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/PaperQuestion.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/PaperQuestion.java new file mode 100644 index 0000000..1dd11d1 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/PaperQuestion.java @@ -0,0 +1,145 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 随机试卷问题表(PaperQuestion)实体类 + * + * @author java + * @since 2020-12-07 11:35:09 + */ + +@ApiModel(value = "抽题表") +public class PaperQuestion implements Serializable { + + private static final long serialVersionUID = -31457085483443169L; + + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键id") + private Integer paperRuleId; + + /** + * 试卷编号 + */ + @ApiModelProperty(value = "试卷编号", required = true) + @NotNull + private Integer paperId; + + /** + * 问题数量 + */ + @ApiModelProperty(value = "问题数量", required = true) + @NotNull + private Integer questionNum; + + /** + * 难易程度 + */ + @ApiModelProperty(value = "难易程度", required = true) + private Integer questionLevel; + + /** + * 题目类型 + */ + @ApiModelProperty(value = "题目类型", required = true) + @NotNull + private Integer questionType; + + /** + * 分值 + */ + @ApiModelProperty(value = "分值", required = true) + private Integer score; + + /** + * 基于哪个题库 + */ + @ApiModelProperty(value = "基于哪个题库", required = true) + @NotNull + private Integer questionTagId; + + public PaperQuestion(Integer paperRuleId, @NotNull Integer paperId, + @NotNull Integer questionNum, Integer questionLevel, + @NotNull Integer questionType, Integer score, + @NotNull Integer questionTagId) { + this.paperRuleId = paperRuleId; + this.paperId = paperId; + this.questionNum = questionNum; + this.questionLevel = questionLevel; + this.questionType = questionType; + this.score = score; + this.questionTagId = questionTagId; + } + + public PaperQuestion() { + } + + public Integer getPaperRuleId() { + return paperRuleId; + } + + public void setPaperRuleId(Integer paperRuleId) { + this.paperRuleId = paperRuleId; + } + + public Integer getPaperId() { + return paperId; + } + + public void setPaperId(Integer paperId) { + this.paperId = paperId; + } + + public Integer getQuestionNum() { + return questionNum; + } + + public void setQuestionNum(Integer questionNum) { + this.questionNum = questionNum; + } + + public Integer getQuestionLevel() { + return questionLevel; + } + + public void setQuestionLevel(Integer questionLevel) { + this.questionLevel = questionLevel; + } + + public Integer getQuestionType() { + return questionType; + } + + public void setQuestionType(Integer questionType) { + this.questionType = questionType; + } + + public Integer getScore() { + return score; + } + + public void setScore(Integer score) { + this.score = score; + } + + public Integer getQuestionTagId() { + return questionTagId; + } + + public void setQuestionTagId(Integer questionTagId) { + this.questionTagId = questionTagId; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Question.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Question.java new file mode 100644 index 0000000..1eb5556 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Question.java @@ -0,0 +1,152 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Transient; +import java.io.Serializable; +import java.util.List; + + +/** + * 习题表(Question)实体类 + * + * @author java + * @since 2020-12-07 11:35:53 + */ + +@ApiModel(value = "题目表") +public class Question implements Serializable { + + private static final long serialVersionUID = 215664877400645272L; + + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键id") + private Integer questionId; + + /** + * 习题题干 + */ + @ApiModelProperty(value = "习题题干", required = true) + private String questionDescription; + + /** + * 标签id + */ + @ApiModelProperty(value = "标签id", required = true) + private Integer tagId; + + /** + * 习题类型 + */ + @ApiModelProperty(value = "习题类型", required = true) + private Integer questionType; + + /** + * 习题分数 + */ + @ApiModelProperty(value = "习题分数", required = true) + private Integer questionScore; + + /** + * 习题级别,难中易 + */ + @ApiModelProperty(value = "习题级别,难中易", required = true) + private Integer questionLevel; + + /** + * 解析 + */ + @ApiModelProperty(value = "解析", required = true) + private String analysis; + + @Transient + private List questionAnswerList; + + public Question(Integer questionId, String questionDescription, + Integer tagId, Integer questionType, + Integer questionScore, Integer questionLevel, String analysis) { + this.questionId = questionId; + this.questionDescription = questionDescription; + this.tagId = tagId; + this.questionType = questionType; + this.questionScore = questionScore; + this.questionLevel = questionLevel; + this.analysis = analysis; + } + + public Question() { + } + + public Integer getQuestionId() { + return questionId; + } + + public void setQuestionId(Integer questionId) { + this.questionId = questionId; + } + + public String getQuestionDescription() { + return questionDescription; + } + + public void setQuestionDescription(String questionDescription) { + this.questionDescription = questionDescription; + } + + public Integer getTagId() { + return tagId; + } + + public void setTagId(Integer tagId) { + this.tagId = tagId; + } + + public Integer getQuestionType() { + return questionType; + } + + public void setQuestionType(Integer questionType) { + this.questionType = questionType; + } + + public Integer getQuestionScore() { + return questionScore; + } + + public void setQuestionScore(Integer questionScore) { + this.questionScore = questionScore; + } + + public Integer getQuestionLevel() { + return questionLevel; + } + + public void setQuestionLevel(Integer questionLevel) { + this.questionLevel = questionLevel; + } + + public String getAnalysis() { + return analysis; + } + + public void setAnalysis(String analysis) { + this.analysis = analysis; + } + + public List getQuestionAnswerList() { + return questionAnswerList; + } + + public void setQuestionAnswerList(List questionAnswerList) { + this.questionAnswerList = questionAnswerList; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/QuestionAnswer.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/QuestionAnswer.java new file mode 100644 index 0000000..2b97580 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/QuestionAnswer.java @@ -0,0 +1,97 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 问题答案表(QuestionAnswer)实体类 + * + * @author java + * @since 2020-12-07 11:36:17 + */ + +@ApiModel(value = "题目答案表") +public class QuestionAnswer implements Serializable { + + private static final long serialVersionUID = 408168416998479718L; + + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键id") + private Integer questionAnswerId; + + /** + * 习题id + */ + @ApiModelProperty(value = "习题id", required = true) + @NotNull + private Integer questionId; + + /** + * 试题答案 + */ + @ApiModelProperty(value = "试题答案", required = true) + @NotNull + private String questionAnswer; + + /** + * 是否正确 + */ + @ApiModelProperty(value = "是否正确", required = true) + @NotNull + private Byte isTrue; + + public QuestionAnswer(Integer questionAnswerId, @NotNull Integer questionId, + @NotNull String questionAnswer, @NotNull Byte isTrue) { + this.questionAnswerId = questionAnswerId; + this.questionId = questionId; + this.questionAnswer = questionAnswer; + this.isTrue = isTrue; + } + + public QuestionAnswer() { + } + + public Integer getQuestionAnswerId() { + return questionAnswerId; + } + + public void setQuestionAnswerId(Integer questionAnswerId) { + this.questionAnswerId = questionAnswerId; + } + + public Integer getQuestionId() { + return questionId; + } + + public void setQuestionId(Integer questionId) { + this.questionId = questionId; + } + + public String getQuestionAnswer() { + return questionAnswer; + } + + public void setQuestionAnswer(String questionAnswer) { + this.questionAnswer = questionAnswer; + } + + public Byte getIsTrue() { + return isTrue; + } + + public void setIsTrue(Byte isTrue) { + this.isTrue = isTrue; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/QuestionTag.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/QuestionTag.java new file mode 100644 index 0000000..7fbbaf7 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/QuestionTag.java @@ -0,0 +1,64 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 问题标签表(QuestionTag)实体类 + * + * @author java + * @since 2020-12-07 11:36:38 + */ + +@ApiModel(value = "题目标签表") +public class QuestionTag implements Serializable { + + private static final long serialVersionUID = 707743295313254406L; + + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键id") + private Integer questionTagId; + + /** + * 标签名称 + */ + @ApiModelProperty(value = "标签名称", required = true) + @NotNull + private String tagName; + + public QuestionTag(Integer questionTagId, @NotNull String tagName) { + this.questionTagId = questionTagId; + this.tagName = tagName; + } + + public QuestionTag() { + } + + public Integer getQuestionTagId() { + return questionTagId; + } + + public void setQuestionTagId(Integer questionTagId) { + this.questionTagId = questionTagId; + } + + public String getTagName() { + return tagName; + } + + public void setTagName(String tagName) { + this.tagName = tagName; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/QuestionType.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/QuestionType.java new file mode 100644 index 0000000..5bec65d --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/QuestionType.java @@ -0,0 +1,64 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 问题类型表(QuestionType)实体类 + * + * @author java + * @since 2020-12-07 11:36:58 + */ + +@ApiModel(value = "试题类型表") +public class QuestionType implements Serializable { + + private static final long serialVersionUID = 477430279562474374L; + + + /** + * 题库id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "题库id") + private Integer typeId; + + /** + * 类型名称 + */ + @ApiModelProperty(value = "类型名称", required = true) + @NotNull + private String typeName; + + public QuestionType(Integer typeId, @NotNull String typeName) { + this.typeId = typeId; + this.typeName = typeName; + } + + public QuestionType() { + } + + public Integer getTypeId() { + return typeId; + } + + public void setTypeId(Integer typeId) { + this.typeId = typeId; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Third.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Third.java new file mode 100644 index 0000000..2f3bee1 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/Third.java @@ -0,0 +1,92 @@ +package com.hc.business.model; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import java.io.Serializable; + +/** + * 第三方用户表(Third)实体类 + * + * @author java + * @since 2020-06-17 17:29:30 + */ + +public class Third implements Serializable { + + private static final long serialVersionUID = 449560525009961962L; + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer thirdId; + /** + * 第三方访问TOKEN + */ + private String thirdToken; + /** + * 第三方名字 + */ + private String thirdName; + /** + * 创建时间 + */ + private Long createTime = System.currentTimeMillis(); + /** + * 失效时间 + */ + private Long expireTime; + + public Third(Integer thirdId, String thirdToken, String thirdName, Long createTime, Long expireTime) { + this.thirdId = thirdId; + this.thirdToken = thirdToken; + this.thirdName = thirdName; + this.createTime = createTime; + this.expireTime = expireTime; + } + + public Third() { + } + + public Integer getThirdId() { + return thirdId; + } + + public void setThirdId(Integer thirdId) { + this.thirdId = thirdId; + } + + public String getThirdToken() { + return thirdToken; + } + + public void setThirdToken(String thirdToken) { + this.thirdToken = thirdToken; + } + + public String getThirdName() { + return thirdName; + } + + public void setThirdName(String thirdName) { + this.thirdName = thirdName; + } + + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + public Long getExpireTime() { + return expireTime; + } + + public void setExpireTime(Long expireTime) { + this.expireTime = expireTime; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/ThirdCourse.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/ThirdCourse.java new file mode 100644 index 0000000..83f159d --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/ThirdCourse.java @@ -0,0 +1,93 @@ +package com.hc.business.model; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import java.io.Serializable; + +/** + * 第三方用户课程配置表(ThirdCourse)实体类 + * + * @author java + * @since 2020-06-17 17:29:30 + */ + + +public class ThirdCourse implements Serializable { + + private static final long serialVersionUID = 819515458055433746L; + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + /** + * 第三方用户ID + */ + private Integer thirdId; + /** + * 课程ID + */ + private Integer courseId; + /** + * 是否有效,默认有效 + */ + private Integer status; + /** + * 配置时间 + */ + private Long createTime = System.currentTimeMillis(); + + public ThirdCourse(Integer id, Integer thirdId, Integer courseId, Integer status, Long createTime) { + this.id = id; + this.thirdId = thirdId; + this.courseId = courseId; + this.status = status; + this.createTime = createTime; + } + + public ThirdCourse() { + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getThirdId() { + return thirdId; + } + + public void setThirdId(Integer thirdId) { + this.thirdId = thirdId; + } + + public Integer getCourseId() { + return courseId; + } + + public void setCourseId(Integer courseId) { + this.courseId = courseId; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/User.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/User.java new file mode 100644 index 0000000..4b0d9dd --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/User.java @@ -0,0 +1,377 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 用户表(User)实体类 + * + * @author java + * @since 2020-11-09 10:04:13 + */ + +@Builder +@ApiModel(value = "用户表") +public class User implements Serializable { + + + private static final long serialVersionUID = 775234090220211721L; + + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键id") + private Integer userId; + + /** + * 身份证 + */ + @ApiModelProperty(value = "身份证") + private String cardId; + + /** + * 用户密码 + */ + @ApiModelProperty(value = "用户密码") + private String userPassword; + + /** + * 用户类别1234分别表示自注册用户,单位报名用户,免费用户,线下用户 + */ + @ApiModelProperty(value = "用户类别1234分别表示自注册用户,单位报名用户,免费用户,线下用户", required = true) + private Integer userType; + + /** + * 用户所属地区。只能看到该地区得课程 + */ + @ApiModelProperty(value = "用户所属地区。只能看到该地区得课程") + private Integer areaId; + + /** + * 用户昵称 + */ + @ApiModelProperty(value = "用户昵称") + private String userNick; + + /** + * 用户姓名 + */ + @ApiModelProperty(value = "用户姓名", required = true) + @NotNull + private String userName; + + /** + * 手机号码 + */ + @ApiModelProperty(value = "手机号码", required = true) + @NotBlank + private String userMobile; + + /** + * 邮箱 + */ + @ApiModelProperty(value = "邮箱",required = true) +// @Email + @NotNull + private String userEmail; + + /** + * 性别 + */ + @ApiModelProperty(value = "性别",required = true) + @NotNull + private String userGender; + + /** + * 创建时间 + */ + @ApiModelProperty(value = "创建时间") + private Long createTime; + + /** + * 生日 + */ + @ApiModelProperty(value = "生日") + private String userBirthday; + + /** + * 是否激活。只要登陆一次,就自动激活 + */ + @ApiModelProperty(value = "是否激活。只要登陆一次,就自动激活") + private Byte active; + + /** + * 用户头像 + */ + @ApiModelProperty(value = "用户头像") + private String userLogo; + + /** + * 用户单位 + */ + @ApiModelProperty(value = "用户单位",required = true) + @NotNull + private String userCompany; + + /** + * 保留字段1 + */ + @ApiModelProperty(value = "保留字段1") + private String userReserved1; + + /** + * 保留字段2 + */ + @ApiModelProperty(value = "保留字段2") + private String userReserved2; + + /** + * 保留字段3 + */ + @ApiModelProperty(value = "保留字段3") + private String userReserved3; + + /** + * 保留字段4 + */ + @ApiModelProperty(value = "保留字段4") + private String userReserved4; + + /** + * 保留字段5 + */ + @ApiModelProperty(value = "保留字段5") + private String userReserved5; + + public User(Integer userId, String cardId, String userPassword, + Integer userType, Integer areaId, String userNick, + @NotNull String userName, @NotNull String userMobile, + @Email String userEmail, @NotNull String userGender, + Long createTime, String userBirthday, Byte active, + String userLogo, @NotNull String userCompany, String userReserved1, + String userReserved2, String userReserved3, + String userReserved4, String userReserved5) { + this.userId = userId; + this.cardId = cardId; + this.userPassword = userPassword; + this.userType = userType; + this.areaId = areaId; + this.userNick = userNick; + this.userName = userName; + this.userMobile = userMobile; + this.userEmail = userEmail; + this.userGender = userGender; + this.createTime = createTime; + this.userBirthday = userBirthday; + this.active = active; + this.userLogo = userLogo; + this.userCompany = userCompany; + this.userReserved1 = userReserved1; + this.userReserved2 = userReserved2; + this.userReserved3 = userReserved3; + this.userReserved4 = userReserved4; + this.userReserved5 = userReserved5; + } + + public User() { + } + + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + public String getCardId() { + return cardId; + } + + public void setCardId(String cardId) { + this.cardId = cardId; + } + + public String getUserPassword() { + return userPassword; + } + + public void setUserPassword(String userPassword) { + this.userPassword = userPassword; + } + + public Integer getUserType() { + return userType; + } + + public void setUserType(Integer userType) { + this.userType = userType; + } + + public Integer getAreaId() { + return areaId; + } + + public void setAreaId(Integer areaId) { + this.areaId = areaId; + } + + public String getUserNick() { + return userNick; + } + + public void setUserNick(String userNick) { + this.userNick = userNick; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getUserMobile() { + return userMobile; + } + + public void setUserMobile(String userMobile) { + this.userMobile = userMobile; + } + + public String getUserEmail() { + return userEmail; + } + + public void setUserEmail(String userEmail) { + this.userEmail = userEmail; + } + + public String getUserGender() { + return userGender; + } + + public void setUserGender(String userGender) { + this.userGender = userGender; + } + + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + public String getUserBirthday() { + return userBirthday; + } + + public void setUserBirthday(String userBirthday) { + this.userBirthday = userBirthday; + } + + public Byte getActive() { + return active; + } + + public void setActive(Byte active) { + this.active = active; + } + + public String getUserLogo() { + return userLogo; + } + + public void setUserLogo(String userLogo) { + this.userLogo = userLogo; + } + + public String getUserCompany() { + return userCompany; + } + + public void setUserCompany(String userCompany) { + this.userCompany = userCompany; + } + + public String getUserReserved1() { + return userReserved1; + } + + public void setUserReserved1(String userReserved1) { + this.userReserved1 = userReserved1; + } + + public String getUserReserved2() { + return userReserved2; + } + + public void setUserReserved2(String userReserved2) { + this.userReserved2 = userReserved2; + } + + public String getUserReserved3() { + return userReserved3; + } + + public void setUserReserved3(String userReserved3) { + this.userReserved3 = userReserved3; + } + + public String getUserReserved4() { + return userReserved4; + } + + public void setUserReserved4(String userReserved4) { + this.userReserved4 = userReserved4; + } + + public String getUserReserved5() { + return userReserved5; + } + + public void setUserReserved5(String userReserved5) { + this.userReserved5 = userReserved5; + } + + @Override + public String toString() { + return "User{" + + "userId=" + userId + + ", cardId='" + cardId + '\'' + + ", userPassword='" + userPassword + '\'' + + ", userType=" + userType + + ", areaId=" + areaId + + ", userNick='" + userNick + '\'' + + ", userName='" + userName + '\'' + + ", userMobile='" + userMobile + '\'' + + ", userEmail='" + userEmail + '\'' + + ", userGender='" + userGender + '\'' + + ", createTime=" + createTime + + ", userBirthday='" + userBirthday + '\'' + + ", active=" + active + + ", userLogo='" + userLogo + '\'' + + ", userCompany='" + userCompany + '\'' + + ", userReserved1='" + userReserved1 + '\'' + + ", userReserved2='" + userReserved2 + '\'' + + ", userReserved3='" + userReserved3 + '\'' + + ", userReserved4='" + userReserved4 + '\'' + + ", userReserved5='" + userReserved5 + '\'' + + '}'; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserAdmin.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserAdmin.java new file mode 100644 index 0000000..4cdf7db --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserAdmin.java @@ -0,0 +1,114 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 管理员表(UserAdmin)实体类 + * + * @author java + * @since 2020-11-16 13:45:03 + */ + +@ApiModel(value = "管理员表") +public class UserAdmin implements Serializable { + + private static final long serialVersionUID = -33023267070799101L; + + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键id") + private Integer userAdminId; + + /** + * 管理员名字 + */ + @ApiModelProperty(value = "管理员名字", required = true) + @NotNull + private String adminName; + + /** + * 管理员账号 + */ + @ApiModelProperty(value = "管理员账号", required = true) + @NotNull + private String adminAccount; + + /** + * 管理员密码 + */ + @ApiModelProperty(value = "管理员密码", required = true) + @NotNull + private String adminPass; + + /** + * 管理员级别 + */ + @ApiModelProperty(value = "管理员级别", required = true) + @NotNull + private Integer permissionLevel; + + public UserAdmin(Integer userAdminId, @NotNull String adminName, + @NotNull String adminAccount, + @NotNull String adminPass, @NotNull Integer permissionLevel) { + this.userAdminId = userAdminId; + this.adminName = adminName; + this.adminAccount = adminAccount; + this.adminPass = adminPass; + this.permissionLevel = permissionLevel; + } + + public UserAdmin() { + } + + public Integer getUserAdminId() { + return userAdminId; + } + + public void setUserAdminId(Integer userAdminId) { + this.userAdminId = userAdminId; + } + + public String getAdminName() { + return adminName; + } + + public void setAdminName(String adminName) { + this.adminName = adminName; + } + + public String getAdminAccount() { + return adminAccount; + } + + public void setAdminAccount(String adminAccount) { + this.adminAccount = adminAccount; + } + + public String getAdminPass() { + return adminPass; + } + + public void setAdminPass(String adminPass) { + this.adminPass = adminPass; + } + + public Integer getPermissionLevel() { + return permissionLevel; + } + + public void setPermissionLevel(Integer permissionLevel) { + this.permissionLevel = permissionLevel; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserAdvise.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserAdvise.java new file mode 100644 index 0000000..cdac092 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserAdvise.java @@ -0,0 +1,172 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.Email; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 用户建议表 + * (UserAdvise)实体类 + * + * @author java + * @since 2020-11-16 14:20:01 + */ + +@ApiModel(value = "用户信息表") +public class UserAdvise implements Serializable { + + private static final long serialVersionUID = -75842427826309033L; + + + /** + * 主键 + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键") + private Integer adviceId; + + /** + * 用户ID + */ + @ApiModelProperty(value = "用户ID", required = true) + @NotNull + private Integer userId; + + /** + * 邮箱 + */ + @ApiModelProperty(value = "邮箱", required = true) + @NotNull + @Email + private String email; + + /** + * 标题 + */ + @ApiModelProperty(value = "标题", required = true) + @NotNull + private String title; + + /** + * 用户建议 + */ + @ApiModelProperty(value = "通知信息", required = true) + @NotNull + private String advise; + + /** + * 时间 + */ + @ApiModelProperty(value = "时间") + private Long createTime; + + + @ApiModelProperty(value = "通知图片") + private String adviceLogo; + + + @ApiModelProperty(value = "通知类型") + private Integer adviceType; + + @ApiModelProperty(value = "是否回复") + private Integer isReply; + + public UserAdvise(Integer adviceId, @NotNull Integer userId, + @NotNull @Email String email, + @NotNull String title, @NotNull String advise, + Long createTime, String adviceLogo, + Integer adviceType, Integer isReply) { + this.adviceId = adviceId; + this.userId = userId; + this.email = email; + this.title = title; + this.advise = advise; + this.createTime = createTime; + this.adviceLogo = adviceLogo; + this.adviceType = adviceType; + this.isReply = isReply; + } + + public UserAdvise() { + } + + public Integer getAdviceId() { + return adviceId; + } + + public void setAdviceId(Integer adviceId) { + this.adviceId = adviceId; + } + + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getAdvise() { + return advise; + } + + public void setAdvise(String advise) { + this.advise = advise; + } + + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + public String getAdviceLogo() { + return adviceLogo; + } + + public void setAdviceLogo(String adviceLogo) { + this.adviceLogo = adviceLogo; + } + + public Integer getAdviceType() { + return adviceType; + } + + public void setAdviceType(Integer adviceType) { + this.adviceType = adviceType; + } + + public Integer getIsReply() { + return isReply; + } + + public void setIsReply(Integer isReply) { + this.isReply = isReply; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserCourse.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserCourse.java new file mode 100644 index 0000000..10a4d1d --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserCourse.java @@ -0,0 +1,114 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 用户课程表(UserCourse)实体类 + * + * @author java + * @since 2020-11-09 10:05:18 + */ + +@ApiModel(value = "用户课程表") +public class UserCourse implements Serializable { + + private static final long serialVersionUID = 367696525637009095L; + + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键id") + private Integer userCourseId; + + /** + * 用户id + */ + @ApiModelProperty(value = "用户id", required = true) + @NotNull + private Integer userId; + + /** + * 课程SKUid + */ + @ApiModelProperty(value = "课程SKUid", required = true) + @NotNull + private Integer courseId; + + /** + * 总体进度 + */ + @ApiModelProperty(value = "总体进度") + @NotNull + private Double coursePercent; + + /** + * 班级ID + */ + @ApiModelProperty(value = "班级ID", required = true) + @NotNull + private Integer classId; + + public UserCourse(Integer userCourseId, @NotNull Integer userId, + @NotNull Integer courseId, Double coursePercent, + @NotNull Integer classId) { + this.userCourseId = userCourseId; + this.userId = userId; + this.courseId = courseId; + this.coursePercent = coursePercent; + this.classId = classId; + } + + public UserCourse() { + } + + public Integer getUserCourseId() { + return userCourseId; + } + + public void setUserCourseId(Integer userCourseId) { + this.userCourseId = userCourseId; + } + + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + public Integer getCourseId() { + return courseId; + } + + public void setCourseId(Integer courseId) { + this.courseId = courseId; + } + + public Double getCoursePercent() { + return coursePercent; + } + + public void setCoursePercent(Double coursePercent) { + this.coursePercent = coursePercent; + } + + public Integer getClassId() { + return classId; + } + + public void setClassId(Integer classId) { + this.classId = classId; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserInvoices.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserInvoices.java new file mode 100644 index 0000000..8c92751 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserInvoices.java @@ -0,0 +1,302 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Transient; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * 用户发票表(UserInvoices)实体类 + * + * @author java + * @since 2020-12-02 10:50:29 + */ + +@ApiModel(value = "订单发票表") +public class UserInvoices implements Serializable { + + + private static final long serialVersionUID = -61454177699116234L; + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键id") + private Integer userInvoicesId; + + /** + * 抬头 + */ + @ApiModelProperty(value = "抬头", required = true) + private String invoicesHead; + + /** + * 发票类型,12普票专票 + */ + @ApiModelProperty(value = "发票类型,12普票专票", required = true) + private Integer invoicesType; + + /** + * 税号 + */ + @ApiModelProperty(value = "税号", required = true) + private String invoicesCode; + + /** + * 开户行 + */ + @ApiModelProperty(value = "开户行", required = true) + private String invoicesBank; + + /** + * 开户名 + */ + @ApiModelProperty(value = "开户名", required = true) + private String invoicesUser; + + /** + * 开户账号 + */ + @ApiModelProperty(value = "开户账号", required = true) + private String invoicesNo; + + /** + * 发票金额 + */ + @ApiModelProperty(value = "发票金额", required = true) + @NotNull + private Double invoicesPrice; + + /** + * 申请日期 + */ + @ApiModelProperty(value = "申请日期") + private Long createTime; + + /** + * 处理状态 + */ + @ApiModelProperty(value = "状态") + private Integer status; + + /** + * 处理日期 + */ + @ApiModelProperty(value = "处理日期") + private Long time; + + /** + * 用户ID + */ + @ApiModelProperty(value = "用户ID", required = true) + @NotNull + private Integer userId; + + /** + * 班次id + */ + @ApiModelProperty(value = "班次ID", required = true) + @NotNull + private Integer classId; + + /** + * 发票备注 + */ + @ApiModelProperty(value = "发票备注") + private String remarks; + + /** + * 后台发票标记 + */ + @ApiModelProperty(value = "后台发票标记") + private String remarksSign; + + /** + * 发票代码 + */ + @ApiModelProperty(value = "发票代码") + private String taxCode; + + @NotEmpty + @ApiModelProperty(value = "订单id") + @Transient + private List ordersIdList; + + + public UserInvoices(Integer userInvoicesId, String invoicesHead, + Integer invoicesType, String invoicesCode, String invoicesBank, + String invoicesUser, String invoicesNo, + @NotNull Double invoicesPrice, Long createTime, + Integer status, Long time, + @NotNull Integer userId, Integer classId, String remarks + , String remarksSign, String taxCode, List ordersIdList) { + this.userInvoicesId = userInvoicesId; + this.invoicesHead = invoicesHead; + this.invoicesType = invoicesType; + this.invoicesCode = invoicesCode; + this.invoicesBank = invoicesBank; + this.invoicesUser = invoicesUser; + this.invoicesNo = invoicesNo; + this.invoicesPrice = invoicesPrice; + this.createTime = createTime; + this.status = status; + this.time = time; + this.userId = userId; + this.remarks = remarks; + this.remarksSign = remarksSign; + this.taxCode = taxCode; + this.classId = classId; + this.ordersIdList = ordersIdList; + } + + + public UserInvoices() { + } + + public Integer getUserInvoicesId() { + return userInvoicesId; + } + + public void setUserInvoicesId(Integer userInvoicesId) { + this.userInvoicesId = userInvoicesId; + } + + public String getInvoicesHead() { + return invoicesHead; + } + + public void setInvoicesHead(String invoicesHead) { + this.invoicesHead = invoicesHead; + } + + public Integer getInvoicesType() { + return invoicesType; + } + + public void setInvoicesType(Integer invoicesType) { + this.invoicesType = invoicesType; + } + + public String getInvoicesCode() { + return invoicesCode; + } + + public void setInvoicesCode(String invoicesCode) { + this.invoicesCode = invoicesCode; + } + + public String getInvoicesBank() { + return invoicesBank; + } + + public void setInvoicesBank(String invoicesBank) { + this.invoicesBank = invoicesBank; + } + + public String getInvoicesUser() { + return invoicesUser; + } + + public void setInvoicesUser(String invoicesUser) { + this.invoicesUser = invoicesUser; + } + + public String getInvoicesNo() { + return invoicesNo; + } + + public void setInvoicesNo(String invoicesNo) { + this.invoicesNo = invoicesNo; + } + + public Double getInvoicesPrice() { + return invoicesPrice; + } + + public void setInvoicesPrice(Double invoicesPrice) { + this.invoicesPrice = invoicesPrice; + } + + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Long getTime() { + return time; + } + + public void setTime(Long time) { + this.time = time; + } + + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + + public List getOrdersIdList() { + return ordersIdList; + } + + public void setOrdersIdList(List ordersIdList) { + this.ordersIdList = ordersIdList; + } + + public String getRemarksSign() { + return remarksSign; + } + + public void setRemarksSign(String remarksSign) { + this.remarksSign = remarksSign; + } + + public String getTaxCode() { + return taxCode; + } + + public void setTaxCode(String taxCode) { + this.taxCode = taxCode; + } + + public Integer getClassId() { + return classId; + } + + public void setClassId(Integer classId) { + this.classId = classId; + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserRefundHistory.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserRefundHistory.java new file mode 100644 index 0000000..bd72a5e --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserRefundHistory.java @@ -0,0 +1,155 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.math.BigDecimal; + + +/** + * 用户退款记录表(UserRefundHistory)实体类 + * + * @author java + * @since 2020-12-10 11:31:35 + */ + +@ApiModel(value = "用户退款表") +public class UserRefundHistory implements Serializable { + + private static final long serialVersionUID = -82710997323240027L; + + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键id") + private Integer id; + + /** + * 用户ID + */ + @ApiModelProperty(value = "用户ID", required = true) + @NotNull + private Integer userId; + + /** + * 用户类型12,普通用户,单位用户 + */ + @ApiModelProperty(value = "用户类型12,普通用户,单位用户", required = true) + @NotNull + private Integer userType; + + /** + * 退款订单号 + */ + @ApiModelProperty(value = "退款订单号", required = true) + @NotNull + private String orderNo; + + /** + * 退款时间 + */ + @ApiModelProperty(value = "退款时间") + private Long createTime; + + /** + * 退款处理时间,保留 + */ + @ApiModelProperty(value = "退款处理时间,保留") + private Long doneTime; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "退费金额") + @NotNull + private BigDecimal refundPrice; + + public UserRefundHistory(Integer id, @NotNull Integer userId, + @NotNull Integer userType, String orderNo, + Long createTime, Long doneTime, String remark, + BigDecimal refundPrice) { + this.id = id; + this.userId = userId; + this.userType = userType; + this.orderNo = orderNo; + this.createTime = createTime; + this.doneTime = doneTime; + this.remark = remark; + this.refundPrice = refundPrice; + } + + public UserRefundHistory() { + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + public Integer getUserType() { + return userType; + } + + public void setUserType(Integer userType) { + this.userType = userType; + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + public Long getDoneTime() { + return doneTime; + } + + public void setDoneTime(Long doneTime) { + this.doneTime = doneTime; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public BigDecimal getRefundPrice() { + return refundPrice; + } + + public void setRefundPrice(BigDecimal refundPrice) { + this.refundPrice = refundPrice; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserStatus.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserStatus.java new file mode 100644 index 0000000..a22176b --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserStatus.java @@ -0,0 +1,115 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 用户班级学习进度表 + * (UserStatus)实体类 + * + * @author java + * @since 2020-12-06 11:37:06 + */ + +@ApiModel(value = "用户状态表") +public class UserStatus implements Serializable { + + private static final long serialVersionUID = 425010649051627355L; + + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键id") + private Integer statusId; + + /** + * 用户id + */ + @ApiModelProperty(value = "用户id") + @NotNull + private Integer userId; + + /** + * 地区年度继续学习配置ID + */ + @ApiModelProperty(value = "地区年度继续学习配置ID") + @NotNull + private Integer classId; + + /** + * 报名得订单号 + */ + @ApiModelProperty(value = "报名得订单号") + @NotNull + private Integer orderId; + + /** + * 状态 + */ + @ApiModelProperty(value = "状态", required = true) + @NotNull + private Integer status; + + public UserStatus(Integer statusId, @NotNull Integer userId, + @NotNull Integer classId, + @NotNull Integer orderId, @NotNull Integer status) { + this.statusId = statusId; + this.userId = userId; + this.classId = classId; + this.orderId = orderId; + this.status = status; + } + + public UserStatus() { + } + + public Integer getStatusId() { + return statusId; + } + + public void setStatusId(Integer statusId) { + this.statusId = statusId; + } + + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + public Integer getClassId() { + return classId; + } + + public void setClassId(Integer classId) { + this.classId = classId; + } + + public Integer getOrderId() { + return orderId; + } + + public void setOrderId(Integer orderId) { + this.orderId = orderId; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserTeacher.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserTeacher.java new file mode 100644 index 0000000..880b4f1 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserTeacher.java @@ -0,0 +1,130 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * (UserTeacher)实体类 + * + * @author java + * @since 2020-11-20 11:08:17 + */ + +@ApiModel(value = "老师表") +public class UserTeacher implements Serializable { + + private static final long serialVersionUID = 354661860163916483L; + + + /** + * 主键 + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键") + private Integer teacherId; + + /** + * 老师名称 + */ + @ApiModelProperty(value = "老师名称", required = true) + @NotNull + private String teacherName; + + /** + * 老师简介 + */ + @ApiModelProperty(value = "老师简介", required = true) + @NotNull + private String teacherIntroduce; + + /** + * 老师头像 + */ + @ApiModelProperty(value = "老师头像", required = true) + @NotNull + private String teacherLogo; + + /** + * 老师图片 + */ + @ApiModelProperty(value = "老师图片", required = true) + @NotNull + private String teacherUrl; + + /** + * 时间 + */ + @ApiModelProperty(value = "时间") + private Long createTime; + + public UserTeacher(Integer teacherId, @NotNull String teacherName, + @NotNull String teacherIntroduce, + @NotNull String teacherLogo, + @NotNull String teacherUrl, Long createTime) { + this.teacherId = teacherId; + this.teacherName = teacherName; + this.teacherIntroduce = teacherIntroduce; + this.teacherLogo = teacherLogo; + this.teacherUrl = teacherUrl; + this.createTime = createTime; + } + + public UserTeacher() { + } + + public Integer getTeacherId() { + return teacherId; + } + + public void setTeacherId(Integer teacherId) { + this.teacherId = teacherId; + } + + public String getTeacherName() { + return teacherName; + } + + public void setTeacherName(String teacherName) { + this.teacherName = teacherName; + } + + public String getTeacherIntroduce() { + return teacherIntroduce; + } + + public void setTeacherIntroduce(String teacherIntroduce) { + this.teacherIntroduce = teacherIntroduce; + } + + public String getTeacherLogo() { + return teacherLogo; + } + + public void setTeacherLogo(String teacherLogo) { + this.teacherLogo = teacherLogo; + } + + public String getTeacherUrl() { + return teacherUrl; + } + + public void setTeacherUrl(String teacherUrl) { + this.teacherUrl = teacherUrl; + } + + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserTestHistory.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserTestHistory.java new file mode 100644 index 0000000..c21f2db --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserTestHistory.java @@ -0,0 +1,165 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import java.io.Serializable; + + +/** + * 用户考试记录表(UserTestHistory)实体类 + * + * @author java + * @since 2020-12-07 11:28:17 + */ + +@ApiModel(value = "考试记录表") +public class UserTestHistory implements Serializable { + + private static final long serialVersionUID = -86805600747462758L; + + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键id") + private Integer testId; + + /** + * 用户Id + */ + @ApiModelProperty(value = "用户Id", required = true) + private Integer userId; + + /** + * 试卷ID + */ + @ApiModelProperty(value = "试卷ID", required = true) + private Integer paperId; + + /** + * 班次id + */ + @ApiModelProperty(value = "班次ID", required = true) + private Integer classId; + + /** + * 成绩 + */ + @ApiModelProperty(value = "成绩", required = true) + private Integer score; + + /** + * 问题ID数组 + */ + @ApiModelProperty(value = "问题ID数组", required = true) + private String answer; + + + @ApiModelProperty(value = "创建时间") + private Long createTime; + + + @ApiModelProperty(value = "总分", required = true) + private Integer totalScore; + + /** + * 考试时间 + */ + @ApiModelProperty(value = "考试时间", required = true) + private String testTime; + + public UserTestHistory(Integer testId, Integer userId, Integer paperId, + Integer classId, Integer score, String answer, + Long createTime, Integer totalScore, String testTime) { + this.testId = testId; + this.userId = userId; + this.paperId = paperId; + this.classId = classId; + this.score = score; + this.answer = answer; + this.createTime = createTime; + this.totalScore = totalScore; + this.testTime = testTime; + } + + public UserTestHistory() { + } + + public Integer getTestId() { + return testId; + } + + public void setTestId(Integer testId) { + this.testId = testId; + } + + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + public Integer getPaperId() { + return paperId; + } + + public void setPaperId(Integer paperId) { + this.paperId = paperId; + } + + public Integer getClassId() { + return classId; + } + + public void setClassId(Integer classId) { + this.classId = classId; + } + + public Integer getScore() { + return score; + } + + public void setScore(Integer score) { + this.score = score; + } + + public String getAnswer() { + return answer; + } + + public void setAnswer(String answer) { + this.answer = answer; + } + + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + public Integer getTotalScore() { + return totalScore; + } + + public void setTotalScore(Integer totalScore) { + this.totalScore = totalScore; + } + + public String getTestTime() { + return testTime; + } + + public void setTestTime(String testTime) { + this.testTime = testTime; + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserVideoPosition.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserVideoPosition.java new file mode 100644 index 0000000..ba7301e --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/UserVideoPosition.java @@ -0,0 +1,122 @@ +package com.hc.business.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * 用户视频观看记录(UserVideoPosition)实体类 + * + * @author java + * @since 2020-05-29 15:50:50 + */ + +@ApiModel(value = "视频记录表") +public class UserVideoPosition implements Serializable { + + private static final long serialVersionUID = 133164084604002223L; + + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "主键ID") + private Integer userVideoPositionId; + + /** + * 视频id + */ + @ApiModelProperty(value = "视频id", required = true) + @NotNull + private Integer videoId; + + /** + * 用户id + */ + @ApiModelProperty(value = "用户id", required = true) + @NotNull + private Integer userId; + + /** + * 视频观看时间 + */ + private String videoPosition; + + /** + * 是否观看解鼠 + */ + private Integer watchEnd; + + /** + * 视频时长 + */ + private String videoTime; + + public UserVideoPosition(Integer userVideoPositionId, @NotNull Integer videoId, + @NotNull Integer userId, + String videoPosition, Integer watchEnd, String videoTime) { + this.userVideoPositionId = userVideoPositionId; + this.videoId = videoId; + this.userId = userId; + this.videoPosition = videoPosition; + this.watchEnd = watchEnd; + this.videoTime = videoTime; + } + + public UserVideoPosition() { + } + + public Integer getUserVideoPositionId() { + return userVideoPositionId; + } + + public void setUserVideoPositionId(Integer userVideoPositionId) { + this.userVideoPositionId = userVideoPositionId; + } + + public Integer getVideoId() { + return videoId; + } + + public void setVideoId(Integer videoId) { + this.videoId = videoId; + } + + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + public String getVideoPosition() { + return videoPosition; + } + + public void setVideoPosition(String videoPosition) { + this.videoPosition = videoPosition; + } + + public Integer getWatchEnd() { + return watchEnd; + } + + public void setWatchEnd(Integer watchEnd) { + this.watchEnd = watchEnd; + } + + public String getVideoTime() { + return videoTime; + } + + public void setVideoTime(String videoTime) { + this.videoTime = videoTime; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/jwt/GenerateAuthToken.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/jwt/GenerateAuthToken.java new file mode 100644 index 0000000..7cb2e44 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/jwt/GenerateAuthToken.java @@ -0,0 +1,66 @@ +package com.hc.business.model.jwt; + +import com.hc.business.model.User; +import com.hc.business.model.UserAdmin; +import com.hc.business.model.login.AccessEntity; +import com.hc.business.model.login.AuthEntity; +import com.hc.business.model.login.TokenEntity; +import com.hc.core.utils.exception.ResponseException; +import com.hc.core.utils.redis.RedisUtil; +import com.hc.core.utils.tool.IdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; +import org.springframework.util.SerializationUtils; + +import java.util.Objects; + +@Slf4j +@Component +public class GenerateAuthToken { + + + private final RedisUtil redisUtil; + + public GenerateAuthToken(RedisUtil redisUtil) { + this.redisUtil = redisUtil; + } + + public AccessEntity generateToken(AuthEntity auth, User user, UserAdmin userAdmin) { + + AccessEntity accessEntity = new AccessEntity(); + accessEntity.setAuth(auth); + TokenEntity tokenEntity = new TokenEntity(); + // 默认超时 8 小时 + tokenEntity.setExpires(60 * 60 * 8); + String token = JWTUtil.sign(auth.getUserName(), IdGenerator.passwordToHash(auth.getPassword())); + tokenEntity.setId(token); + + if (userAdmin != null) { + //设置权限级别 + tokenEntity.setPermissionLevel(userAdmin.getPermissionLevel()); + } + + accessEntity.setToken(tokenEntity); + + String accessEntityStr = null; + try { + accessEntityStr = new String(Objects.requireNonNull(SerializationUtils.serialize(accessEntity))); + } catch (Exception e) { + throw new ResponseException(-1,"登录序列化失败"); + } + + // 写入到 redis + redisUtil.set(accessEntity.getToken().getId(), + accessEntityStr, + accessEntity.getToken().getExpires()); + + if (user != null) { + accessEntity.setUser(user); + } + if (userAdmin != null){ + accessEntity.setUserAdmin(userAdmin); + } + log.info("user: {}", auth.getUserName()+" 成功登录系统"); + return accessEntity; + } +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/jwt/JWTUtil.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/jwt/JWTUtil.java new file mode 100644 index 0000000..2f33000 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/jwt/JWTUtil.java @@ -0,0 +1,76 @@ +package com.hc.business.model.jwt; + +import com.auth0.jwt.JWT; +import com.auth0.jwt.JWTVerifier; +import com.auth0.jwt.algorithms.Algorithm; +import com.auth0.jwt.exceptions.JWTDecodeException; +import com.auth0.jwt.interfaces.DecodedJWT; +import org.springframework.stereotype.Component; + +import java.io.UnsupportedEncodingException; +import java.util.Date; + +@Component +public class JWTUtil { + + // 过期时间8小时0分钟 + + private static final long EXPIRE_TIME = 8 * 60 * 60 * 1000; + + /** + * 校验token是否正确 + * + * @param token 密钥 + * @param secret 用户的密码 + * @return 是否正确 + */ + public static boolean verify(String token, String userName, String secret) { + try { + Algorithm algorithm = Algorithm.HMAC256(secret); + JWTVerifier verifier = JWT.require(algorithm) + .withClaim("userName", userName) + .build(); + DecodedJWT jwt = verifier.verify(token); + return true; + } catch (Exception exception) { + System.out.println(exception.getMessage()); + return false; + } + } + + /** + * 获得token中的信息无需secret解密也能获得 + * + * @return token中包含的用户名 + */ + public static String getUserName(String token) { + try { + DecodedJWT jwt = JWT.decode(token); + return jwt.getClaim("userName").asString(); + } catch (JWTDecodeException e) { + return null; + } + } + + /** + * 生成签名,2小时后过期 + * + * @param userName 用户名 + * @param secret 用户的密码 + * @return 加密的token + */ + public static String sign(String userName, String secret) { + Date date = new Date(System.currentTimeMillis() + EXPIRE_TIME); + Algorithm algorithm = null; + try { + algorithm = Algorithm.HMAC256(secret); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + // 附带userName信息 + return JWT.create() + .withClaim("userName", userName) + .withExpiresAt(date) + .sign(algorithm); + } +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/login/AccessEntity.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/login/AccessEntity.java new file mode 100644 index 0000000..5850fac --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/login/AccessEntity.java @@ -0,0 +1,31 @@ +package com.hc.business.model.login; + +import com.hc.business.model.User; +import com.hc.business.model.UserAdmin; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +@ApiModel("登录信息表") +@Data +public class AccessEntity implements Serializable{ + + private static final long serialVersionUID = -5164168823800497252L; + + @ApiModelProperty(value = "用户信息") + private AuthEntity auth; + + @ApiModelProperty(value = "token",example = "e781d000-0498-46d3-90df-96edfd95bcd6") + private TokenEntity token; + + @ApiModelProperty(value = "user") + private User user; + + @ApiModelProperty(value = "userAdmin") + private UserAdmin userAdmin; + + + +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/login/AuthEntity.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/login/AuthEntity.java new file mode 100644 index 0000000..cec16e9 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/login/AuthEntity.java @@ -0,0 +1,19 @@ +package com.hc.business.model.login; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +@Data +public class AuthEntity implements Serializable { + + private static final long serialVersionUID = -9061398570055647081L; + + @NotNull(message = "用户名不可以为空") + private String userName; + + @NotNull(message = "密码不可以为空") + private String password; + +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/login/TokenEntity.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/login/TokenEntity.java new file mode 100644 index 0000000..f36ac6c --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/model/login/TokenEntity.java @@ -0,0 +1,21 @@ +package com.hc.business.model.login; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class TokenEntity implements Serializable{ + + /** + * + */ + private static final long serialVersionUID = -6482495805136843397L; + + private String id; + + private int expires; + + private Integer permissionLevel; + +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/AliPayService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/AliPayService.java new file mode 100644 index 0000000..f0f9b68 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/AliPayService.java @@ -0,0 +1,44 @@ +package com.hc.business.service; + +import com.alipay.api.AlipayApiException; +import com.hc.core.utils.pay.browser.alipay.bean.AliPayRefundBean; +import com.hc.core.utils.pay.browser.alipay.bean.AliPayBean; +import org.springframework.stereotype.Component; +import java.util.Map; + +/** + * @author 10696 + */ + +@Component +public interface AliPayService { + + /** + * 支付宝支付 + * + * @param aliPayBean 支付对象 + * @return 实例对象 + * @throws AlipayApiException + */ + Map alipay(AliPayBean aliPayBean) throws AlipayApiException; + + + /** + * 支付成功回调 + * + * @param outTradeNo 订单号 + * @param tradeNo 支付宝交易号 + * @param tradeStatus 支付状态 + */ + void returnNotifyUrlInfo(String outTradeNo, String tradeNo, String tradeStatus); + + /** + * 支付宝退款 + * + * @param aliPayRefundBean 退款对象 + * @return 实例对象 + * @throws AlipayApiException + */ + Map refund(AliPayRefundBean aliPayRefundBean) throws AlipayApiException; + +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/AreaDistrictService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/AreaDistrictService.java new file mode 100644 index 0000000..55618c5 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/AreaDistrictService.java @@ -0,0 +1,60 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.AreaDistrict; +import org.springframework.stereotype.Component; + + +/** + * 省份表(AreaDistrict)表服务接口 + * + * @author java + * @since 2020-11-20 12:48:46 + */ + +@Component +public interface AreaDistrictService { + + /** + * 通过ID查询单条数据 + * + * @param areaId 主键 + * @return 实例对象 + */ + AreaDistrict queryById(Integer areaId); + + /** + * 新增数据 + * + * @param areaDistrict 实例对象 + * @return 实例对象 + */ + AreaDistrict insert(AreaDistrict areaDistrict); + + /** + * 修改数据 + * + * @param areaDistrict 实例对象 + * @return 实例对象 + */ + AreaDistrict update(AreaDistrict areaDistrict); + + /** + * 通过主键删除数据 + * + * @param areaId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer areaId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/BannerService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/BannerService.java new file mode 100644 index 0000000..c1939d2 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/BannerService.java @@ -0,0 +1,61 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.Banner; +import org.springframework.stereotype.Component; + + +/** + * 广告表 + * (Banner)表服务接口 + * + * @author java + * @since 2020-11-26 09:29:50 + */ + +@Component +public interface BannerService { + + /** + * 通过ID查询单条数据 + * + * @param bannerId 主键 + * @return 实例对象 + */ + Banner queryById(Integer bannerId); + + /** + * 新增数据 + * + * @param banner 实例对象 + * @return 实例对象 + */ + Banner insert(Banner banner); + + /** + * 修改数据 + * + * @param banner 实例对象 + * @return 实例对象 + */ + Banner update(Banner banner); + + /** + * 通过主键删除数据 + * + * @param bannerId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer bannerId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/ClassConfigService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/ClassConfigService.java new file mode 100644 index 0000000..39eb18b --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/ClassConfigService.java @@ -0,0 +1,99 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.ClassConfig; +import org.springframework.stereotype.Component; + +import java.util.List; + + +/** + * 班次表(ClassConfig)表服务接口 + * + * @author java + * @since 2020-11-19 16:12:31 + */ + +@Component +public interface ClassConfigService { + + /** + * 通过ID查询单条数据 + * + * @param classConfigId 主键 + * @return 实例对象 + */ + ClassConfig queryById(Integer classConfigId); + + /** + * 新增数据 + * + * @param classConfig 实例对象 + * @return 实例对象 + */ + ClassConfig insert(ClassConfig classConfig); + + /** + * 修改数据 + * + * @param classConfig 实例对象 + * @return 实例对象 + */ + ClassConfig update(ClassConfig classConfig); + + /** + * 通过主键删除数据 + * + * @param classConfigId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer classConfigId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + /** + * 校验查询培训班 + * + * @param valid 是否上线 + * @param page 页码 + * @param size 查询条数 + * @return 实例对象数组 + */ + PageInfo queryByValid(Integer valid, int page, int size); + + /** + * 培训班名称查询培训班 + * + * @param name 培训班名称 + * @return 实例对象数组 + */ + List queryByClassName(String name); + + /** + * 地区id查询培训班 + * + * @param areaId 地区id + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryByAreaId(Integer areaId, int page, int size); + + + /** + * 学习时间查询培训班 + * + * @param studyStartTime 学习开始时间 + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryByTime(Long studyStartTime, Integer page, Integer size); +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/ClassConfigSponsorService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/ClassConfigSponsorService.java new file mode 100644 index 0000000..1714753 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/ClassConfigSponsorService.java @@ -0,0 +1,61 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.ClassConfigSponsor; +import org.springframework.stereotype.Component; + + +/** + * (ClassConfigSponsor)表服务接口 + * + * @author java + * @since 2021-05-28 14:11:29 + */ + +@Component +public interface ClassConfigSponsorService { + + /** + * 通过ID查询单条数据 + * + * @param sponsorId 主键 + * @return 实例对象 + */ + ClassConfigSponsor queryById(Integer sponsorId); + + /** + * 新增数据 + * + * @param classConfigSponsor 实例对象 + * @return 实例对象 + */ + ClassConfigSponsor insert(ClassConfigSponsor classConfigSponsor); + + /** + * 修改数据 + * + * @param classConfigSponsor 实例对象 + * @return 实例对象 + */ + ClassConfigSponsor update(ClassConfigSponsor classConfigSponsor); + + /** + * 通过主键删除数据 + * + * @param sponsorId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer sponsorId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @param classId 班次id + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size, Integer classId); + + +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/ClassCourseService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/ClassCourseService.java new file mode 100644 index 0000000..e9a13cf --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/ClassCourseService.java @@ -0,0 +1,69 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.ClassCourse; +import org.springframework.stereotype.Component; + + +/** + * 班次课程表(ClassCourse)表服务接口 + * + * @author java + * @since 2020-11-24 11:30:07 + */ + +@Component +public interface ClassCourseService { + + /** + * 通过ID查询单条数据 + * + * @param classCourseId 主键 + * @return 实例对象 + */ + ClassCourse queryById(Integer classCourseId); + + /** + * 新增数据 + * + * @param classCourse 实例对象 + * @return 实例对象 + */ + ClassCourse insert(ClassCourse classCourse); + + /** + * 修改数据 + * + * @param classCourse 实例对象 + * @return 实例对象 + */ + ClassCourse update(ClassCourse classCourse); + + /** + * 通过主键删除数据 + * + * @param classCourseId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer classCourseId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + /** + * 获取班级下的课程 + * + * @param classId 班级id + * @param courseType 课程类别 + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryByClassId(Integer classId, Integer courseType, Integer page, Integer size); +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseChapterAnnexService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseChapterAnnexService.java new file mode 100644 index 0000000..3dc2241 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseChapterAnnexService.java @@ -0,0 +1,60 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.CourseChapterAnnex; +import org.springframework.stereotype.Component; + + +/** + * 章节附件表(CourseChapterAnnex)表服务接口 + * + * @author java + * @since 2020-11-09 10:04:49 + */ + +@Component +public interface CourseChapterAnnexService { + + /** + * 通过ID查询单条数据 + * + * @param courseChapterAnnexId 主键 + * @return 实例对象 + */ + CourseChapterAnnex queryById(Integer courseChapterAnnexId); + + /** + * 新增数据 + * + * @param courseChapterAnnex 实例对象 + * @return 实例对象 + */ + CourseChapterAnnex insert(CourseChapterAnnex courseChapterAnnex); + + /** + * 修改数据 + * + * @param courseChapterAnnex 实例对象 + * @return 实例对象 + */ + CourseChapterAnnex update(CourseChapterAnnex courseChapterAnnex); + + /** + * 通过主键删除数据 + * + * @param courseChapterAnnexId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer courseChapterAnnexId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseChapterService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseChapterService.java new file mode 100644 index 0000000..c1f982d --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseChapterService.java @@ -0,0 +1,66 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.CourseChapter; +import org.springframework.stereotype.Component; + +import java.util.List; + + +/** + * 课程章节表(CourseChapter)表服务接口 + * + * @author java + * @since 2020-11-09 10:04:47 + */ + +@Component +public interface CourseChapterService { + + /** + * 通过ID查询单条数据 + * + * @param courseChapterId 主键 + * @return 实例对象 + */ + CourseChapter queryById(Integer courseChapterId); + + /** + * 新增数据 + * + * @param courseChapter 实例对象 + * @return 实例对象 + */ + CourseChapter insert(CourseChapter courseChapter); + + /** + * 修改数据 + * + * @param courseChapter 实例对象 + * @return 实例对象 + */ + CourseChapter update(CourseChapter courseChapter); + + /** + * 通过主键删除数据 + * + * @param courseChapterId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer courseChapterId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + + /*** + * 改版。william.根据课程rootid获取所有章节的id列表 + */ + List getCourseChapterChildList(Integer rootId); +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseChapterTagService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseChapterTagService.java new file mode 100644 index 0000000..b335d33 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseChapterTagService.java @@ -0,0 +1,60 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.CourseChapterTag; +import org.springframework.stereotype.Component; + + +/** + * 图书章节标签表。新建完成的图书章节,可以根据讲师不同,给不同的章节打标签,比如基础阶段,进阶阶段。。。(CourseChapterTag)表服务接口 + * + * @author java + * @since 2020-11-09 10:04:51 + */ + +@Component +public interface CourseChapterTagService { + + /** + * 通过ID查询单条数据 + * + * @param tagId 主键 + * @return 实例对象 + */ + CourseChapterTag queryById(Integer tagId); + + /** + * 新增数据 + * + * @param courseChapterTag 实例对象 + * @return 实例对象 + */ + CourseChapterTag insert(CourseChapterTag courseChapterTag); + + /** + * 修改数据 + * + * @param courseChapterTag 实例对象 + * @return 实例对象 + */ + CourseChapterTag update(CourseChapterTag courseChapterTag); + + /** + * 通过主键删除数据 + * + * @param tagId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer tagId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseChapterTestService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseChapterTestService.java new file mode 100644 index 0000000..2c96970 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseChapterTestService.java @@ -0,0 +1,60 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.CourseChapterTest; +import org.springframework.stereotype.Component; + + +/** + * 章节测试表/随堂练习表(CourseChapterTest)表服务接口 + * + * @author java + * @since 2020-11-09 10:04:53 + */ + +@Component +public interface CourseChapterTestService { + + /** + * 通过ID查询单条数据 + * + * @param testId 主键 + * @return 实例对象 + */ + CourseChapterTest queryById(Integer testId); + + /** + * 新增数据 + * + * @param courseChapterTest 实例对象 + * @return 实例对象 + */ + CourseChapterTest insert(CourseChapterTest courseChapterTest); + + /** + * 修改数据 + * + * @param courseChapterTest 实例对象 + * @return 实例对象 + */ + CourseChapterTest update(CourseChapterTest courseChapterTest); + + /** + * 通过主键删除数据 + * + * @param testId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer testId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseChapterVideoService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseChapterVideoService.java new file mode 100644 index 0000000..0d9aed7 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseChapterVideoService.java @@ -0,0 +1,69 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.CourseChapterVideo; +import org.springframework.stereotype.Component; + +import java.util.List; + + +/** + * 课程视频(CourseChapterVideo)表服务接口 + * + * @author java + * @since 2020-11-09 10:04:56 + */ + +@Component +public interface CourseChapterVideoService { + + /** + * 通过ID查询单条数据 + * + * @param videoId 主键 + * @return 实例对象 + */ + CourseChapterVideo queryById(Integer videoId); + + /** + * 新增数据 + * + * @param courseChapterVideo 实例对象 + * @return 实例对象 + */ + CourseChapterVideo insert(CourseChapterVideo courseChapterVideo); + + /** + * 修改数据 + * + * @param courseChapterVideo 实例对象 + * @return 实例对象 + */ + CourseChapterVideo update(CourseChapterVideo courseChapterVideo); + + /** + * 通过主键删除数据 + * + * @param videoId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer videoId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + + /** + * 通过IcourseId查询单条数据 + * + * @param courseId 主键 + * @return 实例对象 + */ + List queryByCourseId(Integer courseId); +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseService.java new file mode 100644 index 0000000..ce827a2 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseService.java @@ -0,0 +1,110 @@ +package com.hc.business.service; + +import com.hc.business.dto.CourseVideoDto; +import com.hc.business.model.Course; +import com.hc.business.model.CourseChapterVideo; +import org.springframework.stereotype.Component; +import com.github.pagehelper.PageInfo; + +import java.util.List; + + +/** + * 课程表(Course)表服务接口 + * + * @author java + * @since 2020-11-09 10:04:45 + */ + +@Component +public interface CourseService { + + /** + * 通过ID查询单条数据 + * + * @param courseId 主键 + * @return 实例对象 + */ + Course queryById(Integer courseId); + + /** + * 新增数据 + * + * @param course 实例对象 + * @return 实例对象 + */ + Course insert(Course course); + + /** + * 修改数据 + * + * @param course 实例对象 + * @return 实例对象 + */ + Course update(Course course); + + /** + * 通过主键删除数据 + * + * @param courseId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer courseId); + + /** + * 依据老师名称获取课程 + * + * @param name 老师名称 + * @return 实例对象数组 + */ + List queryTeacherName(String name); + + /** + * 依据课程名称获取课程 + * + * @param name 课程名称 + * @return 实例对象数组 + */ + List queryCourseName(String name); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @param valid + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size, Integer valid); + + /** + * 分页根据类型查询课程 + * + * @param page 页码 + * @param size 查询条数 + * @param typeId 对象列表 + * @return 实例对象 + */ + PageInfo queryAllByLimitAndTypeId(int page, int size, Integer typeId); + + /** + * 查找課程的所有章節 拼接课程视频 和 播放记录 + * + * @param courseId + * @param userId + * @return + */ + List getCourseChapterAndVideoPosition(Integer courseId, Integer userId, Integer classId); + + + /** + * 查找課程的所有视频 + * + * @param courseId + * @return + * @return + */ + List getAllVideos(Integer courseId); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseTypeRelationService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseTypeRelationService.java new file mode 100644 index 0000000..5c448e4 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseTypeRelationService.java @@ -0,0 +1,59 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.CourseTypeRelation; +import org.springframework.stereotype.Component; + +/** + * (CourseTypeRelation)表服务接口 + * + * @author java + * @since 2021-02-02 09:25:10 + */ + +@Component +public interface CourseTypeRelationService { + + /** + * 通过ID查询单条数据 + * + * @param courseTypeReId 主键 + * @return 实例对象 + */ + CourseTypeRelation queryById(Integer courseTypeReId); + + /** + * 新增数据 + * + * @param courseTypeRelation 实例对象 + * @return 实例对象 + */ + CourseTypeRelation insert(CourseTypeRelation courseTypeRelation); + + /** + * 修改数据 + * + * @param courseTypeRelation 实例对象 + * @return 实例对象 + */ + CourseTypeRelation update(CourseTypeRelation courseTypeRelation); + + /** + * 通过主键删除数据 + * + * @param courseTypeReId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer courseTypeReId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseTypeService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseTypeService.java new file mode 100644 index 0000000..1fc0f48 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/CourseTypeService.java @@ -0,0 +1,60 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.CourseType; +import org.springframework.stereotype.Component; + + +/** + * (CourseType)表服务接口 + * + * @author java + * @since 2020-12-17 14:12:52 + */ + +@Component +public interface CourseTypeService { + + /** + * 通过ID查询单条数据 + * + * @param courseTypeId 主键 + * @return 实例对象 + */ + CourseType queryById(Integer courseTypeId); + + /** + * 新增数据 + * + * @param courseType 实例对象 + * @return 实例对象 + */ + CourseType insert(CourseType courseType); + + /** + * 修改数据 + * + * @param courseType 实例对象 + * @return 实例对象 + */ + CourseType update(CourseType courseType); + + /** + * 通过主键删除数据 + * + * @param courseTypeId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer courseTypeId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/NewsService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/NewsService.java new file mode 100644 index 0000000..4e46048 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/NewsService.java @@ -0,0 +1,71 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.News; +import org.springframework.stereotype.Component; + +import java.util.List; + + +/** + * 新闻表 + * (News)表服务接口 + * + * @author java + * @since 2020-11-20 11:48:37 + */ + +@Component +public interface NewsService { + + /** + * 通过ID查询单条数据 + * + * @param newsId 主键 + * @return 实例对象 + */ + News queryById(Integer newsId); + + /** + * 新增数据 + * + * @param news 实例对象 + * @return 实例对象 + */ + News insert(News news); + + /** + * 修改数据 + * + * @param news 实例对象 + * @return 实例对象 + */ + News update(News news); + + /** + * 通过主键删除数据 + * + * @param newsId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer newsId); + + /** + * 依据标签id查询 news + * + * @param tagId 标签id + * @return 实例对象数组 + */ + PageInfo queryListByTagId(Integer tagId, int page, int size); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/NewsTagService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/NewsTagService.java new file mode 100644 index 0000000..d6e2d91 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/NewsTagService.java @@ -0,0 +1,60 @@ +package com.hc.business.service; + +import com.hc.business.model.News; +import com.hc.business.model.NewsTag; +import org.springframework.stereotype.Component; + +import java.util.List; + + +/** + * 新闻标签表(NewsTag)表服务接口 + * + * @author java + * @since 2020-11-20 12:52:32 + */ + +@Component +public interface NewsTagService { + + /** + * 通过ID查询单条数据 + * + * @param tagId 主键 + * @return 实例对象 + */ + NewsTag queryById(Integer tagId); + + /** + * 新增数据 + * + * @param newsTag 实例对象 + * @return 实例对象 + */ + NewsTag insert(NewsTag newsTag); + + /** + * 修改数据 + * + * @param newsTag 实例对象 + * @return 实例对象 + */ + NewsTag update(NewsTag newsTag); + + /** + * 通过主键删除数据 + * + * @param tagId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer tagId); + + /** + * 分页查询多条数据 + * + * @return 对象列表 + */ + List queryAll(); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/OrderUserLogService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/OrderUserLogService.java new file mode 100644 index 0000000..ce3c792 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/OrderUserLogService.java @@ -0,0 +1,70 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.OrderUserLog; +import org.springframework.stereotype.Component; + +import java.util.List; + + +/** + * (OrderUserLog)表服务接口 + * + * @author java + * @since 2020-12-03 09:25:09 + */ + +@Component +public interface OrderUserLogService { + + /** + * 通过ID查询单条数据 + * + * @param orderLogId 主键 + * @return 实例对象 + */ + OrderUserLog queryById(Integer orderLogId); + + /** + * 新增数据 + * + * @param orderUserLog 实例对象 + * @return 实例对象 + */ + OrderUserLog insert(OrderUserLog orderUserLog); + + /** + * 依据订单id查询订单详情 + * + * @param orderId + * @return + */ + List queryListByOrderId(Integer orderId); + + /** + * 修改数据 + * + * @param orderUserLog 实例对象 + * @return 实例对象 + */ + OrderUserLog update(OrderUserLog orderUserLog); + + /** + * 通过主键删除数据 + * + * @param orderLogId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer orderLogId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/OrdersService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/OrdersService.java new file mode 100644 index 0000000..424b4a0 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/OrdersService.java @@ -0,0 +1,149 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.dto.UserPriceTotal; +import com.hc.business.dto.UserTimeTotal; +import com.hc.business.model.Orders; +import org.springframework.stereotype.Component; + +import java.util.List; + + +/** + * 订单表(Orders)表服务接口 + * + * @author java + * @since 2020-11-26 16:46:44 + */ + +@Component +public interface OrdersService { + + /** + * 通过ID查询单条数据 + * + * @param ordersId 主键 + * @return 实例对象 + */ + Orders queryById(Integer ordersId); + + /** + * 新增数据 + * + * @param orders 实例对象 + * @return 实例对象 + */ + Orders insert(Orders orders); + + /** + * 创建订单编号 + * + * @return 实体对象 + */ + String createOrderNo(); + + /** + * 修改数据 + * + * @param orders 实例对象 + * @return 实例对象 + */ + Orders update(Orders orders); + + /** + * 通过主键删除数据 + * + * @param ordersId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer ordersId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllWithOrderInvoices(int page, int size); + + /** + * 用户 查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @param userId 用户id + * @return 对象列表 + */ + PageInfo queryAllByUserId(int page, int size, Integer userId); + + /** + * 用户 查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @param classId 班次id + * @return 对象列表 + */ + PageInfo queryAllByClassId(int page, int size, Integer classId); + + /** + * 用户 查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @param className 班次名称 + * @return 对象列表 + */ + PageInfo queryAllByClassName(int page, int size, String className); + + /** + * 用户 查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @param status 订单状态 + * @return 对象列表 + */ + PageInfo queryAllByStatus(int page, int size, Integer status); + + /** + * 查询发票下的名单信息 + * + * @param userInvoicesId 发票id + * @return 实例对象数组 + */ + List queryByUserInvoicesId(Integer userInvoicesId); + + /** + * 获取用户订单金额统计数量 + * + * @return 实例对象 + */ + UserPriceTotal queryUserCount(); + + /** + * 依据订单编号获取订单信息 + * + * @param orderNo 订单编号 + * @return 实例对象 + */ + List queryByOrderNo(String orderNo); + + /** + * 获取订单数量 + * + * @return 实例对象 + */ + Integer countOrderTotal(); + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/PaperQuestionService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/PaperQuestionService.java new file mode 100644 index 0000000..5ff6866 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/PaperQuestionService.java @@ -0,0 +1,70 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.PaperQuestion; +import org.springframework.stereotype.Component; + +import java.util.List; + + +/** + * 随机试卷问题表(PaperQuestion)表服务接口 + * + * @author java + * @since 2020-12-07 11:35:13 + */ + +@Component +public interface PaperQuestionService { + + /** + * 通过ID查询单条数据 + * + * @param paperRuleId 主键 + * @return 实例对象 + */ + PaperQuestion queryById(Integer paperRuleId); + + /** + * 新增数据 + * + * @param paperQuestion 实例对象 + * @return 实例对象 + */ + PaperQuestion insert(PaperQuestion paperQuestion); + + /** + * 修改数据 + * + * @param paperQuestion 实例对象 + * @return 实例对象 + */ + PaperQuestion update(PaperQuestion paperQuestion); + + /** + * 通过主键删除数据 + * + * @param paperRuleId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer paperRuleId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + /** + * 依据试卷id获取抽题规则 + * + * @param paperId 试卷id + * @return 实例对象数组 + */ + List queryByPaperId(Integer paperId); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/PaperService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/PaperService.java new file mode 100644 index 0000000..bd96fe2 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/PaperService.java @@ -0,0 +1,78 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.dto.PaperCommitDTO; +import com.hc.business.dto.PaperResultDto; +import com.hc.business.model.Paper; +import com.hc.core.utils.result.Result; +import org.springframework.stereotype.Component; + + +/** + * 试卷表(Paper)表服务接口 + * + * @author java + * @since 2020-12-07 11:34:36 + */ + +@Component +public interface PaperService { + + /** + * 通过ID查询单条数据 + * + * @param paperId 主键 + * @return 实例对象 + */ + Paper queryById(Integer paperId); + + /** + * 新增数据 + * + * @param paper 实例对象 + * @return 实例对象 + */ + Paper insert(Paper paper); + + /** + * 修改数据 + * + * @param paper 实例对象 + * @return 实例对象 + */ + Paper update(Paper paper); + + /** + * 通过主键删除数据 + * + * @param paperId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer paperId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + + /** + * 获取试卷下的习题 + * + * @param paperId 试卷id + * @return 实例对象 + */ + PaperResultDto queryQuestionList(Integer paperId); + + /** + * 提交试卷返回成绩 + * + * @param commitDTO 提交 + * @return 实例对象 + */ + Result paperCommit(PaperCommitDTO commitDTO); +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/QuestionAnswerService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/QuestionAnswerService.java new file mode 100644 index 0000000..0609851 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/QuestionAnswerService.java @@ -0,0 +1,60 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.QuestionAnswer; +import org.springframework.stereotype.Component; + + +/** + * 问题答案表(QuestionAnswer)表服务接口 + * + * @author java + * @since 2020-12-07 11:36:20 + */ + +@Component +public interface QuestionAnswerService { + + /** + * 通过ID查询单条数据 + * + * @param questionAnswerId 主键 + * @return 实例对象 + */ + QuestionAnswer queryById(Integer questionAnswerId); + + /** + * 新增数据 + * + * @param questionAnswer 实例对象 + * @return 实例对象 + */ + QuestionAnswer insert(QuestionAnswer questionAnswer); + + /** + * 修改数据 + * + * @param questionAnswer 实例对象 + * @return 实例对象 + */ + QuestionAnswer update(QuestionAnswer questionAnswer); + + /** + * 通过主键删除数据 + * + * @param questionAnswerId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer questionAnswerId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/QuestionService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/QuestionService.java new file mode 100644 index 0000000..93864bb --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/QuestionService.java @@ -0,0 +1,67 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.Question; +import org.springframework.stereotype.Component; + +/** + * 习题表(Question)表服务接口 + * + * @author java + * @since 2020-12-07 11:35:56 + */ + +@Component +public interface QuestionService { + + /** + * 通过ID查询单条数据 + * + * @param questionId 主键 + * @return 实例对象 + */ + Question queryById(Integer questionId); + + /** + * 新增数据 + * + * @param question 实例对象 + * @return 实例对象 + */ + Question insert(Question question); + + /** + * 修改数据 + * + * @param question 实例对象 + * @return 实例对象 + */ + Question update(Question question); + + /** + * 通过主键删除数据 + * + * @param questionId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer questionId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + /** + * 分页查询多条数据 + * @param tagId 题库id + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryByTagLimit(int tagId,int page, int size); + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/QuestionTagService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/QuestionTagService.java new file mode 100644 index 0000000..7d2a192 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/QuestionTagService.java @@ -0,0 +1,60 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.QuestionTag; +import org.springframework.stereotype.Component; + + +/** + * 问题标签表(QuestionTag)表服务接口 + * + * @author java + * @since 2020-12-07 11:36:41 + */ + +@Component +public interface QuestionTagService { + + /** + * 通过ID查询单条数据 + * + * @param questionTagId 主键 + * @return 实例对象 + */ + QuestionTag queryById(Integer questionTagId); + + /** + * 新增数据 + * + * @param questionTag 实例对象 + * @return 实例对象 + */ + QuestionTag insert(QuestionTag questionTag); + + /** + * 修改数据 + * + * @param questionTag 实例对象 + * @return 实例对象 + */ + QuestionTag update(QuestionTag questionTag); + + /** + * 通过主键删除数据 + * + * @param questionTagId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer questionTagId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/QuestionTypeService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/QuestionTypeService.java new file mode 100644 index 0000000..a78f965 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/QuestionTypeService.java @@ -0,0 +1,60 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.QuestionType; +import org.springframework.stereotype.Component; + + +/** + * 问题类型表(QuestionType)表服务接口 + * + * @author java + * @since 2020-12-07 11:37:01 + */ + +@Component +public interface QuestionTypeService { + + /** + * 通过ID查询单条数据 + * + * @param typeId 主键 + * @return 实例对象 + */ + QuestionType queryById(Integer typeId); + + /** + * 新增数据 + * + * @param questionType 实例对象 + * @return 实例对象 + */ + QuestionType insert(QuestionType questionType); + + /** + * 修改数据 + * + * @param questionType 实例对象 + * @return 实例对象 + */ + QuestionType update(QuestionType questionType); + + /** + * 通过主键删除数据 + * + * @param typeId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer typeId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/ThirdCourseService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/ThirdCourseService.java new file mode 100644 index 0000000..bbbe55c --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/ThirdCourseService.java @@ -0,0 +1,72 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.dto.ThirdCourseBack; +import com.hc.business.dto.ThirdCourseDto; +import com.hc.business.model.ThirdCourse; +import org.springframework.stereotype.Component; + +import java.util.List; + + +/** + * 第三方用户课程配置表(ThirdCourse)表服务接口 + * + * @author java + * @since 2020-06-17 17:29:30 + */ + +@Component +public interface ThirdCourseService { + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + ThirdCourse queryById(Integer id); + + /** + * 新增数据 + * + * @param thirdCourse 实例对象 + * @return 实例对象 + */ + ThirdCourse insert(ThirdCourse thirdCourse); + + /** + * 修改数据 + * + * @param thirdCourse 实例对象 + * @return 实例对象 + */ + ThirdCourse update(ThirdCourse thirdCourse); + + /** + * 通过主键删除数据 + * + * @param id 主键 + * @return 是否成功 + */ + Boolean deleteById(Integer id); + + /** + * 分页查询所有数据 + * + * @param page 页码 + * @param size 每页大小 + * @return 实例对象数组 + */ + PageInfo queryPageAll(Integer page, Integer size); + + /** + * 获取课程 + * + * @param token 第三方token + * @return 实例对象数组 + */ + List queryThreadCourseDto(String token); + + List queryThirdCourseDtoById(Integer thirdId); +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/ThirdService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/ThirdService.java new file mode 100644 index 0000000..afea487 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/ThirdService.java @@ -0,0 +1,58 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.Third; +import org.springframework.stereotype.Component; + +/** + * 第三方用户表(Third)表服务接口 + * + * @author java + * @since 2020-06-17 17:29:30 + */ + +@Component +public interface ThirdService { + + /** + * 通过ID查询单条数据 + * + * @param thirdId 主键 + * @return 实例对象 + */ + Third queryById(Integer thirdId); + + /** + * 新增数据 + * + * @param third 实例对象 + * @return 实例对象 + */ + Third insert(Third third); + + /** + * 修改数据 + * + * @param third 实例对象 + * @return 实例对象 + */ + Third update(Third third); + + /** + * 通过主键删除数据 + * + * @param thirdId 主键 + * @return 是否成功 + */ + Boolean deleteById(Integer thirdId); + + /** + * 分页查询所有数据 + * + * @param page 页码 + * @param size 每页大小 + * @return 实例对象数组 + */ + PageInfo queryPageAll(Integer page, Integer size); + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserAdminService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserAdminService.java new file mode 100644 index 0000000..9ac1b9b --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserAdminService.java @@ -0,0 +1,70 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.UserAdmin; +import com.hc.business.model.login.AccessEntity; +import com.hc.business.model.login.AuthEntity; +import org.springframework.stereotype.Component; + + +/** + * 管理员表(UserAdmin)表服务接口 + * + * @author java + * @since 2020-11-16 13:45:05 + */ + +@Component +public interface UserAdminService { + + /** + * 通过ID查询单条数据 + * + * @param userAdminId 主键 + * @return 实例对象 + */ + UserAdmin queryById(Integer userAdminId); + + /** + * 新增数据 + * + * @param userAdmin 实例对象 + * @return 实例对象 + */ + UserAdmin insert(UserAdmin userAdmin); + + /** + * 修改数据 + * + * @param userAdmin 实例对象 + * @return 实例对象 + */ + UserAdmin update(UserAdmin userAdmin); + + /** + * 通过主键删除数据 + * + * @param userAdminId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer userAdminId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + /** + * 后台管理员登录 + * + * @param authEntity + * @return + */ + AccessEntity userAdminLogin(AuthEntity authEntity); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserAdviseService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserAdviseService.java new file mode 100644 index 0000000..20ecc01 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserAdviseService.java @@ -0,0 +1,71 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.UserAdvise; +import org.springframework.stereotype.Component; + +import java.util.List; + + +/** + * 用户建议表 + * (UserAdvise)表服务接口 + * + * @author java + * @since 2020-11-16 14:20:03 + */ + +@Component +public interface UserAdviseService { + + /** + * 通过ID查询单条数据 + * + * @param adviceId 主键 + * @return 实例对象 + */ + UserAdvise queryById(Integer adviceId); + + /** + * 新增数据 + * + * @param userAdvise 实例对象 + * @return 实例对象 + */ + UserAdvise insert(UserAdvise userAdvise); + + /** + * 修改数据 + * + * @param userAdvise 实例对象 + * @return 实例对象 + */ + UserAdvise update(UserAdvise userAdvise); + + /** + * 通过主键删除数据 + * + * @param adviceId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer adviceId); + + /** + * 分页查询多条数据 + * + * @param adviceType 类别 + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(Integer adviceType, int page, int size); + + /** + * 依据用户id查询建议 + * + * @param userId 用户id + * @return 实例对象 + */ + PageInfo queryAllByUserId(Integer userId, int page, int size); + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserCourseService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserCourseService.java new file mode 100644 index 0000000..6096adf --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserCourseService.java @@ -0,0 +1,62 @@ +package com.hc.business.service; + +import com.hc.business.dto.UserCourseDto; +import com.hc.business.model.UserCourse; +import org.springframework.stereotype.Component; + +import java.util.List; + + +/** + * 用户课程表(UserCourse)表服务接口 + * + * @author java + * @since 2020-11-09 10:05:19 + */ + +@Component +public interface UserCourseService { + + /** + * 通过ID查询单条数据 + * + * @param userCourseId 主键 + * @return 实例对象 + */ + UserCourse queryById(Integer userCourseId); + + /** + * 新增数据 + * + * @param userCourse 实例对象 + * @return 实例对象 + */ + UserCourse insert(UserCourse userCourse); + + /** + * 修改数据 + * + * @param userCourse 实例对象 + * @return 实例对象 + */ + UserCourse update(UserCourse userCourse); + + /** + * 通过主键删除数据 + * + * @param userCourseId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer userCourseId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + List queryAllByLimit(Integer userId, Integer classId, int page, int size); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserInvoicesService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserInvoicesService.java new file mode 100644 index 0000000..1eff3ec --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserInvoicesService.java @@ -0,0 +1,86 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.UserInvoices; +import org.springframework.stereotype.Component; + +import java.util.List; + + +/** + * 用户发票表(UserInvoices)表服务接口 + * + * @author java + * @since 2020-12-02 10:50:36 + */ + +@Component +public interface UserInvoicesService { + + /** + * 通过ID查询单条数据 + * + * @param userInvoicesId 主键 + * @return 实例对象 + */ + UserInvoices queryById(Integer userInvoicesId); + + /** + * 新增数据 + * + * @param userInvoices 实例对象 + * @return 实例对象 + */ + UserInvoices insert(UserInvoices userInvoices); + + /** + * 修改数据 + * + * @param userInvoices 实例对象 + * @return 实例对象 + */ + UserInvoices update(UserInvoices userInvoices); + + /** + * 通过主键删除数据 + * + * @param userInvoicesId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer userInvoicesId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + /** + * 获取用户的发票信息 + * + * @param userId 用户id + * @return 实例对象数组 + */ + List queryDetailByUserId(Integer userId); + + /** + * 获取班次发票信息 + * + * @param classId 班次id + * @return 实例对象数组 + */ + List queryByClassId(Integer classId); + + /** + * 获取状态获取发票信息 + * + * @param status 状态 + * @return 实例对象数组 + */ + List queryByStatus(Integer status); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserRefundHistoryService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserRefundHistoryService.java new file mode 100644 index 0000000..5827e2f --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserRefundHistoryService.java @@ -0,0 +1,59 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.UserRefundHistory; +import org.springframework.stereotype.Component; + +/** + * 用户退款记录表(UserRefundHistory)表服务接口 + * + * @author java + * @since 2020-12-10 11:31:41 + */ + +@Component +public interface UserRefundHistoryService { + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + UserRefundHistory queryById(Integer id); + + /** + * 新增数据 + * + * @param userRefundHistory 实例对象 + * @return 实例对象 + */ + UserRefundHistory insert(UserRefundHistory userRefundHistory); + + /** + * 修改数据 + * + * @param userRefundHistory 实例对象 + * @return 实例对象 + */ + UserRefundHistory update(UserRefundHistory userRefundHistory); + + /** + * 通过主键删除数据 + * + * @param id 主键 + * @return 是否成功 + */ + boolean deleteById(Integer id); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserService.java new file mode 100644 index 0000000..dc80555 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserService.java @@ -0,0 +1,154 @@ +package com.hc.business.service; + +import com.hc.business.dto.*; +import com.hc.business.model.User; +import com.hc.business.model.login.AccessEntity; +import com.hc.business.model.login.AuthEntity; +import org.springframework.stereotype.Component; +import com.github.pagehelper.PageInfo; + +import java.util.List; + + +/** + * 用户表(User)表服务接口 + * + * @author java + * @since 2020-11-09 10:04:14 + */ + +@Component +public interface UserService { + + /** + * 通过ID查询单条数据 + * + * @param userId 主键 + * @return 实例对象 + */ + User queryById(Integer userId); + + /** + * 新增数据 + * + * @param user 实例对象 + * @return 实例对象 + */ + User insert(User user); + + /** + * 修改数据 + * + * @param user 实例对象 + * @return 实例对象 + */ + User update(User user); + + /** + * 通过主键删除数据 + * + * @param userId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer userId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + /** + * 用户登录(账号,密码) + * + * @param authEntity 实例对象 + * @return 实例对象 + */ + AccessEntity userLogin(AuthEntity authEntity); + + + /** + * 用户登录(手机号登录) + * + * @param smsLoginDto 实例对象 + * @return 实例对象 + */ + AccessEntity userLoginSms(SmsLoginDto smsLoginDto); + + /** + * 用户注册 + * + * @param retrievePasswordDto 实例对象 + * @return 实例对象 + */ + AccessEntity userRegister(RetrievePasswordDto retrievePasswordDto); + + /** + * 发送授权码 + * + * @param phone 实例对象 + * @return 实例对象 + */ + String sendAuthCode(String phone); + + /** + * 校验验证码-找回密码 + * + * @param retrievePasswordDto 实例对象 + * @return 实例对象 + */ + User retrievePassword(RetrievePasswordDto retrievePasswordDto); + + /** + * 依据用户手机号查询用户 + * + * @param userMobile 手机号 + * @return 实例对象数组 + */ + List queryByMobile(String userMobile); + + /** + * 身份证查询用户 + * + * @param cardId 身份证号 + * @return 实例对象数组 + */ + List queryUserByCard(String cardId); + + + /** + * 姓名查询用户 + * + * @param name 身份证号 + * @return 实例对象数组 + */ + List queryUserByName(String name); + + + /** + * 姓名查询用户 + * + * @param name 身份证号 + * @return 实例对象数组 + */ + List queryUserByClassName(String name, int pay); + + /** + * 获取用户统计数量 + * + * @return 实例对象 + */ + UserTimeTotal queryUserCount(); + + /** + * 获取最近七天用户统计数量 + * + * @return 实例对象数组 + */ + List queryByUserCount(); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserStatusService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserStatusService.java new file mode 100644 index 0000000..c8c0a0b --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserStatusService.java @@ -0,0 +1,84 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.dto.UserStatusClassDto; +import com.hc.business.model.User; +import com.hc.business.model.UserStatus; +import org.springframework.stereotype.Component; + +import java.util.List; + + +/** + * 用户班级学习进度表 + * (UserStatus)表服务接口 + * + * @author java + * @since 2020-12-06 11:26:43 + */ + +@Component +public interface UserStatusService { + + /** + * 通过ID查询单条数据 + * + * @param statusId 主键 + * @return 实例对象 + */ + UserStatus queryById(Integer statusId); + + /** + * 新增数据 + * + * @param userStatus 实例对象 + * @return 实例对象 + */ + UserStatus insert(UserStatus userStatus); + + /** + * 修改数据 + * + * @param userStatus 实例对象 + * @return 实例对象 + */ + UserStatus update(UserStatus userStatus); + + /** + * 通过主键删除数据 + * + * @param statusId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer statusId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + /** + * 查询用户培训记录 + * + * @param userId 用户id + * @return 实例对象数组 + */ + List queryDtoByUserId(Integer userId); + + + /** + * 查询班次下的用户 + * + * @param classId 班次id + * @param page 页码 + * @param size 查询条数 + * @return 实例对象 + */ + PageInfo queryByClassId(Integer classId, int page, int size); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserTeacherService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserTeacherService.java new file mode 100644 index 0000000..55dbef2 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserTeacherService.java @@ -0,0 +1,70 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.UserTeacher; +import org.springframework.stereotype.Component; + +import java.util.List; + + +/** + * (UserTeacher)表服务接口 + * + * @author java + * @since 2020-11-20 11:08:19 + */ + +@Component +public interface UserTeacherService { + + /** + * 通过ID查询单条数据 + * + * @param teacherId 主键 + * @return 实例对象 + */ + UserTeacher queryById(Integer teacherId); + + /** + * 新增数据 + * + * @param userTeacher 实例对象 + * @return 实例对象 + */ + UserTeacher insert(UserTeacher userTeacher); + + /** + * 修改数据 + * + * @param userTeacher 实例对象 + * @return 实例对象 + */ + UserTeacher update(UserTeacher userTeacher); + + /** + * 通过主键删除数据 + * + * @param teacherId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer teacherId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + /** + * 依据老师名称查询老师 + * + * @param name 老师名称 + * @return 实例对象数组 + */ + List queryByName(String name); + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserTestHistoryService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserTestHistoryService.java new file mode 100644 index 0000000..28aef99 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserTestHistoryService.java @@ -0,0 +1,67 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.UserTestHistory; +import org.springframework.stereotype.Component; + + +/** + * 用户考试记录表(UserTestHistory)表服务接口 + * + * @author java + * @since 2020-12-07 11:28:20 + */ + +@Component +public interface UserTestHistoryService { + + /** + * 通过ID查询单条数据 + * + * @param testId 主键 + * @return 实例对象 + */ + UserTestHistory queryById(Integer testId); + + /** + * 新增数据 + * + * @param userTestHistory 实例对象 + * @return 实例对象 + */ + UserTestHistory insert(UserTestHistory userTestHistory); + + /** + * 修改数据 + * + * @param userTestHistory 实例对象 + * @return 实例对象 + */ + UserTestHistory update(UserTestHistory userTestHistory); + + /** + * 通过主键删除数据 + * + * @param testId 主键 + * @return 是否成功 + */ + boolean deleteById(Integer testId); + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + PageInfo queryAllByLimit(int page, int size); + + + /** + * 获取当前最高成绩 + * + * @param userId 用户id + * @return 实例对象 + */ + UserTestHistory queryMaxScore(Integer userId,Integer classId); +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserVideoPositionService.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserVideoPositionService.java new file mode 100644 index 0000000..bcbdddb --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/UserVideoPositionService.java @@ -0,0 +1,94 @@ +package com.hc.business.service; + +import com.github.pagehelper.PageInfo; +import com.hc.business.model.UserVideoPosition; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * 用户视频观看记录(UserVideoPosition)表服务接口 + * + * @author java + * @since 2020-05-29 15:50:50 + */ + +@Component +public interface UserVideoPositionService { + + /** + * 通过ID查询单条数据 + * + * @param userVideoPositionId 主键 + * @return 实例对象 + */ + UserVideoPosition queryById(Integer userVideoPositionId); + + /** + * 新增数据 + * + * @param userVideoPosition 实例对象 + * @return 实例对象 + */ + UserVideoPosition insert(UserVideoPosition userVideoPosition); + + /** + * 修改数据 + * + * @param userVideoPosition 实例对象 + * @return 实例对象 + */ + UserVideoPosition update(UserVideoPosition userVideoPosition); + + /** + * 通过主键删除数据 + * + * @param userVideoPositionId 主键 + * @return 是否成功 + */ + Boolean deleteById(Integer userVideoPositionId); + + /** + * 分页查询所有数据 + * + * @param page 页码 + * @param size 每页大小 + * @return 实例对象数组 + */ + PageInfo queryAllByLimit(Integer page, Integer size); + + + /** + * 添加一条播放进度redis + * + * @param userVideoPosition + * @param courseId + * @return + */ + UserVideoPosition insertPositionToRedis(UserVideoPosition userVideoPosition, Integer courseId); + + + /* + 刷新视频进度到数据库 + */ + int flushToDb(Integer userId, Integer videoId, Integer courseId, String years,Integer classId); + + /** + * 获取视频进度 + * + * @param positionId + * @return + */ + UserVideoPosition getVideoPosition(Integer positionId); + + /** + * 获取用户课程进度 + * + * @param userId + * @param videoId + * @param courseId + * @return + */ + Map findVideoPosition(Integer userId, Integer videoId, Integer courseId,Integer classId); + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/AliPayServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/AliPayServiceImpl.java new file mode 100644 index 0000000..69a6595 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/AliPayServiceImpl.java @@ -0,0 +1,186 @@ +package com.hc.business.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alipay.api.AlipayApiException; +import com.hc.business.dto.ClassCourseDto; +import com.hc.business.dto.UserCourseDto; +import com.hc.business.mapper.*; +import com.hc.business.model.*; +import com.hc.business.service.AliPayService; +import com.hc.core.utils.constants.OrderConstants; +import com.hc.core.utils.pay.browser.alipay.bean.AliPayBean; +import com.hc.core.utils.pay.browser.alipay.processor.AliPayProcessor; +import com.hc.core.utils.pay.browser.alipay.bean.AliPayRefundBean; +import com.hc.core.utils.status.CourseFlagEnum; +import com.hc.core.utils.status.OrdersFlagEnum; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author 10696 + */ + +@Service +@Slf4j +public class AliPayServiceImpl implements AliPayService { + + @Autowired + private AliPayProcessor aliPayProcessor; + + @Autowired + private OrdersMapper ordersMapper; + + @Autowired + private OrderUserLogMapper orderUserLogMapper; + + @Autowired + private UserCourseMapper userCourseMapper; + + @Autowired + private ClassCourseMapper classCourseMapper; + + @Autowired + private UserStatusMapper userStatusMapper; + + @Autowired + private UserRefundHistoryMapper userRefundHistoryMapper; + + @Autowired + private UserAdviseMapper userAdviseMapper; + + @Autowired + private UserMapper userMapper; + + @Override + public Map alipay(AliPayBean aliPayBean) throws AlipayApiException { + Map map = new HashMap<>(2); + String pay = aliPayProcessor.pay(aliPayBean); + map.put("aliPay", pay); + return map; + } + + @Override + public void returnNotifyUrlInfo(String outTradeNo, String tradeNo, String tradeStatus) { + //判断交易状态 + + String trade = "TRADE_SUCCESS"; + if (!trade.equals(tradeStatus)) { + throw new RuntimeException("交易出错,支付回调失败"); + } + + //修改订单状态 + Orders orders = ordersMapper.queryByOrderNo(outTradeNo); + orders.setTradeNo(tradeNo); + orders.setOrderStatus(OrdersFlagEnum.ORDERS_FLAG_PAID.getCode()); + ordersMapper.updateByPrimaryKeySelective(orders); + + //查询订单中的用户 + Integer ordersId = orders.getOrdersId(); + Integer classId = orders.getClassId(); + List orderUserLogs = + orderUserLogMapper.queryByOrderId(ordersId); + List classCourseDtoList = + classCourseMapper.queryByClassId(classId, CourseFlagEnum.COURSE_REQUIRE_CODE.getCode()); + + if (CollectionUtils.isEmpty(orderUserLogs)) { + if (CollectionUtils.isEmpty(classCourseDtoList)) { + return; + } + return; + } + createUserAdvise(orderUserLogs); + createUserCourse(classId, orderUserLogs, classCourseDtoList); + } + + private void createUserAdvise(List orderUserLogs) { + orderUserLogs.forEach(orderUserLog -> { + UserAdvise userAdvise = new UserAdvise(); + userAdvise.setAdviceType(1); + userAdvise.setCreateTime(System.currentTimeMillis()); + userAdvise.setAdvise("报名成功,欢迎您的加入。"); + userAdvise.setUserId(orderUserLog.getReUserId()); + userAdvise.setTitle("报名成功"); + userAdviseMapper.insert(userAdvise); + }); + } + + @Override + public Map refund(AliPayRefundBean aliPayRefundBean) throws AlipayApiException { + + String refund = aliPayProcessor.refund(aliPayRefundBean); + JSONObject jsonObject = JSON.parseObject(refund); + String code = (String) jsonObject.get("code"); + String outTradeNo = (String) jsonObject.get("out_trade_no"); + + if (!OrderConstants.ORDER_REFUND.equals(code)) { + throw new RuntimeException("交易出错,退款失败"); + } + + //修改订单状态 + Orders orders = ordersMapper.queryByOrderNo(outTradeNo); + orders.setOrderStatus(OrdersFlagEnum.ORDERS_FLAG_REFUNDED.getCode()); + ordersMapper.updateByPrimaryKeySelective(orders); + + //修改退款状态 + UserRefundHistory userRefundHistory + = userRefundHistoryMapper.queryByOrderNo(outTradeNo); + userRefundHistory.setDoneTime(System.currentTimeMillis()); + userRefundHistoryMapper.updateByPrimaryKeySelective(userRefundHistory); + + //删除用户已选课程 + Integer classId = orders.getClassId(); + Integer userId = orders.getUserId(); + List userCourses = + userCourseMapper.selectUserCourseListByParam(userId, classId); + userCourses.forEach(userCourse -> userCourseMapper.delete(userCourse)); + + Map map = new HashMap<>(2); + map.put("refund", refund); + return map; + } + + private void createUserCourse(Integer classId, + List orderUserLogs, + List classCourseDtoList) { + orderUserLogs.forEach(orderUserLog -> { + Integer reUserId = orderUserLog.getReUserId(); + Integer ordersId = orderUserLog.getOrderId(); + //开用户状态 + List userStatuses = + userStatusMapper.queryByClassIdAndUserId(classId, reUserId); + if (CollectionUtils.isEmpty(userStatuses)) { + UserStatus userStatus = new UserStatus(); + userStatus.setClassId(classId); + userStatus.setOrderId(ordersId); + userStatus.setUserId(reUserId); + userStatus.setStatus(OrdersFlagEnum.ORDERS_FLAG_PAID.getCode()); + userStatusMapper.insert(userStatus); + } + //课程 + classCourseDtoList.forEach(classCourseDto -> { + Integer courseId = classCourseDto.getCourseId(); + //是否已开 + List userCourses + = userCourseMapper.selectUserCourseProgress(reUserId, classId, courseId); + if (CollectionUtils.isEmpty(userCourses)) { + //开课 + UserCourse userCourse = new UserCourse(); + userCourse.setClassId(classId); + userCourse.setCourseId(courseId); + userCourse.setUserId(reUserId); + userCourse.setCoursePercent(0.00); + userCourseMapper.insert(userCourse); + } + }); + }); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/AreaDistrictServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/AreaDistrictServiceImpl.java new file mode 100644 index 0000000..8248148 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/AreaDistrictServiceImpl.java @@ -0,0 +1,93 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.AreaDistrictMapper; +import com.hc.business.model.AreaDistrict; +import com.hc.business.service.AreaDistrictService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 省份表(AreaDistrict)表服务实现类 + * + * @author java + * @since 2020-11-20 12:48:47 + */ + +@Service("areaDistrictService") +public class AreaDistrictServiceImpl implements AreaDistrictService { + + private final AreaDistrictMapper areaDistrictMapper; + + public AreaDistrictServiceImpl(AreaDistrictMapper areaDistrictMapper) { + this.areaDistrictMapper = areaDistrictMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param areaId 主键 + * @return 实例对象 + */ + @Override + public AreaDistrict queryById(Integer areaId) { + return this.areaDistrictMapper.selectByPrimaryKey(areaId); + } + + /** + * 新增数据 + * + * @param areaDistrict 实例对象 + * @return 实例对象 + */ + @Override + public AreaDistrict insert(AreaDistrict areaDistrict) { + this.areaDistrictMapper.insert(areaDistrict); + return areaDistrict; + } + + /** + * 修改数据 + * + * @param areaDistrict 实例对象 + * @return 实例对象 + */ + @Override + public AreaDistrict update(AreaDistrict areaDistrict) { + this.areaDistrictMapper.updateByPrimaryKeySelective(areaDistrict); + return this.queryById(areaDistrict.getAreaId()); + } + + /** + * 通过主键删除数据 + * + * @param areaId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer areaId) { + return this.areaDistrictMapper.deleteByPrimaryKey(areaId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + //分页开启 + PageHelper.startPage(page, size); + List list = areaDistrictMapper.queryAllByParentId(0); + list.forEach(areaDistrict -> { + List areaDistricts = areaDistrictMapper.queryAllByParentId(areaDistrict.getAreaId()); + areaDistrict.setAreaDistrictList(areaDistricts); + }); + return new PageInfo(list); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/BannerServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/BannerServiceImpl.java new file mode 100644 index 0000000..fb42c11 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/BannerServiceImpl.java @@ -0,0 +1,84 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.BannerMapper; +import com.hc.business.model.Banner; +import com.hc.business.service.BannerService; +import org.springframework.stereotype.Service; + +/** + * 广告表 + * (Banner)表服务实现类 + * + * @author java + * @since 2020-11-26 09:29:52 + */ + +@Service("bannerService") +public class BannerServiceImpl implements BannerService { + + private final BannerMapper bannerMapper; + + public BannerServiceImpl(BannerMapper bannerMapper) { + this.bannerMapper = bannerMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param bannerId 主键 + * @return 实例对象 + */ + @Override + public Banner queryById(Integer bannerId) { + return this.bannerMapper.selectByPrimaryKey(bannerId); + } + + /** + * 新增数据 + * + * @param banner 实例对象 + * @return 实例对象 + */ + @Override + public Banner insert(Banner banner) { + this.bannerMapper.insert(banner); + return banner; + } + + /** + * 修改数据 + * + * @param banner 实例对象 + * @return 实例对象 + */ + @Override + public Banner update(Banner banner) { + this.bannerMapper.updateByPrimaryKeySelective(banner); + return this.queryById(banner.getBannerId()); + } + + /** + * 通过主键删除数据 + * + * @param bannerId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer bannerId) { + return this.bannerMapper.deleteByPrimaryKey(bannerId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.bannerMapper::selectAll); + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/ClassConfigServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/ClassConfigServiceImpl.java new file mode 100644 index 0000000..3b18b21 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/ClassConfigServiceImpl.java @@ -0,0 +1,145 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.AreaDistrictMapper; +import com.hc.business.mapper.ClassConfigMapper; +import com.hc.business.model.AreaDistrict; +import com.hc.business.model.ClassConfig; +import com.hc.business.service.ClassConfigService; +import com.hc.core.utils.exception.ResponseException; +import com.hc.core.utils.status.CodeFlagEnum; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; +import java.util.Objects; + +/** + * 班次表(ClassConfig)表服务实现类 + * + * @author java + * @since 2020-11-19 16:12:33 + */ + +@Service("classConfigService") +public class ClassConfigServiceImpl implements ClassConfigService { + + private final ClassConfigMapper classConfigMapper; + + private final AreaDistrictMapper areaDistrictMapper; + + public ClassConfigServiceImpl(ClassConfigMapper classConfigMapper, AreaDistrictMapper areaDistrictMapper) { + this.classConfigMapper = classConfigMapper; + this.areaDistrictMapper = areaDistrictMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param classConfigId 主键 + * @return 实例对象 + */ + @Override + public ClassConfig queryById(Integer classConfigId) { + return this.classConfigMapper.selectByPrimaryKey(classConfigId); + } + + /** + * 新增数据 + * + * @param classConfig 实例对象 + * @return 实例对象 + */ + @Override + public ClassConfig insert(ClassConfig classConfig) { + classConfig.setValid(CodeFlagEnum.OBJECT_ENABLE_CODE.getCode()); + classConfig.setCreateTime(System.currentTimeMillis()); + this.classConfigMapper.insert(classConfig); + return classConfig; + } + + /** + * 修改数据 + * + * @param classConfig 实例对象 + * @return 实例对象 + */ + @Override + public ClassConfig update(ClassConfig classConfig) { + this.classConfigMapper.updateByPrimaryKeySelective(classConfig); + return this.queryById(classConfig.getClassConfigId()); + } + + /** + * 通过主键删除数据 + * + * @param classConfigId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer classConfigId) { + return this.classConfigMapper.deleteByPrimaryKey(classConfigId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + PageHelper.startPage(page, size); + List classConfigs = this.classConfigMapper.queryAll(); + List classConfigsList = queryByAreaIdGetName(classConfigs); + return new PageInfo(classConfigsList); + } + + @Override + public PageInfo queryByValid(Integer valid, int page, int size) { + PageHelper.startPage(page, size); + List classConfigs = this.classConfigMapper.queryByValid(valid); + List classConfigsList = queryByAreaIdGetName(classConfigs); + return new PageInfo(classConfigsList); + } + + @Override + public List queryByClassName(String name) { + return this.classConfigMapper.queryByClassName(name); + } + + @Override + public PageInfo queryByAreaId(Integer areaId, int page, int size) { + PageHelper.startPage(page, size); + List classConfigs = this.classConfigMapper.queryByAreaId(areaId); + List classConfigsList = queryByAreaIdGetName(classConfigs); + return new PageInfo(classConfigsList); + } + + @Override + public PageInfo queryByTime(Long studyStartTime, Integer page, Integer size) { + PageHelper.startPage(page, size); + List classConfigs = this.classConfigMapper.queryByTime(studyStartTime); + List classConfigsList = queryByAreaIdGetName(classConfigs); + return new PageInfo(classConfigsList); + } + + private List queryByAreaIdGetName(List classConfigs) { + if (CollectionUtils.isEmpty(classConfigs)) { + throw new ResponseException(-1, "暂无培训班上线"); + } + classConfigs.forEach(classConfig -> { + AreaDistrict areaDistrict = + areaDistrictMapper.selectByPrimaryKey(classConfig.getAreaId()); + if (Objects.isNull(areaDistrict)) { + return; + } + classConfig.setAreaName(areaDistrict.getAreaName()); + }); + return classConfigs; + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/ClassConfigSponsorServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/ClassConfigSponsorServiceImpl.java new file mode 100644 index 0000000..e665066 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/ClassConfigSponsorServiceImpl.java @@ -0,0 +1,93 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.ClassConfigSponsorMapper; +import com.hc.business.model.ClassConfigSponsor; +import com.hc.business.service.ClassConfigSponsorService; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Objects; + +/** + * (ClassConfigSponsor)表服务实现类 + * + * @author java + * @since 2021-05-28 14:19:35 + */ + +@Service("classConfigSponsorService") +public class ClassConfigSponsorServiceImpl implements ClassConfigSponsorService { + + private final ClassConfigSponsorMapper classConfigSponsorMapper; + + public ClassConfigSponsorServiceImpl(ClassConfigSponsorMapper classConfigSponsorMapper) { + this.classConfigSponsorMapper = classConfigSponsorMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param sponsorId 主键 + * @return 实例对象 + */ + @Override + public ClassConfigSponsor queryById(Integer sponsorId) { + return this.classConfigSponsorMapper.selectByPrimaryKey(sponsorId); + } + + /** + * 新增数据 + * + * @param classConfigSponsor 实例对象 + * @return 实例对象 + */ + @Override + public ClassConfigSponsor insert(ClassConfigSponsor classConfigSponsor) { + classConfigSponsor.setCreateTime(System.currentTimeMillis()); + this.classConfigSponsorMapper.insert(classConfigSponsor); + return classConfigSponsor; + } + + /** + * 修改数据 + * + * @param classConfigSponsor 实例对象 + * @return 实例对象 + */ + @Override + public ClassConfigSponsor update(ClassConfigSponsor classConfigSponsor) { + this.classConfigSponsorMapper.updateByPrimaryKeySelective(classConfigSponsor); + return this.queryById(classConfigSponsor.getSponsorId()); + } + + /** + * 通过主键删除数据 + * + * @param sponsorId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer sponsorId) { + return this.classConfigSponsorMapper.deleteByPrimaryKey(sponsorId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size, Integer classId) { + if (Objects.isNull(classId)) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.classConfigSponsorMapper::selectAll); + } + PageHelper.startPage(page, size); + List classConfigSponsors = this.classConfigSponsorMapper.queryListByClassId(classId); + return new PageInfo(classConfigSponsors); + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/ClassCourseServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/ClassCourseServiceImpl.java new file mode 100644 index 0000000..a5c5750 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/ClassCourseServiceImpl.java @@ -0,0 +1,106 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.dto.ClassCourseDto; +import com.hc.business.mapper.ClassCourseMapper; +import com.hc.business.model.ClassCourse; +import com.hc.business.service.ClassCourseService; +import com.hc.core.utils.exception.ResponseException; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; +import java.util.function.IntFunction; + +/** + * 班次课程表(ClassCourse)表服务实现类 + * + * @author java + * @since 2020-11-24 11:30:09 + */ + +@Service("classCourseService") +public class ClassCourseServiceImpl implements ClassCourseService { + + private final ClassCourseMapper classCourseMapper; + + public ClassCourseServiceImpl(ClassCourseMapper classCourseMapper) { + this.classCourseMapper = classCourseMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param classCourseId 主键 + * @return 实例对象 + */ + @Override + public ClassCourse queryById(Integer classCourseId) { + return this.classCourseMapper.selectByPrimaryKey(classCourseId); + } + + /** + * 新增数据 + * + * @param classCourse 实例对象 + * @return 实例对象 + */ + @Override + public ClassCourse insert(ClassCourse classCourse) { + Integer classId = classCourse.getClassId(); + Integer courseId = classCourse.getCourseId(); + List classCourses = + this.classCourseMapper.queryByClassIdWithCourseId(classId, courseId); + if (!CollectionUtils.isEmpty(classCourses)) { + return classCourses.get(0); + } + classCourse.setCreateTime(System.currentTimeMillis()); + this.classCourseMapper.insert(classCourse); + return classCourse; + } + + /** + * 修改数据 + * + * @param classCourse 实例对象 + * @return 实例对象 + */ + @Override + public ClassCourse update(ClassCourse classCourse) { + this.classCourseMapper.updateByPrimaryKeySelective(classCourse); + return this.queryById(classCourse.getClassCourseId()); + } + + /** + * 通过主键删除数据 + * + * @param classCourseId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer classCourseId) { + return this.classCourseMapper.deleteByPrimaryKey(classCourseId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.classCourseMapper::selectAll); + } + + @Override + public PageInfo queryByClassId(Integer classId, Integer courseType, + Integer page, Integer size) { + PageHelper.startPage(page, size); + List classCourseDtoList + = this.classCourseMapper.queryByClassId(classId, courseType); + return new PageInfo(classCourseDtoList); + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseChapterAnnexServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseChapterAnnexServiceImpl.java new file mode 100644 index 0000000..32d9b38 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseChapterAnnexServiceImpl.java @@ -0,0 +1,83 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.CourseChapterAnnexMapper; +import com.hc.business.model.CourseChapterAnnex; +import com.hc.business.service.CourseChapterAnnexService; +import org.springframework.stereotype.Service; + +/** + * 章节附件表(CourseChapterAnnex)表服务实现类 + * + * @author java + * @since 2020-11-09 10:04:49 + */ + +@Service("courseChapterAnnexService") +public class CourseChapterAnnexServiceImpl implements CourseChapterAnnexService { + + private final CourseChapterAnnexMapper courseChapterAnnexMapper; + + public CourseChapterAnnexServiceImpl(CourseChapterAnnexMapper courseChapterAnnexMapper) { + this.courseChapterAnnexMapper = courseChapterAnnexMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param courseChapterAnnexId 主键 + * @return 实例对象 + */ + @Override + public CourseChapterAnnex queryById(Integer courseChapterAnnexId) { + return this.courseChapterAnnexMapper.selectByPrimaryKey(courseChapterAnnexId); + } + + /** + * 新增数据 + * + * @param courseChapterAnnex 实例对象 + * @return 实例对象 + */ + @Override + public CourseChapterAnnex insert(CourseChapterAnnex courseChapterAnnex) { + this.courseChapterAnnexMapper.insert(courseChapterAnnex); + return courseChapterAnnex; + } + + /** + * 修改数据 + * + * @param courseChapterAnnex 实例对象 + * @return 实例对象 + */ + @Override + public CourseChapterAnnex update(CourseChapterAnnex courseChapterAnnex) { + this.courseChapterAnnexMapper.updateByPrimaryKeySelective(courseChapterAnnex); + return this.queryById(courseChapterAnnex.getCourseChapterAnnexId()); + } + + /** + * 通过主键删除数据 + * + * @param courseChapterAnnexId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer courseChapterAnnexId) { + return this.courseChapterAnnexMapper.deleteByPrimaryKey(courseChapterAnnexId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.courseChapterAnnexMapper::selectAll); + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseChapterServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseChapterServiceImpl.java new file mode 100644 index 0000000..85fb8fb --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseChapterServiceImpl.java @@ -0,0 +1,122 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.CourseChapterMapper; +import com.hc.business.model.CourseChapter; +import com.hc.business.service.CourseChapterService; +import com.hc.core.utils.redis.RedisUtil; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 课程章节表(CourseChapter)表服务实现类 + * + * @author java + * @since 2020-11-09 10:04:47 + */ + +@Service("courseChapterService") +public class CourseChapterServiceImpl implements CourseChapterService { + + private final CourseChapterMapper courseChapterMapper; + + + /** + * 课程以及章节缓存 + */ + private static final String COURSE_CHAPTER_REDIS_KEY_PREFIX = "course:chapter:list:"; + + private final RedisUtil redisUtil; + + public CourseChapterServiceImpl(CourseChapterMapper courseChapterMapper, RedisUtil redisUtil) { + this.courseChapterMapper = courseChapterMapper; + this.redisUtil = redisUtil; + } + + + /** + * 通过ID查询单条数据 + * + * @param courseChapterId 主键 + * @return 实例对象 + */ + @Override + public CourseChapter queryById(Integer courseChapterId) { + return this.courseChapterMapper.selectByPrimaryKey(courseChapterId); + } + + /** + * 新增数据 + * + * @param courseChapter 实例对象 + * @return 实例对象 + */ + @Override + public CourseChapter insert(CourseChapter courseChapter) { + this.courseChapterMapper.insert(courseChapter); + return courseChapter; + } + + /** + * 修改数据 + * + * @param courseChapter 实例对象 + * @return 实例对象 + */ + @Override + public CourseChapter update(CourseChapter courseChapter) { + this.courseChapterMapper.updateByPrimaryKeySelective(courseChapter); + return this.queryById(courseChapter.getCourseChapterId()); + } + + /** + * 通过主键删除数据 + * + * @param courseChapterId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer courseChapterId) { + return this.courseChapterMapper.deleteByPrimaryKey(courseChapterId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.courseChapterMapper::selectAll); + } + + + /** + * @param courseId + * @return + */ + @Override + public List getCourseChapterChildList(Integer courseId) { + + //首先查找redis缓存保存的课程 章节的数据 + String course_key = COURSE_CHAPTER_REDIS_KEY_PREFIX + courseId.toString(); + //目前只支持到章 + if (true == redisUtil.hasKey(course_key)) { + return (List) redisUtil.get(course_key); + } else { + Map map = new HashMap(); + map.put("courseId", courseId); + List list = courseChapterMapper.getCourseChapterChildList(map); + redisUtil.set(course_key, list, 24 * 60 * 60); + return list; + } + + + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseChapterTagServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseChapterTagServiceImpl.java new file mode 100644 index 0000000..aedfe5e --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseChapterTagServiceImpl.java @@ -0,0 +1,83 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.CourseChapterTagMapper; +import com.hc.business.model.CourseChapterTag; +import com.hc.business.service.CourseChapterTagService; +import org.springframework.stereotype.Service; + +/** + * 图书章节标签表。新建完成的图书章节,可以根据讲师不同,给不同的章节打标签,比如基础阶段,进阶阶段。。。(CourseChapterTag)表服务实现类 + * + * @author java + * @since 2020-11-09 10:04:51 + */ + +@Service("courseChapterTagService") +public class CourseChapterTagServiceImpl implements CourseChapterTagService { + + private final CourseChapterTagMapper courseChapterTagMapper; + + public CourseChapterTagServiceImpl(CourseChapterTagMapper courseChapterTagMapper) { + this.courseChapterTagMapper = courseChapterTagMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param tagId 主键 + * @return 实例对象 + */ + @Override + public CourseChapterTag queryById(Integer tagId) { + return this.courseChapterTagMapper.selectByPrimaryKey(tagId); + } + + /** + * 新增数据 + * + * @param courseChapterTag 实例对象 + * @return 实例对象 + */ + @Override + public CourseChapterTag insert(CourseChapterTag courseChapterTag) { + this.courseChapterTagMapper.insert(courseChapterTag); + return courseChapterTag; + } + + /** + * 修改数据 + * + * @param courseChapterTag 实例对象 + * @return 实例对象 + */ + @Override + public CourseChapterTag update(CourseChapterTag courseChapterTag) { + this.courseChapterTagMapper.updateByPrimaryKeySelective(courseChapterTag); + return this.queryById(courseChapterTag.getTagId()); + } + + /** + * 通过主键删除数据 + * + * @param tagId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer tagId) { + return this.courseChapterTagMapper.deleteByPrimaryKey(tagId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.courseChapterTagMapper::selectAll); + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseChapterTestServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseChapterTestServiceImpl.java new file mode 100644 index 0000000..fcf6258 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseChapterTestServiceImpl.java @@ -0,0 +1,83 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.CourseChapterTestMapper; +import com.hc.business.model.CourseChapterTest; +import com.hc.business.service.CourseChapterTestService; +import org.springframework.stereotype.Service; + +/** + * 章节测试表/随堂练习表(CourseChapterTest)表服务实现类 + * + * @author java + * @since 2020-11-09 10:04:53 + */ + +@Service("courseChapterTestService") +public class CourseChapterTestServiceImpl implements CourseChapterTestService { + + private final CourseChapterTestMapper courseChapterTestMapper; + + public CourseChapterTestServiceImpl(CourseChapterTestMapper courseChapterTestMapper) { + this.courseChapterTestMapper = courseChapterTestMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param testId 主键 + * @return 实例对象 + */ + @Override + public CourseChapterTest queryById(Integer testId) { + return this.courseChapterTestMapper.selectByPrimaryKey(testId); + } + + /** + * 新增数据 + * + * @param courseChapterTest 实例对象 + * @return 实例对象 + */ + @Override + public CourseChapterTest insert(CourseChapterTest courseChapterTest) { + this.courseChapterTestMapper.insert(courseChapterTest); + return courseChapterTest; + } + + /** + * 修改数据 + * + * @param courseChapterTest 实例对象 + * @return 实例对象 + */ + @Override + public CourseChapterTest update(CourseChapterTest courseChapterTest) { + this.courseChapterTestMapper.updateByPrimaryKeySelective(courseChapterTest); + return this.queryById(courseChapterTest.getTestId()); + } + + /** + * 通过主键删除数据 + * + * @param testId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer testId) { + return this.courseChapterTestMapper.deleteByPrimaryKey(testId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.courseChapterTestMapper::selectAll); + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseChapterVideoServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseChapterVideoServiceImpl.java new file mode 100644 index 0000000..a44fb93 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseChapterVideoServiceImpl.java @@ -0,0 +1,98 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.CourseChapterVideoMapper; +import com.hc.business.model.CourseChapterVideo; +import com.hc.business.service.CourseChapterVideoService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 课程视频(CourseChapterVideo)表服务实现类 + * + * @author java + * @since 2020-11-09 10:04:56 + */ + +@Service("courseChapterVideoService") +public class CourseChapterVideoServiceImpl implements CourseChapterVideoService { + + private final CourseChapterVideoMapper courseChapterVideoMapper; + + public CourseChapterVideoServiceImpl(CourseChapterVideoMapper courseChapterVideoMapper) { + this.courseChapterVideoMapper = courseChapterVideoMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param videoId 主键 + * @return 实例对象 + */ + @Override + public CourseChapterVideo queryById(Integer videoId) { + return this.courseChapterVideoMapper.selectByPrimaryKey(videoId); + } + + /** + * 新增数据 + * + * @param courseChapterVideo 实例对象 + * @return 实例对象 + */ + @Override + public CourseChapterVideo insert(CourseChapterVideo courseChapterVideo) { + this.courseChapterVideoMapper.insert(courseChapterVideo); + return courseChapterVideo; + } + + /** + * 修改数据 + * + * @param courseChapterVideo 实例对象 + * @return 实例对象 + */ + @Override + public CourseChapterVideo update(CourseChapterVideo courseChapterVideo) { + this.courseChapterVideoMapper.updateByPrimaryKeySelective(courseChapterVideo); + return this.queryById(courseChapterVideo.getVideoId()); + } + + /** + * 通过主键删除数据 + * + * @param videoId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer videoId) { + return this.courseChapterVideoMapper.deleteByPrimaryKey(videoId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.courseChapterVideoMapper::selectAll); + } + + + /** + * 通过courseId查询单条数据 + * + * @param courseId 课程ID + * @return 实例对象 + */ + @Override + public List queryByCourseId(Integer courseId){ + return courseChapterVideoMapper.selectVideoByCourseId(courseId); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseServiceImpl.java new file mode 100644 index 0000000..595abf9 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseServiceImpl.java @@ -0,0 +1,233 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.dto.CourseVideoDto; +import com.hc.business.dto.UserCourseDto; +import com.hc.business.mapper.CourseChapterVideoMapper; +import com.hc.business.mapper.CourseMapper; +import com.hc.business.mapper.UserCourseMapper; +import com.hc.business.model.*; +import com.hc.business.service.CourseChapterService; +import com.hc.business.service.CourseService; +import com.hc.business.service.UserVideoPositionService; +import com.hc.core.utils.status.CodeFlagEnum; +import com.hc.core.utils.tool.Compute; +import org.springframework.stereotype.Service; +import org.springframework.beans.BeanUtils; + +import java.util.*; + +/** + * 课程表(Course)表服务实现类 + * + * @author java + * @since 2020-11-09 10:04:46 + */ + +@Service("courseService") +public class CourseServiceImpl implements CourseService { + + private final CourseChapterService courseChapterService; + + private final CourseChapterVideoMapper courseChapterVideoMapper; + + private final UserVideoPositionService userVideoPositionService; + + private final CourseMapper courseMapper; + + private final UserCourseMapper userCourseMapper; + + public CourseServiceImpl(CourseMapper courseMapper, + UserCourseMapper userCourseMapper, + CourseChapterVideoMapper courseChapterVideoMapper, + UserVideoPositionService userVideoPositionService, + CourseChapterService courseChapterService) { + this.courseMapper = courseMapper; + this.userCourseMapper = userCourseMapper; + this.courseChapterVideoMapper = courseChapterVideoMapper; + this.userVideoPositionService = userVideoPositionService; + this.courseChapterService = courseChapterService; + } + + /** + * 通过ID查询单条数据 + * + * @param courseId 主键 + * @return 实例对象 + */ + @Override + public Course queryById(Integer courseId) { + return this.courseMapper.selectByPrimaryKey(courseId); + } + + /** + * 新增数据 + * + * @param course 实例对象 + * @return 实例对象 + */ + @Override + public Course insert(Course course) { + course.setIsValid(CodeFlagEnum.OBJECT_ENABLE_CODE.getCode()); + this.courseMapper.insert(course); + return course; + } + + /** + * 修改数据 + * + * @param course 实例对象 + * @return 实例对象 + */ + @Override + public Course update(Course course) { + this.courseMapper.updateByPrimaryKeySelective(course); + return this.queryById(course.getCourseId()); + } + + /** + * 通过主键删除数据 + * + * @param courseId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer courseId) { +// return this.courseMapper.deleteByPrimaryKey(courseId) > 0; + Course course = queryById(courseId); + if (!Objects.isNull(course)) { + course.setIsValid(CodeFlagEnum.OBJECT_DISABLED_CODE.getCode()); + this.courseMapper.updateByPrimaryKeySelective(course); + return true; + } + return false; + } + + @Override + public List queryTeacherName(String name) { + return this.courseMapper.queryTeacherName(name); + } + + @Override + public List queryCourseName(String name) { + return this.courseMapper.queryCourseName(name); + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size, Integer valid) { + PageHelper.startPage(page, size); + List courses = this.courseMapper.queryAll(valid); + return new PageInfo(courses); + } + + @Override + public PageInfo queryAllByLimitAndTypeId(int page, int size, Integer typeId) { + PageHelper.startPage(page, size); + List courses = this.courseMapper.queryByTypeId(typeId); + return new PageInfo(courses); + } + + + @Override + public List getAllVideos(Integer courseId){ + return courseChapterVideoMapper.selectVideoByCourseId(courseId); + } + + //重写课程,缓存以及计算用户总体进度的方法和结构, + //继续教育不区分章节,但是支持多个视频 + @Override + public List getCourseChapterAndVideoPosition(Integer courseId, Integer userId, Integer classId) { + + boolean update = false; + List videoListDto = new ArrayList(); + + List videoList = courseChapterVideoMapper.selectVideoByCourseId(courseId); + + Double totalPercent = Double.valueOf("0"); + if (videoList.size() > 0) { + + for (int vindex = 0; vindex < videoList.size(); vindex++) { + + CourseVideoDto dto = new CourseVideoDto(); + dto.setVideo(videoList.get(vindex)); + + Map map = userVideoPositionService.findVideoPosition(userId, videoList.get(vindex).getVideoId(), courseId, classId); + // 填入播放记录 + if ((null != map) && (map.size() > 0)) { + UserVideoPosition userVideoPosition = new UserVideoPosition(); + Double videotime = null; + Double position = null; + if (map.containsKey("update")) { + update = true; + } + try { + videotime = Double.valueOf(map.get("videotime")); + position = Double.valueOf(map.get("position")); + + } catch (Exception e) { + //视频位置,长度有问题,处理吓一条 + //视频进度有问题,不能直接跳过。否则对于 已经缓存了但是没有正确位置信息的视频就会漏掉 + //这类数据按照位置0处理 + userVideoPosition.setVideoTime("0"); + userVideoPosition.setVideoPosition("0"); + userVideoPosition.setVideoId(videoList.get(0).getVideoId()); + userVideoPosition.setUserId(userId); + //没有正确数据的视频,进度按照0计算,返回结构体 + //totalPercent = Compute.add(totalPercent, Compute.div(position, videotime, 2)); + dto.setPosition(userVideoPosition); + + //解析得视频进度数据不正确,但是依然要返回一个空得结构体。否则会造成丢掉数据有问题得视频 + videoListDto.add(dto); + continue; + } + + userVideoPosition.setVideoTime(map.get("videotime")); + userVideoPosition.setVideoPosition(map.get("position")); + userVideoPosition.setVideoId(videoList.get(0).getVideoId()); + userVideoPosition.setUserId(userId); + totalPercent = Compute.add(totalPercent, Compute.div(position, videotime, 2)); + dto.setPosition(userVideoPosition); + } + + videoListDto.add(dto); + } + + + //计算平均进度 + //计算平均进度 + totalPercent = Compute.div(totalPercent, videoList.size(), 2); + if (true == update) { + //如果章节进度有更新,需要从新计算课程总体进度,并更新到数据库 + //TODO 查询课程进度 + List cardCourseList = userCourseMapper.selectUserCourseProgress(userId, classId, courseId); + if (cardCourseList.size() > 0) { + //课程进度有变化时 将查询的课程进度写入数据库 + if (!totalPercent.equals(cardCourseList.get(0).getCoursePercent())) { + UserCourse userCourse = new UserCourse(); + BeanUtils.copyProperties(cardCourseList.get(0), userCourse); + userCourse.setCoursePercent(totalPercent); + userCourseMapper.updateByPrimaryKeySelective(userCourse); + } + } else { + //如果没有课程得记录,则增加记录 + UserCourse userCourse = new UserCourse(); + userCourse.setCoursePercent(totalPercent); + userCourse.setCourseId(courseId); + userCourse.setUserId(userId); + userCourse.setClassId(classId); + userCourseMapper.insert(userCourse); + } + + } + } + return videoListDto; + } +} diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseTypeRelationServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseTypeRelationServiceImpl.java new file mode 100644 index 0000000..682e832 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseTypeRelationServiceImpl.java @@ -0,0 +1,84 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.CourseTypeRelationMapper; +import com.hc.business.model.CourseTypeRelation; +import com.hc.business.service.CourseTypeRelationService; +import org.springframework.stereotype.Service; + +/** + * (CourseTypeRelation)表服务实现类 + * + * @author java + * @since 2021-02-02 09:25:11 + */ + +@Service("courseTypeRelationService") +public class CourseTypeRelationServiceImpl implements CourseTypeRelationService { + + private final CourseTypeRelationMapper courseTypeRelationMapper; + + public CourseTypeRelationServiceImpl(CourseTypeRelationMapper courseTypeRelationMapper) { + this.courseTypeRelationMapper = courseTypeRelationMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param courseTypeReId 主键 + * @return 实例对象 + */ + @Override + public CourseTypeRelation queryById(Integer courseTypeReId) { + return this.courseTypeRelationMapper.selectByPrimaryKey(courseTypeReId); + } + + /** + * 新增数据 + * + * @param courseTypeRelation 实例对象 + * @return 实例对象 + */ + @Override + public CourseTypeRelation insert(CourseTypeRelation courseTypeRelation) { + courseTypeRelation.setCreateTime(System.currentTimeMillis()); + this.courseTypeRelationMapper.insert(courseTypeRelation); + return courseTypeRelation; + } + + /** + * 修改数据 + * + * @param courseTypeRelation 实例对象 + * @return 实例对象 + */ + @Override + public CourseTypeRelation update(CourseTypeRelation courseTypeRelation) { + this.courseTypeRelationMapper.updateByPrimaryKeySelective(courseTypeRelation); + return this.queryById(courseTypeRelation.getCourseTypeReId()); + } + + /** + * 通过主键删除数据 + * + * @param courseTypeReId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer courseTypeReId) { + return this.courseTypeRelationMapper.deleteByPrimaryKey(courseTypeReId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.courseTypeRelationMapper::selectAll); + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseTypeServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseTypeServiceImpl.java new file mode 100644 index 0000000..38df346 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/CourseTypeServiceImpl.java @@ -0,0 +1,91 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.CourseTypeMapper; +import com.hc.business.model.CourseType; +import com.hc.business.service.CourseTypeService; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * (CourseType)表服务实现类 + * + * @author java + * @since 2020-12-17 14:12:54 + */ + +@Service("courseTypeService") +public class CourseTypeServiceImpl implements CourseTypeService { + + private final CourseTypeMapper courseTypeMapper; + + public CourseTypeServiceImpl(CourseTypeMapper courseTypeMapper) { + this.courseTypeMapper = courseTypeMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param courseTypeId 主键 + * @return 实例对象 + */ + @Override + public CourseType queryById(Integer courseTypeId) { + return this.courseTypeMapper.selectByPrimaryKey(courseTypeId); + } + + /** + * 新增数据 + * + * @param courseType 实例对象 + * @return 实例对象 + */ + @Override + public CourseType insert(CourseType courseType) { + List courseTypes + = this.courseTypeMapper.queryAllByCourseName(courseType.getCourseName()); + if (!CollectionUtils.isEmpty(courseTypes)) { + return courseTypes.get(0); + } + this.courseTypeMapper.insert(courseType); + return courseType; + } + + /** + * 修改数据 + * + * @param courseType 实例对象 + * @return 实例对象 + */ + @Override + public CourseType update(CourseType courseType) { + this.courseTypeMapper.updateByPrimaryKeySelective(courseType); + return this.queryById(courseType.getCourseTypeId()); + } + + /** + * 通过主键删除数据 + * + * @param courseTypeId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer courseTypeId) { + return this.courseTypeMapper.deleteByPrimaryKey(courseTypeId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.courseTypeMapper::selectAll); + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/NewsServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/NewsServiceImpl.java new file mode 100644 index 0000000..8654677 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/NewsServiceImpl.java @@ -0,0 +1,94 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.NewsMapper; +import com.hc.business.model.News; +import com.hc.business.service.NewsService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 新闻表 + * (News)表服务实现类 + * + * @author java + * @since 2020-11-20 11:48:38 + */ + +@Service("newsService") +public class NewsServiceImpl implements NewsService { + + private final NewsMapper newsMapper; + + public NewsServiceImpl(NewsMapper newsMapper) { + this.newsMapper = newsMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param newsId 主键 + * @return 实例对象 + */ + @Override + public News queryById(Integer newsId) { + return this.newsMapper.selectByPrimaryKey(newsId); + } + + /** + * 新增数据 + * + * @param news 实例对象 + * @return 实例对象 + */ + @Override + public News insert(News news) { + news.setCreateTime(System.currentTimeMillis()); + this.newsMapper.insert(news); + return news; + } + + /** + * 修改数据 + * + * @param news 实例对象 + * @return 实例对象 + */ + @Override + public News update(News news) { + this.newsMapper.updateByPrimaryKeySelective(news); + return this.queryById(news.getNewsId()); + } + + /** + * 通过主键删除数据 + * + * @param newsId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer newsId) { + return this.newsMapper.deleteByPrimaryKey(newsId) > 0; + } + + @Override + public PageInfo queryListByTagId(Integer tagId, int page, int size) { + PageHelper.startPage(page, size); + List news = this.newsMapper.queryByTagId(tagId); + return new PageInfo(news); + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.newsMapper::selectAll); + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/NewsTagServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/NewsTagServiceImpl.java new file mode 100644 index 0000000..e58e357 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/NewsTagServiceImpl.java @@ -0,0 +1,79 @@ +package com.hc.business.service.impl; + +import com.hc.business.mapper.NewsTagMapper; +import com.hc.business.model.NewsTag; +import com.hc.business.service.NewsTagService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 新闻标签表(NewsTag)表服务实现类 + * + * @author java + * @since 2020-11-20 12:52:33 + */ + +@Service("newsTagService") +public class NewsTagServiceImpl implements NewsTagService { + + private final NewsTagMapper newsTagMapper; + + public NewsTagServiceImpl(NewsTagMapper newsTagMapper) { + this.newsTagMapper = newsTagMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param tagId 主键 + * @return 实例对象 + */ + @Override + public NewsTag queryById(Integer tagId) { + return this.newsTagMapper.selectByPrimaryKey(tagId); + } + + /** + * 新增数据 + * + * @param newsTag 实例对象 + * @return 实例对象 + */ + @Override + public NewsTag insert(NewsTag newsTag) { + this.newsTagMapper.insert(newsTag); + return newsTag; + } + + /** + * 修改数据 + * + * @param newsTag 实例对象 + * @return 实例对象 + */ + @Override + public NewsTag update(NewsTag newsTag) { + this.newsTagMapper.updateByPrimaryKeySelective(newsTag); + return newsTag; + } + + /** + * 通过主键删除数据 + * + * @param tagId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer tagId) { + return this.newsTagMapper.deleteByPrimaryKey(tagId) > 0; + } + + @Override + public List queryAll() { + return this.newsTagMapper.queryAll(); + } + + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/OrderUserLogServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/OrderUserLogServiceImpl.java new file mode 100644 index 0000000..490dfaa --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/OrderUserLogServiceImpl.java @@ -0,0 +1,100 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.OrderUserLogMapper; +import com.hc.business.model.OrderUserLog; +import com.hc.business.service.OrderUserLogService; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * (OrderUserLog)表服务实现类 + * + * @author java + * @since 2020-12-03 09:25:11 + */ + +@Service("orderUserLogService") +public class OrderUserLogServiceImpl implements OrderUserLogService { + + private final OrderUserLogMapper orderUserLogMapper; + + public OrderUserLogServiceImpl(OrderUserLogMapper orderUserLogMapper) { + this.orderUserLogMapper = orderUserLogMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param orderLogId 主键 + * @return 实例对象 + */ + @Override + public OrderUserLog queryById(Integer orderLogId) { + return this.orderUserLogMapper.selectByPrimaryKey(orderLogId); + } + + /** + * 新增数据 + * + * @param orderUserLog 实例对象 + * @return 实例对象 + */ + @Override + public OrderUserLog insert(OrderUserLog orderUserLog) { + Integer orderId = orderUserLog.getOrderId(); + Integer reUserId = orderUserLog.getReUserId(); + List orderUserLogs + = this.orderUserLogMapper.queryByUserIdAndOrderId(orderId, reUserId); + if (!CollectionUtils.isEmpty(orderUserLogs)) { +// throw new ResponseException(InfoEnum.LOGIN_REGISTER_RE); + return orderUserLogs.get(0); + } + orderUserLog.setCreateTime(System.currentTimeMillis()); + this.orderUserLogMapper.insert(orderUserLog); + return orderUserLog; + } + + @Override + public List queryListByOrderId(Integer orderId) { + return orderUserLogMapper.queryByOrderId(orderId); + } + + /** + * 修改数据 + * + * @param orderUserLog 实例对象 + * @return 实例对象 + */ + @Override + public OrderUserLog update(OrderUserLog orderUserLog) { + this.orderUserLogMapper.updateByPrimaryKeySelective(orderUserLog); + return this.queryById(orderUserLog.getOrderLogId()); + } + + /** + * 通过主键删除数据 + * + * @param orderLogId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer orderLogId) { + return this.orderUserLogMapper.deleteByPrimaryKey(orderLogId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.orderUserLogMapper::selectAll); + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/OrdersServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/OrdersServiceImpl.java new file mode 100644 index 0000000..fbfd894 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/OrdersServiceImpl.java @@ -0,0 +1,184 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.dto.UserPriceTotal; +import com.hc.business.mapper.OrdersMapper; +import com.hc.business.model.Orders; +import com.hc.business.service.OrdersService; +import com.hc.core.utils.enums.InfoEnum; +import com.hc.core.utils.exception.ResponseException; +import com.hc.core.utils.status.CodeFlagEnum; +import com.hc.core.utils.status.OrdersFlagEnum; +import org.apache.commons.lang3.RandomStringUtils; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** + * 订单表(Orders)表服务实现类 + * + * @author java + * @since 2020-11-26 16:46:46 + */ + +@Service("ordersService") +public class OrdersServiceImpl implements OrdersService { + + private final OrdersMapper ordersMapper; + + public OrdersServiceImpl(OrdersMapper ordersMapper) { + this.ordersMapper = ordersMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param ordersId 主键 + * @return 实例对象 + */ + @Override + public Orders queryById(Integer ordersId) { + return this.ordersMapper.selectByPrimaryKey(ordersId); + } + + /** + * 新增数据 + * + * @param orders 实例对象 + * @return 实例对象 + */ + @Override + public Orders insert(Orders orders) { + String orderNo = orders.getOrderNo().trim(); + Orders orders1 = this.ordersMapper.queryByOrderNo(orderNo); + if (!Objects.isNull(orders1)) { + throw new ResponseException(InfoEnum.ORDER_ERROR); + } + orders.setCreateTime(System.currentTimeMillis()); + orders.setOrderStatus(OrdersFlagEnum.ORDERS_FLAG_UNPAID.getCode()); + orders.setIsDe(CodeFlagEnum.OBJECT_ENABLE_CODE.getCode()); + this.ordersMapper.insert(orders); + return orders; + } + + /** + * 创建订单编号 + * + * @return 实例对象 + */ + @Override + public String createOrderNo() { + String mills = String.valueOf(System.currentTimeMillis()); + String random = RandomStringUtils.randomNumeric(4); + String s = mills + random; + return s; + } + + /** + * 修改数据 + * + * @param orders 实例对象 + * @return 实例对象 + */ + @Override + public Orders update(Orders orders) { + this.ordersMapper.updateByPrimaryKeySelective(orders); + return this.queryById(orders.getOrdersId()); + } + + /** + * 通过主键删除数据 + * + * @param ordersId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer ordersId) { +// return this.ordersMapper.deleteByPrimaryKey(ordersId) > 0; + Orders orders = this.ordersMapper.selectByPrimaryKey(ordersId); + if (Objects.isNull(orders)) { + return false; + } + orders.setIsDe(CodeFlagEnum.OBJECT_DISABLED_CODE.getCode()); + return this.ordersMapper.updateByPrimaryKey(orders) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.ordersMapper::selectAll); + } + + + @Override + public PageInfo queryAllWithOrderInvoices(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.ordersMapper::queryAllWithInvoices); + } + + @Override + public PageInfo queryAllByUserId(int page, int size, Integer userId) { + PageHelper.startPage(page, size); + List orders = this.ordersMapper.queryAllByUserId(userId); + return new PageInfo(orders); + } + + @Override + public PageInfo queryAllByClassId(int page, int size, Integer classId) { + PageHelper.startPage(page, size); + List orders = this.ordersMapper.queryAllByClassId(classId); + return new PageInfo(orders); + } + + @Override + public PageInfo queryAllByClassName(int page, int size, String className) { + PageHelper.startPage(page, size); + List orders = this.ordersMapper.queryAllByClassName(className); + return new PageInfo(orders); + } + + @Override + public PageInfo queryAllByStatus(int page, int size, Integer status) { + PageHelper.startPage(page, size); + List orders = this.ordersMapper.queryAllByStatus(status); + return new PageInfo<>(orders); + } + + @Override + public List queryByUserInvoicesId(Integer userInvoicesId) { + return this.ordersMapper.queryByUserInvoicesId(userInvoicesId); + } + + @Override + public UserPriceTotal queryUserCount() { + UserPriceTotal userPriceTotal = new UserPriceTotal(); + userPriceTotal.setTotalUserCount(this.ordersMapper.countPrice()); + userPriceTotal.setTodayUserCount(this.ordersMapper.queryToday()); + userPriceTotal.setMonthUserCount(this.ordersMapper.queryMonth()); + userPriceTotal.setYearUserCount(this.ordersMapper.queryYear()); + return userPriceTotal; + } + + @Override + public List queryByOrderNo(String orderNo) { + List ordersList = new ArrayList<>(); + Orders orders = this.ordersMapper.queryByOrderNo(orderNo); + if (Objects.isNull(orders)) { + return Collections.emptyList(); + } + ordersList.add(orders); + return ordersList; + } + + @Override + public Integer countOrderTotal() { + return this.ordersMapper.countOrderTotal(); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/PaperQuestionServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/PaperQuestionServiceImpl.java new file mode 100644 index 0000000..5c5e1ed --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/PaperQuestionServiceImpl.java @@ -0,0 +1,90 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.PaperQuestionMapper; +import com.hc.business.model.PaperQuestion; +import com.hc.business.service.PaperQuestionService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 随机试卷问题表(PaperQuestion)表服务实现类 + * + * @author java + * @since 2020-12-07 11:35:14 + */ + +@Service("paperQuestionService") +public class PaperQuestionServiceImpl implements PaperQuestionService { + + private final PaperQuestionMapper paperQuestionMapper; + + public PaperQuestionServiceImpl(PaperQuestionMapper paperQuestionMapper) { + this.paperQuestionMapper = paperQuestionMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param paperRuleId 主键 + * @return 实例对象 + */ + @Override + public PaperQuestion queryById(Integer paperRuleId) { + return this.paperQuestionMapper.selectByPrimaryKey(paperRuleId); + } + + /** + * 新增数据 + * + * @param paperQuestion 实例对象 + * @return 实例对象 + */ + @Override + public PaperQuestion insert(PaperQuestion paperQuestion) { + this.paperQuestionMapper.insert(paperQuestion); + return paperQuestion; + } + + /** + * 修改数据 + * + * @param paperQuestion 实例对象 + * @return 实例对象 + */ + @Override + public PaperQuestion update(PaperQuestion paperQuestion) { + this.paperQuestionMapper.updateByPrimaryKeySelective(paperQuestion); + return this.queryById(paperQuestion.getPaperRuleId()); + } + + /** + * 通过主键删除数据 + * + * @param paperRuleId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer paperRuleId) { + return this.paperQuestionMapper.deleteByPrimaryKey(paperRuleId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.paperQuestionMapper::selectAll); + } + + @Override + public List queryByPaperId(Integer paperId) { + return this.paperQuestionMapper.queryByPaperId(paperId); + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/PaperServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/PaperServiceImpl.java new file mode 100644 index 0000000..a15c499 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/PaperServiceImpl.java @@ -0,0 +1,263 @@ +package com.hc.business.service.impl; + +import com.alibaba.fastjson.JSON; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.dto.PaperAnswer; +import com.hc.business.dto.PaperCommitDTO; +import com.hc.business.dto.PaperResultDto; +import com.hc.business.dto.QuestionTypeDto; +import com.hc.business.mapper.*; +import com.hc.business.model.*; +import com.hc.business.service.PaperService; +import com.hc.core.utils.enums.InfoEnum; +import com.hc.core.utils.exception.ResponseException; +import com.hc.core.utils.result.Result; +import com.hc.core.utils.tool.Verification; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Random; + +/** + * 试卷表(Paper)表服务实现类 + * + * @author java + * @since 2020-12-07 11:34:36 + */ + +@Service("paperService") +public class PaperServiceImpl implements PaperService { + + private final PaperMapper paperMapper; + + private final QuestionMapper questionMapper; + + private final PaperQuestionMapper paperQuestionMapper; + + private final QuestionTypeMapper questionTypeMapper; + + private final QuestionAnswerMapper questionAnswerMapper; + + private final UserTestHistoryMapper userTestHistoryMapper; + + private final UserMapper userMapper; + + public PaperServiceImpl(PaperMapper paperMapper, + QuestionMapper questionMapper, + PaperQuestionMapper paperQuestionMapper, + QuestionTypeMapper questionTypeMapper, + QuestionAnswerMapper questionAnswerMapper, + UserTestHistoryMapper userTestHistoryMapper, + UserMapper userMapper) { + this.paperMapper = paperMapper; + this.questionMapper = questionMapper; + this.paperQuestionMapper = paperQuestionMapper; + this.questionTypeMapper = questionTypeMapper; + this.questionAnswerMapper = questionAnswerMapper; + this.userTestHistoryMapper = userTestHistoryMapper; + this.userMapper = userMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param paperId 主键 + * @return 实例对象 + */ + @Override + public Paper queryById(Integer paperId) { + return this.paperMapper.selectByPrimaryKey(paperId); + } + + /** + * 新增数据 + * + * @param paper 实例对象 + * @return 实例对象 + */ + @Override + public Paper insert(Paper paper) { + this.paperMapper.insert(paper); + return paper; + } + + /** + * 修改数据 + * + * @param paper 实例对象 + * @return 实例对象 + */ + @Override + public Paper update(Paper paper) { + this.paperMapper.updateByPrimaryKeySelective(paper); + return this.queryById(paper.getPaperId()); + } + + /** + * 通过主键删除数据 + * + * @param paperId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer paperId) { + return this.paperMapper.deleteByPrimaryKey(paperId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.paperMapper::selectAll); + } + + @Override + public PaperResultDto queryQuestionList(Integer paperId) { + + List questionTypeDtoList = new ArrayList<>(); + PaperResultDto paperResultDto = new PaperResultDto(); + + Paper paper = paperMapper.selectByPrimaryKey(paperId); + //可加入试卷状态判断 + if (Objects.isNull(paper)) { + throw new ResponseException(InfoEnum.PAPER_ERROR); + } + + //查询抽题规则 + List paperQuestions = paperQuestionMapper.queryByPaperId(paperId); + + + for (PaperQuestion paperQuestion : paperQuestions) { + + QuestionTypeDto questionTypeDto = new QuestionTypeDto(); + + Integer questionType = paperQuestion.getQuestionType(); + + Integer questionLevel = paperQuestion.getQuestionLevel(); + + Integer questionTagId = paperQuestion.getQuestionTagId(); + + QuestionType questionType1 + = questionTypeMapper.selectByPrimaryKey(questionType); + + List questionList1 + = questionMapper.queryByTagId(questionType, questionLevel, questionTagId); + + if (Objects.isNull(questionType1)) { + throw new ResponseException(-1, "数据库无此类型习题,请联系管理员"); + } + + List idList = new ArrayList<>(); + if (questionList1.size() == paperQuestion.getQuestionNum() || questionList1.size() < paperQuestion.getQuestionNum()) { + idList = questionList1; + } else { + //循环随机需要的题目 直到达到需要的数目 + for (int i = 0; i < paperQuestion.getQuestionNum(); i++) { + Integer randomId; + do { + //随机一个id + randomId = questionList1.get(new Random().nextInt(questionList1.size() - 1)); + } while (idList.contains(randomId)); + idList.add(randomId); + } + } + + questionTypeDto.setQuestionList(idList); + questionTypeDto.setTypeName(questionType1.getTypeName()); + questionTypeDtoList.add(questionTypeDto); + + } + + paperResultDto.setPaper(paper); + paperResultDto.setQuestionTypeDtoList(questionTypeDtoList); + return paperResultDto; + } + + @Override + public Result paperCommit(PaperCommitDTO commitDTO) { + +// Integer userId = commitDTO.getUserId(); + +// int i = userTestHistoryMapper.queryCountByParam(userId); + +// if (i > 2) { +// throw new ResponseException(-1,"您已有三次考试记录,当前批次暂无机会继续考试"); +// } + + Integer amountScore = this.calculateScore(commitDTO.getAnswerList()); + + User user = userMapper.selectByPrimaryKey(commitDTO.getUserId()); + if (user == null) { + throw new ResponseException(InfoEnum.LOGIN_USER_NAME_ERROR); + } + + //进行试卷提交后的相关操作 考试记录的信息 + Paper paper = paperMapper.selectByPrimaryKey(commitDTO.getPaperId()); + if (Objects.isNull(paper)) { + throw new ResponseException(InfoEnum.PAPER_ERROR); + } + + UserTestHistory testHistory = new UserTestHistory(); + + testHistory.setCreateTime(System.currentTimeMillis()); + testHistory.setPaperId(commitDTO.getPaperId()); + testHistory.setClassId(commitDTO.getClassId()); + testHistory.setTestTime(commitDTO.getTestTime()); + testHistory.setUserId(commitDTO.getUserId()); + testHistory.setTotalScore(paper.getPaperScore()); + testHistory.setScore(amountScore); + + String answer = JSON.toJSONString(commitDTO.getAnswerList()); + testHistory.setAnswer(answer); + userTestHistoryMapper.insert(testHistory); + + return Result.success(testHistory); + } + + + private Integer calculateScore(List answerList) { + + Integer AMOUNT_SCORE = 0; + + for (PaperAnswer answer : answerList) { + //前台传过来的问题id + Integer questionId = answer.getQuestionId(); + //前台传过来的问题答案 + List paperAnswerId = answer.getAnswerId(); + //依据问题id查出正确答案 然后和前端传过来的答案对比 + List answerId = + questionAnswerMapper.selectAnswerIdListByQuestionId(questionId); + if (CollectionUtils.isEmpty(answerId)) { + throw new ResponseException(-1, "此题未配置答案,请联系管理员"); + } + //获取对应问题的题库的信息 + Question question = questionMapper.selectByPrimaryKey(questionId); + if (Objects.isNull(question.getQuestionScore())) { + throw new ResponseException(-1, "数据库习题未配置分数,请联系管理员"); + } + + //判断前端提交答案是否与题库答案相等 + //多选题长度不同,答案肯定不对 + if(true == Verification.equalList(paperAnswerId,answerId)){ + //累计成绩 + AMOUNT_SCORE += question.getQuestionScore(); + } + + // if (paperAnswerId.equals(answerId)) { +// //累计成绩 +// AMOUNT_SCORE += question.getQuestionScore(); +// } + } + return AMOUNT_SCORE; + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/QuestionAnswerServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/QuestionAnswerServiceImpl.java new file mode 100644 index 0000000..621af5e --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/QuestionAnswerServiceImpl.java @@ -0,0 +1,83 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.QuestionAnswerMapper; +import com.hc.business.model.QuestionAnswer; +import com.hc.business.service.QuestionAnswerService; +import org.springframework.stereotype.Service; + +/** + * 问题答案表(QuestionAnswer)表服务实现类 + * + * @author java + * @since 2020-12-07 11:36:22 + */ + +@Service("questionAnswerService") +public class QuestionAnswerServiceImpl implements QuestionAnswerService { + + private final QuestionAnswerMapper questionAnswerMapper; + + public QuestionAnswerServiceImpl(QuestionAnswerMapper questionAnswerMapper) { + this.questionAnswerMapper = questionAnswerMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param questionAnswerId 主键 + * @return 实例对象 + */ + @Override + public QuestionAnswer queryById(Integer questionAnswerId) { + return this.questionAnswerMapper.selectByPrimaryKey(questionAnswerId); + } + + /** + * 新增数据 + * + * @param questionAnswer 实例对象 + * @return 实例对象 + */ + @Override + public QuestionAnswer insert(QuestionAnswer questionAnswer) { + this.questionAnswerMapper.insert(questionAnswer); + return questionAnswer; + } + + /** + * 修改数据 + * + * @param questionAnswer 实例对象 + * @return 实例对象 + */ + @Override + public QuestionAnswer update(QuestionAnswer questionAnswer) { + this.questionAnswerMapper.updateByPrimaryKeySelective(questionAnswer); + return this.queryById(questionAnswer.getQuestionAnswerId()); + } + + /** + * 通过主键删除数据 + * + * @param questionAnswerId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer questionAnswerId) { + return this.questionAnswerMapper.deleteByPrimaryKey(questionAnswerId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.questionAnswerMapper::selectAll); + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/QuestionServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/QuestionServiceImpl.java new file mode 100644 index 0000000..aab5f40 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/QuestionServiceImpl.java @@ -0,0 +1,97 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.QuestionMapper; +import com.hc.business.model.Question; +import com.hc.business.service.QuestionService; +import org.springframework.stereotype.Service; + +/** + * 习题表(Question)表服务实现类 + * + * @author java + * @since 2020-12-07 11:35:57 + */ + +@Service("questionService") +public class QuestionServiceImpl implements QuestionService { + + private final QuestionMapper questionMapper; + + public QuestionServiceImpl(QuestionMapper questionMapper) { + this.questionMapper = questionMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param questionId 主键 + * @return 实例对象 + */ + @Override + public Question queryById(Integer questionId) { + return this.questionMapper.queryById(questionId); + } + + /** + * 新增数据 + * + * @param question 实例对象 + * @return 实例对象 + */ + @Override + public Question insert(Question question) { + this.questionMapper.insert(question); + return question; + } + + /** + * 修改数据 + * + * @param question 实例对象 + * @return 实例对象 + */ + @Override + public Question update(Question question) { + this.questionMapper.updateByPrimaryKeySelective(question); + return this.queryById(question.getQuestionId()); + } + + /** + * 通过主键删除数据 + * + * @param questionId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer questionId) { + return this.questionMapper.deleteByPrimaryKey(questionId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.questionMapper::queryQuestions); + } + + + /** + * 分页查询多条数据 + * + * @param tagId 题库id + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryByTagLimit(int tagId, int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(() -> questionMapper.queryTagId(tagId)); + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/QuestionTagServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/QuestionTagServiceImpl.java new file mode 100644 index 0000000..8b5fa62 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/QuestionTagServiceImpl.java @@ -0,0 +1,83 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.QuestionTagMapper; +import com.hc.business.model.QuestionTag; +import com.hc.business.service.QuestionTagService; +import org.springframework.stereotype.Service; + +/** + * 问题标签表(QuestionTag)表服务实现类 + * + * @author java + * @since 2020-12-07 11:36:42 + */ + +@Service("questionTagService") +public class QuestionTagServiceImpl implements QuestionTagService { + + private final QuestionTagMapper questionTagMapper; + + public QuestionTagServiceImpl(QuestionTagMapper questionTagMapper) { + this.questionTagMapper = questionTagMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param questionTagId 主键 + * @return 实例对象 + */ + @Override + public QuestionTag queryById(Integer questionTagId) { + return this.questionTagMapper.selectByPrimaryKey(questionTagId); + } + + /** + * 新增数据 + * + * @param questionTag 实例对象 + * @return 实例对象 + */ + @Override + public QuestionTag insert(QuestionTag questionTag) { + this.questionTagMapper.insert(questionTag); + return questionTag; + } + + /** + * 修改数据 + * + * @param questionTag 实例对象 + * @return 实例对象 + */ + @Override + public QuestionTag update(QuestionTag questionTag) { + this.questionTagMapper.updateByPrimaryKeySelective(questionTag); + return this.queryById(questionTag.getQuestionTagId()); + } + + /** + * 通过主键删除数据 + * + * @param questionTagId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer questionTagId) { + return this.questionTagMapper.deleteByPrimaryKey(questionTagId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.questionTagMapper::selectAll); + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/QuestionTypeServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/QuestionTypeServiceImpl.java new file mode 100644 index 0000000..26d42c6 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/QuestionTypeServiceImpl.java @@ -0,0 +1,83 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.QuestionTypeMapper; +import com.hc.business.model.QuestionType; +import com.hc.business.service.QuestionTypeService; +import org.springframework.stereotype.Service; + +/** + * 问题类型表(QuestionType)表服务实现类 + * + * @author java + * @since 2020-12-07 11:37:03 + */ + +@Service("questionTypeService") +public class QuestionTypeServiceImpl implements QuestionTypeService { + + private final QuestionTypeMapper questionTypeMapper; + + public QuestionTypeServiceImpl(QuestionTypeMapper questionTypeMapper) { + this.questionTypeMapper = questionTypeMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param typeId 主键 + * @return 实例对象 + */ + @Override + public QuestionType queryById(Integer typeId) { + return this.questionTypeMapper.selectByPrimaryKey(typeId); + } + + /** + * 新增数据 + * + * @param questionType 实例对象 + * @return 实例对象 + */ + @Override + public QuestionType insert(QuestionType questionType) { + this.questionTypeMapper.insert(questionType); + return questionType; + } + + /** + * 修改数据 + * + * @param questionType 实例对象 + * @return 实例对象 + */ + @Override + public QuestionType update(QuestionType questionType) { + this.questionTypeMapper.updateByPrimaryKeySelective(questionType); + return this.queryById(questionType.getTypeId()); + } + + /** + * 通过主键删除数据 + * + * @param typeId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer typeId) { + return this.questionTypeMapper.deleteByPrimaryKey(typeId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.questionTypeMapper::selectAll); + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/ThirdCourseServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/ThirdCourseServiceImpl.java new file mode 100644 index 0000000..b6ac621 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/ThirdCourseServiceImpl.java @@ -0,0 +1,163 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.dto.ThirdCourseBack; +import com.hc.business.dto.ThirdCourseDto; +import com.hc.business.mapper.CourseChapterVideoMapper; +import com.hc.business.mapper.CourseMapper; +import com.hc.business.mapper.ThirdCourseMapper; +import com.hc.business.mapper.ThirdMapper; +import com.hc.business.model.Course; +import com.hc.business.model.CourseChapterVideo; +import com.hc.business.model.Third; +import com.hc.business.model.ThirdCourse; +import com.hc.business.service.ThirdCourseService; +import com.hc.core.utils.enums.InfoEnum; +import com.hc.core.utils.exception.ResponseException; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * 第三方用户课程配置表(ThirdCourse)表服务实现类 + * + * @author java + * @since 2020-06-17 17:29:30 + */ + +@Service("thirdCourseService") +public class ThirdCourseServiceImpl implements ThirdCourseService { + + private final ThirdCourseMapper thirdCourseMapper; + + private final ThirdMapper thirdMapper; + + private final CourseChapterVideoMapper courseChapterVideoMapper; + + private final CourseMapper courseMapper ; + + public ThirdCourseServiceImpl(ThirdCourseMapper thirdCourseMapper, ThirdMapper thirdMapper, CourseChapterVideoMapper courseChapterVideoMapper, + CourseMapper courseMapper) { + this.thirdCourseMapper = thirdCourseMapper; + this.thirdMapper = thirdMapper; + this.courseChapterVideoMapper = courseChapterVideoMapper; + this.courseMapper = courseMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + @Override + public ThirdCourse queryById(Integer id) { + return this.thirdCourseMapper.selectByPrimaryKey(id); + } + + /** + * 新增数据 + * + * @param thirdCourse 实例对象 + * @return 实例对象 + */ + @Override + public ThirdCourse insert(ThirdCourse thirdCourse) { + this.thirdCourseMapper.insert(thirdCourse); + return thirdCourse; + } + + /** + * 修改数据 + * + * @param thirdCourse 实例对象 + * @return 实例对象 + */ + @Override + public ThirdCourse update(ThirdCourse thirdCourse) { + this.thirdCourseMapper.updateByPrimaryKeySelective(thirdCourse); + return this.queryById(thirdCourse.getId()); + } + + /** + * 通过主键删除数据 + * + * @param id 主键 + * @return 是否成功 + */ + @Override + public Boolean deleteById(Integer id) { + return this.thirdCourseMapper.deleteByPrimaryKey(id) > 0; + } + + /** + * 分页查询全部数据 + * + * @param page + * @param size + * @return 实例对象数组 + */ + @Override + public PageInfo queryPageAll(Integer page, Integer size) { + PageHelper.startPage(page, size); + List list = this.thirdCourseMapper.selectAll(); + return new PageInfo(list); + } + + @Override + public List queryThreadCourseDto(String token) { + //查询单位 + List thirds = thirdMapper.queryThirdByToken(token); + if (CollectionUtils.isEmpty(thirds)) { + throw new ResponseException(InfoEnum.TOKEN_ERROR); + } + Third third = thirds.get(0); + Integer thirdId = third.getThirdId(); + + List thirdCourseDtoList = new ArrayList<>(); + List courses = thirdCourseMapper.queryThreadCourse(thirdId); + if (CollectionUtils.isEmpty(courses)) { + return null; + } + courses.forEach(course -> { + ThirdCourseDto thirdCourseDto = new ThirdCourseDto(); + Integer courseId = course.getCourseId(); + List courseChapterVideos + = courseChapterVideoMapper.selectVideoByCourseId(courseId); + thirdCourseDto.setCourse(course); + thirdCourseDto.setCourseChapterVideoList(courseChapterVideos); + thirdCourseDtoList.add(thirdCourseDto); + }); + return thirdCourseDtoList; + } + + @Override + public List queryThirdCourseDtoById(Integer thirdId) { + + List list = thirdCourseMapper.selectAll(); + List backList = new ArrayList(); + for (ThirdCourse tc: + list) { + + ThirdCourseBack back = new ThirdCourseBack(); + Course course = courseMapper.selectByPrimaryKey(tc.getCourseId()); + if(null == course){ + continue; + } + + back.setThirdId(thirdId); + back.setId(tc.getId()); + back.setCourseId(tc.getCourseId()); + back.setCourseName(course.getCourseName()); + back.setCourseLogo(course.getCourseLogo()); + + backList.add(back); + + } + + return backList; + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/ThirdServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/ThirdServiceImpl.java new file mode 100644 index 0000000..42cfa3a --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/ThirdServiceImpl.java @@ -0,0 +1,88 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.ThirdMapper; +import com.hc.business.model.Third; +import com.hc.business.service.ThirdService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 第三方用户表(Third)表服务实现类 + * + * @author java + * @since 2020-06-17 17:29:30 + */ + +@Service("thirdService") +public class ThirdServiceImpl implements ThirdService { + + private final ThirdMapper thirdMapper; + + public ThirdServiceImpl(ThirdMapper thirdMapper) { + this.thirdMapper = thirdMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param thirdId 主键 + * @return 实例对象 + */ + @Override + public Third queryById(Integer thirdId) { + return this.thirdMapper.selectByPrimaryKey(thirdId); + } + + /** + * 新增数据 + * + * @param third 实例对象 + * @return 实例对象 + */ + @Override + public Third insert(Third third) { + this.thirdMapper.insert(third); + return third; + } + + /** + * 修改数据 + * + * @param third 实例对象 + * @return 实例对象 + */ + @Override + public Third update(Third third) { + this.thirdMapper.updateByPrimaryKeySelective(third); + return this.queryById(third.getThirdId()); + } + + /** + * 通过主键删除数据 + * + * @param thirdId 主键 + * @return 是否成功 + */ + @Override + public Boolean deleteById(Integer thirdId) { + return this.thirdMapper.deleteByPrimaryKey(thirdId) > 0; + } + + /** + * 分页查询全部数据 + * + * @param page + * @param size + * @return 实例对象数组 + */ + @Override + public PageInfo queryPageAll(Integer page, Integer size) { + PageHelper.startPage(page, size); + List list = this.thirdMapper.selectAll(); + return new PageInfo(list); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserAdminServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserAdminServiceImpl.java new file mode 100644 index 0000000..a063ca4 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserAdminServiceImpl.java @@ -0,0 +1,125 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.UserAdminMapper; +import com.hc.business.model.UserAdmin; +import com.hc.business.model.jwt.GenerateAuthToken; +import com.hc.business.model.login.AccessEntity; +import com.hc.business.model.login.AuthEntity; +import com.hc.business.service.UserAdminService; +import com.hc.core.utils.enums.InfoEnum; +import com.hc.core.utils.exception.ResponseException; +import com.hc.core.utils.tool.IdGenerator; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; +import java.util.Objects; + +/** + * 管理员表(UserAdmin)表服务实现类 + * + * @author java + * @since 2020-11-16 13:45:07 + */ + +@Service("userAdminService") +public class UserAdminServiceImpl implements UserAdminService { + + private final UserAdminMapper userAdminMapper; + + private final GenerateAuthToken generateAuthToken; + + public UserAdminServiceImpl(UserAdminMapper userAdminMapper, + GenerateAuthToken generateAuthToken) { + this.userAdminMapper = userAdminMapper; + this.generateAuthToken = generateAuthToken; + } + + /** + * 通过ID查询单条数据 + * + * @param userAdminId 主键 + * @return 实例对象 + */ + @Override + public UserAdmin queryById(Integer userAdminId) { + return this.userAdminMapper.selectByPrimaryKey(userAdminId); + } + + /** + * 新增数据 + * + * @param userAdmin 实例对象 + * @return 实例对象 + */ + @Override + public UserAdmin insert(UserAdmin userAdmin) { + userAdmin.setPermissionLevel(2); + userAdmin.setAdminPass(IdGenerator.passwordToHash((userAdmin.getAdminPass()))); + this.userAdminMapper.insert(userAdmin); + return userAdmin; + } + + /** + * 修改数据 + * + * @param userAdmin 实例对象 + * @return 实例对象 + */ + @Override + public UserAdmin update(UserAdmin userAdmin) { + String adminPass = userAdmin.getAdminPass(); + if (!Objects.isNull(adminPass)) { + userAdmin.setAdminPass(IdGenerator.passwordToHash(adminPass)); + } + this.userAdminMapper.updateByPrimaryKeySelective(userAdmin); + return this.queryById(userAdmin.getUserAdminId()); + } + + /** + * 通过主键删除数据 + * + * @param userAdminId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer userAdminId) { + return this.userAdminMapper.deleteByPrimaryKey(userAdminId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.userAdminMapper::selectAll); + } + + @Override + public AccessEntity userAdminLogin(AuthEntity authEntity) { + + String adminAccount = authEntity.getUserName().trim(); + //依据用户名查询管理员 + List userAdmins = userAdminMapper.selectUserAdmin(adminAccount); + if (CollectionUtils.isEmpty(userAdmins)) { + throw new ResponseException(InfoEnum.LOGIN_USER_NAME_ERROR); + } + UserAdmin userAdmin = userAdmins.get(0); + + //密码错误 + String password = IdGenerator.passwordToHash(authEntity.getPassword()); + if (!Objects.equals(password, userAdmin.getAdminPass())) { + throw new ResponseException(InfoEnum.LOGIN_PASSWORD_ERROR); + } + + //验证密码正确 生成token 存入redis并返回 + //登录成功 生成token + return generateAuthToken.generateToken(authEntity, null, userAdmin); + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserAdviseServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserAdviseServiceImpl.java new file mode 100644 index 0000000..fef3047 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserAdviseServiceImpl.java @@ -0,0 +1,108 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.UserAdviseMapper; +import com.hc.business.model.UserAdvise; +import com.hc.business.service.UserAdviseService; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Objects; + +/** + * 用户建议表 + * (UserAdvise)表服务实现类 + * + * @author java + * @since 2020-11-16 14:20:04 + */ + +@Service("userAdviseService") +public class UserAdviseServiceImpl implements UserAdviseService { + + private final UserAdviseMapper userAdviseMapper; + + public UserAdviseServiceImpl(UserAdviseMapper userAdviseMapper) { + this.userAdviseMapper = userAdviseMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param adviceId 主键 + * @return 实例对象 + */ + @Override + public UserAdvise queryById(Integer adviceId) { + return this.userAdviseMapper.selectByPrimaryKey(adviceId); + } + + /** + * 新增数据 + * + * @param userAdvise 实例对象 + * @return 实例对象 + */ + @Override + public UserAdvise insert(UserAdvise userAdvise) { + userAdvise.setCreateTime(System.currentTimeMillis()); + this.userAdviseMapper.insert(userAdvise); + return userAdvise; + } + + /** + * 修改数据 + * + * @param userAdvise 实例对象 + * @return 实例对象 + */ + @Override + public UserAdvise update(UserAdvise userAdvise) { + this.userAdviseMapper.updateByPrimaryKeySelective(userAdvise); + return this.queryById(userAdvise.getAdviceId()); + } + + /** + * 通过主键删除数据 + * + * @param adviceId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer adviceId) { + return this.userAdviseMapper.deleteByPrimaryKey(adviceId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(Integer adviceType, int page, int size) { + PageHelper.startPage(page, size); + if (Objects.isNull(adviceType)) { + List userAdvises = this.userAdviseMapper.queryAll(); + return new PageInfo<>(userAdvises); + } + List userAdvises = this.userAdviseMapper.queryAllByAdviceType(adviceType); + return new PageInfo<>(userAdvises); + } + + /** + * 依据用户获取建议 + * + * @param userId 用户id + * @return 实例对象数组 + */ + @Override + public PageInfo queryAllByUserId(Integer userId, int page, int size) { + PageHelper.startPage(page, size); + List userAdvises = this.userAdviseMapper.queryAllByUserId(userId); + return new PageInfo(userAdvises); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserCourseServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserCourseServiceImpl.java new file mode 100644 index 0000000..ce427d2 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserCourseServiceImpl.java @@ -0,0 +1,95 @@ +package com.hc.business.service.impl; + +import com.hc.business.dto.UserCourseDto; +import com.hc.business.mapper.UserCourseMapper; +import com.hc.business.model.UserCourse; +import com.hc.business.service.UserCourseService; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 用户课程表(UserCourse)表服务实现类 + * + * @author java + * @since 2020-11-09 10:05:19 + */ + +@Service("userCourseService") +public class UserCourseServiceImpl implements UserCourseService { + + private final UserCourseMapper userCourseMapper; + + public UserCourseServiceImpl(UserCourseMapper userCourseMapper) { + this.userCourseMapper = userCourseMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param userCourseId 主键 + * @return 实例对象 + */ + @Override + public UserCourse queryById(Integer userCourseId) { + return this.userCourseMapper.selectByPrimaryKey(userCourseId); + } + + /** + * 新增数据 + * + * @param userCourse 实例对象 + * @return 实例对象 + */ + @Override + public UserCourse insert(UserCourse userCourse) { + List userCourses = + this.userCourseMapper.selectUserCourse( + userCourse.getUserId(), + userCourse.getClassId(), + userCourse.getCourseId()); + if (!CollectionUtils.isEmpty(userCourses)) { + return userCourses.get(0); + } + this.userCourseMapper.insert(userCourse); + return userCourse; + } + + /** + * 修改数据 + * + * @param userCourse 实例对象 + * @return 实例对象 + */ + @Override + public UserCourse update(UserCourse userCourse) { + this.userCourseMapper.updateByPrimaryKeySelective(userCourse); + return this.queryById(userCourse.getUserCourseId()); + } + + /** + * 通过主键删除数据 + * + * @param userCourseId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer userCourseId) { + return this.userCourseMapper.deleteByPrimaryKey(userCourseId) > 0; + } + + /** + * 分页查询多条数据,根据user_id查询该用户下所有的课程 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public List queryAllByLimit(Integer userId, Integer classId, int page, int size) { + // return PageHelper.startPage(page, size).doSelectPageInfo(this.userCourseMapper::selectAll); + return userCourseMapper.selectUserCourseList(userId, classId); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserInvoicesServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserInvoicesServiceImpl.java new file mode 100644 index 0000000..2759696 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserInvoicesServiceImpl.java @@ -0,0 +1,144 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.OrdersMapper; +import com.hc.business.mapper.UserInvoicesMapper; +import com.hc.business.model.Orders; +import com.hc.business.model.UserInvoices; +import com.hc.business.service.UserInvoicesService; +import com.hc.core.utils.status.CodeFlagEnum; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Objects; + +/** + * 用户发票表(UserInvoices)表服务实现类 + * + * @author java + * @since 2020-12-02 10:50:38 + */ + +@Service("userInvoicesService") +public class UserInvoicesServiceImpl implements UserInvoicesService { + + private final UserInvoicesMapper userInvoicesMapper; + + private final OrdersMapper ordersMapper; + + public UserInvoicesServiceImpl(UserInvoicesMapper userInvoicesMapper, + OrdersMapper ordersMapper) { + this.userInvoicesMapper = userInvoicesMapper; + this.ordersMapper = ordersMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param userInvoicesId 主键 + * @return 实例对象 + */ + @Override + public UserInvoices queryById(Integer userInvoicesId) { + return this.userInvoicesMapper.selectByPrimaryKey(userInvoicesId); + } + + /** + * 新增数据 + * + * @param userInvoices 实例对象 + * @return 实例对象 + */ + @Override + public UserInvoices insert(UserInvoices userInvoices) { + userInvoices.setStatus(CodeFlagEnum.OBJECT_ENABLE_CODE.getCode()); + userInvoices.setCreateTime(System.currentTimeMillis()); + userInvoicesMapper.insert(userInvoices); + userInvoices.getOrdersIdList().forEach(orderId -> { + Orders orders = ordersMapper.selectByPrimaryKey(orderId); + if (!Objects.isNull(orders)) { +// Integer orderStatus = orders.getOrderStatus(); +// if (OrdersFlagEnum.ORDERS_FLAG_PAID.getCode().equals(orderStatus)) { + if (orders.getUserInvoicesId() == null) { + orders.setUserInvoicesId(userInvoices.getUserInvoicesId()); + ordersMapper.updateByPrimaryKey(orders); +// userInvoices.setStatus(CodeFlagEnum.OBJECT_ENABLE_CODE.getCode()); +// update(userInvoices); +// } + } + } + }); + return userInvoices; + } + + /** + * 修改数据 + * + * @param userInvoices 实例对象 + * @return 实例对象 + */ + @Override + public UserInvoices update(UserInvoices userInvoices) { + this.userInvoicesMapper.updateByPrimaryKeySelective(userInvoices); + return this.queryById(userInvoices.getUserInvoicesId()); + } + + /** + * 通过主键删除数据 + * + * @param userInvoicesId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer userInvoicesId) { + return this.userInvoicesMapper.deleteByPrimaryKey(userInvoicesId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.userInvoicesMapper::queryAll); + } + + /** + * 依据用户id获取发票信息 + * + * @param userId 用户id + * @return 实例对象数组 + */ + @Override + public List queryDetailByUserId(Integer userId) { + return userInvoicesMapper.queryDetailByUserId(userId); + } + + /** + * 获取班次发票信息 + * + * @param classId 班次id + * @return 实例对象数组 + */ + @Override + public List queryByClassId(Integer classId) { + return userInvoicesMapper.queryByClassId(classId); + } + + /** + * 获取状态获取发票信息 + * + * @param status 状态 + * @return 实例对象数组 + */ + @Override + public List queryByStatus(Integer status) { + return userInvoicesMapper.queryByStatus(status); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserRefundHistoryServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserRefundHistoryServiceImpl.java new file mode 100644 index 0000000..da49314 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserRefundHistoryServiceImpl.java @@ -0,0 +1,93 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.UserRefundHistoryMapper; +import com.hc.business.model.UserRefundHistory; +import com.hc.business.service.UserRefundHistoryService; +import com.hc.core.utils.exception.ResponseException; +import org.springframework.stereotype.Service; + +import java.util.Objects; + +/** + * 用户退款记录表(UserRefundHistory)表服务实现类 + * + * @author java + * @since 2020-12-10 11:31:43 + */ + +@Service("userRefundHistoryService") +public class UserRefundHistoryServiceImpl implements UserRefundHistoryService { + + private final UserRefundHistoryMapper userRefundHistoryMapper; + + public UserRefundHistoryServiceImpl(UserRefundHistoryMapper userRefundHistoryMapper) { + this.userRefundHistoryMapper = userRefundHistoryMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + @Override + public UserRefundHistory queryById(Integer id) { + return this.userRefundHistoryMapper.selectByPrimaryKey(id); + } + + /** + * 新增数据 + * + * @param userRefundHistory 实例对象 + * @return 实例对象 + */ + @Override + public UserRefundHistory insert(UserRefundHistory userRefundHistory) { + String orderNo = userRefundHistory.getOrderNo(); + UserRefundHistory userRefundHistory1 + = this.userRefundHistoryMapper.queryByOrderNo(orderNo); + if (!Objects.isNull(userRefundHistory1)) { + throw new ResponseException(-1, "退款已提交请不要重复操作"); + } + userRefundHistory.setCreateTime(System.currentTimeMillis()); + this.userRefundHistoryMapper.insert(userRefundHistory); + return userRefundHistory; + } + + /** + * 修改数据 + * + * @param userRefundHistory 实例对象 + * @return 实例对象 + */ + @Override + public UserRefundHistory update(UserRefundHistory userRefundHistory) { + this.userRefundHistoryMapper.updateByPrimaryKeySelective(userRefundHistory); + return this.queryById(userRefundHistory.getId()); + } + + /** + * 通过主键删除数据 + * + * @param id 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer id) { + return this.userRefundHistoryMapper.deleteByPrimaryKey(id) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.userRefundHistoryMapper::selectAll); + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserServiceImpl.java new file mode 100644 index 0000000..1492c13 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserServiceImpl.java @@ -0,0 +1,297 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.dto.*; +import com.hc.business.mapper.UserMapper; +import com.hc.business.model.User; +import com.hc.business.model.jwt.GenerateAuthToken; +import com.hc.business.model.login.AccessEntity; +import com.hc.business.model.login.AuthEntity; +import com.hc.business.service.UserService; +import com.hc.core.utils.enums.InfoEnum; +import com.hc.core.utils.exception.ResponseException; +import com.hc.core.utils.msm.MessageService; +import com.hc.core.utils.tool.IdGenerator; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.Collections; +import java.util.List; +import java.util.Objects; + +/** + * 用户表(User)表服务实现类 + * + * @author java + * @since 2020-11-09 10:04:14 + */ + +@Service("userService") +public class UserServiceImpl implements UserService { + + private final UserMapper userMapper; + + private final MessageService messageService; + + private final GenerateAuthToken generateAuthToken; + + public UserServiceImpl(UserMapper userMapper, + MessageService messageService, + GenerateAuthToken generateAuthToken) { + this.userMapper = userMapper; + this.messageService = messageService; + this.generateAuthToken = generateAuthToken; + } + + /** + * 通过ID查询单条数据 + * + * @param userId 主键 + * @return 实例对象 + */ + @Override + public User queryById(Integer userId) { + return this.userMapper.selectByPrimaryKey(userId); + } + + /** + * 新增数据 + * + * @param user 实例对象 + * @return 实例对象 + */ + @Override + public User insert(User user) { + String userMobile = user.getUserMobile(); + List users = queryByMobile(userMobile); + if (!CollectionUtils.isEmpty(users)) { + return users.get(0); + } + user.setCreateTime(System.currentTimeMillis()); + user.setUserType(1); + String userPass = StringUtils.substring(userMobile, 5, 11); + user.setUserPassword(IdGenerator.passwordToHash(userPass)); + this.userMapper.insert(user); + return user; + } + + /** + * 修改数据 + * + * @param user 实例对象 + * @return 实例对象 + */ + @Override + public User update(User user) { + String userPassword = user.getUserPassword(); + if (!Objects.isNull(userPassword)) { + user.setUserPassword(IdGenerator.passwordToHash(userPassword)); + } + this.userMapper.updateByPrimaryKeySelective(user); + return this.queryById(user.getUserId()); + } + + /** + * 通过主键删除数据 + * + * @param userId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer userId) { + return this.userMapper.deleteByPrimaryKey(userId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.userMapper::selectAll); + } + + @Override + public AccessEntity userLogin(AuthEntity authEntity) { + String userMobile = authEntity.getUserName().trim(); + List users = queryByMobile(userMobile); + if (CollectionUtils.isEmpty(users)) { + throw new ResponseException(InfoEnum.LOGIN_USER_NAME_ERROR); + } + User user1 = users.get(0); + String userPassword = user1.getUserPassword(); + validatePass(authEntity, userPassword); + return generateAuthToken.generateToken(authEntity, user1, null); + } + + @Override + public AccessEntity userLoginSms(SmsLoginDto smsLoginDto) { + String sessionId = smsLoginDto.getSessionId(); + String code = smsLoginDto.getCode(); + //校验验证码 + validCode(sessionId, code); + //登录 + String userMobile = smsLoginDto.getUserMobile().trim(); + List users = queryByMobile(userMobile); + AuthEntity authEntity = new AuthEntity(); + authEntity.setUserName(userMobile); + authEntity.setPassword(StringUtils.substring(userMobile, 5, 11)); + if (!CollectionUtils.isEmpty(users)) { + return generateAuthToken.generateToken(authEntity, users.get(0), null); + } + User user = new User(); + user.setUserMobile(userMobile); + insert(user); + return generateAuthToken.generateToken(authEntity, user, null); + } + + /** + * 密码校验 + * + * @param authEntity 实例对象 + * @param userPass 实例对象 + */ + private void validatePass(AuthEntity authEntity, String userPass) { + String password = IdGenerator.passwordToHash(authEntity.getPassword()); + if (!Objects.equals(password, userPass)) { + throw new ResponseException(InfoEnum.LOGIN_PASSWORD_ERROR); + } + } + + @Override + public AccessEntity userRegister(RetrievePasswordDto retrievePasswordDto) { + String sessionId = retrievePasswordDto.getSessionId(); + String code = retrievePasswordDto.getCode(); + //校验验证码 + validCode(sessionId, code); + //查询重复用户 + String userMobile = retrievePasswordDto.getUserMobile().trim(); + String password = retrievePasswordDto.getPassword(); + String passwordToHash = IdGenerator.passwordToHash(password); + String userGender = retrievePasswordDto.getUserGender().trim(); + String userCompany = retrievePasswordDto.getUserCompany().trim(); + String userEmail = retrievePasswordDto.getUserEmail().trim(); + + //手机号注册 + List users = queryByMobile(userMobile); + if (!CollectionUtils.isEmpty(users)) { + throw new ResponseException(InfoEnum.LOGIN_REGISTER_RE); + } + //注册用户 + User user = User.builder() + .createTime(System.currentTimeMillis()) + .userMobile(userMobile) + .userPassword(passwordToHash) + .userName(retrievePasswordDto.getUserName()) + .userGender(userGender) + .userCompany(userCompany) + .userEmail(userEmail) + .userType(1) + .userLogo("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1605516088299&di=33e95d78e4ad99b4784665961f1af6e4&imgtype=0&src=http%3A%2F%2Fku.90sjimg.com%2Felement_origin_min_pic%2F01%2F48%2F88%2F16574444edb24ea.jpg") + .build(); + this.userMapper.insertSelective(user); + + AuthEntity authEntity = new AuthEntity(); + authEntity.setUserName(userMobile); + authEntity.setPassword(password); + return generateAuthToken.generateToken(authEntity, user, null); + } + + @Override + public String sendAuthCode(String phone) { + return messageService.sendValidShortMessage(phone); + } + + @Override + public User retrievePassword(RetrievePasswordDto retrievePasswordDto) { + String sessionId = retrievePasswordDto.getSessionId(); + String code = retrievePasswordDto.getCode(); + //校验验证码 + validCode(sessionId, code); + //修改密码 + String userMobile = retrievePasswordDto.getUserMobile().trim(); + List users = queryByMobile(userMobile); + assert users.size() != 0; + User user = users.get(0); + String password = retrievePasswordDto.getPassword().trim(); + user.setUserPassword(password); + return update(user); + } + + @Override + public List queryByMobile(String userMobile) { + return userMapper.queryUserByMobile(userMobile); + } + + @Override + public List queryUserByCard(String cardId) { + return userMapper.queryOneByCardId(cardId); + } + + @Override + public List queryUserByName(String name) { + return userMapper.queryUserByName(name); + } + + @Override + public List queryUserByClassName(String name, int pay) { + + if((null == name) || (name.isEmpty())){ + return null; + }else { + + if(1 == pay){ + //只搜已经支付得 + return this.userMapper.queryUserByClassNameAndPay(name); + + }else { + + //所有订单 + return this.userMapper.queryUserByClassName(name); + } + + } + } + + + + @Override + public UserTimeTotal queryUserCount() { + UserTimeTotal userTimeTotal = new UserTimeTotal(); + userTimeTotal.setTotalUserCount(this.userMapper.queryTotal()); + userTimeTotal.setTodayUserCount(checkNullInt(this.userMapper.queryToday())); + userTimeTotal.setMonthUserCount(checkNullInt(this.userMapper.queryMonth())); + userTimeTotal.setYearUserCount(checkNullInt(this.userMapper.queryYear())); + return userTimeTotal; + } + + private int checkNullInt(Integer count) { + if (Objects.isNull(count)) { + return 0; + } + return count; + } + + @Override + public List queryByUserCount() { + List staTimeTableList = this.userMapper.queryByUserCount(); + Collections.reverse(staTimeTableList); + return staTimeTableList; + } + + private void validCode(String sessionId, String code) { + boolean b = messageService.validCode( + sessionId, + code); + if (!b) { + throw new ResponseException(InfoEnum.AUTHCODE_ERROR); + } + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserStatusServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserStatusServiceImpl.java new file mode 100644 index 0000000..4864044 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserStatusServiceImpl.java @@ -0,0 +1,106 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.dto.UserStatusClassDto; +import com.hc.business.mapper.UserStatusMapper; +import com.hc.business.model.UserStatus; +import com.hc.business.service.UserStatusService; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 用户班级学习进度表 + * (UserStatus)表服务实现类 + * + * @author java + * @since 2020-12-06 11:26:45 + */ + +@Service("userStatusService") +public class UserStatusServiceImpl implements UserStatusService { + + private final UserStatusMapper userStatusMapper; + + public UserStatusServiceImpl(UserStatusMapper userStatusMapper) { + this.userStatusMapper = userStatusMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param statusId 主键 + * @return 实例对象 + */ + @Override + public UserStatus queryById(Integer statusId) { + return this.userStatusMapper.selectByPrimaryKey(statusId); + } + + /** + * 新增数据 + * + * @param userStatus 实例对象 + * @return 实例对象 + */ + @Override + public UserStatus insert(UserStatus userStatus) { + List userStatuses + = this.userStatusMapper.queryByClassIdAndUserId(userStatus.getClassId(), + userStatus.getUserId()); + if (!CollectionUtils.isEmpty(userStatuses)) { + return userStatuses.get(0); + } + this.userStatusMapper.insert(userStatus); + return userStatus; + } + + /** + * 修改数据 + * + * @param userStatus 实例对象 + * @return 实例对象 + */ + @Override + public UserStatus update(UserStatus userStatus) { + this.userStatusMapper.updateByPrimaryKeySelective(userStatus); + return this.queryById(userStatus.getStatusId()); + } + + /** + * 通过主键删除数据 + * + * @param statusId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer statusId) { + return this.userStatusMapper.deleteByPrimaryKey(statusId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.userStatusMapper::selectAll); + } + + @Override + public List queryDtoByUserId(Integer userId) { + return this.userStatusMapper.queryDtoByUserId(userId); + } + + @Override + public PageInfo queryByClassId(Integer classId, int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(() -> this.userStatusMapper.queryByClassId(classId)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserTeacherServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserTeacherServiceImpl.java new file mode 100644 index 0000000..a5e4549 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserTeacherServiceImpl.java @@ -0,0 +1,93 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.UserTeacherMapper; +import com.hc.business.model.UserTeacher; +import com.hc.business.service.UserTeacherService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * (UserTeacher)表服务实现类 + * + * @author java + * @since 2020-11-20 11:08:20 + */ + +@Service("userTeacherService") +public class UserTeacherServiceImpl implements UserTeacherService { + + private final UserTeacherMapper userTeacherMapper; + + public UserTeacherServiceImpl(UserTeacherMapper userTeacherMapper) { + this.userTeacherMapper = userTeacherMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param teacherId 主键 + * @return 实例对象 + */ + @Override + public UserTeacher queryById(Integer teacherId) { + return this.userTeacherMapper.selectByPrimaryKey(teacherId); + } + + /** + * 新增数据 + * + * @param userTeacher 实例对象 + * @return 实例对象 + */ + @Override + public UserTeacher insert(UserTeacher userTeacher) { + userTeacher.setCreateTime(System.currentTimeMillis()); + this.userTeacherMapper.insert(userTeacher); + return userTeacher; + } + + /** + * 修改数据 + * + * @param userTeacher 实例对象 + * @return 实例对象 + */ + @Override + public UserTeacher update(UserTeacher userTeacher) { + this.userTeacherMapper.updateByPrimaryKeySelective(userTeacher); + return this.queryById(userTeacher.getTeacherId()); + } + + /** + * 通过主键删除数据 + * + * @param teacherId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer teacherId) { + return this.userTeacherMapper.deleteByPrimaryKey(teacherId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.userTeacherMapper::selectAll); + } + + @Override + public List queryByName(String name) { + return this.userTeacherMapper.queryByName(name); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserTestHistoryServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserTestHistoryServiceImpl.java new file mode 100644 index 0000000..5341d0b --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserTestHistoryServiceImpl.java @@ -0,0 +1,88 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.mapper.UserTestHistoryMapper; +import com.hc.business.model.UserTestHistory; +import com.hc.business.service.UserTestHistoryService; +import org.springframework.stereotype.Service; + +/** + * 用户考试记录表(UserTestHistory)表服务实现类 + * + * @author java + * @since 2020-12-07 11:28:21 + */ + +@Service("userTestHistoryService") +public class UserTestHistoryServiceImpl implements UserTestHistoryService { + + private final UserTestHistoryMapper userTestHistoryMapper; + + public UserTestHistoryServiceImpl(UserTestHistoryMapper userTestHistoryMapper) { + this.userTestHistoryMapper = userTestHistoryMapper; + } + + /** + * 通过ID查询单条数据 + * + * @param testId 主键 + * @return 实例对象 + */ + @Override + public UserTestHistory queryById(Integer testId) { + return this.userTestHistoryMapper.selectByPrimaryKey(testId); + } + + /** + * 新增数据 + * + * @param userTestHistory 实例对象 + * @return 实例对象 + */ + @Override + public UserTestHistory insert(UserTestHistory userTestHistory) { + this.userTestHistoryMapper.insert(userTestHistory); + return userTestHistory; + } + + /** + * 修改数据 + * + * @param userTestHistory 实例对象 + * @return 实例对象 + */ + @Override + public UserTestHistory update(UserTestHistory userTestHistory) { + this.userTestHistoryMapper.updateByPrimaryKeySelective(userTestHistory); + return this.queryById(userTestHistory.getTestId()); + } + + /** + * 通过主键删除数据 + * + * @param testId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer testId) { + return this.userTestHistoryMapper.deleteByPrimaryKey(testId) > 0; + } + + /** + * 分页查询多条数据 + * + * @param page 页码 + * @param size 查询条数 + * @return 对象列表 + */ + @Override + public PageInfo queryAllByLimit(int page, int size) { + return PageHelper.startPage(page, size).doSelectPageInfo(this.userTestHistoryMapper::selectAll); + } + + @Override + public UserTestHistory queryMaxScore(Integer userId,Integer classId) { + return userTestHistoryMapper.queryMaxScore(userId,classId); + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserVideoPositionServiceImpl.java b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserVideoPositionServiceImpl.java new file mode 100644 index 0000000..41d1f07 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/java/com/hc/business/service/impl/UserVideoPositionServiceImpl.java @@ -0,0 +1,381 @@ +package com.hc.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hc.business.dto.UserCourseDto; +import com.hc.business.mapper.CourseChapterVideoMapper; +import com.hc.business.mapper.UserCourseMapper; +import com.hc.business.mapper.UserVideoPositionMapper; +import com.hc.business.model.UserVideoPosition; +import com.hc.business.model.CourseChapterVideo; +import com.hc.business.model.UserCourse; +import com.hc.business.service.UserVideoPositionService; +import com.hc.core.utils.redis.RedisUtil; +import com.hc.core.utils.exception.ResponseException; +import com.hc.core.utils.tool.Compute; +import com.hc.core.utils.tool.Verification; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 用户视频观看记录(UserVideoPosition)表服务实现类 + * + * @author java + * @since 2020-05-29 15:50:50 + */ + +@Service("userVideoPositionService") +public class UserVideoPositionServiceImpl implements UserVideoPositionService { + + private final RedisUtil redisUtil; + + private final UserVideoPositionMapper userVideoPositionMapper; + + private final CourseChapterVideoMapper chapterVideoMapper; + + private final UserVideoPositionMapper positionMapper; + + private final UserCourseMapper userCourseMapper; + + private static final String REDIS_KEY_PREFIX = "user:video:position:"; + + public UserVideoPositionServiceImpl(UserVideoPositionMapper userVideoPositionMapper, RedisUtil redisUtil, CourseChapterVideoMapper videoMapper, + UserVideoPositionMapper positionMapper, UserCourseMapper userCourseMapper) { + this.userVideoPositionMapper = userVideoPositionMapper; + this.chapterVideoMapper = videoMapper; + this.positionMapper = positionMapper; + this.userCourseMapper = userCourseMapper; + this.redisUtil = redisUtil; + } + + /** + * 通过ID查询单条数据 + * + * @param userVideoPositionId 主键 + * @return 实例对象 + */ + @Override + public UserVideoPosition queryById(Integer userVideoPositionId) { + return userVideoPositionMapper.selectByPrimaryKey(userVideoPositionId); + } + + /** + * 新增数据 + * + * @param userVideoPosition 实例对象 + * @return 实例对象 + */ + @Override + public UserVideoPosition insert(UserVideoPosition userVideoPosition) { + userVideoPositionMapper.insert(userVideoPosition); + return userVideoPosition; + } + + /** + * 修改数据 + * + * @param userVideoPosition 实例对象 + * @return 实例对象 + */ + @Override + public UserVideoPosition update(UserVideoPosition userVideoPosition) { + userVideoPositionMapper.updateByPrimaryKeySelective(userVideoPosition); + return this.queryById(userVideoPosition.getUserVideoPositionId()); + } + + /** + * 通过主键删除数据 + * + * @param userVideoPositionId 主键 + * @return 是否成功 + */ + @Override + public Boolean deleteById(Integer userVideoPositionId) { + return userVideoPositionMapper.deleteByPrimaryKey(userVideoPositionId) > 0; + } + + /** + * 分页查询所有数据 + * + * @return 实例对象数组 + */ + @Override + public PageInfo queryAllByLimit(Integer page, Integer size) { + PageHelper.startPage(page, size); + List list = userVideoPositionMapper.selectAll(); + return new PageInfo(list); + } + + /** + * 重新计算课程的总进度,没有章节得概念,但是多个视频 + * + * @param userId + * @param years + * @param courseId + * @return + */ + + private boolean calcCourseChapterAndVideoPosition(Integer courseId, Integer userId, String years,Integer classId) { + + //重写计算 + //取一个课程所有的视频列表 + List video_list = chapterVideoMapper.selectVideoByCourseId(courseId); + if ((null == video_list) || (video_list.size() <= 0)) { + return false; + } + + //遍历每个视频的进度 + Double totalPercent = Double.valueOf("0"); + for (CourseChapterVideo video : + video_list) { + + List position_list = positionMapper.selectUserPositionByUserAndVideo(video.getVideoId(), userId); + if ((null == position_list) || (0 == position_list.size())) { + continue; + } + + try { + Double videotime = Double.valueOf(position_list.get(0).getVideoTime()); + Double position = Double.valueOf(position_list.get(0).getVideoPosition()); + + totalPercent = Compute.add(totalPercent, Compute.div(position, videotime, 2)); + } catch (Exception e) { + //计算出错,不计入进度 + continue; + } + + + } + + //计算平均进度 + totalPercent = Compute.div(totalPercent, video_list.size(), 2); + //如果章节进度有更新,需要从新计算课程总体进度,并更新到数据库 + //TODO 查询课程进度 + List cardCourseList = userCourseMapper.selectUserCourseProgress(userId, classId,courseId); + if (cardCourseList.size() > 0) { + //课程进度有变化时 将查询的课程进度写入数据库 + if (!totalPercent.equals(cardCourseList.get(0).getCoursePercent())) { + UserCourse userCourse = new UserCourse(); + BeanUtils.copyProperties(cardCourseList.get(0), userCourse); + userCourse.setCoursePercent(totalPercent); + userCourseMapper.updateByPrimaryKeySelective(userCourse); + } + } else { + //如果没有课程得记录,则增加记录 + UserCourse userCourse = new UserCourse(); + userCourse.setCoursePercent(totalPercent); + userCourse.setCourseId(courseId); + userCourse.setUserId(userId); + userCourse.setClassId(classId); + userCourseMapper.insert(userCourse); + } + + return true; + } + + //课程进度接口 + //刷新进度到数据库 + @Override + public int flushToDb(Integer userId, Integer videoId, Integer courseId, String years,Integer classId) { + + if ((null == videoId) || (null == userId) || (null == courseId)) { + return 0; + } + String key = REDIS_KEY_PREFIX + userId + ":" + videoId; + String key_v = "position" + String.valueOf(videoId); + String key_t = "videotime" + String.valueOf(videoId); + String key_u = "update" + String.valueOf(videoId); + //没有缓存得进度信息,不刷新 + if ((true != redisUtil.hashHasKey(key, key_v)) || (true != redisUtil.hashHasKey(key, key_t))) { + return 0; + } + + /** + * 首先更新单挑播放记录 + */ + + String videoTime = redisUtil.hashGet(key, key_t).toString(); + String position = redisUtil.hashGet(key, key_v).toString(); + //首先查找是否存在userVideoPostion记录 + List plist = userVideoPositionMapper.selectUserPositionByUserAndVideo(videoId, userId); + //不存在记录 + Double percent = Compute.div(Double.valueOf(position), Double.valueOf(videoTime), 2); + + if ((null == plist) || (plist.size() <= 0)) { + //新增记录 + UserVideoPosition uposition = new UserVideoPosition(); + uposition.setVideoId(videoId); + uposition.setUserId(userId); + uposition.setVideoTime(videoTime); + uposition.setVideoPosition(position); + if (percent >= 0.95) { + uposition.setWatchEnd(1); + } else { + uposition.setWatchEnd(0); + } + + try { + userVideoPositionMapper.insert(uposition); + } catch (Exception e) { + return 0; + } + } else { + //修改记录,只保存一条记录 + UserVideoPosition uposition = plist.get(0); + //位置比数据库保存得少,不刷新 + if (Double.valueOf(position) <= Double.valueOf(uposition.getVideoPosition())) { + return 0; + } + uposition.setVideoPosition(position); + if (percent >= 0.95) { + uposition.setWatchEnd(1); + } else { + uposition.setWatchEnd(0); + } + try { + userVideoPositionMapper.updateByPrimaryKey(uposition); + } catch (Exception e) { + return 0; + } + } + + //更新课程总进度 + calcCourseChapterAndVideoPosition(courseId, userId, years,classId); + + return 1; + } + + @Override + public Map findVideoPosition(Integer userId, Integer videoId, Integer courseId,Integer classId) { + + String key = REDIS_KEY_PREFIX + userId + ":" + videoId ; + String key_v = "position" + String.valueOf(videoId); + String key_t = "videotime" + String.valueOf(videoId); + String key_u = "update" + String.valueOf(videoId); + + //redis中不存在,从数据库查找,防止极端情况下,完全清理了缓存,全部丢掉数据 + Map map = new HashMap<>(2); + if ((true != redisUtil.hashHasKey(key, key_v)) || (true != redisUtil.hashHasKey(key, key_t))) { + List position_list = userVideoPositionMapper.selectUserPositionByUserAndVideo(videoId, userId); + if ((null != position_list) && (position_list.size() > 0)) { + UserVideoPosition position = position_list.get(0); + redisUtil.hashDel(key, key_t); + redisUtil.hashDel(key, key_v); + + map.put("position", position.getVideoPosition()); + map.put("videotime", position.getVideoTime()); + + redisUtil.hashSet(key, key_v, position.getVideoPosition()); + redisUtil.hashSet(key, key_v, position.getVideoTime()); + + return map; + } + + } else { + String videoPosition = (null == redisUtil.hashGet(key, key_v)) ? null : redisUtil.hashGet(key, key_v).toString(); + String videoTime = (null == redisUtil.hashGet(key, key_t)) ? null : redisUtil.hashGet(key, key_t).toString(); + map.put("position", videoPosition); + map.put("videotime", videoTime); + if (redisUtil.hashHasKey(key, key_u)) { + map.put("update", "1"); + redisUtil.hashDel(key, key_u); + } + return map; + } + + return map; + + } + + @Override + public UserVideoPosition getVideoPosition(Integer positionId) { + return userVideoPositionMapper.selectByPrimaryKey(positionId); + } + +// @Override +// public int insertVideoPositionList(List userVideoPositionList) { +// return userVideoPositionMapper.insertList(userVideoPositionList); +// } + + + @Override + public UserVideoPosition insertPositionToRedis(UserVideoPosition userVideoPosition, Integer courseId) { + + String key = REDIS_KEY_PREFIX + userVideoPosition.getUserId() + ":" + userVideoPosition.getVideoId(); + String key_v = "position" + String.valueOf(userVideoPosition.getVideoId()); + String key_t = "videotime" + String.valueOf(userVideoPosition.getVideoId()); + //是否更新标记位,用来同步数据使用 + String key_u = "update" + String.valueOf(userVideoPosition.getVideoId()); + + //校验播放记录百分比 大于97% 默认100% + if (Verification.verificationString(userVideoPosition.getVideoTime()) && Verification.verificationString(userVideoPosition.getVideoPosition())) { + if (Double.valueOf(userVideoPosition.getVideoPosition()) > Double.valueOf(userVideoPosition.getVideoTime())) { + userVideoPosition.setVideoPosition(userVideoPosition.getVideoTime()); + } + if (Double.valueOf(userVideoPosition.getVideoTime()) != 0) { + Double percent = Compute.div(Double.valueOf(userVideoPosition.getVideoPosition()), Double.valueOf(userVideoPosition.getVideoTime()), 2); + if (percent >= 0.95) { + //设置视频观看长度 = 视频总长 + userVideoPosition.setVideoPosition(userVideoPosition.getVideoTime()); + } + } + } + try { + if (Verification.verificationString(userVideoPosition.getVideoPosition())) { + if (redisUtil.hasKey(key)) { + //hashset已存在 + String videoPosition = (String) redisUtil.hashGet(key, key_v); + String videoTime = (String) redisUtil.hashGet(key, key_t); + + //表示i视频进度有更新 + redisUtil.hashDel(key, key_u); + redisUtil.hashSet(key, key_u, "1"); + + //单个视频总长是否已存在 + if (Verification.verificationString(videoTime)) { + //大于原先长 + if (Double.valueOf(userVideoPosition.getVideoTime()) > Double.valueOf(videoTime)) { + redisUtil.hashDel(key, key_t); + redisUtil.hashSet(key, key_t, userVideoPosition.getVideoTime()); + } + } else { + redisUtil.hashSet(key, key_t, userVideoPosition.getVideoTime()); + } + + //单个视频播放记录是否已存在 + if (Verification.verificationString(videoPosition)) { + if (Double.valueOf(userVideoPosition.getVideoPosition()) > Double.valueOf(videoPosition)) { + //大于原先值 + //先删除原先的存储 + redisUtil.hashDel(key, key_v); + redisUtil.hashSet(key, key_v, userVideoPosition.getVideoPosition()); + } + + //如果位置大于视频最大长度,肯定出错了。不能超过视频最大长度 + if (Double.valueOf(userVideoPosition.getVideoPosition()) >= Double.valueOf(videoTime)) { + redisUtil.hashDel(key, key_v); + redisUtil.hashSet(key, key_v, videoTime); + } + } else { + redisUtil.hashSet(key, key_v, userVideoPosition.getVideoPosition()); + } + } else { + //每次添加时将播放记录先添加至redis + Map pairs = new HashMap(16); + pairs.put(key_v, userVideoPosition.getVideoPosition()); + pairs.put(key_t, userVideoPosition.getVideoTime()); + pairs.put(key_u, "1"); + redisUtil.hashMapSet(key, pairs); + } + } + return userVideoPosition; + } catch (Exception e) { + throw new ResponseException(e.hashCode(), e.getMessage()); + } + + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/AreaDistrictMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/AreaDistrictMapper.xml new file mode 100644 index 0000000..c2f3ae4 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/AreaDistrictMapper.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + area_id, + area_name, + parent_id, + area_image, + area_status, + area_index + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/BannerMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/BannerMapper.xml new file mode 100644 index 0000000..5ee05fb --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/BannerMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + banner_id, + banner_url, + banner_index, + banner_type + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/ClassConfigMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/ClassConfigMapper.xml new file mode 100644 index 0000000..1f964c7 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/ClassConfigMapper.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + class_config_id, + class_name, + class_desc, + class_type, + class_logo, + class_content, + class_mobile_content, + area_id, + bx_hours, + xx_hours, + paper_hours, + paper_id, + create_time, + years, + price, + apply_start_time, + apply_end_time, + study_start_time, + study_end_time, + paper_start_time, + paper_end_time, + cert_start_time, + cert_end_time, + need_paper, + valid, + sign_time, + prefix + + + + + + + + + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/ClassConfigSponsorMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/ClassConfigSponsorMapper.xml new file mode 100644 index 0000000..70bd1db --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/ClassConfigSponsorMapper.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + sponsor_id, + sponsor_url, + sponsor_name, + class_id, + sponsor_index, + create_time + + + + + diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/ClassCourseMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/ClassCourseMapper.xml new file mode 100644 index 0000000..56aec87 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/ClassCourseMapper.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + class_course_id, + class_id, + course_id, + course_type, + create_time + + + + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseChapterAnnexMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseChapterAnnexMapper.xml new file mode 100644 index 0000000..57b8fb2 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseChapterAnnexMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + course_chapter_annex_id, + annex_name, + course_chapter_id, + annex_introduction, + annex_url + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseChapterMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseChapterMapper.xml new file mode 100644 index 0000000..d114252 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseChapterMapper.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + course_chapter_id, + chapter_name, + parent_id, + chapter_level, + course_id + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseChapterTagMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseChapterTagMapper.xml new file mode 100644 index 0000000..23969e1 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseChapterTagMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + tag_id, + tag_name, + tag_index, + chapter_id, + teacher_name, + course_id + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseChapterTestMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseChapterTestMapper.xml new file mode 100644 index 0000000..fdc736a --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseChapterTestMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + test_id, + question_id, + chapter_id, + course_id + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseChapterVideoMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseChapterVideoMapper.xml new file mode 100644 index 0000000..ef441d9 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseChapterVideoMapper.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + video_id, + chapter_id, + video_name, + video_url, + video_ori_url, + course_id, + is_free, + free_time + + + + + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseMapper.xml new file mode 100644 index 0000000..a98fb29 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseMapper.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + course_id, + course_name, + course_logo, + course_desc, + course_hours, + course_teacher, + is_valid, + gallery, + reserved1 + + + + + + + + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseTypeMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseTypeMapper.xml new file mode 100644 index 0000000..beb724e --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseTypeMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + course_type_id, + course_name + + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseTypeRelationMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseTypeRelationMapper.xml new file mode 100644 index 0000000..d9409d9 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/CourseTypeRelationMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + course_type_re_id, + course_id, + course_type_id, + create_time + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/NewsMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/NewsMapper.xml new file mode 100644 index 0000000..419d669 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/NewsMapper.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + news_id, + news_title, + news_logo, + news_content, + create_time, + tag_id + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/NewsTagMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/NewsTagMapper.xml new file mode 100644 index 0000000..6f34a84 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/NewsTagMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + tag_id, + tag_name + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/OrderUserLogMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/OrderUserLogMapper.xml new file mode 100644 index 0000000..e588b74 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/OrderUserLogMapper.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + order_log_id, + order_id, + re_user_id, + create_time + + + + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/OrdersMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/OrdersMapper.xml new file mode 100644 index 0000000..b628b02 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/OrdersMapper.xml @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + orders_id, + order_no, + user_id, + class_id, + order_status, + `body`, + `subject`, + total_amount, + create_time, + trade_no, + over_time, + user_invoices_id, + is_de, + remark + + + o.orders_id, + o.order_no, + o.user_id, + o.class_id, + o.order_status, + o.`body`, + o.`subject`, + o.total_amount, + o.create_time, + o.over_time, + o.user_invoices_id, + o.is_de, + o.remark + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/PaperMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/PaperMapper.xml new file mode 100644 index 0000000..006d7f7 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/PaperMapper.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + paper_id, + paper_name, + paper_type, + paper_introduction, + paper_score, + paper_score_pass, + paper_time, + questions_num, + end_time, + `status` + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/PaperQuestionMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/PaperQuestionMapper.xml new file mode 100644 index 0000000..945e890 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/PaperQuestionMapper.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + paper_rule_id, + paper_id, + question_num, + question_level, + question_type, + score, + question_tag_id + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/QuestionAnswerMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/QuestionAnswerMapper.xml new file mode 100644 index 0000000..dc998e3 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/QuestionAnswerMapper.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + question_answer_id, + question_id, + question_answer, + is_true + + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/QuestionMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/QuestionMapper.xml new file mode 100644 index 0000000..3c04d9e --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/QuestionMapper.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + question_id, + question_description, + tag_id, + question_type, + question_score, + question_level, + analysis + + + + + + + + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/QuestionTagMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/QuestionTagMapper.xml new file mode 100644 index 0000000..22bf60a --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/QuestionTagMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + question_tag_id, + tag_name + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/QuestionTypeMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/QuestionTypeMapper.xml new file mode 100644 index 0000000..8a7ff86 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/QuestionTypeMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + type_id, + type_name + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/ThirdCourseMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/ThirdCourseMapper.xml new file mode 100644 index 0000000..72ef187 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/ThirdCourseMapper.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + id, + third_id, + course_id, + `status`, + create_time + + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/ThirdMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/ThirdMapper.xml new file mode 100644 index 0000000..120efc3 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/ThirdMapper.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + third_id, + third_token, + third_name, + create_time, + expire_time + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserAdminMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserAdminMapper.xml new file mode 100644 index 0000000..ce45fe3 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserAdminMapper.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + user_admin_id, + admin_name, + admin_account, + admin_pass, + permission_level + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserAdviseMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserAdviseMapper.xml new file mode 100644 index 0000000..6015d1a --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserAdviseMapper.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + advice_id, + user_id, + email, + title, + advise, + advice_logo, + advice_type, + is_reply, + create_time + + + + + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserCourseMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserCourseMapper.xml new file mode 100644 index 0000000..fba637f --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserCourseMapper.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + user_course_id, + user_id, + course_id, + course_percent, + class_id + + + + + + + + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserInvoicesMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserInvoicesMapper.xml new file mode 100644 index 0000000..4c65b8f --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserInvoicesMapper.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + user_invoices_id, + invoices_head, + invoices_type, + invoices_code, + invoices_bank, + invoices_user, + invoices_no, + invoices_price, + create_time, + `status`, + `time`, + user_id, + class_id, + remarks, + remarks_sign, + tax_code + + + + + + + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserMapper.xml new file mode 100644 index 0000000..4a7ab6a --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserMapper.xml @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + user_id, + card_id, + user_password, + user_type, + area_id, + user_nick, + user_name, + user_mobile, + user_email, + user_gender, + create_time, + user_birthday, + `active`, + user_logo, + user_company, + user_reserved1, + user_reserved2, + user_reserved3, + user_reserved4, + user_reserved5 + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserRefundHistoryMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserRefundHistoryMapper.xml new file mode 100644 index 0000000..242037b --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserRefundHistoryMapper.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + id, + user_id, + user_type, + order_no, + create_time, + done_time, + refund_price, + remark + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserStatusMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserStatusMapper.xml new file mode 100644 index 0000000..be2b187 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserStatusMapper.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + status_id, + user_id, + class_id, + order_id, + `status` + + + + + + + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserTeacherMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserTeacherMapper.xml new file mode 100644 index 0000000..b387724 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserTeacherMapper.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + teacher_id, + teacher_name, + teacher_introduce, + teacher_logo, + teacher_url, + create_time + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserTestHistoryMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserTestHistoryMapper.xml new file mode 100644 index 0000000..1862d8a --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserTestHistoryMapper.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + test_id, + user_id, + paper_id, + class_id, + score, + answer, + create_time, + total_score, + test_time + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserVideoPositionMapper.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserVideoPositionMapper.xml new file mode 100644 index 0000000..d03cca2 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mapper/UserVideoPositionMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + user_video_position_id, video_id, user_id, video_position, watch_end, video_time + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mybatis-config.xml b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mybatis-config.xml new file mode 100644 index 0000000..36c796c --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-business/src/main/resources/mybatis-config.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + diff --git a/JAVA_MYSQL_ZC/jxjy-core/jxjy-core.iml b/JAVA_MYSQL_ZC/jxjy-core/jxjy-core.iml new file mode 100644 index 0000000..49ed79b --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/jxjy-core.iml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-core/pom.xml b/JAVA_MYSQL_ZC/jxjy-core/pom.xml new file mode 100644 index 0000000..be969f8 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/pom.xml @@ -0,0 +1,120 @@ + + + 4.0.0 + + + com.hc + jxjy-education + 0.0.1-SNAPSHOT + + + jxjy-core + 0.0.1-SNAPSHOT + jxjy-core + Demo project for Spring Boot + + + 11 + 23.0 + 2.1.3 + 4.1.5 + [7.2.0, 7.2.99] + 3.3.0 + 4.9.9 + + + + + + org.springframework.boot + spring-boot-starter-data-redis + + + + org.apache.commons + commons-pool2 + + + + + org.springframework.boot + spring-boot-starter-validation + + + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + ${mybatis.version} + + + + tk.mybatis + mapper + ${tk.version} + + + + + com.qiniu + qiniu-java-sdk + ${qiniu.version} + + + + org.apache.commons + commons-lang3 + + + + commons-codec + commons-codec + + + + com.google.guava + guava + ${guava.version} + + + + + com.auth0 + java-jwt + ${auth0.jwt.version} + + + + org.apache.httpcomponents + httpcore + + + + org.apache.httpcomponents + httpclient + + + + + commons-httpclient + commons-httpclient + 3.1 + + + + + org.jdom + jdom + 2.0.2 + + + + com.alipay.sdk + alipay-sdk-java + ${alipay.version} + + + + + diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/constants/OrderConstants.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/constants/OrderConstants.java new file mode 100644 index 0000000..29bf9ae --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/constants/OrderConstants.java @@ -0,0 +1,11 @@ +package com.hc.core.utils.constants; + +/** + * @author 10696 + * @since 2020/11/26 14:49 + */ + +public interface OrderConstants { + + String ORDER_REFUND = "10000"; +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/enums/ErrorEnum.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/enums/ErrorEnum.java new file mode 100644 index 0000000..d52cf96 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/enums/ErrorEnum.java @@ -0,0 +1,34 @@ +package com.hc.core.utils.enums; + +import lombok.Getter; + +/** + * @author JIA + * 自定义错误枚举类 + */ + +@Getter +public enum ErrorEnum { + + /* 系统级别 */ + + ERROR_REQUEST(100,"请求失败"), + ERROR_BAD_REQUEST(400,"请求语法错误"), + ERROR_UNAUTHORIZED(401,"未授权"), + ERROR_FORBIDDEN(403,"服务器拒绝请求"), + ERROR_NOT_FOUND(404,"请求资源不存在"), + ERROR_METHOD_NOT_AllOWED(405,"指定的请求方法,被禁用"), + ERROR_REQUEST_TIMEOUT(408,"请求超时"), + ERROR_REQUEST_ENTITY_TOO_LARGE(413,"请求实体过大,超出处理能力"), + ERROR_REQUEST_URI_TOO_LONG(414,"请求URL太长,拒绝访问") + + ; + private final Integer key; + private final String msg; + + ErrorEnum(Integer key, String msg) { + this.key = key; + this.msg = msg; + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/enums/InfoEnum.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/enums/InfoEnum.java new file mode 100644 index 0000000..f2455a9 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/enums/InfoEnum.java @@ -0,0 +1,40 @@ +package com.hc.core.utils.enums; + +import lombok.Getter; + +/** + * @author JIA + * 自定义消息枚举类 + */ +@Getter +public enum InfoEnum { + + NULL_PARAMETER(400, "请求参数错误"), + + LOGIN_USER_NAME_ERROR(201, "用户名错误,此用户不存在"), + + LOGIN_PASSWORD_ERROR(202, "密码错误,请重新输入"), + + LOGIN_REGISTER_RE(204, "用户已存在,不可重复注册"), + + SESSION_EXPIRED(205, "无资源权限,请登录"), + + AUTHCODE_ERROR(206, "验证码输入错误"), + + PAPER_ERROR(212, "此试卷已过期,请联系管理员重新设置"), + + TOKEN_ERROR(209, "非法token,禁止进入系统"), + + USER_INVOICES_ERROR(210, "此订单已申请发票,请不要重复操作"), + + ORDER_ERROR(211, "订单已存在,请不要重复操作"); + + private final Integer key; + private final String msg; + + InfoEnum(Integer key, String msg) { + this.key = key; + this.msg = msg; + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/enums/SuccessEnum.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/enums/SuccessEnum.java new file mode 100644 index 0000000..934a108 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/enums/SuccessEnum.java @@ -0,0 +1,32 @@ +package com.hc.core.utils.enums; + +import lombok.Getter; + +/** + * @author JIA + * 自定义成功枚举类 + */ +@Getter +public enum SuccessEnum { + + /* 系统级别 */ + + SUCCESS_REQUEST(200, "服务请求成功"), + SUCCESS_CREATED(201, "请求成功,服务器创建资源"), + SUCCESS_ACCEPTED(202, "请求成功,服务器尚未处理"), + SUCCESS_NON_AUTHORITATIVE(203,"请求成功,信息非授权"), + SUCCESS_NO_CONTENT(204,"请求成功,无内容"), + SUCCESS_RESET_CONTENT(205,"请求成功,内容重置"), + SUCCESS_PARTIAL_CONTENT(206,"请求成功,部分内容已处理") + + ; + + private final Integer key; + private final String msg; + + SuccessEnum(Integer key, String msg) { + this.key = key; + this.msg = msg; + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/exception/ResponseException.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/exception/ResponseException.java new file mode 100644 index 0000000..e526217 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/exception/ResponseException.java @@ -0,0 +1,33 @@ +package com.hc.core.utils.exception; + +import com.hc.core.utils.enums.InfoEnum; + +/** + * @author JIA + */ + +public class ResponseException extends RuntimeException { + + private static final long serialVersionUID = 1L; + + private Integer code; + + public ResponseException(Integer code,String message){ + super(message); + this.code = code; + } + + public ResponseException(InfoEnum infoEnum){ + super(infoEnum.getMsg()); + this.code = infoEnum.getKey(); + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/mapper/Mapper.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/mapper/Mapper.java new file mode 100644 index 0000000..8dfb4d2 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/mapper/Mapper.java @@ -0,0 +1,19 @@ +package com.hc.core.utils.mapper; + +import tk.mybatis.mapper.common.BaseMapper; +import tk.mybatis.mapper.common.ConditionMapper; +import tk.mybatis.mapper.common.IdsMapper; +import tk.mybatis.mapper.common.special.InsertListMapper; + +/** + * 定制版MyBatis Mapper插件接口,如需其他接口参考官方文档自行添加。 + * + * @author mybatis + */ +public interface Mapper + extends + BaseMapper, + ConditionMapper, + IdsMapper, + InsertListMapper { +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/msm/MessageService.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/msm/MessageService.java new file mode 100644 index 0000000..38734c7 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/msm/MessageService.java @@ -0,0 +1,101 @@ +package com.hc.core.utils.msm; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +import java.util.Random; + +/** + * @author Andrew + * @create 2019/02/18 10:39 + */ +@Configuration +@EnableConfigurationProperties(MsgConfig.class) +@Slf4j +public class MessageService { + + private final MsgConfig msgConfig; + + @Autowired + public MessageService(MsgConfig msgConfig) { + this.msgConfig = msgConfig; + } + + private JSONObject sendHttp(String url, String params) throws Exception { + CloseableHttpClient client = HttpClients.createDefault(); + HttpPost method = new HttpPost(url); + StringEntity entity = new StringEntity(params, "utf-8"); + entity.setContentEncoding("UTF-8"); + entity.setContentType("application/x-www-form-urlencoded"); + setHeader(method); + method.setEntity(entity); + HttpResponse resp = client.execute(method); + String result = EntityUtils.toString(resp.getEntity()); + client.close(); + return JSON.parseObject(result); + } + + private void setHeader(HttpPost method) { + Random random = new Random(); + long nonce = Math.abs(random.nextLong()); + long timpStamp = (System.currentTimeMillis() / 1000); + String sign = DigestUtils.sha1Hex(msgConfig.getAPP_SECRIT() + nonce + timpStamp); + method.addHeader("App-Key", msgConfig.getAPP_KEY()); + method.addHeader("Nonce", nonce + ""); + method.addHeader("Timestamp", timpStamp + ""); + method.addHeader("Signature", sign); + } + + + public String sendValidShortMessage(String phone) { + try { + String params = "mobile=" + phone + "&templateId=" + msgConfig.getTEMPLATE_ID() + "®ion=" + msgConfig.getREGION(); + JSONObject obj = sendHttp(msgConfig.getSEND_CODE_URL(), params); + if (obj != null && obj.get("code") != null && "200".equals(obj.get("code").toString())) { + return (String) obj.get("sessionId"); + } else { + return ""; + } + } catch (Exception e) { + log.error(e.getMessage()); + return ""; + } + } + + @Deprecated + public boolean validCode(String sessionId, String code) { + try { + + String params = "sessionId=" + sessionId + "&code=" + code; + JSONObject obj = sendHttp(msgConfig.getVERIF_CODE_URL(), params); + + if ((obj != null) && (obj.get("code") != null) && ("200".equals(obj.get("code").toString())) + && ("true".equals(obj.get("success").toString()))) { + log.debug("verify:" + params + ": obj:" + obj.toString()); + + return true; + + } else { + + assert obj != null; + log.debug("verify:" + params + ": obj:" + obj.toString()); + return false; + } + } catch (Exception e) { + log.error(e.getMessage()); + return false; + } + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/msm/MsgConfig.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/msm/MsgConfig.java new file mode 100644 index 0000000..aafb759 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/msm/MsgConfig.java @@ -0,0 +1,26 @@ +package com.hc.core.utils.msm; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * @author Andrew + * @create 2019/02/18 10:40 + */ +@Data +@ConfigurationProperties(prefix = "rong") +public class MsgConfig { + + private String TEMPLATE_ID; + + private String REGION; + + private String SEND_CODE_URL; + + private String APP_SECRIT; + + private String APP_KEY; + + private String VERIF_CODE_URL; + +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/oss/QiNiuUtil.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/oss/QiNiuUtil.java new file mode 100644 index 0000000..278c2cb --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/oss/QiNiuUtil.java @@ -0,0 +1,50 @@ +package com.hc.core.utils.oss; + +import com.qiniu.util.Auth; +import lombok.Data; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * @author JIA + */ + +@Data +@Component +public class QiNiuUtil { + + @Value("${oss.access-key}") + private String accessKey; + + @Value("${oss.secret-key}") + private String secretKey; + + @Value("${oss.bucket}") + private String bucket; + + @Value("${oss.file-domain}") + private String fileDomain; + + private Auth auth; + + private Auth getAuth() { + if (Objects.isNull(auth)) { + auth = Auth.create(getAccessKey(), getSecretKey()); + } + return auth; + } + + public Map getUpToken() { + Map map = new HashMap<>(2); + String upToken = getAuth().uploadToken(bucket); + map.put("upToken", upToken); + map.put("domain", fileDomain); + return map; + } + + +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/alipay/bean/AliPayBean.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/alipay/bean/AliPayBean.java new file mode 100644 index 0000000..b4481eb --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/alipay/bean/AliPayBean.java @@ -0,0 +1,50 @@ +package com.hc.core.utils.pay.browser.alipay.bean; + +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * @author 10696 + * @since 2020/11/26 14:43 + */ + +@Data +public class AliPayBean { + + /** + * 商户订单号 + */ + @NotNull(message = "订单号不可以为空") + private String out_trade_no; + + /** + * 订单名称 + */ + @NotNull(message = "订单名称不可以为空") + private String subject; + + /** + * 付款金额 + */ + @NotNull(message = "付款金额不可以为空") + private String total_amount; + + /** + * 商品描述 + */ + @NotNull(message = "商品描述不可以为空") + private String body; + + /** + * 超时时间参数 + */ + private String timeout_express = "10m"; + + /** + * 产品编号 + */ + private String product_code = "FAST_INSTANT_TRADE_PAY"; + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/alipay/bean/AliPayRefundBean.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/alipay/bean/AliPayRefundBean.java new file mode 100644 index 0000000..c1cf0ba --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/alipay/bean/AliPayRefundBean.java @@ -0,0 +1,31 @@ +package com.hc.core.utils.pay.browser.alipay.bean; + +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * @author 10696 + * @since 2020/11/26 14:44 + */ + +@Data +public class AliPayRefundBean { + + /** + * 商品订单号 + */ + @NotNull + private String out_trade_no; + /** + * 支付宝交易号 + */ + @NotNull + private String trade_no; + /** + * 退款金额 + */ + @NotNull + private Double refund_amount; + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/alipay/processor/AliPayProcessor.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/alipay/processor/AliPayProcessor.java new file mode 100644 index 0000000..358acbb --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/alipay/processor/AliPayProcessor.java @@ -0,0 +1,92 @@ +package com.hc.core.utils.pay.browser.alipay.processor; + +import com.alibaba.fastjson.JSON; +import com.alipay.api.AlipayApiException; +import com.alipay.api.AlipayClient; +import com.alipay.api.DefaultAlipayClient; +import com.alipay.api.request.AlipayTradePagePayRequest; +import com.alipay.api.request.AlipayTradeRefundRequest; +import com.hc.core.utils.properties.PayProperties; +import com.hc.core.utils.pay.browser.alipay.bean.AliPayBean; +import com.hc.core.utils.pay.browser.alipay.bean.AliPayRefundBean; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @author JIA + */ + +@Component("aliPayProcessor") +public class AliPayProcessor { + + @Autowired + private PayProperties payProperties; + + /** + * 支付宝支付配置 + * + * @return 接口对象 + */ + public AlipayClient alipayClient(String aliPayPublicKey) { + // 1、获得初始化的AliPayClient + String serverUrl = payProperties.getAliPay().getGatewayUrl(); + String appId = payProperties.getAliPay().getAppId(); + String privateKey = payProperties.getAliPay().getPrivateKey(); + String format = "json"; + String charset = payProperties.getAliPay().getCharset(); + String signType = payProperties.getAliPay().getSignType(); + return new DefaultAlipayClient(serverUrl, appId, privateKey, format, charset, aliPayPublicKey, signType); + } + + /** + * 支付 + * + * @param aliPayBean + * @return 实例对象 + * @throws AlipayApiException + */ + public String pay(AliPayBean aliPayBean) throws AlipayApiException { + + // 2、设置请求参数 + String aliPayPublicKey = payProperties.getAliPay().getPublicKey(); + String notifyUrl = payProperties.getAliPay().getNotifyUrl(); + String returnUrl = payProperties.getAliPay().getReturnUrl(); + // 构造请求 + AlipayTradePagePayRequest alipayRequest = new AlipayTradePagePayRequest(); + // 页面跳转同步通知页面路径 + alipayRequest.setReturnUrl(returnUrl); + // 服务器异步通知页面路径 + alipayRequest.setNotifyUrl(notifyUrl); + // 封装参数 + alipayRequest.setBizContent(JSON.toJSONString(aliPayBean)); + // 连接参数 + AlipayClient alipayClient = alipayClient(aliPayPublicKey); + // 3、请求支付宝进行付款,并获取支付结果 + String result = alipayClient.pageExecute(alipayRequest).getBody(); + // 返回付款信息 + return result; + } + + /** + * 退款 + * + * @param aliPayRefundBean + * @return 实例对象 + * @throws AlipayApiException + */ + public String refund(AliPayRefundBean aliPayRefundBean) throws AlipayApiException { + // 2、设置请求参数 + String aliPayPublicKey = payProperties.getAliPay().getKey(); + // 构造请求 + AlipayTradeRefundRequest request = new AlipayTradeRefundRequest(); + request.setBizContent(JSON.toJSONString(aliPayRefundBean)); + //连接参数 + AlipayClient alipayClient = alipayClient(aliPayPublicKey); + // 3、请求支付宝进行退款,并获取支付结果 + String result = alipayClient.execute(request).getBody(); + // 返回退款信息 + return result; + } + + +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/wxpay/utils/Md5ToolUtil.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/wxpay/utils/Md5ToolUtil.java new file mode 100644 index 0000000..d645c4f --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/wxpay/utils/Md5ToolUtil.java @@ -0,0 +1,30 @@ +package com.hc.core.utils.pay.browser.wxpay.utils; + +import com.google.common.hash.HashCode; +import com.google.common.hash.HashFunction; +import com.google.common.hash.Hashing; + +import java.nio.charset.Charset; + +/** + * @author zdx + */ +public class Md5ToolUtil { + + private static HashFunction hf = Hashing.md5(); + private static Charset defaultCharset = Charset.forName("UTF-8"); + + private Md5ToolUtil() { + throw new AssertionError("不要实例化工具类哦"); + } + + public static String md5(String data) { + HashCode hash = hf.newHasher().putString(data, defaultCharset).hash(); + return hash.toString(); + } + + public static String md5(String data, Charset charset, boolean isUpperCase) { + HashCode hash = hf.newHasher().putString(data, charset == null ? defaultCharset : charset).hash(); + return isUpperCase ? hash.toString().toUpperCase() : hash.toString(); + } +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/wxpay/utils/WebUtils.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/wxpay/utils/WebUtils.java new file mode 100644 index 0000000..2107607 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/wxpay/utils/WebUtils.java @@ -0,0 +1,43 @@ +package com.hc.core.utils.pay.browser.wxpay.utils; + +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.httpclient.methods.PostMethod; +import org.apache.commons.httpclient.methods.RequestEntity; +import org.apache.commons.httpclient.methods.StringRequestEntity; + +import java.io.BufferedInputStream; +import java.util.HashMap; +import java.util.Map; + +/** + * @author zdx + */ +public class WebUtils { + + public static Map getMwebUrl(String url, String xmlParam){ + String jsonStr = null; + HttpClient httpClient = new HttpClient(); + Map map = new HashMap(); + try { + PostMethod method = null; + RequestEntity reqEntity = new StringRequestEntity(xmlParam,"text/json","UTF-8"); + method = new PostMethod(url); + method.setRequestEntity(reqEntity); + method.addRequestHeader("Content-Type","application/json;charset=utf-8"); + httpClient.executeMethod(method); + StringBuffer resBodyBuf = new StringBuffer(); + byte[] responseBody = new byte[1024]; + int readCount = 0; + BufferedInputStream is = new BufferedInputStream(method.getResponseBodyAsStream()); + while((readCount = is.read(responseBody,0,responseBody.length))!=-1){ + resBodyBuf.append(new String(responseBody,0,readCount,"utf-8")); + } + jsonStr = resBodyBuf.toString(); + map = XMLUtils.parseXmlToList(jsonStr); + } catch (Exception e) { + e.printStackTrace(); + } + return map; + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/wxpay/utils/XMLUtils.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/wxpay/utils/XMLUtils.java new file mode 100644 index 0000000..b5948dc --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/pay/browser/wxpay/utils/XMLUtils.java @@ -0,0 +1,51 @@ +package com.hc.core.utils.pay.browser.wxpay.utils; + +import org.jdom2.Document; +import org.jdom2.Element; +import org.jdom2.input.SAXBuilder; +import org.xml.sax.InputSource; + +import java.io.StringReader; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author zdx + */ +public class XMLUtils { + + /** + * description: 解析微信通知xml + * + * @param xml + * @return + * @author ex_yangxiaoyi + * @see + */ + @SuppressWarnings({ "unused", "rawtypes", "unchecked" }) + public static Map parseXmlToList(String xml) { + Map retMap = new HashMap(); + try { + StringReader read = new StringReader(xml); + // 创建新的输入源SAX 解析器将使用 InputSource 对象来确定如何读取 XML 输入 + InputSource source = new InputSource(read); + // 创建一个新的SAXBuilder + SAXBuilder sb = new SAXBuilder(); + // 通过输入源构造一个Document + Document doc = (Document) sb.build(source); + Element root = doc.getRootElement();// 指向根节点 + List es = root.getChildren(); + if (es != null && es.size() != 0) { + for (Element element : es) { + retMap.put(element.getName(), element.getValue()); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return retMap; + + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/properties/AliPayProperties.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/properties/AliPayProperties.java new file mode 100644 index 0000000..3473df6 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/properties/AliPayProperties.java @@ -0,0 +1,31 @@ +package com.hc.core.utils.properties; + +import lombok.Data; +import org.springframework.stereotype.Component; + +/** + * @author 10696 + * @since 2020/11/26 14:20 + */ +@Data +@Component +public class AliPayProperties { + + private String appId; + + private String privateKey; + + private String publicKey; + + private String notifyUrl; + + private String returnUrl; + + private String signType; + + private String charset; + + private String gatewayUrl; + + private String key; +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/properties/PayProperties.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/properties/PayProperties.java new file mode 100644 index 0000000..1ec6479 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/properties/PayProperties.java @@ -0,0 +1,36 @@ +package com.hc.core.utils.properties; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * @author 10696 + */ + +@Component("payProperties") +@ConfigurationProperties("hc.pay") +public class PayProperties { + + private AliPayProperties aliPay = new AliPayProperties(); + + private WxPayProperties wxPay = new WxPayProperties(); + + public AliPayProperties getAliPay() { + return aliPay; + } + + public void setAliPay(AliPayProperties aliPay) { + this.aliPay = aliPay; + } + + public WxPayProperties getWxPay() { + return wxPay; + } + + public void setWxPay(WxPayProperties wxPay) { + this.wxPay = wxPay; + } + + + +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/properties/WxPayProperties.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/properties/WxPayProperties.java new file mode 100644 index 0000000..406957b --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/properties/WxPayProperties.java @@ -0,0 +1,37 @@ +package com.hc.core.utils.properties; + +import lombok.Data; +import org.springframework.stereotype.Component; + +/** + * @author 10696 + */ +@Data +@Component +public class WxPayProperties { + + private String appid; + + private String mch_id; + + private String sign_key; + + private String nonce_str; + + private String sign; + + private String body; + + private String out_trade_no; + + private int total_fee; + + private String spbill_create_ip; + + private String notify_url; + + private String trade_type; + + private String scene_info; + +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/redis/RedisUtil.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/redis/RedisUtil.java new file mode 100644 index 0000000..266002a --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/redis/RedisUtil.java @@ -0,0 +1,281 @@ +package com.hc.core.utils.redis; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; + +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +/** + * SpringData Redis工具类 + * 序列化工具,已回退到jdk序列 + * + * @author JIA + */ +@Component +public class RedisUtil { + + private final RedisTemplate redisTemplate; + + @Autowired + public RedisUtil(RedisTemplate redisTemplate) { + this.redisTemplate = redisTemplate; + } + + /** + * 指定缓存失效时间 + * + * @param key 键值 + * @param time 时间 + * @return 布尔 + */ + public boolean expire(String key, long time) { + try { + if (time > 0) { + redisTemplate.expire(key, time, TimeUnit.SECONDS); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + + /** + * 判断key是否存在 + * + * @param key 键值 + * @return 布尔 + */ + public boolean hasKey(String key) { + try { + return redisTemplate.hasKey(key); + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 删除缓存 + * + * @param key 键值 + */ + public void del(String... key) { + if (key != null && key.length > 0) { + if (key.length == 1) { + redisTemplate.delete(key[0]); + } else { + redisTemplate.delete(CollectionUtils.arrayToList(key)); + } + } + } + + + /** + * 放入存储,不设置时间 + * + * @param key 键值 + * @param value 对象 + * @return 布尔 + */ + public boolean set(String key, Object value) { + try { + redisTemplate.opsForValue().set(key, value); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 放入缓存,并设置时间 + * + * @param key 键值 + * @param value 对象 + * @param time 时间 + * @return 布尔 + */ + + public boolean set(String key, Object value, long time) { + try { + if (time > 0) { + redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS); + } else { + set(key, value); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 依据key 获取缓存 + * + * @param key 键值 + * @return 实例对象 + */ + public Object get(String key) { + return key == null ? null : redisTemplate.opsForValue().get(key); + } + + /** + * HashMap存入缓存 + * + * @param key 键值 + * @param map Map对象 + * @return 布尔 + */ + public boolean hashMapSet(String key, Map map) { + try { + redisTemplate.opsForHash().putAll(key, map); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + + /** + * HashGet获取 + * + * @param key 键值 + * @param item 散列值 + * @return 实例对象 + */ + public Object hashGet(String key, String item) { + return redisTemplate.opsForHash().get(key, item); + } + + /** + * hash表中放入数据,如果不存在将创建 + * + * @param key 键值 + * @param item 散列值 + * @param value 对象 + * @return 布尔 + */ + public boolean hashSet(String key, String item, Object value) { + try { + redisTemplate.opsForHash().put(key, item, value); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 删除hash表中的值 + * + * @param key 键值 + * @param item 散列值 + */ + public void hashDel(String key, Object... item) { + redisTemplate.opsForHash().delete(key, item); + } + + /** + * 判断hash表中是否有该项的值 + * + * @param key 键值 + * @param item 散列值 + * @return 布尔 + */ + public boolean hashHasKey(String key, String item) { + return redisTemplate.opsForHash().hasKey(key, item); + } + + /** + * 根据key获取Set中的所有值 + * + * @param key 键值 + * @return 实例对象数组 + */ + public Set setGet(String key) { + try { + return redisTemplate.opsForSet().members(key); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * 将数据放入set缓存 + * + * @param key 键值 + * @param values 对象数组 + * @return 成功个数 + */ + public long setSet(String key, Object... values) { + try { + return redisTemplate.opsForSet().add(key, values); + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + + /** + * 将set数据放入缓存,并设置时间 + * + * @param key 键值 + * @param time 时间 + * @param values 对象数组 + * @return 个数 + */ + public long setSetAndTime(String key, long time, Object... values) { + try { + Long count = redisTemplate.opsForSet().add(key, values); + if (time > 0) { + expire(key, time); + } + return count; + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + + /** + * 获取set缓存的长度 + * + * @param key 键值 + * @return 个数 + */ + public long setGetSetSize(String key) { + try { + return redisTemplate.opsForSet().size(key); + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + + /** + * 移除值为value的 + * + * @param key 键值 + * @param values 实例对象 + * @return 个数 + */ + public long setRemove(String key, Object... values) { + try { + Long count = redisTemplate.opsForSet().remove(key, values); + return count; + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/result/Result.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/result/Result.java new file mode 100644 index 0000000..9811407 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/result/Result.java @@ -0,0 +1,84 @@ +package com.hc.core.utils.result; + + +import com.hc.core.utils.enums.InfoEnum; +import com.hc.core.utils.enums.SuccessEnum; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + + +/** + * @author JIA + */ +@Data +public class Result implements Serializable { + + private static final long serialVersionUID = 1L; + + + @ApiModelProperty(example = "200") + private Integer code; + + @ApiModelProperty(example = "服务请求成功") + private String msg; + + private T data; + + public Result() { + + } + + /** + * 请求成功 返回数据 + * + * @param object + * @param + * @return 实例对象 + */ + public static Result success(T object) { + Result result = new Result(); + result.setCode(SuccessEnum.SUCCESS_REQUEST.getKey()); + result.setMsg(SuccessEnum.SUCCESS_REQUEST.getMsg()); + result.setData(object); + return result; + } + + /** + * 请求成功 + * + * @return 实例对象 + */ + public static Result success() { + return success(null); + } + + /** + * 自定义信息返回 + * + * @param infoEnum 自定义枚举 + * @return 实例对象 + */ + public static Result info(InfoEnum infoEnum) { + Result result = new Result(); + result.setCode(infoEnum.getKey()); + result.setMsg(infoEnum.getMsg()); + return result; + } + + /** + * 自定义异常返回 + * + * @param key + * @param msg + * @return 实例对象 + */ + public static Result exception(Integer key, String msg) { + Result result = new Result(); + result.setCode(key); + result.setMsg(msg); + return result; + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/status/CodeFlagEnum.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/status/CodeFlagEnum.java new file mode 100644 index 0000000..d4bf129 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/status/CodeFlagEnum.java @@ -0,0 +1,25 @@ +package com.hc.core.utils.status; + +import lombok.Getter; + +/** + * @author 10696 + * @since 2020/11/20 10:31 + */ + +@Getter +public enum CodeFlagEnum { + + OBJECT_ENABLE_CODE(1, "标识有效"), + + OBJECT_DISABLED_CODE(0, "标识无效"); + + private final Integer code; + + private final String flag; + + CodeFlagEnum(Integer code, String flag) { + this.code = code; + this.flag = flag; + } +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/status/CourseFlagEnum.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/status/CourseFlagEnum.java new file mode 100644 index 0000000..99c04e8 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/status/CourseFlagEnum.java @@ -0,0 +1,26 @@ +package com.hc.core.utils.status; + +import lombok.Getter; + +/** + * @author 10696 + * @since 2020/11/25 9:48 + */ +@Getter +public enum CourseFlagEnum { + + COURSE_REQUIRE_CODE(1, "必修"), + + COURSE_OPTIONAL_CODE(2, "选修"); + + private final Integer code; + + private final String flag; + + CourseFlagEnum(Integer code, String flag) { + this.code = code; + this.flag = flag; + } + + +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/status/OrdersFlagEnum.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/status/OrdersFlagEnum.java new file mode 100644 index 0000000..d1e0e81 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/status/OrdersFlagEnum.java @@ -0,0 +1,28 @@ +package com.hc.core.utils.status; + +import lombok.Getter; + +/** + * @author 10696 + * @since 2020/11/26 17:47 + */ + +@Getter +public enum OrdersFlagEnum { + + + ORDERS_FLAG_UNPAID(0, "未支付"), + + ORDERS_FLAG_PAID(1, "已支付"), + + ORDERS_FLAG_REFUNDED(2, "已退款"); + + private final Integer code; + + private final String flag; + + OrdersFlagEnum(Integer code, String flag) { + this.code = code; + this.flag = flag; + } +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/tool/Compute.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/tool/Compute.java new file mode 100644 index 0000000..9962e9d --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/tool/Compute.java @@ -0,0 +1,98 @@ +package com.hc.core.utils.tool; + +import java.math.BigDecimal; + +/** + * @author Andrew + */ +public class Compute { // 默认除法运算精度 + private static final int DEF_DIV_SCALE = 10; // 这个类不能实例化 + + private Compute() { + } + + /** + * 提供精确的加法运算。 + * + * @param v1 被加数 + * @param v2 加数 + * @return 两个参数的和 + */ + public static double add(double v1, double v2) { + BigDecimal b1 = new BigDecimal(Double.toString(v1)); + BigDecimal b2 = new BigDecimal(Double.toString(v2)); + return b1.add(b2).doubleValue(); + } + + /** + * 提供精确的减法运算。 + * + * @param v1 被减数 + * @param v2 减数 + * @return 两个参数的差 + */ + public static double sub(double v1, double v2) { + BigDecimal b1 = new BigDecimal(Double.toString(v1)); + BigDecimal b2 = new BigDecimal(Double.toString(v2)); + return b1.subtract(b2).doubleValue(); + } + + /** + * 提供精确的乘法运算。 + * + * @param v1 被乘数 + * @param v2 乘数 + * @return 两个参数的积 + */ + public static double mul(double v1, double v2) { + BigDecimal b1 = new BigDecimal(Double.toString(v1)); + BigDecimal b2 = new BigDecimal(Double.toString(v2)); + return b1.multiply(b2).doubleValue(); + } + + /** + * 提供(相对)精确的除法运算,当发生除不尽的情况时,精确到 小数点以后10位,以后的数字四舍五入。 + * + * @param v1 被除数 + * @param v2 除数 + * @return 两个参数的商 + */ + public static double div(double v1, double v2) { + return div(v1, v2, DEF_DIV_SCALE); + } + + /** + * 提供(相对)精确的除法运算。当发生除不尽的情况时,由scale参数指 定精度,以后的数字四舍五入。 + * + * @param v1 被除数 + * @param v2 除数 + * @param scale 表示表示需要精确到小数点以后几位。 + * @return 两个参数的商 + */ + public static double div(double v1, double v2, int scale) { + if (scale < 0) { + throw new IllegalArgumentException( + "The scale must be a positive integer or zero"); + } + BigDecimal b1 = new BigDecimal(Double.toString(v1)); + BigDecimal b2 = new BigDecimal(Double.toString(v2)); + return b1.divide(b2, scale, BigDecimal.ROUND_HALF_UP).doubleValue(); + } + + /** + * 提供精确的小数位四舍五入处理。 + * + * @param v 需要四舍五入的数字 + * @param scale 小数点后保留几位 + * @return 四舍五入后的结果 + */ + public static double round(double v, int scale) { + if (scale < 0) { + throw new IllegalArgumentException( + "The scale must be a positive integer or zero"); + } + BigDecimal b = new BigDecimal(Double.toString(v)); + BigDecimal one = new BigDecimal("1"); + return b.divide(one, scale, BigDecimal.ROUND_HALF_UP).doubleValue(); + } +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/tool/IdGenerator.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/tool/IdGenerator.java new file mode 100644 index 0000000..855bcee --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/tool/IdGenerator.java @@ -0,0 +1,142 @@ +package com.hc.core.utils.tool; + +import java.math.BigInteger; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Random; +import java.util.UUID; + +/** + * @author Andrew + */ +public class IdGenerator { + + public static String[] chars = new String[]{ + "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", + "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", + "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", + "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", + "O", "P", "Q", "R", "S", "T", "U", "V","W", "X", "Y", "Z" + }; + + /** + * 获取短UUID,保证在百万数量级唯一,长度为 8 位,例子(tbN7ru6S,2B6orRJp) + * 用途:短信验证码,重设的用户密码...等等,对长度比较敏感的 ID + * @return 字符串型 短UUID + */ + public static String getShortUuid(){ + StringBuffer stringBuffer = new StringBuffer(); + String uuid = UUID.randomUUID().toString().replace("-", ""); + for (int i = 0; i < 8; i++){ + String str = uuid.substring(i * 4, i * 4 + 4); + int strInteger = Integer.parseInt(str, 16); + stringBuffer.append(chars[strInteger % 0x3E]); //除62取余 + } + return stringBuffer.toString(); + } + + /** + * 获取 nano 时间因子作为时间ID,位数为 14 位数字 例子(89864091147334) + * 可以用作 数据库 中的 ID 字段 + * @return 字符串型 ID + */ + public static String getShortTimeId() { + String dateString = String.valueOf(System.nanoTime()); + return dateString; + } + + /** + * 获取 “日期时分秒 + nano 时间因子” 作为时间ID,位数为 28 位数字 例子(2017011223042793189007681236) + * 可以用作 数据库 中的 ID 字段 + * @return 字符串型 ID + */ + public static String getTimeId() { + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); + String dateString = sdf.format(new Date()); + dateString += String.valueOf(System.nanoTime()); + return dateString; + } + + /** + * 获取标准的 uuid,长度为 32 位,例子(5d02334e-da48-4952-a168-ca19444efbe2) + * @return + */ + public static String getUuid() { + UUID uuid = UUID.randomUUID(); + return (uuid.toString()); + } + + /** + * 对字符串md5加密 + * + * @param str + * @return + */ + public static String getMD5(String str) { + try { + // 生成一个MD5加密计算摘要 + MessageDigest md = MessageDigest.getInstance("MD5"); + // 计算md5函数 + md.update(str.getBytes()); + // digest()最后确定返回md5 hash值,返回值为8为字符串。因为md5 hash值是16位的hex值,实际上就是8位的字符 + // BigInteger函数则将8位的字符串转换成16位hex值,用字符串来表示;得到字符串形式的hash值 + return new BigInteger(1, md.digest()).toString(16); + } catch (Exception e) { + return ""; + } + } + + /*** + * 密码hash加密 + * @param password + * @return + */ + public static String passwordToHash(String password) { + try { + MessageDigest digest = MessageDigest.getInstance("SHA-256"); + digest.update(password.getBytes()); + byte[] src = digest.digest(); + StringBuilder stringBuilder = new StringBuilder(); + // 字节数组转16进制字符串 + // https://my.oschina.net/u/347386/blog/182717 + for (byte aSrc : src) { + String s = Integer.toHexString(aSrc & 0xFF); + if (s.length() < 2) { + stringBuilder.append('0'); + } + stringBuilder.append(s); + } + return stringBuilder.toString(); + } catch (NoSuchAlgorithmException ignore) { + } + return null; + } + public static String getRandomPwd(){ + Random rd = new Random(); +// String n=""; + int getNum; + /** + do { + getNum = Math.abs(rd.nextInt())%10 + 48;//产生数字0-9的随机数 + //getNum = Math.abs(rd.nextInt())%26 + 97;//产生字母a-z的随机数 + char num1 = (char)getNum; + String dn = Character.toString(num1); + n += dn; + } while (n.length()<6); + */ + //改进效率 + StringBuffer buf = new StringBuffer(); + do { +// getNum = Math.abs(rd.nextInt())%10 + 48;//产生数字0-9的随机数 + getNum = Math.abs(rd.nextInt()%10) + 48;//产生数字0-9的随机数 + //getNum = Math.abs(rd.nextInt())%26 + 97;//产生字母a-z的随机数 + char num1 = (char)getNum; + String dn = Character.toString(num1); + buf.append(dn); + } while (buf.length()<6); + return buf.toString(); + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/tool/JsonUtils.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/tool/JsonUtils.java new file mode 100644 index 0000000..f9bb8c1 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/tool/JsonUtils.java @@ -0,0 +1,29 @@ +package com.hc.core.utils.tool; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +/** + * @author JIA + */ +public class JsonUtils { + + private static final ObjectMapper JSON = new ObjectMapper(); + + static { + JSON.setSerializationInclusion(JsonInclude.Include.NON_NULL); + JSON.configure(SerializationFeature.INDENT_OUTPUT, Boolean.TRUE); + } + + public static String toJson(Object obj) { + try { + return JSON.writeValueAsString(obj); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + + return null; + } +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/tool/Verification.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/tool/Verification.java new file mode 100644 index 0000000..bab67a3 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/tool/Verification.java @@ -0,0 +1,109 @@ +package com.hc.core.utils.tool; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Andrew + */ +public class Verification { + + public static boolean verificationAndString(String ...args){ + + for(int i=0;i list){ + if ((null == list) || (list.isEmpty())) { + return false; + } + return true; + } + + public static List getReturnList(List list, int perPage,int page) { + /* + List newlist = new ArrayList<>(); + if((perPage <=0) || (page < 1) || (null == list) || (list.size() ==0)) { + return newlist; + } + + //超过范围 + if(((page-1) * perPage) > list.size()) { + return newlist; + } + + + for(int index = ((page-1) * perPage); index < (page * perPage);index ++){ + if(index >= list.size()){ + break; + } + newlist.add(list.get(index)); + + } + return newlist; + */ + + int start,end; + + if((perPage <=0) || (page < 1) || (null == list) || (list.size() ==0) || + (((page-1) * perPage) > list.size())) { + return new ArrayList<>(); + } + + start = (page-1) * perPage; + //这里subList是左闭右开的,不包括toindex的这个元素,所以如果是需要取最后一个元素,toindex+1 + end = ((start + perPage) >= list.size())?(list.size()-1+1):(start+perPage); + return list.subList(start, end); + } + + public static boolean equalList(List listSrc, List listDest){ + + if (listSrc.size() != listDest.size()) + return false; + for (Object object : listSrc) { + if (!listDest.contains(object)) + return false; + } + return true; + } +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/MD5Utils.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/MD5Utils.java new file mode 100644 index 0000000..486de0d --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/MD5Utils.java @@ -0,0 +1,30 @@ +package com.hc.core.utils.wx; + +import java.security.MessageDigest; + +/** + * @author zdx + */ +public class MD5Utils { + + public final static String getMessageDigest(byte[] buffer) { + char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; + try { + MessageDigest mdTemp = MessageDigest.getInstance("MD5"); + mdTemp.update(buffer); + byte[] md = mdTemp.digest(); + int j = md.length; + char str[] = new char[j * 2]; + int k = 0; + for (int i = 0; i < j; i++) { + byte byte0 = md[i]; + str[k++] = hexDigits[byte0 >>> 4 & 0xf]; + str[k++] = hexDigits[byte0 & 0xf]; + } + return new String(str); + } catch (Exception e) { + return null; + } + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/Md5UtilTest.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/Md5UtilTest.java new file mode 100644 index 0000000..edc0149 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/Md5UtilTest.java @@ -0,0 +1,30 @@ +package com.hc.core.utils.wx; + +import com.google.common.hash.HashCode; +import com.google.common.hash.HashFunction; +import com.google.common.hash.Hashing; + +import java.nio.charset.Charset; + +/** + * @author zdx + */ +public class Md5UtilTest { + + private static HashFunction hf = Hashing.md5(); + private static Charset defaultCharset = Charset.forName("UTF-8"); + + private Md5UtilTest() { + throw new AssertionError("不要实例化工具类哦"); + } + + public static String md5(String data) { + HashCode hash = hf.newHasher().putString(data, defaultCharset).hash(); + return hash.toString(); + } + + public static String md5(String data, Charset charset, boolean isUpperCase) { + HashCode hash = hf.newHasher().putString(data, charset == null ? defaultCharset : charset).hash(); + return isUpperCase ? hash.toString().toUpperCase() : hash.toString(); + } +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/StringUtils.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/StringUtils.java new file mode 100644 index 0000000..16454db --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/StringUtils.java @@ -0,0 +1,35 @@ +package com.hc.core.utils.wx; + +/** + * @author zdx + */ +public class StringUtils { + + /** + * 元转换成分 + * + * @param amount + * @return + */ + public static String getMoney(String amount) { + if (amount == null) { + return ""; + } + // 金额转化为分为单位 + String currency = amount.replaceAll("\\$|\\¥|\\,", ""); //处理包含, ¥ 或者$的金额 + int index = currency.indexOf("."); + int length = currency.length(); + Long amLong = 0L; + if (index == -1) { + amLong = Long.valueOf(currency + "00"); + } else if (length - index >= 3) { + amLong = Long.valueOf((currency.substring(0, index + 3)).replace(".", "")); + } else if (length - index == 2) { + amLong = Long.valueOf((currency.substring(0, index + 2)).replace(".", "") + 0); + } else { + amLong = Long.valueOf((currency.substring(0, index + 1)).replace(".", "") + "00"); + } + return amLong.toString(); + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/TimeUtils.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/TimeUtils.java new file mode 100644 index 0000000..da2f5c5 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/TimeUtils.java @@ -0,0 +1,32 @@ +package com.hc.core.utils.wx; + +import java.text.SimpleDateFormat; +import java.util.Calendar; + +/** + * @author zdx + */ +public class TimeUtils { + + /** + * 取得系统时间 + * @param pattern eg:yyyy-MM-dd HH:mm:ss,SSS + * @return + */ + public static String getSysTime(String pattern) { + + return formatSysTime(new SimpleDateFormat(pattern)); + } + + /** + * 格式化系统时间 + * @param format + * @return + */ + private static String formatSysTime(SimpleDateFormat format) { + + String str = format.format(Calendar.getInstance().getTime()); + return str; + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/WebUtils.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/WebUtils.java new file mode 100644 index 0000000..bbeea33 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/WebUtils.java @@ -0,0 +1,43 @@ +package com.hc.core.utils.wx; + +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.httpclient.methods.PostMethod; +import org.apache.commons.httpclient.methods.RequestEntity; +import org.apache.commons.httpclient.methods.StringRequestEntity; + +import java.io.BufferedInputStream; +import java.util.HashMap; +import java.util.Map; + +/** + * @author zdx + */ +public class WebUtils { + + public static Map getMwebUrl(String url, String xmlParam){ + String jsonStr = null; + HttpClient httpClient = new HttpClient(); + Map map = new HashMap(); + try { + PostMethod method = null; + RequestEntity reqEntity = new StringRequestEntity(xmlParam,"text/json","UTF-8"); + method = new PostMethod(url); + method.setRequestEntity(reqEntity); + method.addRequestHeader("Content-Type","application/json;charset=utf-8"); + httpClient.executeMethod(method); + StringBuffer resBodyBuf = new StringBuffer(); + byte[] responseBody = new byte[1024]; + int readCount = 0; + BufferedInputStream is = new BufferedInputStream(method.getResponseBodyAsStream()); + while((readCount = is.read(responseBody,0,responseBody.length))!=-1){ + resBodyBuf.append(new String(responseBody,0,readCount,"utf-8")); + } + jsonStr = resBodyBuf.toString(); + map = XMLUtils.parseXmlToList(jsonStr); + } catch (Exception e) { + e.printStackTrace(); + } + return map; + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/XMLUtils.java b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/XMLUtils.java new file mode 100644 index 0000000..4a2b78d --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/java/com/hc/core/utils/wx/XMLUtils.java @@ -0,0 +1,51 @@ +package com.hc.core.utils.wx; + +import org.jdom2.Document; +import org.jdom2.Element; +import org.jdom2.input.SAXBuilder; +import org.xml.sax.InputSource; + +import java.io.StringReader; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author zdx + */ +public class XMLUtils { + + /** + * description: 解析微信通知xml + * + * @param xml + * @return + * @author ex_yangxiaoyi + * @see + */ + @SuppressWarnings({ "unused", "rawtypes", "unchecked" }) + public static Map parseXmlToList(String xml) { + Map retMap = new HashMap(); + try { + StringReader read = new StringReader(xml); + // 创建新的输入源SAX 解析器将使用 InputSource 对象来确定如何读取 XML 输入 + InputSource source = new InputSource(read); + // 创建一个新的SAXBuilder + SAXBuilder sb = new SAXBuilder(); + // 通过输入源构造一个Document + Document doc = (Document) sb.build(source); + Element root = doc.getRootElement();// 指向根节点 + List es = root.getChildren(); + if (es != null && es.size() != 0) { + for (Element element : es) { + retMap.put(element.getName(), element.getValue()); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return retMap; + + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-core/src/main/resources/application.properties b/JAVA_MYSQL_ZC/jxjy-core/src/main/resources/application.properties new file mode 100644 index 0000000..6e8c135 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-core/src/main/resources/application.properties @@ -0,0 +1,15 @@ +oss.access-key=IbM95nqve70SCvl0AYWPfmflAEVUvJx8o3S76NJ0 +oss.secret-key=1WucYYYpPx0u6Yx5cGnBcWPIv23y5okGiahefqKg +oss.bucket=guopei-cmtrain +oss.file-domain=http://cmtrain-qn.cfefe.com + + +hc.pay.aliPay.appId=2018122562638745 +hc.pay.aliPay.privateKey=MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQClKb9yCfdJBTy02jFksfEwBur/68NpgcJFSYBFMChGUs0HM+th8vTZYBRn8Dqf2IirbcQ09pDKbsdRhnXTxK8UUnQGufxDZh/mQWAGih34D8sD+6MGukAHD8CzsxEWUzB6W8K6xy5jh6N0ZL1T1u+a/3WE3PBYfYKjQOtpcrM2K6PDzquOXZZhCL6fN1wyIS2tnO3hPD7oAXgrl182of7TBnaK85qM8v96rs8cLfseNgBmx6pmIh9K6cE3dpDiqxovzg0/w1fZKJOKcmXpwb7wFAgrE02LPcAwWxwWNFdoXwte/tTuldKIxvt/FyOjWnUXe7D4Z7g9IRToFSVieio5AgMBAAECggEAO9AwquX9Dg69e2mBdcwTYqc+t8v0CuOZLWp+74+PJliaM7+TwPcxwP9QpIuVT4olhJ/N7LhWm1kfCeE+DqEuHpf1uPHl76quZr7KPdQLImjlxt18ntUYlvYXfXyd9Y3PAqD0lpvHqvfWNDK/dfti7qkRMDqrOADMLL84Agot6LG0EqB441LVHxA8sQ6eznhrOcxpBN6ckYmDLfkYJenvihfFGcCVofSTwRZODSlw6HjPA4hp4EDmqU+dpcBMjpLJYR8/7eTVfC3hzyVq+hKjm+nSMp2rIiSDWmIejgzI1KUig4sq0Hm80K9s+3+SGVhbNb61G2IDr3aAvkbODBNIYQKBgQDX3cHr+8bQ/E2lyUGNTxTVHSAebYCh3YSvpHDOScEtnN0USsyJyECmiqU0DVrTQ4aWM32snfN14zHk7iXWX0SCjK3o2a7XmkiYpVGhDaiYF7CTJWrllbQrgSkQp3CgrFf+CZKQ8bhr2ZvGRJbDz/8Y18a6sLEQTeDbXWCwi0ZgFQKBgQDD3sCf3QRPoXbSqxTlPul3dCq37KD0uzU4R1Yhy3uxC/kzHrf+5oqivZQ3xAnn3xFF3mLZYdAOiM6sfRx/lu5OE4LYpUdwrlMtTHfgiuzjd/dFK3REqy5bP7cBybiSq+nPFwRvAcyKA+ybuxExwjOuwyYJFx7L0K5DdOvv7GTGlQKBgFL+eqltMuJ0rrHX7/ERf5P0T74DIdqZ3YLeOVTGvJP55HIB1CQBLwIY+i1KGSpyotMq1t3AGLOxdyRqf3etRxzeU5rb3sIcGl896GWAZ9qZ+RSJ5VCBvzSewxgZGE9eE7KjIYvCs8Ibdy3Cfyin1o9Jnql2d40qNBKDE0KtOZCFAoGBALuCwD1KxRnGpY5AohxlAfSNjWfObLhdkDF0eYyY1K1FnSfHPLYV1pq9iutoDWOhNVQB9ffNn/SKG/EdRO8Qesrb+uOUNrQ07wPqtMiNtwJ8kofxdblXd2V7taNMjho74fWTP3dV7Y4i+5yKlYdhN0ETKZKCQ8Uy3eFOSaDCWieRAoGBAK15upK43O6MUi1OrRD4TGfbYNQSdZ0ZFD/s3R9t7IwAuZCLdyKdT7f+UwbGQnDjmaaR7mzPuaDmAX9xgW7MYvAZqRaKXUQArtsWzPIkDXIdkCz3MtdXe5cVHtCDdFf0e+VVRMQYGOwcTu3g2cEXXAUMfGQFvJdRbspkm8wUZfaq +hc.pay.aliPay.publicKey=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApSm/cgn3SQU8tNoxZLHxMAbq/+vDaYHCRUmARTAoRlLNBzPrYfL02WAUZ/A6n9iIq23ENPaQym7HUYZ108SvFFJ0Brn8Q2Yf5kFgBood+A/LA/ujBrpABw/As7MRFlMwelvCuscuY4ejdGS9U9bvmv91hNzwWH2Co0DraXKzNiujw86rjl2WYQi+nzdcMiEtrZzt4Tw+6AF4K5dfNqH+0wZ2ivOajPL/eq7PHC37HjYAZseqZiIfSunBN3aQ4qsaL84NP8NX2SiTinJl6cG+8BQIKxNNiz3AMFscFjRXaF8LXv7U7pXSiMb7fxcjo1p1F3uw+Ge4PSEU6BUlYnoqOQIDAQAB +hc.pay.aliPay.signType=RSA2 +hc.pay.aliPay.charset=utf-8 +hc.pay.aliPay.gatewayUrl=https://openapi.alipay.com/gateway.do +hc.pay.aliPay.notifyUrl=http://zgcj.cfefe.com/new/api/front/ali/notify +hc.pay.aliPay.returnUrl=http://zgcj.cfefe.com/#/index +hc.pay.aliPay.key=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1hUXWi3QFJ9v3ZKFj91bAxEjiNMltVwLxI0OOnGpj2pBHEW3h2uwrQu/ZegAgcUWqgD0oJBv8jdNUlEEVQvYaM0tPDL8qnY0fK5ieFUwvNMn32mxlCq7LMlm6eM2AfZSPEw2C7pWwMythqkYU6H4aomcTYHBPMRfxMbqe1tpiF3JCcVVdvsPXL21TS8eSA49yT5RIDibGYSqAzC4TvhzIh8uJo9j67hMIKWLsHLwxXvBeBQtqluV9dFSEJ/VvfzCLXjDSojR54C4aSnFXkNYHF6DO7BgTkzNZgUWFqm0WPP6zJ2MYVTYI3wED/Bo7WIfgm0szpF5o32BocuENcR+FQIDAQAB diff --git a/JAVA_MYSQL_ZC/jxjy-education.iml b/JAVA_MYSQL_ZC/jxjy-education.iml new file mode 100644 index 0000000..01614a9 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-education.iml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/jxjy-web.iml b/JAVA_MYSQL_ZC/jxjy-web/jxjy-web.iml new file mode 100644 index 0000000..b67c4e0 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/jxjy-web.iml @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/pom.xml b/JAVA_MYSQL_ZC/jxjy-web/pom.xml new file mode 100644 index 0000000..719b73b --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/pom.xml @@ -0,0 +1,87 @@ + + + 4.0.0 + + com.hc + jxjy-education + 0.0.1-SNAPSHOT + + + jxjy-web + 0.0.1-SNAPSHOT + jxjy-web + war + Demo project for Spring Boot + + + 11 + + + + + + com.hc + jxjy-core + 0.0.1-SNAPSHOT + + + + com.hc + jxjy-business + 0.0.1-SNAPSHOT + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-aop + + + + org.springframework.boot + spring-boot-starter-tomcat + provided + + + + com.alibaba + druid + 1.1.14 + + + + mysql + mysql-connector-java + runtime + + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/JxjyWebApplication.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/JxjyWebApplication.java new file mode 100644 index 0000000..b53a913 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/JxjyWebApplication.java @@ -0,0 +1,23 @@ +package com.hc.web; + +import com.spring4all.swagger.EnableSwagger2Doc; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.scheduling.annotation.EnableScheduling; +import tk.mybatis.spring.annotation.MapperScan; + +/** + * @author 10696 + */ +@SpringBootApplication +@ComponentScan("com.hc") +@MapperScan("com.hc.business.mapper") +@EnableSwagger2Doc +public class JxjyWebApplication { + + public static void main(String[] args) { + SpringApplication.run(JxjyWebApplication.class, args); + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/ServletInitializer.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/ServletInitializer.java new file mode 100644 index 0000000..41e32ab --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/ServletInitializer.java @@ -0,0 +1,13 @@ +package com.hc.web; + +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; + +public class ServletInitializer extends SpringBootServletInitializer { + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(JxjyWebApplication.class); + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/aspect/AppUserAspect.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/aspect/AppUserAspect.java new file mode 100644 index 0000000..58bf0ee --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/aspect/AppUserAspect.java @@ -0,0 +1,81 @@ +package com.hc.web.aspect; + +import com.hc.core.utils.exception.ResponseException; +import com.hc.core.utils.redis.RedisUtil; +import com.hc.core.utils.tool.Verification; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.util.Objects; + +/** + * @author 10696 + * @since 2020/12/22 9:01 + */ + +@Aspect +@Component +@Slf4j +public class AppUserAspect { + + private final RedisUtil redisUtil; + + public AppUserAspect(RedisUtil redisUtil) { + this.redisUtil = redisUtil; + } + + @Pointcut("execution (public * com.hc.web.controller.browser.app.*.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.app.AppUserController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.app.AppNewsTagController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.app.AppUserTeacherController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.app.AppClassConfigController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.app.AppClassCourseController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.app.AppBannerController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.app.AppUserController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.app.AppCourseController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.app.AppCourseTypeController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.app.AppNewsController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.app.AppAreaDistrictController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.app.AppWxPayJsApiController.*(..))" + ) + + public void verify() { + + } + + @Before("verify()") + public void doVerify() { + + //获取请求信息 + + ServletRequestAttributes attributes = + (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletRequest request = Objects.requireNonNull(attributes).getRequest(); + + //从请求头中获取token + String token = request.getHeader("token"); + + if (!Objects.isNull(token)) { + + //身份识别 已取消 + + //获取redis中的token 查看token是否过期 + if (Verification.verificationString((String) redisUtil.get(token))) { + log.info("app 请求-token正常"); + } else { + log.info("app 请求-redis中的token已过期,请重新登录"); + throw new ResponseException(-1, "front token is expired"); + } + + } else { + log.info("app request-token is null"); + throw new ResponseException(-1, "app request-token is null"); + } + } +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/aspect/BackUserAspect.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/aspect/BackUserAspect.java new file mode 100644 index 0000000..7f3e747 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/aspect/BackUserAspect.java @@ -0,0 +1,70 @@ +package com.hc.web.aspect; + +import com.hc.core.utils.exception.ResponseException; +import com.hc.core.utils.redis.RedisUtil; +import com.hc.core.utils.tool.Verification; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.util.Objects; + +/** + * @author JIA + */ + +@Aspect +@Component +@Slf4j +public class BackUserAspect { + + private final RedisUtil redisUtil; + + public BackUserAspect(RedisUtil redisUtil) { + this.redisUtil = redisUtil; + } + + + @Pointcut(" execution (public * com.hc.web.controller.browser.back.*.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.back.BackUserAdminController.*(..))" + ) + + public void verify() { + + } + + @Before("verify()") + public void doVerify() { + + //获取请求信息 + ServletRequestAttributes attributes = + (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletRequest request = Objects.requireNonNull(attributes).getRequest(); + + //从请求头中获取token + String token = request.getHeader("token"); + + if (!Objects.isNull(token)) { + + //身份识别 已取消 + + //获取redis中的token 查看token是否过期 + if (Verification.verificationString((String) redisUtil.get(token))) { + log.info("back 请求-token正常"); + } else { + log.info("back 请求-redis中的token已过期,请重新登录"); + throw new ResponseException(-1, "Back request-token is expired"); + } + + } else { + log.info("Back request-token is null"); + throw new ResponseException(-1, "Back request-token is null"); + } + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/aspect/FrontUserAspect.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/aspect/FrontUserAspect.java new file mode 100644 index 0000000..4049fba --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/aspect/FrontUserAspect.java @@ -0,0 +1,83 @@ +package com.hc.web.aspect; + +import com.hc.core.utils.exception.ResponseException; +import com.hc.core.utils.redis.RedisUtil; +import com.hc.core.utils.tool.Verification; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.util.Objects; + +/** + * @author JIA + */ + +@Aspect +@Component +@Slf4j +public class FrontUserAspect { + + private final RedisUtil redisUtil; + + public FrontUserAspect(RedisUtil redisUtil) { + this.redisUtil = redisUtil; + } + + + @Pointcut("execution (public * com.hc.web.controller.browser.front.*.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.front.FrontUserController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.front.FrontNewsTagController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.front.FrontUserTeacherController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.front.FrontClassConfigController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.front.FrontBannerController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.front.FrontUserController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.front.FrontCourseController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.front.FrontCourseTypeController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.front.FrontNewsController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.front.FrontAliPayController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.front.FrontAreaDistrictController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.front.FrontClassConfigController.*(..))" + + "&& ! execution (public * com.hc.web.controller.browser.front.FrontClassCourseController.*(..))" + ) + + public void verify() { + + } + + @Before("verify()") + public void doVerify() { + + //获取请求信息 + + ServletRequestAttributes attributes = + (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletRequest request = Objects.requireNonNull(attributes).getRequest(); + + //从请求头中获取token + String token = request.getHeader("token"); + + if (!Objects.isNull(token)) { + + //身份识别 已取消 + + //获取redis中的token 查看token是否过期 + if (Verification.verificationString((String) redisUtil.get(token))) { + log.info("front 请求-token正常"); + } else { + log.info("front 请求-redis中的token已过期,请重新登录"); + throw new ResponseException(-1, "front token is expired"); + } + + } else { + log.info("front request-token is null"); + throw new ResponseException(-1, "front request-token is null"); + } + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/CrossConfig.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/CrossConfig.java new file mode 100644 index 0000000..eee8a16 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/CrossConfig.java @@ -0,0 +1,36 @@ +package com.hc.web.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; + +import java.util.Collections; + +/** + * @author JIA + * 跨域 配置 + */ + +@Configuration +public class CrossConfig { + + @Bean + public CorsFilter corsFilter() { + final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + final CorsConfiguration configuration = new CorsConfiguration(); + + configuration.setAllowCredentials(true); + configuration.setAllowedOrigins(Collections.singletonList("*")); + configuration.setAllowedHeaders(Collections.singletonList("*")); + configuration.setAllowedMethods(Collections.singletonList("*")); + configuration.setMaxAge(300L); + + source.registerCorsConfiguration("/**", configuration); + return new CorsFilter(source); + + } + + +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/RedisTemplateSerializer.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/RedisTemplateSerializer.java new file mode 100644 index 0000000..d786f22 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/RedisTemplateSerializer.java @@ -0,0 +1,26 @@ +package com.hc.web.config; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; + +/** + * @author jia + */ +@Configuration +public class RedisTemplateSerializer { + + private RedisTemplate redisTemplate; + + @Autowired(required = false) + public void setRedisTemplate(RedisTemplate redisTemplate) { + RedisSerializer stringSerializer = new StringRedisSerializer(); + redisTemplate.setKeySerializer(stringSerializer); + redisTemplate.setValueSerializer(stringSerializer); + redisTemplate.setHashKeySerializer(stringSerializer); + redisTemplate.setHashValueSerializer(stringSerializer); + this.redisTemplate = redisTemplate; + } +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/Swagger3config.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/Swagger3config.java new file mode 100644 index 0000000..1522a00 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/Swagger3config.java @@ -0,0 +1,85 @@ +package com.hc.web.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; + +/** + * @author 10696 + * 已将最新版本回退到最低版本 + */ +@Configuration +public class Swagger3config { + + @Bean + public Docket createRestApiFront() { + return new Docket(DocumentationType.SWAGGER_12) + .apiInfo(apiInfo()) + .groupName("front-api") + .select() + .apis(RequestHandlerSelectors.basePackage("com.hc.web.controller.browser.front")) + .paths(PathSelectors.any()) + .build(); + } + + @Bean + public Docket createRestApiBack() { + return new Docket(DocumentationType.SWAGGER_12) + .apiInfo(apiInfo()) + .groupName("back-api") + .select() + .apis(RequestHandlerSelectors.basePackage("com.hc.web.controller.browser.back")) + .paths(PathSelectors.any()) + .build(); + } + + @Bean + public Docket createRestApiApp() { + return new Docket(DocumentationType.SWAGGER_12) + .apiInfo(apiInfo()) + .groupName("app-api") + .select() + .apis(RequestHandlerSelectors.basePackage("com.hc.web.controller.browser.app")) + .paths(PathSelectors.any()) + .build(); + } + + @Bean + public Docket createRestApiCommon() { + return new Docket(DocumentationType.SWAGGER_12) + .apiInfo(apiInfo()) + .groupName("common-api") + .select() + .apis(RequestHandlerSelectors.basePackage("com.hc.web.controller.browser.common")) + .paths(PathSelectors.any()) + .build(); + } + + @Bean + public Docket createRestApiThird() { + return new Docket(DocumentationType.SWAGGER_12) + .apiInfo(apiInfo()) + .groupName("third-api") + .select() + .apis(RequestHandlerSelectors.basePackage("com.hc.web.controller.browser.third")) + .paths(PathSelectors.any()) + .build(); + } + + private ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("Swagger一接口文档") + .description("若请求体中出现主键字段,创建时间字段可主动去除") + .contact(new Contact("作者", "作者地址", "作者邮箱")) + .version("1.0") + .build(); + } + + +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/util/HttpRequest.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/util/HttpRequest.java new file mode 100644 index 0000000..9904cb8 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/util/HttpRequest.java @@ -0,0 +1,138 @@ +package com.hc.web.config.util; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.URL; +import java.net.URLConnection; +import java.util.List; +import java.util.Map; + +public class HttpRequest { + + /** + * 向指定URL发送GET方法的请求 + * + * @param url 发送请求的URL + * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。 + * @return URL 所代表远程资源的响应结果 + */ + + public static String sendGet(String url, String param) { + String result = ""; + BufferedReader in = null; + try { + String urlNameString = url + "?" + param; + System.out.println(urlNameString); + URL realUrl = new URL(urlNameString); +// 打开和URL之间的连接 + URLConnection connection = realUrl.openConnection(); +// 设置通用的请求属性 + connection.setRequestProperty("accept", "*/*"); + connection.setRequestProperty("connection", "Keep-Alive"); + connection.setRequestProperty("user-agent", + "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); +// 建立实际的连接 + connection.connect(); +// 获取所有响应头字段 + Map> map = connection.getHeaderFields(); +// 遍历所有的响应头字段 + for (String key : map.keySet()) { + System.out.println(key + "--->" + map.get(key)); + } + +// 定义 BufferedReader输入流来读取URL的响应 + + in = new BufferedReader(new InputStreamReader( + connection.getInputStream())); + String line; + + while ((line = in.readLine()) != null) { + result += line; + } + + } catch (Exception e) { + System.out.println("发送GET请求出现异常!" + e); + e.printStackTrace(); + } + +// 使用finally块来关闭输入流 + + finally { + try { + if (in != null) { + in.close(); + } + } catch (Exception e2) { + e2.printStackTrace(); + } + } + return result; + + } + + + /** + * 向指定 URL 发送POST方法的请求 + * + * @param url 发送请求的 URL + * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。 + * @return 所代表远程资源的响应结果 + */ + + public static String sendPost(String url, String param) { + PrintWriter out = null; + BufferedReader in = null; + String result = ""; + try { + URL realUrl = new URL(url); +// 打开和URL之间的连接 + + URLConnection conn = realUrl.openConnection(); + +// 设置通用的请求属性 + conn.setRequestProperty("accept", "*/*"); + conn.setRequestProperty("connection", "Keep-Alive"); + conn.setRequestProperty("user-agent", + "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); +// 发送POST请求必须设置如下两行 + conn.setDoOutput(true); + conn.setDoInput(true); +// 获取URLConnection对象对应的输出流 + out = new PrintWriter(conn.getOutputStream()); +// 发送请求参数 + out.print(param); +// flush输出流的缓冲 + out.flush(); +// 定义BufferedReader输入流来读取URL的响应 + in = new BufferedReader( + new InputStreamReader(conn.getInputStream())); + String line; + while ((line = in.readLine()) != null) { + result += line; + } + } catch (Exception e) { + System.out.println("发送 POST 请求出现异常!" + e); + e.printStackTrace(); + } + +//使用finally块来关闭输出流、输入流 + + finally { + try { + if (out != null) { + out.close(); + } + if (in != null) { + in.close(); + } + } catch (IOException ex) { + ex.printStackTrace(); + } + } + return result; + + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/util/HttpsUtil.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/util/HttpsUtil.java new file mode 100644 index 0000000..9166ab0 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/util/HttpsUtil.java @@ -0,0 +1,89 @@ +package com.hc.web.config.util; + +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.TrustManager; +import java.io.*; +import java.net.URL; +import java.nio.charset.StandardCharsets; + +/** + * @author 10696 + */ +public class HttpsUtil { + + /** + * 以https方式发送请求并将请求响应内容以String方式返回 + * + * @param path 请求路径 + * @param method 请求方法 + * @param body 请求数据体 + * @return 请求响应内容转换成字符串信息 + */ + public static String httpsRequestToString(String path, String method, String body) { + if (path == null || method == null) { + return null; + } + + String response = null; + InputStream inputStream = null; + InputStreamReader inputStreamReader = null; + BufferedReader bufferedReader = null; + HttpsURLConnection conn = null; + try { + // 创建SSLConrext对象,并使用我们指定的信任管理器初始化 + TrustManager[] tm = {new JEEWeiXinX509TrustManager()}; + SSLContext sslContext = SSLContext.getInstance("SSL", "SunJSSE"); + sslContext.init(null, tm, new java.security.SecureRandom()); + + // 从上述对象中的到SSLSocketFactory + SSLSocketFactory ssf = sslContext.getSocketFactory(); + + URL url = new URL(path); + conn = (HttpsURLConnection) url.openConnection(); + conn.setSSLSocketFactory(ssf); + + conn.setDoOutput(true); + conn.setDoInput(true); + conn.setUseCaches(false); + + //设置请求方式(git|post) + conn.setRequestMethod(method); + + //有数据提交时 + if (null != body) { + OutputStream outputStream = conn.getOutputStream(); + outputStream.write(body.getBytes("UTF-8")); + outputStream.close(); + } + + // 将返回的输入流转换成字符串 + inputStream = conn.getInputStream(); + inputStreamReader = new InputStreamReader(inputStream, StandardCharsets.UTF_8); + bufferedReader = new BufferedReader(inputStreamReader); + String str = null; + StringBuffer buffer = new StringBuffer(); + while ((str = bufferedReader.readLine()) != null) { + buffer.append(str); + } + + response = buffer.toString(); + } catch (Exception e) { + + } finally { + if (conn != null) { + conn.disconnect(); + } + try { + bufferedReader.close(); + inputStreamReader.close(); + inputStream.close(); + } catch (IOException execption) { + + } + } + return response; + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/util/JEEWeiXinX509TrustManager.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/util/JEEWeiXinX509TrustManager.java new file mode 100644 index 0000000..0fe4d31 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/config/util/JEEWeiXinX509TrustManager.java @@ -0,0 +1,24 @@ +package com.hc.web.config.util; + +import javax.net.ssl.X509TrustManager; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; + +public class JEEWeiXinX509TrustManager implements X509TrustManager { + + @Override + public void checkClientTrusted(X509Certificate[] chain, String authType) + throws CertificateException { + } + + @Override + public void checkServerTrusted(X509Certificate[] chain, String authType) + throws CertificateException { + } + + @Override + public X509Certificate[] getAcceptedIssuers() { + return null; + } +} + diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppAreaDistrictController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppAreaDistrictController.java new file mode 100644 index 0000000..171d522 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppAreaDistrictController.java @@ -0,0 +1,41 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.service.AreaDistrictService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +/** + * (AreaDistrict)表控制层 + * + * @author java + * @since 2020-11-20 16:06:50 + */ + +@RestController +@RequestMapping("/new//api/app/areaDistrict") +public class AppAreaDistrictController { + + /** + * 服务对象 + */ + private final AreaDistrictService areaDistrictService; + + public AppAreaDistrictController(AreaDistrictService areaDistrictService) { + this.areaDistrictService = areaDistrictService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 AreaDistrict", response = Result.class) + public Result selectAppAreaDistrict(@PathVariable("id") Integer id) { + return Result.success(areaDistrictService.queryById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 AreaDistrict列表(分页)", response = Result.class) + public Result listAppAreaDistrict(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(areaDistrictService.queryAllByLimit(page, size)); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppBannerController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppBannerController.java new file mode 100644 index 0000000..4af7675 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppBannerController.java @@ -0,0 +1,44 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.service.BannerService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + + +/** + * 广告表 + * (Banner)表控制层 + * + * @author java + * @since 2020-11-26 09:29:54 + */ + +@RestController +@RequestMapping("/new/api/app/banner") +public class AppBannerController { + + /** + * 服务对象 + */ + private final BannerService bannerService; + + public AppBannerController(BannerService bannerService) { + this.bannerService = bannerService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 Banner", response = Result.class) + public Result selectAppDetail(@PathVariable("id") Integer id) { + return Result.success(this.bannerService.queryById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 Banner列表(分页)", response = Result.class) + public Result listAppBanner(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(bannerService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppClassConfigController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppClassConfigController.java new file mode 100644 index 0000000..865bf5e --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppClassConfigController.java @@ -0,0 +1,67 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.service.ClassConfigService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + + +/** + * 班次表(ClassConfig)表控制层 + * + * @author java + * @since 2020-11-19 16:12:35 + */ + +@RestController +@RequestMapping("/new/api/app/classConfig") +public class AppClassConfigController { + + /** + * 服务对象 + */ + private final ClassConfigService classConfigService; + + public AppClassConfigController(ClassConfigService classConfigService) { + this.classConfigService = classConfigService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 ClassConfig", response = Result.class) + public Result selectAppDetail(@PathVariable("id") Integer id) { + return Result.success(this.classConfigService.queryById(id)); + } + + @GetMapping("/valid/list") + @ApiOperation(value = "获取 ClassConfig列表(分页)", response = Result.class) + public Result listAppClassConfigByValid(@ApiParam(value = "是否有效") @RequestParam Integer valid, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(classConfigService.queryByValid(valid, page, size)); + } + + @GetMapping("/area/list") + @ApiOperation(value = "获取 ClassConfig列表(分页) 地区id", response = Result.class) + public Result listAppClassConfigByAreaId(@ApiParam(value = "地区id") @RequestParam Integer areaId, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(classConfigService.queryByAreaId(areaId, page, size)); + } + + @GetMapping("/time/list") + @ApiOperation(value = "获取 ClassConfig列表(分页) 学习时间", response = Result.class) + public Result listAppByStudyStartTime(@ApiParam(value = "学习开始时间") @RequestParam Long studyStartTime, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(classConfigService.queryByTime(studyStartTime, page, size)); + } + + @GetMapping("/list/name") + @ApiOperation(value = "依据名称 获取 ClassConfig列表", response = Result.class) + public Result listFrontClassConfigByName(@ApiParam(value = "培训班名称") @RequestParam String name) { + return Result.success(classConfigService.queryByClassName(name)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppClassCourseController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppClassCourseController.java new file mode 100644 index 0000000..4a07161 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppClassCourseController.java @@ -0,0 +1,51 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.service.ClassCourseService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + + +/** + * 班次课程表(ClassCourse)表控制层 + * + * @author java + * @since 2020-11-24 11:30:12 + */ + +@RestController +@RequestMapping("/new/api/app/classCourse") +public class AppClassCourseController { + + /** + * 服务对象 + */ + private final ClassCourseService classCourseService; + + public AppClassCourseController(ClassCourseService classCourseService) { + this.classCourseService = classCourseService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 ClassCourse", response = Result.class) + public Result selectAppDetail(@PathVariable("id") Integer id) { + return Result.success(this.classCourseService.queryById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 ClassCourse列表(分页)", response = Result.class) + public Result listAppClassCourse(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(classCourseService.queryAllByLimit(page, size)); + } + + @GetMapping("/course") + @ApiOperation(value = "获取班级 必修/选修课程", response = Result.class) + public Result listAppClassCourseByParam(@ApiParam(value = "班次id") @RequestParam Integer classId, + @ApiParam(value = "课程类别") @RequestParam(required = false) Integer courseType, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(classCourseService.queryByClassId(classId, courseType, page, size)); + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppCourseController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppCourseController.java new file mode 100644 index 0000000..537963d --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppCourseController.java @@ -0,0 +1,101 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.model.UserVideoPosition; +import com.hc.business.service.CourseService; +import com.hc.business.service.UserVideoPositionService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +/** + * 课程表(Course)表控制层 + * + * @author java + * @since 2020-11-09 10:04:46 + */ + +@RestController +@RequestMapping("/new/api/app/course") +public class AppCourseController { + + /** + * 服务对象 + */ + private final CourseService courseService; + private final UserVideoPositionService userVideoPositionService; + + public AppCourseController(CourseService courseServices, + UserVideoPositionService userVideoPositionService) { + this.courseService = courseServices; + this.userVideoPositionService = userVideoPositionService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 Course", response = Result.class) + public Result selectAppDetail(@PathVariable("id") Integer id) { + return Result.success(this.courseService.queryById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 Course列表(分页)", response = Result.class) + public Result listAppCourse(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size, + @RequestParam(required = false) Integer valid) { + return Result.success(courseService.queryAllByLimit(page, size, valid)); + } + + @GetMapping("/list/video") + @ApiOperation(value = "获取 课程下得video list", response = Result.class) + public Result queryAllVideos(@ApiParam(value = "课程id") @RequestParam Integer courseId) { + + return Result.success(courseService.getAllVideos(courseId)); + } + + @GetMapping("/list/teacher") + @ApiOperation(value = "依据老师名称获取 Course列表(分页)", response = Result.class) + public Result queryTeacherName(@ApiParam(value = "老师名称") @RequestParam String name) { + return Result.success(courseService.queryTeacherName(name)); + } + + @GetMapping("/list/name") + @ApiOperation(value = "依据课程名称获取 Course列表(分页)", response = Result.class) + public Result queryCourseName(@ApiParam(value = "课程名称") @RequestParam String name) { + return Result.success(courseService.queryCourseName(name)); + } + + @GetMapping("/list/type") + @ApiOperation(value = "获取 type分类下的 Course列表(分页)", response = Result.class) + public Result queryAllByLimitAndTypeId(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size, + @ApiParam(value = "课程类别id") @RequestParam Integer typeId) { + return Result.success(courseService.queryAllByLimitAndTypeId(page, size, typeId)); + } + + + @PostMapping("/position") + @ApiOperation(value = "添加一个视频播放记录redis", response = Result.class) + public Result insertAppPosition(@RequestBody UserVideoPosition userVideoPosition, + @RequestParam Integer courseId) { + return Result.success(userVideoPositionService.insertPositionToRedis(userVideoPosition, courseId)); + } + + + @PostMapping("/flush") + @ApiOperation(value = "添加一个视频播放记录dataBase", response = Result.class) + public Result insertAppPositionData(@RequestParam Integer courseId, + @RequestParam Integer videoId, + @RequestParam Integer userId, + @RequestParam String years, + @RequestParam Integer classId) { + return Result.success(userVideoPositionService.flushToDb(userId, videoId, courseId, years, classId)); + } + + @GetMapping("/getCourseVideoPosition") + @ApiOperation(value = "获取一个课程下所有的视频以及某个用户的播放进度", response = Result.class) + public Result getAppCourseChapterAndVideoPosition(@RequestParam Integer courseId, + @RequestParam Integer userId, + @RequestParam Integer classId) { + return Result.success(courseService.getCourseChapterAndVideoPosition(courseId, userId, classId)); + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppCourseTypeController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppCourseTypeController.java new file mode 100644 index 0000000..6bc28b1 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppCourseTypeController.java @@ -0,0 +1,43 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.service.CourseTypeService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + + +/** + * (CourseType)表控制层 + * + * @author java + * @since 2020-12-17 14:12:55 + */ + +@RestController +@RequestMapping("/new/api/app/courseType") +public class AppCourseTypeController { + + /** + * 服务对象 + */ + private final CourseTypeService courseTypeService; + + public AppCourseTypeController(CourseTypeService courseTypeService) { + this.courseTypeService = courseTypeService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 CourseType", response = Result.class) + public Result selectAppCourseType(@PathVariable("id") Integer id) { + return Result.success(this.courseTypeService.queryById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 CourseType列表(分页)", response = Result.class) + public Result listAppCourseType(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(courseTypeService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppNewsController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppNewsController.java new file mode 100644 index 0000000..5a551c5 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppNewsController.java @@ -0,0 +1,53 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.service.NewsService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + + +/** + * 新闻表 + * (News)表控制层 + * + * @author java + * @since 2020-11-20 11:48:39 + */ + +@RestController +@RequestMapping("/new/api/app/news") +public class AppNewsController { + + /** + * 服务对象 + */ + private final NewsService newsService; + + public AppNewsController(NewsService newsService) { + this.newsService = newsService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 News", response = Result.class) + public Result selectAppDetail(@PathVariable("id") Integer id) { + return Result.success(this.newsService.queryById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 News列表(分页)", response = Result.class) + public Result listBackNews(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(newsService.queryAllByLimit(page, size)); + } + + @GetMapping("/tag/{tagId}") + @ApiOperation(value = "依据tagId获取 News", response = Result.class) + public Result selectAppByTagId(@ApiParam(value = "新闻标签id") @PathVariable("tagId") Integer tagId, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(this.newsService.queryListByTagId(tagId, page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppNewsTagController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppNewsTagController.java new file mode 100644 index 0000000..4e5e0ba --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppNewsTagController.java @@ -0,0 +1,38 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.service.NewsTagService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 新闻标签表(NewsTag)表控制层 + * + * @author java + * @since 2020-11-20 12:52:34 + */ + +@RestController +@RequestMapping("/new/api/app/newsTag") +public class AppNewsTagController { + + /** + * 服务对象 + */ + private final NewsTagService newsTagService; + + public AppNewsTagController(NewsTagService newsTagService) { + this.newsTagService = newsTagService; + } + + @GetMapping("/list") + @ApiOperation(value = "获取 NewsTag列表", response = Result.class) + public Result listAppNewsTag() { + return Result.success(newsTagService.queryAll()); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppOrderUserLogController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppOrderUserLogController.java new file mode 100644 index 0000000..c58f725 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppOrderUserLogController.java @@ -0,0 +1,51 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.model.OrderUserLog; +import com.hc.business.service.OrderUserLogService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * (OrderUserLog)表控制层 + * + * @author java + * @since 2020-12-03 09:25:12 + */ + +@RestController +@RequestMapping("/new/api/app/orderUserLog") +public class AppOrderUserLogController { + + /** + * 服务对象 + */ + private final OrderUserLogService orderUserLogService; + + public AppOrderUserLogController(OrderUserLogService orderUserLogService) { + this.orderUserLogService = orderUserLogService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 OrderUserLog", response = Result.class) + public Result selectAppOrderUserLog(@PathVariable("id") Integer id) { + return Result.success(this.orderUserLogService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 OrderUserLog", response = Result.class) + public Result addAppOrderUserLog(@Valid @RequestBody OrderUserLog orderUserLog) { + return Result.success(orderUserLogService.insert(orderUserLog)); + } + + @GetMapping("/order/{orderId}") + @ApiOperation(value = "依据订单id 获取 OrderUserLog", response = Result.class) + public Result selectOrderUserLogByOrderId(@ApiParam(value = "订单id") @PathVariable("orderId") Integer orderId) { + return Result.success(orderUserLogService.queryListByOrderId(orderId)); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppOrdersController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppOrdersController.java new file mode 100644 index 0000000..f4c4110 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppOrdersController.java @@ -0,0 +1,71 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.model.Orders; +import com.hc.business.service.OrdersService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 订单表(Orders)表控制层 + * + * @author java + * @since 2020-11-26 16:46:48 + */ + +@RestController +@RequestMapping("/new/api/app/orders") +public class AppOrdersController { + + /** + * 服务对象 + */ + private final OrdersService ordersService; + + public AppOrdersController(OrdersService ordersService) { + this.ordersService = ordersService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 Orders", response = Result.class) + public Result selectAppDetail(@PathVariable("id") Integer id) { + return Result.success(this.ordersService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 Orders", response = Result.class) + public Result addAppOrders(@Valid @RequestBody Orders orders) { + return Result.success(ordersService.insert(orders)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 Orders", response = Result.class) + public Result deleteAppOrders(@PathVariable("id") Integer id) { + return Result.success(ordersService.deleteById(id)); + } + + @GetMapping("/list/userInvoices") + @ApiOperation(value = "获取 发票 Orders列表(分页)", response = Result.class) + public Result listAppOrdersByUserInvoicesId(@ApiParam(value = "发票id") @RequestParam Integer userInvoicesId) { + return Result.success(ordersService.queryByUserInvoicesId(userInvoicesId)); + } + + @GetMapping("/list/user") + @ApiOperation(value = "获取 用户 Orders列表(分页)", response = Result.class) + public Result listAppOrdersByUserId(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size, + @ApiParam(value = "用户id") @RequestParam Integer userId) { + return Result.success(ordersService.queryAllByUserId(page, size, userId)); + } + + @GetMapping("/create/no") + @ApiOperation(value = "创建一条订单编号", response = Result.class) + public Result createOrderNo() { + return Result.success(ordersService.createOrderNo()); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppPaperController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppPaperController.java new file mode 100644 index 0000000..3f7539e --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppPaperController.java @@ -0,0 +1,43 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.service.PaperService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + + +/** + * 试卷表(Paper)表控制层 + * + * @author java + * @since 2020-12-07 11:34:40 + */ + +@RestController +@RequestMapping("/new/api/app/paper") +public class AppPaperController { + + /** + * 服务对象 + */ + private final PaperService paperService; + + public AppPaperController(PaperService paperService) { + this.paperService = paperService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 Paper", response = Result.class) + public Result selectAppPaper(@PathVariable("id") Integer id) { + return Result.success(this.paperService.queryById(id)); + } + + @GetMapping("/detail") + @ApiOperation(value = "前台用户获取 Paper", response = Result.class) + public Result selectAppPaperDetail(@ApiParam(value = "试卷id") @RequestParam Integer paperId) { + return Result.success(paperService.queryQuestionList(paperId)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppPaperQuestionController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppPaperQuestionController.java new file mode 100644 index 0000000..6c53eb5 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppPaperQuestionController.java @@ -0,0 +1,38 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.service.PaperQuestionService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 随机试卷问题表(PaperQuestion)表控制层 + * + * @author java + * @since 2020-12-07 11:35:16 + */ + +@RestController +@RequestMapping("/new/api/app/paperQuestion") +public class AppPaperQuestionController { + + /** + * 服务对象 + */ + private final PaperQuestionService paperQuestionService; + + public AppPaperQuestionController(PaperQuestionService paperQuestionService) { + this.paperQuestionService = paperQuestionService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 PaperQuestion", response = Result.class) + public Result selectAppPaperQuestion(@PathVariable("id") Integer id) { + return Result.success(this.paperQuestionService.queryById(id)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppQuestionAnswerController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppQuestionAnswerController.java new file mode 100644 index 0000000..927d84b --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppQuestionAnswerController.java @@ -0,0 +1,39 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.service.QuestionAnswerService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 问题答案表(QuestionAnswer)表控制层 + * + * @author java + * @since 2020-12-07 11:36:23 + */ + +@RestController +@RequestMapping("/new/api/app/questionAnswer") +public class AppQuestionAnswerController { + + /** + * 服务对象 + */ + private final QuestionAnswerService questionAnswerService; + + public AppQuestionAnswerController(QuestionAnswerService questionAnswerService) { + this.questionAnswerService = questionAnswerService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 QuestionAnswer", response = Result.class) + public Result selectAppQuestionAnswer(@PathVariable("id") Integer id) { + return Result.success(this.questionAnswerService.queryById(id)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppQuestionController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppQuestionController.java new file mode 100644 index 0000000..24087ab --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppQuestionController.java @@ -0,0 +1,42 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.service.QuestionService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +/** + * 习题表(Question)表控制层 + * + * @author java + * @since 2020-12-07 11:35:59 + */ + +@RestController +@RequestMapping("/new/api/app/question") +public class AppQuestionController { + + /** + * 服务对象 + */ + private final QuestionService questionService; + + public AppQuestionController(QuestionService questionService) { + this.questionService = questionService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 Question", response = Result.class) + public Result selectAppQuestion(@PathVariable("id") Integer id) { + return Result.success(this.questionService.queryById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 Question列表(分页)", response = Result.class) + public Result listAppQuestion(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(questionService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppQuestionTagController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppQuestionTagController.java new file mode 100644 index 0000000..d6e3994 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppQuestionTagController.java @@ -0,0 +1,38 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.service.QuestionTagService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 问题标签表(QuestionTag)表控制层 + * + * @author java + * @since 2020-12-07 11:36:44 + */ + +@RestController +@RequestMapping("/new/api/app/questionTag") +public class AppQuestionTagController { + + /** + * 服务对象 + */ + private final QuestionTagService questionTagService; + + public AppQuestionTagController(QuestionTagService questionTagService) { + this.questionTagService = questionTagService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 QuestionTag", response = Result.class) + public Result selectAppQuestionTag(@PathVariable("id") Integer id) { + return Result.success(this.questionTagService.queryById(id)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppQuestionTypeController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppQuestionTypeController.java new file mode 100644 index 0000000..10a9e89 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppQuestionTypeController.java @@ -0,0 +1,43 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.service.QuestionTypeService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + + +/** + * 问题类型表(QuestionType)表控制层 + * + * @author java + * @since 2020-12-07 11:37:04 + */ + +@RestController +@RequestMapping("/new/api/app/questionType") +public class AppQuestionTypeController { + + /** + * 服务对象 + */ + private final QuestionTypeService questionTypeService; + + public AppQuestionTypeController(QuestionTypeService questionTypeService) { + this.questionTypeService = questionTypeService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 QuestionType", response = Result.class) + public Result selectAppQuestionType(@PathVariable("id") Integer id) { + return Result.success(this.questionTypeService.queryById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 QuestionType列表(分页)", response = Result.class) + public Result listAppQuestionType(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(questionTypeService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserAdviseController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserAdviseController.java new file mode 100644 index 0000000..6b667af --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserAdviseController.java @@ -0,0 +1,56 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.model.UserAdvise; +import com.hc.business.service.UserAdviseService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 用户建议表 + * (UserAdvise)表控制层 + * + * @author java + * @since 2020-11-16 14:20:06 + */ + +@RestController +@RequestMapping("/new/api/app/userAdvise") +public class AppUserAdviseController { + + /** + * 服务对象 + */ + private final UserAdviseService userAdviseService; + + public AppUserAdviseController(UserAdviseService userAdviseService) { + this.userAdviseService = userAdviseService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserAdvise", response = Result.class) + public Result selectAppUserAdvise(@PathVariable("id") Integer id) { + return Result.success(this.userAdviseService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 UserAdvise", response = Result.class) + public Result addAppUserAdvise(@Valid @RequestBody UserAdvise userAdvise) { + userAdvise.setAdviceType(2); + return Result.success(userAdviseService.insert(userAdvise)); + } + + @GetMapping("/user/{userId}") + @ApiOperation(value = "依据用户id获取 UserAdvise", response = Result.class) + public Result listAppUserAdviseById(@ApiParam(value = "用户id") + @PathVariable("userId") Integer userId, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(this.userAdviseService.queryAllByUserId(userId, page, size)); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserClassLogController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserClassLogController.java new file mode 100644 index 0000000..708134a --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserClassLogController.java @@ -0,0 +1,30 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.service.UserStatusService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author 10696 + * @since 2020/12/6 13:53 + */ + +@RestController +@RequestMapping("/new/api/app/userClassLog") +public class AppUserClassLogController { + + @Autowired + private UserStatusService userStatusService; + + @GetMapping("/{userId}") + @ApiOperation(value = "依据用户id查询 userClassLog ", response = Result.class) + public Result selectAppUserStatusLog(@PathVariable("userId") Integer userId) { + return Result.success(this.userStatusService.queryDtoByUserId(userId)); + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserController.java new file mode 100644 index 0000000..ea7f88a --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserController.java @@ -0,0 +1,91 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.dto.RetrievePasswordDto; +import com.hc.business.dto.SmsLoginDto; +import com.hc.business.model.User; +import com.hc.business.model.login.AuthEntity; +import com.hc.business.service.UserService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.apache.commons.lang3.StringUtils; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 用户表(User)表控制层 + * + * @author java + * @since 2020-11-09 10:04:14 + */ + +@RestController +@RequestMapping("/new/api/app/user") +public class AppUserController { + + /** + * 服务对象 + */ + private final UserService userService; + + public AppUserController(UserService userService) { + this.userService = userService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 User", response = Result.class) + public Result selectAppDetail(@PathVariable("id") Integer id) { + return Result.success(this.userService.queryById(id)); + } + + @PostMapping("/login") + @ApiOperation(value = "用户登录(账号,密码)", response = Result.class) + public Result userAppLogin(@RequestBody AuthEntity authEntity) { + return Result.success(userService.userLogin(authEntity)); + } + + @PostMapping("/login/sms") + @ApiOperation(value = "用户登录(短信登录)", response = Result.class) + public Result userAppLoginSms(@Valid @RequestBody SmsLoginDto smsLoginDto) { + return Result.success(userService.userLoginSms(smsLoginDto)); + } + + @PostMapping("/register") + @ApiOperation(value = "用户注册", response = Result.class) + public Result userAppRegister(@Valid @RequestBody RetrievePasswordDto retrievePasswordDto) { + return Result.success(userService.userRegister(retrievePasswordDto)); + } + + @PostMapping("/send") + @ApiOperation(value = "短信发送验证码", response = Result.class) + public Result sendAppAuthCode(@ApiParam(value = "手机号")@RequestParam String userMobile) { + return Result.success(userService.sendAuthCode(userMobile)); + } + + @GetMapping("/mobile") + @ApiOperation(value = "依据手机号查询用户", response = Result.class) + public Result queryAppByMobile(@ApiParam(value = "手机号") @RequestParam String userMobile) { + return Result.success(userService.queryByMobile(userMobile)); + } + + @PostMapping("/retrievePassword") + @ApiOperation(value = "找回密码", response = Result.class) + public Result retrieveAppPassword(@Valid @RequestBody RetrievePasswordDto retrievePasswordDto) { + return Result.success(userService.retrievePassword(retrievePasswordDto)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 User", response = Result.class) + public Result addAppUser(@Valid @RequestBody User user) { + return Result.success(userService.insert(user)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 User", response = Result.class) + public Result updateAppUser(@RequestBody User user) { + return Result.success(userService.update(user)); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserCourseController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserCourseController.java new file mode 100644 index 0000000..ea25734 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserCourseController.java @@ -0,0 +1,55 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.model.UserCourse; +import com.hc.business.service.UserCourseService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 用户课程表(UserCourse)表控制层 + * + * @author java + * @since 2020-11-09 10:05:20 + */ + +@RestController +@RequestMapping("/new/api/app/userCourse") +public class AppUserCourseController { + + /** + * 服务对象 + */ + private final UserCourseService userCourseService; + + public AppUserCourseController(UserCourseService userCourseService) { + this.userCourseService = userCourseService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserCourse", response = Result.class) + public Result selectAppUserCourse(@PathVariable("id") Integer id) { + return Result.success(this.userCourseService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 UserCourse", response = Result.class) + public Result addAppUserCourse(@Valid @RequestBody UserCourse userCourse) { + return Result.success(userCourseService.insert(userCourse)); + } + + @GetMapping("/list") + @ApiOperation(value = "根据用户id 获取 UserCourse列表(分页)", response = Result.class) + public Result listAppUserCourse(@ApiParam(value = "用户id") @RequestParam Integer userId, + @ApiParam(value = "班次id") @RequestParam Integer classId, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(userCourseService.queryAllByLimit(userId, classId, page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserInvoicesController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserInvoicesController.java new file mode 100644 index 0000000..583f586 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserInvoicesController.java @@ -0,0 +1,51 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.model.UserInvoices; +import com.hc.business.service.UserInvoicesService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 用户发票表(UserInvoices)表控制层 + * + * @author java + * @since 2020-12-02 10:50:41 + */ + +@RestController +@RequestMapping("/new/api/app/userInvoices") +public class AppUserInvoicesController { + + /** + * 服务对象 + */ + private final UserInvoicesService userInvoicesService; + + public AppUserInvoicesController(UserInvoicesService userInvoicesService) { + this.userInvoicesService = userInvoicesService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserInvoices", response = Result.class) + public Result selectAppUserInvoices(@PathVariable("id") Integer id) { + return Result.success(this.userInvoicesService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 UserInvoices", response = Result.class) + public Result addAppUserInvoices(@Valid @RequestBody UserInvoices userInvoices) { + return Result.success(userInvoicesService.insert(userInvoices)); + } + + @GetMapping("/user/{userId}") + @ApiOperation(value = "获取用户发票信息", response = Result.class) + public Result queryDetailByUserId(@ApiParam(value = "用户id") @PathVariable("userId") Integer userId) { + return Result.success(userInvoicesService.queryDetailByUserId(userId)); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserRefundHistoryController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserRefundHistoryController.java new file mode 100644 index 0000000..6a79f4e --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserRefundHistoryController.java @@ -0,0 +1,46 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.model.UserRefundHistory; +import com.hc.business.service.UserRefundHistoryService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 用户退款记录表(UserRefundHistory)表控制层 + * + * @author java + * @since 2020-12-10 11:31:45 + */ + +@RestController +@RequestMapping("/new/api/app/userRefundHistory") +public class AppUserRefundHistoryController { + + /** + * 服务对象 + */ + private final UserRefundHistoryService userRefundHistoryService; + + public AppUserRefundHistoryController(UserRefundHistoryService userRefundHistoryService) { + this.userRefundHistoryService = userRefundHistoryService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserRefundHistory", response = Result.class) + public Result selectAppUserRefundHistory(@PathVariable("id") Integer id) { + return Result.success(this.userRefundHistoryService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 UserRefundHistory", response = Result.class) + public Result addAppUserRefundHistory(@Valid @RequestBody UserRefundHistory userRefundHistory) { + return Result.success(userRefundHistoryService.insert(userRefundHistory)); + } + + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserTeacherController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserTeacherController.java new file mode 100644 index 0000000..a1843bf --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserTeacherController.java @@ -0,0 +1,48 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.service.UserTeacherService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +/** + * (UserTeacher)表控制层 + * + * @author java + * @since 2020-11-20 11:08:21 + */ + +@RestController +@RequestMapping("/new/api/app/userTeacher") +public class AppUserTeacherController { + + /** + * 服务对象 + */ + private final UserTeacherService userTeacherService; + + public AppUserTeacherController(UserTeacherService userTeacherService) { + this.userTeacherService = userTeacherService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserTeacher", response = Result.class) + public Result selectAppUserTeacher(@PathVariable("id") Integer id) { + return Result.success(this.userTeacherService.queryById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 UserTeacher列表(分页)", response = Result.class) + public Result listAppUserTeacher(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(userTeacherService.queryAllByLimit(page, size)); + } + + @GetMapping("/list/name") + @ApiOperation(value = "依据老师名称 获取 UserTeacher列表", response = Result.class) + public Result listUserTeacherByName(@RequestParam String name) { + return Result.success(userTeacherService.queryByName(name)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserTestHistoryController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserTestHistoryController.java new file mode 100644 index 0000000..a609d5c --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserTestHistoryController.java @@ -0,0 +1,58 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.dto.PaperCommitDTO; +import com.hc.business.service.PaperService; +import com.hc.business.service.UserTestHistoryService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 用户考试记录表(UserTestHistory)表控制层 + * + * @author java + * @since 2020-12-07 11:28:22 + */ + +@RestController +@RequestMapping("/new/api/app/userTestHistory") +public class AppUserTestHistoryController { + + /** + * 服务对象 + */ + private final UserTestHistoryService userTestHistoryService; + + private final PaperService paperService; + + public AppUserTestHistoryController(UserTestHistoryService userTestHistoryService, + PaperService paperService) { + this.userTestHistoryService = userTestHistoryService; + this.paperService = paperService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserTestHistory", response = Result.class) + public Result selectAppUserTestHistory(@PathVariable("id") Integer id) { + return Result.success(this.userTestHistoryService.queryById(id)); + } + + @PostMapping("/commit") + @ApiOperation(value = "提交试卷,获取成绩", response = Result.class) + public Result paperAppCommit(@Valid @RequestBody PaperCommitDTO paperCommitDTO) { + return paperService.paperCommit(paperCommitDTO); + } + + @GetMapping("/max") + @ApiOperation(value = "获取用户当前最高成绩", response = Result.class) + public Result selectAppUserMaxTestHistory(@ApiParam(value = "用户id") @RequestParam Integer userId, + @RequestParam Integer classId) { + return Result.success(userTestHistoryService.queryMaxScore(userId, classId)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserVideoPositionController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserVideoPositionController.java new file mode 100644 index 0000000..487227e --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppUserVideoPositionController.java @@ -0,0 +1,74 @@ +package com.hc.web.controller.browser.app; + +import com.hc.business.model.UserVideoPosition; +import com.hc.business.service.UserVideoPositionService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 用户视频观看记录(UserVideoPosition)表控制层 + * + * @author java + * @since 2020-11-11 13:26:26 + */ + +@RestController +@RequestMapping("/new/api/app/userVideoPosition") +public class AppUserVideoPositionController { + + /** + * 服务对象 + */ + private final UserVideoPositionService userVideoPositionService; + + public AppUserVideoPositionController(UserVideoPositionService userVideoPositionService) { + this.userVideoPositionService = userVideoPositionService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserVideoPosition", response = Result.class) + public Result selectAppUserVideoPosition(@PathVariable("id") Integer id) { + return Result.success(this.userVideoPositionService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 UserVideoPosition", response = Result.class) + public Result addAppUserVideoPosition(@Valid @RequestBody UserVideoPosition userVideoPosition) { + return Result.success(userVideoPositionService.insert(userVideoPosition)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 UserVideoPosition", response = Result.class) + public Result updateAppUserVideoPosition(@RequestBody UserVideoPosition userVideoPosition) { + return Result.success(userVideoPositionService.update(userVideoPosition)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 UserVideoPosition", response = Result.class) + public Result deleteAppUserVideoPosition(@PathVariable("id") Integer id) { + return Result.success(userVideoPositionService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 UserVideoPosition列表(分页)", response = Result.class) + public Result listAppUserVideoPosition(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(userVideoPositionService.queryAllByLimit(page, size)); + } + + + @GetMapping("/{userId}/{videoId}/{courseId}/{classId}") + @ApiOperation(value = "依据userId,vidoeId查找播放记录", response = Result.class) + public Result findAppVideoPosition(@PathVariable("userId") Integer userId, + @PathVariable("videoId") Integer videoId, + @PathVariable("courseId") Integer courseId, + @PathVariable("classId") Integer classId) { + return Result.success(userVideoPositionService.findVideoPosition(userId, videoId, courseId, classId)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppWxPayJsApiController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppWxPayJsApiController.java new file mode 100644 index 0000000..c940064 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/app/AppWxPayJsApiController.java @@ -0,0 +1,365 @@ +package com.hc.web.controller.browser.app; + +import com.alibaba.fastjson.JSONObject; +import com.hc.business.dto.ClassCourseDto; +import com.hc.business.dto.UserCourseDto; +import com.hc.business.mapper.*; +import com.hc.business.model.*; +import com.hc.core.utils.properties.PayProperties; +import com.hc.core.utils.result.Result; +import com.hc.core.utils.status.CourseFlagEnum; +import com.hc.core.utils.status.OrdersFlagEnum; +import com.hc.core.utils.wx.StringUtils; +import com.hc.core.utils.wx.XMLUtils; +import com.hc.web.config.util.HttpRequest; +import com.hc.web.config.util.HttpsUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.BufferedReader; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * @author 10696 + */ + +@RestController +@RequestMapping("/new/api/jsApi") +public class AppWxPayJsApiController { + + private final PayProperties payProperties; + + private final OrdersMapper ordersMapper; + + @Autowired + private OrderUserLogMapper orderUserLogMapper; + + @Autowired + private UserCourseMapper userCourseMapper; + + @Autowired + private ClassCourseMapper classCourseMapper; + + @Autowired + private UserStatusMapper userStatusMapper; + + @Autowired + private UserAdviseMapper userAdviseMapper; + + private final String secret = "510742935518af9b4b2d5b3aab0d378d"; + + Log log = LogFactory.getLog(this.getClass()); + + public AppWxPayJsApiController(PayProperties payProperties, OrdersMapper ordersMapper) { + this.payProperties = payProperties; + this.ordersMapper = ordersMapper; + } + + + @PostMapping(value = "/pay", produces = {"application/json;charset=UTF-8"}) + public Result zf1(HttpServletRequest request, HttpServletResponse response) { + + String getopenid_url = "https://api.weixin.qq.com/sns/oauth2/access_token"; + + String sign_Key = payProperties.getWxPay().getSign_key(); + + String code = request.getParameter("code"); + String param = + "appid=" + payProperties.getWxPay().getAppid() + + "&secret=" + secret + + "&code=" + code + "&grant_type=authorization_code"; + //向微信服务器发送get请求获取openIdStr + String openIdStr = HttpRequest.sendGet(getopenid_url, param); + //转成Json格式 + JSONObject json = JSONObject.parseObject(openIdStr); + String openId = json.getString("openid"); + + Map returnMap = new HashMap(); + String appId = payProperties.getWxPay().getAppid(); + String body = request.getParameter("body"); + String tradeNo = request.getParameter("out_trade_no"); + String merchantId = payProperties.getWxPay().getMch_id(); + String nonceStr1 = createNonceStr(); + String notifyUrl = "http://zgcj.cfefe.com/new/api/jsApi/notify"; + + //不可为小数,否则报错//不可为小数,否则报错 + String totalFee = request.getParameter("total_amount"); + String finalMoney = StringUtils.getMoney(totalFee); + TreeMap map = new TreeMap<>(); + map.put("appid", appId); + map.put("mch_id", merchantId); + map.put("device_info", "WEB"); + map.put("body", body); + map.put("trade_type", "JSAPI"); + map.put("nonce_str", nonceStr1); + map.put("notify_url", notifyUrl); + map.put("out_trade_no", tradeNo); + map.put("total_fee", finalMoney); + map.put("openid", openId); + String sign = createSign(map); + + String xml = "" + + "" + appId + "" + + "" + body + "" + + "WEB" + + "" + merchantId + "" + + "" + nonceStr1 + "" + + "" + notifyUrl + "" + + "" + openId + "" + + "" + tradeNo + "" + + "" + finalMoney + "" + + "JSAPI" + + "" + sign + "" + + ""; + String url = "https://api.mch.weixin.qq.com/pay/unifiedorder"; + + String result = null; + + result = HttpsUtil.httpsRequestToString(url, "POST", xml); + + String reg = ""; + + Pattern pattern = Pattern.compile(reg); + + Matcher matcher = pattern.matcher(result); + + String prepayId = ""; + + while (matcher.find()) { + prepayId = matcher.group(1); + System.out.println("预支付ID:" + prepayId); + } + + Date beijingDate = Calendar.getInstance(Locale.CHINA).getTime(); + String datassss = String.valueOf(beijingDate.getTime() / 1000); + String nonceStrss = createNonceStr(); + //appId, timeStamp, nonceStr, package, signType + //再一次签名,我看网上的有好多都没说,是后来报错了我搜索才发现要重新签名 + String stringAs = "appId=" + payProperties.getWxPay().getAppid() + + "&nonceStr=" + nonceStrss + "&package=prepay_id=" + prepayId + + "&signType=MD5&timeStamp=" + datassss + "&key=" + + sign_Key; + + String dd = null; + try { + dd = MD5(stringAs).toUpperCase(); + } catch (Exception e) { + e.printStackTrace(); + } + + returnMap.put("paySignss", dd); + returnMap.put("appids", payProperties.getWxPay().getAppid()); + returnMap.put("timestampss", datassss); + returnMap.put("nonceStrss", nonceStrss); + returnMap.put("packagess", "prepay_id=" + prepayId); + returnMap.put("signTypess", "MD5"); + + return Result.success(returnMap); + } + + + @PostMapping(value = "/notify") + public void weixinPayNotify(HttpServletRequest request, HttpServletResponse response) throws Exception { + BufferedReader reader = request.getReader(); + String line = ""; + Map map = new HashMap<>(); + String xml = ""; + StringBuffer inputString = new StringBuffer(); + while ((line = reader.readLine()) != null) { + inputString.append(line); + } + request.getReader().close(); + if (inputString.toString().length() > 0) { + map = XMLUtils.parseXmlToList(inputString.toString()); + } else { + log.info("接受微信报文为空"); + } + if (map != null && "SUCCESS".equals(map.get("result_code"))) { + String out_trade_no = (String) map.get("out_trade_no"); + String transaction_id = (String) map.get("transaction_id"); + Orders orders = + ordersMapper.queryByOrderNo(out_trade_no); + if (Objects.isNull(orders)) { + return; + } + orders.setOrderStatus(OrdersFlagEnum.ORDERS_FLAG_PAID.getCode()); + orders.setTradeNo(transaction_id); + ordersMapper.updateByPrimaryKey(orders); + + //查询订单中的用户 + Integer ordersId = orders.getOrdersId(); + Integer classId = orders.getClassId(); + List orderUserLogs = + orderUserLogMapper.queryByOrderId(ordersId); + List classCourseDtoList = + classCourseMapper.queryByClassId(classId, CourseFlagEnum.COURSE_REQUIRE_CODE.getCode()); + + if (CollectionUtils.isEmpty(orderUserLogs)) { + if (CollectionUtils.isEmpty(classCourseDtoList)) { + return; + } + return; + } + + createUserAdvise(orderUserLogs); + createUserCourse(classId, orderUserLogs, classCourseDtoList); + + xml = ""; + } else { + //失败的业务。。。 + } + //告诉微信端已经确认支付成功 + response.getWriter().write(xml); + } + + /** + * 生成 MD5 + * + * @param data 待处理数据 + * @return MD5结果 + */ + private static String MD5(String data) throws Exception { + MessageDigest md = MessageDigest.getInstance("MD5"); + byte[] array = md.digest(data.getBytes(StandardCharsets.UTF_8)); + StringBuilder sb = new StringBuilder(); + for (byte item : array) { + sb.append(Integer.toHexString((item & 0xFF) | 0x100).substring(1, 3)); + } + return sb.toString().toUpperCase(); + } + + /** + * 生成随机数 + *

算法参考:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=4_3

+ * + * @return 随机数字符串 + */ + + private static String createNonceStr() { + SecureRandom random = new SecureRandom(); + int randomNum = random.nextInt(); + return Integer.toString(randomNum); + } + + /** + * 生成签名,用于在微信支付前,获取预支付时候需要使用的参数sign + *

算法参考:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=4_3

+ * + * @param params 需要发送的所有数据设置为的Map + * @return 签名sign + */ + + private String createSign(TreeMap params) { + String signValue = ""; + String stringSignTemp = ""; + + String stringA = ""; + //获得stringA + Set keys = params.keySet(); + for (String key : keys) { + stringA += (key + "=" + params.get(key) + "&"); + } + stringA = stringA.substring(0, stringA.length() - 1); + //获得stringSignTemp + stringSignTemp = stringA + "&key=" + payProperties.getWxPay().getSign_key(); + //获得signValue + signValue = encryptByMD5(stringSignTemp).toUpperCase(); + return signValue; + } + + /** + * MD5加密 + * + * @param sourceStr + * @return + */ + + private static String encryptByMD5(String sourceStr) { + String result = ""; + try { + MessageDigest md = MessageDigest.getInstance("MD5"); + md.update(sourceStr.getBytes(StandardCharsets.UTF_8)); + byte b[] = md.digest(); + int i; + StringBuffer buf = new StringBuffer(""); + for (int offset = 0; offset < b.length; offset++) { + i = b[offset]; + if (i < 0) { + i += 256; + } + if (i < 16) { + buf.append("0"); + } + buf.append(Integer.toHexString(i)); + } + result = buf.toString(); + } catch (NoSuchAlgorithmException e) { + System.out.println(e); + } + return result; + } + + private void createUserAdvise(List orderUserLogs) { + orderUserLogs.forEach(orderUserLog -> { + UserAdvise userAdvise = new UserAdvise(); + userAdvise.setAdviceType(1); + userAdvise.setCreateTime(System.currentTimeMillis()); + userAdvise.setAdvise("报名成功,这里是一行通知。。。。。"); + userAdvise.setUserId(orderUserLog.getReUserId()); + userAdvise.setTitle("标题"); + userAdviseMapper.insert(userAdvise); + }); + } + + private void createUserCourse(Integer classId, + List orderUserLogs, + List classCourseDtoList) { + + orderUserLogs.forEach(orderUserLog -> { + Integer reUserId = orderUserLog.getReUserId(); + Integer ordersId = orderUserLog.getOrderId(); + //开用户状态 + List userStatuses = + userStatusMapper.queryByClassIdAndUserId(classId, reUserId); + if (CollectionUtils.isEmpty(userStatuses)) { + UserStatus userStatus = new UserStatus(); + userStatus.setClassId(classId); + userStatus.setOrderId(ordersId); + userStatus.setUserId(reUserId); + userStatus.setStatus(OrdersFlagEnum.ORDERS_FLAG_PAID.getCode()); + userStatusMapper.insert(userStatus); + } + //课程 + classCourseDtoList.forEach(classCourseDto -> { + Integer courseId = classCourseDto.getCourseId(); + //是否已开 + List userCourses + = userCourseMapper.selectUserCourseProgress(reUserId, classId, courseId); + if (CollectionUtils.isEmpty(userCourses)) { + //开课 + UserCourse userCourse = new UserCourse(); + userCourse.setClassId(classId); + userCourse.setCourseId(courseId); + userCourse.setUserId(reUserId); + userCourse.setCoursePercent(0.00); + userCourseMapper.insert(userCourse); + } + }); + }); + } + + +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackAliPayController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackAliPayController.java new file mode 100644 index 0000000..28aec0e --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackAliPayController.java @@ -0,0 +1,37 @@ +package com.hc.web.controller.browser.back; + +import com.alipay.api.AlipayApiException; +import com.hc.business.service.AliPayService; +import com.hc.core.utils.pay.browser.alipay.bean.AliPayRefundBean; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author 10696 + */ + +@RestController +@RequestMapping("/new/api/back/ali") +public class BackAliPayController { + + /** + * 服务对象 + */ + private final AliPayService aliPayService; + + public BackAliPayController(AliPayService aliPayService) { + this.aliPayService = aliPayService; + } + + @PostMapping("/refund") + @ApiOperation(value = "阿里云支付退款", response = Result.class) + public Result aliRefund(@RequestBody AliPayRefundBean aliPayRefundBean) + throws AlipayApiException { + return Result.success(aliPayService.refund(aliPayRefundBean)); + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackAreaDistrictController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackAreaDistrictController.java new file mode 100644 index 0000000..c5b5458 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackAreaDistrictController.java @@ -0,0 +1,56 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.AreaDistrict; +import com.hc.business.service.AreaDistrictService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * (AreaDistrict)表控制层 + * + * @author java + * @since 2020-11-20 16:06:50 + */ + +@RestController +@RequestMapping("/new/api/back/areaDistrict") +public class BackAreaDistrictController { + + /** + * 服务对象 + */ + private final AreaDistrictService areaDistrictService; + + public BackAreaDistrictController(AreaDistrictService areaDistrictService) { + this.areaDistrictService = areaDistrictService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 AreaDistrict", response = Result.class) + public Result selectBackAreaDistrict(@PathVariable("id") Integer id) { + return Result.success(areaDistrictService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 AreaDistrict", response = Result.class) + public Result addBackAreaDistrict(@Valid @RequestBody AreaDistrict areaDistrict) { + return Result.success(areaDistrictService.insert(areaDistrict)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 AreaDistrict", response = Result.class) + public Result updateBackAreaDistrict(@RequestBody AreaDistrict areaDistrict) { + return Result.success(areaDistrictService.update(areaDistrict)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 AreaDistrict列表(分页)", response = Result.class) + public Result listBackAreaDistrict(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(areaDistrictService.queryAllByLimit(page, size)); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackBannerController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackBannerController.java new file mode 100644 index 0000000..0e93101 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackBannerController.java @@ -0,0 +1,65 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.Banner; +import com.hc.business.service.BannerService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 广告表 + * (Banner)表控制层 + * + * @author java + * @since 2020-11-26 09:29:54 + */ + +@RestController +@RequestMapping("/new/api/back/banner") +public class BackBannerController { + + /** + * 服务对象 + */ + private final BannerService bannerService; + + public BackBannerController(BannerService bannerService) { + this.bannerService = bannerService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 Banner", response = Result.class) + public Result selectBackDetail(@PathVariable("id") Integer id) { + return Result.success(this.bannerService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 Banner", response = Result.class) + public Result addBackBanner(@Valid @RequestBody Banner banner) { + return Result.success(bannerService.insert(banner)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 Banner", response = Result.class) + public Result updateBackBanner(@RequestBody Banner banner) { + return Result.success(bannerService.update(banner)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 Banner", response = Result.class) + public Result deleteBackBanner(@PathVariable("id") Integer id) { + return Result.success(bannerService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 Banner列表(分页)", response = Result.class) + public Result listBackBanner(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(bannerService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackClassConfigController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackClassConfigController.java new file mode 100644 index 0000000..57bf67e --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackClassConfigController.java @@ -0,0 +1,81 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.ClassConfig; +import com.hc.business.service.ClassConfigService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 班次表(ClassConfig)表控制层 + * + * @author java + * @since 2020-11-19 16:12:35 + */ + +@RestController +@RequestMapping("/new/api/back/classConfig") +public class BackClassConfigController { + + /** + * 服务对象 + */ + private final ClassConfigService classConfigService; + + public BackClassConfigController(ClassConfigService classConfigService) { + this.classConfigService = classConfigService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 ClassConfig", response = Result.class) + public Result selectBackDetail(@PathVariable("id") Integer id) { + return Result.success(this.classConfigService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 ClassConfig", response = Result.class) + public Result addBackClassConfig(@Valid @RequestBody ClassConfig classConfig) { + return Result.success(classConfigService.insert(classConfig)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 ClassConfig", response = Result.class) + public Result updateBackClassConfig(@RequestBody ClassConfig classConfig) { + return Result.success(classConfigService.update(classConfig)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 ClassConfig", response = Result.class) + public Result deleteBackClassConfig(@PathVariable("id") Integer id) { + return Result.success(classConfigService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 ClassConfig列表(分页)", response = Result.class) + public Result listBackClassConfig(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(classConfigService.queryAllByLimit(page, size)); + } + + @GetMapping("/valid/list") + @ApiOperation(value = "获取 ClassConfig列表(分页)", response = Result.class) + public Result listBackClassConfigByValid(@ApiParam(value = "状态") @RequestParam Integer valid, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(classConfigService.queryByValid(valid, page, size)); + } + + @GetMapping("/area/list") + @ApiOperation(value = "获取 ClassConfig列表(分页)", response = Result.class) + public Result listBackClassConfigByAreaId(@ApiParam(value = "地区id") @RequestParam Integer areaId, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(classConfigService.queryByAreaId(areaId, page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackClassConfigSponsorController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackClassConfigSponsorController.java new file mode 100644 index 0000000..0611569 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackClassConfigSponsorController.java @@ -0,0 +1,65 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.ClassConfigSponsor; +import com.hc.business.service.ClassConfigSponsorService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * (ClassConfigSponsor)表控制层 + * + * @author java + * @since 2021-05-28 14:11:29 + */ + +@RestController +@RequestMapping("/api/back/classConfigSponsor") +public class BackClassConfigSponsorController { + + /** + * 服务对象 + */ + private final ClassConfigSponsorService classConfigSponsorService; + + public BackClassConfigSponsorController(ClassConfigSponsorService classConfigSponsorService) { + this.classConfigSponsorService = classConfigSponsorService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 ClassConfigSponsor", response = Result.class) + public Result selectClassConfigSponsor(@PathVariable("id") Integer id) { + return Result.success(this.classConfigSponsorService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 ClassConfigSponsor", response = Result.class) + public Result addClassConfigSponsor(@Valid @RequestBody ClassConfigSponsor classConfigSponsor) { + return Result.success(classConfigSponsorService.insert(classConfigSponsor)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 ClassConfigSponsor", response = Result.class) + public Result updateClassConfigSponsor(@RequestBody ClassConfigSponsor classConfigSponsor) { + return Result.success(classConfigSponsorService.update(classConfigSponsor)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 ClassConfigSponsor", response = Result.class) + public Result deleteClassConfigSponsor(@PathVariable("id") Integer id) { + return Result.success(classConfigSponsorService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 ClassConfigSponsor列表(分页)", response = Result.class) + public Result listClassConfigSponsor(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size, + @RequestParam(required = false) Integer classId) { + return Result.success(classConfigSponsorService.queryAllByLimit(page, size, classId)); + } + + +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackClassCourseController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackClassCourseController.java new file mode 100644 index 0000000..0bdb010 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackClassCourseController.java @@ -0,0 +1,74 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.ClassCourse; +import com.hc.business.service.ClassCourseService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 班次课程表(ClassCourse)表控制层 + * + * @author java + * @since 2020-11-24 11:30:12 + */ + +@RestController +@RequestMapping("/new/api/back/classCourse") +public class BackClassCourseController { + + /** + * 服务对象 + */ + private final ClassCourseService classCourseService; + + public BackClassCourseController(ClassCourseService classCourseService) { + this.classCourseService = classCourseService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 ClassCourse", response = Result.class) + public Result selectBackDetail(@PathVariable("id") Integer id) { + return Result.success(this.classCourseService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 ClassCourse", response = Result.class) + public Result addBackClassCourse(@Valid @RequestBody ClassCourse classCourse) { + return Result.success(classCourseService.insert(classCourse)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 ClassCourse", response = Result.class) + public Result updateBackClassCourse(@RequestBody ClassCourse classCourse) { + return Result.success(classCourseService.update(classCourse)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 ClassCourse", response = Result.class) + public Result deleteBackClassCourse(@PathVariable("id") Integer id) { + return Result.success(classCourseService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 ClassCourse列表(分页)", response = Result.class) + public Result listBackClassCourse(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(classCourseService.queryAllByLimit(page, size)); + } + + @GetMapping("/course") + @ApiOperation(value = "获取班级 必修/选修课程", response = Result.class) + public Result listBackClassCourseByParam(@ApiParam(value = "班次id") @RequestParam Integer classId, + @ApiParam(value = "班级类别") @RequestParam(required = false) Integer courseType, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(classCourseService.queryByClassId(classId, courseType, page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackCourseController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackCourseController.java new file mode 100644 index 0000000..7cb3255 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackCourseController.java @@ -0,0 +1,91 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.Course; +import com.hc.business.service.CourseChapterVideoService; +import com.hc.business.service.CourseService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + + +/** + * 课程表(Course)表控制层 + * + * @author java + * @since 2020-11-09 10:04:46 + */ + +@RestController +@RequestMapping("/new/api/back/course") +public class BackCourseController { + + /** + * 服务对象 + */ + private final CourseService courseService; + private final CourseChapterVideoService videoService; + + public BackCourseController(CourseService courseService, + CourseChapterVideoService videoService) { + this.courseService = courseService; + this.videoService = videoService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 Course", response = Result.class) + public Result selectBackDetail(@PathVariable("id") Integer id) { + return Result.success(this.courseService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 Course", response = Result.class) + public Result addBackCourse(@Valid @RequestBody Course course) { + return Result.success(courseService.insert(course)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 Course", response = Result.class) + public Result updateBackCourse(@RequestBody Course course) { + return Result.success(courseService.update(course)); + } + +// @DeleteMapping("/delete/{id}") +// @ApiOperation(value = "依据主键删除 Course", response = Result.class) +// public Result deleteBackCourse(@PathVariable("id") Integer id) { +// return Result.success(courseService.deleteById(id)); +// } + + @GetMapping("/list") + @ApiOperation(value = "获取 Course列表(分页)", response = Result.class) + public Result listBackCourse(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size, + @RequestParam(required = false) Integer valid) { + return Result.success(courseService.queryAllByLimit(page, size, valid)); + } + + + @GetMapping("/list/teacher") + @ApiOperation(value = "依据老师名称获取 Course列表(分页)", response = Result.class) + public Result queryTeacherName(@ApiParam(value = "老师名称") @RequestParam String name) { + return Result.success(courseService.queryTeacherName(name)); + } + + @GetMapping("/list/type") + @ApiOperation(value = "获取 type分类下的 Course列表(分页)", response = Result.class) + public Result queryAllByLimitAndTypeId(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size, + @ApiParam(value = "类别id") @RequestParam Integer typeId) { + return Result.success(courseService.queryAllByLimitAndTypeId(page, size, typeId)); + } + + @GetMapping("/video") + @ApiOperation(value = "获取一个课程下所有的视频以及某个用户的播放进度", response = Result.class) + public Result getCourseChapterAndVideoPosition(@RequestParam Integer courseId) { + return Result.success(videoService.queryByCourseId(courseId)); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackCourseTypeController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackCourseTypeController.java new file mode 100644 index 0000000..e49149f --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackCourseTypeController.java @@ -0,0 +1,66 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.CourseType; +import com.hc.business.service.CourseTypeService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * (CourseType)表控制层 + * + * @author java + * @since 2020-12-17 14:12:55 + */ + +@RestController +@RequestMapping("/new/api/back/courseType") +public class BackCourseTypeController { + + /** + * 服务对象 + */ + private final CourseTypeService courseTypeService; + + public BackCourseTypeController(CourseTypeService courseTypeService) { + this.courseTypeService = courseTypeService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 CourseType", response = Result.class) + public Result selectBackDetail(@PathVariable("id") Integer id) { + return Result.success(this.courseTypeService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 CourseType", response = Result.class) + public Result addBackCourseType(@Valid @RequestBody CourseType courseType) { + return Result.success(courseTypeService.insert(courseType)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 CourseType", response = Result.class) + public Result updateBackCourseType(@RequestBody CourseType courseType) { + return Result.success(courseTypeService.update(courseType)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 CourseType", response = Result.class) + public Result deleteBackCourseType(@PathVariable("id") Integer id) { + return Result.success(courseTypeService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 CourseType列表(分页)", response = Result.class) + public Result listBackCourseType(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(courseTypeService.queryAllByLimit(page, size)); + } + + + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackCourseTypeRelationController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackCourseTypeRelationController.java new file mode 100644 index 0000000..fec9623 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackCourseTypeRelationController.java @@ -0,0 +1,64 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.CourseTypeRelation; +import com.hc.business.service.CourseTypeRelationService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * (CourseTypeRelation)表控制层 + * + * @author java + * @since 2021-02-02 09:25:14 + */ + +@RestController +@RequestMapping("/new/api/back/courseTypeRelation") +public class BackCourseTypeRelationController { + + /** + * 服务对象 + */ + private final CourseTypeRelationService courseTypeRelationService; + + public BackCourseTypeRelationController(CourseTypeRelationService courseTypeRelationService) { + this.courseTypeRelationService = courseTypeRelationService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 CourseTypeRelation", response = Result.class) + public Result selectDetail(@PathVariable("id") Integer id) { + return Result.success(this.courseTypeRelationService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 CourseTypeRelation", response = Result.class) + public Result addCourseTypeRelation(@Valid @RequestBody CourseTypeRelation courseTypeRelation) { + return Result.success(courseTypeRelationService.insert(courseTypeRelation)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 CourseTypeRelation", response = Result.class) + public Result updateCourseTypeRelation(@RequestBody CourseTypeRelation courseTypeRelation) { + return Result.success(courseTypeRelationService.update(courseTypeRelation)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 CourseTypeRelation", response = Result.class) + public Result deleteCourseTypeRelation(@PathVariable("id") Integer id) { + return Result.success(courseTypeRelationService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 CourseTypeRelation列表(分页)", response = Result.class) + public Result listCourseTypeRelation(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(courseTypeRelationService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackNewsController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackNewsController.java new file mode 100644 index 0000000..77a17b7 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackNewsController.java @@ -0,0 +1,74 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.News; +import com.hc.business.service.NewsService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 新闻表 + * (News)表控制层 + * + * @author java + * @since 2020-11-20 11:48:39 + */ + +@RestController +@RequestMapping("/new/api/back/news") +public class BackNewsController { + + /** + * 服务对象 + */ + private final NewsService newsService; + + public BackNewsController(NewsService newsService) { + this.newsService = newsService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 News", response = Result.class) + public Result selectBackDetail(@PathVariable("id") Integer id) { + return Result.success(this.newsService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 News", response = Result.class) + public Result addBackNews(@Valid @RequestBody News news) { + return Result.success(newsService.insert(news)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 News", response = Result.class) + public Result updateBackNews(@RequestBody News news) { + return Result.success(newsService.update(news)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 News", response = Result.class) + public Result deleteBackNews(@PathVariable("id") Integer id) { + return Result.success(newsService.deleteById(id)); + } + + @GetMapping("/tag/{tagId}") + @ApiOperation(value = "依据tagId获取 News", response = Result.class) + public Result selectBackByTagId(@ApiParam(value = "标签id") @PathVariable("tagId") Integer tagId, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(this.newsService.queryListByTagId(tagId, page, size)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 News列表(分页)", response = Result.class) + public Result listBackNews(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(newsService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackNewsTagController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackNewsTagController.java new file mode 100644 index 0000000..01e3f38 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackNewsTagController.java @@ -0,0 +1,64 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.mapper.NewsTagMapper; +import com.hc.business.model.NewsTag; +import com.hc.business.service.NewsTagService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 新闻标签表(NewsTag)表控制层 + * + * @author java + * @since 2020-11-20 12:52:34 + */ + +@RestController +@RequestMapping("/new/api/back/newsTag") +public class BackNewsTagController { + + /** + * 服务对象 + */ + private final NewsTagService newsTagService; + + + public BackNewsTagController(NewsTagService newsTagService) { + this.newsTagService = newsTagService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 NewsTag", response = Result.class) + public Result selectBackDetail(@PathVariable("id") Integer id) { + return Result.success(this.newsTagService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 NewsTag", response = Result.class) + public Result addBackNewsTag(@Valid @RequestBody NewsTag newsTag) { + return Result.success(newsTagService.insert(newsTag)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 NewsTag", response = Result.class) + public Result updateBackNewsTag(@RequestBody NewsTag newsTag) { + return Result.success(newsTagService.update(newsTag)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "主键 删除 NewsTag", response = Result.class) + public Result deleteBackNewsTag(@PathVariable("id") Integer id) { + return Result.success(newsTagService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 NewsTag列表", response = Result.class) + public Result listBackNewsTag() { + return Result.success(newsTagService.queryAll()); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackOrderInvoicesController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackOrderInvoicesController.java new file mode 100644 index 0000000..78b7e07 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackOrderInvoicesController.java @@ -0,0 +1,33 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.service.OrdersService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author 10696 + */ + +@RestController +@RequestMapping("/new/api/back/orderInvoices") +public class BackOrderInvoicesController { + + private final OrdersService ordersService; + + public BackOrderInvoicesController(OrdersService ordersService) { + this.ordersService = ordersService; + } + + @GetMapping("/list") + @ApiOperation(value = "获取 全部订单发票信息 (分页)", response = Result.class) + public Result listBackOrderInvoices(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(ordersService.queryAllWithOrderInvoices(page, size)); + } + + +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackOrderUserLogController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackOrderUserLogController.java new file mode 100644 index 0000000..69df731 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackOrderUserLogController.java @@ -0,0 +1,47 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.OrderUserLog; +import com.hc.business.service.OrderUserLogService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + + +/** + * (OrderUserLog)表控制层 + * + * @author java + * @since 2020-12-03 09:25:12 + */ + +@RestController +@RequestMapping("/new/api/back/orderUserLog") +public class BackOrderUserLogController { + + /** + * 服务对象 + */ + private final OrderUserLogService orderUserLogService; + + public BackOrderUserLogController(OrderUserLogService orderUserLogService) { + this.orderUserLogService = orderUserLogService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 OrderUserLog", response = Result.class) + public Result selectBackOrderUserLog(@PathVariable("id") Integer id) { + return Result.success(this.orderUserLogService.queryById(id)); + } + + @GetMapping("/order/{orderId}") + @ApiOperation(value = "依据订单id 获取 OrderUserLog", response = Result.class) + public Result selectOrderUserLogByOrderId(@ApiParam(value = "订单id") @PathVariable("orderId") Integer orderId) { + return Result.success(orderUserLogService.queryListByOrderId(orderId)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackOrdersController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackOrdersController.java new file mode 100644 index 0000000..8126046 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackOrdersController.java @@ -0,0 +1,118 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.Orders; +import com.hc.business.service.OrdersService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 订单表(Orders)表控制层 + * + * @author java + * @since 2020-11-26 16:46:48 + */ + +@RestController +@RequestMapping("/new/api/back/orders") +public class BackOrdersController { + + /** + * 服务对象 + */ + private final OrdersService ordersService; + + public BackOrdersController(OrdersService ordersService) { + this.ordersService = ordersService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 Orders", response = Result.class) + public Result selectBackDetail(@PathVariable("id") Integer id) { + return Result.success(this.ordersService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 Orders", response = Result.class) + public Result addBackOrders(@Valid @RequestBody Orders orders) { + return Result.success(ordersService.insert(orders)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 Orders", response = Result.class) + public Result updateBackOrders(@RequestBody Orders orders) { + return Result.success(ordersService.update(orders)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 Orders", response = Result.class) + public Result deleteBackOrders(@PathVariable("id") Integer id) { + return Result.success(ordersService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 Orders列表(分页)", response = Result.class) + public Result listBackOrders(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(ordersService.queryAllByLimit(page, size)); + } + + @GetMapping("/class/list") + @ApiOperation(value = "依据班次id 获取 Orders列表(分页)", response = Result.class) + public Result listBackOrdersByClassId(@ApiParam(value = "班次id") @RequestParam Integer classId, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(ordersService.queryAllByClassId(page, size, classId)); + } + + @GetMapping("/className") + @ApiOperation(value = "依据班次名称 获取 Orders列表(分页)", response = Result.class) + public Result listBackOrdersByClassName(@ApiParam(value = "班次名称") @RequestParam String className, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(ordersService.queryAllByClassName(page, size, className)); + } + + @GetMapping("/status/list") + @ApiOperation(value = "依据状态 获取 Orders列表(分页)", response = Result.class) + public Result listBackOrdersByStatus(@ApiParam(value = "状态") @RequestParam Integer status, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(ordersService.queryAllByStatus(page, size, status)); + } + + @GetMapping("/list/userInvoices") + @ApiOperation(value = "获取 发票 Orders列表(分页)", response = Result.class) + public Result listBackOrdersByUserInvoicesId(@ApiParam(value = "发票id") @RequestParam Integer userInvoicesId) { + return Result.success(ordersService.queryByUserInvoicesId(userInvoicesId)); + } + + @GetMapping("/create/no") + @ApiOperation(value = "创建一条订单编号", response = Result.class) + public Result createOrderNo() { + return Result.success(ordersService.createOrderNo()); + } + + @GetMapping("/count") + @ApiOperation(value = "获取 订单金额统计数据", response = Result.class) + public Result queryOrderCount() { + return Result.success(ordersService.queryUserCount()); + } + + @GetMapping("/count/no") + @ApiOperation(value = "获取 订单数量统计数据", response = Result.class) + public Result queryOrderCountNo() { + return Result.success(ordersService.countOrderTotal()); + } + + @GetMapping("/no") + @ApiOperation(value = "依据订单编号获取 Orders", response = Result.class) + public Result selectBackOrders(@ApiParam(value = "订单编号") @RequestParam String orderNo) { + return Result.success(this.ordersService.queryByOrderNo(orderNo.trim())); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackPaperController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackPaperController.java new file mode 100644 index 0000000..3f8e5ad --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackPaperController.java @@ -0,0 +1,64 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.Paper; +import com.hc.business.service.PaperService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 试卷表(Paper)表控制层 + * + * @author java + * @since 2020-12-07 11:34:40 + */ + +@RestController +@RequestMapping("/new/api/back/paper") +public class BackPaperController { + + /** + * 服务对象 + */ + private final PaperService paperService; + + public BackPaperController(PaperService paperService) { + this.paperService = paperService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 Paper", response = Result.class) + public Result selectBackPaper(@PathVariable("id") Integer id) { + return Result.success(this.paperService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 Paper", response = Result.class) + public Result addBackPaper(@Valid @RequestBody Paper paper) { + return Result.success(paperService.insert(paper)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 Paper", response = Result.class) + public Result updateBackPaper(@RequestBody Paper paper) { + return Result.success(paperService.update(paper)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 Paper", response = Result.class) + public Result deleteBackPaper(@PathVariable("id") Integer id) { + return Result.success(paperService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 Paper列表(分页)", response = Result.class) + public Result listBackPaper(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(paperService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackPaperQuestionController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackPaperQuestionController.java new file mode 100644 index 0000000..cff25e1 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackPaperQuestionController.java @@ -0,0 +1,70 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.PaperQuestion; +import com.hc.business.service.PaperQuestionService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 随机试卷问题表(PaperQuestion)表控制层 + * + * @author java + * @since 2020-12-07 11:35:16 + */ + +@RestController +@RequestMapping("/new/api/back/paperQuestion") +public class BackPaperQuestionController { + + /** + * 服务对象 + */ + private final PaperQuestionService paperQuestionService; + + public BackPaperQuestionController(PaperQuestionService paperQuestionService) { + this.paperQuestionService = paperQuestionService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 PaperQuestion", response = Result.class) + public Result selectBackPaperQuestion(@PathVariable("id") Integer id) { + return Result.success(this.paperQuestionService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 PaperQuestion", response = Result.class) + public Result addBackPaperQuestion(@Valid @RequestBody PaperQuestion paperQuestion) { + return Result.success(paperQuestionService.insert(paperQuestion)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 PaperQuestion", response = Result.class) + public Result updateBackPaperQuestion(@RequestBody PaperQuestion paperQuestion) { + return Result.success(paperQuestionService.update(paperQuestion)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 PaperQuestion", response = Result.class) + public Result deleteBackPaperQuestion(@PathVariable("id") Integer id) { + return Result.success(paperQuestionService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 PaperQuestion列表(分页)", response = Result.class) + public Result listBackPaperQuestion(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(paperQuestionService.queryAllByLimit(page, size)); + } + + @GetMapping("/paper/{paperId}") + @ApiOperation(value = "依据试卷id获取 PaperQuestion", response = Result.class) + public Result selectPaperQuestionByPaperId(@ApiParam(value = "试卷") @PathVariable("paperId") Integer paperId) { + return Result.success(this.paperQuestionService.queryByPaperId(paperId)); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackQuestionAnswerController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackQuestionAnswerController.java new file mode 100644 index 0000000..0df5b47 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackQuestionAnswerController.java @@ -0,0 +1,64 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.QuestionAnswer; +import com.hc.business.service.QuestionAnswerService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 问题答案表(QuestionAnswer)表控制层 + * + * @author java + * @since 2020-12-07 11:36:23 + */ + +@RestController +@RequestMapping("/new/api/back/questionAnswer") +public class BackQuestionAnswerController { + + /** + * 服务对象 + */ + private final QuestionAnswerService questionAnswerService; + + public BackQuestionAnswerController(QuestionAnswerService questionAnswerService) { + this.questionAnswerService = questionAnswerService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 QuestionAnswer", response = Result.class) + public Result selectBackQuestionAnswer(@PathVariable("id") Integer id) { + return Result.success(this.questionAnswerService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 QuestionAnswer", response = Result.class) + public Result addBackQuestionAnswer(@Valid @RequestBody QuestionAnswer questionAnswer) { + return Result.success(questionAnswerService.insert(questionAnswer)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 QuestionAnswer", response = Result.class) + public Result updateBackQuestionAnswer(@RequestBody QuestionAnswer questionAnswer) { + return Result.success(questionAnswerService.update(questionAnswer)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 QuestionAnswer", response = Result.class) + public Result deleteBackQuestionAnswer(@PathVariable("id") Integer id) { + return Result.success(questionAnswerService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 QuestionAnswer列表(分页)", response = Result.class) + public Result listBackQuestionAnswer(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(questionAnswerService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackQuestionController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackQuestionController.java new file mode 100644 index 0000000..439e1fa --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackQuestionController.java @@ -0,0 +1,72 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.Question; +import com.hc.business.service.QuestionService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 习题表(Question)表控制层 + * + * @author java + * @since 2020-12-07 11:35:59 + */ + +@RestController +@RequestMapping("/new/api/back/question") +public class BackQuestionController { + + /** + * 服务对象 + */ + private final QuestionService questionService; + + public BackQuestionController(QuestionService questionService) { + this.questionService = questionService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 Question", response = Result.class) + public Result selectBackQuestion(@PathVariable("id") Integer id) { + return Result.success(this.questionService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 Question", response = Result.class) + public Result addBackQuestion(@Valid @RequestBody Question question) { + return Result.success(questionService.insert(question)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 Question", response = Result.class) + public Result updateBackQuestion(@RequestBody Question question) { + return Result.success(questionService.update(question)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 Question", response = Result.class) + public Result deleteBackQuestion(@PathVariable("id") Integer id) { + return Result.success(questionService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 Question列表(分页)", response = Result.class) + public Result listBackQuestion(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(questionService.queryAllByLimit(page, size)); + } + + @GetMapping("/list/tagId") + @ApiOperation(value = "根据tagId 获取 Question列表(分页)", response = Result.class) + public Result listBackQuestionTag(@ApiParam(value = "标签id") @RequestParam Integer tagId, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(questionService.queryByTagLimit(tagId, page, size)); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackQuestionTagController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackQuestionTagController.java new file mode 100644 index 0000000..e06b268 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackQuestionTagController.java @@ -0,0 +1,64 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.QuestionTag; +import com.hc.business.service.QuestionTagService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 问题标签表(QuestionTag)表控制层 + * + * @author java + * @since 2020-12-07 11:36:44 + */ + +@RestController +@RequestMapping("/new/api/back/questionTag") +public class BackQuestionTagController { + + /** + * 服务对象 + */ + private final QuestionTagService questionTagService; + + public BackQuestionTagController(QuestionTagService questionTagService) { + this.questionTagService = questionTagService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 QuestionTag", response = Result.class) + public Result selectBackQuestionTag(@PathVariable("id") Integer id) { + return Result.success(this.questionTagService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 QuestionTag", response = Result.class) + public Result addBackQuestionTag(@Valid @RequestBody QuestionTag questionTag) { + return Result.success(questionTagService.insert(questionTag)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 QuestionTag", response = Result.class) + public Result updateBackQuestionTag(@RequestBody QuestionTag questionTag) { + return Result.success(questionTagService.update(questionTag)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 QuestionTag", response = Result.class) + public Result deleteBackQuestionTag(@PathVariable("id") Integer id) { + return Result.success(questionTagService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 QuestionTag列表(分页)", response = Result.class) + public Result listBackQuestionTag(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(questionTagService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackQuestionTypeController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackQuestionTypeController.java new file mode 100644 index 0000000..5b7fe05 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackQuestionTypeController.java @@ -0,0 +1,64 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.QuestionType; +import com.hc.business.service.QuestionTypeService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 问题类型表(QuestionType)表控制层 + * + * @author java + * @since 2020-12-07 11:37:04 + */ + +@RestController +@RequestMapping("/new/api/back/questionType") +public class BackQuestionTypeController { + + /** + * 服务对象 + */ + private final QuestionTypeService questionTypeService; + + public BackQuestionTypeController(QuestionTypeService questionTypeService) { + this.questionTypeService = questionTypeService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 QuestionType", response = Result.class) + public Result selectBackQuestionType(@PathVariable("id") Integer id) { + return Result.success(this.questionTypeService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 QuestionType", response = Result.class) + public Result addBackQuestionType(@Valid @RequestBody QuestionType questionType) { + return Result.success(questionTypeService.insert(questionType)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 QuestionType", response = Result.class) + public Result updateBackQuestionType(@RequestBody QuestionType questionType) { + return Result.success(questionTypeService.update(questionType)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 QuestionType", response = Result.class) + public Result deleteBackQuestionType(@PathVariable("id") Integer id) { + return Result.success(questionTypeService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 QuestionType列表(分页)", response = Result.class) + public Result listBackQuestionType(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(questionTypeService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackThirdController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackThirdController.java new file mode 100644 index 0000000..f5826fc --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackThirdController.java @@ -0,0 +1,61 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.Third; +import com.hc.business.service.ThirdService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +/** + * 第三方用户表(Third)表控制层 + * + * @author java + * @since 2020-06-17 17:29:30 + */ + +@RestController +@RequestMapping("/new/api/back/third") +public class BackThirdController { + + /** + * 服务对象 + */ + private final ThirdService thirdService; + + public BackThirdController(ThirdService thirdService) { + this.thirdService = thirdService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 Third", response = Result.class) + public Result selectBackThird(@PathVariable("id") Integer id) { + return Result.success(this.thirdService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 Third", response = Result.class) + public Result addBackThird(@RequestBody Third third) { + return Result.success(this.thirdService.insert(third)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 Third", response = Result.class) + public Result updateBackThird(@RequestBody Third third) { + return Result.success(this.thirdService.update(third)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 Third", response = Result.class) + public Result deleteBackThird(@PathVariable("id") Integer id) { + return Result.success(this.thirdService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 Third列表(分页)", response = Result.class) + public Result listBackThird(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(this.thirdService.queryPageAll(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackThirdCourseController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackThirdCourseController.java new file mode 100644 index 0000000..d37d552 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackThirdCourseController.java @@ -0,0 +1,66 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.ThirdCourse; +import com.hc.business.service.ThirdCourseService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +/** + * 第三方用户课程配置表(ThirdCourse)表控制层 + * + * @author java + * @since 2020-06-17 17:29:30 + */ + +@RestController +@RequestMapping("/new/api/back/thirdCourse") +public class BackThirdCourseController { + + /** + * 服务对象 + */ + private final ThirdCourseService thirdCourseService; + + public BackThirdCourseController(ThirdCourseService thirdCourseService) { + this.thirdCourseService = thirdCourseService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 ThirdCourse", response = Result.class) + public Result selectBackThirdCourse(@PathVariable("id") Integer id) { + return Result.success(this.thirdCourseService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 ThirdCourse", response = Result.class) + public Result addBackThirdCourse(@RequestBody ThirdCourse thirdCourse) { + return Result.success(this.thirdCourseService.insert(thirdCourse)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 ThirdCourse", response = Result.class) + public Result updateBackThirdCourse(@RequestBody ThirdCourse thirdCourse) { + return Result.success(this.thirdCourseService.update(thirdCourse)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 ThirdCourse", response = Result.class) + public Result deleteBackThirdCourse(@PathVariable("id") Integer id) { + return Result.success(this.thirdCourseService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 ThirdCourse列表(分页)", response = Result.class) + public Result listBackThirdCourse(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(this.thirdCourseService.queryPageAll(page, size)); + } + + @GetMapping("/findById/{thirdId}") + @ApiOperation(value = "获取 ThirdCourse列表(分页)", response = Result.class) + public Result listBackThirdCourseUpdate(@PathVariable("thirdId") Integer thirdId) { + return Result.success(this.thirdCourseService.queryThirdCourseDtoById(thirdId)); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserAdminController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserAdminController.java new file mode 100644 index 0000000..8d6d27d --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserAdminController.java @@ -0,0 +1,45 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.UserAdmin; +import com.hc.business.model.login.AuthEntity; +import com.hc.business.service.UserAdminService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * @author JIA + */ +@RestController +@RequestMapping("/new/api/back/userAdmin") +public class BackUserAdminController { + + private final UserAdminService userAdminService; + + @Autowired + public BackUserAdminController(UserAdminService userAdminService) { + this.userAdminService = userAdminService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserAdmin", response = Result.class) + public Result selectDetail(@PathVariable("id") Integer id) { + return Result.success(this.userAdminService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增管理员", response = Result.class) + public Result insertUserAdmin(@Valid @RequestBody UserAdmin userAdmin) { + return Result.success(userAdminService.insert(userAdmin)); + } + + @PostMapping("/login") + @ApiOperation(value = "后台管理员登录", response = Result.class) + public Result userAdminLogin(@Valid @RequestBody AuthEntity authEntity) { + return Result.success(userAdminService.userAdminLogin(authEntity)); + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserAdviseController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserAdviseController.java new file mode 100644 index 0000000..42c7ff4 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserAdviseController.java @@ -0,0 +1,78 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.UserAdmin; +import com.hc.business.model.UserAdvise; +import com.hc.business.service.UserAdviseService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 用户建议表 + * (UserAdvise)表控制层 + * + * @author java + * @since 2020-11-16 14:20:06 + */ + +@RestController +@RequestMapping("/new/api/back/userAdvise") +public class BackUserAdviseController { + + /** + * 服务对象 + */ + private final UserAdviseService userAdviseService; + + public BackUserAdviseController(UserAdviseService userAdviseService) { + this.userAdviseService = userAdviseService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserAdvise", response = Result.class) + public Result selectBackDetail(@PathVariable("id") Integer id) { + return Result.success(this.userAdviseService.queryById(id)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 UserAdvise", response = Result.class) + public Result deleteUserAdvise(@PathVariable("id") Integer id) { + return Result.success(userAdviseService.deleteById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增UserAdvise", response = Result.class) + public Result insertUserAdvise(@Valid @RequestBody UserAdvise userAdvise) { + userAdvise.setAdviceType(1); + return Result.success(userAdviseService.insert(userAdvise)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改UserAdvise", response = Result.class) + public Result updateUserAdvise(@RequestBody UserAdvise userAdvise) { + return Result.success(userAdviseService.update(userAdvise)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 UserAdvise列表(分页)", response = Result.class) + public Result listUserAdvise(@ApiParam(value = "类别") @RequestParam(required = false) Integer adviceType, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(userAdviseService.queryAllByLimit(adviceType, page, size)); + } + + @GetMapping("/user/{userId}") + @ApiOperation(value = "依据用户id获取 UserAdvise", response = Result.class) + public Result listUserAdviseById(@ApiParam(value = "用户id") + @PathVariable("userId") Integer userId, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(this.userAdviseService.queryAllByUserId(userId, page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserController.java new file mode 100644 index 0000000..32d6930 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserController.java @@ -0,0 +1,101 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.User; +import com.hc.business.service.UserService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.apache.commons.lang3.StringUtils; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 用户表(User)表控制层 + * + * @author java + * @since 2020-11-09 10:04:14 + */ + +@RestController +@RequestMapping("/new/api/back/user") +public class BackUserController { + + /** + * 服务对象 + */ + private final UserService userService; + + public BackUserController(UserService userService) { + this.userService = userService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 User", response = Result.class) + public Result selectBackDetail(@PathVariable("id") Integer id) { + return Result.success(this.userService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 User", response = Result.class) + public Result addUser(@Valid @RequestBody User user) { + return Result.success(userService.insert(user)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 User", response = Result.class) + public Result updateUser(@RequestBody User user) { + return Result.success(userService.update(user)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 User", response = Result.class) + public Result deleteUser(@PathVariable("id") Integer id) { + return Result.success(userService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 User列表(分页)", response = Result.class) + public Result listUser(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(userService.queryAllByLimit(page, size)); + } + + @GetMapping("/week") + @ApiOperation(value = "最近七天用户注册图表", response = Result.class) + public Result listWeeks() { + return Result.success(userService.queryByUserCount()); + } + + @GetMapping("/count") + @ApiOperation(value = "用户数量统计", response = Result.class) + public Result listCount() { + return Result.success(userService.queryUserCount()); + } + + @GetMapping("/mobile") + @ApiOperation(value = "依据手机号查询用户", response = Result.class) + public Result queryByMobile(@ApiParam(value = "手机号") @RequestParam String userMobile) { + return Result.success(userService.queryByMobile(userMobile)); + } + + @GetMapping("/card") + @ApiOperation(value = "依据身份证号查询用户", response = Result.class) + public Result queryByCardId(@ApiParam(value = "身份证号") @RequestParam String cardId) { + return Result.success(userService.queryUserByCard(cardId)); + } + + @GetMapping("/name") + @ApiOperation(value = "依据姓名查询用户", response = Result.class) + public Result queryByName(@ApiParam(value = "姓名") @RequestParam String name) { + return Result.success(userService.queryUserByName(name)); + } + + @GetMapping("/search") + @ApiOperation(value = "依据培训班名字和支付状态", response = Result.class) + public Result queryByClassName(@ApiParam(value = "培训班名称") @RequestParam String name, + @ApiParam(value ="支付状态 1已支付 0 未支付") @RequestParam int pay) { + return Result.success(userService.queryUserByClassName(name,pay)); + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserCourseController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserCourseController.java new file mode 100644 index 0000000..bda78db --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserCourseController.java @@ -0,0 +1,67 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.UserCourse; +import com.hc.business.service.UserCourseService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 用户课程表(UserCourse)表控制层 + * + * @author java + * @since 2020-11-09 10:05:20 + */ + +@RestController +@RequestMapping("/new/api/back/userCourse") +public class BackUserCourseController { + + /** + * 服务对象 + */ + private final UserCourseService userCourseService; + + public BackUserCourseController(UserCourseService userCourseService) { + this.userCourseService = userCourseService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserCourse", response = Result.class) + public Result selectDetail(@PathVariable("id") Integer id) { + return Result.success(this.userCourseService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 UserCourse", response = Result.class) + public Result addUserCourse(@Valid @RequestBody UserCourse userCourse) { + return Result.success(userCourseService.insert(userCourse)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 UserCourse", response = Result.class) + public Result updateUserCourse(@RequestBody UserCourse userCourse) { + return Result.success(userCourseService.update(userCourse)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 UserCourse", response = Result.class) + public Result deleteUserCourse(@PathVariable("id") Integer id) { + return Result.success(userCourseService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "根据用户id 获取 UserCourse列表(分页)", response = Result.class) + public Result listUserCourse(@ApiParam(value = "用户id") @RequestParam Integer userId, + @ApiParam(value = "班次id") @RequestParam Integer classId, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(userCourseService.queryAllByLimit(userId, classId, page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserInvoicesController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserInvoicesController.java new file mode 100644 index 0000000..1c44660 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserInvoicesController.java @@ -0,0 +1,83 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.UserInvoices; +import com.hc.business.service.UserInvoicesService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 用户发票表(UserInvoices)表控制层 + * + * @author java + * @since 2020-12-02 10:50:41 + */ + +@RestController +@RequestMapping("/new/api/back/userInvoices") +public class BackUserInvoicesController { + + /** + * 服务对象 + */ + private final UserInvoicesService userInvoicesService; + + public BackUserInvoicesController(UserInvoicesService userInvoicesService) { + this.userInvoicesService = userInvoicesService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserInvoices", response = Result.class) + public Result selectBackUserInvoices(@PathVariable("id") Integer id) { + return Result.success(this.userInvoicesService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 UserInvoices", response = Result.class) + public Result addBackUserInvoices(@Valid @RequestBody UserInvoices userInvoices) { + return Result.success(userInvoicesService.insert(userInvoices)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 UserInvoices", response = Result.class) + public Result updateBackUserInvoices(@RequestBody UserInvoices userInvoices) { + return Result.success(userInvoicesService.update(userInvoices)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 UserInvoices", response = Result.class) + public Result deleteBackUserInvoices(@PathVariable("id") Integer id) { + return Result.success(userInvoicesService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 UserInvoices列表(分页)", response = Result.class) + public Result listBackUserInvoices(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(userInvoicesService.queryAllByLimit(page, size)); + } + + @GetMapping("/user/{userId}") + @ApiOperation(value = "获取用户发票信息", response = Result.class) + public Result queryDetailByUserId(@ApiParam(value = "用户id") @PathVariable("userId") Integer userId) { + return Result.success(userInvoicesService.queryDetailByUserId(userId)); + } + + @GetMapping("/class/{classId}") + @ApiOperation(value = "获取班次发票信息", response = Result.class) + public Result queryDetailByClassId(@ApiParam(value = "班次id") @PathVariable("classId") Integer classId) { + return Result.success(userInvoicesService.queryByClassId(classId)); + } + + @GetMapping("/status") + @ApiOperation(value = "获取用户发票信息", response = Result.class) + public Result queryDetailByStatus(@ApiParam(value = "状态") @RequestParam Integer status) { + return Result.success(userInvoicesService.queryByStatus(status)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserRefundHistoryController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserRefundHistoryController.java new file mode 100644 index 0000000..557089a --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserRefundHistoryController.java @@ -0,0 +1,64 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.UserRefundHistory; +import com.hc.business.service.UserRefundHistoryService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 用户退款记录表(UserRefundHistory)表控制层 + * + * @author java + * @since 2020-12-10 11:31:45 + */ + +@RestController +@RequestMapping("/new/api/back/userRefundHistory") +public class BackUserRefundHistoryController { + + /** + * 服务对象 + */ + private final UserRefundHistoryService userRefundHistoryService; + + public BackUserRefundHistoryController(UserRefundHistoryService userRefundHistoryService) { + this.userRefundHistoryService = userRefundHistoryService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserRefundHistory", response = Result.class) + public Result selectBackUserRefundHistory(@PathVariable("id") Integer id) { + return Result.success(this.userRefundHistoryService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 UserRefundHistory", response = Result.class) + public Result addBackUserRefundHistory(@Valid @RequestBody UserRefundHistory userRefundHistory) { + return Result.success(userRefundHistoryService.insert(userRefundHistory)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 UserRefundHistory", response = Result.class) + public Result updateBackUserRefundHistory(@RequestBody UserRefundHistory userRefundHistory) { + return Result.success(userRefundHistoryService.update(userRefundHistory)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 UserRefundHistory", response = Result.class) + public Result deleteBackUserRefundHistory(@PathVariable("id") Integer id) { + return Result.success(userRefundHistoryService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 UserRefundHistory列表(分页)", response = Result.class) + public Result listBackUserRefundHistory(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(userRefundHistoryService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserStatusController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserStatusController.java new file mode 100644 index 0000000..8bae71b --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserStatusController.java @@ -0,0 +1,73 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.UserStatus; +import com.hc.business.service.UserStatusService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 用户班级学习进度表 + * (UserStatus)表控制层 + * + * @author java + * @since 2020-12-06 11:26:46 + */ + +@RestController +@RequestMapping("/new/api/back/userStatus") +public class BackUserStatusController { + + /** + * 服务对象 + */ + private final UserStatusService userStatusService; + + public BackUserStatusController(UserStatusService userStatusService) { + this.userStatusService = userStatusService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserStatus", response = Result.class) + public Result selectDetail(@PathVariable("id") Integer id) { + return Result.success(this.userStatusService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 UserStatus", response = Result.class) + public Result addUserStatus(@Valid @RequestBody UserStatus userStatus) { + return Result.success(userStatusService.insert(userStatus)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 UserStatus", response = Result.class) + public Result updateUserStatus(@RequestBody UserStatus userStatus) { + return Result.success(userStatusService.update(userStatus)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 UserStatus", response = Result.class) + public Result deleteUserStatus(@PathVariable("id") Integer id) { + return Result.success(userStatusService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 UserStatus列表(分页)", response = Result.class) + public Result listUserStatus(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(userStatusService.queryAllByLimit(page, size)); + } + + @GetMapping("/list/user") + @ApiOperation(value = "获取 User列表(分页)", response = Result.class) + public Result listUserByClassId(@RequestParam Integer classId, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(userStatusService.queryByClassId(classId, page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserTeacherController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserTeacherController.java new file mode 100644 index 0000000..2e383ff --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserTeacherController.java @@ -0,0 +1,69 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.UserTeacher; +import com.hc.business.service.UserTeacherService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * (UserTeacher)表控制层 + * + * @author java + * @since 2020-11-20 11:08:21 + */ + +@RestController +@RequestMapping("/new/api/back/userTeacher") +public class BackUserTeacherController { + + /** + * 服务对象 + */ + private final UserTeacherService userTeacherService; + + public BackUserTeacherController(UserTeacherService userTeacherService) { + this.userTeacherService = userTeacherService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserTeacher", response = Result.class) + public Result selectBackDetail(@PathVariable("id") Integer id) { + return Result.success(this.userTeacherService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 UserTeacher", response = Result.class) + public Result addBackUserTeacher(@Valid @RequestBody UserTeacher userTeacher) { + return Result.success(userTeacherService.insert(userTeacher)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 UserTeacher", response = Result.class) + public Result updateBackUserTeacher(@RequestBody UserTeacher userTeacher) { + return Result.success(userTeacherService.update(userTeacher)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 UserTeacher", response = Result.class) + public Result deleteBackUserTeacher(@PathVariable("id") Integer id) { + return Result.success(userTeacherService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 UserTeacher列表(分页)", response = Result.class) + public Result listBackUserTeacher(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(userTeacherService.queryAllByLimit(page, size)); + } + + @GetMapping("/list/name") + @ApiOperation(value = "依据老师名称 获取 UserTeacher列表", response = Result.class) + public Result listUserTeacherByName(@RequestParam String name) { + return Result.success(userTeacherService.queryByName(name)); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserTestHistoryController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserTestHistoryController.java new file mode 100644 index 0000000..8a073a5 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/BackUserTestHistoryController.java @@ -0,0 +1,64 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.UserTestHistory; +import com.hc.business.service.UserTestHistoryService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 用户考试记录表(UserTestHistory)表控制层 + * + * @author java + * @since 2020-12-07 11:28:22 + */ + +@RestController +@RequestMapping("/new/api/back/userTestHistory") +public class BackUserTestHistoryController { + + /** + * 服务对象 + */ + private final UserTestHistoryService userTestHistoryService; + + public BackUserTestHistoryController(UserTestHistoryService userTestHistoryService) { + this.userTestHistoryService = userTestHistoryService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserTestHistory", response = Result.class) + public Result selectBackUserTestHistory(@PathVariable("id") Integer id) { + return Result.success(this.userTestHistoryService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 UserTestHistory", response = Result.class) + public Result addBackUserTestHistory(@Valid @RequestBody UserTestHistory userTestHistory) { + return Result.success(userTestHistoryService.insert(userTestHistory)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 UserTestHistory", response = Result.class) + public Result updateBackUserTestHistory(@RequestBody UserTestHistory userTestHistory) { + return Result.success(userTestHistoryService.update(userTestHistory)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 UserTestHistory", response = Result.class) + public Result deleteBackUserTestHistory(@PathVariable("id") Integer id) { + return Result.success(userTestHistoryService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 UserTestHistory列表(分页)", response = Result.class) + public Result listBackUserTestHistory(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(userTestHistoryService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/CourseChapterAnnexController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/CourseChapterAnnexController.java new file mode 100644 index 0000000..21a0b86 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/CourseChapterAnnexController.java @@ -0,0 +1,64 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.CourseChapterAnnex; +import com.hc.business.service.CourseChapterAnnexService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 章节附件表(CourseChapterAnnex)表控制层 + * + * @author java + * @since 2020-11-09 10:04:50 + */ + +@RestController +@RequestMapping("/new/api/courseChapterAnnex") +public class CourseChapterAnnexController { + + /** + * 服务对象 + */ + private final CourseChapterAnnexService courseChapterAnnexService; + + public CourseChapterAnnexController(CourseChapterAnnexService courseChapterAnnexService) { + this.courseChapterAnnexService = courseChapterAnnexService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 CourseChapterAnnex", response = Result.class) + public Result selectDetail(@PathVariable("id") Integer id) { + return Result.success(this.courseChapterAnnexService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 CourseChapterAnnex", response = Result.class) + public Result addCourseChapterAnnex(@Valid @RequestBody CourseChapterAnnex courseChapterAnnex) { + return Result.success(courseChapterAnnexService.insert(courseChapterAnnex)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 CourseChapterAnnex", response = Result.class) + public Result updateCourseChapterAnnex(@RequestBody CourseChapterAnnex courseChapterAnnex) { + return Result.success(courseChapterAnnexService.update(courseChapterAnnex)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 CourseChapterAnnex", response = Result.class) + public Result deleteCourseChapterAnnex(@PathVariable("id") Integer id) { + return Result.success(courseChapterAnnexService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 CourseChapterAnnex列表(分页)", response = Result.class) + public Result listCourseChapterAnnex(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(courseChapterAnnexService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/CourseChapterController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/CourseChapterController.java new file mode 100644 index 0000000..094b525 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/CourseChapterController.java @@ -0,0 +1,64 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.CourseChapter; +import com.hc.business.service.CourseChapterService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 课程章节表(CourseChapter)表控制层 + * + * @author java + * @since 2020-11-09 10:04:48 + */ + +@RestController +@RequestMapping("/new/api/courseChapter") +public class CourseChapterController { + + /** + * 服务对象 + */ + private final CourseChapterService courseChapterService; + + public CourseChapterController(CourseChapterService courseChapterService) { + this.courseChapterService = courseChapterService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 CourseChapter", response = Result.class) + public Result selectDetail(@PathVariable("id") Integer id) { + return Result.success(this.courseChapterService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 CourseChapter", response = Result.class) + public Result addCourseChapter(@Valid @RequestBody CourseChapter courseChapter) { + return Result.success(courseChapterService.insert(courseChapter)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 CourseChapter", response = Result.class) + public Result updateCourseChapter(@RequestBody CourseChapter courseChapter) { + return Result.success(courseChapterService.update(courseChapter)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 CourseChapter", response = Result.class) + public Result deleteCourseChapter(@PathVariable("id") Integer id) { + return Result.success(courseChapterService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 CourseChapter列表(分页)", response = Result.class) + public Result listCourseChapter(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(courseChapterService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/CourseChapterTagController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/CourseChapterTagController.java new file mode 100644 index 0000000..bd3006c --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/CourseChapterTagController.java @@ -0,0 +1,64 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.CourseChapterTag; +import com.hc.business.service.CourseChapterTagService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 图书章节标签表。新建完成的图书章节,可以根据讲师不同,给不同的章节打标签,比如基础阶段,进阶阶段。。。(CourseChapterTag)表控制层 + * + * @author java + * @since 2020-11-09 10:04:52 + */ + +@RestController +@RequestMapping("/new/api/courseChapterTag") +public class CourseChapterTagController { + + /** + * 服务对象 + */ + private final CourseChapterTagService courseChapterTagService; + + public CourseChapterTagController(CourseChapterTagService courseChapterTagService) { + this.courseChapterTagService = courseChapterTagService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 CourseChapterTag", response = Result.class) + public Result selectDetail(@PathVariable("id") Integer id) { + return Result.success(this.courseChapterTagService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 CourseChapterTag", response = Result.class) + public Result addCourseChapterTag(@Valid @RequestBody CourseChapterTag courseChapterTag) { + return Result.success(courseChapterTagService.insert(courseChapterTag)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 CourseChapterTag", response = Result.class) + public Result updateCourseChapterTag(@RequestBody CourseChapterTag courseChapterTag) { + return Result.success(courseChapterTagService.update(courseChapterTag)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 CourseChapterTag", response = Result.class) + public Result deleteCourseChapterTag(@PathVariable("id") Integer id) { + return Result.success(courseChapterTagService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 CourseChapterTag列表(分页)", response = Result.class) + public Result listCourseChapterTag(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(courseChapterTagService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/CourseChapterTestController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/CourseChapterTestController.java new file mode 100644 index 0000000..a671c78 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/CourseChapterTestController.java @@ -0,0 +1,64 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.CourseChapterTest; +import com.hc.business.service.CourseChapterTestService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 章节测试表/随堂练习表(CourseChapterTest)表控制层 + * + * @author java + * @since 2020-11-09 10:04:54 + */ + +@RestController +@RequestMapping("/new/api/courseChapterTest") +public class CourseChapterTestController { + + /** + * 服务对象 + */ + private final CourseChapterTestService courseChapterTestService; + + public CourseChapterTestController(CourseChapterTestService courseChapterTestService) { + this.courseChapterTestService = courseChapterTestService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 CourseChapterTest", response = Result.class) + public Result selectDetail(@PathVariable("id") Integer id) { + return Result.success(this.courseChapterTestService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 CourseChapterTest", response = Result.class) + public Result addCourseChapterTest(@Valid @RequestBody CourseChapterTest courseChapterTest) { + return Result.success(courseChapterTestService.insert(courseChapterTest)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 CourseChapterTest", response = Result.class) + public Result updateCourseChapterTest(@RequestBody CourseChapterTest courseChapterTest) { + return Result.success(courseChapterTestService.update(courseChapterTest)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 CourseChapterTest", response = Result.class) + public Result deleteCourseChapterTest(@PathVariable("id") Integer id) { + return Result.success(courseChapterTestService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 CourseChapterTest列表(分页)", response = Result.class) + public Result listCourseChapterTest(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(courseChapterTestService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/CourseChapterVideoController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/CourseChapterVideoController.java new file mode 100644 index 0000000..38cfbf6 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/back/CourseChapterVideoController.java @@ -0,0 +1,64 @@ +package com.hc.web.controller.browser.back; + +import com.hc.business.model.CourseChapterVideo; +import com.hc.business.service.CourseChapterVideoService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 课程视频(CourseChapterVideo)表控制层 + * + * @author java + * @since 2020-11-09 10:04:56 + */ + +@RestController +@RequestMapping("/new/api/courseChapterVideo") +public class CourseChapterVideoController { + + /** + * 服务对象 + */ + private final CourseChapterVideoService courseChapterVideoService; + + public CourseChapterVideoController(CourseChapterVideoService courseChapterVideoService) { + this.courseChapterVideoService = courseChapterVideoService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 CourseChapterVideo", response = Result.class) + public Result selectDetail(@PathVariable("id") Integer id) { + return Result.success(this.courseChapterVideoService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 CourseChapterVideo", response = Result.class) + public Result addCourseChapterVideo(@Valid @RequestBody CourseChapterVideo courseChapterVideo) { + return Result.success(courseChapterVideoService.insert(courseChapterVideo)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 CourseChapterVideo", response = Result.class) + public Result updateCourseChapterVideo(@RequestBody CourseChapterVideo courseChapterVideo) { + return Result.success(courseChapterVideoService.update(courseChapterVideo)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 CourseChapterVideo", response = Result.class) + public Result deleteCourseChapterVideo(@PathVariable("id") Integer id) { + return Result.success(courseChapterVideoService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 CourseChapterVideo列表(分页)", response = Result.class) + public Result listCourseChapterVideo(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(courseChapterVideoService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/common/CommonController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/common/CommonController.java new file mode 100644 index 0000000..14ebcb8 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/common/CommonController.java @@ -0,0 +1,33 @@ +package com.hc.web.controller.browser.common; + +import com.hc.core.utils.oss.QiNiuUtil; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author JIA + */ + +@RestController +@RequestMapping("/new/api/common") +public class CommonController { + + private final QiNiuUtil qiNiuUtil; + + @Autowired + public CommonController(QiNiuUtil qiNiuUtil) { + this.qiNiuUtil = qiNiuUtil; + } + + @GetMapping("/upToken") + @ApiOperation(value = "", response = Result.class) + public Result getUpToken() { + return Result.success(qiNiuUtil.getUpToken()); + } + +} + diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontAliPayController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontAliPayController.java new file mode 100644 index 0000000..3e79a30 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontAliPayController.java @@ -0,0 +1,52 @@ +package com.hc.web.controller.browser.front; + +import com.alipay.api.AlipayApiException; +import com.hc.business.service.AliPayService; +import com.hc.core.utils.pay.browser.alipay.bean.AliPayBean; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.ServletRequestBindingException; +import org.springframework.web.bind.ServletRequestUtils; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; + +/** + * @author 10696 + */ + +@RestController +@RequestMapping("/new/api/front/ali") +@Slf4j +public class FrontAliPayController { + + /** + * 服务对象 + */ + private final AliPayService aliPayService; + + public FrontAliPayController(AliPayService aliPayService) { + this.aliPayService = aliPayService; + } + + @PostMapping("/pay") + @ApiOperation(value = "阿里云支付", response = Result.class) + public Result alipay(@Valid @RequestBody AliPayBean aliPayBean) throws AlipayApiException { + return Result.success(aliPayService.alipay(aliPayBean)); + } + + @PostMapping("/notify") + public void returnNotifyUrlInfo(HttpServletRequest request) throws ServletRequestBindingException { + String outTradeNo = ServletRequestUtils.getRequiredStringParameter(request, "out_trade_no"); + String tradeNo = ServletRequestUtils.getRequiredStringParameter(request, "trade_no"); + String tradeStatus = ServletRequestUtils.getRequiredStringParameter(request, "trade_status"); + aliPayService.returnNotifyUrlInfo(outTradeNo, tradeNo, tradeStatus); + } + + +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontAreaDistrictController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontAreaDistrictController.java new file mode 100644 index 0000000..d21ebb8 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontAreaDistrictController.java @@ -0,0 +1,41 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.service.AreaDistrictService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +/** + * (AreaDistrict)表控制层 + * + * @author java + * @since 2020-11-20 16:06:50 + */ + +@RestController +@RequestMapping("/new/api/front/areaDistrict") +public class FrontAreaDistrictController { + + /** + * 服务对象 + */ + private final AreaDistrictService areaDistrictService; + + public FrontAreaDistrictController(AreaDistrictService areaDistrictService) { + this.areaDistrictService = areaDistrictService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 AreaDistrict", response = Result.class) + public Result selectFrontAreaDistrict(@PathVariable("id") Integer id) { + return Result.success(areaDistrictService.queryById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 AreaDistrict列表(分页)", response = Result.class) + public Result listFrontAreaDistrict(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(areaDistrictService.queryAllByLimit(page, size)); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontBannerController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontBannerController.java new file mode 100644 index 0000000..0882f3d --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontBannerController.java @@ -0,0 +1,44 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.service.BannerService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + + +/** + * 广告表 + * (Banner)表控制层 + * + * @author java + * @since 2020-11-26 09:29:54 + */ + +@RestController +@RequestMapping("/new/api/front/banner") +public class FrontBannerController { + + /** + * 服务对象 + */ + private final BannerService bannerService; + + public FrontBannerController(BannerService bannerService) { + this.bannerService = bannerService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 Banner", response = Result.class) + public Result selectFrontDetail(@PathVariable("id") Integer id) { + return Result.success(this.bannerService.queryById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 Banner列表(分页)", response = Result.class) + public Result listFrontBanner(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(bannerService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontClassConfigController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontClassConfigController.java new file mode 100644 index 0000000..22febff --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontClassConfigController.java @@ -0,0 +1,67 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.service.ClassConfigService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + + +/** + * 班次表(ClassConfig)表控制层 + * + * @author java + * @since 2020-11-19 16:12:35 + */ + +@RestController +@RequestMapping("/new/api/front/classConfig") +public class FrontClassConfigController { + + /** + * 服务对象 + */ + private final ClassConfigService classConfigService; + + public FrontClassConfigController(ClassConfigService classConfigService) { + this.classConfigService = classConfigService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 ClassConfig", response = Result.class) + public Result selectFrontDetail(@PathVariable("id") Integer id) { + return Result.success(this.classConfigService.queryById(id)); + } + + @GetMapping("/valid/list") + @ApiOperation(value = "获取 ClassConfig列表(分页)", response = Result.class) + public Result listFrontClassConfigByValid(@ApiParam(value = "状态") @RequestParam Integer valid, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(classConfigService.queryByValid(valid, page, size)); + } + + @GetMapping("/list/name") + @ApiOperation(value = "依据名称 获取 ClassConfig列表", response = Result.class) + public Result listFrontClassConfigByName(@ApiParam(value = "培训班名称") @RequestParam String name) { + return Result.success(classConfigService.queryByClassName(name)); + } + + @GetMapping("/area/list") + @ApiOperation(value = "获取 ClassConfig列表(分页) 地区id", response = Result.class) + public Result listFrontClassConfigByAreaId(@ApiParam(value = "地区id") @RequestParam Integer areaId, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(classConfigService.queryByAreaId(areaId, page, size)); + } + + @GetMapping("/time/list") + @ApiOperation(value = "获取 ClassConfig列表(分页) 学习时间", response = Result.class) + public Result listByStudyStartTime(@ApiParam(value = "开始学习时间") @RequestParam Long studyStartTime, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(classConfigService.queryByTime(studyStartTime, page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontClassConfigSponsorController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontClassConfigSponsorController.java new file mode 100644 index 0000000..c777dba --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontClassConfigSponsorController.java @@ -0,0 +1,44 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.service.ClassConfigSponsorService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + + +/** + * (ClassConfigSponsor)表控制层 + * + * @author java + * @since 2021-05-28 14:11:29 + */ + +@RestController +@RequestMapping("/new/api/front/classConfigSponsor") +public class FrontClassConfigSponsorController { + + /** + * 服务对象 + */ + private final ClassConfigSponsorService classConfigSponsorService; + + public FrontClassConfigSponsorController(ClassConfigSponsorService classConfigSponsorService) { + this.classConfigSponsorService = classConfigSponsorService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 ClassConfigSponsor", response = Result.class) + public Result selectClassConfigSponsor(@PathVariable("id") Integer id) { + return Result.success(this.classConfigSponsorService.queryById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 ClassConfigSponsor列表(分页)", response = Result.class) + public Result listClassConfigSponsor(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size, + @RequestParam(required = false) Integer classId) { + return Result.success(classConfigSponsorService.queryAllByLimit(page, size, classId)); + } + + +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontClassCourseController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontClassCourseController.java new file mode 100644 index 0000000..60cccdb --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontClassCourseController.java @@ -0,0 +1,51 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.service.ClassCourseService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + + +/** + * 班次课程表(ClassCourse)表控制层 + * + * @author java + * @since 2020-11-24 11:30:12 + */ + +@RestController +@RequestMapping("/new/api/front/classCourse") +public class FrontClassCourseController { + + /** + * 服务对象 + */ + private final ClassCourseService classCourseService; + + public FrontClassCourseController(ClassCourseService classCourseService) { + this.classCourseService = classCourseService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 ClassCourse", response = Result.class) + public Result selectFrontDetail(@PathVariable("id") Integer id) { + return Result.success(this.classCourseService.queryById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 ClassCourse列表(分页)", response = Result.class) + public Result listFrontClassCourse(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(classCourseService.queryAllByLimit(page, size)); + } + + @GetMapping("/course") + @ApiOperation(value = "获取班级 必修/选修课程", response = Result.class) + public Result listFrontClassCourseByParam(@ApiParam(value = "班次id") @RequestParam Integer classId, + @ApiParam(value = "课程类别") @RequestParam(required = false) Integer courseType, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(classCourseService.queryByClassId(classId, courseType, page, size)); + } +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontCourseController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontCourseController.java new file mode 100644 index 0000000..ede91b9 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontCourseController.java @@ -0,0 +1,101 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.model.UserVideoPosition; +import com.hc.business.service.CourseService; +import com.hc.business.service.UserVideoPositionService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +/** + * 课程表(Course)表控制层 + * + * @author java + * @since 2020-11-09 10:04:46 + */ + +@RestController +@RequestMapping("/new/api/front/course") +public class FrontCourseController { + + /** + * 服务对象 + */ + private final CourseService courseService; + private final UserVideoPositionService userVideoPositionService; + + public FrontCourseController(CourseService courseServices, + UserVideoPositionService userVideoPositionService) { + this.courseService = courseServices; + this.userVideoPositionService = userVideoPositionService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 Course", response = Result.class) + public Result selectFrontDetail(@PathVariable("id") Integer id) { + return Result.success(this.courseService.queryById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 Course列表(分页)", response = Result.class) + public Result listFrontCourse(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size, + @RequestParam(defaultValue = "1") Integer valid) { + return Result.success(courseService.queryAllByLimit(page, size, valid)); + } + + @GetMapping("/list/teacher") + @ApiOperation(value = "依据老师名称获取 Course列表(分页)", response = Result.class) + public Result queryTeacherName(@ApiParam(value = "老师名称") @RequestParam String name) { + return Result.success(courseService.queryTeacherName(name)); + } + + @GetMapping("/list/name") + @ApiOperation(value = "依据课程名称获取 Course列表(分页)", response = Result.class) + public Result queryCourseName(@ApiParam(value = "课程名称") @RequestParam String name) { + return Result.success(courseService.queryCourseName(name)); + } + + @GetMapping("/list/type") + @ApiOperation(value = "获取 type分类下的 Course列表(分页)", response = Result.class) + public Result queryAllByLimitAndTypeId(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size, + @ApiParam(value = "类别id") @RequestParam Integer typeId) { + return Result.success(courseService.queryAllByLimitAndTypeId(page, size, typeId)); + } + + @GetMapping("/list/video") + @ApiOperation(value = "获取 课程下得video list", response = Result.class) + public Result queryAllVideos(@ApiParam(value = "课程id") @RequestParam Integer courseId) { + return Result.success(courseService.getAllVideos(courseId)); + } + + @PostMapping("/position") + @ApiOperation(value = "添加一个视频播放记录redis 视频播放时一直调用", response = Result.class) + public Result insertFrontPosition(@RequestBody UserVideoPosition userVideoPosition, + @RequestParam Integer courseId) { + return Result.success(userVideoPositionService.insertPositionToRedis(userVideoPosition, courseId)); + } + + + @PostMapping("/flush") + @ApiOperation(value = "添加一个视频播放记录dataBase 视频停止或者返回时调用 ", response = Result.class) + public Result insertFrontPositionData(@RequestParam Integer courseId, + @RequestParam Integer videoId, + @RequestParam Integer userId, + @RequestParam String years, + @RequestParam Integer classId) { + return Result.success(userVideoPositionService.flushToDb(userId, videoId, courseId, years, classId)); + } + + @GetMapping("/getCourseVideoPosition") + @ApiOperation(value = "获取一个课程下所有的视频以及某个用户的播放进度", response = Result.class) + public Result getCourseChapterAndVideoPosition(@RequestParam Integer courseId, + @RequestParam Integer userId, + @RequestParam Integer classId) { + return Result.success(courseService.getCourseChapterAndVideoPosition(courseId, userId, classId)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontCourseTypeController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontCourseTypeController.java new file mode 100644 index 0000000..bf8eed7 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontCourseTypeController.java @@ -0,0 +1,43 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.service.CourseTypeService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + + +/** + * (CourseType)表控制层 + * + * @author java + * @since 2020-12-17 14:12:55 + */ + +@RestController +@RequestMapping("/new/api/front/courseType") +public class FrontCourseTypeController { + + /** + * 服务对象 + */ + private final CourseTypeService courseTypeService; + + public FrontCourseTypeController(CourseTypeService courseTypeService) { + this.courseTypeService = courseTypeService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 CourseType", response = Result.class) + public Result selectFrontCourseType(@PathVariable("id") Integer id) { + return Result.success(this.courseTypeService.queryById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 CourseType列表(分页)", response = Result.class) + public Result listFrontCourseType(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(courseTypeService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontNewsController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontNewsController.java new file mode 100644 index 0000000..9147f0a --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontNewsController.java @@ -0,0 +1,44 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.service.NewsService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +/** + * 新闻表 + * (News)表控制层 + * + * @author java + * @since 2020-11-20 11:48:39 + */ + +@RestController +@RequestMapping("/new/api/front/news") +public class FrontNewsController { + + /** + * 服务对象 + */ + private final NewsService newsService; + + public FrontNewsController(NewsService newsService) { + this.newsService = newsService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 News", response = Result.class) + public Result selectFrontDetail(@PathVariable("id") Integer id) { + return Result.success(this.newsService.queryById(id)); + } + + @GetMapping("/tag/{tagId}") + @ApiOperation(value = "依据tagId获取 News", response = Result.class) + public Result selectFrontByTagId(@ApiParam(value = "标签id") @PathVariable("tagId") Integer tagId, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(this.newsService.queryListByTagId(tagId, page, size)); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontNewsTagController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontNewsTagController.java new file mode 100644 index 0000000..a37058d --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontNewsTagController.java @@ -0,0 +1,36 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.service.NewsTagService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; + +import org.springframework.web.bind.annotation.*; + + +/** + * 新闻标签表(NewsTag)表控制层 + * + * @author java + * @since 2020-11-20 12:52:34 + */ + +@RestController +@RequestMapping("/new/api/front/newsTag") +public class FrontNewsTagController { + + /** + * 服务对象 + */ + private final NewsTagService newsTagService; + + public FrontNewsTagController(NewsTagService newsTagService) { + this.newsTagService = newsTagService; + } + + @GetMapping("/list") + @ApiOperation(value = "获取 NewsTag列表", response = Result.class) + public Result listFrontNewsTag() { + return Result.success(newsTagService.queryAll()); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontOrderUserLogController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontOrderUserLogController.java new file mode 100644 index 0000000..2a2734e --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontOrderUserLogController.java @@ -0,0 +1,60 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.model.OrderUserLog; +import com.hc.business.service.OrderUserLogService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + + +/** + * (OrderUserLog)表控制层 + * + * @author java + * @since 2020-12-03 09:25:12 + */ + +@RestController +@RequestMapping("/new/api/front/orderUserLog") +public class FrontOrderUserLogController { + + /** + * 服务对象 + */ + private final OrderUserLogService orderUserLogService; + + public FrontOrderUserLogController(OrderUserLogService orderUserLogService) { + this.orderUserLogService = orderUserLogService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 OrderUserLog", response = Result.class) + public Result selectFrontOrderUserLog(@PathVariable("id") Integer id) { + return Result.success(this.orderUserLogService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 OrderUserLog", response = Result.class) + public Result addFrontOrderUserLog(@Valid @RequestBody OrderUserLog orderUserLog) { + return Result.success(orderUserLogService.insert(orderUserLog)); + } + + @GetMapping("/order/{orderId}") + @ApiOperation(value = "依据订单id 获取 OrderUserLog", response = Result.class) + public Result selectOrderUserLogByOrderId(@ApiParam(value = "订单id") @PathVariable("orderId") Integer orderId) { + return Result.success(orderUserLogService.queryListByOrderId(orderId)); + } + + @PostMapping("/insert/list") + @ApiOperation(value = "批量 新增 OrderUserLog", response = Result.class) + public Result addFrontOrderUserLogList(@RequestBody List orderUserLogList) { + orderUserLogList.forEach(orderUserLogService::insert); + return Result.success(orderUserLogList); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontOrdersController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontOrdersController.java new file mode 100644 index 0000000..d755857 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontOrdersController.java @@ -0,0 +1,74 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.model.Orders; +import com.hc.business.service.OrdersService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.apache.commons.lang3.RandomStringUtils; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 订单表(Orders)表控制层 + * + * @author java + * @since 2020-11-26 16:46:48 + */ + +@RestController +@RequestMapping("/new/api/front/orders") +public class FrontOrdersController { + + /** + * 服务对象 + */ + private final OrdersService ordersService; + + public FrontOrdersController(OrdersService ordersService) { + this.ordersService = ordersService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 Orders", response = Result.class) + public Result selectFrontDetail(@PathVariable("id") Integer id) { + return Result.success(this.ordersService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 Orders", response = Result.class) + public Result addFrontOrders(@Valid @RequestBody Orders orders) { + return Result.success(ordersService.insert(orders)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 Orders", response = Result.class) + public Result deleteFrontOrders(@PathVariable("id") Integer id) { + return Result.success(ordersService.deleteById(id)); + } + + @GetMapping("/list/userInvoices") + @ApiOperation(value = "获取 发票 Orders列表(分页)", response = Result.class) + public Result listFrontOrdersByUserInvoicesId(@ApiParam(value = "发票id") @RequestParam Integer userInvoicesId) { + return Result.success(ordersService.queryByUserInvoicesId(userInvoicesId)); + } + + + @GetMapping("/list/user") + @ApiOperation(value = "获取 用户 Orders列表(分页)", response = Result.class) + public Result listFrontOrdersByUserId(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size, + @ApiParam(value = "用户id") @RequestParam Integer userId) { + return Result.success(ordersService.queryAllByUserId(page, size, userId)); + } + + @GetMapping("/create/no") + @ApiOperation(value = "创建一条订单编号", response = Result.class) + public Result createOrderNo() { + return Result.success(ordersService.createOrderNo()); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontPaperController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontPaperController.java new file mode 100644 index 0000000..41a2e8a --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontPaperController.java @@ -0,0 +1,43 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.service.PaperService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + + +/** + * 试卷表(Paper)表控制层 + * + * @author java + * @since 2020-12-07 11:34:40 + */ + +@RestController +@RequestMapping("/new/api/front/paper") +public class FrontPaperController { + + /** + * 服务对象 + */ + private final PaperService paperService; + + public FrontPaperController(PaperService paperService) { + this.paperService = paperService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 Paper", response = Result.class) + public Result selectFrontPaper(@PathVariable("id") Integer id) { + return Result.success(this.paperService.queryById(id)); + } + + @GetMapping("/detail") + @ApiOperation(value = "前台用户获取 Paper", response = Result.class) + public Result selectFrontPaperDetail(@ApiParam(value = "试卷id") @RequestParam Integer paperId) { + return Result.success(paperService.queryQuestionList(paperId)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontPaperQuestionController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontPaperQuestionController.java new file mode 100644 index 0000000..0e9dde9 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontPaperQuestionController.java @@ -0,0 +1,37 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.service.PaperQuestionService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +/** + * 随机试卷问题表(PaperQuestion)表控制层 + * + * @author java + * @since 2020-12-07 11:35:16 + */ + +@RestController +@RequestMapping("/new/api/front/paperQuestion") +public class FrontPaperQuestionController { + + /** + * 服务对象 + */ + private final PaperQuestionService paperQuestionService; + + public FrontPaperQuestionController(PaperQuestionService paperQuestionService) { + this.paperQuestionService = paperQuestionService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 PaperQuestion", response = Result.class) + public Result selectFrontPaperQuestion(@PathVariable("id") Integer id) { + return Result.success(this.paperQuestionService.queryById(id)); + } + + + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontQuestionAnswerController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontQuestionAnswerController.java new file mode 100644 index 0000000..60ccfa1 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontQuestionAnswerController.java @@ -0,0 +1,36 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.service.QuestionAnswerService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + + +/** + * 问题答案表(QuestionAnswer)表控制层 + * + * @author java + * @since 2020-12-07 11:36:23 + */ + +@RestController +@RequestMapping("/new/api/front/questionAnswer") +public class FrontQuestionAnswerController { + + /** + * 服务对象 + */ + private final QuestionAnswerService questionAnswerService; + + public FrontQuestionAnswerController(QuestionAnswerService questionAnswerService) { + this.questionAnswerService = questionAnswerService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 QuestionAnswer", response = Result.class) + public Result selectFrontQuestionAnswer(@PathVariable("id") Integer id) { + return Result.success(this.questionAnswerService.queryById(id)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontQuestionController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontQuestionController.java new file mode 100644 index 0000000..89e84b6 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontQuestionController.java @@ -0,0 +1,42 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.service.QuestionService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +/** + * 习题表(Question)表控制层 + * + * @author java + * @since 2020-12-07 11:35:59 + */ + +@RestController +@RequestMapping("/new/api/front/question") +public class FrontQuestionController { + + /** + * 服务对象 + */ + private final QuestionService questionService; + + public FrontQuestionController(QuestionService questionService) { + this.questionService = questionService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 Question", response = Result.class) + public Result selectFrontQuestion(@PathVariable("id") Integer id) { + return Result.success(this.questionService.queryById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 Question列表(分页)", response = Result.class) + public Result listFrontQuestion(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(questionService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontQuestionTagController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontQuestionTagController.java new file mode 100644 index 0000000..ce604f4 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontQuestionTagController.java @@ -0,0 +1,35 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.service.QuestionTagService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +/** + * 问题标签表(QuestionTag)表控制层 + * + * @author java + * @since 2020-12-07 11:36:44 + */ + +@RestController +@RequestMapping("/new/api/front/questionTag") +public class FrontQuestionTagController { + + /** + * 服务对象 + */ + private final QuestionTagService questionTagService; + + public FrontQuestionTagController(QuestionTagService questionTagService) { + this.questionTagService = questionTagService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 QuestionTag", response = Result.class) + public Result selectDetail(@PathVariable("id") Integer id) { + return Result.success(this.questionTagService.queryById(id)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontQuestionTypeController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontQuestionTypeController.java new file mode 100644 index 0000000..1bf791c --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontQuestionTypeController.java @@ -0,0 +1,43 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.service.QuestionTypeService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + + +/** + * 问题类型表(QuestionType)表控制层 + * + * @author java + * @since 2020-12-07 11:37:04 + */ + +@RestController +@RequestMapping("/new/api/front/questionType") +public class FrontQuestionTypeController { + + /** + * 服务对象 + */ + private final QuestionTypeService questionTypeService; + + public FrontQuestionTypeController(QuestionTypeService questionTypeService) { + this.questionTypeService = questionTypeService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 QuestionType", response = Result.class) + public Result selectFrontQuestionType(@PathVariable("id") Integer id) { + return Result.success(this.questionTypeService.queryById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 QuestionType列表(分页)", response = Result.class) + public Result listFrontQuestionType(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(questionTypeService.queryAllByLimit(page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserAdviseController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserAdviseController.java new file mode 100644 index 0000000..c28588a --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserAdviseController.java @@ -0,0 +1,56 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.model.UserAdvise; +import com.hc.business.service.UserAdviseService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 用户建议表 + * (UserAdvise)表控制层 + * + * @author java + * @since 2020-11-16 14:20:06 + */ + +@RestController +@RequestMapping("/new/api/front/userAdvise") +public class FrontUserAdviseController { + + /** + * 服务对象 + */ + private final UserAdviseService userAdviseService; + + public FrontUserAdviseController(UserAdviseService userAdviseService) { + this.userAdviseService = userAdviseService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserAdvise", response = Result.class) + public Result selectFrontDetail(@PathVariable("id") Integer id) { + return Result.success(this.userAdviseService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 UserAdvise", response = Result.class) + public Result addUserAdvise(@Valid @RequestBody UserAdvise userAdvise) { + userAdvise.setAdviceType(2); + return Result.success(userAdviseService.insert(userAdvise)); + } + + @GetMapping("/user/{userId}") + @ApiOperation(value = "依据用户id获取 UserAdvise", response = Result.class) + public Result listFrontUserAdviseById(@ApiParam(value = "用户id") + @PathVariable("userId") Integer userId, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(this.userAdviseService.queryAllByUserId(userId, page, size)); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserClassLogController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserClassLogController.java new file mode 100644 index 0000000..e2bd8da --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserClassLogController.java @@ -0,0 +1,31 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.service.UserStatusService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author 10696 + * @since 2020/12/6 13:53 + */ + +@RestController +@RequestMapping("/new/api/front/userClassLog") +public class FrontUserClassLogController { + + @Autowired + private UserStatusService userStatusService; + + @GetMapping("/{userId}") + @ApiOperation(value = "依据用户id查询 userClassLog ", response = Result.class) + public Result selectUserStatusLog(@ApiParam(value = "用户id") @PathVariable("userId") Integer userId) { + return Result.success(this.userStatusService.queryDtoByUserId(userId)); + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserController.java new file mode 100644 index 0000000..6b7dd7d --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserController.java @@ -0,0 +1,92 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.dto.RetrievePasswordDto; +import com.hc.business.dto.SmsLoginDto; +import com.hc.business.model.User; +import com.hc.business.model.login.AuthEntity; +import com.hc.business.service.UserService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.apache.commons.lang3.StringUtils; +import org.springframework.web.bind.annotation.*; + + +import javax.validation.Valid; + + +/** + * 用户表(User)表控制层 + * + * @author java + * @since 2020-11-09 10:04:14 + */ + +@RestController +@RequestMapping("/new/api/front/user") +public class FrontUserController { + + /** + * 服务对象 + */ + private final UserService userService; + + public FrontUserController(UserService userService) { + this.userService = userService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 User", response = Result.class) + public Result selectFrontDetail(@PathVariable("id") Integer id) { + return Result.success(this.userService.queryById(id)); + } + + @PostMapping("/login") + @ApiOperation(value = "用户登录(账号,密码)", response = Result.class) + public Result userLogin(@RequestBody AuthEntity authEntity) { + return Result.success(userService.userLogin(authEntity)); + } + + @PostMapping("/login/sms") + @ApiOperation(value = "用户登录(短信登录)", response = Result.class) + public Result userLoginSms(@Valid @RequestBody SmsLoginDto smsLoginDto) { + return Result.success(userService.userLoginSms(smsLoginDto)); + } + + @PostMapping("/register") + @ApiOperation(value = "用户注册", response = Result.class) + public Result userRegister(@Valid @RequestBody RetrievePasswordDto retrievePasswordDto) { + return Result.success(userService.userRegister(retrievePasswordDto)); + } + + @PostMapping("/send") + @ApiOperation(value = "短信发送验证码", response = Result.class) + public Result sendAuthCode(@ApiParam(value = "手机号") @RequestParam String userMobile) { + return Result.success(userService.sendAuthCode(userMobile)); + } + + @GetMapping("/mobile") + @ApiOperation(value = "依据手机号查询用户", response = Result.class) + public Result queryByMobile(@ApiParam(value = "手机号") @RequestParam String userMobile) { + return Result.success(userService.queryByMobile(userMobile)); + } + + @PostMapping("/retrievePassword") + @ApiOperation(value = "找回密码", response = Result.class) + public Result retrievePassword(@Valid @RequestBody RetrievePasswordDto retrievePasswordDto) { + return Result.success(userService.retrievePassword(retrievePasswordDto)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 User", response = Result.class) + public Result addUser(@Valid @RequestBody User user) { + return Result.success(userService.insert(user)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 User", response = Result.class) + public Result updateUser(@RequestBody User user) { + return Result.success(userService.update(user)); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserCourseController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserCourseController.java new file mode 100644 index 0000000..3901ea1 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserCourseController.java @@ -0,0 +1,55 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.model.UserCourse; +import com.hc.business.service.UserCourseService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 用户课程表(UserCourse)表控制层 + * + * @author java + * @since 2020-11-09 10:05:20 + */ + +@RestController +@RequestMapping("/new/api/front/userCourse") +public class FrontUserCourseController { + + /** + * 服务对象 + */ + private final UserCourseService userCourseService; + + public FrontUserCourseController(UserCourseService userCourseService) { + this.userCourseService = userCourseService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserCourse", response = Result.class) + public Result selectDetail(@PathVariable("id") Integer id) { + return Result.success(this.userCourseService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 UserCourse", response = Result.class) + public Result addUserCourse(@Valid @RequestBody UserCourse userCourse) { + return Result.success(userCourseService.insert(userCourse)); + } + + @GetMapping("/list") + @ApiOperation(value = "根据用户id 获取 UserCourse列表(分页)", response = Result.class) + public Result listUserCourse(@ApiParam(value = "用户id") @RequestParam Integer userId, + @ApiParam(value = "班次id") @RequestParam Integer classId, + @RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(userCourseService.queryAllByLimit(userId, classId, page, size)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserInvoicesController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserInvoicesController.java new file mode 100644 index 0000000..a450b94 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserInvoicesController.java @@ -0,0 +1,51 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.model.UserInvoices; +import com.hc.business.service.UserInvoicesService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 用户发票表(UserInvoices)表控制层 + * + * @author java + * @since 2020-12-02 10:50:41 + */ + +@RestController +@RequestMapping("/new/api/front/userInvoices") +public class FrontUserInvoicesController { + + /** + * 服务对象 + */ + private final UserInvoicesService userInvoicesService; + + public FrontUserInvoicesController(UserInvoicesService userInvoicesService) { + this.userInvoicesService = userInvoicesService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserInvoices", response = Result.class) + public Result selectFrontUserInvoices(@PathVariable("id") Integer id) { + return Result.success(this.userInvoicesService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 UserInvoices", response = Result.class) + public Result addFrontUserInvoices(@Valid @RequestBody UserInvoices userInvoices) { + return Result.success(userInvoicesService.insert(userInvoices)); + } + + @GetMapping("/user/{userId}") + @ApiOperation(value = "获取用户发票信息", response = Result.class) + public Result queryDetailByUserId(@ApiParam(value = "用户id") @PathVariable("userId") Integer userId) { + return Result.success(userInvoicesService.queryDetailByUserId(userId)); + } + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserRefundHistoryController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserRefundHistoryController.java new file mode 100644 index 0000000..e3d1c2b --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserRefundHistoryController.java @@ -0,0 +1,46 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.model.UserRefundHistory; +import com.hc.business.service.UserRefundHistoryService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 用户退款记录表(UserRefundHistory)表控制层 + * + * @author java + * @since 2020-12-10 11:31:45 + */ + +@RestController +@RequestMapping("/new/api/front/userRefundHistory") +public class FrontUserRefundHistoryController { + + /** + * 服务对象 + */ + private final UserRefundHistoryService userRefundHistoryService; + + public FrontUserRefundHistoryController(UserRefundHistoryService userRefundHistoryService) { + this.userRefundHistoryService = userRefundHistoryService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserRefundHistory", response = Result.class) + public Result selectFrontUserRefundHistory(@PathVariable("id") Integer id) { + return Result.success(this.userRefundHistoryService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 UserRefundHistory", response = Result.class) + public Result addFrontUserRefundHistory(@Valid @RequestBody UserRefundHistory userRefundHistory) { + return Result.success(userRefundHistoryService.insert(userRefundHistory)); + } + + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserTeacherController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserTeacherController.java new file mode 100644 index 0000000..127c6dd --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserTeacherController.java @@ -0,0 +1,48 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.service.UserTeacherService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +/** + * (UserTeacher)表控制层 + * + * @author java + * @since 2020-11-20 11:08:21 + */ + +@RestController +@RequestMapping("/new/api/front/userTeacher") +public class FrontUserTeacherController { + + /** + * 服务对象 + */ + private final UserTeacherService userTeacherService; + + public FrontUserTeacherController(UserTeacherService userTeacherService) { + this.userTeacherService = userTeacherService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserTeacher", response = Result.class) + public Result selectFrontDetail(@PathVariable("id") Integer id) { + return Result.success(this.userTeacherService.queryById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 UserTeacher列表(分页)", response = Result.class) + public Result listFrontUserTeacher(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(userTeacherService.queryAllByLimit(page, size)); + } + + @GetMapping("/list/name") + @ApiOperation(value = "依据老师名称 获取 UserTeacher列表", response = Result.class) + public Result listUserTeacherByName(@RequestParam String name) { + return Result.success(userTeacherService.queryByName(name)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserTestHistoryController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserTestHistoryController.java new file mode 100644 index 0000000..f7cb4bb --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserTestHistoryController.java @@ -0,0 +1,101 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.dto.PaperCommitDTO; +import com.hc.business.model.ClassConfig; +import com.hc.business.model.Paper; +import com.hc.business.model.UserStatus; +import com.hc.business.model.UserTestHistory; +import com.hc.business.service.ClassConfigService; +import com.hc.business.service.PaperService; +import com.hc.business.service.UserStatusService; +import com.hc.business.service.UserTestHistoryService; +import com.hc.core.utils.exception.ResponseException; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.HashMap; +import java.util.Map; + + +/** + * 用户考试记录表(UserTestHistory)表控制层 + * + * @author java + * @since 2020-12-07 11:28:22 + */ + +@RestController +@RequestMapping("/new/api/front/userTestHistory") +public class FrontUserTestHistoryController { + + /** + * 服务对象 + */ + private final UserTestHistoryService userTestHistoryService; + + private final PaperService paperService; + + private final ClassConfigService classConfigService; + + private final UserStatusService userStatusService; + + public FrontUserTestHistoryController(UserTestHistoryService userTestHistoryService, + PaperService paperService, + ClassConfigService classConfigService, + UserStatusService userStatusService) { + this.userTestHistoryService = userTestHistoryService; + this.paperService = paperService; + this.classConfigService = classConfigService; + this.userStatusService = userStatusService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserTestHistory", response = Result.class) + public Result selectFrontUserTestHistory(@PathVariable("id") Integer id) { + return Result.success(this.userTestHistoryService.queryById(id)); + } + + @PostMapping("/commit") + @ApiOperation(value = "提交试卷,获取成绩", response = Result.class) + public Result paperCommit(@Valid @RequestBody PaperCommitDTO paperCommitDTO) { + return paperService.paperCommit(paperCommitDTO); + } + + @GetMapping("/max") + @ApiOperation(value = "获取用户当前批次最高成绩", response = Result.class) + public Result selectUserMaxTestHistory(@ApiParam(value = "用户id") @RequestParam Integer userId, + @RequestParam Integer classId) { + return Result.success(userTestHistoryService.queryMaxScore(userId, classId)); + } + + @GetMapping("/pass") + @ApiOperation(value = "获取用户成绩,和及格线", response = Result.class) + public Result selectByCard(@RequestParam Integer statusId) { + Map map = new HashMap<>(2); + try { + UserStatus userStatus + = userStatusService.queryById(statusId); + Integer userId = userStatus.getUserId(); + Integer classId = userStatus.getClassId(); + ClassConfig classConfig + = classConfigService.queryById(classId); + Integer paperId = classConfig.getPaperId(); + Paper paper = paperService.queryById(paperId); + UserTestHistory userTestHistory + = userTestHistoryService.queryMaxScore(userId, classId); + Integer score = userTestHistory.getScore(); + map.put("score", score); + map.put("scorePass", paper.getPaperScorePass()); + map.put("time",userTestHistory.getCreateTime()); + return Result.success(map); + } catch (Exception e) { + throw new ResponseException(-1,"暂无考试成绩"); + } + + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserVideoPositionController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserVideoPositionController.java new file mode 100644 index 0000000..d0b3bb9 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/front/FrontUserVideoPositionController.java @@ -0,0 +1,74 @@ +package com.hc.web.controller.browser.front; + +import com.hc.business.model.UserVideoPosition; +import com.hc.business.service.UserVideoPositionService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + + +/** + * 用户视频观看记录(UserVideoPosition)表控制层 + * + * @author java + * @since 2020-11-11 13:26:26 + */ + +@RestController +@RequestMapping("/new/api/front/userVideoPosition") +public class FrontUserVideoPositionController { + + /** + * 服务对象 + */ + private final UserVideoPositionService userVideoPositionService; + + public FrontUserVideoPositionController(UserVideoPositionService userVideoPositionService) { + this.userVideoPositionService = userVideoPositionService; + } + + @GetMapping("/{id}") + @ApiOperation(value = "依据主键获取 UserVideoPosition", response = Result.class) + public Result selectDetail(@PathVariable("id") Integer id) { + return Result.success(this.userVideoPositionService.queryById(id)); + } + + @PostMapping("/insert") + @ApiOperation(value = "新增 UserVideoPosition 视频播完的时候调用", response = Result.class) + public Result addUserVideoPosition(@Valid @RequestBody UserVideoPosition userVideoPosition) { + return Result.success(userVideoPositionService.insert(userVideoPosition)); + } + + @PutMapping("/update") + @ApiOperation(value = "修改 UserVideoPosition", response = Result.class) + public Result updateUserVideoPosition(@RequestBody UserVideoPosition userVideoPosition) { + return Result.success(userVideoPositionService.update(userVideoPosition)); + } + + @DeleteMapping("/delete/{id}") + @ApiOperation(value = "依据主键删除 UserVideoPosition", response = Result.class) + public Result deleteUserVideoPosition(@PathVariable("id") Integer id) { + return Result.success(userVideoPositionService.deleteById(id)); + } + + @GetMapping("/list") + @ApiOperation(value = "获取 UserVideoPosition列表(分页)", response = Result.class) + public Result listUserVideoPosition(@RequestParam(defaultValue = "0") Integer page, + @RequestParam(defaultValue = "0") Integer size) { + return Result.success(userVideoPositionService.queryAllByLimit(page, size)); + } + + + @GetMapping("/{userId}/{videoId}/{courseId}/{classId}") + @ApiOperation(value = "依据userId,vidoeId查找播放记录", response = Result.class) + public Result findVideoPosition(@PathVariable("userId") Integer userId, + @PathVariable("videoId") Integer videoId, + @PathVariable("courseId") Integer courseId, + @PathVariable("classId") Integer classId ) { + return Result.success(userVideoPositionService.findVideoPosition(userId, videoId, courseId,classId)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/third/OneThirdController.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/third/OneThirdController.java new file mode 100644 index 0000000..297cbc7 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/controller/browser/third/OneThirdController.java @@ -0,0 +1,38 @@ +package com.hc.web.controller.browser.third; + +import com.hc.business.service.ThirdCourseService; +import com.hc.core.utils.result.Result; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * 第三方用户表(Third)表控制层 + * + * @author java + * @since 2020-06-17 17:29:30 + */ + +@RestController +@RequestMapping("/new/api/third") +public class OneThirdController { + + /** + * 服务对象 + */ + private final ThirdCourseService thirdCourseService; + + public OneThirdController(ThirdCourseService thirdCourseService) { + this.thirdCourseService = thirdCourseService; + } + + @PostMapping("/course") + @ApiOperation(value = "依据token获取 第三方课程", response = Result.class) + public Result selectThird(@RequestParam String token) { + return Result.success(thirdCourseService.queryThreadCourseDto(token)); + } + + +} \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/handler/ExceptionResultHandler.java b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/handler/ExceptionResultHandler.java new file mode 100644 index 0000000..9cd6b42 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/java/com/hc/web/handler/ExceptionResultHandler.java @@ -0,0 +1,103 @@ +package com.hc.web.handler; + +import com.hc.core.utils.exception.ResponseException; +import com.hc.core.utils.result.Result; +import org.springframework.http.HttpStatus; +import org.springframework.jdbc.UncategorizedSQLException; +import org.springframework.validation.BindingResult; +import org.springframework.validation.FieldError; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.MissingServletRequestParameterException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +import javax.validation.ConstraintViolation; +import javax.validation.ConstraintViolationException; +import java.util.Set; + +/** + * @author JIA + */ + +@RestControllerAdvice +public class ExceptionResultHandler { + + @ExceptionHandler(MethodArgumentNotValidException.class) + @ResponseStatus(HttpStatus.OK) + @ResponseBody + public Result handleMethodArgumentNotValidException(MethodArgumentNotValidException exception) { + StringBuilder errorInfo = new StringBuilder(); + BindingResult bindingResult = exception.getBindingResult(); + for (int i = 0; i < bindingResult.getFieldErrors().size(); i++) { + if (i > 0) { + errorInfo.append(","); + } + FieldError fieldError = bindingResult.getFieldErrors().get(i); + errorInfo.append(fieldError.getField()).append(" :").append(fieldError.getDefaultMessage()); + } + + //返回BaseResponse + Result response = new Result(); + response.setMsg(errorInfo.toString()); + response.setCode(401); + return response; + } + + @ExceptionHandler(MissingServletRequestParameterException.class) + @ResponseStatus(HttpStatus.BAD_REQUEST) + public Result handleRequestParameterException(MissingServletRequestParameterException e) { + return Result.exception(HttpStatus.BAD_REQUEST.value(), e.getMessage()); + } + + @ExceptionHandler(ConstraintViolationException.class) + @ResponseStatus(HttpStatus.BAD_REQUEST) + @ResponseBody + public Result handleConstraintViolationException(ConstraintViolationException exception) { + StringBuilder errorInfo = new StringBuilder(); + String errorMessage; + + Set> violations = exception.getConstraintViolations(); + for (ConstraintViolation item : violations) { + errorInfo.append(item.getMessage()).append(","); + } + errorMessage = errorInfo.toString().substring(0, errorInfo.toString().length() - 1); + + //返回BaseResponse + Result response = new Result(); + response.setMsg(errorMessage); + response.setCode(402); + return response; + } + + + @ExceptionHandler(ResponseException.class) + @ResponseStatus(HttpStatus.OK) + @ResponseBody + public Result handleResponseException(ResponseException e) { + return Result.exception(e.getCode(), e.getMessage()); + } + + @ExceptionHandler(UncategorizedSQLException.class) + @ResponseBody + @ResponseStatus(HttpStatus.NOT_FOUND) + public Result handleSqlException(UncategorizedSQLException e) { + return Result.exception(e.hashCode(), e.getCause().toString()); + } + + @ExceptionHandler(NullPointerException.class) + @ResponseBody + @ResponseStatus(HttpStatus.BAD_REQUEST) + public Result handleNullPointerException(NullPointerException e) { + return Result.exception(HttpStatus.BAD_REQUEST.value(), e.getMessage()); + } + + @ExceptionHandler(Exception.class) + @ResponseBody + @ResponseStatus(HttpStatus.BAD_REQUEST) + public Result handleException(Exception e) { + return Result.exception(-1, e.getMessage()); + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/resources/application-dev.yml b/JAVA_MYSQL_ZC/jxjy-web/src/main/resources/application-dev.yml new file mode 100644 index 0000000..c8a02c5 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/resources/application-dev.yml @@ -0,0 +1,21 @@ +spring: + profiles: dev + datasource: + url: jdbc:mysql://127.0.0.1:3306/jxjy?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC&allowMultiQueries=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true + username: root + password: 123456 + redis: + host: 47.104.62.154 + database: 3 + port: 6379 + password: mypass + timeout: 2000 + lettuce: + pool: + max-idle: 2000 + max-active: 10 + max-wait: -1ms + min-idle: 0 + +server: + port: 8080 \ No newline at end of file diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/resources/application-pro.yml b/JAVA_MYSQL_ZC/jxjy-web/src/main/resources/application-pro.yml new file mode 100644 index 0000000..96167cd --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/resources/application-pro.yml @@ -0,0 +1,21 @@ +spring: + profiles: pro + datasource: + url: jdbc:mysql://rm-m5e856330s821071w.mysql.rds.aliyuncs.com:3306/zcgp_cmtrain?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC&allowMultiQueries=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true + username: zcgp_cmtrain + password: Cmtrain123# + redis: + host: r-bp1h7n8p0tcur9ilzy.redis.rds.aliyuncs.com + database: 3 + port: 6379 + password: vpc_rediS!123 + timeout: 2000 + lettuce: + pool: + max-idle: 2000 + max-active: 10 + max-wait: -1ms + min-idle: 0 + +server: + port: 8080 diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/main/resources/application.yml b/JAVA_MYSQL_ZC/jxjy-web/src/main/resources/application.yml new file mode 100644 index 0000000..8fb2803 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/main/resources/application.yml @@ -0,0 +1,37 @@ +spring: + application: + name: jxjy-education + resources: + static-locations: classpath:/static/,classpath:/resources/ + profiles: + active: pro + datasource: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + +mybatis: + mapper-locations: classpath:mapper/*.xml + config-location: classpath:mybatis-config.xml + type-aliases-package: com.hc.business.model + +swagger: + enabled: true + +hc: + pay: + wx-pay: + appid: wx557361558e285bc9 + mch_id: 1383216702 + sign_key: 138321670213832167021383216702GP + trade_type: MWEB + +rong: + TEMPLATE_ID: dbVeHPNx41jaeiyhFNBaZX + REGION: 86 + SEND_CODE_URL: http://api.sms.ronghub.com/sendCode.json + APP_SECRIT: BEV264hUatgD + APP_KEY: mgb7ka1nmddyg + VERIF_CODE_URL: http://api.sms.ronghub.com/verifyCode.json + + + diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/test/java/com/hc/web/CourseChapterServiceTests.java b/JAVA_MYSQL_ZC/jxjy-web/src/test/java/com/hc/web/CourseChapterServiceTests.java new file mode 100644 index 0000000..5a2fed6 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/test/java/com/hc/web/CourseChapterServiceTests.java @@ -0,0 +1,101 @@ +package com.hc.web; + +import com.hc.business.model.Course; +import com.hc.business.model.CourseChapter; +import com.hc.business.service.CourseChapterService; +import com.hc.business.service.CourseService; +import com.hc.core.utils.redis.RedisUtil; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; + +import java.util.List; + +@SpringBootTest +class CourseChapterServiceTests { + + @Autowired + CourseChapterService courseChapterService; + + @Autowired + CourseService courseService; + + @Autowired + RedisUtil redisUtil; + + private static final String COURSE_CHAPTER_REDIS_KEY_PREFIX ="course:chapter:list:"; + + private Course insert_new_course(){ + //外键,首先要插入图书 + Course course = new Course(); + + //外键,首先要插入图书 + course.setCourseLogo("test"); + course.setCourseHours(Float.valueOf(11)); + course.setCourseName("test"); + course.setCourseTeacher("william"); + course.setCourseDesc("test"); + courseService.insert(course); + + //先插入章节 + //插入第一章 + CourseChapter child_1 = new CourseChapter(); + child_1.setChapterName("2"); + child_1.setChapterLevel(1); + child_1.setParentId(0); + child_1.setCourseId(course.getCourseId()); + courseChapterService.insert(child_1); + + int parent_id = child_1.getCourseChapterId(); + + //插入第二章 + CourseChapter child_2 = new CourseChapter(); + child_2.setChapterName("3"); + child_2.setParentId(0); + child_2.setChapterLevel(1); + child_2.setCourseId(course.getCourseId()); + courseChapterService.insert(child_2); + + CourseChapter child_child_1 = new CourseChapter(); + child_child_1.setChapterName("11"); + child_child_1.setParentId(child_2.getCourseChapterId()); + child_child_1.setChapterLevel(2); + child_child_1.setCourseId(course.getCourseId()); + courseChapterService.insert(child_child_1); + + return course; + } + + /** + * 测试根据课程id获取所有子目录id列表,测试访问数据库取值 + * 测试缓存中得数值 + */ + + + @Test + void get_course_chapter_list(){ + Course course = insert_new_course(); + + String course_key = COURSE_CHAPTER_REDIS_KEY_PREFIX + course.getCourseId(); + + //此时缓存中没有course + assert (true != redisUtil.hasKey(course_key)); + + List chapter_list = courseChapterService.getCourseChapterChildList(course.getCourseId()); + assert ((null != chapter_list) && (chapter_list.size() == 3)); + +// 检查缓存中得数据 + assert (true == redisUtil.hasKey(course_key)); + chapter_list = (List)redisUtil.get(course_key); + assert ((null != chapter_list) && (chapter_list.size() == 3)); + } + + + /* + 测试用户观看,课程统计信息 + */ + @Test + void test_course_process(){ + + } +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/test/java/com/hc/web/CourseServiceTests.java b/JAVA_MYSQL_ZC/jxjy-web/src/test/java/com/hc/web/CourseServiceTests.java new file mode 100644 index 0000000..ef7f9af --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/test/java/com/hc/web/CourseServiceTests.java @@ -0,0 +1,250 @@ +package com.hc.web; + +import com.hc.business.dto.CourseVideoDto; +import com.hc.business.dto.UserCourseDto; +import com.hc.business.mapper.CourseChapterVideoMapper; +import com.hc.business.mapper.UserCourseMapper; +import com.hc.business.model.*; +import com.hc.business.service.CourseChapterService; +import com.hc.business.service.CourseService; +import com.hc.business.service.UserVideoPositionService; +import com.hc.core.utils.redis.RedisUtil; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; + +import java.util.List; + + +@SpringBootTest +class CourseServiceTests { + + @Autowired + CourseChapterService courseChapterService; + + @Autowired + CourseService courseService; + + @Autowired + private CourseChapterVideoMapper courseChapterVideoMapper; + + @Autowired + private UserCourseMapper userCourseMapper; + + @Autowired + UserVideoPositionService userVideoPositionService; + + private static final String REDIS_KEY_PREFIX = "user:video:position:"; + + @Autowired + RedisUtil redisUtil; + + + private Integer _video_id = null; + + private void clean_redis(UserVideoPosition userVideoPosition, Integer courseid){ + //初始化清理掉缓存 + String key = REDIS_KEY_PREFIX + userVideoPosition.getUserId() + ":" + courseid; + if(redisUtil.hasKey(key)){ + redisUtil.del(key); + } + } + + private UserVideoPosition new_position(String videotime, String position, Integer videoid){ + UserVideoPosition userVideoPosition = new UserVideoPosition(); + userVideoPosition.setVideoId(videoid); + userVideoPosition.setUserId(100); + userVideoPosition.setVideoPosition(position); + userVideoPosition.setVideoTime(videotime); + return userVideoPosition; + } + + + /* + 插入图书和章节视频,继续教育不区分章节,课程下直接是多个视频 + */ + + private Course insert_new_course_and_chapter_video(){ + //外键,首先要插入图书 + Course course = new Course(); + course.setCourseLogo("test"); + course.setCourseHours(Float.valueOf(11)); + course.setCourseName("test"); + course.setCourseTeacher("william"); + course.setCourseDesc("test"); + courseService.insert(course); +// +// //先插入章节.不要根节点 +// CourseChapter parent = new CourseChapter(); +// parent.setParentId(0); +// parent.setChapterName("1"); +// parent.setChapterLevel(0); +// parent.setCourseId(course.getCourseId()); +// courseChapterService.insert(parent); +// int parent_id = parent.getCourseChapterId(); + + //插入第一章 + CourseChapter child_1 = new CourseChapter(); + child_1.setChapterName("2"); + child_1.setChapterLevel(1); + child_1.setParentId(0); + child_1.setCourseId(course.getCourseId()); + courseChapterService.insert(child_1); + //插入第一章视频 + CourseChapterVideo courseChapterVideo = new CourseChapterVideo(); + courseChapterVideo.setChapterId(child_1.getCourseChapterId()); + courseChapterVideo.setVideoName("1"); + courseChapterVideo.setVideoUrl("1"); + courseChapterVideo.setVideoOriUrl("1"); + courseChapterVideo.setCourseId(course.getCourseId()); + courseChapterVideo.setIsFree(0); + courseChapterVideo.setFreeTime(10); + courseChapterVideoMapper.insert(courseChapterVideo); + + //插入用户得视频进度 + UserVideoPosition userVideoPosition = new_position("100","20",courseChapterVideo.getVideoId()); + clean_redis(userVideoPosition,course.getCourseId()); + userVideoPositionService.insertPositionToRedis(userVideoPosition,course.getCourseId()); +// + //插入第二章 + CourseChapter child_2 = new CourseChapter(); + child_2.setChapterName("3"); + child_2.setParentId(0); + child_2.setChapterLevel(1); + child_2.setCourseId(course.getCourseId()); + courseChapterService.insert(child_2); + //插入第二章视频 + courseChapterVideo = new CourseChapterVideo(); + courseChapterVideo.setChapterId(child_2.getCourseChapterId()); + courseChapterVideo.setVideoName("2"); + courseChapterVideo.setVideoUrl("2"); + courseChapterVideo.setVideoOriUrl("2"); + courseChapterVideo.setCourseId(course.getCourseId()); + courseChapterVideo.setIsFree(0); + courseChapterVideo.setFreeTime(10); + courseChapterVideoMapper.insert(courseChapterVideo); + //插入用户得视频进度 + userVideoPosition = new_position("100","20",courseChapterVideo.getVideoId()); + userVideoPositionService.insertPositionToRedis(userVideoPosition,course.getCourseId()); + _video_id = courseChapterVideo.getVideoId(); + return course; + } + + /* + 测试章节进度统计 + */ + +// @Test +// void test_course_chapter_video(){ +// +// Course course = insert_new_course_and_chapter_video(); +// assert (null != course); +// +// Integer user_id = 100; +// Integer class_id = 100; +// List list = courseService.getCourseChapterAndVideoPosition(course.getCourseId(),user_id,class_id); +// //包含两个章节得进度信息 +// assert ((null != list) && (list.size() == 2)); +// //测试课程总体进度,因该是0.2 +// List cardCourseList = userCourseMapper.selectUserCourseProgress(user_id,class_id,course.getCourseId()); +// assert ((null != cardCourseList) && (cardCourseList.size() == 1)); +// assert (cardCourseList.get(0).getCoursePercent() == 0.2); +// } + + /* + 测试进度更新 + */ + + @Test + void test_course_chapter_video_update(){ + Course course = insert_new_course_and_chapter_video(); + assert (null != course); + + Integer user_id = 100; + Integer class_id = 100; + List list = courseService.getCourseChapterAndVideoPosition(course.getCourseId(),user_id,class_id); + //包含两个章节得进度信息 + assert ((null != list) && (list.size() == 2)); + //测试课程总体进度,因该是0.2 + List cardCourseList = userCourseMapper.selectUserCourseProgress(user_id,class_id,course.getCourseId()); + assert ((null != cardCourseList) && (cardCourseList.size() == 1)); + assert (cardCourseList.get(0).getCoursePercent() == 0.2); + + //模拟用户观看视频 + UserVideoPosition userVideoPosition = new_position("100","40",_video_id); + userVideoPositionService.insertPositionToRedis(userVideoPosition,course.getCourseId()); + + //触发重新计算 + courseService.getCourseChapterAndVideoPosition(course.getCourseId(),user_id,class_id); + + cardCourseList = userCourseMapper.selectUserCourseProgress(user_id,class_id,course.getCourseId()); + assert ((null != cardCourseList) && (cardCourseList.size() == 1)); + assert (cardCourseList.get(0).getCoursePercent() == 0.3); + + //模拟用户观看视频 + userVideoPosition = new_position("100","40",_video_id); + userVideoPositionService.insertPositionToRedis(userVideoPosition,course.getCourseId()); + + //触发重新计算 + courseService.getCourseChapterAndVideoPosition(course.getCourseId(),user_id,class_id); + + cardCourseList = userCourseMapper.selectUserCourseProgress(user_id,class_id,course.getCourseId()); + assert ((null != cardCourseList) && (cardCourseList.size() == 1)); + assert (cardCourseList.get(0).getCoursePercent() == 0.3); + + } + + /* + 测试update 标记位 + */ + +// @Test +// void test_update_flag(){ +// Course course = insert_new_course_and_chapter_video(); +// assert (null != course); +// Integer user_id = 100; +// Integer class_id = 100; +// +// List list = courseService.getCourseChapterAndVideoPosition(course.getCourseId(),user_id,class_id); +// //包含两个章节得进度信息 +// assert ((null != list) && (list.size() == 2)); +// //测试课程总体进度,因该是0.2 +// List cardCourseList = userCourseMapper.selectUserCourseProgress(user_id,class_id,course.getCourseId()); +// assert ((null != cardCourseList) && (cardCourseList.size() == 1)); +// assert (cardCourseList.get(0).getCoursePercent() == 0.2); +// +// //模拟用户观看视频 +// UserVideoPosition userVideoPosition = new_position("100","40",_video_id); +// userVideoPositionService.insertPositionToRedis( userVideoPosition,course.getCourseId()); +// //update 标记为因该存在 +// String key = REDIS_KEY_PREFIX + userVideoPosition.getUserId() + ":" + _video_id; +// assert (true == redisUtil.hashHasKey(key,"update"+_video_id)); +// +// //触发重新计算,update标记位被i删除 +// courseService.getCourseChapterAndVideoPosition(course.getCourseId(),user_id,class_id); +// assert (false == redisUtil.hashHasKey(key,"update"+_video_id)); +// +// cardCourseList = userCourseMapper.selectUserCourseProgress(user_id,class_id,course.getCourseId()); +// assert ((null != cardCourseList) && (cardCourseList.size() == 1)); +// assert (cardCourseList.get(0).getCoursePercent() == 0.3); +// +// //再次模拟观看 +// //模拟用户观看视频 +// userVideoPosition = new_position("100","60",_video_id); +// userVideoPositionService.insertPositionToRedis(userVideoPosition,course.getCourseId()); +// //update 标记为因该存在 +// assert (true == redisUtil.hashHasKey(key,"update"+_video_id)); +// +// //触发重新计算,update标记位被i删除 +// courseService.getCourseChapterAndVideoPosition(course.getCourseId(),user_id,class_id); +// assert (false == redisUtil.hashHasKey(key,"update"+_video_id)); +// +// cardCourseList = userCourseMapper.selectUserCourseProgress(user_id,class_id,course.getCourseId()); +// assert ((null != cardCourseList) && (cardCourseList.size() == 1)); +// assert (cardCourseList.get(0).getCoursePercent() == 0.4); +// } + + + + +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/test/java/com/hc/web/CourseTypeServiceTests.java b/JAVA_MYSQL_ZC/jxjy-web/src/test/java/com/hc/web/CourseTypeServiceTests.java new file mode 100644 index 0000000..6186ea4 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/test/java/com/hc/web/CourseTypeServiceTests.java @@ -0,0 +1,64 @@ +package com.hc.web; + + +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class CourseTypeServiceTests { + +/* +暂时保留没有启用 + + @Autowired + CourseTypeService courseTypeService; + + private static final String REDIS_KEY_PREFIX = "user:video:position:"; + + @Autowired + RedisUtil redisUtil; + + + @Test + void test_course_type(){ + + //插入一个根节点 + CourseType type = new CourseType(); + type.setParentId(0); + type.setLevelId(0); + type.setTypeName("测试根节点"); + courseTypeService.insert(type); + + //插入子节点1 + CourseType child1= new CourseType(); + child1.setTypeName("child1"); + child1.setLevelId(0); + child1.setParentId(type.getCourseTypeId()); + courseTypeService.insert(child1); + +//插入子节点2 + CourseType child2= new CourseType(); + child2.setTypeName("child2"); + child2.setParentId(type.getCourseTypeId()); + child2.setLevelId(0); + courseTypeService.insert(child2); + List list = courseTypeService.getCourseTypeChildList(type.getCourseTypeId()); + + //应该有3个数据 + assert (null != list); + assert (list.size() == 3); + + //插入孙子节点 + CourseType child11= new CourseType(); + child11.setTypeName("child11"); + child11.setLevelId(0); + child11.setParentId(child1.getCourseTypeId()); + courseTypeService.insert(child11); + + list = courseTypeService.getCourseTypeChildList(child1.getCourseTypeId()); + assert (list.size() == 2); + + } +*/ + + +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/test/java/com/hc/web/JxjyWebApplicationTests.java b/JAVA_MYSQL_ZC/jxjy-web/src/test/java/com/hc/web/JxjyWebApplicationTests.java new file mode 100644 index 0000000..0e4be12 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/test/java/com/hc/web/JxjyWebApplicationTests.java @@ -0,0 +1,17 @@ +package com.hc.web; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class JxjyWebApplicationTests { + + + + @Test + void contextLoads() { + System.out.println(String.class.getClassLoader()); + System.out.println(System.currentTimeMillis()); + } + +} diff --git a/JAVA_MYSQL_ZC/jxjy-web/src/test/java/com/hc/web/UserPositionServiceTests.java b/JAVA_MYSQL_ZC/jxjy-web/src/test/java/com/hc/web/UserPositionServiceTests.java new file mode 100644 index 0000000..95096e6 --- /dev/null +++ b/JAVA_MYSQL_ZC/jxjy-web/src/test/java/com/hc/web/UserPositionServiceTests.java @@ -0,0 +1,477 @@ +package com.hc.web; + +import com.hc.business.dto.CourseVideoDto; +import com.hc.business.mapper.UserVideoPositionMapper; +import com.hc.business.model.Course; +import com.hc.business.model.CourseChapterVideo; +import com.hc.business.model.UserCourse; +import com.hc.business.model.UserVideoPosition; +import com.hc.business.service.CourseChapterVideoService; +import com.hc.business.service.UserCourseService; +import com.hc.business.service.UserVideoPositionService; +import com.hc.core.utils.redis.RedisUtil; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; + +import java.util.List; +import java.util.Map; + +@SpringBootTest +class UserPositionServiceTests { + + + @Autowired + RedisUtil redisUtil; + + @Autowired + UserVideoPositionService userVideoPositionService; + + @Autowired + UserVideoPositionMapper mapper; + + @Autowired + CourseChapterVideoService videoService; + + @Autowired + UserCourseService userCourseService; + + private static final String REDIS_KEY_PREFIX = "user:video:position:"; + + private UserVideoPosition new_position(){ + + UserVideoPosition userVideoPosition = new UserVideoPosition(); + userVideoPosition.setVideoId(1); + userVideoPosition.setUserId(100); + userVideoPosition.setVideoPosition("20"); + userVideoPosition.setVideoTime("100.1"); + return userVideoPosition; + } + + + private void clean_redis(UserVideoPosition userVideoPosition){ + + //初始化清理掉缓存 + String key = REDIS_KEY_PREFIX + userVideoPosition.getUserId() + ":" + 1; + if(redisUtil.hasKey(key)){ + redisUtil.del(key); + } + } + /** + * 测试根据课程id获取所有子目录id列表,测试访问数据库取值 + * 测试缓存中得数值 + */ + + @Test + void insert_new_video_position(){ + + UserVideoPosition userVideoPosition = new_position(); + clean_redis(userVideoPosition); + userVideoPositionService.insertPositionToRedis(userVideoPosition,7); + + String key = REDIS_KEY_PREFIX + userVideoPosition.getUserId() + ":" + 1; + String key_v = "position" + String.valueOf(userVideoPosition.getVideoId()); + String key_t = "videotime"+ String.valueOf(userVideoPosition.getVideoId()); + + //验证redis + Object position = redisUtil.hashGet(key,key_v); + assert ((null != position) && (true == position.toString().equals("20"))); + Object time = redisUtil.hashGet(key,key_t); + assert ((null != time) && (true == time.toString().equals("100.1"))); + + + //正常观看进度 + userVideoPosition.setVideoPosition("22"); + userVideoPositionService.insertPositionToRedis(userVideoPosition,7); + position = redisUtil.hashGet(key,key_v); + assert ((null != position) && (true == position.toString().equals("22"))); + time = redisUtil.hashGet(key,key_t); + assert ((null != time) && (true == time.toString().equals("100.1"))); + + } + + + /** + * 非正常播放一个视频 + */ + + @Test + void play_video_invalid_position(){ + UserVideoPosition userVideoPosition = new_position(); + clean_redis(userVideoPosition); + userVideoPositionService.insertPositionToRedis(userVideoPosition,7); + + String key = REDIS_KEY_PREFIX + userVideoPosition.getUserId() + ":" + 1; + String key_v = "position" + String.valueOf(userVideoPosition.getVideoId()); + String key_t = "videotime"+ String.valueOf(userVideoPosition.getVideoId()); + + //验证redis + Object position = redisUtil.hashGet(key,key_v); + assert ((null != position) && (true == position.toString().equals("20"))); + Object time = redisUtil.hashGet(key,key_t); + assert ((null != time) && (true == time.toString().equals("100.1"))); + + //正常观看进度 + userVideoPosition.setVideoPosition("22"); + userVideoPositionService.insertPositionToRedis(userVideoPosition,7); + + //错误观看进度,前台时间戳有问题 + userVideoPosition.setVideoPosition("19"); + userVideoPositionService.insertPositionToRedis(userVideoPosition,7); + position = redisUtil.hashGet(key,key_v); + assert ((null != position) && (true == position.toString().equals("22"))); + time = redisUtil.hashGet(key,key_t); + assert ((null != time) && (true == time.toString().equals("100.1"))); + } + + @Test + void play_video_invalid_video_time(){ + UserVideoPosition userVideoPosition = new_position(); + clean_redis(userVideoPosition); + userVideoPositionService.insertPositionToRedis(userVideoPosition,7); + + String key = REDIS_KEY_PREFIX + userVideoPosition.getUserId() + ":" + 1; + String key_v = "position" + String.valueOf(userVideoPosition.getVideoId()); + String key_t = "videotime"+ String.valueOf(userVideoPosition.getVideoId()); + + //验证redis + Object position = redisUtil.hashGet(key,key_v); + assert ((null != position) && (true == position.toString().equals("20"))); + Object time = redisUtil.hashGet(key,key_t); + assert ((null != time) && (true == time.toString().equals("100.1"))); + + //观看进度不正确,超过最大视频长度 + userVideoPosition.setVideoPosition("101"); + userVideoPositionService.insertPositionToRedis(userVideoPosition,7); + position = redisUtil.hashGet(key,key_v); + time = redisUtil.hashGet(key,key_t); + assert ((null != position) && (position.toString().equals("100.1")) && (null != time) && (time.toString().equals("100.1"))); + } + + /* + 测试获取观看进度 + */ + + @Test + void get_video_position(){ + + UserVideoPosition userVideoPosition = new_position(); + clean_redis(userVideoPosition); + userVideoPositionService.insertPositionToRedis(userVideoPosition,7); + + String key = REDIS_KEY_PREFIX + userVideoPosition.getUserId() + ":" + 1; + String key_v = "position" + String.valueOf(userVideoPosition.getVideoId()); + String key_t = "videotime"+ String.valueOf(userVideoPosition.getVideoId()); + + //验证redis + Object position = redisUtil.hashGet(key,key_v); + assert ((null != position) && (true == position.toString().equals("20"))); + Object time = redisUtil.hashGet(key,key_t); + assert ((null != time) && (true == time.toString().equals("100.1"))); + + //正常观看进度 + userVideoPosition.setVideoPosition("22"); + userVideoPositionService.insertPositionToRedis(userVideoPosition,7); + Map map = userVideoPositionService.findVideoPosition(userVideoPosition.getUserId(),userVideoPosition.getVideoId(),7,100); + assert ((null != map) && (true == map.containsKey("position")) && (true == map.containsKey("videotime"))); + assert ((map.get("position").toString().equals("22")) && (map.get("videotime").toString().equals("100.1"))); + } + + /* + 获取一条不存在得观看记录 + */ + + @Test + void get_invalid_video_position(){ + + UserVideoPosition userVideoPosition = new_position(); + clean_redis(userVideoPosition); + userVideoPositionService.insertPositionToRedis(userVideoPosition,7); + + String key = REDIS_KEY_PREFIX + userVideoPosition.getUserId() + ":" + 1; + String key_v = "position" + String.valueOf(userVideoPosition.getVideoId()); + String key_t = "videotime"+ String.valueOf(userVideoPosition.getVideoId()); + + //验证redis + Object position = redisUtil.hashGet(key,key_v); + assert ((null != position) && (true == position.toString().equals("20"))); + Object time = redisUtil.hashGet(key,key_t); + assert ((null != time) && (true == time.toString().equals("100.1"))); + + //获取一个不存在得观看记录 + Map map = userVideoPositionService.findVideoPosition(userVideoPosition.getUserId(),5555,7,100); + assert (null != map); + assert ((null == map.get("position")) && (null == map.get("videotime"))); + } + + /* + 测试视频进度更新表记位 + */ + + @Test + void test_video_position_update_flag(){ + UserVideoPosition userVideoPosition = new_position(); + clean_redis(userVideoPosition); + userVideoPositionService.insertPositionToRedis(userVideoPosition,7); + + String key = REDIS_KEY_PREFIX + userVideoPosition.getUserId() + ":" + 1; + String key_v = "position" + String.valueOf(userVideoPosition.getVideoId()); + String key_t = "videotime"+ String.valueOf(userVideoPosition.getVideoId()); + String key_u = "update"+String.valueOf(userVideoPosition.getVideoId()); + + //验证redis + Object position = redisUtil.hashGet(key,key_v); + assert ((null != position) && (true == position.toString().equals("20"))); + Object time = redisUtil.hashGet(key,key_t); + assert ((null != time) && (true == time.toString().equals("100.1"))); + Object update = redisUtil.hashGet(key,key_u); + assert ((null != update) && (update.toString().equals("1"))); + + //删除标记为,更新视频观看进度,改标记为需要重新标记 + redisUtil.hashDel(key,key_u); + update = redisUtil.hashGet(key,key_u); + assert (null == update); + +// 正常观看进度 + userVideoPosition.setVideoPosition("22"); + userVideoPositionService.insertPositionToRedis(userVideoPosition,7); + update = redisUtil.hashGet(key,key_u); + assert ((null != update) && (update.toString().equals("1"))); + } + + /* + 测试刷新观看记录从缓存到数据库,新增 + */ + + @Test + void test_flush_position_todb_new(){ + UserVideoPosition userVideoPosition = new_position(); + clean_redis(userVideoPosition); + userVideoPositionService.insertPositionToRedis(userVideoPosition,7); + + String key = REDIS_KEY_PREFIX + userVideoPosition.getUserId() + ":" + 1; + String key_v = "position" + String.valueOf(userVideoPosition.getVideoId()); + String key_t = "videotime"+ String.valueOf(userVideoPosition.getVideoId()); + + //验证redis + Object position = redisUtil.hashGet(key,key_v); + assert ((null != position) && (true == position.toString().equals("20"))); + Object time = redisUtil.hashGet(key,key_t); + assert ((null != time) && (true == time.toString().equals("100.1"))); + + //清理数据库 + List list = mapper.selectUserPositionByUserAndVideo(userVideoPosition.getVideoId(),userVideoPosition.getUserId()); + if((null != list) && (list.size() > 0)){ + mapper.delete(list.get(0)); + } + + //刷新到数据库 + userVideoPositionService.flushToDb(userVideoPosition.getUserId(),userVideoPosition.getVideoId(),7,"2020",100); + list = mapper.selectUserPositionByUserAndVideo(userVideoPosition.getVideoId(),userVideoPosition.getUserId()); + assert (list.size() == 1); + UserVideoPosition uposition = list.get(0); + assert (uposition.getVideoPosition().equals(userVideoPosition.getVideoPosition())); + + } + + /* + 测试刷新观看记录从缓存到数据库,更新 + */ + + @Test + void test_flush_position_todb_update(){ + UserVideoPosition userVideoPosition = new_position(); + clean_redis(userVideoPosition); + userVideoPositionService.insertPositionToRedis(userVideoPosition,7); + + String key = REDIS_KEY_PREFIX + userVideoPosition.getUserId() + ":" + 1; + String key_v = "position" + String.valueOf(userVideoPosition.getVideoId()); + String key_t = "videotime"+ String.valueOf(userVideoPosition.getVideoId()); + + //验证redis + Object position = redisUtil.hashGet(key,key_v); + assert ((null != position) && (true == position.toString().equals("20"))); + Object time = redisUtil.hashGet(key,key_t); + assert ((null != time) && (true == time.toString().equals("100.1"))); + + //清理数据库 + List list = mapper.selectUserPositionByUserAndVideo(userVideoPosition.getVideoId(),userVideoPosition.getUserId()); + if((null != list) && (list.size()>0)){ + mapper.delete(list.get(0)); + } + + //刷新到数据库 + userVideoPositionService.flushToDb(userVideoPosition.getUserId(),userVideoPosition.getVideoId(),7,"2020",100); + list = mapper.selectUserPositionByUserAndVideo(userVideoPosition.getVideoId(),userVideoPosition.getUserId()); + assert (list.size() == 1); + assert (list.get(0).getVideoPosition().equals("20")); + + ///跟新数据库观看记录 + userVideoPosition.setVideoPosition("40"); + userVideoPositionService.insertPositionToRedis(userVideoPosition,7); + userVideoPositionService.flushToDb(userVideoPosition.getUserId(),userVideoPosition.getVideoId(),7,"2020",100); + list = mapper.selectUserPositionByUserAndVideo(userVideoPosition.getVideoId(),userVideoPosition.getUserId()); + assert (list.size() == 1); + assert (list.get(0).getVideoPosition().equals("40")); + } + + + /* +测试刷新观看记录从缓存到数据库,测试观看结标记 + */ + + @Test + void test_flush_position_todb_end(){ + UserVideoPosition userVideoPosition = new_position(); + clean_redis(userVideoPosition); + userVideoPositionService.insertPositionToRedis(userVideoPosition,7); + + String key = REDIS_KEY_PREFIX + userVideoPosition.getUserId() + ":" + 1; + String key_v = "position" + String.valueOf(userVideoPosition.getVideoId()); + String key_t = "videotime"+ String.valueOf(userVideoPosition.getVideoId()); + + //验证redis + Object position = redisUtil.hashGet(key,key_v); + + + assert ((null != position) && (true == position.toString().equals("20"))); + Object time = redisUtil.hashGet(key,key_t); + assert ((null != time) && (true == time.toString().equals("100.1"))); + + + //清理数据库 + List list = mapper.selectUserPositionByUserAndVideo(userVideoPosition.getVideoId(),userVideoPosition.getUserId()); + //assert (list.size() == 0); + if(null != list){ + mapper.delete(list.get(0)); + } + + //刷新到数据库 + userVideoPositionService.flushToDb(userVideoPosition.getUserId(),userVideoPosition.getVideoId(),7,"2020",100); + list = mapper.selectUserPositionByUserAndVideo(userVideoPosition.getVideoId(),userVideoPosition.getUserId()); + assert (list.size() == 1); + assert (list.get(0).getVideoPosition().equals("20")); + + ///跟新数据库观看记录 + userVideoPosition.setVideoPosition("96"); + userVideoPositionService.insertPositionToRedis(userVideoPosition,7); + userVideoPositionService.flushToDb(userVideoPosition.getUserId(),userVideoPosition.getVideoId(),7,"2020",100); + list = mapper.selectUserPositionByUserAndVideo(userVideoPosition.getVideoId(),userVideoPosition.getUserId()); + assert (list.size() == 1); + assert (list.get(0).getVideoPosition().equals("100.1")); + assert (0 == list.get(0).getWatchEnd().compareTo(1)); + } + + + /** + * 测试课程总进度 + */ + + @Test + void test_flush_to_course_percent(){ + + int max=1000,min=1; + Integer courseId = (int) (Math.random()*(max-min)+min); + + //测试课程插入2个视频 + CourseChapterVideo video1 = new CourseChapterVideo(); + video1.setVideoName("测试视频1"); + video1.setChapterId(0); + video1.setVideoUrl("fff"); + video1.setIsFree(0); + video1.setCourseId(courseId); + video1.setFreeTime(10); + + videoService.insert(video1); + //随机数当作COURSE用 + + + //插入第一个进度 + UserVideoPosition userVideoPosition = new UserVideoPosition(); + userVideoPosition.setVideoId(video1.getVideoId()); + userVideoPosition.setUserId(100); + userVideoPosition.setVideoPosition("20"); + userVideoPosition.setVideoTime("100"); + + clean_redis(userVideoPosition); + userVideoPositionService.insertPositionToRedis(userVideoPosition,courseId); + + + + //插入视频2 + CourseChapterVideo video2 = new CourseChapterVideo(); + video2.setVideoName("测试视频1"); + video2.setChapterId(0); + video2.setVideoUrl("fff"); + video2.setIsFree(0); + video2.setCourseId(courseId); + video2.setFreeTime(10); + + videoService.insert(video2); + + //刷新到数据库课程总进度 + userVideoPositionService.flushToDb(100,video1.getVideoId(),courseId,"2020",100); + + //查询总进度 + UserCourse userCourse = userCourseService.queryById(courseId); + + + } + + + @Test + void test_all_course_videos_and_progress(){ + int max=1000,min=1; + Integer courseId = (int) (Math.random()*(max-min)+min); + Integer userId = (int) (Math.random()*(max-min)+min); + + + //测试课程插入2个视频 + CourseChapterVideo video1 = new CourseChapterVideo(); + video1.setVideoName("测试视频1"); + video1.setChapterId(0); + video1.setVideoUrl("fff"); + video1.setIsFree(0); + video1.setCourseId(courseId); + video1.setFreeTime(10); + + videoService.insert(video1); + //随机数当作COURSE用 + + //插入第一个进度 + UserVideoPosition userVideoPosition = new UserVideoPosition(); + userVideoPosition.setVideoId(video1.getVideoId()); + userVideoPosition.setUserId(userId); + userVideoPosition.setVideoPosition("20"); + userVideoPosition.setVideoTime("100"); + + clean_redis(userVideoPosition); + userVideoPositionService.insertPositionToRedis(userVideoPosition,courseId); + + + + //插入视频2 + CourseChapterVideo video2 = new CourseChapterVideo(); + video2.setVideoName("测试视频2"); + video2.setChapterId(0); + video2.setVideoUrl("fff"); + video2.setIsFree(0); + video2.setCourseId(courseId); + video2.setFreeTime(10); + + videoService.insert(video2); + //插入第一个进度 + userVideoPosition = new UserVideoPosition(); + userVideoPosition.setVideoId(video2.getVideoId()); + userVideoPosition.setUserId(userId); + userVideoPosition.setVideoPosition("30"); + userVideoPosition.setVideoTime("100"); + + clean_redis(userVideoPosition); + userVideoPositionService.insertPositionToRedis(userVideoPosition,courseId); + + + } + + +} diff --git a/JAVA_MYSQL_ZC/pom.xml b/JAVA_MYSQL_ZC/pom.xml new file mode 100644 index 0000000..59b9940 --- /dev/null +++ b/JAVA_MYSQL_ZC/pom.xml @@ -0,0 +1,64 @@ + + + 4.0.0 + + + + org.apache.maven.plugins + maven-compiler-plugin + + 11 + 11 + + + + + + + org.springframework.boot + spring-boot-starter-parent + 2.2.9.RELEASE + + + + com.hc + jxjy-education + 0.0.1-SNAPSHOT + jxjy-education + pom + Demo project for Spring Boot + + + 11 + + + + jxjy-business + jxjy-core + jxjy-web + + + + + + org.springframework.boot + spring-boot-starter + + + + + com.spring4all + swagger-spring-boot-starter + 1.6.0.RELEASE + + + + org.projectlombok + lombok + true + + + + +