parent
948a3fced5
commit
a3ed7449cb
@ -0,0 +1,219 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||||
|
<component name="FacetManager">
|
||||||
|
<facet type="web" name="Web">
|
||||||
|
<configuration>
|
||||||
|
<webroots />
|
||||||
|
<sourceRoots />
|
||||||
|
</configuration>
|
||||||
|
</facet>
|
||||||
|
<facet type="Spring" name="Spring">
|
||||||
|
<configuration />
|
||||||
|
</facet>
|
||||||
|
</component>
|
||||||
|
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||||
|
<output url="file://$MODULE_DIR$/target/classes" />
|
||||||
|
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||||
|
</content>
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="module" module-name="ruoyi-framework" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.11" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.11" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.17.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.17.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.36" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.28" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.12.6.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.12.6" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.6" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.12.6" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.63" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.63" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.63" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.7" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.2.11" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.alibaba:druid:1.2.11" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.github.penggle:kaptcha:2.3.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.jhlabs:filters:2.0.235-1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.github.oshi:oshi-core:6.2.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: net.java.dev.jna:jna:5.12.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: net.java.dev.jna:jna-platform:5.12.1" level="project" />
|
||||||
|
<orderEntry type="module" module-name="ruoyi-system" />
|
||||||
|
<orderEntry type="module" module-name="ruoyi-common" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-security:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-config:5.5.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-core:5.5.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-crypto:5.5.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-web:5.5.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.4.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.2.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.9" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.7" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.4.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.3.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-validation:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.2.3.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.3.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.alibaba.fastjson2:fastjson2:2.0.12" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: commons-io:commons-io:2.11.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:4.1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.poi:poi:4.1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.commons:commons-math3:3.6.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.zaxxer:SparseBitSet:1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:4.1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:3.1.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.commons:commons-compress:1.19" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.06" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.jsonwebtoken:jjwt:0.9.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.5.11" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.5.11" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.5.11" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.lettuce:lettuce-core:6.1.8.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.4.18" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.9.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: eu.bitwalker:UserAgentUtils:1.21" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:4.0.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-boot-starter:3.4.3.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.4.3.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.4.3.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-core:3.4.3.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.4.3.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:4.0.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.7.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.24" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: cn.jpush.api:jiguang-common:1.1.7" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.60" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.60" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: cn.jpush.api:jpush-client:3.4.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-all:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-dns:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-haproxy:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-http:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-http2:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-memcache:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-mqtt:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-redis:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-smtp:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-socks:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-stomp:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-xml:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-handler-proxy:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-resolver-dns:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-transport-rxtx:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-transport-sctp:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-transport-udt:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-transport-classes-epoll:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-transport-native-unix-common:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-transport-classes-kqueue:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-resolver-dns-classes-macos:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-epoll:linux-x86_64:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-epoll:linux-aarch_64:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-kqueue:osx-x86_64:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-kqueue:osx-aarch_64:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-resolver-dns-native-macos:osx-x86_64:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-resolver-dns-native-macos:osx-aarch_64:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-boot-starter:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-oas:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.swagger.core.v3:swagger-annotations:2.1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.swagger.core.v3:swagger-models:2.1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-core:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.22" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.github.classgraph:classgraph:4.8.83" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-webmvc:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-webflux:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" scope="RUNTIME" name="Maven: org.mapstruct:mapstruct:1.3.1.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-data-rest:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-ui:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:2.0.0.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:2.0.0.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.6.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.6.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-joda:2.12.6" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: joda-time:joda-time:2.10.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-websocket:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-messaging:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-websocket:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.auth0:java-jwt:3.11.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.15" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.29" level="project" />
|
||||||
|
<orderEntry type="module" module-name="ruoyi-im-client" />
|
||||||
|
<orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.14.9" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.squareup.okio:okio:1.17.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.minio:minio:8.2.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.carrotsearch.thirdparty:simple-xml-safe:2.7.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.google.guava:guava:29.0-jre" 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-qual:2.11.1" 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.jackson.core:jackson-annotations:2.12.6" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.12.6" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: net.coobird:thumbnailator:0.4.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.9" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.github.wechatpay-apiv3:wechatpay-java:0.2.9" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.github.wechatpay-apiv3:wechatpay-java-core:0.2.9" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.github.wechatpay-apiv3:wechatpay-apache-httpclient:0.4.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.13" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.15" level="project" />
|
||||||
|
<orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.httpcomponents:httpmime:4.5.13" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: junit:junit:4.13.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:2.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest:2.2" level="project" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
@ -1,125 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.app_course;
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import com.ruoyi.RestResponse;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
|
||||||
import com.ruoyi.course.domain.Appointment;
|
|
||||||
import com.ruoyi.course.domain.AppointmentVo;
|
|
||||||
import com.ruoyi.course.mapper.AppointmentMapper;
|
|
||||||
import com.ruoyi.course.service.AppointmentServiceImpl;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* 课程 前端控制器
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @author xhj
|
|
||||||
* @since 2022-09-22
|
|
||||||
*/
|
|
||||||
@Api(tags = "课程", description = "提供课程相关的API")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/appointment")
|
|
||||||
public class AppointmentAppController extends BaseController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
AppointmentServiceImpl appointmentService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
AppointmentMapper mapper;
|
|
||||||
|
|
||||||
|
|
||||||
// @PostMapping("/getAppointmentList")
|
|
||||||
public RestResponse getAppointmentList(@RequestBody Map map) {
|
|
||||||
// List<Course> list = appointmentService.getList(map);
|
|
||||||
// return new RestResponse().setData(list);
|
|
||||||
return RestResponse.success().setData(appointmentService.findList(map));
|
|
||||||
}
|
|
||||||
|
|
||||||
// @PostMapping("/updateAppointment")
|
|
||||||
public RestResponse updateAppointment(@RequestBody Appointment appointment) {
|
|
||||||
String username = SecurityUtils.getUsername();
|
|
||||||
appointment.setUpdateUser(username);
|
|
||||||
// LocalDateTime now= ;
|
|
||||||
appointment.setUpdateTime(DateUtil.parseLocalDateTime(DateUtil.now(),"yyyy-MM-dd HH:mm:ss"));
|
|
||||||
appointmentService.updateById(appointment);
|
|
||||||
return RestResponse.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预约课程
|
|
||||||
* @param appointment
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
// @PostMapping("/yy")
|
|
||||||
public RestResponse yy(@RequestBody Appointment appointment) {
|
|
||||||
appointment.setCreateTime(DateUtil.parseLocalDateTime(DateUtil.now(),"yyyy-MM-dd HH:mm:ss"));
|
|
||||||
appointmentService.save(appointment);
|
|
||||||
return RestResponse.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
//我的预约
|
|
||||||
//预约成功
|
|
||||||
//预约失败
|
|
||||||
@PostMapping("/appointments")
|
|
||||||
public RestResponse appointments(HttpServletRequest request) {
|
|
||||||
Long userId= Long.parseLong(request.getAttribute("userId").toString());
|
|
||||||
Map map=new HashMap();
|
|
||||||
map.put("consumerId",userId);
|
|
||||||
List<AppointmentVo> list=appointmentService.findList(map);
|
|
||||||
List<AppointmentVo> list1=new ArrayList<>();//预约中
|
|
||||||
List<AppointmentVo> list2=new ArrayList<>();//预约成功
|
|
||||||
List<AppointmentVo> list3=new ArrayList<>();//预约失败
|
|
||||||
List<AppointmentVo> list4=new ArrayList<>();//取消预约
|
|
||||||
for (AppointmentVo a:list){
|
|
||||||
if (a.getFlag()==0){
|
|
||||||
list1.add(a);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (a.getFlag()==1){
|
|
||||||
list2.add(a);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (a.getFlag()==2){
|
|
||||||
list3.add(a);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (a.getFlag()==3){
|
|
||||||
list4.add(a);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
map.clear();
|
|
||||||
map.put("list1",list1);
|
|
||||||
map.put("list2",list2);
|
|
||||||
map.put("list3",list3);
|
|
||||||
map.put("list4",list4);
|
|
||||||
return RestResponse.success().setData(map);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//取消预约
|
|
||||||
@PostMapping("/cancel")
|
|
||||||
public RestResponse cancel(@RequestBody Appointment appointment) {
|
|
||||||
appointment.setUpdateTime(DateUtil.parseLocalDateTime(DateUtil.now(),"yyyy-MM-dd HH:mm:ss"));
|
|
||||||
int i= mapper.cancel(appointment);
|
|
||||||
return RestResponse.success().setMessage(i==0?"修改失败,当前状态无法取消预约!":"成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.app_course;
|
|
||||||
|
|
||||||
|
|
||||||
import com.ruoyi.RestResponse;
|
|
||||||
import com.ruoyi.course.domain.CourseLog;
|
|
||||||
import com.ruoyi.course.mapper.ConsumerCourseMapper;
|
|
||||||
import com.ruoyi.course.service.ConsumerCourseServiceImpl;
|
|
||||||
import com.ruoyi.course.service.CourseServiceImpl;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* 前端控制器
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @author xn
|
|
||||||
* @since 2022-12-29
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/consumerCourse")
|
|
||||||
public class ConsumerCourseController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CourseServiceImpl courseService;
|
|
||||||
@Resource
|
|
||||||
private ConsumerCourseServiceImpl consumerCourseService;
|
|
||||||
@Resource
|
|
||||||
private ConsumerCourseMapper mapper;
|
|
||||||
|
|
||||||
//我的课程 (视频)
|
|
||||||
@PostMapping("/myCourse")
|
|
||||||
public RestResponse myCourse(HttpServletRequest request){
|
|
||||||
Long userId= Long.parseLong(request.getAttribute("userId").toString());
|
|
||||||
List<CourseLog> list= mapper.myCourse(userId);
|
|
||||||
List<CourseLog> list1=new ArrayList<>();
|
|
||||||
List<CourseLog> list2=new ArrayList<>();
|
|
||||||
for (CourseLog l:list){
|
|
||||||
if (l.getCourseType().equals("2")){
|
|
||||||
list1.add(l);
|
|
||||||
}
|
|
||||||
if (l.getCourseType().equals("3")){
|
|
||||||
list2.add(l);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Map map=new HashMap();
|
|
||||||
map.put("list1",list1);//大咖课
|
|
||||||
map.put("list2",list2);//教练培训
|
|
||||||
return new RestResponse().setSuccess(true).setData(map);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,54 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.app_course;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.ruoyi.RestResponse;
|
|
||||||
import com.ruoyi.course.domain.HistoryMessage;
|
|
||||||
import com.ruoyi.course.service.HistoryMessageServiceImpl;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 我的消息
|
|
||||||
*/
|
|
||||||
@Api(tags = "我的消息", description = "提供我的消息相关的API")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/historyMessage")
|
|
||||||
public class HistoryMessageController {
|
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
HistoryMessageServiceImpl historyMessageService;
|
|
||||||
|
|
||||||
@ApiOperation("我的消息列表")
|
|
||||||
@PostMapping("/getMessages")
|
|
||||||
public RestResponse getMessages(HttpServletRequest request){
|
|
||||||
List<HistoryMessage> list= historyMessageService.list(new QueryWrapper<HistoryMessage>()
|
|
||||||
.eq("phone",request.getAttribute("phone").toString())
|
|
||||||
.eq("releases",true));
|
|
||||||
return new RestResponse().setSuccess(true).setData(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("消息详情")
|
|
||||||
@PostMapping("/getOne")
|
|
||||||
public RestResponse getOne(@RequestBody HistoryMessage message){
|
|
||||||
HistoryMessage historyMessage= historyMessageService.getById(message.getId());
|
|
||||||
return new RestResponse().setSuccess(true).setData(historyMessage);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("删除消息")
|
|
||||||
@PostMapping("/remove")
|
|
||||||
public RestResponse remove(@RequestBody HistoryMessage message){
|
|
||||||
message.setReleases(false);
|
|
||||||
historyMessageService.updateById(message);
|
|
||||||
return new RestResponse().setSuccess(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,72 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.app_shop;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.ruoyi.RestResponse;
|
|
||||||
import com.ruoyi.course.domain.CourseLog;
|
|
||||||
import com.ruoyi.course.service.CourseLogServiceImpl;
|
|
||||||
import com.ruoyi.shop.domain.YjCourseLp;
|
|
||||||
import com.ruoyi.shop.service.impl.YjCourceLpMenuServiceImpl;
|
|
||||||
import com.ruoyi.shop.service.impl.YjCourceLpServiceImpl;
|
|
||||||
import com.ruoyi.shop.service.impl.YjMerchantServiceImpl;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
@Api(tags = "瑜伽流派", description = "提供瑜伽流派相关的API")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/courseLp")
|
|
||||||
public class CourceLpController {
|
|
||||||
@Resource
|
|
||||||
private YjCourceLpServiceImpl service;
|
|
||||||
@Resource
|
|
||||||
private YjMerchantServiceImpl merchantService;
|
|
||||||
@Resource
|
|
||||||
private YjCourceLpMenuServiceImpl menuService;
|
|
||||||
@Resource
|
|
||||||
private CourseLogServiceImpl courseLogService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 列表
|
|
||||||
* @param lp
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PostMapping("/list")
|
|
||||||
@ApiOperation("获取瑜伽流派 列表")
|
|
||||||
public RestResponse list(@RequestBody YjCourseLp lp){
|
|
||||||
List<YjCourseLp> list=service.list(new QueryWrapper<YjCourseLp>()
|
|
||||||
.eq("merchant_id", lp.getMerchantId())
|
|
||||||
.eq("enabled",true)
|
|
||||||
.orderByDesc("modify_time")
|
|
||||||
);
|
|
||||||
return new RestResponse().setSuccess(true).setMessage("成功").setData(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("获取当前瑜伽流派下的课程")
|
|
||||||
@PostMapping("/courseList")
|
|
||||||
public RestResponse courseList(@RequestBody YjCourseLp lp){
|
|
||||||
// 课程分类courseType 是否显示releases
|
|
||||||
List<YjCourseLp> list=service.list(new QueryWrapper<YjCourseLp>()
|
|
||||||
.eq("merchant_id", lp.getMerchantId())
|
|
||||||
.eq("enabled",true)
|
|
||||||
.orderByDesc("modify_time")
|
|
||||||
);
|
|
||||||
list.forEach(l->{
|
|
||||||
l.setCourseType(lp.getCourseType());
|
|
||||||
l.setReleases(true);
|
|
||||||
List<CourseLog> courseList=courseLogService.list(new QueryWrapper<CourseLog>()
|
|
||||||
.select("id","course_id","course_names","course_price","course_picture","course_type")
|
|
||||||
.eq("course_type",lp.getCourseType())//课程类型 2大咖课 3教练培训
|
|
||||||
.eq("releases",true) //上架
|
|
||||||
.eq("lp_id",l.getId())//流派
|
|
||||||
);
|
|
||||||
l.setCourseList(courseList);
|
|
||||||
});
|
|
||||||
return new RestResponse().setSuccess(true).setMessage("成功").setData(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,58 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.app_shop;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.ruoyi.RestResponse;
|
|
||||||
import com.ruoyi.shop.domain.ShopGoods;
|
|
||||||
import com.ruoyi.shop.domain.ShopGoodsCategory;
|
|
||||||
import com.ruoyi.shop.mapper.ShopGoodsMapper;
|
|
||||||
import com.ruoyi.shop.service.impl.ShopGoodsCategoryServiceImpl;
|
|
||||||
import com.ruoyi.shop.service.impl.ShopGoodsServiceImpl;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Api(tags = "商品", description = "提供商品相关的API")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/goods")
|
|
||||||
public class GoodsController {
|
|
||||||
@Resource
|
|
||||||
private ShopGoodsServiceImpl service;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private ShopGoodsCategoryServiceImpl categoryService;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private ShopGoodsMapper goodsMapper;
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation("商品类别")
|
|
||||||
@PostMapping("/getGoodsCategory")
|
|
||||||
public RestResponse getGoodsCategory(@RequestBody ShopGoodsCategory category){
|
|
||||||
List<ShopGoodsCategory> categoryList=categoryService.list(new QueryWrapper<ShopGoodsCategory>()
|
|
||||||
.eq("business_id",category.getBusinessId())
|
|
||||||
.eq("pid","0")
|
|
||||||
.eq("display",true)
|
|
||||||
.eq("is_delete",false));
|
|
||||||
return new RestResponse().setSuccess(true).setMessage("成功").setData(categoryList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("商品列表")
|
|
||||||
@PostMapping("/getGoods")
|
|
||||||
public RestResponse getGoods(@RequestBody ShopGoodsCategory category){
|
|
||||||
List<ShopGoods> goods=goodsMapper.getByPid(category.getId());
|
|
||||||
return new RestResponse().setSuccess(true).setMessage("成功").setData(goods);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("商品详情")
|
|
||||||
@PostMapping("/getOne")
|
|
||||||
public RestResponse getOne(@RequestBody ShopGoods goods){
|
|
||||||
return new RestResponse().setSuccess(true).setMessage("成功").setData(service.getById(goods.getId()));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,56 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.app_shop;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.ruoyi.RestResponse;
|
|
||||||
import com.ruoyi.shop.domain.YjIndex;
|
|
||||||
import com.ruoyi.shop.domain.YjMerchant;
|
|
||||||
import com.ruoyi.shop.service.impl.YjIndexServiceImpl;
|
|
||||||
import com.ruoyi.shop.service.impl.YjMerchantServiceImpl;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
@Api(tags = "首页", description = "提供首页信息相关的API")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/index")
|
|
||||||
public class IndexController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private YjIndexServiceImpl indexService;
|
|
||||||
@Resource
|
|
||||||
private YjMerchantServiceImpl merchantService;
|
|
||||||
|
|
||||||
|
|
||||||
//商户list
|
|
||||||
@ApiOperation("门店列表")
|
|
||||||
@PostMapping("/getMerchant")
|
|
||||||
public RestResponse getMerchant(){
|
|
||||||
List<YjMerchant> list=merchantService.list(new QueryWrapper<YjMerchant>()
|
|
||||||
.select("address","enterprise_name","phone","banner","id")
|
|
||||||
.eq("status",2));
|
|
||||||
return new RestResponse().setSuccess(true).setData(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("首页图标")
|
|
||||||
@ApiImplicitParam(name = "merchantId", value = "商户ID", required = true, dataType = "String", dataTypeClass = String.class)
|
|
||||||
@PostMapping("/getIndex")
|
|
||||||
public RestResponse getIndex(@RequestBody YjIndex yjIndex){
|
|
||||||
YjIndex y= indexService.getOne(new QueryWrapper<YjIndex>()
|
|
||||||
.eq("merchant_id",yjIndex.getMerchantId()));
|
|
||||||
|
|
||||||
if (ObjectUtil.isNotEmpty(y)){
|
|
||||||
return new RestResponse().setSuccess(true).setData(y);
|
|
||||||
}else {
|
|
||||||
return new RestResponse().setSuccess(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,315 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.app_shop;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.ruoyi.RestResponse;
|
|
||||||
import com.ruoyi.common.constant.CacheConstants;
|
|
||||||
import com.ruoyi.common.constant.Constants;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
||||||
import com.ruoyi.common.core.domain.model.LoginBody;
|
|
||||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
||||||
import com.ruoyi.common.core.redis.RedisCache;
|
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
|
||||||
import com.ruoyi.common.exception.user.CaptchaException;
|
|
||||||
import com.ruoyi.common.exception.user.CaptchaExpireException;
|
|
||||||
import com.ruoyi.common.exception.user.UserPasswordNotMatchException;
|
|
||||||
import com.ruoyi.common.utils.*;
|
|
||||||
import com.ruoyi.common.utils.ip.IpUtils;
|
|
||||||
import com.ruoyi.framework.config.JwtUtil1;
|
|
||||||
import com.ruoyi.framework.manager.AsyncManager;
|
|
||||||
import com.ruoyi.framework.manager.factory.AsyncFactory;
|
|
||||||
import com.ruoyi.framework.security.context.AuthenticationContextHolder;
|
|
||||||
import com.ruoyi.framework.web.service.TokenService;
|
|
||||||
import com.ruoyi.shop.domain.Consumer;
|
|
||||||
import com.ruoyi.shop.domain.YjMerchant;
|
|
||||||
import com.ruoyi.shop.service.ConsumerService;
|
|
||||||
import com.ruoyi.shop.service.impl.YjMerchantServiceImpl;
|
|
||||||
import com.ruoyi.system.service.ISysConfigService;
|
|
||||||
import com.ruoyi.system.service.ISysUserService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
|
||||||
import org.springframework.security.authentication.AuthenticationManager;
|
|
||||||
import org.springframework.security.authentication.BadCredentialsException;
|
|
||||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
|
||||||
import org.springframework.security.core.Authentication;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Random;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
@Api(tags = "登录与验证")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api")
|
|
||||||
public class LoginController {
|
|
||||||
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private ConsumerService service;
|
|
||||||
@Autowired
|
|
||||||
private ISysUserService userService;
|
|
||||||
@Resource
|
|
||||||
JwtUtil1 jwtUtil1;
|
|
||||||
@Autowired
|
|
||||||
private TokenService tokenService;
|
|
||||||
@Resource
|
|
||||||
RedisTemplate<String,Object> redisTemplate;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RedisCache redisCache;
|
|
||||||
@Autowired
|
|
||||||
private ISysConfigService configService;
|
|
||||||
@Resource
|
|
||||||
private AuthenticationManager authenticationManager;
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation("登录")
|
|
||||||
@PostMapping("/login")
|
|
||||||
public AjaxResult login(@RequestBody LoginBody loginBody){
|
|
||||||
|
|
||||||
AjaxResult ajax = AjaxResult.success();
|
|
||||||
if (StrUtil.isEmpty(loginBody.getRegisterId())){
|
|
||||||
ajax.put(Constants.FAIL, "设备id异常");
|
|
||||||
return ajax;
|
|
||||||
}
|
|
||||||
boolean captchaEnabled = configService.selectCaptchaEnabled();
|
|
||||||
// 验证码开关
|
|
||||||
if (captchaEnabled)
|
|
||||||
{
|
|
||||||
validateCaptcha(loginBody.getAccount(),loginBody.getCode(),loginBody.getUuid());
|
|
||||||
}
|
|
||||||
|
|
||||||
//用户名是否存在
|
|
||||||
SysUser user = userService.selectUserByUserName(loginBody.getAccount());
|
|
||||||
|
|
||||||
//未注册
|
|
||||||
if(ObjectUtil.isEmpty(user) ){
|
|
||||||
//注册并登录
|
|
||||||
//用户账号 昵称 门店 密码 头像
|
|
||||||
// registerId 地址
|
|
||||||
// 必填 user_name nick_name merchant_id
|
|
||||||
user=new SysUser();
|
|
||||||
user.setUserName(loginBody.getAccount());
|
|
||||||
user.setNickName("用户"+loginBody.getAccount());
|
|
||||||
user.setPassword(SecurityUtils.encryptPassword(loginBody.getPassword()));
|
|
||||||
user.setRegisterId(loginBody.getRegisterId());
|
|
||||||
user.setVisitStore(getIndex(user).get("id"));
|
|
||||||
Long[] ros={107l};//用户角色
|
|
||||||
user.setRoleIds(ros);
|
|
||||||
userService.insertUser(user);
|
|
||||||
String token = validateUser(loginBody.getAccount(),loginBody.getPassword());
|
|
||||||
//设置推送别名
|
|
||||||
JpushClientUtil.bindAlias(loginBody.getRegisterId(),loginBody.getAccount());
|
|
||||||
ajax.put(Constants.TOKEN, token);
|
|
||||||
return ajax;
|
|
||||||
}
|
|
||||||
|
|
||||||
//已注册 直接登录
|
|
||||||
String token = validateUser(loginBody.getAccount(),loginBody.getPassword());
|
|
||||||
//设置推送别名
|
|
||||||
JpushClientUtil.bindAlias(loginBody.getRegisterId(),loginBody.getAccount());
|
|
||||||
if (!loginBody.getRegisterId().equals(user.getRegisterId())){
|
|
||||||
//判断登录设备是否更换 todo
|
|
||||||
// userService.updateUser();
|
|
||||||
}
|
|
||||||
//返回token
|
|
||||||
ajax.put(Constants.TOKEN, token);
|
|
||||||
return ajax;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 校验验证码
|
|
||||||
*
|
|
||||||
* @param code 验证码
|
|
||||||
* @param uuid 唯一标识
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public void validateCaptcha(String username, String code, String uuid)
|
|
||||||
{
|
|
||||||
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, "");
|
|
||||||
String captcha = redisCache.getCacheObject(verifyKey);
|
|
||||||
redisCache.deleteObject(verifyKey);
|
|
||||||
if (captcha == null)
|
|
||||||
{
|
|
||||||
//验证码为空
|
|
||||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
|
|
||||||
throw new CaptchaExpireException();
|
|
||||||
}
|
|
||||||
if (!code.equalsIgnoreCase(captcha))
|
|
||||||
{
|
|
||||||
//验证码不存在
|
|
||||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
|
|
||||||
throw new CaptchaException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//用户验证
|
|
||||||
public String validateUser(String username,String password){
|
|
||||||
// 用户验证
|
|
||||||
Authentication authentication = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password);
|
|
||||||
AuthenticationContextHolder.setContext(authenticationToken);
|
|
||||||
// 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
|
|
||||||
authentication = authenticationManager.authenticate(authenticationToken);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
if (e instanceof BadCredentialsException)
|
|
||||||
{
|
|
||||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
|
|
||||||
throw new UserPasswordNotMatchException();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage()));
|
|
||||||
throw new ServiceException(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
AuthenticationContextHolder.clearContext();
|
|
||||||
}
|
|
||||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
|
|
||||||
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
|
|
||||||
if (StrUtil.isEmpty(loginUser.getUser().getMerchantId())){
|
|
||||||
throw new RuntimeException("未建商户无法登录");
|
|
||||||
}
|
|
||||||
recordLoginInfo(loginUser.getUserId());
|
|
||||||
// 生成token
|
|
||||||
return tokenService.createToken(loginUser);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取用户信息
|
|
||||||
*
|
|
||||||
* @return 用户信息
|
|
||||||
*/
|
|
||||||
@GetMapping("/getInfo")
|
|
||||||
public AjaxResult getInfo()
|
|
||||||
{
|
|
||||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
|
||||||
// 角色集合
|
|
||||||
// Set<String> roles = permissionService.getRolePermission(user);
|
|
||||||
// 权限集合
|
|
||||||
// Set<String> permissions = permissionService.getMenuPermission(user);
|
|
||||||
AjaxResult ajax = AjaxResult.success();
|
|
||||||
ajax.put("user", user);
|
|
||||||
ajax.put("merchant",getIndex(user));
|
|
||||||
// ajax.put("roles", roles);
|
|
||||||
// ajax.put("permissions", permissions);
|
|
||||||
return ajax;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 记录登录信息
|
|
||||||
*
|
|
||||||
* @param userId 用户ID
|
|
||||||
*/
|
|
||||||
public void recordLoginInfo(Long userId)
|
|
||||||
{
|
|
||||||
SysUser sysUser = new SysUser();
|
|
||||||
sysUser.setUserId(userId);
|
|
||||||
sysUser.setLoginIp(IpUtils.getIpAddr(ServletUtils.getRequest()));
|
|
||||||
sysUser.setLoginDate(DateUtils.getNowDate());
|
|
||||||
userService.updateUserProfile(sysUser);
|
|
||||||
}
|
|
||||||
|
|
||||||
// -----------------------------------------------
|
|
||||||
@ApiOperation("获取验证码")
|
|
||||||
// @PostMapping ("/getCode")
|
|
||||||
public RestResponse getCode(@RequestBody Consumer consumer){
|
|
||||||
String captcha=(String) redisTemplate.opsForValue().get(consumer.getConsumerPhonenumber());
|
|
||||||
if (StrUtil.isNotEmpty(captcha)){
|
|
||||||
return new RestResponse().setSuccess(false).setMessage("请1分钟后重试");
|
|
||||||
}
|
|
||||||
captcha =gen()+"";
|
|
||||||
|
|
||||||
//发送成功 手机号存到redis 对应code 1分钟有效期
|
|
||||||
redisTemplate.opsForValue().set(consumer.getConsumerPhonenumber(),
|
|
||||||
captcha,
|
|
||||||
1,
|
|
||||||
TimeUnit.MINUTES);
|
|
||||||
return new RestResponse().setSuccess(true).setMessage("发送成功").setData(captcha);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int gen() {
|
|
||||||
Random r = new Random( System.currentTimeMillis() );
|
|
||||||
return ((1 + r.nextInt(2)) * 100000 + r.nextInt(100000));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 短信验证码登录方式
|
|
||||||
* @param map
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public RestResponse login(@RequestBody Map<String,String> map){
|
|
||||||
System.out.println("---------------------registerId"+map.get("registerId"));
|
|
||||||
String captcha=(String)redisTemplate.opsForValue().get(map.get("consumerPhonenumber"));
|
|
||||||
if(map.get("captcha").equals(captcha)){
|
|
||||||
//登录成功
|
|
||||||
redisTemplate.delete(map.get("consumerPhonenumber"));
|
|
||||||
Map<String, Object> dataMap = new HashMap<>();
|
|
||||||
//查找数据库,判断是否为新用户:
|
|
||||||
//老用戶
|
|
||||||
Consumer consumer=service.getOne(new QueryWrapper<Consumer>()
|
|
||||||
.eq("consumer_phonenumber",map.get("consumerPhonenumber")));
|
|
||||||
if (ObjectUtil.isNotEmpty(consumer)){
|
|
||||||
//老客户
|
|
||||||
if (StrUtil.isNotEmpty(map.get("registerId"))){
|
|
||||||
consumer.setRegisterId(map.get("registerId"));
|
|
||||||
service.updateById(consumer);
|
|
||||||
//设置推送别名
|
|
||||||
JpushClientUtil.bindAlias(consumer.getRegisterId(),consumer.getConsumerPhonenumber());
|
|
||||||
}
|
|
||||||
String token = jwtUtil1.generateToken(consumer.getConsumerId().toString(),consumer.getConsumerPhonenumber());
|
|
||||||
dataMap.put("jwt",token);
|
|
||||||
dataMap.put("userInfo",consumer);
|
|
||||||
return new RestResponse().setSuccess(true).setMessage("成功").setData(dataMap);
|
|
||||||
}
|
|
||||||
//新用戶
|
|
||||||
consumer=new Consumer();
|
|
||||||
consumer.setConsumerPhonenumber(map.get("consumerPhonenumber"));
|
|
||||||
consumer.setConsumerName("用户"+map.get("consumerPhonenumber"));
|
|
||||||
consumer.setConsumerNickName("用户"+map.get("consumerPhonenumber"));
|
|
||||||
consumer.setRegisterId(map.get("registerId"));
|
|
||||||
consumer.setConsumerAvatar("/default.jpeg");
|
|
||||||
service.save(consumer);
|
|
||||||
//设置推送别名
|
|
||||||
JpushClientUtil.bindAlias(consumer.getRegisterId(),consumer.getConsumerPhonenumber());
|
|
||||||
String token = jwtUtil1.generateToken(consumer.getConsumerId().toString(),consumer.getConsumerPhonenumber());
|
|
||||||
dataMap.put("jwt",token);
|
|
||||||
dataMap.put("userInfo",consumer);
|
|
||||||
// dataMap.put("index",getIndex(consumer));
|
|
||||||
|
|
||||||
return new RestResponse().setSuccess(true).setMessage("成功").setData(dataMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
return new RestResponse().setSuccess(false).setMessage("失败");
|
|
||||||
}
|
|
||||||
@Resource
|
|
||||||
private YjMerchantServiceImpl merchantService;
|
|
||||||
|
|
||||||
public Map<String,String> getIndex(SysUser c){
|
|
||||||
YjMerchant merchant;
|
|
||||||
Map m=new HashMap();
|
|
||||||
if (StrUtil.isNotEmpty(c.getVisitStore())){
|
|
||||||
merchant=merchantService.getById(c.getVisitStore());
|
|
||||||
}else {
|
|
||||||
merchant= merchantService.list().get(0);
|
|
||||||
}
|
|
||||||
m.put("address",merchant.getAddress());
|
|
||||||
m.put("enterpriseName",merchant.getEnterpriseName());
|
|
||||||
m.put("phone",merchant.getPhone());
|
|
||||||
m.put("banner",merchant.getBanner());
|
|
||||||
m.put("id",merchant.getId());
|
|
||||||
return m;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,68 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.app_shop;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.ruoyi.RestResponse;
|
|
||||||
import com.ruoyi.shop.domain.ShopCart;
|
|
||||||
import com.ruoyi.shop.domain.ShopGoods;
|
|
||||||
import com.ruoyi.shop.mapper.ShopCartMapper;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
@Api(tags = "购物车", description = "提供购物车相关的API")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/shopCart")
|
|
||||||
public class ShopCartController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private ShopCartMapper shopCartMapper;
|
|
||||||
|
|
||||||
@ApiOperation("加入购物车")
|
|
||||||
@PostMapping("/addShopCart")
|
|
||||||
public RestResponse addShopCart(@RequestBody ShopCart shopCart, HttpServletRequest request){
|
|
||||||
Long userId= Long.parseLong(request.getAttribute("userId").toString());
|
|
||||||
ShopCart s=shopCartMapper.selectOne(new QueryWrapper<ShopCart>()
|
|
||||||
.eq("id_user",userId)
|
|
||||||
.eq("id_goods",shopCart.getIdGoods()));
|
|
||||||
if (ObjectUtil.isNotEmpty(s)){
|
|
||||||
s.setCount(s.getCount()+1);
|
|
||||||
shopCartMapper.updateById(s);
|
|
||||||
return new RestResponse().setSuccess(true).setMessage("成功");
|
|
||||||
}
|
|
||||||
shopCart.setIdUser(userId);
|
|
||||||
shopCartMapper.insert(shopCart);
|
|
||||||
return new RestResponse().setSuccess(true).setMessage("成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("购物车删除商品")
|
|
||||||
@PostMapping("/removeShopCart")
|
|
||||||
public RestResponse removeShopCart(@RequestBody Map<String, List<String>> map){
|
|
||||||
List<String> ids=map.get("ids");
|
|
||||||
shopCartMapper.deleteBatchIds(ids);
|
|
||||||
return new RestResponse().setSuccess(true).setMessage("成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("购物车商品列表")
|
|
||||||
@PostMapping("/shopCartList")
|
|
||||||
public RestResponse shopCartList(HttpServletRequest request){
|
|
||||||
Long userId= Long.parseLong(request.getAttribute("userId").toString());
|
|
||||||
List<ShopGoods> list=shopCartMapper.cartList(userId);
|
|
||||||
return new RestResponse().setSuccess(true).setMessage("成功").setData(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("购物车修改商品数量")
|
|
||||||
@PostMapping("/changeCount")
|
|
||||||
public RestResponse changeCount(@RequestBody ShopCart shopCart){
|
|
||||||
shopCartMapper.updateById(shopCart);
|
|
||||||
return new RestResponse().setSuccess(true).setMessage("成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,40 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.app_shop.dto;
|
|
||||||
|
|
||||||
import com.ruoyi.shop.domain.ShopGoods;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class ShopOrderDto {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 省
|
|
||||||
*/
|
|
||||||
@ApiModelProperty("省")
|
|
||||||
private String province;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 市
|
|
||||||
*/
|
|
||||||
private String city;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 详细地址
|
|
||||||
*/
|
|
||||||
private String address;
|
|
||||||
/**
|
|
||||||
* 电话
|
|
||||||
*/
|
|
||||||
private String phone;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 收货人名称
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
private String message;
|
|
||||||
private List<ShopGoods> list;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -0,0 +1,77 @@
|
|||||||
|
package com.ruoyi.web.controller.basic;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import com.ruoyi.RestResponse;
|
||||||
|
import com.ruoyi.basic.service.YjAppUserService;
|
||||||
|
import com.ruoyi.common.core.domain.entity.AppUser;
|
||||||
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.basic.domain.YjStore;
|
||||||
|
import com.ruoyi.basic.service.impl.YjStoreServiceImpl;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Api(tags = "021-首页", description = "提供首页信息相关的API")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/index")
|
||||||
|
public class IndexController {
|
||||||
|
@Resource
|
||||||
|
private YjStoreServiceImpl storeService;
|
||||||
|
@Autowired
|
||||||
|
private YjAppUserService appUserService;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("门店列表")
|
||||||
|
@PostMapping("/getStores")
|
||||||
|
public RestResponse getStores(){
|
||||||
|
Long userId = SecurityUtils.getAppLoginUser().getAppUser().getId();
|
||||||
|
AppUser appUser =appUserService.getById(userId);
|
||||||
|
YjStore s=storeService.getOne(new QueryWrapper<YjStore>().select("tenant_id").eq("id",appUser.getVisitStore()));
|
||||||
|
List<YjStore> list= storeService.list(new QueryWrapper<YjStore>()
|
||||||
|
.select("address","" +
|
||||||
|
"store_name","phone","id","parent_id")
|
||||||
|
.eq("status",2)
|
||||||
|
.eq("tenant_id",s.getTenantId())
|
||||||
|
.orderByAsc("tenant_id")
|
||||||
|
);
|
||||||
|
|
||||||
|
list.forEach(l->{
|
||||||
|
if (l.getParentId().equals("0")){
|
||||||
|
l.setStoreName(l.getStoreName()+"(总店)");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return new RestResponse().setSuccess(true).setData(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("切换门店")
|
||||||
|
@PostMapping("/changeStore")
|
||||||
|
public RestResponse changeStore(@RequestBody Map<String,String> map){
|
||||||
|
String visitStoreId =map.get("visitStoreId");
|
||||||
|
//登录用户的访问门店字段修改
|
||||||
|
AppUser appUser = SecurityUtils.getAppLoginUser().getAppUser();
|
||||||
|
appUserService.update(new UpdateWrapper<AppUser>()
|
||||||
|
.eq("app_user_id",appUser)
|
||||||
|
.set("visit_store",visitStoreId));
|
||||||
|
//返回新切换的门店信息
|
||||||
|
YjStore yjStore= storeService.getById(visitStoreId);
|
||||||
|
Map m=new HashMap();
|
||||||
|
m.put("address",yjStore.getAddress());
|
||||||
|
m.put("storeName",yjStore.getStoreName());
|
||||||
|
m.put("phone",yjStore.getPhone());
|
||||||
|
m.put("banner",yjStore.getBanner());
|
||||||
|
m.put("id",yjStore.getId());
|
||||||
|
return new RestResponse().setSuccess(true).setData(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
package com.ruoyi.web.controller.basic;
|
||||||
|
|
||||||
|
import cn.hutool.crypto.SecureUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class WeChatController {
|
||||||
|
@Value("${wechat.token}")
|
||||||
|
String TOKEN;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param signature
|
||||||
|
* @param timestamp
|
||||||
|
* @param nonce
|
||||||
|
* @param echostr
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("")
|
||||||
|
public String check(@RequestParam("signature") String signature,
|
||||||
|
@RequestParam("timestamp") String timestamp,
|
||||||
|
@RequestParam("nonce") String nonce,
|
||||||
|
@RequestParam("echostr") String echostr){
|
||||||
|
return this.check1(signature,timestamp,nonce,echostr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String check1(String signature,String timestamp,String nonce,String echostr) {
|
||||||
|
String[] arr = new String[]{TOKEN,timestamp,nonce};
|
||||||
|
Arrays.sort(arr);
|
||||||
|
StringBuilder content = new StringBuilder();
|
||||||
|
for (String s : arr) {
|
||||||
|
content.append(s);
|
||||||
|
}
|
||||||
|
String temp = SecureUtil.sha1(content.toString());
|
||||||
|
if (temp.equals(signature)){
|
||||||
|
return echostr;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
package com.ruoyi.web.controller.course;
|
||||||
|
|
||||||
|
import com.ruoyi.RestResponse;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Api(tags = "040-教练", description = "获取商品及课程分类")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/course/category")
|
||||||
|
public class CourseController extends BaseController {
|
||||||
|
// @Autowired
|
||||||
|
// ContextServicelmpl contextService;
|
||||||
|
// @Autowired
|
||||||
|
// SysUserServiceImpl userService;
|
||||||
|
|
||||||
|
@ApiOperation("商品及课程类型列表")
|
||||||
|
@PostMapping(value = "/getList")
|
||||||
|
public RestResponse findList(@RequestBody Map<String, Object> params) {
|
||||||
|
// List<Context> list =contextService.getList(params);
|
||||||
|
return new RestResponse().setSuccess(true).setMessage("成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,65 @@
|
|||||||
|
package com.ruoyi.web.controller.im;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.ruoyi.basic.service.YjAppUserService;
|
||||||
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||||
|
import com.ruoyi.common.core.domain.entity.AppUser;
|
||||||
|
import com.ruoyi.im.domain.vo.FriendVO;
|
||||||
|
import com.ruoyi.im.domain.vo.UserVO;
|
||||||
|
import com.ruoyi.im.service.FriendService;
|
||||||
|
import com.ruoyi.web.controller.im.result.Result;
|
||||||
|
import com.ruoyi.web.controller.im.result.ResultUtils;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/friend")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class FriendController {
|
||||||
|
|
||||||
|
private final FriendService friendService;
|
||||||
|
private final YjAppUserService appUserService;
|
||||||
|
@GetMapping("/list")
|
||||||
|
@Operation(summary = "好友列表", description = "获取好友列表")
|
||||||
|
public Result<List<FriendVO>> findFriends() {
|
||||||
|
return ResultUtils.success(friendService.findFriends());
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/find/{phonenumber}")
|
||||||
|
@Operation(summary = "查找用户", description = "根据电话查找用户")
|
||||||
|
public Result<UserVO> findById(@NotNull @PathVariable("phonenumber") String phonenumber) {
|
||||||
|
//权限:课程顾问 店长 教练 查询客户信息
|
||||||
|
//todo
|
||||||
|
AppUser appUser=appUserService.getOne(new QueryWrapper<AppUser>().eq("phoneNumber",phonenumber));
|
||||||
|
ResultUtils.success(appUser);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RepeatSubmit
|
||||||
|
@PostMapping("/add")
|
||||||
|
@Operation(summary = "添加好友", description = "双方建立好友关系")
|
||||||
|
public Result addFriend(@NotNull(message = "好友id不可为空") @RequestParam Long friendId) {
|
||||||
|
friendService.addFriend(friendId);
|
||||||
|
return ResultUtils.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/find/{friendId}")
|
||||||
|
@Operation(summary = "查找好友信息", description = "查找好友信息")
|
||||||
|
public Result<FriendVO> findFriend(@NotNull(message = "好友id不可为空") @PathVariable Long friendId) {
|
||||||
|
return ResultUtils.success(friendService.findFriend(friendId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{friendId}")
|
||||||
|
@Operation(summary = "删除好友", description = "解除好友关系")
|
||||||
|
public Result delFriend(@NotNull(message = "好友id不可为空") @PathVariable Long friendId) {
|
||||||
|
friendService.delFriend(friendId);
|
||||||
|
return ResultUtils.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,73 @@
|
|||||||
|
package com.ruoyi.web.controller.im;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.im.domain.dto.PrivateMessageDTO;
|
||||||
|
import com.ruoyi.im.domain.vo.FriendVO;
|
||||||
|
import com.ruoyi.im.domain.vo.PrivateMessageVO;
|
||||||
|
import com.ruoyi.im.service.FriendService;
|
||||||
|
import com.ruoyi.im.service.PrivateMessageService;
|
||||||
|
import com.ruoyi.web.controller.im.result.Result;
|
||||||
|
import com.ruoyi.web.controller.im.result.ResultUtils;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Tag(name = "私聊消息")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/message/private")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PrivateMessageController {
|
||||||
|
|
||||||
|
private final PrivateMessageService privateMessageService;
|
||||||
|
|
||||||
|
@PostMapping("/send")
|
||||||
|
@Operation(summary = "发送消息", description = "发送私聊消息")
|
||||||
|
public Result<PrivateMessageVO> sendMessage(@Valid @RequestBody PrivateMessageDTO vo) {
|
||||||
|
return ResultUtils.success(privateMessageService.sendMessage(vo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param minId 最大已读消息的id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/pullOfflineMessage")
|
||||||
|
@Operation(summary = "拉取离线消息", description = "拉取离线消息,消息将通过webscoket异步推送")
|
||||||
|
public Result pullOfflineMessage(@RequestParam Long minId) {
|
||||||
|
privateMessageService.pullOfflineMessage(minId);
|
||||||
|
return ResultUtils.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/readed")
|
||||||
|
@Operation(summary = "消息已读", description = "将会话中接收的消息状态置为已读")
|
||||||
|
public Result readedMessage(@RequestParam Long friendId) {
|
||||||
|
privateMessageService.readedMessage(friendId);
|
||||||
|
return ResultUtils.success();
|
||||||
|
}
|
||||||
|
@GetMapping("/maxReadedId")
|
||||||
|
@Operation(summary = "获取最大已读消息的id", description = "获取某个会话中已读消息的最大id")
|
||||||
|
public Result<Long> getMaxReadedId(@RequestParam Long friendId) {
|
||||||
|
return ResultUtils.success(privateMessageService.getMaxReadedId(friendId));
|
||||||
|
}
|
||||||
|
|
||||||
|
// @GetMapping("/history")
|
||||||
|
@Operation(summary = "查询聊天记录", description = "查询聊天记录")
|
||||||
|
public Result<List<PrivateMessageVO>> recallMessage(
|
||||||
|
@NotNull(message = "好友id不能为空") @RequestParam Long friendId,
|
||||||
|
@NotNull(message = "页码不能为空") @RequestParam Long page,
|
||||||
|
@NotNull(message = "size不能为空") @RequestParam Long size) {
|
||||||
|
return ResultUtils.success(privateMessageService.findHistoryMessage(friendId, page, size));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
package com.ruoyi.web.controller.im;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.common.config.WebrtcConfig;
|
||||||
|
import com.ruoyi.im.domain.vo.SystemConfigVO;
|
||||||
|
import com.ruoyi.web.controller.im.result.ResultUtils;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.ruoyi.web.controller.im.result.Result;
|
||||||
|
/**
|
||||||
|
* @author: blue
|
||||||
|
* @date: 2024-06-10
|
||||||
|
* @version: 1.0
|
||||||
|
*/
|
||||||
|
@Tag(name = "系统相关")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SystemController {
|
||||||
|
|
||||||
|
private final WebrtcConfig webrtcConfig;
|
||||||
|
|
||||||
|
@GetMapping("/config")
|
||||||
|
@Operation(summary = "加载系统配置", description = "加载系统配置")
|
||||||
|
public Result<SystemConfigVO> loadConfig() {
|
||||||
|
return ResultUtils.success(new SystemConfigVO(webrtcConfig));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
package com.ruoyi.web.controller.im;
|
||||||
|
|
||||||
|
import com.ruoyi.im.service.WebrtcPrivateService;
|
||||||
|
import com.ruoyi.web.controller.im.result.ResultUtils;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import com.ruoyi.web.controller.im.result.Result;
|
||||||
|
|
||||||
|
@Tag(name = "单人通话")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/webrtc/private")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class WebrtcPrivateController {
|
||||||
|
|
||||||
|
private final WebrtcPrivateService webrtcPrivateService;
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "呼叫视频通话")
|
||||||
|
@PostMapping("/call")
|
||||||
|
public Result call(@RequestParam Long uid, @RequestParam(defaultValue = "video") String mode,
|
||||||
|
@RequestBody String offer) {
|
||||||
|
webrtcPrivateService.call(uid, mode, offer);
|
||||||
|
return ResultUtils.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "接受视频通话")
|
||||||
|
@PostMapping("/accept")
|
||||||
|
public Result accept(@RequestParam Long uid, @RequestBody String answer) {
|
||||||
|
webrtcPrivateService.accept(uid, answer);
|
||||||
|
return ResultUtils.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "拒绝视频通话")
|
||||||
|
@PostMapping("/reject")
|
||||||
|
public Result reject(@RequestParam Long uid) {
|
||||||
|
webrtcPrivateService.reject(uid);
|
||||||
|
return ResultUtils.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "取消呼叫")
|
||||||
|
@PostMapping("/cancel")
|
||||||
|
public Result cancel(@RequestParam Long uid) {
|
||||||
|
webrtcPrivateService.cancel(uid);
|
||||||
|
return ResultUtils.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "呼叫失败")
|
||||||
|
@PostMapping("/failed")
|
||||||
|
public Result failed(@RequestParam Long uid, @RequestParam String reason) {
|
||||||
|
webrtcPrivateService.failed(uid, reason);
|
||||||
|
return ResultUtils.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "挂断")
|
||||||
|
@PostMapping("/handup")
|
||||||
|
public Result handup(@RequestParam Long uid) {
|
||||||
|
webrtcPrivateService.handup(uid);
|
||||||
|
return ResultUtils.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/candidate")
|
||||||
|
@Operation(summary = "同步candidate")
|
||||||
|
public Result candidate(@RequestParam Long uid, @RequestBody String candidate) {
|
||||||
|
webrtcPrivateService.candidate(uid, candidate);
|
||||||
|
return ResultUtils.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "心跳")
|
||||||
|
@PostMapping("/heartbeat")
|
||||||
|
public Result heartbeat(@RequestParam Long uid) {
|
||||||
|
webrtcPrivateService.heartbeat(uid);
|
||||||
|
return ResultUtils.success();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package com.ruoyi.web.controller.im.result;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Result<T> {
|
||||||
|
|
||||||
|
private int code;
|
||||||
|
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
private T data;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
package com.ruoyi.web.controller.im.result;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.common.im.enums.ResultCode;
|
||||||
|
|
||||||
|
public final class ResultUtils {
|
||||||
|
|
||||||
|
private ResultUtils() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> Result<T> success() {
|
||||||
|
Result<T> result = new Result<>();
|
||||||
|
result.setCode(ResultCode.SUCCESS.getCode());
|
||||||
|
result.setMessage(ResultCode.SUCCESS.getMsg());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> Result<T> success(T data) {
|
||||||
|
Result<T> result = new Result<>();
|
||||||
|
result.setCode(ResultCode.SUCCESS.getCode());
|
||||||
|
result.setMessage(ResultCode.SUCCESS.getMsg());
|
||||||
|
result.setData(data);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> Result<T> success(T data, String messsage) {
|
||||||
|
Result<T> result = new Result<>();
|
||||||
|
result.setCode(ResultCode.SUCCESS.getCode());
|
||||||
|
result.setMessage(messsage);
|
||||||
|
result.setData(data);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> Result<T> success(String messsage) {
|
||||||
|
Result<T> result = new Result<>();
|
||||||
|
result.setCode(ResultCode.SUCCESS.getCode());
|
||||||
|
result.setMessage(messsage);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> Result<T> error(Integer code, String messsage) {
|
||||||
|
Result<T> result = new Result<>();
|
||||||
|
result.setCode(code);
|
||||||
|
result.setMessage(messsage);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static <T> Result<T> error(ResultCode resultCode, String messsage) {
|
||||||
|
Result<T> result = new Result<>();
|
||||||
|
result.setCode(resultCode.getCode());
|
||||||
|
result.setMessage(messsage);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> Result<T> error(ResultCode resultCode) {
|
||||||
|
Result<T> result = new Result<>();
|
||||||
|
result.setCode(resultCode.getCode());
|
||||||
|
result.setMessage(resultCode.getMsg());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
package com.ruoyi.web.controller.im.session;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.common.im.model.IMSessionInfo;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class UserSession extends IMSessionInfo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名称
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户昵称
|
||||||
|
*/
|
||||||
|
private String nickName;
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
package com.ruoyi.web.controller.im.session;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.common.im.model.IMUserInfo;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: Blue
|
||||||
|
* @date: 2024-06-01
|
||||||
|
* @version: 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WebrtcGroupSession {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通话发起者
|
||||||
|
*/
|
||||||
|
private IMUserInfo host;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所有被邀请的用户列表
|
||||||
|
*/
|
||||||
|
private List<WebrtcUserInfo> userInfos;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已经进入通话的用户列表
|
||||||
|
*/
|
||||||
|
private List<IMUserInfo> inChatUsers = new LinkedList<>();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
package com.ruoyi.web.controller.im.session;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* webrtc 会话信息
|
||||||
|
* @Author Blue
|
||||||
|
* @Date 2022/10/21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WebrtcPrivateSession {
|
||||||
|
/**
|
||||||
|
* 发起者id
|
||||||
|
*/
|
||||||
|
private Long callerId;
|
||||||
|
/**
|
||||||
|
* 发起者终端类型
|
||||||
|
*/
|
||||||
|
private Integer callerTerminal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接受者id
|
||||||
|
*/
|
||||||
|
private Long acceptorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接受者终端类型
|
||||||
|
*/
|
||||||
|
private Integer acceptorTerminal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通话模式
|
||||||
|
*/
|
||||||
|
private String mode;
|
||||||
|
/**
|
||||||
|
* 开始聊天时间戳
|
||||||
|
*/
|
||||||
|
private Long chatTimeStamp;
|
||||||
|
}
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
package com.ruoyi.web.controller.im.session;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: Blue
|
||||||
|
* @date: 2024-06-02
|
||||||
|
* @version: 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "用户信息")
|
||||||
|
public class WebrtcUserInfo {
|
||||||
|
@Schema(description = "用户id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "用户昵称")
|
||||||
|
private String nickName;
|
||||||
|
|
||||||
|
@Schema(description = "用户头像")
|
||||||
|
private String headImage;
|
||||||
|
|
||||||
|
@Schema(description = "是否开启摄像头")
|
||||||
|
private Boolean isCamera;
|
||||||
|
|
||||||
|
@Schema(description = "是否开启麦克风")
|
||||||
|
private Boolean isMicroPhone;
|
||||||
|
}
|
||||||
@ -0,0 +1,88 @@
|
|||||||
|
package com.ruoyi.web.controller.mall;
|
||||||
|
|
||||||
|
import com.ruoyi.common.constant.Constants;
|
||||||
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.mall.domain.MemberCart;
|
||||||
|
import com.ruoyi.mall.domain.query.MemberCartQuery;
|
||||||
|
import com.ruoyi.mall.domain.vo.MemberCartVO;
|
||||||
|
import com.ruoyi.mall.service.impl.MemberCartService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cart")
|
||||||
|
public class MemberCartController {
|
||||||
|
@Autowired
|
||||||
|
private MemberCartService memberCartService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加购物车
|
||||||
|
*
|
||||||
|
* @return 购物车商品
|
||||||
|
*/
|
||||||
|
@PostMapping("add")
|
||||||
|
public ResponseEntity<Integer> add(@RequestBody MemberCart memberCart) {
|
||||||
|
return ResponseEntity.ok(memberCartService.insert(memberCart));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 购物车列表
|
||||||
|
*
|
||||||
|
* @return 购物车列表
|
||||||
|
*/
|
||||||
|
@GetMapping("list")
|
||||||
|
public ResponseEntity<List<MemberCartVO>> list() {
|
||||||
|
MemberCartQuery query = new MemberCartQuery();
|
||||||
|
query.setMemberId(SecurityUtils.getAppLoginUser().getAppUserId());
|
||||||
|
return ResponseEntity.ok(memberCartService.selectList(query, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前用户的购物车商品数量
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("goodscount")
|
||||||
|
public ResponseEntity<Integer> goodscount() {
|
||||||
|
return ResponseEntity.ok(memberCartService.mineCartNum());
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 当前用户的购物车商品id列表
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("cart-ids")
|
||||||
|
public ResponseEntity<List<Long>> cartIds() {
|
||||||
|
return ResponseEntity.ok(memberCartService.mineCartIds());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改购物车
|
||||||
|
*
|
||||||
|
* @return 是否修改
|
||||||
|
*/
|
||||||
|
@PostMapping("modify")
|
||||||
|
public ResponseEntity<Integer> modify(@Valid @RequestBody MemberCart memberCart) {
|
||||||
|
return ResponseEntity.ok(memberCartService.update(memberCart));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除购物车商品
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@DeleteMapping("remove")
|
||||||
|
public ResponseEntity<Integer> remove(@RequestBody Map<String,List<Long>> map) {
|
||||||
|
List<Long> ids=map.get("ids");
|
||||||
|
return ResponseEntity.ok(memberCartService.deleteByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,143 @@
|
|||||||
|
package com.ruoyi.web.controller.mall;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.ruoyi.mall.domain.dto.PayNotifyMessageDTO;
|
||||||
|
import com.ruoyi.mall.service.impl.OrderService;
|
||||||
|
import com.ruoyi.web.core.config.WechatPayConfig;
|
||||||
|
import com.wechat.pay.java.core.Config;
|
||||||
|
import com.wechat.pay.java.core.notification.NotificationConfig;
|
||||||
|
import com.wechat.pay.java.core.notification.NotificationParser;
|
||||||
|
import com.wechat.pay.java.core.notification.RequestParam;
|
||||||
|
import com.wechat.pay.java.service.partnerpayments.jsapi.model.Transaction;
|
||||||
|
import com.wechat.pay.java.service.refund.model.RefundNotification;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单表Controller
|
||||||
|
*
|
||||||
|
* @author sjm
|
||||||
|
* @date 2023-04-05
|
||||||
|
*/
|
||||||
|
@Api(description ="微信回调接口列表")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/no-auth/wechat")
|
||||||
|
public class PayNotifyController {
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(PayNotifyController.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OrderService OrderService;
|
||||||
|
// @Autowired
|
||||||
|
// private AftersaleService aftersaleService;
|
||||||
|
|
||||||
|
private final SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信支付回调
|
||||||
|
* @param request
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
@PostMapping("/notify")
|
||||||
|
public void weChatPayNotify(HttpServletRequest request) throws Exception {
|
||||||
|
log.info("收到了微信支付回调");
|
||||||
|
// 从请求头中获取信息
|
||||||
|
String timestamp = request.getHeader("Wechatpay-Timestamp");
|
||||||
|
String nonce = request.getHeader("Wechatpay-Nonce");
|
||||||
|
String signature = request.getHeader("Wechatpay-Signature");
|
||||||
|
String singType = request.getHeader("Wechatpay-Signature-Type");
|
||||||
|
String wechatPayCertificateSerialNumber = request.getHeader("Wechatpay-Serial");
|
||||||
|
// 拿到请求体body
|
||||||
|
StringBuilder requestBody = new StringBuilder();
|
||||||
|
String line;
|
||||||
|
BufferedReader reader;
|
||||||
|
reader = request.getReader();
|
||||||
|
while (null != (line = reader.readLine())) {
|
||||||
|
requestBody.append(line);
|
||||||
|
}
|
||||||
|
// 构造 RequestParam
|
||||||
|
RequestParam requestParam = new RequestParam.Builder()
|
||||||
|
.serialNumber(wechatPayCertificateSerialNumber)
|
||||||
|
.nonce(nonce)
|
||||||
|
.signature(signature)
|
||||||
|
.timestamp(timestamp)
|
||||||
|
.body(requestBody.toString())
|
||||||
|
.build();
|
||||||
|
// log.info("【requestParam】" + JSONObject.toJSON(requestParam));
|
||||||
|
//初始化了 RSAAutoCertificateConfig
|
||||||
|
Config config = WechatPayConfig.getInstance();
|
||||||
|
// 初始化解析器 NotificationParser
|
||||||
|
NotificationParser parser = new NotificationParser((NotificationConfig) config);
|
||||||
|
// 以支付通知回调为例,验签、解密并转换成 Transaction
|
||||||
|
Transaction transaction = parser.parse(requestParam, Transaction.class);
|
||||||
|
// log.info("【transaction】" + JSONObject.toJSON(transaction));
|
||||||
|
PayNotifyMessageDTO message = new PayNotifyMessageDTO();
|
||||||
|
message.setOutTradeNo(Long.valueOf(transaction.getOutTradeNo()));
|
||||||
|
message.setMemberId(Long.valueOf(transaction.getAttach()));
|
||||||
|
message.setTradeStatus(transaction.getTradeState());
|
||||||
|
if (StrUtil.isEmpty(transaction.getSuccessTime())){
|
||||||
|
throw new RuntimeException("微信支付回调失败");
|
||||||
|
}
|
||||||
|
message.setPayTime(formatter.parse(transaction.getSuccessTime().substring(0, transaction.getSuccessTime().indexOf("+"))));
|
||||||
|
message.setTradeNo(transaction.getTransactionId());
|
||||||
|
// OrderService.payCallBack(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @ApiOperation(value = "微信退款回调")
|
||||||
|
// @PostMapping("/weChatRefundNotify")
|
||||||
|
// public void weChatRefundNotify(HttpServletRequest request) throws IOException {
|
||||||
|
// log.info("收到了微信支付退款回调");
|
||||||
|
// // 从请求头中获取信息
|
||||||
|
// String timestamp = request.getHeader("Wechatpay-Timestamp");
|
||||||
|
// String nonce = request.getHeader("Wechatpay-Nonce");
|
||||||
|
// String signature = request.getHeader("Wechatpay-Signature");
|
||||||
|
// String singType = request.getHeader("Wechatpay-Signature-Type");
|
||||||
|
// String wechatPayCertificateSerialNumber = request.getHeader("Wechatpay-Serial");
|
||||||
|
// // 拿到请求体body
|
||||||
|
// StringBuilder requestBody = new StringBuilder();
|
||||||
|
// String line;
|
||||||
|
// BufferedReader reader;
|
||||||
|
// reader = request.getReader();
|
||||||
|
// while (null != (line = reader.readLine())) {
|
||||||
|
// requestBody.append(line);
|
||||||
|
// }
|
||||||
|
// // 构造 RequestParam
|
||||||
|
// RequestParam requestParam = new RequestParam.Builder()
|
||||||
|
// .serialNumber(wechatPayCertificateSerialNumber)
|
||||||
|
// .nonce(nonce)
|
||||||
|
// .signature(signature)
|
||||||
|
// .timestamp(timestamp)
|
||||||
|
// .body(requestBody.toString())
|
||||||
|
// .build();
|
||||||
|
//
|
||||||
|
// log.info("【requestParam】" + JSONObject.toJSON(requestParam));
|
||||||
|
// //初始化了 RSAAutoCertificateConfig
|
||||||
|
// Config config = WechatPayConfig.getInstance();
|
||||||
|
// // 初始化解析器 NotificationParser
|
||||||
|
// NotificationParser parser = new NotificationParser((NotificationConfig) config);
|
||||||
|
//
|
||||||
|
// //获取退款回调的信息
|
||||||
|
// RefundNotification refundInfo = parser.parse(requestParam, RefundNotification.class);
|
||||||
|
// aftersaleService.refundOrderExc(refundInfo);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,120 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.monitor;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Properties;
|
|
||||||
import java.util.Set;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.data.redis.core.RedisCallback;
|
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.constant.CacheConstants;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import com.ruoyi.system.domain.SysCache;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 缓存监控
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/monitor/cache")
|
|
||||||
public class CacheController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private RedisTemplate<String, String> redisTemplate;
|
|
||||||
|
|
||||||
private final static List<SysCache> caches = new ArrayList<SysCache>();
|
|
||||||
{
|
|
||||||
caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "用户信息"));
|
|
||||||
caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "配置信息"));
|
|
||||||
caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "数据字典"));
|
|
||||||
caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "验证码"));
|
|
||||||
caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交"));
|
|
||||||
caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理"));
|
|
||||||
caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
|
||||||
@GetMapping()
|
|
||||||
public AjaxResult getInfo() throws Exception
|
|
||||||
{
|
|
||||||
Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info());
|
|
||||||
Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats"));
|
|
||||||
Object dbSize = redisTemplate.execute((RedisCallback<Object>) connection -> connection.dbSize());
|
|
||||||
|
|
||||||
Map<String, Object> result = new HashMap<>(3);
|
|
||||||
result.put("info", info);
|
|
||||||
result.put("dbSize", dbSize);
|
|
||||||
|
|
||||||
List<Map<String, String>> pieList = new ArrayList<>();
|
|
||||||
commandStats.stringPropertyNames().forEach(key -> {
|
|
||||||
Map<String, String> data = new HashMap<>(2);
|
|
||||||
String property = commandStats.getProperty(key);
|
|
||||||
data.put("name", StringUtils.removeStart(key, "cmdstat_"));
|
|
||||||
data.put("value", StringUtils.substringBetween(property, "calls=", ",usec"));
|
|
||||||
pieList.add(data);
|
|
||||||
});
|
|
||||||
result.put("commandStats", pieList);
|
|
||||||
return AjaxResult.success(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
|
||||||
@GetMapping("/getNames")
|
|
||||||
public AjaxResult cache()
|
|
||||||
{
|
|
||||||
return AjaxResult.success(caches);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
|
||||||
@GetMapping("/getKeys/{cacheName}")
|
|
||||||
public AjaxResult getCacheKeys(@PathVariable String cacheName)
|
|
||||||
{
|
|
||||||
Set<String> cacheKeys = redisTemplate.keys(cacheName + "*");
|
|
||||||
return AjaxResult.success(cacheKeys);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
|
||||||
@GetMapping("/getValue/{cacheName}/{cacheKey}")
|
|
||||||
public AjaxResult getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey)
|
|
||||||
{
|
|
||||||
String cacheValue = redisTemplate.opsForValue().get(cacheKey);
|
|
||||||
SysCache sysCache = new SysCache(cacheName, cacheKey, cacheValue);
|
|
||||||
return AjaxResult.success(sysCache);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
|
||||||
@DeleteMapping("/clearCacheName/{cacheName}")
|
|
||||||
public AjaxResult clearCacheName(@PathVariable String cacheName)
|
|
||||||
{
|
|
||||||
Collection<String> cacheKeys = redisTemplate.keys(cacheName + "*");
|
|
||||||
redisTemplate.delete(cacheKeys);
|
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
|
||||||
@DeleteMapping("/clearCacheKey/{cacheKey}")
|
|
||||||
public AjaxResult clearCacheKey(@PathVariable String cacheKey)
|
|
||||||
{
|
|
||||||
redisTemplate.delete(cacheKey);
|
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
|
||||||
@DeleteMapping("/clearCacheAll")
|
|
||||||
public AjaxResult clearCacheAll()
|
|
||||||
{
|
|
||||||
Collection<String> cacheKeys = redisTemplate.keys("*");
|
|
||||||
redisTemplate.delete(cacheKeys);
|
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.monitor;
|
|
||||||
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.framework.web.domain.Server;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 服务器监控
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/monitor/server")
|
|
||||||
public class ServerController
|
|
||||||
{
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:server:list')")
|
|
||||||
@GetMapping()
|
|
||||||
public AjaxResult getInfo() throws Exception
|
|
||||||
{
|
|
||||||
Server server = new Server();
|
|
||||||
server.copyTo();
|
|
||||||
return AjaxResult.success(server);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,82 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.monitor;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.framework.web.service.SysPasswordService;
|
|
||||||
import com.ruoyi.system.domain.SysLogininfor;
|
|
||||||
import com.ruoyi.system.service.ISysLogininforService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统访问记录
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/monitor/logininfor")
|
|
||||||
public class SysLogininforController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ISysLogininforService logininforService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SysPasswordService passwordService;
|
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(SysLogininfor logininfor)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:export')")
|
|
||||||
@PostMapping("/export")
|
|
||||||
public void export(HttpServletResponse response, SysLogininfor logininfor)
|
|
||||||
{
|
|
||||||
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
|
||||||
ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
|
|
||||||
util.exportExcel(response, list, "登录日志");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
|
|
||||||
@Log(title = "登录日志", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{infoIds}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] infoIds)
|
|
||||||
{
|
|
||||||
return toAjax(logininforService.deleteLogininforByIds(infoIds));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
|
|
||||||
@Log(title = "登录日志", businessType = BusinessType.CLEAN)
|
|
||||||
@DeleteMapping("/clean")
|
|
||||||
public AjaxResult clean()
|
|
||||||
{
|
|
||||||
logininforService.cleanLogininfor();
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:unlock')")
|
|
||||||
@Log(title = "账户解锁", businessType = BusinessType.OTHER)
|
|
||||||
@GetMapping("/unlock/{userName}")
|
|
||||||
public AjaxResult unlock(@PathVariable("userName") String userName)
|
|
||||||
{
|
|
||||||
passwordService.clearLoginRecordCache(userName);
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,69 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.monitor;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.system.domain.SysOperLog;
|
|
||||||
import com.ruoyi.system.service.ISysOperLogService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 操作日志记录
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/monitor/operlog")
|
|
||||||
public class SysOperlogController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ISysOperLogService operLogService;
|
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:operlog:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(SysOperLog operLog)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:operlog:export')")
|
|
||||||
@PostMapping("/export")
|
|
||||||
public void export(HttpServletResponse response, SysOperLog operLog)
|
|
||||||
{
|
|
||||||
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
|
||||||
ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
|
|
||||||
util.exportExcel(response, list, "操作日志");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log(title = "操作日志", businessType = BusinessType.DELETE)
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
|
|
||||||
@DeleteMapping("/{operIds}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] operIds)
|
|
||||||
{
|
|
||||||
return toAjax(operLogService.deleteOperLogByIds(operIds));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
|
|
||||||
@DeleteMapping("/clean")
|
|
||||||
public AjaxResult clean()
|
|
||||||
{
|
|
||||||
operLogService.cleanOperLog();
|
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,92 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.monitor;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.constant.CacheConstants;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
import com.ruoyi.common.core.redis.RedisCache;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import com.ruoyi.system.domain.SysUserOnline;
|
|
||||||
import com.ruoyi.system.service.ISysUserOnlineService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 在线用户监控
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/monitor/online")
|
|
||||||
public class SysUserOnlineController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ISysUserOnlineService userOnlineService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RedisCache redisCache;
|
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:online:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(String ipaddr, String userName)
|
|
||||||
{
|
|
||||||
Collection<String> keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*");
|
|
||||||
List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>();
|
|
||||||
for (String key : keys)
|
|
||||||
{
|
|
||||||
LoginUser user = redisCache.getCacheObject(key);
|
|
||||||
if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName))
|
|
||||||
{
|
|
||||||
if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername()))
|
|
||||||
{
|
|
||||||
userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (StringUtils.isNotEmpty(ipaddr))
|
|
||||||
{
|
|
||||||
if (StringUtils.equals(ipaddr, user.getIpaddr()))
|
|
||||||
{
|
|
||||||
userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser()))
|
|
||||||
{
|
|
||||||
if (StringUtils.equals(userName, user.getUsername()))
|
|
||||||
{
|
|
||||||
userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
userOnlineList.add(userOnlineService.loginUserToUserOnline(user));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Collections.reverse(userOnlineList);
|
|
||||||
userOnlineList.removeAll(Collections.singleton(null));
|
|
||||||
return getDataTable(userOnlineList);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 强退用户
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')")
|
|
||||||
@Log(title = "在线用户", businessType = BusinessType.FORCE)
|
|
||||||
@DeleteMapping("/{tokenId}")
|
|
||||||
public AjaxResult forceLogout(@PathVariable String tokenId)
|
|
||||||
{
|
|
||||||
redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId);
|
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.search;
|
|
||||||
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
|
||||||
import com.ruoyi.search.domain.MemberUserWo;
|
|
||||||
import com.ruoyi.search.service.MemberUserServicelmpl;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/member_user")
|
|
||||||
public class MemberUserController extends BaseController {
|
|
||||||
@Autowired
|
|
||||||
MemberUserServicelmpl memberuserService;
|
|
||||||
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(@RequestParam Map map) {
|
|
||||||
startPage();
|
|
||||||
map.put("stroreId", SecurityUtils.getMerchanId());
|
|
||||||
List<MemberUserWo> list = memberuserService.getList(map);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// @PostMapping(value = "/getList")
|
|
||||||
// public RestResponse findList1(@RequestBody Map<String, Object> params) {
|
|
||||||
// List<MemberUser> list =memberuserService.findList((String) params.get("memberName"));
|
|
||||||
// return new RestResponse().setSuccess(true).setMessage("成功").setData(list);
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
@ -1,134 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.system;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.system.domain.SysConfig;
|
|
||||||
import com.ruoyi.system.service.ISysConfigService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参数配置 信息操作处理
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/system/config")
|
|
||||||
public class SysConfigController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ISysConfigService configService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取参数配置列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:config:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(SysConfig config)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<SysConfig> list = configService.selectConfigList(config);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:config:export')")
|
|
||||||
@PostMapping("/export")
|
|
||||||
public void export(HttpServletResponse response, SysConfig config)
|
|
||||||
{
|
|
||||||
List<SysConfig> list = configService.selectConfigList(config);
|
|
||||||
ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
|
|
||||||
util.exportExcel(response, list, "参数数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据参数编号获取详细信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:config:query')")
|
|
||||||
@GetMapping(value = "/{configId}")
|
|
||||||
public AjaxResult getInfo(@PathVariable Long configId)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(configService.selectConfigById(configId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据参数键名查询参数值
|
|
||||||
*/
|
|
||||||
@GetMapping(value = "/configKey/{configKey}")
|
|
||||||
public AjaxResult getConfigKey(@PathVariable String configKey)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(configService.selectConfigByKey(configKey));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增参数配置
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:config:add')")
|
|
||||||
@Log(title = "参数管理", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@Validated @RequestBody SysConfig config)
|
|
||||||
{
|
|
||||||
if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
|
||||||
}
|
|
||||||
config.setCreateBy(getUsername());
|
|
||||||
return toAjax(configService.insertConfig(config));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改参数配置
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:config:edit')")
|
|
||||||
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult edit(@Validated @RequestBody SysConfig config)
|
|
||||||
{
|
|
||||||
if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
|
||||||
}
|
|
||||||
config.setUpdateBy(getUsername());
|
|
||||||
return toAjax(configService.updateConfig(config));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除参数配置
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
|
||||||
@Log(title = "参数管理", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{configIds}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] configIds)
|
|
||||||
{
|
|
||||||
configService.deleteConfigByIds(configIds);
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 刷新参数缓存
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
|
||||||
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
|
|
||||||
@DeleteMapping("/refreshCache")
|
|
||||||
public AjaxResult refreshCache()
|
|
||||||
{
|
|
||||||
configService.resetConfigCache();
|
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,139 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.system;
|
|
||||||
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.shop.domain.YjMerchant;
|
|
||||||
import com.ruoyi.shop.service.impl.YjMerchantServiceImpl;
|
|
||||||
import com.ruoyi.system.service.ISysDictDataService;
|
|
||||||
import com.ruoyi.system.service.ISysDictTypeService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 数据字典信息
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/system/dict/data")
|
|
||||||
public class SysDictDataController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ISysDictDataService dictDataService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysDictTypeService dictTypeService;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private YjMerchantServiceImpl merchantService;
|
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(SysDictData dictData)
|
|
||||||
{
|
|
||||||
dictData.setMerchantId(SecurityUtils.getMerchanId());
|
|
||||||
startPage();
|
|
||||||
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:export')")
|
|
||||||
@PostMapping("/export")
|
|
||||||
public void export(HttpServletResponse response, SysDictData dictData)
|
|
||||||
{
|
|
||||||
dictData.setMerchantId(SecurityUtils.getMerchanId());
|
|
||||||
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
|
||||||
ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
|
|
||||||
util.exportExcel(response, list, "字典数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询字典数据详细
|
|
||||||
*/
|
|
||||||
// @PreAuthorize("@ss.hasPermi('system:dict:query')")
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
|
||||||
@GetMapping(value = "/{dictCode}")
|
|
||||||
public AjaxResult getInfo(@PathVariable Long dictCode)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(dictDataService.selectDictDataById(dictCode));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据字典类型查询字典数据信息
|
|
||||||
*/
|
|
||||||
@GetMapping(value = "/type/{dictType}")
|
|
||||||
public AjaxResult dictType(@PathVariable String dictType)
|
|
||||||
{
|
|
||||||
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
|
|
||||||
if (StringUtils.isNull(data))
|
|
||||||
{
|
|
||||||
data = new ArrayList<SysDictData>();
|
|
||||||
}
|
|
||||||
return AjaxResult.success(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增字典类型
|
|
||||||
*/
|
|
||||||
// @PreAuthorize("@ss.hasPermi('system:dict:add')")
|
|
||||||
// @Log(title = "字典数据", businessType = BusinessType.INSERT)
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@Validated @RequestBody SysDictData dict)
|
|
||||||
{
|
|
||||||
dict.setCreateBy(getUsername());
|
|
||||||
List<YjMerchant> list= merchantService.list();
|
|
||||||
for (YjMerchant m:list){
|
|
||||||
dict.setMerchantId(m.getId());
|
|
||||||
dictDataService.insertDictData(dict);
|
|
||||||
}
|
|
||||||
return toAjax(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改保存字典类型
|
|
||||||
*/
|
|
||||||
// @PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
|
||||||
// @Log(title = "字典数据", businessType = BusinessType.UPDATE)
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult edit(@Validated @RequestBody SysDictData dict)
|
|
||||||
{
|
|
||||||
if (!SecurityUtils.getUserId().equals(1)) {
|
|
||||||
SysDictData d=new SysDictData();
|
|
||||||
d.setDictCode(dict.getDictCode());
|
|
||||||
d.setDictLabel(dict.getDictLabel());
|
|
||||||
return toAjax(dictDataService.updateDictData(d));
|
|
||||||
}
|
|
||||||
dict.setUpdateBy(getUsername());
|
|
||||||
return toAjax(dictDataService.updateDictData(dict));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除字典类型
|
|
||||||
*/
|
|
||||||
// @PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
|
||||||
// @Log(title = "字典类型", businessType = BusinessType.DELETE)
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
|
||||||
@DeleteMapping("/{dictCodes}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] dictCodes)
|
|
||||||
{
|
|
||||||
dictDataService.deleteDictDataByIds(dictCodes);
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,134 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.system;
|
|
||||||
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysDictType;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.system.mapper.SysDictTypeMapper;
|
|
||||||
import com.ruoyi.system.service.ISysDictTypeService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 数据字典信息
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/system/dict/type")
|
|
||||||
public class SysDictTypeController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ISysDictTypeService dictTypeService;
|
|
||||||
@Resource
|
|
||||||
private SysDictTypeMapper dictTypeMapper;
|
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(SysDictType dictType){
|
|
||||||
startPage();
|
|
||||||
List<SysDictType> list ;
|
|
||||||
if (SecurityUtils.getMerchanId().equals("1")){
|
|
||||||
list = dictTypeService.selectDictTypeList(dictType);
|
|
||||||
}else {
|
|
||||||
list = dictTypeMapper.selectDictTypeList1(dictType);
|
|
||||||
}
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:export')")
|
|
||||||
@PostMapping("/export")
|
|
||||||
public void export(HttpServletResponse response, SysDictType dictType)
|
|
||||||
{
|
|
||||||
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
|
||||||
ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
|
|
||||||
util.exportExcel(response, list, "字典类型");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询字典类型详细
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:query')")
|
|
||||||
@GetMapping(value = "/{dictId}")
|
|
||||||
public AjaxResult getInfo(@PathVariable Long dictId)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(dictTypeService.selectDictTypeById(dictId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增字典类型
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:add')")
|
|
||||||
@Log(title = "字典类型", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@Validated @RequestBody SysDictType dict){
|
|
||||||
if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
|
||||||
}
|
|
||||||
dict.setCreateBy(getUsername());
|
|
||||||
return toAjax(dictTypeService.insertDictType(dict));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改字典类型
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
|
||||||
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult edit(@Validated @RequestBody SysDictType dict)
|
|
||||||
{
|
|
||||||
if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
|
||||||
}
|
|
||||||
dict.setUpdateBy(getUsername());
|
|
||||||
return toAjax(dictTypeService.updateDictType(dict));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除字典类型
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
|
||||||
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{dictIds}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] dictIds)
|
|
||||||
{
|
|
||||||
dictTypeService.deleteDictTypeByIds(dictIds);
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 刷新字典缓存
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
|
||||||
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
|
|
||||||
@DeleteMapping("/refreshCache")
|
|
||||||
public AjaxResult refreshCache()
|
|
||||||
{
|
|
||||||
dictTypeService.resetDictCache();
|
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取字典选择框列表
|
|
||||||
*/
|
|
||||||
@GetMapping("/optionselect")
|
|
||||||
public AjaxResult optionselect()
|
|
||||||
{
|
|
||||||
List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
|
|
||||||
return AjaxResult.success(dictTypes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,86 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.system;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.constant.Constants;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysMenu;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
||||||
import com.ruoyi.common.core.domain.model.LoginBody;
|
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
|
||||||
import com.ruoyi.framework.web.service.SysLoginService;
|
|
||||||
import com.ruoyi.framework.web.service.SysPermissionService;
|
|
||||||
import com.ruoyi.system.service.ISysMenuService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 登录验证
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
public class SysLoginController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private SysLoginService loginService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysMenuService menuService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SysPermissionService permissionService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 登录方法
|
|
||||||
*
|
|
||||||
* @param loginBody 登录信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@PostMapping("/login")
|
|
||||||
public AjaxResult login(@RequestBody LoginBody loginBody)
|
|
||||||
{
|
|
||||||
AjaxResult ajax = AjaxResult.success();
|
|
||||||
// 生成令牌
|
|
||||||
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
|
|
||||||
loginBody.getUuid());
|
|
||||||
ajax.put(Constants.TOKEN, token);
|
|
||||||
return ajax;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取用户信息
|
|
||||||
*
|
|
||||||
* @return 用户信息
|
|
||||||
*/
|
|
||||||
@GetMapping("getInfo")
|
|
||||||
public AjaxResult getInfo()
|
|
||||||
{
|
|
||||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
|
||||||
// 角色集合
|
|
||||||
Set<String> roles = permissionService.getRolePermission(user);
|
|
||||||
// 权限集合
|
|
||||||
Set<String> permissions = permissionService.getMenuPermission(user);
|
|
||||||
AjaxResult ajax = AjaxResult.success();
|
|
||||||
ajax.put("user", user);
|
|
||||||
ajax.put("roles", roles);
|
|
||||||
ajax.put("permissions", permissions);
|
|
||||||
return ajax;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取路由信息
|
|
||||||
*
|
|
||||||
* @return 路由信息
|
|
||||||
*/
|
|
||||||
@GetMapping("getRouters")
|
|
||||||
public AjaxResult getRouters()
|
|
||||||
{
|
|
||||||
Long userId = SecurityUtils.getUserId();
|
|
||||||
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
|
|
||||||
return AjaxResult.success(menuService.buildMenus(menus));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,91 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.system;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.ruoyi.system.domain.SysNotice;
|
|
||||||
import com.ruoyi.system.service.ISysNoticeService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公告 信息操作处理
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/system/notice")
|
|
||||||
public class SysNoticeController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ISysNoticeService noticeService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取通知公告列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:notice:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(SysNotice notice)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<SysNotice> list = noticeService.selectNoticeList(notice);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据通知公告编号获取详细信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:notice:query')")
|
|
||||||
@GetMapping(value = "/{noticeId}")
|
|
||||||
public AjaxResult getInfo(@PathVariable Long noticeId)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(noticeService.selectNoticeById(noticeId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增通知公告
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:notice:add')")
|
|
||||||
@Log(title = "通知公告", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@Validated @RequestBody SysNotice notice)
|
|
||||||
{
|
|
||||||
notice.setCreateBy(getUsername());
|
|
||||||
return toAjax(noticeService.insertNotice(notice));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改通知公告
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:notice:edit')")
|
|
||||||
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult edit(@Validated @RequestBody SysNotice notice)
|
|
||||||
{
|
|
||||||
notice.setUpdateBy(getUsername());
|
|
||||||
return toAjax(noticeService.updateNotice(notice));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除通知公告
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:notice:remove')")
|
|
||||||
@Log(title = "通知公告", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{noticeIds}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] noticeIds)
|
|
||||||
{
|
|
||||||
return toAjax(noticeService.deleteNoticeByIds(noticeIds));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,133 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.system;
|
|
||||||
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.framework.web.service.TokenService;
|
|
||||||
import com.ruoyi.system.domain.SysPost;
|
|
||||||
import com.ruoyi.system.service.ISysPostService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 岗位信息操作处理
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/system/post")
|
|
||||||
public class SysPostController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ISysPostService postService;
|
|
||||||
@Resource
|
|
||||||
private TokenService tokenService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取岗位列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:post:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(SysPost post, HttpServletRequest request){
|
|
||||||
SysUser loginUser=tokenService.getLoginUser(request).getUser();
|
|
||||||
post.setMerchanId(loginUser.getMerchantId());
|
|
||||||
startPage();
|
|
||||||
List<SysPost> list = postService.selectPostList(post);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:post:export')")
|
|
||||||
@PostMapping("/export")
|
|
||||||
public void export(HttpServletResponse response, SysPost post)
|
|
||||||
{
|
|
||||||
List<SysPost> list = postService.selectPostList(post);
|
|
||||||
ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
|
|
||||||
util.exportExcel(response, list, "岗位数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据岗位编号获取详细信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:post:query')")
|
|
||||||
@GetMapping(value = "/{postId}")
|
|
||||||
public AjaxResult getInfo(@PathVariable Long postId)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(postService.selectPostById(postId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增岗位
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:post:add')")
|
|
||||||
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@Validated @RequestBody SysPost post, HttpServletRequest request){
|
|
||||||
SysUser loginUser=tokenService.getLoginUser(request).getUser();
|
|
||||||
post.setMerchanId(loginUser.getMerchantId());
|
|
||||||
|
|
||||||
if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
|
||||||
}
|
|
||||||
else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
|
||||||
}
|
|
||||||
post.setCreateBy(getUsername());
|
|
||||||
return toAjax(postService.insertPost(post));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改岗位
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:post:edit')")
|
|
||||||
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult edit(@Validated @RequestBody SysPost post)
|
|
||||||
{
|
|
||||||
if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
|
||||||
}
|
|
||||||
else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
|
||||||
}
|
|
||||||
post.setUpdateBy(getUsername());
|
|
||||||
return toAjax(postService.updatePost(post));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除岗位
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:post:remove')")
|
|
||||||
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{postIds}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] postIds)
|
|
||||||
{
|
|
||||||
return toAjax(postService.deletePostByIds(postIds));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取岗位选择框列表
|
|
||||||
*/
|
|
||||||
@GetMapping("/optionselect")
|
|
||||||
public AjaxResult optionselect(HttpServletRequest request){
|
|
||||||
SysUser loginUser=tokenService.getLoginUser(request).getUser();
|
|
||||||
List<SysPost> posts = postService.selectPostAll(loginUser.getMerchantId());
|
|
||||||
return AjaxResult.success(posts);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,144 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.system;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.config.RuoYiConfig;
|
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
||||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
|
||||||
import com.ruoyi.common.utils.file.MimeTypeUtils;
|
|
||||||
import com.ruoyi.framework.web.service.TokenService;
|
|
||||||
import com.ruoyi.system.service.ISysUserService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 个人信息 业务处理
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/system/user/profile")
|
|
||||||
public class SysProfileController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ISysUserService userService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private TokenService tokenService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 个人信息
|
|
||||||
*/
|
|
||||||
@GetMapping
|
|
||||||
public AjaxResult profile()
|
|
||||||
{
|
|
||||||
LoginUser loginUser = getLoginUser();
|
|
||||||
SysUser user = loginUser.getUser();
|
|
||||||
AjaxResult ajax = AjaxResult.success(user);
|
|
||||||
ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
|
|
||||||
ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername()));
|
|
||||||
return ajax;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改用户
|
|
||||||
*/
|
|
||||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult updateProfile(@RequestBody SysUser user)
|
|
||||||
{
|
|
||||||
LoginUser loginUser = getLoginUser();
|
|
||||||
SysUser sysUser = loginUser.getUser();
|
|
||||||
user.setUserName(sysUser.getUserName());
|
|
||||||
if (StringUtils.isNotEmpty(user.getPhonenumber())
|
|
||||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotEmpty(user.getEmail())
|
|
||||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
|
||||||
}
|
|
||||||
user.setUserId(sysUser.getUserId());
|
|
||||||
user.setPassword(null);
|
|
||||||
user.setAvatar(null);
|
|
||||||
user.setDeptId(null);
|
|
||||||
if (userService.updateUserProfile(user) > 0)
|
|
||||||
{
|
|
||||||
// 更新缓存用户信息
|
|
||||||
sysUser.setNickName(user.getNickName());
|
|
||||||
sysUser.setPhonenumber(user.getPhonenumber());
|
|
||||||
sysUser.setEmail(user.getEmail());
|
|
||||||
sysUser.setSex(user.getSex());
|
|
||||||
tokenService.setLoginUser(loginUser);
|
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
|
||||||
return AjaxResult.error("修改个人信息异常,请联系管理员");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 重置密码
|
|
||||||
*/
|
|
||||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping("/updatePwd")
|
|
||||||
public AjaxResult updatePwd(String oldPassword, String newPassword)
|
|
||||||
{
|
|
||||||
LoginUser loginUser = getLoginUser();
|
|
||||||
String userName = loginUser.getUsername();
|
|
||||||
String password = loginUser.getPassword();
|
|
||||||
if (!SecurityUtils.matchesPassword(oldPassword, password))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改密码失败,旧密码错误");
|
|
||||||
}
|
|
||||||
if (SecurityUtils.matchesPassword(newPassword, password))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新密码不能与旧密码相同");
|
|
||||||
}
|
|
||||||
if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0)
|
|
||||||
{
|
|
||||||
// 更新缓存用户密码
|
|
||||||
loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword));
|
|
||||||
tokenService.setLoginUser(loginUser);
|
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
|
||||||
return AjaxResult.error("修改密码异常,请联系管理员");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 头像上传
|
|
||||||
*/
|
|
||||||
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
|
|
||||||
@PostMapping("/avatar")
|
|
||||||
public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception
|
|
||||||
{
|
|
||||||
if (!file.isEmpty())
|
|
||||||
{
|
|
||||||
LoginUser loginUser = getLoginUser();
|
|
||||||
String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION);
|
|
||||||
if (userService.updateUserAvatar(loginUser.getUsername(), avatar))
|
|
||||||
{
|
|
||||||
AjaxResult ajax = AjaxResult.success();
|
|
||||||
ajax.put("imgUrl", avatar);
|
|
||||||
// 更新缓存用户头像
|
|
||||||
loginUser.getUser().setAvatar(avatar);
|
|
||||||
tokenService.setLoginUser(loginUser);
|
|
||||||
return ajax;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return AjaxResult.error("上传图片异常,请联系管理员");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.system;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.domain.model.RegisterBody;
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import com.ruoyi.framework.web.service.SysRegisterService;
|
|
||||||
import com.ruoyi.system.service.ISysConfigService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 注册验证
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
public class SysRegisterController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private SysRegisterService registerService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysConfigService configService;
|
|
||||||
|
|
||||||
@PostMapping("/register")
|
|
||||||
public AjaxResult register(@RequestBody RegisterBody user)
|
|
||||||
{
|
|
||||||
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser"))))
|
|
||||||
{
|
|
||||||
return error("当前系统没有开启注册功能!");
|
|
||||||
}
|
|
||||||
String msg = registerService.register(user);
|
|
||||||
return StringUtils.isEmpty(msg) ? success() : error(msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,260 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.system;
|
|
||||||
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
||||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.framework.web.service.SysPermissionService;
|
|
||||||
import com.ruoyi.framework.web.service.TokenService;
|
|
||||||
import com.ruoyi.system.domain.SysUserRole;
|
|
||||||
import com.ruoyi.system.service.ISysDeptService;
|
|
||||||
import com.ruoyi.system.service.ISysRoleService;
|
|
||||||
import com.ruoyi.system.service.ISysUserService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 角色信息
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/system/role")
|
|
||||||
public class SysRoleController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ISysRoleService roleService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private TokenService tokenService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SysPermissionService permissionService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysUserService userService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysDeptService deptService;
|
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(SysRole role)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<SysRole> list = roleService.selectRoleList(role);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:export')")
|
|
||||||
@PostMapping("/export")
|
|
||||||
public void export(HttpServletResponse response, SysRole role)
|
|
||||||
{
|
|
||||||
List<SysRole> list = roleService.selectRoleList(role);
|
|
||||||
ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
|
|
||||||
util.exportExcel(response, list, "角色数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据角色编号获取详细信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
|
||||||
@GetMapping(value = "/{roleId}")
|
|
||||||
public AjaxResult getInfo(@PathVariable Long roleId)
|
|
||||||
{
|
|
||||||
roleService.checkRoleDataScope(roleId);
|
|
||||||
return AjaxResult.success(roleService.selectRoleById(roleId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增角色
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:add')")
|
|
||||||
@Log(title = "角色管理", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@Validated @RequestBody SysRole role)
|
|
||||||
{
|
|
||||||
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
|
||||||
}
|
|
||||||
else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
|
||||||
}
|
|
||||||
role.setCreateBy(getUsername());
|
|
||||||
return toAjax(roleService.insertRole(role));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改保存角色
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
|
||||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult edit(@Validated @RequestBody SysRole role)
|
|
||||||
{
|
|
||||||
roleService.checkRoleAllowed(role);
|
|
||||||
roleService.checkRoleDataScope(role.getRoleId());
|
|
||||||
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
|
||||||
}
|
|
||||||
else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
|
||||||
}
|
|
||||||
role.setUpdateBy(getUsername());
|
|
||||||
|
|
||||||
if (roleService.updateRole(role) > 0)
|
|
||||||
{
|
|
||||||
// 更新缓存用户权限
|
|
||||||
LoginUser loginUser = getLoginUser();
|
|
||||||
if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin())
|
|
||||||
{
|
|
||||||
loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
|
|
||||||
loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
|
|
||||||
tokenService.setLoginUser(loginUser);
|
|
||||||
}
|
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
|
||||||
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,请联系管理员");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改保存数据权限
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
|
||||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping("/dataScope")
|
|
||||||
public AjaxResult dataScope(@RequestBody SysRole role)
|
|
||||||
{
|
|
||||||
roleService.checkRoleAllowed(role);
|
|
||||||
roleService.checkRoleDataScope(role.getRoleId());
|
|
||||||
return toAjax(roleService.authDataScope(role));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态修改
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
|
||||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping("/changeStatus")
|
|
||||||
public AjaxResult changeStatus(@RequestBody SysRole role)
|
|
||||||
{
|
|
||||||
roleService.checkRoleAllowed(role);
|
|
||||||
roleService.checkRoleDataScope(role.getRoleId());
|
|
||||||
role.setUpdateBy(getUsername());
|
|
||||||
return toAjax(roleService.updateRoleStatus(role));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除角色
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:remove')")
|
|
||||||
@Log(title = "角色管理", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{roleIds}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] roleIds)
|
|
||||||
{
|
|
||||||
return toAjax(roleService.deleteRoleByIds(roleIds));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取角色选择框列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
|
||||||
@GetMapping("/optionselect")
|
|
||||||
public AjaxResult optionselect()
|
|
||||||
{
|
|
||||||
return AjaxResult.success(roleService.selectRoleAll());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询已分配用户角色列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
|
||||||
@GetMapping("/authUser/allocatedList")
|
|
||||||
public TableDataInfo allocatedList(SysUser user)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<SysUser> list = userService.selectAllocatedList(user);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询未分配用户角色列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
|
||||||
@GetMapping("/authUser/unallocatedList")
|
|
||||||
public TableDataInfo unallocatedList(SysUser user)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<SysUser> list = userService.selectUnallocatedList(user);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 取消授权用户
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
|
||||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
|
||||||
@PutMapping("/authUser/cancel")
|
|
||||||
public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole)
|
|
||||||
{
|
|
||||||
return toAjax(roleService.deleteAuthUser(userRole));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量取消授权用户
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
|
||||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
|
||||||
@PutMapping("/authUser/cancelAll")
|
|
||||||
public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds)
|
|
||||||
{
|
|
||||||
return toAjax(roleService.deleteAuthUsers(roleId, userIds));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量选择用户授权
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
|
||||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
|
||||||
@PutMapping("/authUser/selectAll")
|
|
||||||
public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds)
|
|
||||||
{
|
|
||||||
roleService.checkRoleDataScope(roleId);
|
|
||||||
return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取对应角色部门树列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
|
||||||
@GetMapping(value = "/deptTree/{roleId}")
|
|
||||||
public AjaxResult deptTree(@PathVariable("roleId") Long roleId, HttpServletRequest request){
|
|
||||||
SysUser loginUser=tokenService.getLoginUser(request).getUser();
|
|
||||||
SysDept dept=new SysDept();
|
|
||||||
dept.setMerchanId(loginUser.getMerchantId());
|
|
||||||
AjaxResult ajax = AjaxResult.success();
|
|
||||||
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
|
|
||||||
ajax.put("depts", deptService.selectDeptTreeList(dept));
|
|
||||||
return ajax;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,290 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.system;
|
|
||||||
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.framework.web.service.TokenService;
|
|
||||||
import com.ruoyi.system.mapper.SysRoleMapper;
|
|
||||||
import com.ruoyi.system.service.ISysDeptService;
|
|
||||||
import com.ruoyi.system.service.ISysPostService;
|
|
||||||
import com.ruoyi.system.service.ISysRoleService;
|
|
||||||
import com.ruoyi.system.service.ISysUserService;
|
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户信息
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/system/user")
|
|
||||||
public class SysUserController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ISysUserService userService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysRoleService roleService;
|
|
||||||
@Autowired
|
|
||||||
private SysRoleMapper roleMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysDeptService deptService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysPostService postService;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private TokenService tokenService;
|
|
||||||
/**
|
|
||||||
* 获取用户列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(SysUser user){
|
|
||||||
if (!SecurityUtils.getMerchanId().equals("1")){
|
|
||||||
user.setMerchantId(SecurityUtils.getMerchanId());
|
|
||||||
}
|
|
||||||
startPage();
|
|
||||||
List<SysUser> list = userService.selectUserList(user);
|
|
||||||
if (!SecurityUtils.getMerchanId().equals("1")){
|
|
||||||
list.forEach(u->{
|
|
||||||
for (SysRole role:u.getRoles()){
|
|
||||||
if(role.isMerchant()){
|
|
||||||
u.setResponsible(true);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}else {
|
|
||||||
list.forEach(u->{
|
|
||||||
for (SysRole role:u.getRoles()){
|
|
||||||
if(role.getRoleId() != null && 1L ==role.getRoleId()){
|
|
||||||
u.setResponsible(true);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:export')")
|
|
||||||
@PostMapping("/export")
|
|
||||||
public void export(HttpServletResponse response, SysUser user)
|
|
||||||
{
|
|
||||||
List<SysUser> list = userService.selectUserList(user);
|
|
||||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
|
||||||
util.exportExcel(response, list, "用户数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:import')")
|
|
||||||
// @PostMapping("/importData")
|
|
||||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
|
||||||
{
|
|
||||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
|
||||||
List<SysUser> userList = util.importExcel(file.getInputStream());
|
|
||||||
String operName = getUsername();
|
|
||||||
String message = userService.importUser(userList, updateSupport, operName);
|
|
||||||
return AjaxResult.success(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/importTemplate")
|
|
||||||
public void importTemplate(HttpServletResponse response)
|
|
||||||
{
|
|
||||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
|
||||||
util.importTemplateExcel(response, "用户数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据用户编号获取详细信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
|
||||||
@GetMapping(value = { "/", "/{userId}" })
|
|
||||||
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId,HttpServletRequest request){
|
|
||||||
SysUser loginUser=tokenService.getLoginUser(request).getUser();
|
|
||||||
|
|
||||||
userService.checkUserDataScope(userId);
|
|
||||||
AjaxResult ajax = AjaxResult.success();
|
|
||||||
|
|
||||||
//todo 角色
|
|
||||||
// List<SysRole> roles = roleService.selectRoleAll();
|
|
||||||
List<SysRole> roles = roleMapper.selectRoleAll();
|
|
||||||
// ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
|
||||||
ajax.put("roles", SysUser.isAdmin(SecurityUtils.getUserId())?
|
|
||||||
roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())
|
|
||||||
:
|
|
||||||
roles.stream().filter(r -> !r.isMerchant()).collect(Collectors.toList()));
|
|
||||||
|
|
||||||
//todo
|
|
||||||
// 岗位
|
|
||||||
ajax.put("posts", postService.selectPostAll(loginUser.getMerchantId()));
|
|
||||||
if (StringUtils.isNotNull(userId))
|
|
||||||
{
|
|
||||||
SysUser sysUser = userService.selectUserById(userId);
|
|
||||||
ajax.put(AjaxResult.DATA_TAG, sysUser);
|
|
||||||
ajax.put("postIds", postService.selectPostListByUserId(userId));
|
|
||||||
ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()));
|
|
||||||
}
|
|
||||||
return ajax;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增用户
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:add')")
|
|
||||||
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@Validated @RequestBody SysUser user, HttpServletRequest request){
|
|
||||||
SysUser loginUser=tokenService.getLoginUser(request).getUser();
|
|
||||||
user.setMerchantId(loginUser.getMerchantId());
|
|
||||||
if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user.getUserName())))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
|
||||||
}
|
|
||||||
else if (StringUtils.isNotEmpty(user.getPhonenumber())
|
|
||||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
|
|
||||||
}
|
|
||||||
else if (StringUtils.isNotEmpty(user.getEmail())
|
|
||||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
|
||||||
}
|
|
||||||
|
|
||||||
user.setCreateBy(getUsername());
|
|
||||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
|
||||||
return toAjax(userService.insertUser(user));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改用户
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
|
||||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult edit(@Validated @RequestBody SysUser user)
|
|
||||||
{
|
|
||||||
userService.checkUserAllowed(user);
|
|
||||||
userService.checkUserDataScope(user.getUserId());
|
|
||||||
if (StringUtils.isNotEmpty(user.getPhonenumber())
|
|
||||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
|
||||||
}
|
|
||||||
else if (StringUtils.isNotEmpty(user.getEmail())
|
|
||||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
|
||||||
}
|
|
||||||
user.setUpdateBy(getUsername());
|
|
||||||
return toAjax(userService.updateUser(user));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除用户
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:remove')")
|
|
||||||
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{userIds}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] userIds)
|
|
||||||
{
|
|
||||||
if (ArrayUtils.contains(userIds, getUserId()))
|
|
||||||
{
|
|
||||||
return error("当前用户不能删除");
|
|
||||||
}
|
|
||||||
return toAjax(userService.deleteUserByIds(userIds));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 重置密码
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
|
|
||||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping("/resetPwd")
|
|
||||||
public AjaxResult resetPwd(@RequestBody SysUser user)
|
|
||||||
{
|
|
||||||
userService.checkUserAllowed(user);
|
|
||||||
userService.checkUserDataScope(user.getUserId());
|
|
||||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
|
||||||
user.setUpdateBy(getUsername());
|
|
||||||
return toAjax(userService.resetPwd(user));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态修改
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
|
||||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping("/changeStatus")
|
|
||||||
public AjaxResult changeStatus(@RequestBody SysUser user)
|
|
||||||
{
|
|
||||||
userService.checkUserAllowed(user);
|
|
||||||
userService.checkUserDataScope(user.getUserId());
|
|
||||||
user.setUpdateBy(getUsername());
|
|
||||||
return toAjax(userService.updateUserStatus(user));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据用户编号获取授权角色
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
|
||||||
@GetMapping("/authRole/{userId}")
|
|
||||||
public AjaxResult authRole(@PathVariable("userId") Long userId)
|
|
||||||
{
|
|
||||||
AjaxResult ajax = AjaxResult.success();
|
|
||||||
SysUser user = userService.selectUserById(userId);
|
|
||||||
List<SysRole> roles = roleService.selectRolesByUserId(userId);
|
|
||||||
ajax.put("user", user);
|
|
||||||
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
|
||||||
return ajax;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户授权角色
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
|
||||||
@Log(title = "用户管理", businessType = BusinessType.GRANT)
|
|
||||||
@PutMapping("/authRole")
|
|
||||||
public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
|
|
||||||
{
|
|
||||||
userService.checkUserDataScope(userId);
|
|
||||||
userService.insertUserAuth(userId, roleIds);
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取部门树列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
|
||||||
@GetMapping("/deptTree")
|
|
||||||
public AjaxResult deptTree(SysDept dept){
|
|
||||||
if (!SecurityUtils.getMerchanId().equals("1")){
|
|
||||||
dept.setMerchanId(SecurityUtils.getMerchanId());
|
|
||||||
}
|
|
||||||
return AjaxResult.success(deptService.selectDeptTreeList(dept));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,183 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.tool;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.R;
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* swagger 用户测试方法
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@Api("用户信息管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/test/user")
|
|
||||||
public class TestController extends BaseController
|
|
||||||
{
|
|
||||||
private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>();
|
|
||||||
{
|
|
||||||
users.put(1, new UserEntity(1, "admin", "admin123", "15888888888"));
|
|
||||||
users.put(2, new UserEntity(2, "ry", "admin123", "15666666666"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("获取用户列表")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public R<List<UserEntity>> userList()
|
|
||||||
{
|
|
||||||
List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
|
|
||||||
return R.ok(userList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("获取用户详细")
|
|
||||||
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
|
|
||||||
@GetMapping("/{userId}")
|
|
||||||
public R<UserEntity> getUser(@PathVariable Integer userId)
|
|
||||||
{
|
|
||||||
if (!users.isEmpty() && users.containsKey(userId))
|
|
||||||
{
|
|
||||||
return R.ok(users.get(userId));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return R.fail("用户不存在");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("新增用户")
|
|
||||||
@ApiImplicitParams({
|
|
||||||
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "Integer", dataTypeClass = Integer.class),
|
|
||||||
@ApiImplicitParam(name = "username", value = "用户名称", dataType = "String", dataTypeClass = String.class),
|
|
||||||
@ApiImplicitParam(name = "password", value = "用户密码", dataType = "String", dataTypeClass = String.class),
|
|
||||||
@ApiImplicitParam(name = "mobile", value = "用户手机", dataType = "String", dataTypeClass = String.class)
|
|
||||||
})
|
|
||||||
@PostMapping("/save")
|
|
||||||
public R<String> save(UserEntity user)
|
|
||||||
{
|
|
||||||
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
|
|
||||||
{
|
|
||||||
return R.fail("用户ID不能为空");
|
|
||||||
}
|
|
||||||
users.put(user.getUserId(), user);
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("更新用户")
|
|
||||||
@PutMapping("/update")
|
|
||||||
public R<String> update(@RequestBody UserEntity user)
|
|
||||||
{
|
|
||||||
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
|
|
||||||
{
|
|
||||||
return R.fail("用户ID不能为空");
|
|
||||||
}
|
|
||||||
if (users.isEmpty() || !users.containsKey(user.getUserId()))
|
|
||||||
{
|
|
||||||
return R.fail("用户不存在");
|
|
||||||
}
|
|
||||||
users.remove(user.getUserId());
|
|
||||||
users.put(user.getUserId(), user);
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("删除用户信息")
|
|
||||||
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
|
|
||||||
@DeleteMapping("/{userId}")
|
|
||||||
public R<String> delete(@PathVariable Integer userId)
|
|
||||||
{
|
|
||||||
if (!users.isEmpty() && users.containsKey(userId))
|
|
||||||
{
|
|
||||||
users.remove(userId);
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return R.fail("用户不存在");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiModel(value = "UserEntity", description = "用户实体")
|
|
||||||
class UserEntity
|
|
||||||
{
|
|
||||||
@ApiModelProperty("用户ID")
|
|
||||||
private Integer userId;
|
|
||||||
|
|
||||||
@ApiModelProperty("用户名称")
|
|
||||||
private String username;
|
|
||||||
|
|
||||||
@ApiModelProperty("用户密码")
|
|
||||||
private String password;
|
|
||||||
|
|
||||||
@ApiModelProperty("用户手机")
|
|
||||||
private String mobile;
|
|
||||||
|
|
||||||
public UserEntity()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public UserEntity(Integer userId, String username, String password, String mobile)
|
|
||||||
{
|
|
||||||
this.userId = userId;
|
|
||||||
this.username = username;
|
|
||||||
this.password = password;
|
|
||||||
this.mobile = mobile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getUserId()
|
|
||||||
{
|
|
||||||
return userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserId(Integer userId)
|
|
||||||
{
|
|
||||||
this.userId = userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUsername()
|
|
||||||
{
|
|
||||||
return username;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUsername(String username)
|
|
||||||
{
|
|
||||||
this.username = username;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPassword()
|
|
||||||
{
|
|
||||||
return password;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPassword(String password)
|
|
||||||
{
|
|
||||||
this.password = password;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMobile()
|
|
||||||
{
|
|
||||||
return mobile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMobile(String mobile)
|
|
||||||
{
|
|
||||||
this.mobile = mobile;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package com.ruoyi.web.core.config;
|
||||||
|
|
||||||
|
import com.ruoyi.mall.util.PayConstants;
|
||||||
|
import com.wechat.pay.java.core.Config;
|
||||||
|
import com.wechat.pay.java.core.RSAAutoCertificateConfig;
|
||||||
|
|
||||||
|
public class WechatPayConfig {
|
||||||
|
|
||||||
|
private static Config wechatPayConfig;
|
||||||
|
|
||||||
|
private WechatPayConfig(){}
|
||||||
|
|
||||||
|
public static Config getInstance() {
|
||||||
|
|
||||||
|
|
||||||
|
if (wechatPayConfig == null) {
|
||||||
|
wechatPayConfig = new RSAAutoCertificateConfig.Builder()
|
||||||
|
.merchantId(PayConstants.MCH_ID)
|
||||||
|
.privateKeyFromPath(PayConstants.PRIVATE_KEY_FILE_PATH)
|
||||||
|
.merchantSerialNumber(PayConstants.MCH_SERIAL_NO)
|
||||||
|
.apiV3Key(PayConstants.API_V3KEY)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
return wechatPayConfig;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,291 +0,0 @@
|
|||||||
package com.ruoyi.web.util;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Base64工具类
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public final class Base64
|
|
||||||
{
|
|
||||||
static private final int BASELENGTH = 128;
|
|
||||||
static private final int LOOKUPLENGTH = 64;
|
|
||||||
static private final int TWENTYFOURBITGROUP = 24;
|
|
||||||
static private final int EIGHTBIT = 8;
|
|
||||||
static private final int SIXTEENBIT = 16;
|
|
||||||
static private final int FOURBYTE = 4;
|
|
||||||
static private final int SIGN = -128;
|
|
||||||
static private final char PAD = '=';
|
|
||||||
static final private byte[] base64Alphabet = new byte[BASELENGTH];
|
|
||||||
static final private char[] lookUpBase64Alphabet = new char[LOOKUPLENGTH];
|
|
||||||
|
|
||||||
static
|
|
||||||
{
|
|
||||||
for (int i = 0; i < BASELENGTH; ++i)
|
|
||||||
{
|
|
||||||
base64Alphabet[i] = -1;
|
|
||||||
}
|
|
||||||
for (int i = 'Z'; i >= 'A'; i--)
|
|
||||||
{
|
|
||||||
base64Alphabet[i] = (byte) (i - 'A');
|
|
||||||
}
|
|
||||||
for (int i = 'z'; i >= 'a'; i--)
|
|
||||||
{
|
|
||||||
base64Alphabet[i] = (byte) (i - 'a' + 26);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = '9'; i >= '0'; i--)
|
|
||||||
{
|
|
||||||
base64Alphabet[i] = (byte) (i - '0' + 52);
|
|
||||||
}
|
|
||||||
|
|
||||||
base64Alphabet['+'] = 62;
|
|
||||||
base64Alphabet['/'] = 63;
|
|
||||||
|
|
||||||
for (int i = 0; i <= 25; i++)
|
|
||||||
{
|
|
||||||
lookUpBase64Alphabet[i] = (char) ('A' + i);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 26, j = 0; i <= 51; i++, j++)
|
|
||||||
{
|
|
||||||
lookUpBase64Alphabet[i] = (char) ('a' + j);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 52, j = 0; i <= 61; i++, j++)
|
|
||||||
{
|
|
||||||
lookUpBase64Alphabet[i] = (char) ('0' + j);
|
|
||||||
}
|
|
||||||
lookUpBase64Alphabet[62] = (char) '+';
|
|
||||||
lookUpBase64Alphabet[63] = (char) '/';
|
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean isWhiteSpace(char octect)
|
|
||||||
{
|
|
||||||
return (octect == 0x20 || octect == 0xd || octect == 0xa || octect == 0x9);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean isPad(char octect)
|
|
||||||
{
|
|
||||||
return (octect == PAD);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean isData(char octect)
|
|
||||||
{
|
|
||||||
return (octect < BASELENGTH && base64Alphabet[octect] != -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Encodes hex octects into Base64
|
|
||||||
*
|
|
||||||
* @param binaryData Array containing binaryData
|
|
||||||
* @return Encoded Base64 array
|
|
||||||
*/
|
|
||||||
public static String encode(byte[] binaryData)
|
|
||||||
{
|
|
||||||
if (binaryData == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
int lengthDataBits = binaryData.length * EIGHTBIT;
|
|
||||||
if (lengthDataBits == 0)
|
|
||||||
{
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP;
|
|
||||||
int numberTriplets = lengthDataBits / TWENTYFOURBITGROUP;
|
|
||||||
int numberQuartet = fewerThan24bits != 0 ? numberTriplets + 1 : numberTriplets;
|
|
||||||
char encodedData[] = null;
|
|
||||||
|
|
||||||
encodedData = new char[numberQuartet * 4];
|
|
||||||
|
|
||||||
byte k = 0, l = 0, b1 = 0, b2 = 0, b3 = 0;
|
|
||||||
|
|
||||||
int encodedIndex = 0;
|
|
||||||
int dataIndex = 0;
|
|
||||||
|
|
||||||
for (int i = 0; i < numberTriplets; i++)
|
|
||||||
{
|
|
||||||
b1 = binaryData[dataIndex++];
|
|
||||||
b2 = binaryData[dataIndex++];
|
|
||||||
b3 = binaryData[dataIndex++];
|
|
||||||
|
|
||||||
l = (byte) (b2 & 0x0f);
|
|
||||||
k = (byte) (b1 & 0x03);
|
|
||||||
|
|
||||||
byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
|
|
||||||
byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
|
|
||||||
byte val3 = ((b3 & SIGN) == 0) ? (byte) (b3 >> 6) : (byte) ((b3) >> 6 ^ 0xfc);
|
|
||||||
|
|
||||||
encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
|
|
||||||
encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
|
|
||||||
encodedData[encodedIndex++] = lookUpBase64Alphabet[(l << 2) | val3];
|
|
||||||
encodedData[encodedIndex++] = lookUpBase64Alphabet[b3 & 0x3f];
|
|
||||||
}
|
|
||||||
|
|
||||||
// form integral number of 6-bit groups
|
|
||||||
if (fewerThan24bits == EIGHTBIT)
|
|
||||||
{
|
|
||||||
b1 = binaryData[dataIndex];
|
|
||||||
k = (byte) (b1 & 0x03);
|
|
||||||
byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
|
|
||||||
encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
|
|
||||||
encodedData[encodedIndex++] = lookUpBase64Alphabet[k << 4];
|
|
||||||
encodedData[encodedIndex++] = PAD;
|
|
||||||
encodedData[encodedIndex++] = PAD;
|
|
||||||
}
|
|
||||||
else if (fewerThan24bits == SIXTEENBIT)
|
|
||||||
{
|
|
||||||
b1 = binaryData[dataIndex];
|
|
||||||
b2 = binaryData[dataIndex + 1];
|
|
||||||
l = (byte) (b2 & 0x0f);
|
|
||||||
k = (byte) (b1 & 0x03);
|
|
||||||
|
|
||||||
byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
|
|
||||||
byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
|
|
||||||
|
|
||||||
encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
|
|
||||||
encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
|
|
||||||
encodedData[encodedIndex++] = lookUpBase64Alphabet[l << 2];
|
|
||||||
encodedData[encodedIndex++] = PAD;
|
|
||||||
}
|
|
||||||
return new String(encodedData);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Decodes Base64 data into octects
|
|
||||||
*
|
|
||||||
* @param encoded string containing Base64 data
|
|
||||||
* @return Array containind decoded data.
|
|
||||||
*/
|
|
||||||
public static byte[] decode(String encoded)
|
|
||||||
{
|
|
||||||
if (encoded == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
char[] base64Data = encoded.toCharArray();
|
|
||||||
// remove white spaces
|
|
||||||
int len = removeWhiteSpace(base64Data);
|
|
||||||
|
|
||||||
if (len % FOURBYTE != 0)
|
|
||||||
{
|
|
||||||
return null;// should be divisible by four
|
|
||||||
}
|
|
||||||
|
|
||||||
int numberQuadruple = (len / FOURBYTE);
|
|
||||||
|
|
||||||
if (numberQuadruple == 0)
|
|
||||||
{
|
|
||||||
return new byte[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
byte decodedData[] = null;
|
|
||||||
byte b1 = 0, b2 = 0, b3 = 0, b4 = 0;
|
|
||||||
char d1 = 0, d2 = 0, d3 = 0, d4 = 0;
|
|
||||||
|
|
||||||
int i = 0;
|
|
||||||
int encodedIndex = 0;
|
|
||||||
int dataIndex = 0;
|
|
||||||
decodedData = new byte[(numberQuadruple) * 3];
|
|
||||||
|
|
||||||
for (; i < numberQuadruple - 1; i++)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))
|
|
||||||
|| !isData((d3 = base64Data[dataIndex++])) || !isData((d4 = base64Data[dataIndex++])))
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
} // if found "no data" just return null
|
|
||||||
|
|
||||||
b1 = base64Alphabet[d1];
|
|
||||||
b2 = base64Alphabet[d2];
|
|
||||||
b3 = base64Alphabet[d3];
|
|
||||||
b4 = base64Alphabet[d4];
|
|
||||||
|
|
||||||
decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
|
|
||||||
decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
|
|
||||||
decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++])))
|
|
||||||
{
|
|
||||||
return null;// if found "no data" just return null
|
|
||||||
}
|
|
||||||
|
|
||||||
b1 = base64Alphabet[d1];
|
|
||||||
b2 = base64Alphabet[d2];
|
|
||||||
|
|
||||||
d3 = base64Data[dataIndex++];
|
|
||||||
d4 = base64Data[dataIndex++];
|
|
||||||
if (!isData((d3)) || !isData((d4)))
|
|
||||||
{// Check if they are PAD characters
|
|
||||||
if (isPad(d3) && isPad(d4))
|
|
||||||
{
|
|
||||||
if ((b2 & 0xf) != 0)// last 4 bits should be zero
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
byte[] tmp = new byte[i * 3 + 1];
|
|
||||||
System.arraycopy(decodedData, 0, tmp, 0, i * 3);
|
|
||||||
tmp[encodedIndex] = (byte) (b1 << 2 | b2 >> 4);
|
|
||||||
return tmp;
|
|
||||||
}
|
|
||||||
else if (!isPad(d3) && isPad(d4))
|
|
||||||
{
|
|
||||||
b3 = base64Alphabet[d3];
|
|
||||||
if ((b3 & 0x3) != 0)// last 2 bits should be zero
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
byte[] tmp = new byte[i * 3 + 2];
|
|
||||||
System.arraycopy(decodedData, 0, tmp, 0, i * 3);
|
|
||||||
tmp[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
|
|
||||||
tmp[encodedIndex] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
|
|
||||||
return tmp;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ // No PAD e.g 3cQl
|
|
||||||
b3 = base64Alphabet[d3];
|
|
||||||
b4 = base64Alphabet[d4];
|
|
||||||
decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
|
|
||||||
decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
|
|
||||||
decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
|
|
||||||
|
|
||||||
}
|
|
||||||
return decodedData;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* remove WhiteSpace from MIME containing encoded Base64 data.
|
|
||||||
*
|
|
||||||
* @param data the byte array of base64 data (with WS)
|
|
||||||
* @return the new length
|
|
||||||
*/
|
|
||||||
private static int removeWhiteSpace(char[] data)
|
|
||||||
{
|
|
||||||
if (data == null)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// count characters that's not whitespace
|
|
||||||
int newSize = 0;
|
|
||||||
int len = data.length;
|
|
||||||
for (int i = 0; i < len; i++)
|
|
||||||
{
|
|
||||||
if (!isWhiteSpace(data[i]))
|
|
||||||
{
|
|
||||||
data[newSize++] = data[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return newSize;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
package com.ruoyi.web.util;
|
|
||||||
|
|
||||||
import java.security.MessageDigest;
|
|
||||||
|
|
||||||
|
|
||||||
public class MD5Util {
|
|
||||||
|
|
||||||
private static String byteArrayToHexString(byte b[]) {
|
|
||||||
StringBuffer resultSb = new StringBuffer();
|
|
||||||
for (int i = 0; i < b.length; i++)
|
|
||||||
resultSb.append(byteToHexString(b[i]));
|
|
||||||
|
|
||||||
return resultSb.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String byteToHexString(byte b) {
|
|
||||||
int n = b;
|
|
||||||
if (n < 0)
|
|
||||||
n += 256;
|
|
||||||
int d1 = n / 16;
|
|
||||||
int d2 = n % 16;
|
|
||||||
return hexDigits[d1] + hexDigits[d2];
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String MD5Encode(String origin, String charsetname) {
|
|
||||||
String resultString = null;
|
|
||||||
try {
|
|
||||||
resultString = new String(origin);
|
|
||||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
|
||||||
if (charsetname == null || "".equals(charsetname))
|
|
||||||
resultString = byteArrayToHexString(md.digest(resultString
|
|
||||||
.getBytes()));
|
|
||||||
else
|
|
||||||
resultString = byteArrayToHexString(md.digest(resultString
|
|
||||||
.getBytes(charsetname)));
|
|
||||||
} catch (Exception exception) {
|
|
||||||
}
|
|
||||||
return resultString;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final String hexDigits[] = {"0", "1", "2", "3", "4", "5",
|
|
||||||
"6", "7", "8", "9", "A", "B", "C", "D", "E", "F"};
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
package com.ruoyi.web.util;
|
|
||||||
|
|
||||||
public class clientServiceImpl {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -0,0 +1,188 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||||
|
<component name="FacetManager">
|
||||||
|
<facet type="web" name="Web">
|
||||||
|
<configuration>
|
||||||
|
<webroots />
|
||||||
|
<sourceRoots>
|
||||||
|
<root url="file://$MODULE_DIR$/src/main/java" />
|
||||||
|
</sourceRoots>
|
||||||
|
</configuration>
|
||||||
|
</facet>
|
||||||
|
<facet type="Spring" name="Spring">
|
||||||
|
<configuration />
|
||||||
|
</facet>
|
||||||
|
</component>
|
||||||
|
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||||
|
<output url="file://$MODULE_DIR$/target/classes" />
|
||||||
|
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||||
|
</content>
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-security:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.11" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.11" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.17.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.17.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.36" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-config:5.5.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-core:5.5.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-crypto:5.5.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-web:5.5.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.4.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.2.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.9" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.7" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.4.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.3.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-validation:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.63" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.2.3.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.3.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.12.6.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.12.6" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.12.6" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.alibaba.fastjson2:fastjson2:2.0.12" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: commons-io:commons-io:2.11.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:4.1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.poi:poi:4.1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.commons:commons-math3:3.6.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.zaxxer:SparseBitSet:1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:4.1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:3.1.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.commons:commons-compress:1.19" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.06" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.28" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.jsonwebtoken:jjwt:0.9.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.5.11" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.5.11" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.5.11" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.lettuce:lettuce-core:6.1.8.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.4.18" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.9.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: eu.bitwalker:UserAgentUtils:1.21" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:4.0.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-boot-starter:3.4.3.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.4.3.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.4.3.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-core:3.4.3.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.4.3.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:4.0.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.7.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.12" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: cn.jpush.api:jiguang-common:1.1.7" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.60" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.60" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: cn.jpush.api:jpush-client:3.4.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.13" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.15" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-all:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-dns:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-haproxy:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-http:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-http2:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-memcache:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-mqtt:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-redis:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-smtp:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-socks:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-stomp:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-codec-xml:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-handler-proxy:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-resolver-dns:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-transport-rxtx:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-transport-sctp:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-transport-udt:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-transport-classes-epoll:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-transport-native-unix-common:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-transport-classes-kqueue:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-resolver-dns-classes-macos:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-epoll:linux-x86_64:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-epoll:linux-aarch_64:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-kqueue:osx-x86_64:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-kqueue:osx-aarch_64:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-resolver-dns-native-macos:osx-x86_64:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-resolver-dns-native-macos:osx-aarch_64:4.1.77.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.9" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-boot-starter:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-oas:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.swagger.core.v3:swagger-annotations:2.1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.swagger.core.v3:swagger-models:2.1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-core:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.22" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.github.classgraph:classgraph:4.8.83" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-webmvc:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-webflux:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" scope="RUNTIME" name="Maven: org.mapstruct:mapstruct:1.3.1.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-data-rest:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-ui:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:2.0.0.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:2.0.0.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.6.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.6.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-joda:2.12.6" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: joda-time:joda-time:2.10.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-websocket:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.12.6" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.6" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.12.6" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.5.14" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.63" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.63" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-messaging:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-websocket:5.3.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.auth0:java-jwt:3.11.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.15" level="project" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
package com.ruoyi.common.config;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ICEServer {
|
||||||
|
private String urls;
|
||||||
|
private String username;
|
||||||
|
private String credential;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.ruoyi.common.config;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Component
|
||||||
|
@ConfigurationProperties(prefix = "webrtc")
|
||||||
|
public class WebrtcConfig {
|
||||||
|
|
||||||
|
private Integer maxChannel = 9;
|
||||||
|
|
||||||
|
private List<ICEServer> iceServers = new ArrayList<>();
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,105 +0,0 @@
|
|||||||
package com.ruoyi.common.core.domain;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import com.ruoyi.common.constant.HttpStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 响应信息主体
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
public class R<T> implements Serializable
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/** 成功 */
|
|
||||||
public static final int SUCCESS = HttpStatus.SUCCESS;
|
|
||||||
|
|
||||||
/** 失败 */
|
|
||||||
public static final int FAIL = HttpStatus.ERROR;
|
|
||||||
|
|
||||||
private int code;
|
|
||||||
|
|
||||||
private String msg;
|
|
||||||
|
|
||||||
private T data;
|
|
||||||
|
|
||||||
public static <T> R<T> ok()
|
|
||||||
{
|
|
||||||
return restResult(null, SUCCESS, "操作成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static <T> R<T> ok(T data)
|
|
||||||
{
|
|
||||||
return restResult(data, SUCCESS, "操作成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static <T> R<T> ok(T data, String msg)
|
|
||||||
{
|
|
||||||
return restResult(data, SUCCESS, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static <T> R<T> fail()
|
|
||||||
{
|
|
||||||
return restResult(null, FAIL, "操作失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static <T> R<T> fail(String msg)
|
|
||||||
{
|
|
||||||
return restResult(null, FAIL, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static <T> R<T> fail(T data)
|
|
||||||
{
|
|
||||||
return restResult(data, FAIL, "操作失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static <T> R<T> fail(T data, String msg)
|
|
||||||
{
|
|
||||||
return restResult(data, FAIL, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static <T> R<T> fail(int code, String msg)
|
|
||||||
{
|
|
||||||
return restResult(null, code, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static <T> R<T> restResult(T data, int code, String msg)
|
|
||||||
{
|
|
||||||
R<T> apiResult = new R<>();
|
|
||||||
apiResult.setCode(code);
|
|
||||||
apiResult.setData(data);
|
|
||||||
apiResult.setMsg(msg);
|
|
||||||
return apiResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCode()
|
|
||||||
{
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCode(int code)
|
|
||||||
{
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMsg()
|
|
||||||
{
|
|
||||||
return msg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMsg(String msg)
|
|
||||||
{
|
|
||||||
this.msg = msg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public T getData()
|
|
||||||
{
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setData(T data)
|
|
||||||
{
|
|
||||||
this.data = data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,112 @@
|
|||||||
|
package com.ruoyi.common.core.domain.model;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.entity.AppUser;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.security.core.GrantedAuthority;
|
||||||
|
import org.springframework.security.core.userdetails.UserDetails;
|
||||||
|
import com.alibaba.fastjson2.annotation.JSONField;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录用户身份权限
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AppLoginUser implements UserDetails
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private Long appUserId;
|
||||||
|
private String token;
|
||||||
|
private Long loginTime;
|
||||||
|
private Long expireTime;
|
||||||
|
/**
|
||||||
|
* 用户信息
|
||||||
|
*/
|
||||||
|
private AppUser appUser;
|
||||||
|
|
||||||
|
public AppLoginUser(Long appUserId, String token, Long loginTime, Long expireTime, AppUser appUser) {
|
||||||
|
this.appUserId = appUserId;
|
||||||
|
this.token = token;
|
||||||
|
this.loginTime = loginTime;
|
||||||
|
this.expireTime = expireTime;
|
||||||
|
this.appUser = appUser;
|
||||||
|
}
|
||||||
|
public AppLoginUser() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public AppLoginUser(Long appUserId,AppUser appUser) {
|
||||||
|
this.appUserId = appUserId;
|
||||||
|
this.appUser = appUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JSONField(serialize = false)
|
||||||
|
@Override
|
||||||
|
public String getPassword()
|
||||||
|
{
|
||||||
|
return appUser.getPassword();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUsername()
|
||||||
|
{
|
||||||
|
return appUser.getUserName();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账户是否未过期,过期无法验证
|
||||||
|
*/
|
||||||
|
@JSONField(serialize = false)
|
||||||
|
@Override
|
||||||
|
public boolean isAccountNonExpired()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指定用户是否解锁,锁定的用户无法进行身份验证
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@JSONField(serialize = false)
|
||||||
|
@Override
|
||||||
|
public boolean isAccountNonLocked()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指示是否已过期的用户的凭据(密码),过期的凭据防止认证
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@JSONField(serialize = false)
|
||||||
|
@Override
|
||||||
|
public boolean isCredentialsNonExpired()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否可用 ,禁用的用户不能身份验证
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@JSONField(serialize = false)
|
||||||
|
@Override
|
||||||
|
public boolean isEnabled()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<? extends GrantedAuthority> getAuthorities()
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,68 @@
|
|||||||
|
package com.ruoyi.common.core.domain.model;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Max;
|
||||||
|
import javax.validation.constraints.Min;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户登录对象
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AppUserLoginBody
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 用户名
|
||||||
|
*/
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电话
|
||||||
|
*/
|
||||||
|
private String phonenumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 短信验证码
|
||||||
|
*/
|
||||||
|
private String smsCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户密码
|
||||||
|
*/
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片验证码
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
/**
|
||||||
|
* 设备id
|
||||||
|
*/
|
||||||
|
private String registerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序登录code 用以获取openID
|
||||||
|
*/
|
||||||
|
private String miniAppCode;
|
||||||
|
|
||||||
|
@Max(value = 2, message = "登录终端类型取值范围:0,2")
|
||||||
|
@Min(value = 1, message = "登录终端类型取值范围:0,2")
|
||||||
|
@NotNull(message = "登录终端类型不可为空")
|
||||||
|
@Schema(description = "登录终端 1:app 2:小程序")
|
||||||
|
private Integer terminal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 唯一标识
|
||||||
|
*/
|
||||||
|
private String uuid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 访问的门店
|
||||||
|
*/
|
||||||
|
private String visitStoreId;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,110 @@
|
|||||||
|
package com.ruoyi.common.core.redis;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class RedisService {
|
||||||
|
@Autowired
|
||||||
|
private RedisCache redisCache;
|
||||||
|
|
||||||
|
public void setMatchList(Long userId, List<Long> userIds) {
|
||||||
|
String key = RedisKeys.MATCH_LIST_OF + userId;
|
||||||
|
redisCache.setCacheList(key, userIds);
|
||||||
|
redisCache.expire(key, 7, TimeUnit.DAYS);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Long> getMatchList(Long userId) {
|
||||||
|
String key = RedisKeys.MATCH_LIST_OF + userId;
|
||||||
|
return redisCache.getCacheList(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddressList() {
|
||||||
|
String key = RedisKeys.ADDRESS_LIST_KEY;
|
||||||
|
return redisCache.getCacheObject(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddressList(String list) {
|
||||||
|
String key = RedisKeys.ADDRESS_LIST_KEY;
|
||||||
|
redisCache.setCacheObject(key,list);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVerifyCode(String code) {
|
||||||
|
String key = RedisKeys.VERIFY_CODE + code;
|
||||||
|
redisCache.setCacheObject(key, code);
|
||||||
|
redisCache.expire(key, 5, TimeUnit.MINUTES);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteVerifyCode(String code) {
|
||||||
|
redisCache.deleteObject(RedisKeys.VERIFY_CODE + code);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVerifyCode(String code) {
|
||||||
|
return redisCache.getCacheObject(RedisKeys.VERIFY_CODE + code);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWechatToken() {
|
||||||
|
return redisCache.getCacheObject(RedisKeys.WECHAT_ACCESS_TOKEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWechatToken(String token) {
|
||||||
|
redisCache.setCacheObject(RedisKeys.WECHAT_ACCESS_TOKEN, token, 100, TimeUnit.MINUTES);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQrCode(String code, String scene) {
|
||||||
|
redisCache.setCacheObject(RedisKeys.WECHAT_QR_CODE + scene, code, 30, TimeUnit.DAYS);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQrCode(String scene) {
|
||||||
|
return redisCache.getCacheObject(RedisKeys.WECHAT_QR_CODE + scene);
|
||||||
|
}
|
||||||
|
|
||||||
|
interface RedisKeys {
|
||||||
|
String MATCH_LIST_OF = "MATCH_LIST_OF_";
|
||||||
|
String ADDRESS_LIST_KEY = "ADDRESS_LIST_KEY_";
|
||||||
|
|
||||||
|
String WECHAT_ACCESS_TOKEN = "WECHAT_ACCESS_TOKEN_";
|
||||||
|
String WECHAT_QR_CODE = "WECHAT_QR_CODE_";
|
||||||
|
String VERIFY_CODE = "VERIFY_CODE:";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* redis实现分布式锁 --- 上锁
|
||||||
|
*
|
||||||
|
* @param key
|
||||||
|
* @param jobInfo
|
||||||
|
* @param lockSecond
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void lock(String key, String jobInfo, Integer lockSecond) throws Exception {
|
||||||
|
String existJobInfo = redisCache.getCacheObject(key);
|
||||||
|
if (StringUtils.isNotEmpty(existJobInfo)) {
|
||||||
|
log.info("获取锁失败: redisKey: {}, existJobInfo: {}", key, existJobInfo);
|
||||||
|
throw new Exception("请不要反复提交订单!");
|
||||||
|
}
|
||||||
|
redisCache.setCacheObject(key, jobInfo, lockSecond, TimeUnit.SECONDS);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* redis实现分布式锁 --- 解锁
|
||||||
|
*
|
||||||
|
* @param key
|
||||||
|
* @param jobInfo
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void unLock(String key, String jobInfo) throws Exception {
|
||||||
|
String existJobInfo = redisCache.getCacheObject(key);
|
||||||
|
if (jobInfo.equals(existJobInfo)) {
|
||||||
|
redisCache.deleteObject(key);
|
||||||
|
} else {
|
||||||
|
throw new Exception(String.format("释放锁异常: redisKey: %s, existJobInfo: %s, jobInfo: %s", key, existJobInfo, jobInfo));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
package com.ruoyi.common.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 售后状态
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public enum AftersaleStatus
|
||||||
|
{
|
||||||
|
APPLY(0, "待处理"),
|
||||||
|
WAIT(1, "退货中"),
|
||||||
|
SUCCESS(2, "已完成"),
|
||||||
|
REJECT(3, "已拒绝"),
|
||||||
|
CANCEL(4,"用户取消");
|
||||||
|
|
||||||
|
private final Integer type;
|
||||||
|
private final String msg;
|
||||||
|
|
||||||
|
private AftersaleStatus(Integer type, String msg) {
|
||||||
|
this.type = type;
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getType() {
|
||||||
|
return this.type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsg() {
|
||||||
|
return this.msg;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
package com.ruoyi.common.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public enum OrderRefundStatus
|
||||||
|
{
|
||||||
|
NO_REFUND(1, "无售后"),
|
||||||
|
APPLY(2, "申请中"),
|
||||||
|
WAIT(3, "退款中"),
|
||||||
|
SUCCESS(4, "退款成功"),
|
||||||
|
FAIL(5,"退款失败");
|
||||||
|
|
||||||
|
private final Integer type;
|
||||||
|
private final String msg;
|
||||||
|
|
||||||
|
private OrderRefundStatus(Integer type, String msg) {
|
||||||
|
this.type = type;
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getType() {
|
||||||
|
return this.type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsg() {
|
||||||
|
return this.msg;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
package com.ruoyi.common.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单状态
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public enum OrderStatus
|
||||||
|
{
|
||||||
|
ALL_DATA(-1,"全部订单"),
|
||||||
|
UN_PAY(0, "待付款"),
|
||||||
|
NOT_DELIVERED(1, "待发货"),
|
||||||
|
DELIVERED(2, "待收货"),
|
||||||
|
COMPLETE(3, "已完成"),
|
||||||
|
CLOSED(4, "已关闭"),
|
||||||
|
INVALID(5, "无效订单"),
|
||||||
|
REFUUND(-2, "售后订单");
|
||||||
|
|
||||||
|
private final Integer type;
|
||||||
|
private final String msg;
|
||||||
|
|
||||||
|
private OrderStatus(Integer type, String msg) {
|
||||||
|
this.type = type;
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getType() {
|
||||||
|
return this.type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsg() {
|
||||||
|
return this.msg;
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue