commit:同步1.3版本

This commit is contained in:
Jerry
2021-01-03 22:29:02 +08:00
parent ef316438da
commit 25023e29b5
706 changed files with 23404 additions and 14179 deletions

View File

@@ -1 +0,0 @@
OrangeMultiDemo

View File

@@ -6,18 +6,19 @@
<sourceOutputDir name="target/generated-sources/annotations" /> <sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" /> <outputRelativeToContentRoot value="true" />
<module name="admin-monitor" />
<module name="gateway" />
<module name="common-core" />
<module name="course-class-service" />
<module name="stats-service" />
<module name="common-sequence" />
<module name="upms-interface" />
<module name="common-redis" /> <module name="common-redis" />
<module name="upms-service" />
<module name="application-common" />
<module name="course-class-interface" />
<module name="stats-interface" /> <module name="stats-interface" />
<module name="application-common" />
<module name="gateway" />
<module name="common-swagger" />
<module name="common-sequence" />
<module name="course-class-service" />
<module name="common-core" />
<module name="upms-interface" />
<module name="admin-monitor" />
<module name="stats-service" />
<module name="course-class-interface" />
<module name="upms-service" />
</profile> </profile>
</annotationProcessing> </annotationProcessing>
<bytecodeTargetLevel> <bytecodeTargetLevel>
@@ -29,6 +30,7 @@
<module name="common-core" target="1.8" /> <module name="common-core" target="1.8" />
<module name="common-redis" target="1.8" /> <module name="common-redis" target="1.8" />
<module name="common-sequence" target="1.8" /> <module name="common-sequence" target="1.8" />
<module name="common-swagger" target="1.8" />
<module name="course-class" target="1.8" /> <module name="course-class" target="1.8" />
<module name="course-class-interface" target="1.8" /> <module name="course-class-interface" target="1.8" />
<module name="course-class-service" target="1.8" /> <module name="course-class-service" target="1.8" />

View File

@@ -18,6 +18,8 @@
<file url="file://$PROJECT_DIR$/common/common-redis/src/main/resources" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/common/common-redis/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/common/common-sequence/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/common/common-sequence/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/common/common-sequence/src/main/resources" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/common/common-sequence/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/common/common-swagger/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/common/common-swagger/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/framework/admin-monitor/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/framework/admin-monitor/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/framework/admin-monitor/src/main/resources" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/framework/admin-monitor/src/main/resources" charset="UTF-8" />
</component> </component>

View File

@@ -14,6 +14,57 @@
<inspection_tool class="CheckDtdRefs" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="CheckDtdRefs" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="CheckTagEmptyBody" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="CheckTagEmptyBody" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="CheckXmlFileWithXercesValidator" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="CheckXmlFileWithXercesValidator" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitAbstractClassShouldStartWithAbstractNaming" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="CloudToolkitAbstractMethodOrInterfaceMethodMustUseJavadoc" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitAvoidApacheBeanUtilsCopy" enabled="false" level="BLOCKER" enabled_by_default="false" />
<inspection_tool class="CloudToolkitAvoidCallStaticSimpleDateFormat" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="CloudToolkitAvoidCommentBehindStatement" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitAvoidComplexCondition" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitAvoidConcurrentCompetitionRandom" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitAvoidDoubleOrFloatEqualCompare" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="CloudToolkitAvoidManuallyCreateThread" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="CloudToolkitAvoidMissUseOfMathRandom" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitAvoidNegationOperator" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitAvoidNewDateGetTime" enabled="false" level="BLOCKER" enabled_by_default="false" />
<inspection_tool class="CloudToolkitAvoidPatternCompileInMethod" enabled="false" level="BLOCKER" enabled_by_default="false" />
<inspection_tool class="CloudToolkitAvoidReturnInFinally" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="CloudToolkitAvoidStartWithDollarAndUnderLineNaming" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="CloudToolkitAvoidUseTimer" enabled="false" level="BLOCKER" enabled_by_default="false" />
<inspection_tool class="CloudToolkitBigDecimalAvoidDoubleConstructor" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitBooleanPropertyShouldNotStartWithIs" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="CloudToolkitClassCastExceptionWithSubListToArrayList" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="CloudToolkitClassCastExceptionWithToArray" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="CloudToolkitClassMustHaveAuthor" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitClassNamingShouldBeCamel" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitCollectionInitShouldAssignCapacity" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitCommentsMustBeJavadocFormat" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitConcurrentExceptionWithModifyOriginSubList" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="CloudToolkitConstantFieldShouldBeUpperCase" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="CloudToolkitCountDownShouldInFinally" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitDontModifyInForeachCircle" enabled="false" level="BLOCKER" enabled_by_default="false" />
<inspection_tool class="CloudToolkitEnumConstantsMustHaveComment" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="CloudToolkitExceptionClassShouldEndWithException" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="CloudToolkitIbatisMethodQueryForList" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitLowerCamelCaseVariableNaming" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="CloudToolkitMethodReturnWrapperType" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitMethodTooLong" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitPackageNaming" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitPojoMustOverrideToString" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitPojoMustUsePrimitiveField" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitPojoNoDefaultValue" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitRemoveCommentedCode" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitServiceOrDaoClassShouldEndWithImpl" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="CloudToolkitStringConcat" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitSwitchStatement" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="CloudToolkitTestClassShouldEndWithTestNaming" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitThreadLocalShouldRemove" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="CloudToolkitThreadPoolCreation" enabled="false" level="BLOCKER" enabled_by_default="false" />
<inspection_tool class="CloudToolkitThreadShouldSetName" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="CloudToolkitTransactionMustHaveRollback" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitUndefineMagicConstant" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitUnsupportedExceptionWithModifyAsList" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="CloudToolkitUseQuietReferenceNotation" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="CloudToolkitUseRightCaseForDateFormat" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="ConstantConditions" enabled="false" level="WARNING" enabled_by_default="false"> <inspection_tool class="ConstantConditions" enabled="false" level="WARNING" enabled_by_default="false">
<option name="SUGGEST_NULLABLE_ANNOTATIONS" value="false" /> <option name="SUGGEST_NULLABLE_ANNOTATIONS" value="false" />
<option name="DONT_REPORT_TRUE_ASSERT_STATEMENTS" value="false" /> <option name="DONT_REPORT_TRUE_ASSERT_STATEMENTS" value="false" />

View File

@@ -1,13 +1,13 @@
<component name="libraryTable"> <component name="libraryTable">
<library name="Maven: com.github.jsqlparser:jsqlparser:2.0"> <library name="Maven: com.github.jsqlparser:jsqlparser:3.2">
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/jsqlparser/jsqlparser/2.0/jsqlparser-2.0.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/com/github/jsqlparser/jsqlparser/3.2/jsqlparser-3.2.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC> <JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/github/jsqlparser/jsqlparser/2.0/jsqlparser-2.0-javadoc.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/com/github/jsqlparser/jsqlparser/3.2/jsqlparser-3.2-javadoc.jar!/" />
</JAVADOC> </JAVADOC>
<SOURCES> <SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/jsqlparser/jsqlparser/2.0/jsqlparser-2.0-sources.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/com/github/jsqlparser/jsqlparser/3.2/jsqlparser-3.2-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
</component> </component>

View File

@@ -1,13 +1,13 @@
<component name="libraryTable"> <component name="libraryTable">
<library name="Maven: com.github.pagehelper:pagehelper:5.1.11"> <library name="Maven: com.github.pagehelper:pagehelper:5.2.0">
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper/5.1.11/pagehelper-5.1.11.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper/5.2.0/pagehelper-5.2.0.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC> <JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper/5.1.11/pagehelper-5.1.11-javadoc.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper/5.2.0/pagehelper-5.2.0-javadoc.jar!/" />
</JAVADOC> </JAVADOC>
<SOURCES> <SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper/5.1.11/pagehelper-5.1.11-sources.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper/5.2.0/pagehelper-5.2.0-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
</component> </component>

View File

@@ -1,13 +1,13 @@
<component name="libraryTable"> <component name="libraryTable">
<library name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.2.13"> <library name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.3.0">
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper-spring-boot-autoconfigure/1.2.13/pagehelper-spring-boot-autoconfigure-1.2.13.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper-spring-boot-autoconfigure/1.3.0/pagehelper-spring-boot-autoconfigure-1.3.0.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC> <JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper-spring-boot-autoconfigure/1.2.13/pagehelper-spring-boot-autoconfigure-1.2.13-javadoc.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper-spring-boot-autoconfigure/1.3.0/pagehelper-spring-boot-autoconfigure-1.3.0-javadoc.jar!/" />
</JAVADOC> </JAVADOC>
<SOURCES> <SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper-spring-boot-autoconfigure/1.2.13/pagehelper-spring-boot-autoconfigure-1.2.13-sources.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper-spring-boot-autoconfigure/1.3.0/pagehelper-spring-boot-autoconfigure-1.3.0-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
</component> </component>

View File

@@ -1,13 +1,13 @@
<component name="libraryTable"> <component name="libraryTable">
<library name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.2.13"> <library name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.3.0">
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper-spring-boot-starter/1.2.13/pagehelper-spring-boot-starter-1.2.13.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper-spring-boot-starter/1.3.0/pagehelper-spring-boot-starter-1.3.0.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC> <JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper-spring-boot-starter/1.2.13/pagehelper-spring-boot-starter-1.2.13-javadoc.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper-spring-boot-starter/1.3.0/pagehelper-spring-boot-starter-1.3.0-javadoc.jar!/" />
</JAVADOC> </JAVADOC>
<SOURCES> <SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper-spring-boot-starter/1.2.13/pagehelper-spring-boot-starter-1.2.13-sources.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper-spring-boot-starter/1.3.0/pagehelper-spring-boot-starter-1.3.0-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
</component> </component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.github.xiaoymin:knife4j-annotations:2.0.5">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/xiaoymin/knife4j-annotations/2.0.5/knife4j-annotations-2.0.5.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/github/xiaoymin/knife4j-annotations/2.0.5/knife4j-annotations-2.0.5-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/xiaoymin/knife4j-annotations/2.0.5/knife4j-annotations-2.0.5-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.github.xiaoymin:knife4j-core:2.0.5">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/xiaoymin/knife4j-core/2.0.5/knife4j-core-2.0.5.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/github/xiaoymin/knife4j-core/2.0.5/knife4j-core-2.0.5-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/xiaoymin/knife4j-core/2.0.5/knife4j-core-2.0.5-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.github.xiaoymin:knife4j-micro-spring-boot-starter:2.0.5">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/xiaoymin/knife4j-micro-spring-boot-starter/2.0.5/knife4j-micro-spring-boot-starter-2.0.5.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/github/xiaoymin/knife4j-micro-spring-boot-starter/2.0.5/knife4j-micro-spring-boot-starter-2.0.5-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/xiaoymin/knife4j-micro-spring-boot-starter/2.0.5/knife4j-micro-spring-boot-starter-2.0.5-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.github.xiaoymin:knife4j-spring:2.0.5">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/xiaoymin/knife4j-spring/2.0.5/knife4j-spring-2.0.5.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/github/xiaoymin/knife4j-spring/2.0.5/knife4j-spring-2.0.5-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/xiaoymin/knife4j-spring/2.0.5/knife4j-spring-2.0.5-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.github.xiaoymin:knife4j-spring-boot-autoconfigure:2.0.5">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/xiaoymin/knife4j-spring-boot-autoconfigure/2.0.5/knife4j-spring-boot-autoconfigure-2.0.5.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/github/xiaoymin/knife4j-spring-boot-autoconfigure/2.0.5/knife4j-spring-boot-autoconfigure-2.0.5-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/xiaoymin/knife4j-spring-boot-autoconfigure/2.0.5/knife4j-spring-boot-autoconfigure-2.0.5-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.github.xiaoymin:knife4j-spring-ui:2.0.5">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/xiaoymin/knife4j-spring-ui/2.0.5/knife4j-spring-ui-2.0.5.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/github/xiaoymin/knife4j-spring-ui/2.0.5/knife4j-spring-ui-2.0.5-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/xiaoymin/knife4j-spring-ui/2.0.5/knife4j-spring-ui-2.0.5-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: io.springfox:springfox-bean-validators:2.9.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-bean-validators/2.9.2/springfox-bean-validators-2.9.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-bean-validators/2.9.2/springfox-bean-validators-2.9.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-bean-validators/2.9.2/springfox-bean-validators-2.9.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: io.springfox:springfox-core:2.9.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-core/2.9.2/springfox-core-2.9.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-core/2.9.2/springfox-core-2.9.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-core/2.9.2/springfox-core-2.9.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: io.springfox:springfox-schema:2.9.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-schema/2.9.2/springfox-schema-2.9.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-schema/2.9.2/springfox-schema-2.9.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-schema/2.9.2/springfox-schema-2.9.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: io.springfox:springfox-spi:2.9.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-spi/2.9.2/springfox-spi-2.9.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-spi/2.9.2/springfox-spi-2.9.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-spi/2.9.2/springfox-spi-2.9.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: io.springfox:springfox-spring-web:2.9.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: io.springfox:springfox-swagger2:2.9.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-swagger2/2.9.2/springfox-swagger2-2.9.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-swagger2/2.9.2/springfox-swagger2-2.9.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-swagger2/2.9.2/springfox-swagger2-2.9.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: io.springfox:springfox-swagger-common:2.9.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-swagger-common/2.9.2/springfox-swagger-common-2.9.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-swagger-common/2.9.2/springfox-swagger-common-2.9.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-swagger-common/2.9.2/springfox-swagger-common-2.9.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: io.swagger:swagger-annotations:1.5.20">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/io/swagger/swagger-annotations/1.5.20/swagger-annotations-1.5.20.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/io/swagger/swagger-annotations/1.5.20/swagger-annotations-1.5.20-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/io/swagger/swagger-annotations/1.5.20/swagger-annotations-1.5.20-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: io.swagger:swagger-annotations:1.5.22">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/io/swagger/swagger-annotations/1.5.22/swagger-annotations-1.5.22.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/io/swagger/swagger-annotations/1.5.22/swagger-annotations-1.5.22-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/io/swagger/swagger-annotations/1.5.22/swagger-annotations-1.5.22-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: io.swagger:swagger-models:1.5.21">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/io/swagger/swagger-models/1.5.21/swagger-models-1.5.21.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/io/swagger/swagger-models/1.5.21/swagger-models-1.5.21-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/io/swagger/swagger-models/1.5.21/swagger-models-1.5.21-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: io.swagger:swagger-models:1.5.22">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/io/swagger/swagger-models/1.5.22/swagger-models-1.5.22.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/io/swagger/swagger-models/1.5.22/swagger-models-1.5.22-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/io/swagger/swagger-models/1.5.22/swagger-models-1.5.22-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.javassist:javassist:3.25.0-GA">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/javassist/javassist/3.25.0-GA/javassist-3.25.0-GA.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/javassist/javassist/3.25.0-GA/javassist-3.25.0-GA-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/javassist/javassist/3.25.0-GA/javassist-3.25.0-GA-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,13 +1,13 @@
<component name="libraryTable"> <component name="libraryTable">
<library name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.1"> <library name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.3">
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/mybatis/spring/boot/mybatis-spring-boot-autoconfigure/2.1.1/mybatis-spring-boot-autoconfigure-2.1.1.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/org/mybatis/spring/boot/mybatis-spring-boot-autoconfigure/2.1.3/mybatis-spring-boot-autoconfigure-2.1.3.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC> <JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/mybatis/spring/boot/mybatis-spring-boot-autoconfigure/2.1.1/mybatis-spring-boot-autoconfigure-2.1.1-javadoc.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/org/mybatis/spring/boot/mybatis-spring-boot-autoconfigure/2.1.3/mybatis-spring-boot-autoconfigure-2.1.3-javadoc.jar!/" />
</JAVADOC> </JAVADOC>
<SOURCES> <SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/mybatis/spring/boot/mybatis-spring-boot-autoconfigure/2.1.1/mybatis-spring-boot-autoconfigure-2.1.1-sources.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/org/mybatis/spring/boot/mybatis-spring-boot-autoconfigure/2.1.3/mybatis-spring-boot-autoconfigure-2.1.3-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
</component> </component>

View File

@@ -1,13 +1,13 @@
<component name="libraryTable"> <component name="libraryTable">
<library name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.1"> <library name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.3">
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/mybatis/spring/boot/mybatis-spring-boot-starter/2.1.1/mybatis-spring-boot-starter-2.1.1.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/org/mybatis/spring/boot/mybatis-spring-boot-starter/2.1.3/mybatis-spring-boot-starter-2.1.3.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC> <JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/mybatis/spring/boot/mybatis-spring-boot-starter/2.1.1/mybatis-spring-boot-starter-2.1.1-javadoc.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/org/mybatis/spring/boot/mybatis-spring-boot-starter/2.1.3/mybatis-spring-boot-starter-2.1.3-javadoc.jar!/" />
</JAVADOC> </JAVADOC>
<SOURCES> <SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/mybatis/spring/boot/mybatis-spring-boot-starter/2.1.1/mybatis-spring-boot-starter-2.1.1-sources.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/org/mybatis/spring/boot/mybatis-spring-boot-starter/2.1.3/mybatis-spring-boot-starter-2.1.3-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
</component> </component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/plugin/spring-plugin-metadata/1.2.0.RELEASE/spring-plugin-metadata-1.2.0.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/plugin/spring-plugin-metadata/1.2.0.RELEASE/spring-plugin-metadata-1.2.0.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/plugin/spring-plugin-metadata/1.2.0.RELEASE/spring-plugin-metadata-1.2.0.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -10,6 +10,7 @@
<module fileurl="file://$PROJECT_DIR$/common/common-core/common-core.iml" filepath="$PROJECT_DIR$/common/common-core/common-core.iml" /> <module fileurl="file://$PROJECT_DIR$/common/common-core/common-core.iml" filepath="$PROJECT_DIR$/common/common-core/common-core.iml" />
<module fileurl="file://$PROJECT_DIR$/common/common-redis/common-redis.iml" filepath="$PROJECT_DIR$/common/common-redis/common-redis.iml" /> <module fileurl="file://$PROJECT_DIR$/common/common-redis/common-redis.iml" filepath="$PROJECT_DIR$/common/common-redis/common-redis.iml" />
<module fileurl="file://$PROJECT_DIR$/common/common-sequence/common-sequence.iml" filepath="$PROJECT_DIR$/common/common-sequence/common-sequence.iml" /> <module fileurl="file://$PROJECT_DIR$/common/common-sequence/common-sequence.iml" filepath="$PROJECT_DIR$/common/common-sequence/common-sequence.iml" />
<module fileurl="file://$PROJECT_DIR$/common/common-swagger/common-swagger.iml" filepath="$PROJECT_DIR$/common/common-swagger/common-swagger.iml" />
<module fileurl="file://$PROJECT_DIR$/application/course-class/course-class.iml" filepath="$PROJECT_DIR$/application/course-class/course-class.iml" /> <module fileurl="file://$PROJECT_DIR$/application/course-class/course-class.iml" filepath="$PROJECT_DIR$/application/course-class/course-class.iml" />
<module fileurl="file://$PROJECT_DIR$/application/course-class/course-class-interface/course-class-interface.iml" filepath="$PROJECT_DIR$/application/course-class/course-class-interface/course-class-interface.iml" /> <module fileurl="file://$PROJECT_DIR$/application/course-class/course-class-interface/course-class-interface.iml" filepath="$PROJECT_DIR$/application/course-class/course-class-interface/course-class-interface.iml" />
<module fileurl="file://$PROJECT_DIR$/application/course-class/course-class-service/course-class-service.iml" filepath="$PROJECT_DIR$/application/course-class/course-class-service/course-class-service.iml" /> <module fileurl="file://$PROJECT_DIR$/application/course-class/course-class-service/course-class-service.iml" filepath="$PROJECT_DIR$/application/course-class/course-class-service/course-class-service.iml" />

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="2546802c-1b0b-4971-9f6c-08ccd8545f5e" name="Default Changelist" comment="" /> <list default="true" id="8e833a26-fdef-45f6-a8c9-69c22611e94c" name="Default Changelist" comment="" />
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@@ -13,7 +13,7 @@
<component name="ProjectCodeStyleSettingsMigration"> <component name="ProjectCodeStyleSettingsMigration">
<option name="version" value="1" /> <option name="version" value="1" />
</component> </component>
<component name="ProjectId" id="1lpjNJvR3t3VxuhsomgdAIE1Dyu" /> <component name="ProjectId" id="1mYqHJvsDmC9tqOlQivdAjKUGzi" />
<component name="ProjectViewState"> <component name="ProjectViewState">
<option name="abbreviatePackageNames" value="true" /> <option name="abbreviatePackageNames" value="true" />
<option name="autoscrollFromSource" value="true" /> <option name="autoscrollFromSource" value="true" />
@@ -36,7 +36,7 @@
<recent name="$PROJECT_DIR$/zz-resource/db-scripts" /> <recent name="$PROJECT_DIR$/zz-resource/db-scripts" />
</key> </key>
</component> </component>
<component name="RunManager" selected="Spring Boot.AdminMonitorApplication"> <component name="RunManager" selected="Spring Boot.CourseClassApplication">
<configuration name="AdminMonitorApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot"> <configuration name="AdminMonitorApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<module name="admin-monitor" /> <module name="admin-monitor" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.orange.demo.adminmonitor.AdminMonitorApplication" /> <option name="SPRING_BOOT_MAIN_CLASS" value="com.orange.demo.adminmonitor.AdminMonitorApplication" />
@@ -83,12 +83,12 @@
</component> </component>
<component name="TaskManager"> <component name="TaskManager">
<task active="true" id="Default" summary="Default task"> <task active="true" id="Default" summary="Default task">
<changelist id="2546802c-1b0b-4971-9f6c-08ccd8545f5e" name="Default Changelist" comment="" /> <changelist id="8e833a26-fdef-45f6-a8c9-69c22611e94c" name="Default Changelist" comment="" />
<created>1608300885867</created> <created>1609680782670</created>
<option name="number" value="Default" /> <option name="number" value="Default" />
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1608300885867</updated> <updated>1609680782670</updated>
<workItem from="1608300887522" duration="274000" /> <workItem from="1609680784203" duration="256000" />
</task> </task>
<servers /> <servers />
</component> </component>

View File

@@ -12,6 +12,8 @@
最后,我们真诚的希望能够得到您的反馈,并持续改进我们的产品、文档、服务和操作流程。 最后,我们真诚的希望能够得到您的反馈,并持续改进我们的产品、文档、服务和操作流程。
### 服务接口文档 ### 服务接口文档
--- ---
- Knife4j
- 服务启动后Knife4j的文档入口地址 [http://localhost:8082/doc.html#/plus](http://localhost:8082/doc.html#/plus)
- Postman - Postman
- 无需启动服务即可将当前工程的接口导出成Postman格式。在工程的common/common-tools/模块下找到ExportApiApp文件并执行main函数。 - 无需启动服务即可将当前工程的接口导出成Postman格式。在工程的common/common-tools/模块下找到ExportApiApp文件并执行main函数。

View File

@@ -84,12 +84,12 @@
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring:1.1.5" level="project" /> <orderEntry type="library" name="Maven: tk.mybatis:mapper-spring:1.1.5" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-extra:1.1.5" level="project" /> <orderEntry type="library" name="Maven: tk.mybatis:mapper-extra:1.1.5" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-autoconfigure:2.1.5" level="project" /> <orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-autoconfigure:2.1.5" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.2.13" level="project" /> <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.3.0" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.1" level="project" /> <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.3" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.1" level="project" /> <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.3" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.2.13" level="project" /> <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.3.0" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.1.11" level="project" /> <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.2.0" level="project" />
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:2.0" level="project" /> <orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:3.2" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery:2.2.1.RELEASE" level="project" /> <orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery:2.2.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-client:1.2.1" level="project" /> <orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-client:1.2.1" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-common:1.2.1" level="project" /> <orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-common:1.2.1" level="project" />

View File

@@ -85,12 +85,30 @@
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring:1.1.5" level="project" /> <orderEntry type="library" name="Maven: tk.mybatis:mapper-spring:1.1.5" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-extra:1.1.5" level="project" /> <orderEntry type="library" name="Maven: tk.mybatis:mapper-extra:1.1.5" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-autoconfigure:2.1.5" level="project" /> <orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-autoconfigure:2.1.5" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.2.13" level="project" /> <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.3.0" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.1" level="project" /> <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.3" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.1" level="project" /> <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.3" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.2.13" level="project" /> <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.3.0" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.1.11" level="project" /> <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.2.0" level="project" />
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:2.0" level="project" /> <orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:3.2" level="project" />
<orderEntry type="module" module-name="common-swagger" />
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-micro-spring-boot-starter:2.0.5" level="project" />
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-autoconfigure:2.0.5" level="project" />
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring:2.0.5" level="project" />
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-annotations:2.0.5" level="project" />
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-core:2.0.5" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.25.0-GA" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.22" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.22" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:2.9.2" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery:2.2.1.RELEASE" level="project" /> <orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery:2.2.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-client:1.2.1" level="project" /> <orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-client:1.2.1" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-common:1.2.1" level="project" /> <orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-common:1.2.1" level="project" />
@@ -247,7 +265,7 @@
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.13.2" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.13.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest:2.1" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest:2.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:3.1.0" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:3.1.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy:1.10.8" level="project" /> <orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.8" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.10.8" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.10.8" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" />

View File

@@ -26,5 +26,11 @@
<artifactId>common-core</artifactId> <artifactId>common-core</artifactId>
<version>1.0.0</version> <version>1.0.0</version>
</dependency> </dependency>
<!-- knife4j 接口文档框架 -->
<dependency>
<groupId>com.orange.demo</groupId>
<artifactId>common-swagger</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -1,5 +1,7 @@
package com.orange.demo.courseclassinterface.dto; package com.orange.demo.courseclassinterface.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
/** /**
@@ -8,26 +10,31 @@ import lombok.Data;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("行政区划实体对象")
@Data @Data
public class AreaCodeDto { public class AreaCodeDto {
/** /**
* 行政区划主键Id * 行政区划主键Id
*/ */
@ApiModelProperty(value = "行政区划主键Id", required = true)
private Long areaId; private Long areaId;
/** /**
* 行政区划名称 * 行政区划名称
*/ */
@ApiModelProperty(value = "行政区划名称")
private String areaName; private String areaName;
/** /**
* 行政区划级别 (1: 省级别 2: 市级别 3: 区级别) * 行政区划级别 (1: 省级别 2: 市级别 3: 区级别)
*/ */
@ApiModelProperty(value = "行政区划级别")
private Integer areaLevel; private Integer areaLevel;
/** /**
* 父级行政区划Id * 父级行政区划Id
*/ */
@ApiModelProperty(value = "父级行政区划Id")
private Long parentId; private Long parentId;
} }

View File

@@ -2,6 +2,8 @@ package com.orange.demo.courseclassinterface.dto;
import com.orange.demo.common.core.validator.UpdateGroup; import com.orange.demo.common.core.validator.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.*; import javax.validation.constraints.*;
@@ -12,24 +14,28 @@ import javax.validation.constraints.*;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("ClassCourseDto对象")
@Data @Data
public class ClassCourseDto { public class ClassCourseDto {
/** /**
* 班级Id。 * 班级Id。
*/ */
@ApiModelProperty(value = "班级Id", required = true)
@NotNull(message = "数据验证失败班级Id不能为空", groups = {UpdateGroup.class}) @NotNull(message = "数据验证失败班级Id不能为空", groups = {UpdateGroup.class})
private Long classId; private Long classId;
/** /**
* 课程Id。 * 课程Id。
*/ */
@ApiModelProperty(value = "课程Id", required = true)
@NotNull(message = "数据验证失败课程Id不能为空", groups = {UpdateGroup.class}) @NotNull(message = "数据验证失败课程Id不能为空", groups = {UpdateGroup.class})
private Long courseId; private Long courseId;
/** /**
* 课程顺序(数值越小越靠前)。 * 课程顺序(数值越小越靠前)。
*/ */
@ApiModelProperty(value = "课程顺序(数值越小越靠前)", required = true)
@NotNull(message = "数据验证失败,课程顺序(数值越小越靠前)不能为空!", groups = {UpdateGroup.class}) @NotNull(message = "数据验证失败,课程顺序(数值越小越靠前)不能为空!", groups = {UpdateGroup.class})
private Integer courseOrder; private Integer courseOrder;
} }

View File

@@ -2,6 +2,8 @@ package com.orange.demo.courseclassinterface.dto;
import com.orange.demo.common.core.validator.UpdateGroup; import com.orange.demo.common.core.validator.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.*; import javax.validation.constraints.*;
@@ -12,18 +14,21 @@ import javax.validation.constraints.*;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("ClassStudentDto对象")
@Data @Data
public class ClassStudentDto { public class ClassStudentDto {
/** /**
* 班级Id。 * 班级Id。
*/ */
@ApiModelProperty(value = "班级Id", required = true)
@NotNull(message = "数据验证失败班级Id不能为空", groups = {UpdateGroup.class}) @NotNull(message = "数据验证失败班级Id不能为空", groups = {UpdateGroup.class})
private Long classId; private Long classId;
/** /**
* 学生Id。 * 学生Id。
*/ */
@ApiModelProperty(value = "学生Id", required = true)
@NotNull(message = "数据验证失败学生Id不能为空", groups = {UpdateGroup.class}) @NotNull(message = "数据验证失败学生Id不能为空", groups = {UpdateGroup.class})
private Long studentId; private Long studentId;
} }

View File

@@ -5,12 +5,13 @@ import com.orange.demo.common.core.validator.ConstDictRef;
import com.orange.demo.courseclassinterface.constant.CourseDifficult; import com.orange.demo.courseclassinterface.constant.CourseDifficult;
import com.orange.demo.application.common.constant.Subject; import com.orange.demo.application.common.constant.Subject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
/** /**
* CourseDto对象。 * CourseDto对象。
@@ -18,35 +19,41 @@ import java.util.Date;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("CourseDto对象")
@Data @Data
public class CourseDto { public class CourseDto {
/** /**
* 主键Id。 * 主键Id。
*/ */
@ApiModelProperty(value = "主键Id", required = true)
@NotNull(message = "数据验证失败主键Id不能为空", groups = {UpdateGroup.class}) @NotNull(message = "数据验证失败主键Id不能为空", groups = {UpdateGroup.class})
private Long courseId; private Long courseId;
/** /**
* 课程名称。 * 课程名称。
*/ */
@ApiModelProperty(value = "课程名称", required = true)
@NotBlank(message = "数据验证失败,课程名称不能为空!") @NotBlank(message = "数据验证失败,课程名称不能为空!")
private String courseName; private String courseName;
/** /**
* 课程价格。 * 课程价格。
*/ */
@ApiModelProperty(value = "课程价格", required = true)
@NotNull(message = "数据验证失败,课程价格不能为空!") @NotNull(message = "数据验证失败,课程价格不能为空!")
private BigDecimal price; private BigDecimal price;
/** /**
* 课程描述。 * 课程描述。
*/ */
@ApiModelProperty(value = "课程描述")
private String description; private String description;
/** /**
* 课程难度(0: 容易 1: 普通 2: 很难)。 * 课程难度(0: 容易 1: 普通 2: 很难)。
*/ */
@ApiModelProperty(value = "课程难度(0: 容易 1: 普通 2: 很难)", required = true)
@NotNull(message = "数据验证失败,课程难度不能为空!") @NotNull(message = "数据验证失败,课程难度不能为空!")
@ConstDictRef(constDictClass = CourseDifficult.class, message = "数据验证失败,课程难度为无效值!") @ConstDictRef(constDictClass = CourseDifficult.class, message = "数据验证失败,课程难度为无效值!")
private Integer difficulty; private Integer difficulty;
@@ -54,12 +61,14 @@ public class CourseDto {
/** /**
* 年级Id。 * 年级Id。
*/ */
@ApiModelProperty(value = "年级Id", required = true)
@NotNull(message = "数据验证失败,所属年级不能为空!") @NotNull(message = "数据验证失败,所属年级不能为空!")
private Integer gradeId; private Integer gradeId;
/** /**
* 学科Id。 * 学科Id。
*/ */
@ApiModelProperty(value = "学科Id", required = true)
@NotNull(message = "数据验证失败,所属学科不能为空!") @NotNull(message = "数据验证失败,所属学科不能为空!")
@ConstDictRef(constDictClass = Subject.class, message = "数据验证失败,所属学科为无效值!") @ConstDictRef(constDictClass = Subject.class, message = "数据验证失败,所属学科为无效值!")
private Integer subjectId; private Integer subjectId;
@@ -67,57 +76,50 @@ public class CourseDto {
/** /**
* 课时数量。 * 课时数量。
*/ */
@ApiModelProperty(value = "课时数量", required = true)
@NotNull(message = "数据验证失败,课时数量不能为空!") @NotNull(message = "数据验证失败,课时数量不能为空!")
private Integer classHour; private Integer classHour;
/** /**
* 多张课程图片地址。 * 多张课程图片地址。
*/ */
@ApiModelProperty(value = "多张课程图片地址", required = true)
@NotBlank(message = "数据验证失败,课程图片不能为空!") @NotBlank(message = "数据验证失败,课程图片不能为空!")
private String pictureUrl; private String pictureUrl;
/**
* 创建用户Id。
*/
private Long createUserId;
/**
* 创建时间。
*/
private Date createTime;
/**
* 最后修改时间。
*/
private Date updateTime;
/** /**
* price 范围过滤起始值(>=)。 * price 范围过滤起始值(>=)。
*/ */
@ApiModelProperty(value = "price 范围过滤起始值(>=)")
private BigDecimal priceStart; private BigDecimal priceStart;
/** /**
* price 范围过滤结束值(<=)。 * price 范围过滤结束值(<=)。
*/ */
@ApiModelProperty(value = "price 范围过滤结束值(<=)")
private BigDecimal priceEnd; private BigDecimal priceEnd;
/** /**
* classHour 范围过滤起始值(>=)。 * classHour 范围过滤起始值(>=)。
*/ */
@ApiModelProperty(value = "classHour 范围过滤起始值(>=)")
private Integer classHourStart; private Integer classHourStart;
/** /**
* classHour 范围过滤结束值(<=)。 * classHour 范围过滤结束值(<=)。
*/ */
@ApiModelProperty(value = "classHour 范围过滤结束值(<=)")
private Integer classHourEnd; private Integer classHourEnd;
/** /**
* updateTime 范围过滤起始值(>=)。 * updateTime 范围过滤起始值(>=)。
*/ */
@ApiModelProperty(value = "updateTime 范围过滤起始值(>=)")
private String updateTimeStart; private String updateTimeStart;
/** /**
* updateTime 范围过滤结束值(<=)。 * updateTime 范围过滤结束值(<=)。
*/ */
@ApiModelProperty(value = "updateTime 范围过滤结束值(<=)")
private String updateTimeEnd; private String updateTimeEnd;
} }

View File

@@ -2,6 +2,8 @@ package com.orange.demo.courseclassinterface.dto;
import com.orange.demo.common.core.validator.UpdateGroup; import com.orange.demo.common.core.validator.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.*; import javax.validation.constraints.*;
@@ -12,18 +14,21 @@ import javax.validation.constraints.*;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("GradeDto对象")
@Data @Data
public class GradeDto { public class GradeDto {
/** /**
* 主键Id。 * 主键Id。
*/ */
@ApiModelProperty(value = "主键Id", required = true)
@NotNull(message = "数据验证失败主键Id不能为空", groups = {UpdateGroup.class}) @NotNull(message = "数据验证失败主键Id不能为空", groups = {UpdateGroup.class})
private Integer gradeId; private Integer gradeId;
/** /**
* 年级名称。 * 年级名称。
*/ */
@ApiModelProperty(value = "年级名称", required = true)
@NotBlank(message = "数据验证失败,年级名称不能为空!") @NotBlank(message = "数据验证失败,年级名称不能为空!")
private String gradeName; private String gradeName;
} }

View File

@@ -2,41 +2,47 @@ package com.orange.demo.courseclassinterface.dto;
import com.orange.demo.common.core.validator.UpdateGroup; import com.orange.demo.common.core.validator.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.*; import javax.validation.constraints.*;
/** /**
* SchoolInfoDto对象。 * SchoolInfoDto对象。
* *
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("SchoolInfoDto对象")
@Data @Data
public class SchoolInfoDto { public class SchoolInfoDto {
/** /**
* 学校Id。 * 学校Id。
*/ */
@ApiModelProperty(value = "学校Id", required = true)
@NotNull(message = "数据验证失败学校Id不能为空", groups = {UpdateGroup.class}) @NotNull(message = "数据验证失败学校Id不能为空", groups = {UpdateGroup.class})
private Long schoolId; private Long schoolId;
/** /**
* 学校名称。 * 学校名称。
*/ */
@ApiModelProperty(value = "学校名称", required = true)
@NotBlank(message = "数据验证失败,学校名称不能为空!") @NotBlank(message = "数据验证失败,学校名称不能为空!")
private String schoolName; private String schoolName;
/** /**
* 所在省Id。 * 所在省Id。
*/ */
@ApiModelProperty(value = "所在省Id", required = true)
@NotNull(message = "数据验证失败,所在省份不能为空!") @NotNull(message = "数据验证失败,所在省份不能为空!")
private Long provinceId; private Long provinceId;
/** /**
* 所在城市Id。 * 所在城市Id。
*/ */
@ApiModelProperty(value = "所在城市Id", required = true)
@NotNull(message = "数据验证失败,所在城市不能为空!") @NotNull(message = "数据验证失败,所在城市不能为空!")
private Long cityId; private Long cityId;
} }

View File

@@ -4,65 +4,62 @@ import com.orange.demo.common.core.validator.UpdateGroup;
import com.orange.demo.common.core.validator.ConstDictRef; import com.orange.demo.common.core.validator.ConstDictRef;
import com.orange.demo.courseclassinterface.constant.ClassLevel; import com.orange.demo.courseclassinterface.constant.ClassLevel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import java.util.Date;
/** /**
* StudentClassDto对象。 * StudentClassDto对象。
* *
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("StudentClassDto对象")
@Data @Data
public class StudentClassDto { public class StudentClassDto {
/** /**
* 班级Id。 * 班级Id。
*/ */
@ApiModelProperty(value = "班级Id", required = true)
@NotNull(message = "数据验证失败班级Id不能为空", groups = {UpdateGroup.class}) @NotNull(message = "数据验证失败班级Id不能为空", groups = {UpdateGroup.class})
private Long classId; private Long classId;
/** /**
* 班级名称。 * 班级名称。
*/ */
@ApiModelProperty(value = "班级名称", required = true)
@NotBlank(message = "数据验证失败,班级名称不能为空!") @NotBlank(message = "数据验证失败,班级名称不能为空!")
private String className; private String className;
/** /**
* 学校Id。 * 学校Id。
*/ */
@ApiModelProperty(value = "学校Id", required = true)
@NotNull(message = "数据验证失败,所属校区不能为空!") @NotNull(message = "数据验证失败,所属校区不能为空!")
private Long schoolId; private Long schoolId;
/** /**
* 学生班长Id。 * 学生班长Id。
*/ */
@ApiModelProperty(value = "学生班长Id", required = true)
@NotNull(message = "数据验证失败,班长不能为空!") @NotNull(message = "数据验证失败,班长不能为空!")
private Long leaderId; private Long leaderId;
/** /**
* 已完成课时数量。 * 已完成课时数量。
*/ */
@ApiModelProperty(value = "已完成课时数量", required = true)
@NotNull(message = "数据验证失败,已完成课时不能为空!") @NotNull(message = "数据验证失败,已完成课时不能为空!")
private Integer finishClassHour; private Integer finishClassHour;
/** /**
* 班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)。 * 班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)。
*/ */
@ApiModelProperty(value = "班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)", required = true)
@NotNull(message = "数据验证失败,班级级别不能为空!") @NotNull(message = "数据验证失败,班级级别不能为空!")
@ConstDictRef(constDictClass = ClassLevel.class, message = "数据验证失败,班级级别为无效值!") @ConstDictRef(constDictClass = ClassLevel.class, message = "数据验证失败,班级级别为无效值!")
private Integer classLevel; private Integer classLevel;
/**
* 创建用户。
*/
private Long createUserId;
/**
* 班级创建时间。
*/
private Date createTime;
} }

View File

@@ -6,6 +6,8 @@ import com.orange.demo.application.common.constant.Gender;
import com.orange.demo.application.common.constant.ExpLevel; import com.orange.demo.application.common.constant.ExpLevel;
import com.orange.demo.application.common.constant.StudentStatus; import com.orange.demo.application.common.constant.StudentStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.*; import javax.validation.constraints.*;
@@ -18,48 +20,56 @@ import java.util.Date;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("StudentDto对象")
@Data @Data
public class StudentDto { public class StudentDto {
/** /**
* 学生Id。 * 学生Id。
*/ */
@ApiModelProperty(value = "学生Id", required = true)
@NotNull(message = "数据验证失败学生Id不能为空", groups = {UpdateGroup.class}) @NotNull(message = "数据验证失败学生Id不能为空", groups = {UpdateGroup.class})
private Long studentId; private Long studentId;
/** /**
* 登录手机。 * 登录手机。
*/ */
@ApiModelProperty(value = "登录手机", required = true)
@NotBlank(message = "数据验证失败,手机号码不能为空!") @NotBlank(message = "数据验证失败,手机号码不能为空!")
private String loginMobile; private String loginMobile;
/** /**
* 学生姓名。 * 学生姓名。
*/ */
@ApiModelProperty(value = "学生姓名", required = true)
@NotBlank(message = "数据验证失败,姓名不能为空!") @NotBlank(message = "数据验证失败,姓名不能为空!")
private String studentName; private String studentName;
/** /**
* 所在省份Id。 * 所在省份Id。
*/ */
@ApiModelProperty(value = "所在省份Id", required = true)
@NotNull(message = "数据验证失败,所在省份不能为空!") @NotNull(message = "数据验证失败,所在省份不能为空!")
private Long provinceId; private Long provinceId;
/** /**
* 所在城市Id。 * 所在城市Id。
*/ */
@ApiModelProperty(value = "所在城市Id", required = true)
@NotNull(message = "数据验证失败,所在城市不能为空!") @NotNull(message = "数据验证失败,所在城市不能为空!")
private Long cityId; private Long cityId;
/** /**
* 区县Id。 * 区县Id。
*/ */
@ApiModelProperty(value = "区县Id", required = true)
@NotNull(message = "数据验证失败,所在区县不能为空!") @NotNull(message = "数据验证失败,所在区县不能为空!")
private Long districtId; private Long districtId;
/** /**
* 学生性别 (0: 女生 1: 男生)。 * 学生性别 (0: 女生 1: 男生)。
*/ */
@ApiModelProperty(value = "学生性别 (0: 女生 1: 男生)", required = true)
@NotNull(message = "数据验证失败,性别不能为空!") @NotNull(message = "数据验证失败,性别不能为空!")
@ConstDictRef(constDictClass = Gender.class, message = "数据验证失败,性别为无效值!") @ConstDictRef(constDictClass = Gender.class, message = "数据验证失败,性别为无效值!")
private Integer gender; private Integer gender;
@@ -67,12 +77,14 @@ public class StudentDto {
/** /**
* 生日。 * 生日。
*/ */
@ApiModelProperty(value = "生日", required = true)
@NotNull(message = "数据验证失败,生日不能为空!") @NotNull(message = "数据验证失败,生日不能为空!")
private Date birthday; private Date birthday;
/** /**
* 经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)。 * 经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)。
*/ */
@ApiModelProperty(value = "经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)", required = true)
@NotNull(message = "数据验证失败,经验等级不能为空!") @NotNull(message = "数据验证失败,经验等级不能为空!")
@ConstDictRef(constDictClass = ExpLevel.class, message = "数据验证失败,经验等级为无效值!") @ConstDictRef(constDictClass = ExpLevel.class, message = "数据验证失败,经验等级为无效值!")
private Integer experienceLevel; private Integer experienceLevel;
@@ -80,35 +92,35 @@ public class StudentDto {
/** /**
* 总共充值学币数量。 * 总共充值学币数量。
*/ */
@ApiModelProperty(value = "总共充值学币数量", required = true)
@NotNull(message = "数据验证失败,充值学币不能为空!", groups = {UpdateGroup.class}) @NotNull(message = "数据验证失败,充值学币不能为空!", groups = {UpdateGroup.class})
private Integer totalCoin; private Integer totalCoin;
/** /**
* 可用学币数量。 * 可用学币数量。
*/ */
@ApiModelProperty(value = "可用学币数量", required = true)
@NotNull(message = "数据验证失败,剩余学币不能为空!", groups = {UpdateGroup.class}) @NotNull(message = "数据验证失败,剩余学币不能为空!", groups = {UpdateGroup.class})
private Integer leftCoin; private Integer leftCoin;
/** /**
* 年级Id。 * 年级Id。
*/ */
@ApiModelProperty(value = "年级Id", required = true)
@NotNull(message = "数据验证失败,年级不能为空!") @NotNull(message = "数据验证失败,年级不能为空!")
private Integer gradeId; private Integer gradeId;
/** /**
* 校区Id。 * 校区Id。
*/ */
@ApiModelProperty(value = "校区Id", required = true)
@NotNull(message = "数据验证失败,所属校区不能为空!") @NotNull(message = "数据验证失败,所属校区不能为空!")
private Long schoolId; private Long schoolId;
/**
* 注册时间。
*/
private Date registerTime;
/** /**
* 学生状态 (0: 正常 1: 锁定 2: 注销)。 * 学生状态 (0: 正常 1: 锁定 2: 注销)。
*/ */
@ApiModelProperty(value = "学生状态 (0: 正常 1: 锁定 2: 注销)", required = true)
@NotNull(message = "数据验证失败,状态 不能为空!", groups = {UpdateGroup.class}) @NotNull(message = "数据验证失败,状态 不能为空!", groups = {UpdateGroup.class})
@ConstDictRef(constDictClass = StudentStatus.class, message = "数据验证失败,状态 为无效值!") @ConstDictRef(constDictClass = StudentStatus.class, message = "数据验证失败,状态 为无效值!")
private Integer status; private Integer status;
@@ -116,25 +128,30 @@ public class StudentDto {
/** /**
* birthday 范围过滤起始值(>=)。 * birthday 范围过滤起始值(>=)。
*/ */
@ApiModelProperty(value = "birthday 范围过滤起始值(>=)")
private String birthdayStart; private String birthdayStart;
/** /**
* birthday 范围过滤结束值(<=)。 * birthday 范围过滤结束值(<=)。
*/ */
@ApiModelProperty(value = "birthday 范围过滤结束值(<=)")
private String birthdayEnd; private String birthdayEnd;
/** /**
* registerTime 范围过滤起始值(>=)。 * registerTime 范围过滤起始值(>=)。
*/ */
@ApiModelProperty(value = "registerTime 范围过滤起始值(>=)")
private String registerTimeStart; private String registerTimeStart;
/** /**
* registerTime 范围过滤结束值(<=)。 * registerTime 范围过滤结束值(<=)。
*/ */
@ApiModelProperty(value = "registerTime 范围过滤结束值(<=)")
private String registerTimeEnd; private String registerTimeEnd;
/** /**
* true LIKE搜索字符串。 * true LIKE搜索字符串。
*/ */
@ApiModelProperty(value = "LIKE模糊搜索字符串")
private String searchString; private String searchString;
} }

View File

@@ -1,5 +1,7 @@
package com.orange.demo.courseclassinterface.vo; package com.orange.demo.courseclassinterface.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
/** /**
@@ -8,26 +10,31 @@ import lombok.Data;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("行政区划实体对象VO")
@Data @Data
public class AreaCodeVo { public class AreaCodeVo {
/** /**
* 行政区划主键Id * 行政区划主键Id
*/ */
@ApiModelProperty(value = "行政区划主键Id", required = true)
private Long areaId; private Long areaId;
/** /**
* 行政区划名称 * 行政区划名称
*/ */
@ApiModelProperty(value = "行政区划名称")
private String areaName; private String areaName;
/** /**
* 行政区划级别 (1: 省级别 2: 市级别 3: 区级别) * 行政区划级别 (1: 省级别 2: 市级别 3: 区级别)
*/ */
@ApiModelProperty(value = "行政区划级别")
private Integer areaLevel; private Integer areaLevel;
/** /**
* 父级行政区划Id * 父级行政区划Id
*/ */
@ApiModelProperty(value = "父级行政区划Id")
private Long parentId; private Long parentId;
} }

View File

@@ -1,5 +1,7 @@
package com.orange.demo.courseclassinterface.vo; package com.orange.demo.courseclassinterface.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
/** /**
@@ -8,21 +10,25 @@ import lombok.Data;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("ClassCourseVO实体对象")
@Data @Data
public class ClassCourseVo { public class ClassCourseVo {
/** /**
* 班级Id。 * 班级Id。
*/ */
@ApiModelProperty(value = "班级Id")
private Long classId; private Long classId;
/** /**
* 课程Id。 * 课程Id。
*/ */
@ApiModelProperty(value = "课程Id")
private Long courseId; private Long courseId;
/** /**
* 课程顺序(数值越小越靠前)。 * 课程顺序(数值越小越靠前)。
*/ */
@ApiModelProperty(value = "课程顺序(数值越小越靠前)")
private Integer courseOrder; private Integer courseOrder;
} }

View File

@@ -1,5 +1,7 @@
package com.orange.demo.courseclassinterface.vo; package com.orange.demo.courseclassinterface.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
/** /**
@@ -8,16 +10,19 @@ import lombok.Data;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("ClassStudentVO实体对象")
@Data @Data
public class ClassStudentVo { public class ClassStudentVo {
/** /**
* 班级Id。 * 班级Id。
*/ */
@ApiModelProperty(value = "班级Id")
private Long classId; private Long classId;
/** /**
* 学生Id。 * 学生Id。
*/ */
@ApiModelProperty(value = "学生Id")
private Long studentId; private Long studentId;
} }

View File

@@ -1,5 +1,7 @@
package com.orange.demo.courseclassinterface.vo; package com.orange.demo.courseclassinterface.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
@@ -12,86 +14,103 @@ import java.util.Map;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("CourseVO实体对象")
@Data @Data
public class CourseVo { public class CourseVo {
/** /**
* 主键Id。 * 主键Id。
*/ */
@ApiModelProperty(value = "主键Id")
private Long courseId; private Long courseId;
/** /**
* 课程名称。 * 课程名称。
*/ */
@ApiModelProperty(value = "课程名称")
private String courseName; private String courseName;
/** /**
* 课程价格。 * 课程价格。
*/ */
@ApiModelProperty(value = "课程价格")
private BigDecimal price; private BigDecimal price;
/** /**
* 课程描述。 * 课程描述。
*/ */
@ApiModelProperty(value = "课程描述")
private String description; private String description;
/** /**
* 课程难度(0: 容易 1: 普通 2: 很难)。 * 课程难度(0: 容易 1: 普通 2: 很难)。
*/ */
@ApiModelProperty(value = "课程难度(0: 容易 1: 普通 2: 很难)")
private Integer difficulty; private Integer difficulty;
/** /**
* 年级Id。 * 年级Id。
*/ */
@ApiModelProperty(value = "年级Id")
private Integer gradeId; private Integer gradeId;
/** /**
* 学科Id。 * 学科Id。
*/ */
@ApiModelProperty(value = "学科Id")
private Integer subjectId; private Integer subjectId;
/** /**
* 课时数量。 * 课时数量。
*/ */
@ApiModelProperty(value = "课时数量")
private Integer classHour; private Integer classHour;
/** /**
* 多张课程图片地址。 * 多张课程图片地址。
*/ */
@ApiModelProperty(value = "多张课程图片地址")
private String pictureUrl; private String pictureUrl;
/** /**
* 创建用户Id。 * 创建用户Id。
*/ */
@ApiModelProperty(value = "创建用户Id")
private Long createUserId; private Long createUserId;
/** /**
* 创建时间。 * 创建时间。
*/ */
@ApiModelProperty(value = "创建时间")
private Date createTime; private Date createTime;
/** /**
* 最后修改时间。 * 最后修改时间。
*/ */
@ApiModelProperty(value = "最后修改时间")
private Date updateTime; private Date updateTime;
/** /**
* courseId 的多对多关联表数据对象数据对应类型为ClassCourseVo。 * courseId 的多对多关联表数据对象数据对应类型为ClassCourseVo。
*/ */
@ApiModelProperty(value = "courseId 的多对多关联表数据对象数据对应类型为ClassCourseVo")
private Map<String, Object> classCourse; private Map<String, Object> classCourse;
/** /**
* gradeId 字典关联数据。 * gradeId 字典关联数据。
*/ */
@ApiModelProperty(value = "gradeId 字典关联数据")
private Map<String, Object> gradeIdDictMap; private Map<String, Object> gradeIdDictMap;
/** /**
* difficulty 常量字典关联数据。 * difficulty 常量字典关联数据。
*/ */
@ApiModelProperty(value = "difficulty 常量字典关联数据")
private Map<String, Object> difficultyDictMap; private Map<String, Object> difficultyDictMap;
/** /**
* subjectId 常量字典关联数据。 * subjectId 常量字典关联数据。
*/ */
@ApiModelProperty(value = "subjectId 常量字典关联数据")
private Map<String, Object> subjectIdDictMap; private Map<String, Object> subjectIdDictMap;
} }

View File

@@ -1,5 +1,7 @@
package com.orange.demo.courseclassinterface.vo; package com.orange.demo.courseclassinterface.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
/** /**
@@ -8,16 +10,19 @@ import lombok.Data;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("GradeVO实体对象")
@Data @Data
public class GradeVo { public class GradeVo {
/** /**
* 主键Id。 * 主键Id。
*/ */
@ApiModelProperty(value = "主键Id")
private Integer gradeId; private Integer gradeId;
/** /**
* 年级名称。 * 年级名称。
*/ */
@ApiModelProperty(value = "年级名称")
private String gradeName; private String gradeName;
} }

View File

@@ -1,5 +1,7 @@
package com.orange.demo.courseclassinterface.vo; package com.orange.demo.courseclassinterface.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Map; import java.util.Map;
@@ -10,36 +12,43 @@ import java.util.Map;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("SchoolInfoVO实体对象")
@Data @Data
public class SchoolInfoVo { public class SchoolInfoVo {
/** /**
* 学校Id。 * 学校Id。
*/ */
@ApiModelProperty(value = "学校Id")
private Long schoolId; private Long schoolId;
/** /**
* 学校名称。 * 学校名称。
*/ */
@ApiModelProperty(value = "学校名称")
private String schoolName; private String schoolName;
/** /**
* 所在省Id。 * 所在省Id。
*/ */
@ApiModelProperty(value = "所在省Id")
private Long provinceId; private Long provinceId;
/** /**
* 所在城市Id。 * 所在城市Id。
*/ */
@ApiModelProperty(value = "所在城市Id")
private Long cityId; private Long cityId;
/** /**
* provinceId 字典关联数据。 * provinceId 字典关联数据。
*/ */
@ApiModelProperty(value = "provinceId 字典关联数据")
private Map<String, Object> provinceIdDictMap; private Map<String, Object> provinceIdDictMap;
/** /**
* cityId 字典关联数据。 * cityId 字典关联数据。
*/ */
@ApiModelProperty(value = "cityId 字典关联数据")
private Map<String, Object> cityIdDictMap; private Map<String, Object> cityIdDictMap;
} }

View File

@@ -1,5 +1,7 @@
package com.orange.demo.courseclassinterface.vo; package com.orange.demo.courseclassinterface.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
@@ -11,61 +13,73 @@ import java.util.Map;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("StudentClassVO实体对象")
@Data @Data
public class StudentClassVo { public class StudentClassVo {
/** /**
* 班级Id。 * 班级Id。
*/ */
@ApiModelProperty(value = "班级Id")
private Long classId; private Long classId;
/** /**
* 班级名称。 * 班级名称。
*/ */
@ApiModelProperty(value = "班级名称")
private String className; private String className;
/** /**
* 学校Id。 * 学校Id。
*/ */
@ApiModelProperty(value = "学校Id")
private Long schoolId; private Long schoolId;
/** /**
* 学生班长Id。 * 学生班长Id。
*/ */
@ApiModelProperty(value = "学生班长Id")
private Long leaderId; private Long leaderId;
/** /**
* 已完成课时数量。 * 已完成课时数量。
*/ */
@ApiModelProperty(value = "已完成课时数量")
private Integer finishClassHour; private Integer finishClassHour;
/** /**
* 班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)。 * 班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)。
*/ */
@ApiModelProperty(value = "班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)")
private Integer classLevel; private Integer classLevel;
/** /**
* 创建用户。 * 创建用户。
*/ */
@ApiModelProperty(value = "创建用户")
private Long createUserId; private Long createUserId;
/** /**
* 班级创建时间。 * 班级创建时间。
*/ */
@ApiModelProperty(value = "班级创建时间")
private Date createTime; private Date createTime;
/** /**
* schoolId 字典关联数据。 * schoolId 字典关联数据。
*/ */
@ApiModelProperty(value = "schoolId 字典关联数据")
private Map<String, Object> schoolIdDictMap; private Map<String, Object> schoolIdDictMap;
/** /**
* leaderId 字典关联数据。 * leaderId 字典关联数据。
*/ */
@ApiModelProperty(value = "leaderId 字典关联数据")
private Map<String, Object> leaderIdDictMap; private Map<String, Object> leaderIdDictMap;
/** /**
* classLevel 常量字典关联数据。 * classLevel 常量字典关联数据。
*/ */
@ApiModelProperty(value = "classLevel 常量字典关联数据")
private Map<String, Object> classLevelDictMap; private Map<String, Object> classLevelDictMap;
} }

View File

@@ -1,5 +1,7 @@
package com.orange.demo.courseclassinterface.vo; package com.orange.demo.courseclassinterface.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
@@ -11,121 +13,145 @@ import java.util.Map;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("StudentVO实体对象")
@Data @Data
public class StudentVo { public class StudentVo {
/** /**
* 学生Id。 * 学生Id。
*/ */
@ApiModelProperty(value = "学生Id")
private Long studentId; private Long studentId;
/** /**
* 登录手机。 * 登录手机。
*/ */
@ApiModelProperty(value = "登录手机")
private String loginMobile; private String loginMobile;
/** /**
* 学生姓名。 * 学生姓名。
*/ */
@ApiModelProperty(value = "学生姓名")
private String studentName; private String studentName;
/** /**
* 所在省份Id。 * 所在省份Id。
*/ */
@ApiModelProperty(value = "所在省份Id")
private Long provinceId; private Long provinceId;
/** /**
* 所在城市Id。 * 所在城市Id。
*/ */
@ApiModelProperty(value = "所在城市Id")
private Long cityId; private Long cityId;
/** /**
* 区县Id。 * 区县Id。
*/ */
@ApiModelProperty(value = "区县Id")
private Long districtId; private Long districtId;
/** /**
* 学生性别 (0: 女生 1: 男生)。 * 学生性别 (0: 女生 1: 男生)。
*/ */
@ApiModelProperty(value = "学生性别 (0: 女生 1: 男生)")
private Integer gender; private Integer gender;
/** /**
* 生日。 * 生日。
*/ */
@ApiModelProperty(value = "生日")
private Date birthday; private Date birthday;
/** /**
* 经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)。 * 经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)。
*/ */
@ApiModelProperty(value = "经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)")
private Integer experienceLevel; private Integer experienceLevel;
/** /**
* 总共充值学币数量。 * 总共充值学币数量。
*/ */
@ApiModelProperty(value = "总共充值学币数量")
private Integer totalCoin; private Integer totalCoin;
/** /**
* 可用学币数量。 * 可用学币数量。
*/ */
@ApiModelProperty(value = "可用学币数量")
private Integer leftCoin; private Integer leftCoin;
/** /**
* 年级Id。 * 年级Id。
*/ */
@ApiModelProperty(value = "年级Id")
private Integer gradeId; private Integer gradeId;
/** /**
* 校区Id。 * 校区Id。
*/ */
@ApiModelProperty(value = "校区Id")
private Long schoolId; private Long schoolId;
/** /**
* 注册时间。 * 注册时间。
*/ */
@ApiModelProperty(value = "注册时间")
private Date registerTime; private Date registerTime;
/** /**
* 学生状态 (0: 正常 1: 锁定 2: 注销)。 * 学生状态 (0: 正常 1: 锁定 2: 注销)。
*/ */
@ApiModelProperty(value = "学生状态 (0: 正常 1: 锁定 2: 注销)")
private Integer status; private Integer status;
/** /**
* provinceId 字典关联数据。 * provinceId 字典关联数据。
*/ */
@ApiModelProperty(value = "provinceId 字典关联数据")
private Map<String, Object> provinceIdDictMap; private Map<String, Object> provinceIdDictMap;
/** /**
* cityId 字典关联数据。 * cityId 字典关联数据。
*/ */
@ApiModelProperty(value = "cityId 字典关联数据")
private Map<String, Object> cityIdDictMap; private Map<String, Object> cityIdDictMap;
/** /**
* districtId 字典关联数据。 * districtId 字典关联数据。
*/ */
@ApiModelProperty(value = "districtId 字典关联数据")
private Map<String, Object> districtIdDictMap; private Map<String, Object> districtIdDictMap;
/** /**
* gradeId 字典关联数据。 * gradeId 字典关联数据。
*/ */
@ApiModelProperty(value = "gradeId 字典关联数据")
private Map<String, Object> gradeIdDictMap; private Map<String, Object> gradeIdDictMap;
/** /**
* schoolId 字典关联数据。 * schoolId 字典关联数据。
*/ */
@ApiModelProperty(value = "schoolId 字典关联数据")
private Map<String, Object> schoolIdDictMap; private Map<String, Object> schoolIdDictMap;
/** /**
* gender 常量字典关联数据。 * gender 常量字典关联数据。
*/ */
@ApiModelProperty(value = "gender 常量字典关联数据")
private Map<String, Object> genderDictMap; private Map<String, Object> genderDictMap;
/** /**
* experienceLevel 常量字典关联数据。 * experienceLevel 常量字典关联数据。
*/ */
@ApiModelProperty(value = "experienceLevel 常量字典关联数据")
private Map<String, Object> experienceLevelDictMap; private Map<String, Object> experienceLevelDictMap;
/** /**
* status 常量字典关联数据。 * status 常量字典关联数据。
*/ */
@ApiModelProperty(value = "status 常量字典关联数据")
private Map<String, Object> statusDictMap; private Map<String, Object> statusDictMap;
} }

View File

@@ -83,12 +83,29 @@
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring:1.1.5" level="project" /> <orderEntry type="library" name="Maven: tk.mybatis:mapper-spring:1.1.5" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-extra:1.1.5" level="project" /> <orderEntry type="library" name="Maven: tk.mybatis:mapper-extra:1.1.5" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-autoconfigure:2.1.5" level="project" /> <orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-autoconfigure:2.1.5" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.2.13" level="project" /> <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.3.0" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.1" level="project" /> <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.3" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.1" level="project" /> <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.3" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.2.13" level="project" /> <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.3.0" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.1.11" level="project" /> <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.2.0" level="project" />
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:2.0" level="project" /> <orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:3.2" level="project" />
<orderEntry type="module" module-name="common-swagger" />
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-micro-spring-boot-starter:2.0.5" level="project" />
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-autoconfigure:2.0.5" level="project" />
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring:2.0.5" level="project" />
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-annotations:2.0.5" level="project" />
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-core:2.0.5" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.22" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.22" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:2.9.2" level="project" />
<orderEntry type="module" module-name="common-redis" /> <orderEntry type="module" module-name="common-redis" />
<orderEntry type="library" name="Maven: redis.clients:jedis:3.1.0" level="project" /> <orderEntry type="library" name="Maven: redis.clients:jedis:3.1.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.7.0" level="project" /> <orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.7.0" level="project" />

View File

@@ -1,8 +1,9 @@
package com.orange.demo.courseclassservice.controller; package com.orange.demo.courseclassservice.controller;
import io.swagger.annotations.Api;
import cn.jimmyshi.beanquery.BeanQuery; import cn.jimmyshi.beanquery.BeanQuery;
import com.orange.demo.common.core.base.controller.BaseController; import com.orange.demo.common.core.base.controller.BaseController;
import com.orange.demo.common.core.base.service.BaseService; import com.orange.demo.common.core.base.service.IBaseDictService;
import com.orange.demo.common.core.util.MyModelUtil; import com.orange.demo.common.core.util.MyModelUtil;
import com.orange.demo.common.core.object.*; import com.orange.demo.common.core.object.*;
import com.orange.demo.courseclassinterface.vo.AreaCodeVo; import com.orange.demo.courseclassinterface.vo.AreaCodeVo;
@@ -20,6 +21,7 @@ import java.util.*;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@Api(tags = "行政区划数据访问接口")
@RestController @RestController
@RequestMapping("/areaCode") @RequestMapping("/areaCode")
public class AreaCodeController extends BaseController<AreaCode, AreaCodeVo, Long> { public class AreaCodeController extends BaseController<AreaCode, AreaCodeVo, Long> {
@@ -28,7 +30,7 @@ public class AreaCodeController extends BaseController<AreaCode, AreaCodeVo, Lon
private AreaCodeService areaCodeService; private AreaCodeService areaCodeService;
@Override @Override
protected BaseService<AreaCode, Long> service() { protected IBaseDictService<AreaCode, Long> service() {
return areaCodeService; return areaCodeService;
} }

View File

@@ -15,11 +15,13 @@ import com.orange.demo.common.core.object.*;
import com.orange.demo.common.core.util.*; import com.orange.demo.common.core.util.*;
import com.orange.demo.common.core.constant.*; import com.orange.demo.common.core.constant.*;
import com.orange.demo.common.core.base.controller.BaseController; import com.orange.demo.common.core.base.controller.BaseController;
import com.orange.demo.common.core.base.service.BaseService; import com.orange.demo.common.core.base.service.IBaseService;
import com.orange.demo.common.core.annotation.MyRequestBody; import com.orange.demo.common.core.annotation.MyRequestBody;
import com.orange.demo.common.core.validator.UpdateGroup; import com.orange.demo.common.core.validator.UpdateGroup;
import com.orange.demo.common.redis.cache.SessionCacheHelper; import com.orange.demo.common.redis.cache.SessionCacheHelper;
import com.orange.demo.courseclassservice.config.ApplicationConfig; import com.orange.demo.courseclassservice.config.ApplicationConfig;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -35,6 +37,7 @@ import java.util.*;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@Api(tags = "课程数据管理接口")
@Slf4j @Slf4j
@RestController @RestController
@RequestMapping("/course") @RequestMapping("/course")
@@ -50,7 +53,7 @@ public class CourseController extends BaseController<Course, CourseVo, Long> {
private UpDownloaderFactory upDownloaderFactory; private UpDownloaderFactory upDownloaderFactory;
@Override @Override
protected BaseService<Course, Long> service() { protected IBaseService<Course, Long> service() {
return courseService; return courseService;
} }
@@ -60,6 +63,14 @@ public class CourseController extends BaseController<Course, CourseVo, Long> {
* @param courseDto 新增对象。 * @param courseDto 新增对象。
* @return 应答结果对象包含新增对象主键Id。 * @return 应答结果对象包含新增对象主键Id。
*/ */
@ApiOperationSupport(ignoreParameters = {
"course.courseId",
"course.priceStart",
"course.priceEnd",
"course.classHourStart",
"course.classHourEnd",
"course.updateTimeStart",
"course.updateTimeEnd"})
@PostMapping("/add") @PostMapping("/add")
public ResponseResult<Long> add(@MyRequestBody("course") CourseDto courseDto) { public ResponseResult<Long> add(@MyRequestBody("course") CourseDto courseDto) {
String errorMessage = MyCommonUtil.getModelValidationError(courseDto); String errorMessage = MyCommonUtil.getModelValidationError(courseDto);
@@ -83,6 +94,13 @@ public class CourseController extends BaseController<Course, CourseVo, Long> {
* @param courseDto 更新对象。 * @param courseDto 更新对象。
* @return 应答结果对象。 * @return 应答结果对象。
*/ */
@ApiOperationSupport(ignoreParameters = {
"course.priceStart",
"course.priceEnd",
"course.classHourStart",
"course.classHourEnd",
"course.updateTimeStart",
"course.updateTimeEnd"})
@PostMapping("/update") @PostMapping("/update")
public ResponseResult<Void> update(@MyRequestBody("course") CourseDto courseDto) { public ResponseResult<Void> update(@MyRequestBody("course") CourseDto courseDto) {
String errorMessage = MyCommonUtil.getModelValidationError(courseDto, Default.class, UpdateGroup.class); String errorMessage = MyCommonUtil.getModelValidationError(courseDto, Default.class, UpdateGroup.class);
@@ -279,7 +297,7 @@ public class CourseController extends BaseController<Course, CourseVo, Long> {
*/ */
@GetMapping("/listDict") @GetMapping("/listDict")
public ResponseResult<List<Map<String, Object>>> listDict(Course filter) { public ResponseResult<List<Map<String, Object>>> listDict(Course filter) {
List<Course> resultList = courseService.getListByFilter(filter, null); List<Course> resultList = courseService.getListByFilter(filter);
return ResponseResult.success( return ResponseResult.success(
BeanQuery.select("courseId as id", "courseName as name").executeFrom(resultList)); BeanQuery.select("courseId as id", "courseName as name").executeFrom(resultList));
} }
@@ -291,6 +309,7 @@ public class CourseController extends BaseController<Course, CourseVo, Long> {
* @param withDict 是否包含字典关联。 * @param withDict 是否包含字典关联。
* @return 应答结果对象,包含主对象集合。 * @return 应答结果对象,包含主对象集合。
*/ */
@ApiOperation(hidden = true, value = "listByIds")
@PostMapping("/listByIds") @PostMapping("/listByIds")
public ResponseResult<List<CourseVo>> listByIds( public ResponseResult<List<CourseVo>> listByIds(
@RequestParam Set<Long> courseIds, @RequestParam Boolean withDict) { @RequestParam Set<Long> courseIds, @RequestParam Boolean withDict) {
@@ -304,6 +323,7 @@ public class CourseController extends BaseController<Course, CourseVo, Long> {
* @param withDict 是否包含字典关联。 * @param withDict 是否包含字典关联。
* @return 应答结果对象,包含主对象数据。 * @return 应答结果对象,包含主对象数据。
*/ */
@ApiOperation(hidden = true, value = "getById")
@PostMapping("/getById") @PostMapping("/getById")
public ResponseResult<CourseVo> getById( public ResponseResult<CourseVo> getById(
@RequestParam Long courseId, @RequestParam Boolean withDict) { @RequestParam Long courseId, @RequestParam Boolean withDict) {
@@ -316,6 +336,7 @@ public class CourseController extends BaseController<Course, CourseVo, Long> {
* @param courseIds 主键Id集合。 * @param courseIds 主键Id集合。
* @return 应答结果对象包含true全部存在否则false。 * @return 应答结果对象包含true全部存在否则false。
*/ */
@ApiOperation(hidden = true, value = "existIds")
@PostMapping("/existIds") @PostMapping("/existIds")
public ResponseResult<Boolean> existIds(@RequestParam Set<Long> courseIds) { public ResponseResult<Boolean> existIds(@RequestParam Set<Long> courseIds) {
return super.baseExistIds(courseIds); return super.baseExistIds(courseIds);
@@ -327,6 +348,7 @@ public class CourseController extends BaseController<Course, CourseVo, Long> {
* @param courseId 主键Id。 * @param courseId 主键Id。
* @return 应答结果对象包含true表示存在否则false。 * @return 应答结果对象包含true表示存在否则false。
*/ */
@ApiOperation(hidden = true, value = "existId")
@PostMapping("/existId") @PostMapping("/existId")
public ResponseResult<Boolean> existId(@RequestParam Long courseId) { public ResponseResult<Boolean> existId(@RequestParam Long courseId) {
return super.baseExistId(courseId); return super.baseExistId(courseId);
@@ -338,6 +360,7 @@ public class CourseController extends BaseController<Course, CourseVo, Long> {
* @param filter 过滤对象。 * @param filter 过滤对象。
* @return 删除数量。 * @return 删除数量。
*/ */
@ApiOperation(hidden = true, value = "deleteBy")
@PostMapping("/deleteBy") @PostMapping("/deleteBy")
public ResponseResult<Integer> deleteBy(@RequestBody CourseDto filter) throws Exception { public ResponseResult<Integer> deleteBy(@RequestBody CourseDto filter) throws Exception {
return super.baseDeleteBy(MyModelUtil.copyTo(filter, Course.class)); return super.baseDeleteBy(MyModelUtil.copyTo(filter, Course.class));
@@ -349,6 +372,7 @@ public class CourseController extends BaseController<Course, CourseVo, Long> {
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。 * @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。
*/ */
@ApiOperation(hidden = true, value = "listBy")
@PostMapping("/listBy") @PostMapping("/listBy")
public ResponseResult<MyPageData<CourseVo>> listBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<MyPageData<CourseVo>> listBy(@RequestBody MyQueryParam queryParam) {
return super.baseListBy(queryParam, Course.INSTANCE); return super.baseListBy(queryParam, Course.INSTANCE);
@@ -360,6 +384,7 @@ public class CourseController extends BaseController<Course, CourseVo, Long> {
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。 * @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。
*/ */
@ApiOperation(hidden = true, value = "listMapBy")
@PostMapping("/listMapBy") @PostMapping("/listMapBy")
public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
return super.baseListMapBy(queryParam, Course.INSTANCE); return super.baseListMapBy(queryParam, Course.INSTANCE);
@@ -371,6 +396,7 @@ public class CourseController extends BaseController<Course, CourseVo, Long> {
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。 * @return 应答结果对象,包含符合查询过滤条件的对象结果集。
*/ */
@ApiOperation(hidden = true, value = "getBy")
@PostMapping("/getBy") @PostMapping("/getBy")
public ResponseResult<CourseVo> getBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<CourseVo> getBy(@RequestBody MyQueryParam queryParam) {
return super.baseGetBy(queryParam, Course.INSTANCE); return super.baseGetBy(queryParam, Course.INSTANCE);
@@ -382,6 +408,7 @@ public class CourseController extends BaseController<Course, CourseVo, Long> {
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 应答结果对象,包含结果数量。 * @return 应答结果对象,包含结果数量。
*/ */
@ApiOperation(hidden = true, value = "countBy")
@PostMapping("/countBy") @PostMapping("/countBy")
public ResponseResult<Integer> countBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<Integer> countBy(@RequestBody MyQueryParam queryParam) {
return super.baseCountBy(queryParam); return super.baseCountBy(queryParam);
@@ -393,6 +420,7 @@ public class CourseController extends BaseController<Course, CourseVo, Long> {
* @param aggregationParam 聚合参数。 * @param aggregationParam 聚合参数。
* @return 应该结果对象包含聚合计算后的分组Map列表。 * @return 应该结果对象包含聚合计算后的分组Map列表。
*/ */
@ApiOperation(hidden = true, value = "aggregateBy")
@PostMapping("/aggregateBy") @PostMapping("/aggregateBy")
public ResponseResult<List<Map<String, Object>>> aggregateBy(@RequestBody MyAggregationParam aggregationParam) { public ResponseResult<List<Map<String, Object>>> aggregateBy(@RequestBody MyAggregationParam aggregationParam) {
return super.baseAggregateBy(aggregationParam); return super.baseAggregateBy(aggregationParam);

View File

@@ -1,9 +1,13 @@
package com.orange.demo.courseclassservice.controller; package com.orange.demo.courseclassservice.controller;
import com.alibaba.fastjson.JSONObject;
import cn.jimmyshi.beanquery.BeanQuery; import cn.jimmyshi.beanquery.BeanQuery;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import com.orange.demo.common.core.base.controller.BaseController; import com.orange.demo.common.core.base.controller.BaseController;
import com.orange.demo.common.core.base.service.BaseDictService; import com.orange.demo.common.core.base.service.IBaseDictService;
import com.orange.demo.common.core.constant.ErrorCodeEnum; import com.orange.demo.common.core.constant.ErrorCodeEnum;
import com.orange.demo.common.core.object.*; import com.orange.demo.common.core.object.*;
import com.orange.demo.common.core.util.MyModelUtil; import com.orange.demo.common.core.util.MyModelUtil;
@@ -26,6 +30,7 @@ import java.util.*;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@Api(tags = "年级管理接口")
@Slf4j @Slf4j
@RestController @RestController
@RequestMapping("/grade") @RequestMapping("/grade")
@@ -35,7 +40,7 @@ public class GradeController extends BaseController<Grade, GradeVo, Integer> {
private GradeService gradeService; private GradeService gradeService;
@Override @Override
protected BaseDictService<Grade, Integer> service() { protected IBaseDictService<Grade, Integer> service() {
return gradeService; return gradeService;
} }
@@ -45,6 +50,7 @@ public class GradeController extends BaseController<Grade, GradeVo, Integer> {
* @param gradeDto 新增对象。 * @param gradeDto 新增对象。
* @return 应答结果对象包含新增对象主键Id。 * @return 应答结果对象包含新增对象主键Id。
*/ */
@ApiOperationSupport(ignoreParameters = {"grade.gradeId"})
@PostMapping("/add") @PostMapping("/add")
public ResponseResult<Integer> add(@MyRequestBody("grade") GradeDto gradeDto) { public ResponseResult<Integer> add(@MyRequestBody("grade") GradeDto gradeDto) {
String errorMessage = MyCommonUtil.getModelValidationError(gradeDto); String errorMessage = MyCommonUtil.getModelValidationError(gradeDto);
@@ -116,18 +122,34 @@ public class GradeController extends BaseController<Grade, GradeVo, Integer> {
} }
/** /**
* 以字典形式返回全部年级数据集合。 * 白名单接口,登录用户均可访问。以字典形式返回全部年级数据集合。
* 白名单接口,登录用户均可访问 * 所有数据全部取自于缓存,对于数据库中存在,但是缓存中不存在的数据,不会返回
* *
* @return 应答结果对象,包含字典形式的数据集合。 * @return 应答结果对象,包含字典形式的数据集合。
*/ */
@GetMapping("/listDict") @GetMapping("/listDict")
public ResponseResult<List<Map<String, Object>>> listDict() { public ResponseResult<List<Map<String, Object>>> listDict() {
List<Grade> resultList = gradeService.getAllList(); List<Grade> resultList = gradeService.getAllListFromCache();
return ResponseResult.success(BeanQuery.select( return ResponseResult.success(BeanQuery.select(
"gradeId as id", "gradeName as name").executeFrom(resultList)); "gradeId as id", "gradeName as name").executeFrom(resultList));
} }
/**
* 白名单接口,登录用户均可访问。以字典形式返回全部年级数据集合。
* fullResultList中的字典列表全部取自于数据库而cachedResultList全部取自于缓存前端负责比对。
*
* @return 应答结果对象,包含字典形式的数据集合。
*/
@GetMapping("/listAll")
public ResponseResult<JSONObject> listAll() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("fullResultList", BeanQuery.select(
"gradeId as id", "gradeName as name").executeFrom(gradeService.getAllList()));
jsonObject.put("cachedResultList", BeanQuery.select(
"gradeId as id", "gradeName as name").executeFrom(gradeService.getAllListFromCache()));
return ResponseResult.success(jsonObject);
}
/** /**
* 根据主键Id集合获取数据对象集合。仅限于微服务间远程接口调用。 * 根据主键Id集合获取数据对象集合。仅限于微服务间远程接口调用。
* *
@@ -135,6 +157,7 @@ public class GradeController extends BaseController<Grade, GradeVo, Integer> {
* @param withDict 是否包含字典关联。 * @param withDict 是否包含字典关联。
* @return 应答结果对象,包含主对象集合。 * @return 应答结果对象,包含主对象集合。
*/ */
@ApiOperation(hidden = true, value = "listByIds")
@PostMapping("/listByIds") @PostMapping("/listByIds")
public ResponseResult<List<GradeVo>> listByIds( public ResponseResult<List<GradeVo>> listByIds(
@RequestParam Set<Integer> gradeIds, @RequestParam Boolean withDict) { @RequestParam Set<Integer> gradeIds, @RequestParam Boolean withDict) {
@@ -148,6 +171,7 @@ public class GradeController extends BaseController<Grade, GradeVo, Integer> {
* @param withDict 是否包含字典关联。 * @param withDict 是否包含字典关联。
* @return 应答结果对象,包含主对象数据。 * @return 应答结果对象,包含主对象数据。
*/ */
@ApiOperation(hidden = true, value = "getById")
@PostMapping("/getById") @PostMapping("/getById")
public ResponseResult<GradeVo> getById( public ResponseResult<GradeVo> getById(
@RequestParam Integer gradeId, @RequestParam Boolean withDict) { @RequestParam Integer gradeId, @RequestParam Boolean withDict) {
@@ -160,6 +184,7 @@ public class GradeController extends BaseController<Grade, GradeVo, Integer> {
* @param gradeIds 主键Id集合。 * @param gradeIds 主键Id集合。
* @return 应答结果对象包含true全部存在否则false。 * @return 应答结果对象包含true全部存在否则false。
*/ */
@ApiOperation(hidden = true, value = "existIds")
@PostMapping("/existIds") @PostMapping("/existIds")
public ResponseResult<Boolean> existIds(@RequestParam Set<Integer> gradeIds) { public ResponseResult<Boolean> existIds(@RequestParam Set<Integer> gradeIds) {
return super.baseExistIds(gradeIds); return super.baseExistIds(gradeIds);
@@ -171,6 +196,7 @@ public class GradeController extends BaseController<Grade, GradeVo, Integer> {
* @param gradeId 主键Id。 * @param gradeId 主键Id。
* @return 应答结果对象包含true全部存在否则false。 * @return 应答结果对象包含true全部存在否则false。
*/ */
@ApiOperation(hidden = true, value = "existId")
@PostMapping("/existId") @PostMapping("/existId")
public ResponseResult<Boolean> existId(@RequestParam Integer gradeId) { public ResponseResult<Boolean> existId(@RequestParam Integer gradeId) {
return super.baseExistId(gradeId); return super.baseExistId(gradeId);
@@ -182,6 +208,7 @@ public class GradeController extends BaseController<Grade, GradeVo, Integer> {
* @param filter 过滤对象。 * @param filter 过滤对象。
* @return 删除数量。 * @return 删除数量。
*/ */
@ApiOperation(hidden = true, value = "deleteBy")
@PostMapping("/deleteBy") @PostMapping("/deleteBy")
public ResponseResult<Integer> deleteBy(@RequestBody GradeDto filter) throws Exception { public ResponseResult<Integer> deleteBy(@RequestBody GradeDto filter) throws Exception {
return super.baseDeleteBy(MyModelUtil.copyTo(filter, Grade.class)); return super.baseDeleteBy(MyModelUtil.copyTo(filter, Grade.class));
@@ -193,6 +220,7 @@ public class GradeController extends BaseController<Grade, GradeVo, Integer> {
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。 * @return 应答结果对象,包含符合查询过滤条件的对象结果集。
*/ */
@ApiOperation(hidden = true, value = "listBy")
@PostMapping("/listBy") @PostMapping("/listBy")
public ResponseResult<MyPageData<GradeVo>> listBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<MyPageData<GradeVo>> listBy(@RequestBody MyQueryParam queryParam) {
return super.baseListBy(queryParam, null); return super.baseListBy(queryParam, null);
@@ -204,6 +232,7 @@ public class GradeController extends BaseController<Grade, GradeVo, Integer> {
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。 * @return 应答结果对象,包含符合查询过滤条件的对象结果集。
*/ */
@ApiOperation(hidden = true, value = "getBy")
@PostMapping("/getBy") @PostMapping("/getBy")
public ResponseResult<GradeVo> getBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<GradeVo> getBy(@RequestBody MyQueryParam queryParam) {
return super.baseGetBy(queryParam, null); return super.baseGetBy(queryParam, null);

View File

@@ -10,9 +10,11 @@ import com.orange.demo.common.core.object.*;
import com.orange.demo.common.core.util.*; import com.orange.demo.common.core.util.*;
import com.orange.demo.common.core.constant.*; import com.orange.demo.common.core.constant.*;
import com.orange.demo.common.core.base.controller.BaseController; import com.orange.demo.common.core.base.controller.BaseController;
import com.orange.demo.common.core.base.service.BaseService; import com.orange.demo.common.core.base.service.IBaseService;
import com.orange.demo.common.core.annotation.MyRequestBody; import com.orange.demo.common.core.annotation.MyRequestBody;
import com.orange.demo.common.core.validator.UpdateGroup; import com.orange.demo.common.core.validator.UpdateGroup;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -26,6 +28,7 @@ import java.util.*;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@Api(tags = "校区数据管理接口")
@Slf4j @Slf4j
@RestController @RestController
@RequestMapping("/schoolInfo") @RequestMapping("/schoolInfo")
@@ -35,7 +38,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoV
private SchoolInfoService schoolInfoService; private SchoolInfoService schoolInfoService;
@Override @Override
protected BaseService<SchoolInfo, Long> service() { protected IBaseService<SchoolInfo, Long> service() {
return schoolInfoService; return schoolInfoService;
} }
@@ -45,6 +48,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoV
* @param schoolInfoDto 新增对象。 * @param schoolInfoDto 新增对象。
* @return 应答结果对象包含新增对象主键Id。 * @return 应答结果对象包含新增对象主键Id。
*/ */
@ApiOperationSupport(ignoreParameters = {"schoolInfo.schoolId"})
@PostMapping("/add") @PostMapping("/add")
public ResponseResult<Long> add(@MyRequestBody("schoolInfo") SchoolInfoDto schoolInfoDto) { public ResponseResult<Long> add(@MyRequestBody("schoolInfo") SchoolInfoDto schoolInfoDto) {
String errorMessage = MyCommonUtil.getModelValidationError(schoolInfoDto); String errorMessage = MyCommonUtil.getModelValidationError(schoolInfoDto);
@@ -171,7 +175,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoV
*/ */
@GetMapping("/listDict") @GetMapping("/listDict")
public ResponseResult<List<Map<String, Object>>> listDict(SchoolInfo filter) { public ResponseResult<List<Map<String, Object>>> listDict(SchoolInfo filter) {
List<SchoolInfo> resultList = schoolInfoService.getListByFilter(filter, null); List<SchoolInfo> resultList = schoolInfoService.getListByFilter(filter);
return ResponseResult.success( return ResponseResult.success(
BeanQuery.select("schoolId as id", "schoolName as name").executeFrom(resultList)); BeanQuery.select("schoolId as id", "schoolName as name").executeFrom(resultList));
} }
@@ -183,6 +187,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoV
* @param withDict 是否包含字典关联。 * @param withDict 是否包含字典关联。
* @return 应答结果对象,包含主对象集合。 * @return 应答结果对象,包含主对象集合。
*/ */
@ApiOperation(hidden = true, value = "listByIds")
@PostMapping("/listByIds") @PostMapping("/listByIds")
public ResponseResult<List<SchoolInfoVo>> listByIds( public ResponseResult<List<SchoolInfoVo>> listByIds(
@RequestParam Set<Long> schoolIds, @RequestParam Boolean withDict) { @RequestParam Set<Long> schoolIds, @RequestParam Boolean withDict) {
@@ -196,6 +201,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoV
* @param withDict 是否包含字典关联。 * @param withDict 是否包含字典关联。
* @return 应答结果对象,包含主对象数据。 * @return 应答结果对象,包含主对象数据。
*/ */
@ApiOperation(hidden = true, value = "getById")
@PostMapping("/getById") @PostMapping("/getById")
public ResponseResult<SchoolInfoVo> getById( public ResponseResult<SchoolInfoVo> getById(
@RequestParam Long schoolId, @RequestParam Boolean withDict) { @RequestParam Long schoolId, @RequestParam Boolean withDict) {
@@ -208,6 +214,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoV
* @param schoolIds 主键Id集合。 * @param schoolIds 主键Id集合。
* @return 应答结果对象包含true全部存在否则false。 * @return 应答结果对象包含true全部存在否则false。
*/ */
@ApiOperation(hidden = true, value = "existIds")
@PostMapping("/existIds") @PostMapping("/existIds")
public ResponseResult<Boolean> existIds(@RequestParam Set<Long> schoolIds) { public ResponseResult<Boolean> existIds(@RequestParam Set<Long> schoolIds) {
return super.baseExistIds(schoolIds); return super.baseExistIds(schoolIds);
@@ -219,6 +226,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoV
* @param schoolId 主键Id。 * @param schoolId 主键Id。
* @return 应答结果对象包含true表示存在否则false。 * @return 应答结果对象包含true表示存在否则false。
*/ */
@ApiOperation(hidden = true, value = "existId")
@PostMapping("/existId") @PostMapping("/existId")
public ResponseResult<Boolean> existId(@RequestParam Long schoolId) { public ResponseResult<Boolean> existId(@RequestParam Long schoolId) {
return super.baseExistId(schoolId); return super.baseExistId(schoolId);
@@ -230,6 +238,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoV
* @param filter 过滤对象。 * @param filter 过滤对象。
* @return 删除数量。 * @return 删除数量。
*/ */
@ApiOperation(hidden = true, value = "deleteBy")
@PostMapping("/deleteBy") @PostMapping("/deleteBy")
public ResponseResult<Integer> deleteBy(@RequestBody SchoolInfoDto filter) throws Exception { public ResponseResult<Integer> deleteBy(@RequestBody SchoolInfoDto filter) throws Exception {
return super.baseDeleteBy(MyModelUtil.copyTo(filter, SchoolInfo.class)); return super.baseDeleteBy(MyModelUtil.copyTo(filter, SchoolInfo.class));
@@ -241,6 +250,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoV
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。 * @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。
*/ */
@ApiOperation(hidden = true, value = "listBy")
@PostMapping("/listBy") @PostMapping("/listBy")
public ResponseResult<MyPageData<SchoolInfoVo>> listBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<MyPageData<SchoolInfoVo>> listBy(@RequestBody MyQueryParam queryParam) {
return super.baseListBy(queryParam, SchoolInfo.INSTANCE); return super.baseListBy(queryParam, SchoolInfo.INSTANCE);
@@ -252,6 +262,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoV
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。 * @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。
*/ */
@ApiOperation(hidden = true, value = "listMapBy")
@PostMapping("/listMapBy") @PostMapping("/listMapBy")
public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
return super.baseListMapBy(queryParam, SchoolInfo.INSTANCE); return super.baseListMapBy(queryParam, SchoolInfo.INSTANCE);
@@ -263,6 +274,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoV
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。 * @return 应答结果对象,包含符合查询过滤条件的对象结果集。
*/ */
@ApiOperation(hidden = true, value = "getBy")
@PostMapping("/getBy") @PostMapping("/getBy")
public ResponseResult<SchoolInfoVo> getBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<SchoolInfoVo> getBy(@RequestBody MyQueryParam queryParam) {
return super.baseGetBy(queryParam, SchoolInfo.INSTANCE); return super.baseGetBy(queryParam, SchoolInfo.INSTANCE);
@@ -274,6 +286,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoV
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 应答结果对象,包含结果数量。 * @return 应答结果对象,包含结果数量。
*/ */
@ApiOperation(hidden = true, value = "countBy")
@PostMapping("/countBy") @PostMapping("/countBy")
public ResponseResult<Integer> countBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<Integer> countBy(@RequestBody MyQueryParam queryParam) {
return super.baseCountBy(queryParam); return super.baseCountBy(queryParam);
@@ -285,6 +298,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoV
* @param aggregationParam 聚合参数。 * @param aggregationParam 聚合参数。
* @return 应该结果对象包含聚合计算后的分组Map列表。 * @return 应该结果对象包含聚合计算后的分组Map列表。
*/ */
@ApiOperation(hidden = true, value = "aggregateBy")
@PostMapping("/aggregateBy") @PostMapping("/aggregateBy")
public ResponseResult<List<Map<String, Object>>> aggregateBy(@RequestBody MyAggregationParam aggregationParam) { public ResponseResult<List<Map<String, Object>>> aggregateBy(@RequestBody MyAggregationParam aggregationParam) {
return super.baseAggregateBy(aggregationParam); return super.baseAggregateBy(aggregationParam);

View File

@@ -9,9 +9,11 @@ import com.orange.demo.common.core.object.*;
import com.orange.demo.common.core.util.*; import com.orange.demo.common.core.util.*;
import com.orange.demo.common.core.constant.*; import com.orange.demo.common.core.constant.*;
import com.orange.demo.common.core.base.controller.BaseController; import com.orange.demo.common.core.base.controller.BaseController;
import com.orange.demo.common.core.base.service.BaseService; import com.orange.demo.common.core.base.service.IBaseService;
import com.orange.demo.common.core.annotation.MyRequestBody; import com.orange.demo.common.core.annotation.MyRequestBody;
import com.orange.demo.common.core.validator.UpdateGroup; import com.orange.demo.common.core.validator.UpdateGroup;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -26,6 +28,7 @@ import java.util.stream.Collectors;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@Api(tags = "班级数据管理接口")
@Slf4j @Slf4j
@RestController @RestController
@RequestMapping("/studentClass") @RequestMapping("/studentClass")
@@ -39,7 +42,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
private StudentService studentService; private StudentService studentService;
@Override @Override
protected BaseService<StudentClass, Long> service() { protected IBaseService<StudentClass, Long> service() {
return studentClassService; return studentClassService;
} }
@@ -49,6 +52,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
* @param studentClassDto 新增对象。 * @param studentClassDto 新增对象。
* @return 应答结果对象包含新增对象主键Id。 * @return 应答结果对象包含新增对象主键Id。
*/ */
@ApiOperationSupport(ignoreParameters = {"studentClass.classId"})
@PostMapping("/add") @PostMapping("/add")
public ResponseResult<Long> add(@MyRequestBody("studentClass") StudentClassDto studentClassDto) { public ResponseResult<Long> add(@MyRequestBody("studentClass") StudentClassDto studentClassDto) {
String errorMessage = MyCommonUtil.getModelValidationError(studentClassDto); String errorMessage = MyCommonUtil.getModelValidationError(studentClassDto);
@@ -182,11 +186,9 @@ public class StudentClassController extends BaseController<StudentClass, Student
@MyRequestBody("courseFilter") CourseDto courseDtoFilter, @MyRequestBody("courseFilter") CourseDto courseDtoFilter,
@MyRequestBody MyOrderParam orderParam, @MyRequestBody MyOrderParam orderParam,
@MyRequestBody MyPageParam pageParam) { @MyRequestBody MyPageParam pageParam) {
if (MyCommonUtil.existBlankArgument(classId)) { ResponseResult<Void> verifyResult = this.doClassCourseVerify(classId);
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST); if (!verifyResult.isSuccess()) {
} return ResponseResult.errorFrom(verifyResult);
if (!studentClassService.existId(classId)) {
return ResponseResult.error(ErrorCodeEnum.INVALID_RELATED_RECORD_ID);
} }
if (pageParam != null) { if (pageParam != null) {
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize()); PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
@@ -213,11 +215,9 @@ public class StudentClassController extends BaseController<StudentClass, Student
@MyRequestBody("courseFilter") CourseDto courseDtoFilter, @MyRequestBody("courseFilter") CourseDto courseDtoFilter,
@MyRequestBody MyOrderParam orderParam, @MyRequestBody MyOrderParam orderParam,
@MyRequestBody MyPageParam pageParam) { @MyRequestBody MyPageParam pageParam) {
if (MyCommonUtil.existBlankArgument(classId)) { ResponseResult<Void> verifyResult = this.doClassCourseVerify(classId);
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST); if (!verifyResult.isSuccess()) {
} return ResponseResult.errorFrom(verifyResult);
if (!studentClassService.existId(classId)) {
return ResponseResult.error(ErrorCodeEnum.INVALID_RELATED_RECORD_ID);
} }
if (pageParam != null) { if (pageParam != null) {
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize()); PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
@@ -229,6 +229,16 @@ public class StudentClassController extends BaseController<StudentClass, Student
return ResponseResult.success(MyPageUtil.makeResponseData(courseList, Course.INSTANCE)); return ResponseResult.success(MyPageUtil.makeResponseData(courseList, Course.INSTANCE));
} }
private ResponseResult<Void> doClassCourseVerify(Long classId) {
if (MyCommonUtil.existBlankArgument(classId)) {
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
}
if (!studentClassService.existId(classId)) {
return ResponseResult.error(ErrorCodeEnum.INVALID_RELATED_RECORD_ID);
}
return ResponseResult.success();
}
/** /**
* 批量添加班级数据和 [课程数据] 对象的多对多关联关系数据。 * 批量添加班级数据和 [课程数据] 对象的多对多关联关系数据。
* *
@@ -337,11 +347,9 @@ public class StudentClassController extends BaseController<StudentClass, Student
@MyRequestBody("studentFilter") StudentDto studentDtoFilter, @MyRequestBody("studentFilter") StudentDto studentDtoFilter,
@MyRequestBody MyOrderParam orderParam, @MyRequestBody MyOrderParam orderParam,
@MyRequestBody MyPageParam pageParam) { @MyRequestBody MyPageParam pageParam) {
if (MyCommonUtil.existBlankArgument(classId)) { ResponseResult<Void> verifyResult = this.doClassStudentVerify(classId);
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST); if (!verifyResult.isSuccess()) {
} return ResponseResult.errorFrom(verifyResult);
if (!studentClassService.existId(classId)) {
return ResponseResult.error(ErrorCodeEnum.INVALID_RELATED_RECORD_ID);
} }
if (pageParam != null) { if (pageParam != null) {
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize()); PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
@@ -368,11 +376,9 @@ public class StudentClassController extends BaseController<StudentClass, Student
@MyRequestBody("studentFilter") StudentDto studentDtoFilter, @MyRequestBody("studentFilter") StudentDto studentDtoFilter,
@MyRequestBody MyOrderParam orderParam, @MyRequestBody MyOrderParam orderParam,
@MyRequestBody MyPageParam pageParam) { @MyRequestBody MyPageParam pageParam) {
if (MyCommonUtil.existBlankArgument(classId)) { ResponseResult<Void> verifyResult = this.doClassStudentVerify(classId);
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST); if (!verifyResult.isSuccess()) {
} return ResponseResult.errorFrom(verifyResult);
if (!studentClassService.existId(classId)) {
return ResponseResult.error(ErrorCodeEnum.INVALID_RELATED_RECORD_ID);
} }
if (pageParam != null) { if (pageParam != null) {
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize()); PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
@@ -384,6 +390,16 @@ public class StudentClassController extends BaseController<StudentClass, Student
return ResponseResult.success(MyPageUtil.makeResponseData(studentList, Student.INSTANCE)); return ResponseResult.success(MyPageUtil.makeResponseData(studentList, Student.INSTANCE));
} }
private ResponseResult<Void> doClassStudentVerify(Long classId) {
if (MyCommonUtil.existBlankArgument(classId)) {
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
}
if (!studentClassService.existId(classId)) {
return ResponseResult.error(ErrorCodeEnum.INVALID_RELATED_RECORD_ID);
}
return ResponseResult.success();
}
/** /**
* 批量添加班级数据和 [学生数据] 对象的多对多关联关系数据。 * 批量添加班级数据和 [学生数据] 对象的多对多关联关系数据。
* *
@@ -442,6 +458,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
* @param withDict 是否包含字典关联。 * @param withDict 是否包含字典关联。
* @return 应答结果对象,包含主对象集合。 * @return 应答结果对象,包含主对象集合。
*/ */
@ApiOperation(hidden = true, value = "listByIds")
@PostMapping("/listByIds") @PostMapping("/listByIds")
public ResponseResult<List<StudentClassVo>> listByIds( public ResponseResult<List<StudentClassVo>> listByIds(
@RequestParam Set<Long> classIds, @RequestParam Boolean withDict) { @RequestParam Set<Long> classIds, @RequestParam Boolean withDict) {
@@ -455,6 +472,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
* @param withDict 是否包含字典关联。 * @param withDict 是否包含字典关联。
* @return 应答结果对象,包含主对象数据。 * @return 应答结果对象,包含主对象数据。
*/ */
@ApiOperation(hidden = true, value = "getById")
@PostMapping("/getById") @PostMapping("/getById")
public ResponseResult<StudentClassVo> getById( public ResponseResult<StudentClassVo> getById(
@RequestParam Long classId, @RequestParam Boolean withDict) { @RequestParam Long classId, @RequestParam Boolean withDict) {
@@ -467,6 +485,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
* @param classIds 主键Id集合。 * @param classIds 主键Id集合。
* @return 应答结果对象包含true全部存在否则false。 * @return 应答结果对象包含true全部存在否则false。
*/ */
@ApiOperation(hidden = true, value = "existIds")
@PostMapping("/existIds") @PostMapping("/existIds")
public ResponseResult<Boolean> existIds(@RequestParam Set<Long> classIds) { public ResponseResult<Boolean> existIds(@RequestParam Set<Long> classIds) {
return super.baseExistIds(classIds); return super.baseExistIds(classIds);
@@ -478,6 +497,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
* @param classId 主键Id。 * @param classId 主键Id。
* @return 应答结果对象包含true表示存在否则false。 * @return 应答结果对象包含true表示存在否则false。
*/ */
@ApiOperation(hidden = true, value = "existId")
@PostMapping("/existId") @PostMapping("/existId")
public ResponseResult<Boolean> existId(@RequestParam Long classId) { public ResponseResult<Boolean> existId(@RequestParam Long classId) {
return super.baseExistId(classId); return super.baseExistId(classId);
@@ -489,6 +509,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
* @param filter 过滤对象。 * @param filter 过滤对象。
* @return 删除数量。 * @return 删除数量。
*/ */
@ApiOperation(hidden = true, value = "deleteBy")
@PostMapping("/deleteBy") @PostMapping("/deleteBy")
public ResponseResult<Integer> deleteBy(@RequestBody StudentClassDto filter) throws Exception { public ResponseResult<Integer> deleteBy(@RequestBody StudentClassDto filter) throws Exception {
return super.baseDeleteBy(MyModelUtil.copyTo(filter, StudentClass.class)); return super.baseDeleteBy(MyModelUtil.copyTo(filter, StudentClass.class));
@@ -500,6 +521,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。 * @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。
*/ */
@ApiOperation(hidden = true, value = "listBy")
@PostMapping("/listBy") @PostMapping("/listBy")
public ResponseResult<MyPageData<StudentClassVo>> listBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<MyPageData<StudentClassVo>> listBy(@RequestBody MyQueryParam queryParam) {
return super.baseListBy(queryParam, StudentClass.INSTANCE); return super.baseListBy(queryParam, StudentClass.INSTANCE);
@@ -511,6 +533,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。 * @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。
*/ */
@ApiOperation(hidden = true, value = "listMapBy")
@PostMapping("/listMapBy") @PostMapping("/listMapBy")
public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
return super.baseListMapBy(queryParam, StudentClass.INSTANCE); return super.baseListMapBy(queryParam, StudentClass.INSTANCE);
@@ -522,6 +545,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。 * @return 应答结果对象,包含符合查询过滤条件的对象结果集。
*/ */
@ApiOperation(hidden = true, value = "getBy")
@PostMapping("/getBy") @PostMapping("/getBy")
public ResponseResult<StudentClassVo> getBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<StudentClassVo> getBy(@RequestBody MyQueryParam queryParam) {
return super.baseGetBy(queryParam, StudentClass.INSTANCE); return super.baseGetBy(queryParam, StudentClass.INSTANCE);
@@ -533,6 +557,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 应答结果对象,包含结果数量。 * @return 应答结果对象,包含结果数量。
*/ */
@ApiOperation(hidden = true, value = "countBy")
@PostMapping("/countBy") @PostMapping("/countBy")
public ResponseResult<Integer> countBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<Integer> countBy(@RequestBody MyQueryParam queryParam) {
return super.baseCountBy(queryParam); return super.baseCountBy(queryParam);
@@ -544,6 +569,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
* @param aggregationParam 聚合参数。 * @param aggregationParam 聚合参数。
* @return 应该结果对象包含聚合计算后的分组Map列表。 * @return 应该结果对象包含聚合计算后的分组Map列表。
*/ */
@ApiOperation(hidden = true, value = "aggregateBy")
@PostMapping("/aggregateBy") @PostMapping("/aggregateBy")
public ResponseResult<List<Map<String, Object>>> aggregateBy(@RequestBody MyAggregationParam aggregationParam) { public ResponseResult<List<Map<String, Object>>> aggregateBy(@RequestBody MyAggregationParam aggregationParam) {
return super.baseAggregateBy(aggregationParam); return super.baseAggregateBy(aggregationParam);

View File

@@ -10,9 +10,11 @@ import com.orange.demo.common.core.object.*;
import com.orange.demo.common.core.util.*; import com.orange.demo.common.core.util.*;
import com.orange.demo.common.core.constant.*; import com.orange.demo.common.core.constant.*;
import com.orange.demo.common.core.base.controller.BaseController; import com.orange.demo.common.core.base.controller.BaseController;
import com.orange.demo.common.core.base.service.BaseService; import com.orange.demo.common.core.base.service.IBaseService;
import com.orange.demo.common.core.annotation.MyRequestBody; import com.orange.demo.common.core.annotation.MyRequestBody;
import com.orange.demo.common.core.validator.UpdateGroup; import com.orange.demo.common.core.validator.UpdateGroup;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -26,6 +28,7 @@ import java.util.*;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@Api(tags = "学生数据管理接口")
@Slf4j @Slf4j
@RestController @RestController
@RequestMapping("/student") @RequestMapping("/student")
@@ -35,7 +38,7 @@ public class StudentController extends BaseController<Student, StudentVo, Long>
private StudentService studentService; private StudentService studentService;
@Override @Override
protected BaseService<Student, Long> service() { protected IBaseService<Student, Long> service() {
return studentService; return studentService;
} }
@@ -45,6 +48,13 @@ public class StudentController extends BaseController<Student, StudentVo, Long>
* @param studentDto 新增对象。 * @param studentDto 新增对象。
* @return 应答结果对象包含新增对象主键Id。 * @return 应答结果对象包含新增对象主键Id。
*/ */
@ApiOperationSupport(ignoreParameters = {
"student.studentId",
"student.searchString",
"student.birthdayStart",
"student.birthdayEnd",
"student.registerTimeStart",
"student.registerTimeEnd"})
@PostMapping("/add") @PostMapping("/add")
public ResponseResult<Long> add(@MyRequestBody("student") StudentDto studentDto) { public ResponseResult<Long> add(@MyRequestBody("student") StudentDto studentDto) {
String errorMessage = MyCommonUtil.getModelValidationError(studentDto); String errorMessage = MyCommonUtil.getModelValidationError(studentDto);
@@ -68,6 +78,12 @@ public class StudentController extends BaseController<Student, StudentVo, Long>
* @param studentDto 更新对象。 * @param studentDto 更新对象。
* @return 应答结果对象。 * @return 应答结果对象。
*/ */
@ApiOperationSupport(ignoreParameters = {
"student.searchString",
"student.birthdayStart",
"student.birthdayEnd",
"student.registerTimeStart",
"student.registerTimeEnd"})
@PostMapping("/update") @PostMapping("/update")
public ResponseResult<Void> update(@MyRequestBody("student") StudentDto studentDto) { public ResponseResult<Void> update(@MyRequestBody("student") StudentDto studentDto) {
String errorMessage = MyCommonUtil.getModelValidationError(studentDto, Default.class, UpdateGroup.class); String errorMessage = MyCommonUtil.getModelValidationError(studentDto, Default.class, UpdateGroup.class);
@@ -171,7 +187,7 @@ public class StudentController extends BaseController<Student, StudentVo, Long>
*/ */
@GetMapping("/listDict") @GetMapping("/listDict")
public ResponseResult<List<Map<String, Object>>> listDict(Student filter) { public ResponseResult<List<Map<String, Object>>> listDict(Student filter) {
List<Student> resultList = studentService.getListByFilter(filter, null); List<Student> resultList = studentService.getListByFilter(filter);
return ResponseResult.success( return ResponseResult.success(
BeanQuery.select("studentId as id", "studentName as name").executeFrom(resultList)); BeanQuery.select("studentId as id", "studentName as name").executeFrom(resultList));
} }
@@ -183,6 +199,7 @@ public class StudentController extends BaseController<Student, StudentVo, Long>
* @param withDict 是否包含字典关联。 * @param withDict 是否包含字典关联。
* @return 应答结果对象,包含主对象集合。 * @return 应答结果对象,包含主对象集合。
*/ */
@ApiOperation(hidden = true, value = "listByIds")
@PostMapping("/listByIds") @PostMapping("/listByIds")
public ResponseResult<List<StudentVo>> listByIds( public ResponseResult<List<StudentVo>> listByIds(
@RequestParam Set<Long> studentIds, @RequestParam Boolean withDict) { @RequestParam Set<Long> studentIds, @RequestParam Boolean withDict) {
@@ -196,6 +213,7 @@ public class StudentController extends BaseController<Student, StudentVo, Long>
* @param withDict 是否包含字典关联。 * @param withDict 是否包含字典关联。
* @return 应答结果对象,包含主对象数据。 * @return 应答结果对象,包含主对象数据。
*/ */
@ApiOperation(hidden = true, value = "getById")
@PostMapping("/getById") @PostMapping("/getById")
public ResponseResult<StudentVo> getById( public ResponseResult<StudentVo> getById(
@RequestParam Long studentId, @RequestParam Boolean withDict) { @RequestParam Long studentId, @RequestParam Boolean withDict) {
@@ -208,6 +226,7 @@ public class StudentController extends BaseController<Student, StudentVo, Long>
* @param studentIds 主键Id集合。 * @param studentIds 主键Id集合。
* @return 应答结果对象包含true全部存在否则false。 * @return 应答结果对象包含true全部存在否则false。
*/ */
@ApiOperation(hidden = true, value = "existIds")
@PostMapping("/existIds") @PostMapping("/existIds")
public ResponseResult<Boolean> existIds(@RequestParam Set<Long> studentIds) { public ResponseResult<Boolean> existIds(@RequestParam Set<Long> studentIds) {
return super.baseExistIds(studentIds); return super.baseExistIds(studentIds);
@@ -219,6 +238,7 @@ public class StudentController extends BaseController<Student, StudentVo, Long>
* @param studentId 主键Id。 * @param studentId 主键Id。
* @return 应答结果对象包含true表示存在否则false。 * @return 应答结果对象包含true表示存在否则false。
*/ */
@ApiOperation(hidden = true, value = "existId")
@PostMapping("/existId") @PostMapping("/existId")
public ResponseResult<Boolean> existId(@RequestParam Long studentId) { public ResponseResult<Boolean> existId(@RequestParam Long studentId) {
return super.baseExistId(studentId); return super.baseExistId(studentId);
@@ -230,6 +250,7 @@ public class StudentController extends BaseController<Student, StudentVo, Long>
* @param filter 过滤对象。 * @param filter 过滤对象。
* @return 删除数量。 * @return 删除数量。
*/ */
@ApiOperation(hidden = true, value = "deleteBy")
@PostMapping("/deleteBy") @PostMapping("/deleteBy")
public ResponseResult<Integer> deleteBy(@RequestBody StudentDto filter) throws Exception { public ResponseResult<Integer> deleteBy(@RequestBody StudentDto filter) throws Exception {
return super.baseDeleteBy(MyModelUtil.copyTo(filter, Student.class)); return super.baseDeleteBy(MyModelUtil.copyTo(filter, Student.class));
@@ -241,6 +262,7 @@ public class StudentController extends BaseController<Student, StudentVo, Long>
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。 * @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。
*/ */
@ApiOperation(hidden = true, value = "listBy")
@PostMapping("/listBy") @PostMapping("/listBy")
public ResponseResult<MyPageData<StudentVo>> listBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<MyPageData<StudentVo>> listBy(@RequestBody MyQueryParam queryParam) {
return super.baseListBy(queryParam, Student.INSTANCE); return super.baseListBy(queryParam, Student.INSTANCE);
@@ -252,6 +274,7 @@ public class StudentController extends BaseController<Student, StudentVo, Long>
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。 * @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。
*/ */
@ApiOperation(hidden = true, value = "listMapBy")
@PostMapping("/listMapBy") @PostMapping("/listMapBy")
public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
return super.baseListMapBy(queryParam, Student.INSTANCE); return super.baseListMapBy(queryParam, Student.INSTANCE);
@@ -263,6 +286,7 @@ public class StudentController extends BaseController<Student, StudentVo, Long>
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。 * @return 应答结果对象,包含符合查询过滤条件的对象结果集。
*/ */
@ApiOperation(hidden = true, value = "getBy")
@PostMapping("/getBy") @PostMapping("/getBy")
public ResponseResult<StudentVo> getBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<StudentVo> getBy(@RequestBody MyQueryParam queryParam) {
return super.baseGetBy(queryParam, Student.INSTANCE); return super.baseGetBy(queryParam, Student.INSTANCE);
@@ -274,6 +298,7 @@ public class StudentController extends BaseController<Student, StudentVo, Long>
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 应答结果对象,包含结果数量。 * @return 应答结果对象,包含结果数量。
*/ */
@ApiOperation(hidden = true, value = "countBy")
@PostMapping("/countBy") @PostMapping("/countBy")
public ResponseResult<Integer> countBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<Integer> countBy(@RequestBody MyQueryParam queryParam) {
return super.baseCountBy(queryParam); return super.baseCountBy(queryParam);
@@ -285,6 +310,7 @@ public class StudentController extends BaseController<Student, StudentVo, Long>
* @param aggregationParam 聚合参数。 * @param aggregationParam 聚合参数。
* @return 应该结果对象包含聚合计算后的分组Map列表。 * @return 应该结果对象包含聚合计算后的分组Map列表。
*/ */
@ApiOperation(hidden = true, value = "aggregateBy")
@PostMapping("/aggregateBy") @PostMapping("/aggregateBy")
public ResponseResult<List<Map<String, Object>>> aggregateBy(@RequestBody MyAggregationParam aggregationParam) { public ResponseResult<List<Map<String, Object>>> aggregateBy(@RequestBody MyAggregationParam aggregationParam) {
return super.baseAggregateBy(aggregationParam); return super.baseAggregateBy(aggregationParam);

View File

@@ -38,4 +38,4 @@ public class AreaCode {
*/ */
@Column(name = "parent_id") @Column(name = "parent_id")
private Long parentId; private Long parentId;
} }

View File

@@ -2,7 +2,6 @@ package com.orange.demo.courseclassservice.model;
import lombok.Data; import lombok.Data;
import javax.persistence.*; import javax.persistence.*;
import javax.validation.constraints.*;
/** /**
* ClassCourse实体对象。 * ClassCourse实体对象。
@@ -17,7 +16,6 @@ public class ClassCourse {
/** /**
* 班级Id。 * 班级Id。
*/ */
@NotNull(message = "数据验证失败班级Id不能为空")
@Id @Id
@Column(name = "class_id") @Column(name = "class_id")
private Long classId; private Long classId;
@@ -25,7 +23,6 @@ public class ClassCourse {
/** /**
* 课程Id。 * 课程Id。
*/ */
@NotNull(message = "数据验证失败课程Id不能为空")
@Id @Id
@Column(name = "course_id") @Column(name = "course_id")
private Long courseId; private Long courseId;
@@ -33,7 +30,6 @@ public class ClassCourse {
/** /**
* 课程顺序(数值越小越靠前)。 * 课程顺序(数值越小越靠前)。
*/ */
@NotNull(message = "数据验证失败,课程顺序(数值越小越靠前)不能为空!")
@Column(name = "course_order") @Column(name = "course_order")
private Integer courseOrder; private Integer courseOrder;
} }

View File

@@ -2,7 +2,6 @@ package com.orange.demo.courseclassservice.model;
import lombok.Data; import lombok.Data;
import javax.persistence.*; import javax.persistence.*;
import javax.validation.constraints.*;
/** /**
* ClassStudent实体对象。 * ClassStudent实体对象。
@@ -17,7 +16,6 @@ public class ClassStudent {
/** /**
* 班级Id。 * 班级Id。
*/ */
@NotNull(message = "数据验证失败班级Id不能为空")
@Id @Id
@Column(name = "class_id") @Column(name = "class_id")
private Long classId; private Long classId;
@@ -25,7 +23,6 @@ public class ClassStudent {
/** /**
* 学生Id。 * 学生Id。
*/ */
@NotNull(message = "数据验证失败学生Id不能为空")
@Id @Id
@Column(name = "student_id") @Column(name = "student_id")
private Long studentId; private Long studentId;

View File

@@ -7,13 +7,11 @@ import com.orange.demo.common.core.annotation.UploadFlagColumn;
import com.orange.demo.common.core.annotation.RelationDict; import com.orange.demo.common.core.annotation.RelationDict;
import com.orange.demo.common.core.annotation.RelationConstDict; import com.orange.demo.common.core.annotation.RelationConstDict;
import com.orange.demo.common.core.base.mapper.BaseModelMapper; import com.orange.demo.common.core.base.mapper.BaseModelMapper;
import com.orange.demo.common.core.validator.ConstDictRef;
import com.orange.demo.courseclassinterface.vo.CourseVo; import com.orange.demo.courseclassinterface.vo.CourseVo;
import lombok.Data; import lombok.Data;
import org.mapstruct.*; import org.mapstruct.*;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
import javax.persistence.*; import javax.persistence.*;
import javax.validation.constraints.*;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@@ -32,7 +30,6 @@ public class Course {
/** /**
* 主键Id。 * 主键Id。
*/ */
@NotNull(message = "数据验证失败主键Id不能为空")
@Id @Id
@Column(name = "course_id") @Column(name = "course_id")
private Long courseId; private Long courseId;
@@ -40,14 +37,12 @@ public class Course {
/** /**
* 课程名称。 * 课程名称。
*/ */
@NotBlank(message = "数据验证失败,课程名称不能为空!")
@Column(name = "course_name") @Column(name = "course_name")
private String courseName; private String courseName;
/** /**
* 课程价格。 * 课程价格。
*/ */
@NotNull(message = "数据验证失败,课程价格不能为空!")
private BigDecimal price; private BigDecimal price;
/** /**
@@ -58,29 +53,23 @@ public class Course {
/** /**
* 课程难度(0: 容易 1: 普通 2: 很难)。 * 课程难度(0: 容易 1: 普通 2: 很难)。
*/ */
@NotNull(message = "数据验证失败,课程难度不能为空!")
@ConstDictRef(constDictClass = CourseDifficult.class, message = "数据验证失败,课程难度为无效值!")
private Integer difficulty; private Integer difficulty;
/** /**
* 年级Id。 * 年级Id。
*/ */
@NotNull(message = "数据验证失败,所属年级不能为空!")
@Column(name = "grade_id") @Column(name = "grade_id")
private Integer gradeId; private Integer gradeId;
/** /**
* 学科Id。 * 学科Id。
*/ */
@NotNull(message = "数据验证失败,所属学科不能为空!")
@ConstDictRef(constDictClass = Subject.class, message = "数据验证失败,所属学科为无效值!")
@Column(name = "subject_id") @Column(name = "subject_id")
private Integer subjectId; private Integer subjectId;
/** /**
* 课时数量。 * 课时数量。
*/ */
@NotNull(message = "数据验证失败,课时数量不能为空!")
@Column(name = "class_hour") @Column(name = "class_hour")
private Integer classHour; private Integer classHour;
@@ -88,7 +77,6 @@ public class Course {
* 多张课程图片地址。 * 多张课程图片地址。
*/ */
@UploadFlagColumn(storeType = UploadStoreTypeEnum.LOCAL_SYSTEM) @UploadFlagColumn(storeType = UploadStoreTypeEnum.LOCAL_SYSTEM)
@NotBlank(message = "数据验证失败,课程图片不能为空!")
@Column(name = "picture_url") @Column(name = "picture_url")
private String pictureUrl; private String pictureUrl;

View File

@@ -4,7 +4,6 @@ import com.alibaba.fastjson.annotation.JSONField;
import com.orange.demo.common.core.annotation.DeletedFlagColumn; import com.orange.demo.common.core.annotation.DeletedFlagColumn;
import lombok.Data; import lombok.Data;
import javax.persistence.*; import javax.persistence.*;
import javax.validation.constraints.*;
/** /**
* Grade实体对象。 * Grade实体对象。
@@ -19,7 +18,6 @@ public class Grade {
/** /**
* 主键Id。 * 主键Id。
*/ */
@NotNull(message = "数据验证失败主键Id不能为空")
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "grade_id") @Column(name = "grade_id")
@@ -28,7 +26,6 @@ public class Grade {
/** /**
* 年级名称。 * 年级名称。
*/ */
@NotBlank(message = "数据验证失败,年级名称不能为空!")
@Column(name = "grade_name") @Column(name = "grade_name")
private String gradeName; private String gradeName;

View File

@@ -2,7 +2,6 @@ package com.orange.demo.courseclassservice.model;
import lombok.Data; import lombok.Data;
import javax.persistence.*; import javax.persistence.*;
import javax.validation.constraints.*;
/** /**
* MaterialEdition实体对象。 * MaterialEdition实体对象。
@@ -17,7 +16,6 @@ public class MaterialEdition {
/** /**
* 主键Id。 * 主键Id。
*/ */
@NotNull(message = "数据验证失败主键Id不能为空")
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "edition_id") @Column(name = "edition_id")
@@ -26,13 +24,11 @@ public class MaterialEdition {
/** /**
* 教材版本名称。 * 教材版本名称。
*/ */
@NotBlank(message = "数据验证失败,教材版本名称不能为空!")
@Column(name = "edition_name") @Column(name = "edition_name")
private String editionName; private String editionName;
/** /**
* 是否正在使用0不是1 * 是否正在使用0不是1
*/ */
@NotNull(message = "数据验证失败是否正在使用0不是1不能为空")
private Integer status; private Integer status;
} }

View File

@@ -7,7 +7,6 @@ import lombok.Data;
import org.mapstruct.*; import org.mapstruct.*;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
import javax.persistence.*; import javax.persistence.*;
import javax.validation.constraints.*;
import java.util.Map; import java.util.Map;
@@ -24,7 +23,6 @@ public class SchoolInfo {
/** /**
* 学校Id。 * 学校Id。
*/ */
@NotNull(message = "数据验证失败学校Id不能为空")
@Id @Id
@Column(name = "school_id") @Column(name = "school_id")
private Long schoolId; private Long schoolId;
@@ -32,21 +30,18 @@ public class SchoolInfo {
/** /**
* 学校名称。 * 学校名称。
*/ */
@NotBlank(message = "数据验证失败,学校名称不能为空!")
@Column(name = "school_name") @Column(name = "school_name")
private String schoolName; private String schoolName;
/** /**
* 所在省Id。 * 所在省Id。
*/ */
@NotNull(message = "数据验证失败,所在省份不能为空!")
@Column(name = "province_id") @Column(name = "province_id")
private Long provinceId; private Long provinceId;
/** /**
* 所在城市Id。 * 所在城市Id。
*/ */
@NotNull(message = "数据验证失败,所在城市不能为空!")
@Column(name = "city_id") @Column(name = "city_id")
private Long cityId; private Long cityId;

View File

@@ -6,13 +6,12 @@ import com.orange.demo.application.common.constant.StudentStatus;
import com.orange.demo.common.core.annotation.RelationDict; import com.orange.demo.common.core.annotation.RelationDict;
import com.orange.demo.common.core.annotation.RelationConstDict; import com.orange.demo.common.core.annotation.RelationConstDict;
import com.orange.demo.common.core.base.mapper.BaseModelMapper; import com.orange.demo.common.core.base.mapper.BaseModelMapper;
import com.orange.demo.common.core.validator.ConstDictRef; import com.orange.demo.common.core.util.MyCommonUtil;
import com.orange.demo.courseclassinterface.vo.StudentVo; import com.orange.demo.courseclassinterface.vo.StudentVo;
import lombok.Data; import lombok.Data;
import org.mapstruct.*; import org.mapstruct.*;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
import javax.persistence.*; import javax.persistence.*;
import javax.validation.constraints.*;
import java.util.Date; import java.util.Date;
import java.util.Map; import java.util.Map;
@@ -30,7 +29,6 @@ public class Student {
/** /**
* 学生Id。 * 学生Id。
*/ */
@NotNull(message = "数据验证失败学生Id不能为空")
@Id @Id
@Column(name = "student_id") @Column(name = "student_id")
private Long studentId; private Long studentId;
@@ -38,84 +36,70 @@ public class Student {
/** /**
* 登录手机。 * 登录手机。
*/ */
@NotBlank(message = "数据验证失败,手机号码不能为空!")
@Column(name = "login_mobile") @Column(name = "login_mobile")
private String loginMobile; private String loginMobile;
/** /**
* 学生姓名。 * 学生姓名。
*/ */
@NotBlank(message = "数据验证失败,姓名不能为空!")
@Column(name = "student_name") @Column(name = "student_name")
private String studentName; private String studentName;
/** /**
* 所在省份Id。 * 所在省份Id。
*/ */
@NotNull(message = "数据验证失败,所在省份不能为空!")
@Column(name = "province_id") @Column(name = "province_id")
private Long provinceId; private Long provinceId;
/** /**
* 所在城市Id。 * 所在城市Id。
*/ */
@NotNull(message = "数据验证失败,所在城市不能为空!")
@Column(name = "city_id") @Column(name = "city_id")
private Long cityId; private Long cityId;
/** /**
* 区县Id。 * 区县Id。
*/ */
@NotNull(message = "数据验证失败,所在区县不能为空!")
@Column(name = "district_id") @Column(name = "district_id")
private Long districtId; private Long districtId;
/** /**
* 学生性别 (0: 女生 1: 男生)。 * 学生性别 (0: 女生 1: 男生)。
*/ */
@NotNull(message = "数据验证失败,性别不能为空!")
@ConstDictRef(constDictClass = Gender.class, message = "数据验证失败,性别为无效值!")
private Integer gender; private Integer gender;
/** /**
* 生日。 * 生日。
*/ */
@NotNull(message = "数据验证失败,生日不能为空!")
private Date birthday; private Date birthday;
/** /**
* 经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)。 * 经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)。
*/ */
@NotNull(message = "数据验证失败,经验等级不能为空!")
@ConstDictRef(constDictClass = ExpLevel.class, message = "数据验证失败,经验等级为无效值!")
@Column(name = "experience_level") @Column(name = "experience_level")
private Integer experienceLevel; private Integer experienceLevel;
/** /**
* 总共充值学币数量。 * 总共充值学币数量。
*/ */
@NotNull(message = "数据验证失败,充值学币不能为空!")
@Column(name = "total_coin") @Column(name = "total_coin")
private Integer totalCoin; private Integer totalCoin;
/** /**
* 可用学币数量。 * 可用学币数量。
*/ */
@NotNull(message = "数据验证失败,剩余学币不能为空!")
@Column(name = "left_coin") @Column(name = "left_coin")
private Integer leftCoin; private Integer leftCoin;
/** /**
* 年级Id。 * 年级Id。
*/ */
@NotNull(message = "数据验证失败,年级不能为空!")
@Column(name = "grade_id") @Column(name = "grade_id")
private Integer gradeId; private Integer gradeId;
/** /**
* 校区Id。 * 校区Id。
*/ */
@NotNull(message = "数据验证失败,所属校区不能为空!")
@Column(name = "school_id") @Column(name = "school_id")
private Long schoolId; private Long schoolId;
@@ -128,8 +112,6 @@ public class Student {
/** /**
* 学生状态 (0: 正常 1: 锁定 2: 注销)。 * 学生状态 (0: 正常 1: 锁定 2: 注销)。
*/ */
@NotNull(message = "数据验证失败,状态 不能为空!")
@ConstDictRef(constDictClass = StudentStatus.class, message = "数据验证失败,状态 为无效值!")
private Integer status; private Integer status;
/** /**
@@ -162,6 +144,10 @@ public class Student {
@Transient @Transient
private String searchString; private String searchString;
public void setSearchString(String searchString) {
this.searchString = MyCommonUtil.replaceSqlWildcard(searchString);
}
@RelationDict( @RelationDict(
masterIdField = "provinceId", masterIdField = "provinceId",
slaveServiceName = "areaCodeService", slaveServiceName = "areaCodeService",

View File

@@ -6,13 +6,11 @@ import com.orange.demo.common.core.annotation.RelationDict;
import com.orange.demo.common.core.annotation.RelationConstDict; import com.orange.demo.common.core.annotation.RelationConstDict;
import com.orange.demo.common.core.base.mapper.BaseModelMapper; import com.orange.demo.common.core.base.mapper.BaseModelMapper;
import com.orange.demo.common.core.annotation.DeletedFlagColumn; import com.orange.demo.common.core.annotation.DeletedFlagColumn;
import com.orange.demo.common.core.validator.ConstDictRef;
import com.orange.demo.courseclassinterface.vo.StudentClassVo; import com.orange.demo.courseclassinterface.vo.StudentClassVo;
import lombok.Data; import lombok.Data;
import org.mapstruct.*; import org.mapstruct.*;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
import javax.persistence.*; import javax.persistence.*;
import javax.validation.constraints.*;
import java.util.Date; import java.util.Date;
import java.util.Map; import java.util.Map;
@@ -30,7 +28,6 @@ public class StudentClass {
/** /**
* 班级Id。 * 班级Id。
*/ */
@NotNull(message = "数据验证失败班级Id不能为空")
@Id @Id
@Column(name = "class_id") @Column(name = "class_id")
private Long classId; private Long classId;
@@ -38,36 +35,30 @@ public class StudentClass {
/** /**
* 班级名称。 * 班级名称。
*/ */
@NotBlank(message = "数据验证失败,班级名称不能为空!")
@Column(name = "class_name") @Column(name = "class_name")
private String className; private String className;
/** /**
* 学校Id。 * 学校Id。
*/ */
@NotNull(message = "数据验证失败,所属校区不能为空!")
@Column(name = "school_id") @Column(name = "school_id")
private Long schoolId; private Long schoolId;
/** /**
* 学生班长Id。 * 学生班长Id。
*/ */
@NotNull(message = "数据验证失败,班长不能为空!")
@Column(name = "leader_id") @Column(name = "leader_id")
private Long leaderId; private Long leaderId;
/** /**
* 已完成课时数量。 * 已完成课时数量。
*/ */
@NotNull(message = "数据验证失败,已完成课时不能为空!")
@Column(name = "finish_class_hour") @Column(name = "finish_class_hour")
private Integer finishClassHour; private Integer finishClassHour;
/** /**
* 班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)。 * 班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)。
*/ */
@NotNull(message = "数据验证失败,班级级别不能为空!")
@ConstDictRef(constDictClass = ClassLevel.class, message = "数据验证失败,班级级别为无效值!")
@Column(name = "class_level") @Column(name = "class_level")
private Integer classLevel; private Integer classLevel;

View File

@@ -1,49 +1,17 @@
package com.orange.demo.courseclassservice.service; package com.orange.demo.courseclassservice.service;
import com.orange.demo.courseclassservice.dao.AreaCodeMapper;
import com.orange.demo.courseclassservice.model.AreaCode; import com.orange.demo.courseclassservice.model.AreaCode;
import com.orange.demo.common.core.cache.MapTreeDictionaryCache; import com.orange.demo.common.core.base.service.IBaseDictService;
import com.orange.demo.common.core.base.service.BaseDictService;
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import java.util.Collection; import java.util.Collection;
import java.util.List;
/** /**
* 行政区划的Service * 行政区划的Service接口
* *
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@Service public interface AreaCodeService extends IBaseDictService<AreaCode, Long> {
public class AreaCodeService extends BaseDictService<AreaCode, Long> {
@Autowired
private AreaCodeMapper areaCodeMapper;
public AreaCodeService() {
super();
this.dictionaryCache = MapTreeDictionaryCache.create(AreaCode::getAreaId, AreaCode::getParentId);
}
@Override
protected BaseDaoMapper<AreaCode> mapper() {
return areaCodeMapper;
}
/**
* 加载数据库数据到内存缓存。
*/
@Override
public void loadCachedData() {
Example e = new Example(AreaCode.class);
e.orderBy("areaLevel");
List<AreaCode> areaCodeList = areaCodeMapper.selectByExample(e);
dictionaryCache.putAll(areaCodeList);
}
/** /**
* 根据上级行政区划Id获取其下级行政区划列表。 * 根据上级行政区划Id获取其下级行政区划列表。
@@ -51,7 +19,5 @@ public class AreaCodeService extends BaseDictService<AreaCode, Long> {
* @param parentId 上级行政区划Id。 * @param parentId 上级行政区划Id。
* @return 下级行政区划列表。 * @return 下级行政区划列表。
*/ */
public Collection<AreaCode> getListByParentId(Long parentId) { Collection<AreaCode> getListByParentId(Long parentId);
return ((MapTreeDictionaryCache<Long, AreaCode>) dictionaryCache).getListByParentId(parentId);
}
} }

View File

@@ -1,48 +1,18 @@
package com.orange.demo.courseclassservice.service; package com.orange.demo.courseclassservice.service;
import com.orange.demo.courseclassservice.dao.*;
import com.orange.demo.courseclassservice.model.*; import com.orange.demo.courseclassservice.model.*;
import com.orange.demo.common.core.util.*;
import com.orange.demo.common.core.object.MyRelationParam;
import com.orange.demo.common.core.object.CallResult; import com.orange.demo.common.core.object.CallResult;
import com.orange.demo.common.core.object.TokenData; import com.orange.demo.common.core.base.service.IBaseService;
import com.orange.demo.common.core.object.MyWhereCriteria;
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
import com.orange.demo.common.core.base.service.BaseService;
import com.orange.demo.common.sequence.wrapper.IdGeneratorWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*; import java.util.*;
/** /**
* 课程数据数据操作服务 * 课程数据数据操作服务接口
* *
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@Service public interface CourseService extends IBaseService<Course, Long> {
public class CourseService extends BaseService<Course, Long> {
@Autowired
private CourseMapper courseMapper;
@Autowired
private ClassCourseMapper classCourseMapper;
@Autowired
private GradeService gradeService;
@Autowired
private IdGeneratorWrapper idGenerator;
/**
* 返回当前Service的主表Mapper对象。
*
* @return 主表Mapper对象。
*/
@Override
protected BaseDaoMapper<Course> mapper() {
return courseMapper;
}
/** /**
* 保存新增对象。 * 保存新增对象。
@@ -50,17 +20,7 @@ public class CourseService extends BaseService<Course, Long> {
* @param course 新增对象。 * @param course 新增对象。
* @return 返回新增对象。 * @return 返回新增对象。
*/ */
@Transactional(rollbackFor = Exception.class) Course saveNew(Course course);
public Course saveNew(Course course) {
course.setCourseId(idGenerator.nextLongId());
TokenData tokenData = TokenData.takeFromRequest();
course.setCreateUserId(tokenData.getUserId());
Date now = new Date();
course.setCreateTime(now);
course.setUpdateTime(now);
courseMapper.insert(course);
return course;
}
/** /**
* 更新数据对象。 * 更新数据对象。
@@ -69,14 +29,7 @@ public class CourseService extends BaseService<Course, Long> {
* @param originalCourse 原有数据对象。 * @param originalCourse 原有数据对象。
* @return 成功返回true否则false。 * @return 成功返回true否则false。
*/ */
@Transactional(rollbackFor = Exception.class) boolean update(Course course, Course originalCourse);
public boolean update(Course course, Course originalCourse) {
course.setCreateUserId(originalCourse.getCreateUserId());
course.setCreateTime(originalCourse.getCreateTime());
course.setUpdateTime(new Date());
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
return courseMapper.updateByPrimaryKey(course) == 1;
}
/** /**
* 删除指定数据。 * 删除指定数据。
@@ -84,19 +37,7 @@ public class CourseService extends BaseService<Course, Long> {
* @param courseId 主键Id。 * @param courseId 主键Id。
* @return 成功返回true否则false。 * @return 成功返回true否则false。
*/ */
@Transactional(rollbackFor = Exception.class) boolean remove(Long courseId);
public boolean remove(Long courseId) {
// 这里先删除主数据
if (courseMapper.deleteByPrimaryKey(courseId) == 0) {
return false;
}
// 这里可继续删除关联数据。
// 开始删除与本地多对多父表的关联
ClassCourse classCourse = new ClassCourse();
classCourse.setCourseId(courseId);
classCourseMapper.delete(classCourse);
return true;
}
/** /**
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。 * 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
@@ -106,9 +47,7 @@ public class CourseService extends BaseService<Course, Long> {
* @param orderBy 排序参数。 * @param orderBy 排序参数。
* @return 查询结果集。 * @return 查询结果集。
*/ */
public List<Course> getCourseList(Course filter, String orderBy) { List<Course> getCourseList(Course filter, String orderBy);
return courseMapper.getCourseList(null, null, filter, orderBy);
}
/** /**
* 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。 * 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。
@@ -121,11 +60,7 @@ public class CourseService extends BaseService<Course, Long> {
* @param orderBy 排序参数。 * @param orderBy 排序参数。
* @return 查询结果集。 * @return 查询结果集。
*/ */
public <M> List<Course> getCourseList( <M> List<Course> getCourseList(String inFilterField, Set<M> inFilterValues, Course filter, String orderBy);
String inFilterField, Set<M> inFilterValues, Course filter, String orderBy) {
String inFilterColumn = MyModelUtil.mapToColumnName(inFilterField, Course.class);
return courseMapper.getCourseList(inFilterColumn, inFilterValues, filter, orderBy);
}
/** /**
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。 * 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
@@ -135,12 +70,7 @@ public class CourseService extends BaseService<Course, Long> {
* @param orderBy 排序对象。 * @param orderBy 排序对象。
* @return 查询结果集。 * @return 查询结果集。
*/ */
public List<Course> getCourseListWithRelation(Course filter, String orderBy) { List<Course> getCourseListWithRelation(Course filter, String orderBy);
List<Course> resultList = courseMapper.getCourseList(null, null, filter, orderBy);
Map<String, List<MyWhereCriteria>> criteriaMap = buildAggregationAdditionalWhereCriteria();
this.buildRelationForDataList(resultList, MyRelationParam.normal(), criteriaMap);
return resultList;
}
/** /**
* 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。 * 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。
@@ -153,13 +83,8 @@ public class CourseService extends BaseService<Course, Long> {
* @param orderBy 排序对象。 * @param orderBy 排序对象。
* @return 查询结果集。 * @return 查询结果集。
*/ */
public <M> List<Course> getCourseListWithRelation( <M> List<Course> getCourseListWithRelation(
String inFilterField, Set<M> inFilterValues, Course filter, String orderBy) { String inFilterField, Set<M> inFilterValues, Course filter, String orderBy);
List<Course> resultList =
courseMapper.getCourseList(inFilterField, inFilterValues, filter, orderBy);
this.buildRelationForDataList(resultList, MyRelationParam.dictOnly(), null);
return resultList;
}
/** /**
* 在多对多关系中当前Service的数据表为从表返回不与指定主表主键Id存在对多对关系的列表。 * 在多对多关系中当前Service的数据表为从表返回不与指定主表主键Id存在对多对关系的列表。
@@ -169,13 +94,8 @@ public class CourseService extends BaseService<Course, Long> {
* @param orderBy 排序参数。 * @param orderBy 排序参数。
* @return 查询结果集。 * @return 查询结果集。
*/ */
public List<Course> getNotInCourseListByClassId( List<Course> getNotInCourseListByClassId(
Long classId, Course filter, String orderBy) { Long classId, Course filter, String orderBy);
List<Course> resultList =
courseMapper.getNotInCourseListByClassId(classId, filter, orderBy);
this.buildRelationForDataList(resultList, MyRelationParam.dictOnly(), null);
return resultList;
}
/** /**
* 在多对多关系中当前Service的数据表为从表返回与指定主表主键Id存在对多对关系的列表。 * 在多对多关系中当前Service的数据表为从表返回与指定主表主键Id存在对多对关系的列表。
@@ -185,13 +105,8 @@ public class CourseService extends BaseService<Course, Long> {
* @param orderBy 排序参数。 * @param orderBy 排序参数。
* @return 查询结果集。 * @return 查询结果集。
*/ */
public List<Course> getCourseListByClassId( List<Course> getCourseListByClassId(
Long classId, Course filter, String orderBy) { Long classId, Course filter, String orderBy);
List<Course> resultList =
courseMapper.getCourseListByClassId(classId, filter, orderBy);
this.buildRelationForDataList(resultList, MyRelationParam.dictOnly(), null);
return resultList;
}
/** /**
* 根据最新对象和原有对象的数据对比,判断关联的字典数据和多对一主表数据是否都是合法数据。 * 根据最新对象和原有对象的数据对比,判断关联的字典数据和多对一主表数据是否都是合法数据。
@@ -200,12 +115,5 @@ public class CourseService extends BaseService<Course, Long> {
* @param originalCourse 原有数据对象。 * @param originalCourse 原有数据对象。
* @return 数据全部正确返回true否则false同时返回具体的错误信息。 * @return 数据全部正确返回true否则false同时返回具体的错误信息。
*/ */
public CallResult verifyRelatedData(Course course, Course originalCourse) { CallResult verifyRelatedData(Course course, Course originalCourse);
String errorMessageFormat = "数据验证失败,关联的%s并不存在请刷新后重试";
if (this.needToVerify(course, originalCourse, Course::getGradeId)
&& !gradeService.existId(course.getGradeId())) {
return CallResult.error(String.format(errorMessageFormat, "所属年级"));
}
return CallResult.ok();
}
} }

View File

@@ -1,98 +1,13 @@
package com.orange.demo.courseclassservice.service; package com.orange.demo.courseclassservice.service;
import com.orange.demo.common.redis.cache.RedisDictionaryCache; import com.orange.demo.common.core.base.service.IBaseDictService;
import com.orange.demo.common.core.base.service.BaseDictService;
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
import com.orange.demo.common.core.constant.GlobalDeletedFlag;
import com.orange.demo.courseclassservice.dao.GradeMapper;
import com.orange.demo.courseclassservice.model.Grade; import com.orange.demo.courseclassservice.model.Grade;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.PostConstruct;
/** /**
* 年级数据操作服务 * 年级字典数据操作服务接口
* *
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@Service public interface GradeService extends IBaseDictService<Grade, Integer> {
public class GradeService extends BaseDictService<Grade, Integer> {
@Autowired
private GradeMapper gradeMapper;
@Autowired
private RedissonClient redissonClient;
public GradeService() {
super();
}
@PostConstruct
public void init() {
this.dictionaryCache = RedisDictionaryCache.create(
redissonClient, "Grade", Grade.class, Grade::getGradeId);
}
/**
* 返回当前Service的主表Mapper对象。
*
* @return 主表Mapper对象。
*/
@Override
protected BaseDaoMapper<Grade> mapper() {
return gradeMapper;
}
/**
* 保存新增对象。
*
* @param grade 新增对象。
* @return 返回新增对象。
*/
@Transactional(rollbackFor = Exception.class)
public Grade saveNew(Grade grade) {
grade.setStatus(GlobalDeletedFlag.NORMAL);
gradeMapper.insert(grade);
dictionaryCache.put(grade.getGradeId(), grade);
return grade;
}
/**
* 更新数据对象。
*
* @param grade 更新的对象。
* @param originalGrade 原有数据对象。
* @return 成功返回true否则false。
*/
@Transactional(rollbackFor = Exception.class)
public boolean update(Grade grade, Grade originalGrade) {
grade.setStatus(GlobalDeletedFlag.NORMAL);
if (gradeMapper.updateByPrimaryKey(grade) != 1) {
return false;
}
dictionaryCache.put(grade.getGradeId(), grade);
return true;
}
/**
* 删除指定数据。
*
* @param gradeId 主键Id。
* @return 成功返回true否则false。
*/
@Transactional(rollbackFor = Exception.class)
public boolean remove(Integer gradeId) {
Grade deletedObject = new Grade();
deletedObject.setGradeId(gradeId);
deletedObject.setStatus(GlobalDeletedFlag.DELETED);
if (gradeMapper.updateByPrimaryKeySelective(deletedObject) != 1) {
return false;
}
dictionaryCache.invalidate(gradeId);
return true;
}
} }

View File

@@ -1,45 +1,18 @@
package com.orange.demo.courseclassservice.service; package com.orange.demo.courseclassservice.service;
import com.orange.demo.courseclassservice.dao.*;
import com.orange.demo.courseclassservice.model.*; import com.orange.demo.courseclassservice.model.*;
import com.orange.demo.common.core.util.*;
import com.orange.demo.common.core.object.MyRelationParam;
import com.orange.demo.common.core.object.CallResult; import com.orange.demo.common.core.object.CallResult;
import com.orange.demo.common.core.object.MyWhereCriteria; import com.orange.demo.common.core.base.service.IBaseService;
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
import com.orange.demo.common.core.base.service.BaseService;
import com.orange.demo.common.sequence.wrapper.IdGeneratorWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*; import java.util.*;
/** /**
* 校区数据数据操作服务 * 校区数据数据操作服务接口
* *
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@Service public interface SchoolInfoService extends IBaseService<SchoolInfo, Long> {
public class SchoolInfoService extends BaseService<SchoolInfo, Long> {
@Autowired
private SchoolInfoMapper schoolInfoMapper;
@Autowired
private AreaCodeService areaCodeService;
@Autowired
private IdGeneratorWrapper idGenerator;
/**
* 返回当前Service的主表Mapper对象。
*
* @return 主表Mapper对象。
*/
@Override
protected BaseDaoMapper<SchoolInfo> mapper() {
return schoolInfoMapper;
}
/** /**
* 保存新增对象。 * 保存新增对象。
@@ -47,12 +20,7 @@ public class SchoolInfoService extends BaseService<SchoolInfo, Long> {
* @param schoolInfo 新增对象。 * @param schoolInfo 新增对象。
* @return 返回新增对象。 * @return 返回新增对象。
*/ */
@Transactional(rollbackFor = Exception.class) SchoolInfo saveNew(SchoolInfo schoolInfo);
public SchoolInfo saveNew(SchoolInfo schoolInfo) {
schoolInfo.setSchoolId(idGenerator.nextLongId());
schoolInfoMapper.insert(schoolInfo);
return schoolInfo;
}
/** /**
* 更新数据对象。 * 更新数据对象。
@@ -61,11 +29,7 @@ public class SchoolInfoService extends BaseService<SchoolInfo, Long> {
* @param originalSchoolInfo 原有数据对象。 * @param originalSchoolInfo 原有数据对象。
* @return 成功返回true否则false。 * @return 成功返回true否则false。
*/ */
@Transactional(rollbackFor = Exception.class) boolean update(SchoolInfo schoolInfo, SchoolInfo originalSchoolInfo);
public boolean update(SchoolInfo schoolInfo, SchoolInfo originalSchoolInfo) {
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
return schoolInfoMapper.updateByPrimaryKey(schoolInfo) == 1;
}
/** /**
* 删除指定数据。 * 删除指定数据。
@@ -73,10 +37,7 @@ public class SchoolInfoService extends BaseService<SchoolInfo, Long> {
* @param schoolId 主键Id。 * @param schoolId 主键Id。
* @return 成功返回true否则false。 * @return 成功返回true否则false。
*/ */
@Transactional(rollbackFor = Exception.class) boolean remove(Long schoolId);
public boolean remove(Long schoolId) {
return schoolInfoMapper.deleteByPrimaryKey(schoolId) != 0;
}
/** /**
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。 * 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
@@ -86,9 +47,7 @@ public class SchoolInfoService extends BaseService<SchoolInfo, Long> {
* @param orderBy 排序参数。 * @param orderBy 排序参数。
* @return 查询结果集。 * @return 查询结果集。
*/ */
public List<SchoolInfo> getSchoolInfoList(SchoolInfo filter, String orderBy) { List<SchoolInfo> getSchoolInfoList(SchoolInfo filter, String orderBy);
return schoolInfoMapper.getSchoolInfoList(null, null, filter, orderBy);
}
/** /**
* 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。 * 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。
@@ -101,11 +60,7 @@ public class SchoolInfoService extends BaseService<SchoolInfo, Long> {
* @param orderBy 排序参数。 * @param orderBy 排序参数。
* @return 查询结果集。 * @return 查询结果集。
*/ */
public <M> List<SchoolInfo> getSchoolInfoList( <M> List<SchoolInfo> getSchoolInfoList(String inFilterField, Set<M> inFilterValues, SchoolInfo filter, String orderBy);
String inFilterField, Set<M> inFilterValues, SchoolInfo filter, String orderBy) {
String inFilterColumn = MyModelUtil.mapToColumnName(inFilterField, SchoolInfo.class);
return schoolInfoMapper.getSchoolInfoList(inFilterColumn, inFilterValues, filter, orderBy);
}
/** /**
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。 * 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
@@ -115,12 +70,7 @@ public class SchoolInfoService extends BaseService<SchoolInfo, Long> {
* @param orderBy 排序对象。 * @param orderBy 排序对象。
* @return 查询结果集。 * @return 查询结果集。
*/ */
public List<SchoolInfo> getSchoolInfoListWithRelation(SchoolInfo filter, String orderBy) { List<SchoolInfo> getSchoolInfoListWithRelation(SchoolInfo filter, String orderBy);
List<SchoolInfo> resultList = schoolInfoMapper.getSchoolInfoList(null, null, filter, orderBy);
Map<String, List<MyWhereCriteria>> criteriaMap = buildAggregationAdditionalWhereCriteria();
this.buildRelationForDataList(resultList, MyRelationParam.normal(), criteriaMap);
return resultList;
}
/** /**
* 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。 * 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。
@@ -133,13 +83,8 @@ public class SchoolInfoService extends BaseService<SchoolInfo, Long> {
* @param orderBy 排序对象。 * @param orderBy 排序对象。
* @return 查询结果集。 * @return 查询结果集。
*/ */
public <M> List<SchoolInfo> getSchoolInfoListWithRelation( <M> List<SchoolInfo> getSchoolInfoListWithRelation(
String inFilterField, Set<M> inFilterValues, SchoolInfo filter, String orderBy) { String inFilterField, Set<M> inFilterValues, SchoolInfo filter, String orderBy);
List<SchoolInfo> resultList =
schoolInfoMapper.getSchoolInfoList(inFilterField, inFilterValues, filter, orderBy);
this.buildRelationForDataList(resultList, MyRelationParam.dictOnly(), null);
return resultList;
}
/** /**
* 根据最新对象和原有对象的数据对比,判断关联的字典数据和多对一主表数据是否都是合法数据。 * 根据最新对象和原有对象的数据对比,判断关联的字典数据和多对一主表数据是否都是合法数据。
@@ -148,16 +93,5 @@ public class SchoolInfoService extends BaseService<SchoolInfo, Long> {
* @param originalSchoolInfo 原有数据对象。 * @param originalSchoolInfo 原有数据对象。
* @return 数据全部正确返回true否则false同时返回具体的错误信息。 * @return 数据全部正确返回true否则false同时返回具体的错误信息。
*/ */
public CallResult verifyRelatedData(SchoolInfo schoolInfo, SchoolInfo originalSchoolInfo) { CallResult verifyRelatedData(SchoolInfo schoolInfo, SchoolInfo originalSchoolInfo);
String errorMessageFormat = "数据验证失败,关联的%s并不存在请刷新后重试";
if (this.needToVerify(schoolInfo, originalSchoolInfo, SchoolInfo::getProvinceId)
&& !areaCodeService.existId(schoolInfo.getProvinceId())) {
return CallResult.error(String.format(errorMessageFormat, "所在省份"));
}
if (this.needToVerify(schoolInfo, originalSchoolInfo, SchoolInfo::getCityId)
&& !areaCodeService.existId(schoolInfo.getCityId())) {
return CallResult.error(String.format(errorMessageFormat, "所在城市"));
}
return CallResult.ok();
}
} }

View File

@@ -1,54 +1,18 @@
package com.orange.demo.courseclassservice.service; package com.orange.demo.courseclassservice.service;
import com.orange.demo.courseclassservice.dao.*;
import com.orange.demo.courseclassservice.model.*; import com.orange.demo.courseclassservice.model.*;
import com.orange.demo.common.core.util.*;
import com.orange.demo.common.core.object.MyRelationParam;
import com.orange.demo.common.core.object.CallResult; import com.orange.demo.common.core.object.CallResult;
import com.orange.demo.common.core.object.TokenData; import com.orange.demo.common.core.base.service.IBaseService;
import com.orange.demo.common.core.object.MyWhereCriteria;
import com.orange.demo.common.core.constant.GlobalDeletedFlag;
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
import com.orange.demo.common.core.base.service.BaseService;
import com.orange.demo.common.sequence.wrapper.IdGeneratorWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import java.util.*; import java.util.*;
/** /**
* 班级数据数据操作服务 * 班级数据数据操作服务接口
* *
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@Service public interface StudentClassService extends IBaseService<StudentClass, Long> {
public class StudentClassService extends BaseService<StudentClass, Long> {
@Autowired
private StudentClassMapper studentClassMapper;
@Autowired
private ClassCourseMapper classCourseMapper;
@Autowired
private ClassStudentMapper classStudentMapper;
@Autowired
private SchoolInfoService schoolInfoService;
@Autowired
private StudentService studentService;
@Autowired
private IdGeneratorWrapper idGenerator;
/**
* 返回当前Service的主表Mapper对象。
*
* @return 主表Mapper对象。
*/
@Override
protected BaseDaoMapper<StudentClass> mapper() {
return studentClassMapper;
}
/** /**
* 保存新增对象。 * 保存新增对象。
@@ -56,16 +20,7 @@ public class StudentClassService extends BaseService<StudentClass, Long> {
* @param studentClass 新增对象。 * @param studentClass 新增对象。
* @return 返回新增对象。 * @return 返回新增对象。
*/ */
@Transactional(rollbackFor = Exception.class) StudentClass saveNew(StudentClass studentClass);
public StudentClass saveNew(StudentClass studentClass) {
studentClass.setClassId(idGenerator.nextLongId());
TokenData tokenData = TokenData.takeFromRequest();
studentClass.setCreateUserId(tokenData.getUserId());
studentClass.setCreateTime(new Date());
studentClass.setStatus(GlobalDeletedFlag.NORMAL);
studentClassMapper.insert(studentClass);
return studentClass;
}
/** /**
* 更新数据对象。 * 更新数据对象。
@@ -74,14 +29,7 @@ public class StudentClassService extends BaseService<StudentClass, Long> {
* @param originalStudentClass 原有数据对象。 * @param originalStudentClass 原有数据对象。
* @return 成功返回true否则false。 * @return 成功返回true否则false。
*/ */
@Transactional(rollbackFor = Exception.class) boolean update(StudentClass studentClass, StudentClass originalStudentClass);
public boolean update(StudentClass studentClass, StudentClass originalStudentClass) {
studentClass.setCreateUserId(originalStudentClass.getCreateUserId());
studentClass.setCreateTime(originalStudentClass.getCreateTime());
studentClass.setStatus(GlobalDeletedFlag.NORMAL);
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
return studentClassMapper.updateByPrimaryKey(studentClass) == 1;
}
/** /**
* 删除指定数据。 * 删除指定数据。
@@ -89,27 +37,7 @@ public class StudentClassService extends BaseService<StudentClass, Long> {
* @param classId 主键Id。 * @param classId 主键Id。
* @return 成功返回true否则false。 * @return 成功返回true否则false。
*/ */
@Transactional(rollbackFor = Exception.class) boolean remove(Long classId);
public boolean remove(Long classId) {
Example studentClassExample = new Example(StudentClass.class);
Example.Criteria c = studentClassExample.createCriteria();
c.andEqualTo(super.idFieldName, classId);
c.andEqualTo(super.deletedFlagFieldName, GlobalDeletedFlag.NORMAL);
// 这里先删除主数据
StudentClass deletedObject = new StudentClass();
deletedObject.setStatus(GlobalDeletedFlag.DELETED);
if (studentClassMapper.updateByExampleSelective(deletedObject, studentClassExample) == 0) {
return false;
}
// 开始删除多对多中间表的关联
ClassCourse classCourse = new ClassCourse();
classCourse.setClassId(classId);
classCourseMapper.delete(classCourse);
ClassStudent classStudent = new ClassStudent();
classStudent.setClassId(classId);
classStudentMapper.delete(classStudent);
return true;
}
/** /**
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。 * 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
@@ -119,9 +47,7 @@ public class StudentClassService extends BaseService<StudentClass, Long> {
* @param orderBy 排序参数。 * @param orderBy 排序参数。
* @return 查询结果集。 * @return 查询结果集。
*/ */
public List<StudentClass> getStudentClassList(StudentClass filter, String orderBy) { List<StudentClass> getStudentClassList(StudentClass filter, String orderBy);
return studentClassMapper.getStudentClassList(null, null, filter, orderBy);
}
/** /**
* 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。 * 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。
@@ -134,11 +60,7 @@ public class StudentClassService extends BaseService<StudentClass, Long> {
* @param orderBy 排序参数。 * @param orderBy 排序参数。
* @return 查询结果集。 * @return 查询结果集。
*/ */
public <M> List<StudentClass> getStudentClassList( <M> List<StudentClass> getStudentClassList(String inFilterField, Set<M> inFilterValues, StudentClass filter, String orderBy);
String inFilterField, Set<M> inFilterValues, StudentClass filter, String orderBy) {
String inFilterColumn = MyModelUtil.mapToColumnName(inFilterField, StudentClass.class);
return studentClassMapper.getStudentClassList(inFilterColumn, inFilterValues, filter, orderBy);
}
/** /**
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。 * 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
@@ -148,12 +70,7 @@ public class StudentClassService extends BaseService<StudentClass, Long> {
* @param orderBy 排序对象。 * @param orderBy 排序对象。
* @return 查询结果集。 * @return 查询结果集。
*/ */
public List<StudentClass> getStudentClassListWithRelation(StudentClass filter, String orderBy) { List<StudentClass> getStudentClassListWithRelation(StudentClass filter, String orderBy);
List<StudentClass> resultList = studentClassMapper.getStudentClassList(null, null, filter, orderBy);
Map<String, List<MyWhereCriteria>> criteriaMap = buildAggregationAdditionalWhereCriteria();
this.buildRelationForDataList(resultList, MyRelationParam.normal(), criteriaMap);
return resultList;
}
/** /**
* 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。 * 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。
@@ -166,13 +83,8 @@ public class StudentClassService extends BaseService<StudentClass, Long> {
* @param orderBy 排序对象。 * @param orderBy 排序对象。
* @return 查询结果集。 * @return 查询结果集。
*/ */
public <M> List<StudentClass> getStudentClassListWithRelation( <M> List<StudentClass> getStudentClassListWithRelation(
String inFilterField, Set<M> inFilterValues, StudentClass filter, String orderBy) { String inFilterField, Set<M> inFilterValues, StudentClass filter, String orderBy);
List<StudentClass> resultList =
studentClassMapper.getStudentClassList(inFilterField, inFilterValues, filter, orderBy);
this.buildRelationForDataList(resultList, MyRelationParam.dictOnly(), null);
return resultList;
}
/** /**
* 批量添加多对多关联关系。 * 批量添加多对多关联关系。
@@ -180,16 +92,7 @@ public class StudentClassService extends BaseService<StudentClass, Long> {
* @param classCourseList 多对多关联表对象集合。 * @param classCourseList 多对多关联表对象集合。
* @param classId 主表Id。 * @param classId 主表Id。
*/ */
@Transactional(rollbackFor = Exception.class) void addClassCourseList(List<ClassCourse> classCourseList, Long classId);
public void addClassCourseList(List<ClassCourse> classCourseList, Long classId) {
for (ClassCourse classCourse : classCourseList) {
classCourse.setClassId(classId);
if (classCourse.getCourseOrder() == null) {
classCourse.setCourseOrder(0);
}
}
classCourseMapper.insertList(classCourseList);
}
/** /**
* 更新中间表数据。 * 更新中间表数据。
@@ -197,14 +100,7 @@ public class StudentClassService extends BaseService<StudentClass, Long> {
* @param classCourse 中间表对象。 * @param classCourse 中间表对象。
* @return 更新成功与否。 * @return 更新成功与否。
*/ */
@Transactional(rollbackFor = Exception.class) boolean updateClassCourse(ClassCourse classCourse);
public boolean updateClassCourse(ClassCourse classCourse) {
Example e = new Example(ClassCourse.class);
e.createCriteria()
.andEqualTo("classId", classCourse.getClassId())
.andEqualTo("courseId", classCourse.getCourseId());
return classCourseMapper.updateByExample(classCourse, e) > 0;
}
/** /**
* 获取中间表数据。 * 获取中间表数据。
@@ -213,13 +109,7 @@ public class StudentClassService extends BaseService<StudentClass, Long> {
* @param courseId 从表Id。 * @param courseId 从表Id。
* @return 中间表对象。 * @return 中间表对象。
*/ */
public ClassCourse getClassCourse(Long classId, Long courseId) { ClassCourse getClassCourse(Long classId, Long courseId);
Example e = new Example(ClassCourse.class);
e.createCriteria()
.andEqualTo("classId", classId)
.andEqualTo("courseId", courseId);
return classCourseMapper.selectOneByExample(e);
}
/** /**
* 移除单条多对多关系。 * 移除单条多对多关系。
@@ -228,13 +118,7 @@ public class StudentClassService extends BaseService<StudentClass, Long> {
* @param courseId 从表Id。 * @param courseId 从表Id。
* @return 成功返回true否则false。 * @return 成功返回true否则false。
*/ */
@Transactional(rollbackFor = Exception.class) boolean removeClassCourse(Long classId, Long courseId);
public boolean removeClassCourse(Long classId, Long courseId) {
ClassCourse classCourse = new ClassCourse();
classCourse.setClassId(classId);
classCourse.setCourseId(courseId);
return classCourseMapper.delete(classCourse) > 0;
}
/** /**
* 批量添加多对多关联关系。 * 批量添加多对多关联关系。
@@ -242,13 +126,7 @@ public class StudentClassService extends BaseService<StudentClass, Long> {
* @param classStudentList 多对多关联表对象集合。 * @param classStudentList 多对多关联表对象集合。
* @param classId 主表Id。 * @param classId 主表Id。
*/ */
@Transactional(rollbackFor = Exception.class) void addClassStudentList(List<ClassStudent> classStudentList, Long classId);
public void addClassStudentList(List<ClassStudent> classStudentList, Long classId) {
for (ClassStudent classStudent : classStudentList) {
classStudent.setClassId(classId);
}
classStudentMapper.insertList(classStudentList);
}
/** /**
* 移除单条多对多关系。 * 移除单条多对多关系。
@@ -257,13 +135,7 @@ public class StudentClassService extends BaseService<StudentClass, Long> {
* @param studentId 从表Id。 * @param studentId 从表Id。
* @return 成功返回true否则false。 * @return 成功返回true否则false。
*/ */
@Transactional(rollbackFor = Exception.class) boolean removeClassStudent(Long classId, Long studentId);
public boolean removeClassStudent(Long classId, Long studentId) {
ClassStudent classStudent = new ClassStudent();
classStudent.setClassId(classId);
classStudent.setStudentId(studentId);
return classStudentMapper.delete(classStudent) > 0;
}
/** /**
* 根据最新对象和原有对象的数据对比,判断关联的字典数据和多对一主表数据是否都是合法数据。 * 根据最新对象和原有对象的数据对比,判断关联的字典数据和多对一主表数据是否都是合法数据。
@@ -272,16 +144,5 @@ public class StudentClassService extends BaseService<StudentClass, Long> {
* @param originalStudentClass 原有数据对象。 * @param originalStudentClass 原有数据对象。
* @return 数据全部正确返回true否则false同时返回具体的错误信息。 * @return 数据全部正确返回true否则false同时返回具体的错误信息。
*/ */
public CallResult verifyRelatedData(StudentClass studentClass, StudentClass originalStudentClass) { CallResult verifyRelatedData(StudentClass studentClass, StudentClass originalStudentClass);
String errorMessageFormat = "数据验证失败,关联的%s并不存在请刷新后重试";
if (this.needToVerify(studentClass, originalStudentClass, StudentClass::getSchoolId)
&& !schoolInfoService.existId(studentClass.getSchoolId())) {
return CallResult.error(String.format(errorMessageFormat, "所属校区"));
}
if (this.needToVerify(studentClass, originalStudentClass, StudentClass::getLeaderId)
&& !studentService.existId(studentClass.getLeaderId())) {
return CallResult.error(String.format(errorMessageFormat, "班长"));
}
return CallResult.ok();
}
} }

View File

@@ -1,52 +1,18 @@
package com.orange.demo.courseclassservice.service; package com.orange.demo.courseclassservice.service;
import com.orange.demo.application.common.constant.StudentStatus;
import com.orange.demo.courseclassservice.dao.*;
import com.orange.demo.courseclassservice.model.*; import com.orange.demo.courseclassservice.model.*;
import com.orange.demo.common.core.util.*;
import com.orange.demo.common.core.object.MyRelationParam;
import com.orange.demo.common.core.object.CallResult; import com.orange.demo.common.core.object.CallResult;
import com.orange.demo.common.core.object.MyWhereCriteria; import com.orange.demo.common.core.base.service.IBaseService;
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
import com.orange.demo.common.core.base.service.BaseService;
import com.orange.demo.common.sequence.wrapper.IdGeneratorWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*; import java.util.*;
/** /**
* 学生数据数据操作服务 * 学生数据数据操作服务接口
* *
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@Service public interface StudentService extends IBaseService<Student, Long> {
public class StudentService extends BaseService<Student, Long> {
@Autowired
private StudentMapper studentMapper;
@Autowired
private ClassStudentMapper classStudentMapper;
@Autowired
private SchoolInfoService schoolInfoService;
@Autowired
private AreaCodeService areaCodeService;
@Autowired
private GradeService gradeService;
@Autowired
private IdGeneratorWrapper idGenerator;
/**
* 返回当前Service的主表Mapper对象。
*
* @return 主表Mapper对象。
*/
@Override
protected BaseDaoMapper<Student> mapper() {
return studentMapper;
}
/** /**
* 保存新增对象。 * 保存新增对象。
@@ -54,22 +20,7 @@ public class StudentService extends BaseService<Student, Long> {
* @param student 新增对象。 * @param student 新增对象。
* @return 返回新增对象。 * @return 返回新增对象。
*/ */
@Transactional(rollbackFor = Exception.class) Student saveNew(Student student);
public Student saveNew(Student student) {
student.setStudentId(idGenerator.nextLongId());
student.setRegisterTime(new Date());
if (student.getTotalCoin() == null) {
student.setTotalCoin(0);
}
if (student.getLeftCoin() == null) {
student.setLeftCoin(0);
}
if (student.getStatus() == null) {
student.setStatus(StudentStatus.NORMAL);
}
studentMapper.insert(student);
return student;
}
/** /**
* 更新数据对象。 * 更新数据对象。
@@ -78,12 +29,7 @@ public class StudentService extends BaseService<Student, Long> {
* @param originalStudent 原有数据对象。 * @param originalStudent 原有数据对象。
* @return 成功返回true否则false。 * @return 成功返回true否则false。
*/ */
@Transactional(rollbackFor = Exception.class) boolean update(Student student, Student originalStudent);
public boolean update(Student student, Student originalStudent) {
student.setRegisterTime(originalStudent.getRegisterTime());
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
return studentMapper.updateByPrimaryKey(student) == 1;
}
/** /**
* 删除指定数据。 * 删除指定数据。
@@ -91,19 +37,7 @@ public class StudentService extends BaseService<Student, Long> {
* @param studentId 主键Id。 * @param studentId 主键Id。
* @return 成功返回true否则false。 * @return 成功返回true否则false。
*/ */
@Transactional(rollbackFor = Exception.class) boolean remove(Long studentId);
public boolean remove(Long studentId) {
// 这里先删除主数据
if (studentMapper.deleteByPrimaryKey(studentId) == 0) {
return false;
}
// 这里可继续删除关联数据。
// 开始删除与本地多对多父表的关联
ClassStudent classStudent = new ClassStudent();
classStudent.setStudentId(studentId);
classStudentMapper.delete(classStudent);
return true;
}
/** /**
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。 * 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
@@ -113,9 +47,7 @@ public class StudentService extends BaseService<Student, Long> {
* @param orderBy 排序参数。 * @param orderBy 排序参数。
* @return 查询结果集。 * @return 查询结果集。
*/ */
public List<Student> getStudentList(Student filter, String orderBy) { List<Student> getStudentList(Student filter, String orderBy);
return studentMapper.getStudentList(null, null, filter, orderBy);
}
/** /**
* 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。 * 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。
@@ -128,11 +60,7 @@ public class StudentService extends BaseService<Student, Long> {
* @param orderBy 排序参数。 * @param orderBy 排序参数。
* @return 查询结果集。 * @return 查询结果集。
*/ */
public <M> List<Student> getStudentList( <M> List<Student> getStudentList(String inFilterField, Set<M> inFilterValues, Student filter, String orderBy);
String inFilterField, Set<M> inFilterValues, Student filter, String orderBy) {
String inFilterColumn = MyModelUtil.mapToColumnName(inFilterField, Student.class);
return studentMapper.getStudentList(inFilterColumn, inFilterValues, filter, orderBy);
}
/** /**
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。 * 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
@@ -142,12 +70,7 @@ public class StudentService extends BaseService<Student, Long> {
* @param orderBy 排序对象。 * @param orderBy 排序对象。
* @return 查询结果集。 * @return 查询结果集。
*/ */
public List<Student> getStudentListWithRelation(Student filter, String orderBy) { List<Student> getStudentListWithRelation(Student filter, String orderBy);
List<Student> resultList = studentMapper.getStudentList(null, null, filter, orderBy);
Map<String, List<MyWhereCriteria>> criteriaMap = buildAggregationAdditionalWhereCriteria();
this.buildRelationForDataList(resultList, MyRelationParam.normal(), criteriaMap);
return resultList;
}
/** /**
* 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。 * 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。
@@ -160,13 +83,8 @@ public class StudentService extends BaseService<Student, Long> {
* @param orderBy 排序对象。 * @param orderBy 排序对象。
* @return 查询结果集。 * @return 查询结果集。
*/ */
public <M> List<Student> getStudentListWithRelation( <M> List<Student> getStudentListWithRelation(
String inFilterField, Set<M> inFilterValues, Student filter, String orderBy) { String inFilterField, Set<M> inFilterValues, Student filter, String orderBy);
List<Student> resultList =
studentMapper.getStudentList(inFilterField, inFilterValues, filter, orderBy);
this.buildRelationForDataList(resultList, MyRelationParam.dictOnly(), null);
return resultList;
}
/** /**
* 在多对多关系中当前Service的数据表为从表返回不与指定主表主键Id存在对多对关系的列表。 * 在多对多关系中当前Service的数据表为从表返回不与指定主表主键Id存在对多对关系的列表。
@@ -176,13 +94,8 @@ public class StudentService extends BaseService<Student, Long> {
* @param orderBy 排序参数。 * @param orderBy 排序参数。
* @return 查询结果集。 * @return 查询结果集。
*/ */
public List<Student> getNotInStudentListByClassId( List<Student> getNotInStudentListByClassId(
Long classId, Student filter, String orderBy) { Long classId, Student filter, String orderBy);
List<Student> resultList =
studentMapper.getNotInStudentListByClassId(classId, filter, orderBy);
this.buildRelationForDataList(resultList, MyRelationParam.dictOnly(), null);
return resultList;
}
/** /**
* 在多对多关系中当前Service的数据表为从表返回与指定主表主键Id存在对多对关系的列表。 * 在多对多关系中当前Service的数据表为从表返回与指定主表主键Id存在对多对关系的列表。
@@ -192,13 +105,8 @@ public class StudentService extends BaseService<Student, Long> {
* @param orderBy 排序参数。 * @param orderBy 排序参数。
* @return 查询结果集。 * @return 查询结果集。
*/ */
public List<Student> getStudentListByClassId( List<Student> getStudentListByClassId(
Long classId, Student filter, String orderBy) { Long classId, Student filter, String orderBy);
List<Student> resultList =
studentMapper.getStudentListByClassId(classId, filter, orderBy);
this.buildRelationForDataList(resultList, MyRelationParam.dictOnly(), null);
return resultList;
}
/** /**
* 根据最新对象和原有对象的数据对比,判断关联的字典数据和多对一主表数据是否都是合法数据。 * 根据最新对象和原有对象的数据对比,判断关联的字典数据和多对一主表数据是否都是合法数据。
@@ -207,28 +115,5 @@ public class StudentService extends BaseService<Student, Long> {
* @param originalStudent 原有数据对象。 * @param originalStudent 原有数据对象。
* @return 数据全部正确返回true否则false同时返回具体的错误信息。 * @return 数据全部正确返回true否则false同时返回具体的错误信息。
*/ */
public CallResult verifyRelatedData(Student student, Student originalStudent) { CallResult verifyRelatedData(Student student, Student originalStudent);
String errorMessageFormat = "数据验证失败,关联的%s并不存在请刷新后重试";
if (this.needToVerify(student, originalStudent, Student::getProvinceId)
&& !areaCodeService.existId(student.getProvinceId())) {
return CallResult.error(String.format(errorMessageFormat, "所在省份"));
}
if (this.needToVerify(student, originalStudent, Student::getCityId)
&& !areaCodeService.existId(student.getCityId())) {
return CallResult.error(String.format(errorMessageFormat, "所在城市"));
}
if (this.needToVerify(student, originalStudent, Student::getDistrictId)
&& !areaCodeService.existId(student.getDistrictId())) {
return CallResult.error(String.format(errorMessageFormat, "所在区县"));
}
if (this.needToVerify(student, originalStudent, Student::getGradeId)
&& !gradeService.existId(student.getGradeId())) {
return CallResult.error(String.format(errorMessageFormat, "年级"));
}
if (this.needToVerify(student, originalStudent, Student::getSchoolId)
&& !schoolInfoService.existId(student.getSchoolId())) {
return CallResult.error(String.format(errorMessageFormat, "所属校区"));
}
return CallResult.ok();
}
} }

View File

@@ -0,0 +1,59 @@
package com.orange.demo.courseclassservice.service.impl;
import com.orange.demo.courseclassservice.service.AreaCodeService;
import com.orange.demo.courseclassservice.dao.AreaCodeMapper;
import com.orange.demo.courseclassservice.model.AreaCode;
import com.orange.demo.common.core.cache.MapTreeDictionaryCache;
import com.orange.demo.common.core.base.service.BaseDictService;
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import java.util.Collection;
import java.util.List;
/**
* 行政区划的Service类。
*
* @author Jerry
* @date 2020-08-08
*/
@Service("areaCodeService")
public class AreaCodeServiceImpl extends BaseDictService<AreaCode, Long> implements AreaCodeService {
@Autowired
private AreaCodeMapper areaCodeMapper;
public AreaCodeServiceImpl() {
super();
this.dictionaryCache = MapTreeDictionaryCache.create(AreaCode::getAreaId, AreaCode::getParentId);
}
@Override
protected BaseDaoMapper<AreaCode> mapper() {
return areaCodeMapper;
}
/**
* 加载数据库数据到内存缓存。
*/
@Override
public void loadCachedData() {
Example e = new Example(AreaCode.class);
e.orderBy("areaLevel");
List<AreaCode> areaCodeList = areaCodeMapper.selectByExample(e);
dictionaryCache.putAll(areaCodeList);
}
/**
* 根据上级行政区划Id获取其下级行政区划列表。
*
* @param parentId 上级行政区划Id。
* @return 下级行政区划列表。
*/
@Override
public Collection<AreaCode> getListByParentId(Long parentId) {
return ((MapTreeDictionaryCache<Long, AreaCode>) dictionaryCache).getListByParentId(parentId);
}
}

View File

@@ -0,0 +1,220 @@
package com.orange.demo.courseclassservice.service.impl;
import com.orange.demo.courseclassservice.service.*;
import com.orange.demo.courseclassservice.dao.*;
import com.orange.demo.courseclassservice.model.*;
import com.orange.demo.common.core.util.*;
import com.orange.demo.common.core.object.MyRelationParam;
import com.orange.demo.common.core.object.CallResult;
import com.orange.demo.common.core.object.TokenData;
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
import com.orange.demo.common.core.base.service.BaseService;
import com.orange.demo.common.sequence.wrapper.IdGeneratorWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
/**
* 课程数据数据操作服务类。
*
* @author Jerry
* @date 2020-08-08
*/
@Service("courseService")
public class CourseServiceImpl extends BaseService<Course, Long> implements CourseService {
@Autowired
private CourseMapper courseMapper;
@Autowired
private ClassCourseMapper classCourseMapper;
@Autowired
private GradeService gradeService;
@Autowired
private IdGeneratorWrapper idGenerator;
/**
* 返回当前Service的主表Mapper对象。
*
* @return 主表Mapper对象。
*/
@Override
protected BaseDaoMapper<Course> mapper() {
return courseMapper;
}
/**
* 保存新增对象。
*
* @param course 新增对象。
* @return 返回新增对象。
*/
@Transactional(rollbackFor = Exception.class)
@Override
public Course saveNew(Course course) {
course.setCourseId(idGenerator.nextLongId());
TokenData tokenData = TokenData.takeFromRequest();
course.setCreateUserId(tokenData.getUserId());
Date now = new Date();
course.setCreateTime(now);
course.setUpdateTime(now);
courseMapper.insert(course);
return course;
}
/**
* 更新数据对象。
*
* @param course 更新的对象。
* @param originalCourse 原有数据对象。
* @return 成功返回true否则false。
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean update(Course course, Course originalCourse) {
course.setCreateUserId(originalCourse.getCreateUserId());
course.setCreateTime(originalCourse.getCreateTime());
course.setUpdateTime(new Date());
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
return courseMapper.updateByPrimaryKey(course) == 1;
}
/**
* 删除指定数据。
*
* @param courseId 主键Id。
* @return 成功返回true否则false。
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean remove(Long courseId) {
// 这里先删除主数据
if (!this.removeById(courseId)) {
return false;
}
// 开始删除与本地多对多父表的关联
ClassCourse classCourse = new ClassCourse();
classCourse.setCourseId(courseId);
classCourseMapper.delete(classCourse);
return true;
}
/**
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
* 如果需要同时获取关联数据,请移步(getCourseListWithRelation)方法。
*
* @param filter 过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
@Override
public List<Course> getCourseList(Course filter, String orderBy) {
return courseMapper.getCourseList(null, null, filter, orderBy);
}
/**
* 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。
* 由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
* 如果需要同时获取关联数据,请移步(getCourseListWithRelation)方法。
*
* @param inFilterField (In-list)指定的字段(Java成员字段而非数据列名)。
* @param inFilterValues inFilterField指定字段的(In-list)数据列表。
* @param filter 过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
@Override
public <M> List<Course> getCourseList(
String inFilterField, Set<M> inFilterValues, Course filter, String orderBy) {
String inFilterColumn = MyModelUtil.mapToColumnName(inFilterField, Course.class);
return courseMapper.getCourseList(inFilterColumn, inFilterValues, filter, orderBy);
}
/**
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
* 该查询会涉及到一对一从表的关联过滤,或一对多从表的嵌套关联过滤,因此性能不如单表过滤。
* 如果仅仅需要获取主表数据,请移步(getCourseList),以便获取更好的查询性能。
*
* @param filter 主表过滤对象。
* @param orderBy 排序对象。
* @return 查询结果集。
*/
@Override
public List<Course> getCourseListWithRelation(Course filter, String orderBy) {
List<Course> resultList = courseMapper.getCourseList(null, null, filter, orderBy);
this.buildRelationForDataList(resultList, MyRelationParam.normal());
return resultList;
}
/**
* 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。
* 同时还包含主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
* 如果仅仅需要获取主表数据,请移步(getCourseList),以便获取更好的查询性能。
*
* @param inFilterField (In-list)指定的字段(Java成员字段而非数据列名)。
* @param inFilterValues inFilterField指定字段的(In-list)数据列表。
* @param filter 主表过滤对象。
* @param orderBy 排序对象。
* @return 查询结果集。
*/
@Override
public <M> List<Course> getCourseListWithRelation(
String inFilterField, Set<M> inFilterValues, Course filter, String orderBy) {
List<Course> resultList =
courseMapper.getCourseList(inFilterField, inFilterValues, filter, orderBy);
this.buildRelationForDataList(resultList, MyRelationParam.dictOnly());
return resultList;
}
/**
* 在多对多关系中当前Service的数据表为从表返回不与指定主表主键Id存在对多对关系的列表。
*
* @param classId 主表的关联键Id。
* @param filter 从表的过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
@Override
public List<Course> getNotInCourseListByClassId(
Long classId, Course filter, String orderBy) {
List<Course> resultList =
courseMapper.getNotInCourseListByClassId(classId, filter, orderBy);
this.buildRelationForDataList(resultList, MyRelationParam.dictOnly());
return resultList;
}
/**
* 在多对多关系中当前Service的数据表为从表返回与指定主表主键Id存在对多对关系的列表。
*
* @param classId 主表的关联键Id。
* @param filter 从表的过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
@Override
public List<Course> getCourseListByClassId(
Long classId, Course filter, String orderBy) {
List<Course> resultList =
courseMapper.getCourseListByClassId(classId, filter, orderBy);
this.buildRelationForDataList(resultList, MyRelationParam.dictOnly());
return resultList;
}
/**
* 根据最新对象和原有对象的数据对比,判断关联的字典数据和多对一主表数据是否都是合法数据。
*
* @param course 最新数据对象。
* @param originalCourse 原有数据对象。
* @return 数据全部正确返回true否则false同时返回具体的错误信息。
*/
@Override
public CallResult verifyRelatedData(Course course, Course originalCourse) {
String errorMessageFormat = "数据验证失败,关联的%s并不存在请刷新后重试";
if (this.needToVerify(course, originalCourse, Course::getGradeId)
&& !gradeService.existId(course.getGradeId())) {
return CallResult.error(String.format(errorMessageFormat, "所属年级"));
}
return CallResult.ok();
}
}

View File

@@ -0,0 +1,48 @@
package com.orange.demo.courseclassservice.service.impl;
import com.orange.demo.common.redis.cache.RedisDictionaryCache;
import com.orange.demo.common.core.base.service.BaseDictService;
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
import com.orange.demo.courseclassservice.service.GradeService;
import com.orange.demo.courseclassservice.dao.GradeMapper;
import com.orange.demo.courseclassservice.model.Grade;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
/**
* 年级字典数据操作服务类。
*
* @author Jerry
* @date 2020-08-08
*/
@Service("gradeService")
public class GradeServiceImpl extends BaseDictService<Grade, Integer> implements GradeService {
@Autowired
private GradeMapper gradeMapper;
@Autowired
private RedissonClient redissonClient;
public GradeServiceImpl() {
super();
}
@PostConstruct
public void init() {
this.dictionaryCache = RedisDictionaryCache.create(
redissonClient, "Grade", Grade.class, Grade::getGradeId);
}
/**
* 返回当前Service的主表Mapper对象。
*
* @return 主表Mapper对象。
*/
@Override
protected BaseDaoMapper<Grade> mapper() {
return gradeMapper;
}
}

View File

@@ -0,0 +1,172 @@
package com.orange.demo.courseclassservice.service.impl;
import com.orange.demo.courseclassservice.service.*;
import com.orange.demo.courseclassservice.dao.*;
import com.orange.demo.courseclassservice.model.*;
import com.orange.demo.common.core.util.*;
import com.orange.demo.common.core.object.MyRelationParam;
import com.orange.demo.common.core.object.CallResult;
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
import com.orange.demo.common.core.base.service.BaseService;
import com.orange.demo.common.sequence.wrapper.IdGeneratorWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
/**
* 校区数据数据操作服务类。
*
* @author Jerry
* @date 2020-08-08
*/
@Service("schoolInfoService")
public class SchoolInfoServiceImpl extends BaseService<SchoolInfo, Long> implements SchoolInfoService {
@Autowired
private SchoolInfoMapper schoolInfoMapper;
@Autowired
private AreaCodeService areaCodeService;
@Autowired
private IdGeneratorWrapper idGenerator;
/**
* 返回当前Service的主表Mapper对象。
*
* @return 主表Mapper对象。
*/
@Override
protected BaseDaoMapper<SchoolInfo> mapper() {
return schoolInfoMapper;
}
/**
* 保存新增对象。
*
* @param schoolInfo 新增对象。
* @return 返回新增对象。
*/
@Transactional(rollbackFor = Exception.class)
@Override
public SchoolInfo saveNew(SchoolInfo schoolInfo) {
schoolInfo.setSchoolId(idGenerator.nextLongId());
schoolInfoMapper.insert(schoolInfo);
return schoolInfo;
}
/**
* 更新数据对象。
*
* @param schoolInfo 更新的对象。
* @param originalSchoolInfo 原有数据对象。
* @return 成功返回true否则false。
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean update(SchoolInfo schoolInfo, SchoolInfo originalSchoolInfo) {
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
return schoolInfoMapper.updateByPrimaryKey(schoolInfo) == 1;
}
/**
* 删除指定数据。
*
* @param schoolId 主键Id。
* @return 成功返回true否则false。
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean remove(Long schoolId) {
// 这里先删除主数据
return this.removeById(schoolId);
}
/**
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
* 如果需要同时获取关联数据,请移步(getSchoolInfoListWithRelation)方法。
*
* @param filter 过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
@Override
public List<SchoolInfo> getSchoolInfoList(SchoolInfo filter, String orderBy) {
return schoolInfoMapper.getSchoolInfoList(null, null, filter, orderBy);
}
/**
* 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。
* 由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
* 如果需要同时获取关联数据,请移步(getSchoolInfoListWithRelation)方法。
*
* @param inFilterField (In-list)指定的字段(Java成员字段而非数据列名)。
* @param inFilterValues inFilterField指定字段的(In-list)数据列表。
* @param filter 过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
@Override
public <M> List<SchoolInfo> getSchoolInfoList(
String inFilterField, Set<M> inFilterValues, SchoolInfo filter, String orderBy) {
String inFilterColumn = MyModelUtil.mapToColumnName(inFilterField, SchoolInfo.class);
return schoolInfoMapper.getSchoolInfoList(inFilterColumn, inFilterValues, filter, orderBy);
}
/**
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
* 该查询会涉及到一对一从表的关联过滤,或一对多从表的嵌套关联过滤,因此性能不如单表过滤。
* 如果仅仅需要获取主表数据,请移步(getSchoolInfoList),以便获取更好的查询性能。
*
* @param filter 主表过滤对象。
* @param orderBy 排序对象。
* @return 查询结果集。
*/
@Override
public List<SchoolInfo> getSchoolInfoListWithRelation(SchoolInfo filter, String orderBy) {
List<SchoolInfo> resultList = schoolInfoMapper.getSchoolInfoList(null, null, filter, orderBy);
this.buildRelationForDataList(resultList, MyRelationParam.normal());
return resultList;
}
/**
* 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。
* 同时还包含主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
* 如果仅仅需要获取主表数据,请移步(getSchoolInfoList),以便获取更好的查询性能。
*
* @param inFilterField (In-list)指定的字段(Java成员字段而非数据列名)。
* @param inFilterValues inFilterField指定字段的(In-list)数据列表。
* @param filter 主表过滤对象。
* @param orderBy 排序对象。
* @return 查询结果集。
*/
@Override
public <M> List<SchoolInfo> getSchoolInfoListWithRelation(
String inFilterField, Set<M> inFilterValues, SchoolInfo filter, String orderBy) {
List<SchoolInfo> resultList =
schoolInfoMapper.getSchoolInfoList(inFilterField, inFilterValues, filter, orderBy);
this.buildRelationForDataList(resultList, MyRelationParam.dictOnly());
return resultList;
}
/**
* 根据最新对象和原有对象的数据对比,判断关联的字典数据和多对一主表数据是否都是合法数据。
*
* @param schoolInfo 最新数据对象。
* @param originalSchoolInfo 原有数据对象。
* @return 数据全部正确返回true否则false同时返回具体的错误信息。
*/
@Override
public CallResult verifyRelatedData(SchoolInfo schoolInfo, SchoolInfo originalSchoolInfo) {
String errorMessageFormat = "数据验证失败,关联的%s并不存在请刷新后重试";
if (this.needToVerify(schoolInfo, originalSchoolInfo, SchoolInfo::getProvinceId)
&& !areaCodeService.existId(schoolInfo.getProvinceId())) {
return CallResult.error(String.format(errorMessageFormat, "所在省份"));
}
if (this.needToVerify(schoolInfo, originalSchoolInfo, SchoolInfo::getCityId)
&& !areaCodeService.existId(schoolInfo.getCityId())) {
return CallResult.error(String.format(errorMessageFormat, "所在城市"));
}
return CallResult.ok();
}
}

View File

@@ -0,0 +1,293 @@
package com.orange.demo.courseclassservice.service.impl;
import com.orange.demo.courseclassservice.service.*;
import com.orange.demo.courseclassservice.dao.*;
import com.orange.demo.courseclassservice.model.*;
import com.orange.demo.common.core.util.*;
import com.orange.demo.common.core.object.MyRelationParam;
import com.orange.demo.common.core.object.CallResult;
import com.orange.demo.common.core.object.TokenData;
import com.orange.demo.common.core.constant.GlobalDeletedFlag;
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
import com.orange.demo.common.core.base.service.BaseService;
import com.orange.demo.common.sequence.wrapper.IdGeneratorWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import java.util.*;
/**
* 班级数据数据操作服务类。
*
* @author Jerry
* @date 2020-08-08
*/
@Service("studentClassService")
public class StudentClassServiceImpl extends BaseService<StudentClass, Long> implements StudentClassService {
@Autowired
private StudentClassMapper studentClassMapper;
@Autowired
private ClassCourseMapper classCourseMapper;
@Autowired
private ClassStudentMapper classStudentMapper;
@Autowired
private SchoolInfoService schoolInfoService;
@Autowired
private StudentService studentService;
@Autowired
private IdGeneratorWrapper idGenerator;
/**
* 返回当前Service的主表Mapper对象。
*
* @return 主表Mapper对象。
*/
@Override
protected BaseDaoMapper<StudentClass> mapper() {
return studentClassMapper;
}
/**
* 保存新增对象。
*
* @param studentClass 新增对象。
* @return 返回新增对象。
*/
@Transactional(rollbackFor = Exception.class)
@Override
public StudentClass saveNew(StudentClass studentClass) {
studentClass.setClassId(idGenerator.nextLongId());
TokenData tokenData = TokenData.takeFromRequest();
studentClass.setCreateUserId(tokenData.getUserId());
studentClass.setCreateTime(new Date());
studentClass.setStatus(GlobalDeletedFlag.NORMAL);
studentClassMapper.insert(studentClass);
return studentClass;
}
/**
* 更新数据对象。
*
* @param studentClass 更新的对象。
* @param originalStudentClass 原有数据对象。
* @return 成功返回true否则false。
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean update(StudentClass studentClass, StudentClass originalStudentClass) {
studentClass.setCreateUserId(originalStudentClass.getCreateUserId());
studentClass.setCreateTime(originalStudentClass.getCreateTime());
studentClass.setStatus(GlobalDeletedFlag.NORMAL);
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
return studentClassMapper.updateByPrimaryKey(studentClass) == 1;
}
/**
* 删除指定数据。
*
* @param classId 主键Id。
* @return 成功返回true否则false。
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean remove(Long classId) {
// 这里先删除主数据
if (!this.removeById(classId)) {
return false;
}
// 开始删除多对多中间表的关联
ClassCourse classCourse = new ClassCourse();
classCourse.setClassId(classId);
classCourseMapper.delete(classCourse);
ClassStudent classStudent = new ClassStudent();
classStudent.setClassId(classId);
classStudentMapper.delete(classStudent);
return true;
}
/**
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
* 如果需要同时获取关联数据,请移步(getStudentClassListWithRelation)方法。
*
* @param filter 过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
@Override
public List<StudentClass> getStudentClassList(StudentClass filter, String orderBy) {
return studentClassMapper.getStudentClassList(null, null, filter, orderBy);
}
/**
* 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。
* 由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
* 如果需要同时获取关联数据,请移步(getStudentClassListWithRelation)方法。
*
* @param inFilterField (In-list)指定的字段(Java成员字段而非数据列名)。
* @param inFilterValues inFilterField指定字段的(In-list)数据列表。
* @param filter 过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
@Override
public <M> List<StudentClass> getStudentClassList(
String inFilterField, Set<M> inFilterValues, StudentClass filter, String orderBy) {
String inFilterColumn = MyModelUtil.mapToColumnName(inFilterField, StudentClass.class);
return studentClassMapper.getStudentClassList(inFilterColumn, inFilterValues, filter, orderBy);
}
/**
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
* 该查询会涉及到一对一从表的关联过滤,或一对多从表的嵌套关联过滤,因此性能不如单表过滤。
* 如果仅仅需要获取主表数据,请移步(getStudentClassList),以便获取更好的查询性能。
*
* @param filter 主表过滤对象。
* @param orderBy 排序对象。
* @return 查询结果集。
*/
@Override
public List<StudentClass> getStudentClassListWithRelation(StudentClass filter, String orderBy) {
List<StudentClass> resultList = studentClassMapper.getStudentClassList(null, null, filter, orderBy);
this.buildRelationForDataList(resultList, MyRelationParam.normal());
return resultList;
}
/**
* 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。
* 同时还包含主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
* 如果仅仅需要获取主表数据,请移步(getStudentClassList),以便获取更好的查询性能。
*
* @param inFilterField (In-list)指定的字段(Java成员字段而非数据列名)。
* @param inFilterValues inFilterField指定字段的(In-list)数据列表。
* @param filter 主表过滤对象。
* @param orderBy 排序对象。
* @return 查询结果集。
*/
@Override
public <M> List<StudentClass> getStudentClassListWithRelation(
String inFilterField, Set<M> inFilterValues, StudentClass filter, String orderBy) {
List<StudentClass> resultList =
studentClassMapper.getStudentClassList(inFilterField, inFilterValues, filter, orderBy);
this.buildRelationForDataList(resultList, MyRelationParam.dictOnly());
return resultList;
}
/**
* 批量添加多对多关联关系。
*
* @param classCourseList 多对多关联表对象集合。
* @param classId 主表Id。
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void addClassCourseList(List<ClassCourse> classCourseList, Long classId) {
for (ClassCourse classCourse : classCourseList) {
classCourse.setClassId(classId);
MyModelUtil.setDefaultValue(classCourse, "courseOrder", 0);
}
classCourseMapper.insertList(classCourseList);
}
/**
* 更新中间表数据。
*
* @param classCourse 中间表对象。
* @return 更新成功与否。
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateClassCourse(ClassCourse classCourse) {
Example e = new Example(ClassCourse.class);
e.createCriteria()
.andEqualTo("classId", classCourse.getClassId())
.andEqualTo("courseId", classCourse.getCourseId());
return classCourseMapper.updateByExample(classCourse, e) > 0;
}
/**
* 获取中间表数据。
*
* @param classId 主表Id。
* @param courseId 从表Id。
* @return 中间表对象。
*/
@Override
public ClassCourse getClassCourse(Long classId, Long courseId) {
Example e = new Example(ClassCourse.class);
e.createCriteria()
.andEqualTo("classId", classId)
.andEqualTo("courseId", courseId);
return classCourseMapper.selectOneByExample(e);
}
/**
* 移除单条多对多关系。
*
* @param classId 主表Id。
* @param courseId 从表Id。
* @return 成功返回true否则false。
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean removeClassCourse(Long classId, Long courseId) {
ClassCourse filter = new ClassCourse();
filter.setClassId(classId);
filter.setCourseId(courseId);
return classCourseMapper.delete(filter) > 0;
}
/**
* 批量添加多对多关联关系。
*
* @param classStudentList 多对多关联表对象集合。
* @param classId 主表Id。
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void addClassStudentList(List<ClassStudent> classStudentList, Long classId) {
for (ClassStudent classStudent : classStudentList) {
classStudent.setClassId(classId);
}
classStudentMapper.insertList(classStudentList);
}
/**
* 移除单条多对多关系。
*
* @param classId 主表Id。
* @param studentId 从表Id。
* @return 成功返回true否则false。
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean removeClassStudent(Long classId, Long studentId) {
ClassStudent filter = new ClassStudent();
filter.setClassId(classId);
filter.setStudentId(studentId);
return classStudentMapper.delete(filter) > 0;
}
/**
* 根据最新对象和原有对象的数据对比,判断关联的字典数据和多对一主表数据是否都是合法数据。
*
* @param studentClass 最新数据对象。
* @param originalStudentClass 原有数据对象。
* @return 数据全部正确返回true否则false同时返回具体的错误信息。
*/
@Override
public CallResult verifyRelatedData(StudentClass studentClass, StudentClass originalStudentClass) {
String errorMessageFormat = "数据验证失败,关联的%s并不存在请刷新后重试";
if (this.needToVerify(studentClass, originalStudentClass, StudentClass::getSchoolId)
&& !schoolInfoService.existId(studentClass.getSchoolId())) {
return CallResult.error(String.format(errorMessageFormat, "所属校区"));
}
if (this.needToVerify(studentClass, originalStudentClass, StudentClass::getLeaderId)
&& !studentService.existId(studentClass.getLeaderId())) {
return CallResult.error(String.format(errorMessageFormat, "班长"));
}
return CallResult.ok();
}
}

View File

@@ -0,0 +1,237 @@
package com.orange.demo.courseclassservice.service.impl;
import com.orange.demo.application.common.constant.StudentStatus;
import com.orange.demo.courseclassservice.service.*;
import com.orange.demo.courseclassservice.dao.*;
import com.orange.demo.courseclassservice.model.*;
import com.orange.demo.common.core.util.*;
import com.orange.demo.common.core.object.MyRelationParam;
import com.orange.demo.common.core.object.CallResult;
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
import com.orange.demo.common.core.base.service.BaseService;
import com.orange.demo.common.sequence.wrapper.IdGeneratorWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
/**
* 学生数据数据操作服务类。
*
* @author Jerry
* @date 2020-08-08
*/
@Service("studentService")
public class StudentServiceImpl extends BaseService<Student, Long> implements StudentService {
@Autowired
private StudentMapper studentMapper;
@Autowired
private ClassStudentMapper classStudentMapper;
@Autowired
private SchoolInfoService schoolInfoService;
@Autowired
private AreaCodeService areaCodeService;
@Autowired
private GradeService gradeService;
@Autowired
private IdGeneratorWrapper idGenerator;
/**
* 返回当前Service的主表Mapper对象。
*
* @return 主表Mapper对象。
*/
@Override
protected BaseDaoMapper<Student> mapper() {
return studentMapper;
}
/**
* 保存新增对象。
*
* @param student 新增对象。
* @return 返回新增对象。
*/
@Transactional(rollbackFor = Exception.class)
@Override
public Student saveNew(Student student) {
student.setStudentId(idGenerator.nextLongId());
student.setRegisterTime(new Date());
MyModelUtil.setDefaultValue(student, "totalCoin", 0);
MyModelUtil.setDefaultValue(student, "leftCoin", 0);
MyModelUtil.setDefaultValue(student, "status", StudentStatus.NORMAL);
studentMapper.insert(student);
return student;
}
/**
* 更新数据对象。
*
* @param student 更新的对象。
* @param originalStudent 原有数据对象。
* @return 成功返回true否则false。
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean update(Student student, Student originalStudent) {
student.setRegisterTime(originalStudent.getRegisterTime());
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
return studentMapper.updateByPrimaryKey(student) == 1;
}
/**
* 删除指定数据。
*
* @param studentId 主键Id。
* @return 成功返回true否则false。
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean remove(Long studentId) {
// 这里先删除主数据
if (!this.removeById(studentId)) {
return false;
}
// 开始删除与本地多对多父表的关联
ClassStudent classStudent = new ClassStudent();
classStudent.setStudentId(studentId);
classStudentMapper.delete(classStudent);
return true;
}
/**
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
* 如果需要同时获取关联数据,请移步(getStudentListWithRelation)方法。
*
* @param filter 过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
@Override
public List<Student> getStudentList(Student filter, String orderBy) {
return studentMapper.getStudentList(null, null, filter, orderBy);
}
/**
* 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。
* 由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
* 如果需要同时获取关联数据,请移步(getStudentListWithRelation)方法。
*
* @param inFilterField (In-list)指定的字段(Java成员字段而非数据列名)。
* @param inFilterValues inFilterField指定字段的(In-list)数据列表。
* @param filter 过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
@Override
public <M> List<Student> getStudentList(
String inFilterField, Set<M> inFilterValues, Student filter, String orderBy) {
String inFilterColumn = MyModelUtil.mapToColumnName(inFilterField, Student.class);
return studentMapper.getStudentList(inFilterColumn, inFilterValues, filter, orderBy);
}
/**
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
* 该查询会涉及到一对一从表的关联过滤,或一对多从表的嵌套关联过滤,因此性能不如单表过滤。
* 如果仅仅需要获取主表数据,请移步(getStudentList),以便获取更好的查询性能。
*
* @param filter 主表过滤对象。
* @param orderBy 排序对象。
* @return 查询结果集。
*/
@Override
public List<Student> getStudentListWithRelation(Student filter, String orderBy) {
List<Student> resultList = studentMapper.getStudentList(null, null, filter, orderBy);
this.buildRelationForDataList(resultList, MyRelationParam.normal());
return resultList;
}
/**
* 获取主表的查询结果,查询条件中包括主表过滤对象和指定字段的(in list)过滤。
* 同时还包含主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
* 如果仅仅需要获取主表数据,请移步(getStudentList),以便获取更好的查询性能。
*
* @param inFilterField (In-list)指定的字段(Java成员字段而非数据列名)。
* @param inFilterValues inFilterField指定字段的(In-list)数据列表。
* @param filter 主表过滤对象。
* @param orderBy 排序对象。
* @return 查询结果集。
*/
@Override
public <M> List<Student> getStudentListWithRelation(
String inFilterField, Set<M> inFilterValues, Student filter, String orderBy) {
List<Student> resultList =
studentMapper.getStudentList(inFilterField, inFilterValues, filter, orderBy);
this.buildRelationForDataList(resultList, MyRelationParam.dictOnly());
return resultList;
}
/**
* 在多对多关系中当前Service的数据表为从表返回不与指定主表主键Id存在对多对关系的列表。
*
* @param classId 主表的关联键Id。
* @param filter 从表的过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
@Override
public List<Student> getNotInStudentListByClassId(
Long classId, Student filter, String orderBy) {
List<Student> resultList =
studentMapper.getNotInStudentListByClassId(classId, filter, orderBy);
this.buildRelationForDataList(resultList, MyRelationParam.dictOnly());
return resultList;
}
/**
* 在多对多关系中当前Service的数据表为从表返回与指定主表主键Id存在对多对关系的列表。
*
* @param classId 主表的关联键Id。
* @param filter 从表的过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
@Override
public List<Student> getStudentListByClassId(
Long classId, Student filter, String orderBy) {
List<Student> resultList =
studentMapper.getStudentListByClassId(classId, filter, orderBy);
this.buildRelationForDataList(resultList, MyRelationParam.dictOnly());
return resultList;
}
/**
* 根据最新对象和原有对象的数据对比,判断关联的字典数据和多对一主表数据是否都是合法数据。
*
* @param student 最新数据对象。
* @param originalStudent 原有数据对象。
* @return 数据全部正确返回true否则false同时返回具体的错误信息。
*/
@Override
public CallResult verifyRelatedData(Student student, Student originalStudent) {
String errorMessageFormat = "数据验证失败,关联的%s并不存在请刷新后重试";
if (this.needToVerify(student, originalStudent, Student::getProvinceId)
&& !areaCodeService.existId(student.getProvinceId())) {
return CallResult.error(String.format(errorMessageFormat, "所在省份"));
}
if (this.needToVerify(student, originalStudent, Student::getCityId)
&& !areaCodeService.existId(student.getCityId())) {
return CallResult.error(String.format(errorMessageFormat, "所在城市"));
}
if (this.needToVerify(student, originalStudent, Student::getDistrictId)
&& !areaCodeService.existId(student.getDistrictId())) {
return CallResult.error(String.format(errorMessageFormat, "所在区县"));
}
if (this.needToVerify(student, originalStudent, Student::getGradeId)
&& !gradeService.existId(student.getGradeId())) {
return CallResult.error(String.format(errorMessageFormat, "年级"));
}
if (this.needToVerify(student, originalStudent, Student::getSchoolId)
&& !schoolInfoService.existId(student.getSchoolId())) {
return CallResult.error(String.format(errorMessageFormat, "所属校区"));
}
return CallResult.ok();
}
}

View File

@@ -59,6 +59,9 @@
<Root level="${OUTPUT_LOG_LEVEL}"> <Root level="${OUTPUT_LOG_LEVEL}">
<AppenderRef ref="console"/> <AppenderRef ref="console"/>
</Root> </Root>
<Logger name="springfox.documentation" additivity="false" level="error">
<AppenderRef ref="console"/>
</Logger>
<!-- AsyncLogger 是基于Disruptor的全量异步队列性能极高队列默认大小4096。--> <!-- AsyncLogger 是基于Disruptor的全量异步队列性能极高队列默认大小4096。-->
<!-- 队列默认值可通过JVM参数设置参考博客https://www.jianshu.com/p/82469047acbf --> <!-- 队列默认值可通过JVM参数设置参考博客https://www.jianshu.com/p/82469047acbf -->
<AsyncLogger name="com.orange.demo" additivity="false" level="info"> <AsyncLogger name="com.orange.demo" additivity="false" level="info">

View File

@@ -15,6 +15,31 @@
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-ui:2.0.5" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.20" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:28.2-android" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
<orderEntry type="library" name="Maven: org.checkerframework:checker-compat-qual:2.5.5" level="project" />
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.3.4" level="project" />
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.21" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.10.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:2.9.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-gateway:2.2.2.RELEASE" level="project" /> <orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-gateway:2.2.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter:2.2.2.RELEASE" level="project" /> <orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter:2.2.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-rsa:1.0.9.RELEASE" level="project" /> <orderEntry type="library" name="Maven: org.springframework.security:spring-security-rsa:1.0.9.RELEASE" level="project" />
@@ -39,7 +64,6 @@
<orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" /> <orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.18.Final" level="project" /> <orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.18.Final" level="project" />
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.1.Final" level="project" /> <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.1.Final" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webflux:5.2.4.RELEASE" level="project" /> <orderEntry type="library" name="Maven: org.springframework:spring-webflux:5.2.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.synchronoss.cloud:nio-multipart-parser:1.1.0" level="project" /> <orderEntry type="library" name="Maven: org.synchronoss.cloud:nio-multipart-parser:1.1.0" level="project" />
<orderEntry type="library" name="Maven: org.synchronoss.cloud:nio-stream-storage:1.1.3" level="project" /> <orderEntry type="library" name="Maven: org.synchronoss.cloud:nio-stream-storage:1.1.3" level="project" />
@@ -72,13 +96,6 @@
<orderEntry type="library" name="Maven: org.jodd:jodd-bean:5.0.13" level="project" /> <orderEntry type="library" name="Maven: org.jodd:jodd-bean:5.0.13" level="project" />
<orderEntry type="library" name="Maven: org.jodd:jodd-core:5.0.13" level="project" /> <orderEntry type="library" name="Maven: org.jodd:jodd-core:5.0.13" level="project" />
<orderEntry type="module" module-name="common-core" /> <orderEntry type="module" module-name="common-core" />
<orderEntry type="library" name="Maven: com.google.guava:guava:28.2-android" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
<orderEntry type="library" name="Maven: org.checkerframework:checker-compat-qual:2.5.5" level="project" />
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.3.4" level="project" />
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.9" level="project" /> <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.9" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.13" level="project" /> <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.13" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.6" level="project" /> <orderEntry type="library" name="Maven: commons-io:commons-io:2.6" level="project" />
@@ -116,12 +133,12 @@
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring:1.1.5" level="project" /> <orderEntry type="library" name="Maven: tk.mybatis:mapper-spring:1.1.5" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-extra:1.1.5" level="project" /> <orderEntry type="library" name="Maven: tk.mybatis:mapper-extra:1.1.5" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-autoconfigure:2.1.5" level="project" /> <orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-autoconfigure:2.1.5" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.2.13" level="project" /> <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.3.0" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.1" level="project" /> <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.3" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.1" level="project" /> <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.3" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.2.13" level="project" /> <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.3.0" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.1.11" level="project" /> <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.2.0" level="project" />
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:2.0" level="project" /> <orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:3.2" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery:2.2.1.RELEASE" level="project" /> <orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery:2.2.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-client:1.2.1" level="project" /> <orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-client:1.2.1" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-common:1.2.1" level="project" /> <orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-common:1.2.1" level="project" />
@@ -165,7 +182,6 @@
<orderEntry type="library" name="Maven: com.alibaba.csp:sentinel-cluster-client-default:1.7.1" level="project" /> <orderEntry type="library" name="Maven: com.alibaba.csp:sentinel-cluster-client-default:1.7.1" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-alibaba-sentinel-datasource:2.2.1.RELEASE" level="project" /> <orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-alibaba-sentinel-datasource:2.2.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.10.2" level="project" /> <orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.10.2" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.10.2" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.10.2" level="project" /> <orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.10.2" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:4.2" level="project" /> <orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:4.2" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.woodstox:woodstox-core:5.0.3" level="project" /> <orderEntry type="library" name="Maven: com.fasterxml.woodstox:woodstox-core:5.0.3" level="project" />
@@ -178,9 +194,6 @@
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" /> <orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
<orderEntry type="library" name="Maven: org.freemarker:freemarker:2.3.29" level="project" /> <orderEntry type="library" name="Maven: org.freemarker:freemarker:2.3.29" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.2.4.RELEASE" level="project" /> <orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.2.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:4.0.1" level="project" /> <orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:4.0.1" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-log4j2:2.2.5.RELEASE" level="project" /> <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-log4j2:2.2.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-slf4j-impl:2.12.1" level="project" /> <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-slf4j-impl:2.12.1" level="project" />
@@ -241,7 +254,6 @@
<orderEntry type="library" name="Maven: com.github.luben:zstd-jni:1.4.3-1" level="project" /> <orderEntry type="library" name="Maven: com.github.luben:zstd-jni:1.4.3-1" level="project" />
<orderEntry type="library" name="Maven: org.lz4:lz4-java:1.6.0" level="project" /> <orderEntry type="library" name="Maven: org.lz4:lz4-java:1.6.0" level="project" />
<orderEntry type="library" name="Maven: org.xerial.snappy:snappy-java:1.1.7.3" level="project" /> <orderEntry type="library" name="Maven: org.xerial.snappy:snappy-java:1.1.7.3" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
<orderEntry type="library" name="Maven: org.scala-lang:scala-library:2.12.10" level="project" /> <orderEntry type="library" name="Maven: org.scala-lang:scala-library:2.12.10" level="project" />
<orderEntry type="library" name="Maven: com.lmax:disruptor:3.4.2" level="project" /> <orderEntry type="library" name="Maven: com.lmax:disruptor:3.4.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.2.5.RELEASE" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.2.5.RELEASE" level="project" />

View File

@@ -14,6 +14,33 @@
<packaging>jar</packaging> <packaging>jar</packaging>
<dependencies> <dependencies>
<!-- swagger和knife4j相关集成-->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-ui</artifactId>
<version>${knife4j.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox.version}</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-bean-validators</artifactId>
<version>${springfox.version}</version>
</dependency>
<!-- 网关服务 --> <!-- 网关服务 -->
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>

View File

@@ -0,0 +1,52 @@
package com.orange.demo.gateway.config;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.gateway.config.GatewayProperties;
import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.support.NameUtils;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
import springfox.documentation.swagger.web.SwaggerResource;
import springfox.documentation.swagger.web.SwaggerResourcesProvider;
import java.util.ArrayList;
import java.util.List;
/***
* 返回Swagger UI需要读取的资源数据这里是微服务的路由数据。
*
* @author Knife4j Team。
* @date 2020-08-08
*/
@Slf4j
@Component
@Primary
@AllArgsConstructor
public class SwaggerResourceConfig implements SwaggerResourcesProvider {
private final RouteLocator routeLocator;
private final GatewayProperties gatewayProperties;
@Override
public List<SwaggerResource> get() {
List<SwaggerResource> resources = new ArrayList<>();
List<String> routes = new ArrayList<>();
routeLocator.getRoutes().subscribe(route -> routes.add(route.getId()));
gatewayProperties.getRoutes().stream().filter(routeDefinition -> routes.contains(routeDefinition.getId()))
.forEach(route -> route.getPredicates().stream()
.filter(predicateDefinition -> ("Path").equalsIgnoreCase(predicateDefinition.getName()))
.forEach(predicateDefinition -> resources.add(swaggerResource(route.getId(),
predicateDefinition.getArgs().get(NameUtils.GENERATED_NAME_PREFIX + "0")
.replace("**", "v2/api-docs")))));
return resources;
}
private SwaggerResource swaggerResource(String name, String location) {
SwaggerResource swaggerResource = new SwaggerResource();
swaggerResource.setName(name);
swaggerResource.setLocation(location);
swaggerResource.setSwaggerVersion("2.0");
return swaggerResource;
}
}

View File

@@ -50,7 +50,7 @@ public class AuthenticationPreFilter implements GlobalFilter, Ordered {
/** /**
* Ant Pattern模式的白名单地址匹配器。 * Ant Pattern模式的白名单地址匹配器。
*/ */
private AntPathMatcher antMatcher = new AntPathMatcher(); private final AntPathMatcher antMatcher = new AntPathMatcher();
@Override @Override
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) { public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
@@ -148,6 +148,10 @@ public class AuthenticationPreFilter implements GlobalFilter, Ordered {
* @return 是返回true否则false。 * @return 是返回true否则false。
*/ */
private boolean shouldNotFilter(String url) { private boolean shouldNotFilter(String url) {
// 这里过滤和swagger相关的url
if (url.endsWith("/v2/api-docs") || url.endsWith("/v2/api-docs-ext")) {
return true;
}
if (url.equals(GatewayConstant.ADMIN_LOGIN_URL)) { if (url.equals(GatewayConstant.ADMIN_LOGIN_URL)) {
return true; return true;
} }

View File

@@ -0,0 +1,53 @@
package com.orange.demo.gateway.handler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;
import springfox.documentation.swagger.web.*;
import java.util.Optional;
/**
* Swagger的资源请求处理器。
*
* @author Knife4j Team。
* @date 2020-08-08
*/
@RestController
public class SwaggerHandler {
@Autowired(required = false)
private SecurityConfiguration securityConfiguration;
@Autowired(required = false)
private UiConfiguration uiConfiguration;
private final SwaggerResourcesProvider swaggerResources;
@Autowired
public SwaggerHandler(SwaggerResourcesProvider swaggerResources) {
this.swaggerResources = swaggerResources;
}
@GetMapping("/swagger-resources/configuration/security")
public Mono<ResponseEntity<SecurityConfiguration>> securityConfiguration() {
return Mono.just(new ResponseEntity<>(
Optional.ofNullable(securityConfiguration)
.orElse(SecurityConfigurationBuilder.builder().build()), HttpStatus.OK));
}
@GetMapping("/swagger-resources/configuration/ui")
public Mono<ResponseEntity<UiConfiguration>> uiConfiguration() {
return Mono.just(new ResponseEntity<>(
Optional.ofNullable(uiConfiguration)
.orElse(UiConfigurationBuilder.builder().build()), HttpStatus.OK));
}
@GetMapping("/swagger-resources")
public Mono<ResponseEntity> swaggerResources() {
return Mono.just((new ResponseEntity<>(swaggerResources.get(), HttpStatus.OK)));
}
}

View File

@@ -59,6 +59,9 @@
<Root level="${OUTPUT_LOG_LEVEL}"> <Root level="${OUTPUT_LOG_LEVEL}">
<AppenderRef ref="console"/> <AppenderRef ref="console"/>
</Root> </Root>
<Logger name="springfox.documentation" additivity="false" level="error">
<AppenderRef ref="console"/>
</Logger>
<!-- AsyncLogger 是基于Disruptor的全量异步队列性能极高队列默认大小4096。--> <!-- AsyncLogger 是基于Disruptor的全量异步队列性能极高队列默认大小4096。-->
<!-- 队列默认值可通过JVM参数设置参考博客https://www.jianshu.com/p/82469047acbf --> <!-- 队列默认值可通过JVM参数设置参考博客https://www.jianshu.com/p/82469047acbf -->
<AsyncLogger name="com.orange.demo" additivity="false" level="info"> <AsyncLogger name="com.orange.demo" additivity="false" level="info">

View File

@@ -26,5 +26,11 @@
<artifactId>common-core</artifactId> <artifactId>common-core</artifactId>
<version>1.0.0</version> <version>1.0.0</version>
</dependency> </dependency>
<!-- knife4j 接口文档框架 -->
<dependency>
<groupId>com.orange.demo</groupId>
<artifactId>common-swagger</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -4,6 +4,8 @@ import com.orange.demo.common.core.validator.UpdateGroup;
import com.orange.demo.common.core.validator.ConstDictRef; import com.orange.demo.common.core.validator.ConstDictRef;
import com.orange.demo.application.common.constant.Subject; import com.orange.demo.application.common.constant.Subject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.*; import javax.validation.constraints.*;
@@ -16,24 +18,28 @@ import java.util.Date;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("CourseTransStatsDto对象")
@Data @Data
public class CourseTransStatsDto { public class CourseTransStatsDto {
/** /**
* 主键Id。 * 主键Id。
*/ */
@ApiModelProperty(value = "主键Id", required = true)
@NotNull(message = "数据验证失败主键Id不能为空", groups = {UpdateGroup.class}) @NotNull(message = "数据验证失败主键Id不能为空", groups = {UpdateGroup.class})
private Long statsId; private Long statsId;
/** /**
* 统计日期。 * 统计日期。
*/ */
@ApiModelProperty(value = "统计日期", required = true)
@NotNull(message = "数据验证失败,统计日期不能为空!") @NotNull(message = "数据验证失败,统计日期不能为空!")
private Date statsDate; private Date statsDate;
/** /**
* 科目Id。 * 科目Id。
*/ */
@ApiModelProperty(value = "科目Id", required = true)
@NotNull(message = "数据验证失败,所属科目不能为空!") @NotNull(message = "数据验证失败,所属科目不能为空!")
@ConstDictRef(constDictClass = Subject.class, message = "数据验证失败,所属科目为无效值!") @ConstDictRef(constDictClass = Subject.class, message = "数据验证失败,所属科目为无效值!")
private Integer subjectId; private Integer subjectId;
@@ -41,50 +47,59 @@ public class CourseTransStatsDto {
/** /**
* 年级Id。 * 年级Id。
*/ */
@ApiModelProperty(value = "年级Id", required = true)
@NotNull(message = "数据验证失败,所属年级不能为空!") @NotNull(message = "数据验证失败,所属年级不能为空!")
private Integer gradeId; private Integer gradeId;
/** /**
* 年级名称。 * 年级名称。
*/ */
@ApiModelProperty(value = "年级名称")
private String gradeName; private String gradeName;
/** /**
* 课程Id。 * 课程Id。
*/ */
@ApiModelProperty(value = "课程Id", required = true)
@NotNull(message = "数据验证失败课程ID不能为空") @NotNull(message = "数据验证失败课程ID不能为空")
private Long courseId; private Long courseId;
/** /**
* 课程名称。 * 课程名称。
*/ */
@ApiModelProperty(value = "课程名称")
private String courseName; private String courseName;
/** /**
* 学生上课次数。 * 学生上课次数。
*/ */
@ApiModelProperty(value = "学生上课次数", required = true)
@NotNull(message = "数据验证失败,上课次数不能为空!") @NotNull(message = "数据验证失败,上课次数不能为空!")
private Integer studentAttendCount; private Integer studentAttendCount;
/** /**
* 学生献花数量。 * 学生献花数量。
*/ */
@ApiModelProperty(value = "学生献花数量", required = true)
@NotNull(message = "数据验证失败,献花数量不能为空!") @NotNull(message = "数据验证失败,献花数量不能为空!")
private Integer studentFlowerAmount; private Integer studentFlowerAmount;
/** /**
* 学生献花次数。 * 学生献花次数。
*/ */
@ApiModelProperty(value = "学生献花次数", required = true)
@NotNull(message = "数据验证失败,献花次数不能为空!") @NotNull(message = "数据验证失败,献花次数不能为空!")
private Integer studentFlowerCount; private Integer studentFlowerCount;
/** /**
* statsDate 范围过滤起始值(>=)。 * statsDate 范围过滤起始值(>=)。
*/ */
@ApiModelProperty(value = "statsDate 范围过滤起始值(>=)")
private String statsDateStart; private String statsDateStart;
/** /**
* statsDate 范围过滤结束值(<=)。 * statsDate 范围过滤结束值(<=)。
*/ */
@ApiModelProperty(value = "statsDate 范围过滤结束值(<=)")
private String statsDateEnd; private String statsDateEnd;
} }

View File

@@ -2,6 +2,8 @@ package com.orange.demo.statsinterface.dto;
import com.orange.demo.common.core.validator.UpdateGroup; import com.orange.demo.common.core.validator.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.*; import javax.validation.constraints.*;
@@ -14,141 +16,165 @@ import java.util.Date;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("StudentActionStatsDto对象")
@Data @Data
public class StudentActionStatsDto { public class StudentActionStatsDto {
/** /**
* 主键Id。 * 主键Id。
*/ */
@ApiModelProperty(value = "主键Id", required = true)
@NotNull(message = "数据验证失败主键Id不能为空", groups = {UpdateGroup.class}) @NotNull(message = "数据验证失败主键Id不能为空", groups = {UpdateGroup.class})
private Long statsId; private Long statsId;
/** /**
* 统计日期。 * 统计日期。
*/ */
@ApiModelProperty(value = "统计日期", required = true)
@NotNull(message = "数据验证失败,统计日期不能为空!") @NotNull(message = "数据验证失败,统计日期不能为空!")
private Date statsDate; private Date statsDate;
/** /**
* 统计小时。 * 统计小时。
*/ */
@ApiModelProperty(value = "统计小时")
private Date statsMonth; private Date statsMonth;
/** /**
* 年级Id。 * 年级Id。
*/ */
@ApiModelProperty(value = "年级Id", required = true)
@NotNull(message = "数据验证失败,所属年级不能为空!") @NotNull(message = "数据验证失败,所属年级不能为空!")
private Integer gradeId; private Integer gradeId;
/** /**
* 学生所在省Id。 * 学生所在省Id。
*/ */
@ApiModelProperty(value = "学生所在省Id", required = true)
@NotNull(message = "数据验证失败,所在省份不能为空!") @NotNull(message = "数据验证失败,所在省份不能为空!")
private Long provinceId; private Long provinceId;
/** /**
* 学生所在城市Id。 * 学生所在城市Id。
*/ */
@ApiModelProperty(value = "学生所在城市Id", required = true)
@NotNull(message = "数据验证失败,所在城市不能为空!") @NotNull(message = "数据验证失败,所在城市不能为空!")
private Long cityId; private Long cityId;
/** /**
* 购课学币数量。 * 购课学币数量。
*/ */
@ApiModelProperty(value = "购课学币数量", required = true)
@NotNull(message = "数据验证失败,购课学币数量不能为空!") @NotNull(message = "数据验证失败,购课学币数量不能为空!")
private Integer buyCourseAmount; private Integer buyCourseAmount;
/** /**
* 购买课程次数。 * 购买课程次数。
*/ */
@ApiModelProperty(value = "购买课程次数", required = true)
@NotNull(message = "数据验证失败,购买课程次数不能为空!") @NotNull(message = "数据验证失败,购买课程次数不能为空!")
private Integer buyCourseCount; private Integer buyCourseCount;
/** /**
* 购买视频学币数量。 * 购买视频学币数量。
*/ */
@ApiModelProperty(value = "购买视频学币数量", required = true)
@NotNull(message = "数据验证失败,购买视频学币数量不能为空!") @NotNull(message = "数据验证失败,购买视频学币数量不能为空!")
private Integer buyVideoAmount; private Integer buyVideoAmount;
/** /**
* 购买视频次数。 * 购买视频次数。
*/ */
@ApiModelProperty(value = "购买视频次数", required = true)
@NotNull(message = "数据验证失败,购买视频次数不能为空!") @NotNull(message = "数据验证失败,购买视频次数不能为空!")
private Integer buyVideoCount; private Integer buyVideoCount;
/** /**
* 购买作业学币数量。 * 购买作业学币数量。
*/ */
@ApiModelProperty(value = "购买作业学币数量", required = true)
@NotNull(message = "数据验证失败,购买作业学币数量不能为空!") @NotNull(message = "数据验证失败,购买作业学币数量不能为空!")
private Integer buyPaperAmount; private Integer buyPaperAmount;
/** /**
* 购买作业次数。 * 购买作业次数。
*/ */
@ApiModelProperty(value = "购买作业次数", required = true)
@NotNull(message = "数据验证失败,购买作业次数不能为空!") @NotNull(message = "数据验证失败,购买作业次数不能为空!")
private Integer buyPaperCount; private Integer buyPaperCount;
/** /**
* 购买献花数量。 * 购买献花数量。
*/ */
@ApiModelProperty(value = "购买献花数量", required = true)
@NotNull(message = "数据验证失败,购买献花数量不能为空!") @NotNull(message = "数据验证失败,购买献花数量不能为空!")
private Integer buyFlowerAmount; private Integer buyFlowerAmount;
/** /**
* 购买献花次数。 * 购买献花次数。
*/ */
@ApiModelProperty(value = "购买献花次数", required = true)
@NotNull(message = "数据验证失败,购买献花次数不能为空!") @NotNull(message = "数据验证失败,购买献花次数不能为空!")
private Integer buyFlowerCount; private Integer buyFlowerCount;
/** /**
* 充值学币数量。 * 充值学币数量。
*/ */
@ApiModelProperty(value = "充值学币数量", required = true)
@NotNull(message = "数据验证失败,充值学币数量不能为空!") @NotNull(message = "数据验证失败,充值学币数量不能为空!")
private Integer rechargeCoinAmount; private Integer rechargeCoinAmount;
/** /**
* 充值学币次数。 * 充值学币次数。
*/ */
@ApiModelProperty(value = "充值学币次数", required = true)
@NotNull(message = "数据验证失败,充值学币次数不能为空!") @NotNull(message = "数据验证失败,充值学币次数不能为空!")
private Integer rechargeCoinCount; private Integer rechargeCoinCount;
/** /**
* 线下课程上课次数。 * 线下课程上课次数。
*/ */
@ApiModelProperty(value = "线下课程上课次数", required = true)
@NotNull(message = "数据验证失败,线下课程上课次数不能为空!") @NotNull(message = "数据验证失败,线下课程上课次数不能为空!")
private Integer doCourseCount; private Integer doCourseCount;
/** /**
* 观看视频次数。 * 观看视频次数。
*/ */
@ApiModelProperty(value = "观看视频次数", required = true)
@NotNull(message = "数据验证失败,观看视频次数不能为空!") @NotNull(message = "数据验证失败,观看视频次数不能为空!")
private Integer watchVideoCount; private Integer watchVideoCount;
/** /**
* 购买献花消费学币数量。 * 购买献花消费学币数量。
*/ */
@ApiModelProperty(value = "购买献花消费学币数量", required = true)
@NotNull(message = "数据验证失败,购买献花消费学币数量不能为空!") @NotNull(message = "数据验证失败,购买献花消费学币数量不能为空!")
private Integer watchVideoTotalSecond; private Integer watchVideoTotalSecond;
/** /**
* 做题数量。 * 做题数量。
*/ */
@ApiModelProperty(value = "做题数量", required = true)
@NotNull(message = "数据验证失败,做题数量不能为空!") @NotNull(message = "数据验证失败,做题数量不能为空!")
private Integer doExerciseCount; private Integer doExerciseCount;
/** /**
* 做题正确的数量。 * 做题正确的数量。
*/ */
@ApiModelProperty(value = "做题正确的数量", required = true)
@NotNull(message = "数据验证失败,做题正确的数量不能为空!") @NotNull(message = "数据验证失败,做题正确的数量不能为空!")
private Integer doExerciseCorrectCount; private Integer doExerciseCorrectCount;
/** /**
* statsDate 范围过滤起始值(>=)。 * statsDate 范围过滤起始值(>=)。
*/ */
@ApiModelProperty(value = "statsDate 范围过滤起始值(>=)")
private String statsDateStart; private String statsDateStart;
/** /**
* statsDate 范围过滤结束值(<=)。 * statsDate 范围过滤结束值(<=)。
*/ */
@ApiModelProperty(value = "statsDate 范围过滤结束值(<=)")
private String statsDateEnd; private String statsDateEnd;
} }

View File

@@ -5,6 +5,8 @@ import com.orange.demo.common.core.validator.ConstDictRef;
import com.orange.demo.application.common.constant.StudentActionType; import com.orange.demo.application.common.constant.StudentActionType;
import com.orange.demo.application.common.constant.DeviceType; import com.orange.demo.application.common.constant.DeviceType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.*; import javax.validation.constraints.*;
@@ -17,42 +19,49 @@ import java.util.Date;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("StudentActionTransDto对象")
@Data @Data
public class StudentActionTransDto { public class StudentActionTransDto {
/** /**
* 主键Id。 * 主键Id。
*/ */
@ApiModelProperty(value = "主键Id", required = true)
@NotNull(message = "数据验证失败主键Id不能为空", groups = {UpdateGroup.class}) @NotNull(message = "数据验证失败主键Id不能为空", groups = {UpdateGroup.class})
private Long transId; private Long transId;
/** /**
* 学生Id。 * 学生Id。
*/ */
@ApiModelProperty(value = "学生Id", required = true)
@NotNull(message = "数据验证失败学生Id不能为空") @NotNull(message = "数据验证失败学生Id不能为空")
private Long studentId; private Long studentId;
/** /**
* 学生名称。 * 学生名称。
*/ */
@ApiModelProperty(value = "学生名称", required = true)
@NotBlank(message = "数据验证失败,学生名称不能为空!") @NotBlank(message = "数据验证失败,学生名称不能为空!")
private String studentName; private String studentName;
/** /**
* 学生校区。 * 学生校区。
*/ */
@ApiModelProperty(value = "学生校区", required = true)
@NotNull(message = "数据验证失败,学生校区不能为空!") @NotNull(message = "数据验证失败,学生校区不能为空!")
private Long schoolId; private Long schoolId;
/** /**
* 年级Id。 * 年级Id。
*/ */
@ApiModelProperty(value = "年级Id", required = true)
@NotNull(message = "数据验证失败,所属年级不能为空!") @NotNull(message = "数据验证失败,所属年级不能为空!")
private Integer gradeId; private Integer gradeId;
/** /**
* 行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)。 * 行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)。
*/ */
@ApiModelProperty(value = "行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)", required = true)
@NotNull(message = "数据验证失败,行为类型不能为空!") @NotNull(message = "数据验证失败,行为类型不能为空!")
@ConstDictRef(constDictClass = StudentActionType.class, message = "数据验证失败,行为类型为无效值!") @ConstDictRef(constDictClass = StudentActionType.class, message = "数据验证失败,行为类型为无效值!")
private Integer actionType; private Integer actionType;
@@ -60,6 +69,7 @@ public class StudentActionTransDto {
/** /**
* 设备类型(0: iOS 1: Android 2: PC)。 * 设备类型(0: iOS 1: Android 2: PC)。
*/ */
@ApiModelProperty(value = "设备类型(0: iOS 1: Android 2: PC)", required = true)
@NotNull(message = "数据验证失败,设备类型不能为空!") @NotNull(message = "数据验证失败,设备类型不能为空!")
@ConstDictRef(constDictClass = DeviceType.class, message = "数据验证失败,设备类型为无效值!") @ConstDictRef(constDictClass = DeviceType.class, message = "数据验证失败,设备类型为无效值!")
private Integer deviceType; private Integer deviceType;
@@ -67,51 +77,61 @@ public class StudentActionTransDto {
/** /**
* 看视频秒数。 * 看视频秒数。
*/ */
@ApiModelProperty(value = "看视频秒数")
private Integer watchVideoSeconds; private Integer watchVideoSeconds;
/** /**
* 购买献花数量。 * 购买献花数量。
*/ */
@ApiModelProperty(value = "购买献花数量")
private Integer flowerCount; private Integer flowerCount;
/** /**
* 购买作业数量。 * 购买作业数量。
*/ */
@ApiModelProperty(value = "购买作业数量")
private Integer paperCount; private Integer paperCount;
/** /**
* 购买视频数量。 * 购买视频数量。
*/ */
@ApiModelProperty(value = "购买视频数量")
private Integer videoCount; private Integer videoCount;
/** /**
* 购买课程数量。 * 购买课程数量。
*/ */
@ApiModelProperty(value = "购买课程数量")
private Integer courseCount; private Integer courseCount;
/** /**
* 充值学币数量。 * 充值学币数量。
*/ */
@ApiModelProperty(value = "充值学币数量")
private Integer coinCount; private Integer coinCount;
/** /**
* 做题是否正确标记。 * 做题是否正确标记。
*/ */
@ApiModelProperty(value = "做题是否正确标记")
private Integer exerciseCorrectFlag; private Integer exerciseCorrectFlag;
/** /**
* 发生时间。 * 发生时间。
*/ */
@ApiModelProperty(value = "发生时间", required = true)
@NotNull(message = "数据验证失败,发生时间不能为空!") @NotNull(message = "数据验证失败,发生时间不能为空!")
private Date createTime; private Date createTime;
/** /**
* createTime 范围过滤起始值(>=)。 * createTime 范围过滤起始值(>=)。
*/ */
@ApiModelProperty(value = "createTime 范围过滤起始值(>=)")
private String createTimeStart; private String createTimeStart;
/** /**
* createTime 范围过滤结束值(<=)。 * createTime 范围过滤结束值(<=)。
*/ */
@ApiModelProperty(value = "createTime 范围过滤结束值(<=)")
private String createTimeEnd; private String createTimeEnd;
} }

View File

@@ -1,5 +1,7 @@
package com.orange.demo.statsinterface.vo; package com.orange.demo.statsinterface.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
@@ -11,71 +13,85 @@ import java.util.Map;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("CourseTransStatsVO实体对象")
@Data @Data
public class CourseTransStatsVo { public class CourseTransStatsVo {
/** /**
* 主键Id。 * 主键Id。
*/ */
@ApiModelProperty(value = "主键Id")
private Long statsId; private Long statsId;
/** /**
* 统计日期。 * 统计日期。
*/ */
@ApiModelProperty(value = "统计日期")
private Date statsDate; private Date statsDate;
/** /**
* 科目Id。 * 科目Id。
*/ */
@ApiModelProperty(value = "科目Id")
private Integer subjectId; private Integer subjectId;
/** /**
* 年级Id。 * 年级Id。
*/ */
@ApiModelProperty(value = "年级Id")
private Integer gradeId; private Integer gradeId;
/** /**
* 年级名称。 * 年级名称。
*/ */
@ApiModelProperty(value = "年级名称")
private String gradeName; private String gradeName;
/** /**
* 课程Id。 * 课程Id。
*/ */
@ApiModelProperty(value = "课程Id")
private Long courseId; private Long courseId;
/** /**
* 课程名称。 * 课程名称。
*/ */
@ApiModelProperty(value = "课程名称")
private String courseName; private String courseName;
/** /**
* 学生上课次数。 * 学生上课次数。
*/ */
@ApiModelProperty(value = "学生上课次数")
private Integer studentAttendCount; private Integer studentAttendCount;
/** /**
* 学生献花数量。 * 学生献花数量。
*/ */
@ApiModelProperty(value = "学生献花数量")
private Integer studentFlowerAmount; private Integer studentFlowerAmount;
/** /**
* 学生献花次数。 * 学生献花次数。
*/ */
@ApiModelProperty(value = "学生献花次数")
private Integer studentFlowerCount; private Integer studentFlowerCount;
/** /**
* gradeId 字典关联数据。 * gradeId 字典关联数据。
*/ */
@ApiModelProperty(value = "gradeId 字典关联数据")
private Map<String, Object> gradeIdDictMap; private Map<String, Object> gradeIdDictMap;
/** /**
* courseId 字典关联数据。 * courseId 字典关联数据。
*/ */
@ApiModelProperty(value = "courseId 字典关联数据")
private Map<String, Object> courseIdDictMap; private Map<String, Object> courseIdDictMap;
/** /**
* subjectId 常量字典关联数据。 * subjectId 常量字典关联数据。
*/ */
@ApiModelProperty(value = "subjectId 常量字典关联数据")
private Map<String, Object> subjectIdDictMap; private Map<String, Object> subjectIdDictMap;
} }

View File

@@ -1,5 +1,7 @@
package com.orange.demo.statsinterface.vo; package com.orange.demo.statsinterface.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
@@ -11,126 +13,151 @@ import java.util.Map;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("StudentActionStatsVO实体对象")
@Data @Data
public class StudentActionStatsVo { public class StudentActionStatsVo {
/** /**
* 主键Id。 * 主键Id。
*/ */
@ApiModelProperty(value = "主键Id")
private Long statsId; private Long statsId;
/** /**
* 统计日期。 * 统计日期。
*/ */
@ApiModelProperty(value = "统计日期")
private Date statsDate; private Date statsDate;
/** /**
* 统计小时。 * 统计小时。
*/ */
@ApiModelProperty(value = "统计小时")
private Date statsMonth; private Date statsMonth;
/** /**
* 年级Id。 * 年级Id。
*/ */
@ApiModelProperty(value = "年级Id")
private Integer gradeId; private Integer gradeId;
/** /**
* 学生所在省Id。 * 学生所在省Id。
*/ */
@ApiModelProperty(value = "学生所在省Id")
private Long provinceId; private Long provinceId;
/** /**
* 学生所在城市Id。 * 学生所在城市Id。
*/ */
@ApiModelProperty(value = "学生所在城市Id")
private Long cityId; private Long cityId;
/** /**
* 购课学币数量。 * 购课学币数量。
*/ */
@ApiModelProperty(value = "购课学币数量")
private Integer buyCourseAmount; private Integer buyCourseAmount;
/** /**
* 购买课程次数。 * 购买课程次数。
*/ */
@ApiModelProperty(value = "购买课程次数")
private Integer buyCourseCount; private Integer buyCourseCount;
/** /**
* 购买视频学币数量。 * 购买视频学币数量。
*/ */
@ApiModelProperty(value = "购买视频学币数量")
private Integer buyVideoAmount; private Integer buyVideoAmount;
/** /**
* 购买视频次数。 * 购买视频次数。
*/ */
@ApiModelProperty(value = "购买视频次数")
private Integer buyVideoCount; private Integer buyVideoCount;
/** /**
* 购买作业学币数量。 * 购买作业学币数量。
*/ */
@ApiModelProperty(value = "购买作业学币数量")
private Integer buyPaperAmount; private Integer buyPaperAmount;
/** /**
* 购买作业次数。 * 购买作业次数。
*/ */
@ApiModelProperty(value = "购买作业次数")
private Integer buyPaperCount; private Integer buyPaperCount;
/** /**
* 购买献花数量。 * 购买献花数量。
*/ */
@ApiModelProperty(value = "购买献花数量")
private Integer buyFlowerAmount; private Integer buyFlowerAmount;
/** /**
* 购买献花次数。 * 购买献花次数。
*/ */
@ApiModelProperty(value = "购买献花次数")
private Integer buyFlowerCount; private Integer buyFlowerCount;
/** /**
* 充值学币数量。 * 充值学币数量。
*/ */
@ApiModelProperty(value = "充值学币数量")
private Integer rechargeCoinAmount; private Integer rechargeCoinAmount;
/** /**
* 充值学币次数。 * 充值学币次数。
*/ */
@ApiModelProperty(value = "充值学币次数")
private Integer rechargeCoinCount; private Integer rechargeCoinCount;
/** /**
* 线下课程上课次数。 * 线下课程上课次数。
*/ */
@ApiModelProperty(value = "线下课程上课次数")
private Integer doCourseCount; private Integer doCourseCount;
/** /**
* 观看视频次数。 * 观看视频次数。
*/ */
@ApiModelProperty(value = "观看视频次数")
private Integer watchVideoCount; private Integer watchVideoCount;
/** /**
* 购买献花消费学币数量。 * 购买献花消费学币数量。
*/ */
@ApiModelProperty(value = "购买献花消费学币数量")
private Integer watchVideoTotalSecond; private Integer watchVideoTotalSecond;
/** /**
* 做题数量。 * 做题数量。
*/ */
@ApiModelProperty(value = "做题数量")
private Integer doExerciseCount; private Integer doExerciseCount;
/** /**
* 做题正确的数量。 * 做题正确的数量。
*/ */
@ApiModelProperty(value = "做题正确的数量")
private Integer doExerciseCorrectCount; private Integer doExerciseCorrectCount;
/** /**
* gradeId 字典关联数据。 * gradeId 字典关联数据。
*/ */
@ApiModelProperty(value = "gradeId 字典关联数据")
private Map<String, Object> gradeIdDictMap; private Map<String, Object> gradeIdDictMap;
/** /**
* provinceId 字典关联数据。 * provinceId 字典关联数据。
*/ */
@ApiModelProperty(value = "provinceId 字典关联数据")
private Map<String, Object> provinceIdDictMap; private Map<String, Object> provinceIdDictMap;
/** /**
* cityId 字典关联数据。 * cityId 字典关联数据。
*/ */
@ApiModelProperty(value = "cityId 字典关联数据")
private Map<String, Object> cityIdDictMap; private Map<String, Object> cityIdDictMap;
} }

View File

@@ -1,5 +1,7 @@
package com.orange.demo.statsinterface.vo; package com.orange.demo.statsinterface.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
@@ -11,101 +13,121 @@ import java.util.Map;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@ApiModel("StudentActionTransVO实体对象")
@Data @Data
public class StudentActionTransVo { public class StudentActionTransVo {
/** /**
* 主键Id。 * 主键Id。
*/ */
@ApiModelProperty(value = "主键Id")
private Long transId; private Long transId;
/** /**
* 学生Id。 * 学生Id。
*/ */
@ApiModelProperty(value = "学生Id")
private Long studentId; private Long studentId;
/** /**
* 学生名称。 * 学生名称。
*/ */
@ApiModelProperty(value = "学生名称")
private String studentName; private String studentName;
/** /**
* 学生校区。 * 学生校区。
*/ */
@ApiModelProperty(value = "学生校区")
private Long schoolId; private Long schoolId;
/** /**
* 年级Id。 * 年级Id。
*/ */
@ApiModelProperty(value = "年级Id")
private Integer gradeId; private Integer gradeId;
/** /**
* 行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)。 * 行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)。
*/ */
@ApiModelProperty(value = "行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)")
private Integer actionType; private Integer actionType;
/** /**
* 设备类型(0: iOS 1: Android 2: PC)。 * 设备类型(0: iOS 1: Android 2: PC)。
*/ */
@ApiModelProperty(value = "设备类型(0: iOS 1: Android 2: PC)")
private Integer deviceType; private Integer deviceType;
/** /**
* 看视频秒数。 * 看视频秒数。
*/ */
@ApiModelProperty(value = "看视频秒数")
private Integer watchVideoSeconds; private Integer watchVideoSeconds;
/** /**
* 购买献花数量。 * 购买献花数量。
*/ */
@ApiModelProperty(value = "购买献花数量")
private Integer flowerCount; private Integer flowerCount;
/** /**
* 购买作业数量。 * 购买作业数量。
*/ */
@ApiModelProperty(value = "购买作业数量")
private Integer paperCount; private Integer paperCount;
/** /**
* 购买视频数量。 * 购买视频数量。
*/ */
@ApiModelProperty(value = "购买视频数量")
private Integer videoCount; private Integer videoCount;
/** /**
* 购买课程数量。 * 购买课程数量。
*/ */
@ApiModelProperty(value = "购买课程数量")
private Integer courseCount; private Integer courseCount;
/** /**
* 充值学币数量。 * 充值学币数量。
*/ */
@ApiModelProperty(value = "充值学币数量")
private Integer coinCount; private Integer coinCount;
/** /**
* 做题是否正确标记。 * 做题是否正确标记。
*/ */
@ApiModelProperty(value = "做题是否正确标记")
private Integer exerciseCorrectFlag; private Integer exerciseCorrectFlag;
/** /**
* 发生时间。 * 发生时间。
*/ */
@ApiModelProperty(value = "发生时间")
private Date createTime; private Date createTime;
/** /**
* schoolId 字典关联数据。 * schoolId 字典关联数据。
*/ */
@ApiModelProperty(value = "schoolId 字典关联数据")
private Map<String, Object> schoolIdDictMap; private Map<String, Object> schoolIdDictMap;
/** /**
* gradeId 字典关联数据。 * gradeId 字典关联数据。
*/ */
@ApiModelProperty(value = "gradeId 字典关联数据")
private Map<String, Object> gradeIdDictMap; private Map<String, Object> gradeIdDictMap;
/** /**
* actionType 常量字典关联数据。 * actionType 常量字典关联数据。
*/ */
@ApiModelProperty(value = "actionType 常量字典关联数据")
private Map<String, Object> actionTypeDictMap; private Map<String, Object> actionTypeDictMap;
/** /**
* deviceType 常量字典关联数据。 * deviceType 常量字典关联数据。
*/ */
@ApiModelProperty(value = "deviceType 常量字典关联数据")
private Map<String, Object> deviceTypeDictMap; private Map<String, Object> deviceTypeDictMap;
} }

View File

@@ -85,12 +85,30 @@
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring:1.1.5" level="project" /> <orderEntry type="library" name="Maven: tk.mybatis:mapper-spring:1.1.5" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-extra:1.1.5" level="project" /> <orderEntry type="library" name="Maven: tk.mybatis:mapper-extra:1.1.5" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-autoconfigure:2.1.5" level="project" /> <orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-autoconfigure:2.1.5" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.2.13" level="project" /> <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.3.0" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.1" level="project" /> <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.3" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.1" level="project" /> <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.3" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.2.13" level="project" /> <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.3.0" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.1.11" level="project" /> <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.2.0" level="project" />
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:2.0" level="project" /> <orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:3.2" level="project" />
<orderEntry type="module" module-name="common-swagger" />
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-micro-spring-boot-starter:2.0.5" level="project" />
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-autoconfigure:2.0.5" level="project" />
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring:2.0.5" level="project" />
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-annotations:2.0.5" level="project" />
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-core:2.0.5" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.25.0-GA" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.22" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.22" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:2.9.2" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery:2.2.1.RELEASE" level="project" /> <orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery:2.2.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-client:1.2.1" level="project" /> <orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-client:1.2.1" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-common:1.2.1" level="project" /> <orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-common:1.2.1" level="project" />
@@ -247,7 +265,7 @@
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.13.2" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.13.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest:2.1" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest:2.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:3.1.0" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:3.1.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy:1.10.8" level="project" /> <orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.8" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.10.8" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.10.8" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" />

View File

@@ -9,8 +9,9 @@ import com.orange.demo.common.core.object.*;
import com.orange.demo.common.core.util.*; import com.orange.demo.common.core.util.*;
import com.orange.demo.common.core.constant.*; import com.orange.demo.common.core.constant.*;
import com.orange.demo.common.core.base.controller.BaseController; import com.orange.demo.common.core.base.controller.BaseController;
import com.orange.demo.common.core.base.service.BaseService; import com.orange.demo.common.core.base.service.IBaseService;
import com.orange.demo.common.core.annotation.MyRequestBody; import com.orange.demo.common.core.annotation.MyRequestBody;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -23,6 +24,7 @@ import java.util.*;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@Api(tags = "课程统计管理接口")
@Slf4j @Slf4j
@RestController @RestController
@RequestMapping("/courseTransStats") @RequestMapping("/courseTransStats")
@@ -32,7 +34,7 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
private CourseTransStatsService courseTransStatsService; private CourseTransStatsService courseTransStatsService;
@Override @Override
protected BaseService<CourseTransStats, Long> service() { protected IBaseService<CourseTransStats, Long> service() {
return courseTransStatsService; return courseTransStatsService;
} }
@@ -118,6 +120,7 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
* @param withDict 是否包含字典关联。 * @param withDict 是否包含字典关联。
* @return 应答结果对象,包含主对象集合。 * @return 应答结果对象,包含主对象集合。
*/ */
@ApiOperation(hidden = true, value = "listByIds")
@PostMapping("/listByIds") @PostMapping("/listByIds")
public ResponseResult<List<CourseTransStatsVo>> listByIds( public ResponseResult<List<CourseTransStatsVo>> listByIds(
@RequestParam Set<Long> statsIds, @RequestParam Boolean withDict) { @RequestParam Set<Long> statsIds, @RequestParam Boolean withDict) {
@@ -131,6 +134,7 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
* @param withDict 是否包含字典关联。 * @param withDict 是否包含字典关联。
* @return 应答结果对象,包含主对象数据。 * @return 应答结果对象,包含主对象数据。
*/ */
@ApiOperation(hidden = true, value = "getById")
@PostMapping("/getById") @PostMapping("/getById")
public ResponseResult<CourseTransStatsVo> getById( public ResponseResult<CourseTransStatsVo> getById(
@RequestParam Long statsId, @RequestParam Boolean withDict) { @RequestParam Long statsId, @RequestParam Boolean withDict) {
@@ -143,6 +147,7 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
* @param statsIds 主键Id集合。 * @param statsIds 主键Id集合。
* @return 应答结果对象包含true全部存在否则false。 * @return 应答结果对象包含true全部存在否则false。
*/ */
@ApiOperation(hidden = true, value = "existIds")
@PostMapping("/existIds") @PostMapping("/existIds")
public ResponseResult<Boolean> existIds(@RequestParam Set<Long> statsIds) { public ResponseResult<Boolean> existIds(@RequestParam Set<Long> statsIds) {
return super.baseExistIds(statsIds); return super.baseExistIds(statsIds);
@@ -154,6 +159,7 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
* @param statsId 主键Id。 * @param statsId 主键Id。
* @return 应答结果对象包含true表示存在否则false。 * @return 应答结果对象包含true表示存在否则false。
*/ */
@ApiOperation(hidden = true, value = "existId")
@PostMapping("/existId") @PostMapping("/existId")
public ResponseResult<Boolean> existId(@RequestParam Long statsId) { public ResponseResult<Boolean> existId(@RequestParam Long statsId) {
return super.baseExistId(statsId); return super.baseExistId(statsId);
@@ -165,6 +171,7 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
* @param filter 过滤对象。 * @param filter 过滤对象。
* @return 删除数量。 * @return 删除数量。
*/ */
@ApiOperation(hidden = true, value = "deleteBy")
@PostMapping("/deleteBy") @PostMapping("/deleteBy")
public ResponseResult<Integer> deleteBy(@RequestBody CourseTransStatsDto filter) throws Exception { public ResponseResult<Integer> deleteBy(@RequestBody CourseTransStatsDto filter) throws Exception {
return super.baseDeleteBy(MyModelUtil.copyTo(filter, CourseTransStats.class)); return super.baseDeleteBy(MyModelUtil.copyTo(filter, CourseTransStats.class));
@@ -176,6 +183,7 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。 * @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。
*/ */
@ApiOperation(hidden = true, value = "listBy")
@PostMapping("/listBy") @PostMapping("/listBy")
public ResponseResult<MyPageData<CourseTransStatsVo>> listBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<MyPageData<CourseTransStatsVo>> listBy(@RequestBody MyQueryParam queryParam) {
return super.baseListBy(queryParam, CourseTransStats.INSTANCE); return super.baseListBy(queryParam, CourseTransStats.INSTANCE);
@@ -187,6 +195,7 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。 * @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。
*/ */
@ApiOperation(hidden = true, value = "listMapBy")
@PostMapping("/listMapBy") @PostMapping("/listMapBy")
public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
return super.baseListMapBy(queryParam, CourseTransStats.INSTANCE); return super.baseListMapBy(queryParam, CourseTransStats.INSTANCE);
@@ -198,6 +207,7 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。 * @return 应答结果对象,包含符合查询过滤条件的对象结果集。
*/ */
@ApiOperation(hidden = true, value = "getBy")
@PostMapping("/getBy") @PostMapping("/getBy")
public ResponseResult<CourseTransStatsVo> getBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<CourseTransStatsVo> getBy(@RequestBody MyQueryParam queryParam) {
return super.baseGetBy(queryParam, CourseTransStats.INSTANCE); return super.baseGetBy(queryParam, CourseTransStats.INSTANCE);
@@ -209,6 +219,7 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 应答结果对象,包含结果数量。 * @return 应答结果对象,包含结果数量。
*/ */
@ApiOperation(hidden = true, value = "countBy")
@PostMapping("/countBy") @PostMapping("/countBy")
public ResponseResult<Integer> countBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<Integer> countBy(@RequestBody MyQueryParam queryParam) {
return super.baseCountBy(queryParam); return super.baseCountBy(queryParam);
@@ -220,6 +231,7 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
* @param aggregationParam 聚合参数。 * @param aggregationParam 聚合参数。
* @return 应该结果对象包含聚合计算后的分组Map列表。 * @return 应该结果对象包含聚合计算后的分组Map列表。
*/ */
@ApiOperation(hidden = true, value = "aggregateBy")
@PostMapping("/aggregateBy") @PostMapping("/aggregateBy")
public ResponseResult<List<Map<String, Object>>> aggregateBy(@RequestBody MyAggregationParam aggregationParam) { public ResponseResult<List<Map<String, Object>>> aggregateBy(@RequestBody MyAggregationParam aggregationParam) {
return super.baseAggregateBy(aggregationParam); return super.baseAggregateBy(aggregationParam);

View File

@@ -9,8 +9,9 @@ import com.orange.demo.common.core.object.*;
import com.orange.demo.common.core.util.*; import com.orange.demo.common.core.util.*;
import com.orange.demo.common.core.constant.*; import com.orange.demo.common.core.constant.*;
import com.orange.demo.common.core.base.controller.BaseController; import com.orange.demo.common.core.base.controller.BaseController;
import com.orange.demo.common.core.base.service.BaseService; import com.orange.demo.common.core.base.service.IBaseService;
import com.orange.demo.common.core.annotation.MyRequestBody; import com.orange.demo.common.core.annotation.MyRequestBody;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -23,6 +24,7 @@ import java.util.*;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@Api(tags = "学生行为统计管理接口")
@Slf4j @Slf4j
@RestController @RestController
@RequestMapping("/studentActionStats") @RequestMapping("/studentActionStats")
@@ -32,7 +34,7 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
private StudentActionStatsService studentActionStatsService; private StudentActionStatsService studentActionStatsService;
@Override @Override
protected BaseService<StudentActionStats, Long> service() { protected IBaseService<StudentActionStats, Long> service() {
return studentActionStatsService; return studentActionStatsService;
} }
@@ -118,6 +120,7 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
* @param withDict 是否包含字典关联。 * @param withDict 是否包含字典关联。
* @return 应答结果对象,包含主对象集合。 * @return 应答结果对象,包含主对象集合。
*/ */
@ApiOperation(hidden = true, value = "listByIds")
@PostMapping("/listByIds") @PostMapping("/listByIds")
public ResponseResult<List<StudentActionStatsVo>> listByIds( public ResponseResult<List<StudentActionStatsVo>> listByIds(
@RequestParam Set<Long> statsIds, @RequestParam Boolean withDict) { @RequestParam Set<Long> statsIds, @RequestParam Boolean withDict) {
@@ -131,6 +134,7 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
* @param withDict 是否包含字典关联。 * @param withDict 是否包含字典关联。
* @return 应答结果对象,包含主对象数据。 * @return 应答结果对象,包含主对象数据。
*/ */
@ApiOperation(hidden = true, value = "getById")
@PostMapping("/getById") @PostMapping("/getById")
public ResponseResult<StudentActionStatsVo> getById( public ResponseResult<StudentActionStatsVo> getById(
@RequestParam Long statsId, @RequestParam Boolean withDict) { @RequestParam Long statsId, @RequestParam Boolean withDict) {
@@ -143,6 +147,7 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
* @param statsIds 主键Id集合。 * @param statsIds 主键Id集合。
* @return 应答结果对象包含true全部存在否则false。 * @return 应答结果对象包含true全部存在否则false。
*/ */
@ApiOperation(hidden = true, value = "existIds")
@PostMapping("/existIds") @PostMapping("/existIds")
public ResponseResult<Boolean> existIds(@RequestParam Set<Long> statsIds) { public ResponseResult<Boolean> existIds(@RequestParam Set<Long> statsIds) {
return super.baseExistIds(statsIds); return super.baseExistIds(statsIds);
@@ -154,6 +159,7 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
* @param statsId 主键Id。 * @param statsId 主键Id。
* @return 应答结果对象包含true表示存在否则false。 * @return 应答结果对象包含true表示存在否则false。
*/ */
@ApiOperation(hidden = true, value = "existId")
@PostMapping("/existId") @PostMapping("/existId")
public ResponseResult<Boolean> existId(@RequestParam Long statsId) { public ResponseResult<Boolean> existId(@RequestParam Long statsId) {
return super.baseExistId(statsId); return super.baseExistId(statsId);
@@ -165,6 +171,7 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
* @param filter 过滤对象。 * @param filter 过滤对象。
* @return 删除数量。 * @return 删除数量。
*/ */
@ApiOperation(hidden = true, value = "deleteBy")
@PostMapping("/deleteBy") @PostMapping("/deleteBy")
public ResponseResult<Integer> deleteBy(@RequestBody StudentActionStatsDto filter) throws Exception { public ResponseResult<Integer> deleteBy(@RequestBody StudentActionStatsDto filter) throws Exception {
return super.baseDeleteBy(MyModelUtil.copyTo(filter, StudentActionStats.class)); return super.baseDeleteBy(MyModelUtil.copyTo(filter, StudentActionStats.class));
@@ -176,6 +183,7 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。 * @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。
*/ */
@ApiOperation(hidden = true, value = "listBy")
@PostMapping("/listBy") @PostMapping("/listBy")
public ResponseResult<MyPageData<StudentActionStatsVo>> listBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<MyPageData<StudentActionStatsVo>> listBy(@RequestBody MyQueryParam queryParam) {
return super.baseListBy(queryParam, StudentActionStats.INSTANCE); return super.baseListBy(queryParam, StudentActionStats.INSTANCE);
@@ -187,6 +195,7 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。 * @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。
*/ */
@ApiOperation(hidden = true, value = "listMapBy")
@PostMapping("/listMapBy") @PostMapping("/listMapBy")
public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
return super.baseListMapBy(queryParam, StudentActionStats.INSTANCE); return super.baseListMapBy(queryParam, StudentActionStats.INSTANCE);
@@ -198,6 +207,7 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。 * @return 应答结果对象,包含符合查询过滤条件的对象结果集。
*/ */
@ApiOperation(hidden = true, value = "getBy")
@PostMapping("/getBy") @PostMapping("/getBy")
public ResponseResult<StudentActionStatsVo> getBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<StudentActionStatsVo> getBy(@RequestBody MyQueryParam queryParam) {
return super.baseGetBy(queryParam, StudentActionStats.INSTANCE); return super.baseGetBy(queryParam, StudentActionStats.INSTANCE);
@@ -209,6 +219,7 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 应答结果对象,包含结果数量。 * @return 应答结果对象,包含结果数量。
*/ */
@ApiOperation(hidden = true, value = "countBy")
@PostMapping("/countBy") @PostMapping("/countBy")
public ResponseResult<Integer> countBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<Integer> countBy(@RequestBody MyQueryParam queryParam) {
return super.baseCountBy(queryParam); return super.baseCountBy(queryParam);
@@ -220,6 +231,7 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
* @param aggregationParam 聚合参数。 * @param aggregationParam 聚合参数。
* @return 应该结果对象包含聚合计算后的分组Map列表。 * @return 应该结果对象包含聚合计算后的分组Map列表。
*/ */
@ApiOperation(hidden = true, value = "aggregateBy")
@PostMapping("/aggregateBy") @PostMapping("/aggregateBy")
public ResponseResult<List<Map<String, Object>>> aggregateBy(@RequestBody MyAggregationParam aggregationParam) { public ResponseResult<List<Map<String, Object>>> aggregateBy(@RequestBody MyAggregationParam aggregationParam) {
return super.baseAggregateBy(aggregationParam); return super.baseAggregateBy(aggregationParam);

View File

@@ -9,9 +9,11 @@ import com.orange.demo.common.core.object.*;
import com.orange.demo.common.core.util.*; import com.orange.demo.common.core.util.*;
import com.orange.demo.common.core.constant.*; import com.orange.demo.common.core.constant.*;
import com.orange.demo.common.core.base.controller.BaseController; import com.orange.demo.common.core.base.controller.BaseController;
import com.orange.demo.common.core.base.service.BaseService; import com.orange.demo.common.core.base.service.IBaseService;
import com.orange.demo.common.core.annotation.MyRequestBody; import com.orange.demo.common.core.annotation.MyRequestBody;
import com.orange.demo.common.core.validator.UpdateGroup; import com.orange.demo.common.core.validator.UpdateGroup;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -25,6 +27,7 @@ import java.util.*;
* @author Jerry * @author Jerry
* @date 2020-08-08 * @date 2020-08-08
*/ */
@Api(tags = "学生行为流水管理接口")
@Slf4j @Slf4j
@RestController @RestController
@RequestMapping("/studentActionTrans") @RequestMapping("/studentActionTrans")
@@ -34,7 +37,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
private StudentActionTransService studentActionTransService; private StudentActionTransService studentActionTransService;
@Override @Override
protected BaseService<StudentActionTrans, Long> service() { protected IBaseService<StudentActionTrans, Long> service() {
return studentActionTransService; return studentActionTransService;
} }
@@ -44,6 +47,10 @@ public class StudentActionTransController extends BaseController<StudentActionTr
* @param studentActionTransDto 新增对象。 * @param studentActionTransDto 新增对象。
* @return 应答结果对象包含新增对象主键Id。 * @return 应答结果对象包含新增对象主键Id。
*/ */
@ApiOperationSupport(ignoreParameters = {
"studentActionTrans.transId",
"studentActionTrans.createTimeStart",
"studentActionTrans.createTimeEnd"})
@PostMapping("/add") @PostMapping("/add")
public ResponseResult<Long> add(@MyRequestBody("studentActionTrans") StudentActionTransDto studentActionTransDto) { public ResponseResult<Long> add(@MyRequestBody("studentActionTrans") StudentActionTransDto studentActionTransDto) {
String errorMessage = MyCommonUtil.getModelValidationError(studentActionTransDto); String errorMessage = MyCommonUtil.getModelValidationError(studentActionTransDto);
@@ -67,6 +74,9 @@ public class StudentActionTransController extends BaseController<StudentActionTr
* @param studentActionTransDto 更新对象。 * @param studentActionTransDto 更新对象。
* @return 应答结果对象。 * @return 应答结果对象。
*/ */
@ApiOperationSupport(ignoreParameters = {
"studentActionTrans.createTimeStart",
"studentActionTrans.createTimeEnd"})
@PostMapping("/update") @PostMapping("/update")
public ResponseResult<Void> update(@MyRequestBody("studentActionTrans") StudentActionTransDto studentActionTransDto) { public ResponseResult<Void> update(@MyRequestBody("studentActionTrans") StudentActionTransDto studentActionTransDto) {
String errorMessage = MyCommonUtil.getModelValidationError(studentActionTransDto, Default.class, UpdateGroup.class); String errorMessage = MyCommonUtil.getModelValidationError(studentActionTransDto, Default.class, UpdateGroup.class);
@@ -168,6 +178,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
* @param withDict 是否包含字典关联。 * @param withDict 是否包含字典关联。
* @return 应答结果对象,包含主对象集合。 * @return 应答结果对象,包含主对象集合。
*/ */
@ApiOperation(hidden = true, value = "listByIds")
@PostMapping("/listByIds") @PostMapping("/listByIds")
public ResponseResult<List<StudentActionTransVo>> listByIds( public ResponseResult<List<StudentActionTransVo>> listByIds(
@RequestParam Set<Long> transIds, @RequestParam Boolean withDict) { @RequestParam Set<Long> transIds, @RequestParam Boolean withDict) {
@@ -181,6 +192,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
* @param withDict 是否包含字典关联。 * @param withDict 是否包含字典关联。
* @return 应答结果对象,包含主对象数据。 * @return 应答结果对象,包含主对象数据。
*/ */
@ApiOperation(hidden = true, value = "getById")
@PostMapping("/getById") @PostMapping("/getById")
public ResponseResult<StudentActionTransVo> getById( public ResponseResult<StudentActionTransVo> getById(
@RequestParam Long transId, @RequestParam Boolean withDict) { @RequestParam Long transId, @RequestParam Boolean withDict) {
@@ -193,6 +205,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
* @param transIds 主键Id集合。 * @param transIds 主键Id集合。
* @return 应答结果对象包含true全部存在否则false。 * @return 应答结果对象包含true全部存在否则false。
*/ */
@ApiOperation(hidden = true, value = "existIds")
@PostMapping("/existIds") @PostMapping("/existIds")
public ResponseResult<Boolean> existIds(@RequestParam Set<Long> transIds) { public ResponseResult<Boolean> existIds(@RequestParam Set<Long> transIds) {
return super.baseExistIds(transIds); return super.baseExistIds(transIds);
@@ -204,6 +217,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
* @param transId 主键Id。 * @param transId 主键Id。
* @return 应答结果对象包含true表示存在否则false。 * @return 应答结果对象包含true表示存在否则false。
*/ */
@ApiOperation(hidden = true, value = "existId")
@PostMapping("/existId") @PostMapping("/existId")
public ResponseResult<Boolean> existId(@RequestParam Long transId) { public ResponseResult<Boolean> existId(@RequestParam Long transId) {
return super.baseExistId(transId); return super.baseExistId(transId);
@@ -215,6 +229,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
* @param filter 过滤对象。 * @param filter 过滤对象。
* @return 删除数量。 * @return 删除数量。
*/ */
@ApiOperation(hidden = true, value = "deleteBy")
@PostMapping("/deleteBy") @PostMapping("/deleteBy")
public ResponseResult<Integer> deleteBy(@RequestBody StudentActionTransDto filter) throws Exception { public ResponseResult<Integer> deleteBy(@RequestBody StudentActionTransDto filter) throws Exception {
return super.baseDeleteBy(MyModelUtil.copyTo(filter, StudentActionTrans.class)); return super.baseDeleteBy(MyModelUtil.copyTo(filter, StudentActionTrans.class));
@@ -226,6 +241,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。 * @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。
*/ */
@ApiOperation(hidden = true, value = "listBy")
@PostMapping("/listBy") @PostMapping("/listBy")
public ResponseResult<MyPageData<StudentActionTransVo>> listBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<MyPageData<StudentActionTransVo>> listBy(@RequestBody MyQueryParam queryParam) {
return super.baseListBy(queryParam, StudentActionTrans.INSTANCE); return super.baseListBy(queryParam, StudentActionTrans.INSTANCE);
@@ -237,6 +253,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。 * @return 分页数据集合对象。如MyQueryParam参数的分页属性为空则不会执行分页操作只是基于MyPageData对象返回数据结果。
*/ */
@ApiOperation(hidden = true, value = "listMapBy")
@PostMapping("/listMapBy") @PostMapping("/listMapBy")
public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
return super.baseListMapBy(queryParam, StudentActionTrans.INSTANCE); return super.baseListMapBy(queryParam, StudentActionTrans.INSTANCE);
@@ -248,6 +265,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。 * @return 应答结果对象,包含符合查询过滤条件的对象结果集。
*/ */
@ApiOperation(hidden = true, value = "getBy")
@PostMapping("/getBy") @PostMapping("/getBy")
public ResponseResult<StudentActionTransVo> getBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<StudentActionTransVo> getBy(@RequestBody MyQueryParam queryParam) {
return super.baseGetBy(queryParam, StudentActionTrans.INSTANCE); return super.baseGetBy(queryParam, StudentActionTrans.INSTANCE);
@@ -259,6 +277,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
* @param queryParam 查询参数。 * @param queryParam 查询参数。
* @return 应答结果对象,包含结果数量。 * @return 应答结果对象,包含结果数量。
*/ */
@ApiOperation(hidden = true, value = "countBy")
@PostMapping("/countBy") @PostMapping("/countBy")
public ResponseResult<Integer> countBy(@RequestBody MyQueryParam queryParam) { public ResponseResult<Integer> countBy(@RequestBody MyQueryParam queryParam) {
return super.baseCountBy(queryParam); return super.baseCountBy(queryParam);
@@ -270,6 +289,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
* @param aggregationParam 聚合参数。 * @param aggregationParam 聚合参数。
* @return 应该结果对象包含聚合计算后的分组Map列表。 * @return 应该结果对象包含聚合计算后的分组Map列表。
*/ */
@ApiOperation(hidden = true, value = "aggregateBy")
@PostMapping("/aggregateBy") @PostMapping("/aggregateBy")
public ResponseResult<List<Map<String, Object>>> aggregateBy(@RequestBody MyAggregationParam aggregationParam) { public ResponseResult<List<Map<String, Object>>> aggregateBy(@RequestBody MyAggregationParam aggregationParam) {
return super.baseAggregateBy(aggregationParam); return super.baseAggregateBy(aggregationParam);

View File

@@ -8,13 +8,11 @@ import com.orange.demo.application.common.constant.Subject;
import com.orange.demo.common.core.annotation.RelationDict; import com.orange.demo.common.core.annotation.RelationDict;
import com.orange.demo.common.core.annotation.RelationConstDict; import com.orange.demo.common.core.annotation.RelationConstDict;
import com.orange.demo.common.core.base.mapper.BaseModelMapper; import com.orange.demo.common.core.base.mapper.BaseModelMapper;
import com.orange.demo.common.core.validator.ConstDictRef;
import com.orange.demo.statsinterface.vo.CourseTransStatsVo; import com.orange.demo.statsinterface.vo.CourseTransStatsVo;
import lombok.Data; import lombok.Data;
import org.mapstruct.*; import org.mapstruct.*;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
import javax.persistence.*; import javax.persistence.*;
import javax.validation.constraints.*;
import java.util.Date; import java.util.Date;
import java.util.Map; import java.util.Map;
@@ -32,7 +30,6 @@ public class CourseTransStats {
/** /**
* 主键Id。 * 主键Id。
*/ */
@NotNull(message = "数据验证失败主键Id不能为空")
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "stats_id") @Column(name = "stats_id")
@@ -41,22 +38,18 @@ public class CourseTransStats {
/** /**
* 统计日期。 * 统计日期。
*/ */
@NotNull(message = "数据验证失败,统计日期不能为空!")
@Column(name = "stats_date") @Column(name = "stats_date")
private Date statsDate; private Date statsDate;
/** /**
* 科目Id。 * 科目Id。
*/ */
@NotNull(message = "数据验证失败,所属科目不能为空!")
@ConstDictRef(constDictClass = Subject.class, message = "数据验证失败,所属科目为无效值!")
@Column(name = "subject_id") @Column(name = "subject_id")
private Integer subjectId; private Integer subjectId;
/** /**
* 年级Id。 * 年级Id。
*/ */
@NotNull(message = "数据验证失败,所属年级不能为空!")
@Column(name = "grade_id") @Column(name = "grade_id")
private Integer gradeId; private Integer gradeId;
@@ -69,7 +62,6 @@ public class CourseTransStats {
/** /**
* 课程Id。 * 课程Id。
*/ */
@NotNull(message = "数据验证失败课程ID不能为空")
@Column(name = "course_id") @Column(name = "course_id")
private Long courseId; private Long courseId;
@@ -82,21 +74,18 @@ public class CourseTransStats {
/** /**
* 学生上课次数。 * 学生上课次数。
*/ */
@NotNull(message = "数据验证失败,上课次数不能为空!")
@Column(name = "student_attend_count") @Column(name = "student_attend_count")
private Integer studentAttendCount; private Integer studentAttendCount;
/** /**
* 学生献花数量。 * 学生献花数量。
*/ */
@NotNull(message = "数据验证失败,献花数量不能为空!")
@Column(name = "student_flower_amount") @Column(name = "student_flower_amount")
private Integer studentFlowerAmount; private Integer studentFlowerAmount;
/** /**
* 学生献花次数。 * 学生献花次数。
*/ */
@NotNull(message = "数据验证失败,献花次数不能为空!")
@Column(name = "student_flower_count") @Column(name = "student_flower_count")
private Integer studentFlowerCount; private Integer studentFlowerCount;

View File

@@ -4,7 +4,6 @@ import com.alibaba.fastjson.annotation.JSONField;
import com.orange.demo.common.core.annotation.DeletedFlagColumn; import com.orange.demo.common.core.annotation.DeletedFlagColumn;
import lombok.Data; import lombok.Data;
import javax.persistence.*; import javax.persistence.*;
import javax.validation.constraints.*;
/** /**
* Grade实体对象。 * Grade实体对象。
@@ -19,7 +18,6 @@ public class Grade {
/** /**
* 主键Id。 * 主键Id。
*/ */
@NotNull(message = "数据验证失败主键Id不能为空")
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "grade_id") @Column(name = "grade_id")
@@ -28,7 +26,6 @@ public class Grade {
/** /**
* 年级名称。 * 年级名称。
*/ */
@NotBlank(message = "数据验证失败,年级名称不能为空!")
@Column(name = "grade_name") @Column(name = "grade_name")
private String gradeName; private String gradeName;

Some files were not shown because too many files have changed in this diff Show More