Explorar o código

修改注册逻辑

tianboguang %!s(int64=3) %!d(string=hai) anos
pai
achega
e0d69db0ee
Modificáronse 100 ficheiros con 200 adicións e 10877 borrados
  1. 0 35
      platform-admin/pom.xml
  2. 0 68
      platform-admin/src/main/resources/dev/log4j.properties
  3. 0 117
      platform-admin/src/main/resources/dev/platform.properties
  4. 0 66
      platform-admin/src/main/resources/prod/log4j.properties
  5. 0 114
      platform-admin/src/main/resources/prod/platform.properties
  6. 1 1
      platform-admin/src/main/resources/spring-jdbc.xml
  7. 1 1
      platform-admin/src/main/resources/spring-mvc.xml
  8. 9 4
      platform-api/src/main/java/com/platform/api/ApiGoodsController.java
  9. 28 0
      platform-common/pom.xml
  10. 18 13
      platform-common/src/main/java/com/platform/controller/SysLoginController.java
  11. 0 222
      platform-common/src/main/java/com/platform/utils/HttpClientUtil.java
  12. 12 59
      platform-common/src/main/java/com/platform/utils/ResourceUtil.java
  13. 31 29
      platform-common/src/main/java/com/platform/utils/WxOpUtils.java
  14. 0 19
      platform-gen/pom.xml
  15. 0 77
      platform-gen/src/main/java/com/platform/controller/SysGeneratorController.java
  16. 0 22
      platform-gen/src/main/java/com/platform/dao/SysGeneratorDao.java
  17. 0 25
      platform-gen/src/main/java/com/platform/dao/SysOracleGeneratorDao.java
  18. 0 82
      platform-gen/src/main/java/com/platform/entity/ColumnEntity.java
  19. 0 60
      platform-gen/src/main/java/com/platform/entity/ResultMap.java
  20. 0 74
      platform-gen/src/main/java/com/platform/entity/TableEntity.java
  21. 0 106
      platform-gen/src/main/java/com/platform/generator/ApiMysqlGenerator.java
  22. 0 107
      platform-gen/src/main/java/com/platform/generator/MysqlGenerator.java
  23. 0 27
      platform-gen/src/main/java/com/platform/service/SysGeneratorService.java
  24. 0 125
      platform-gen/src/main/java/com/platform/service/impl/SysGeneratorServiceImpl.java
  25. 0 242
      platform-gen/src/main/java/com/platform/utils/GenUtils.java
  26. 0 33
      platform-gen/src/main/resources/com/platform/dao/SysGeneratorDao.xml
  27. 0 67
      platform-gen/src/main/resources/com/platform/dao/SysOracleGeneratorDao.xml
  28. 0 29
      platform-gen/src/main/resources/generator.properties
  29. 0 126
      platform-gen/src/main/resources/template/Controller.java.vm
  30. 0 47
      platform-gen/src/main/resources/template/Dao.java.vm
  31. 0 27
      platform-gen/src/main/resources/template/Dao.xml.vm
  32. 0 49
      platform-gen/src/main/resources/template/Entity.java.vm
  33. 0 75
      platform-gen/src/main/resources/template/Service.java.vm
  34. 0 69
      platform-gen/src/main/resources/template/ServiceImpl.java.vm
  35. 0 60
      platform-gen/src/main/resources/template/list.html.vm
  36. 0 116
      platform-gen/src/main/resources/template/list.js.vm
  37. 0 13
      platform-gen/src/main/resources/template/menu.sql.vm
  38. 0 26
      platform-mp/pom.xml
  39. 0 14
      platform-mp/src/main/java/com/platform/builder/AbstractBuilder.java
  40. 0 21
      platform-mp/src/main/java/com/platform/builder/ImageBuilder.java
  41. 0 19
      platform-mp/src/main/java/com/platform/builder/TextBuilder.java
  42. 0 148
      platform-mp/src/main/java/com/platform/controller/MpMenuController.java
  43. 0 46
      platform-mp/src/main/java/com/platform/entity/WxMenuKey.java
  44. 0 11
      platform-mp/src/main/java/com/platform/handler/AbstractHandler.java
  45. 0 22
      platform-mp/src/main/java/com/platform/handler/KfSessionHandler.java
  46. 0 42
      platform-mp/src/main/java/com/platform/handler/LocationHandler.java
  47. 0 37
      platform-mp/src/main/java/com/platform/handler/LogHandler.java
  48. 0 65
      platform-mp/src/main/java/com/platform/handler/MenuHandler.java
  49. 0 121
      platform-mp/src/main/java/com/platform/handler/MsgHandler.java
  50. 0 21
      platform-mp/src/main/java/com/platform/handler/NullHandler.java
  51. 0 22
      platform-mp/src/main/java/com/platform/handler/StoreCheckNotifyHandler.java
  52. 0 61
      platform-mp/src/main/java/com/platform/handler/SubscribeHandler.java
  53. 0 24
      platform-mp/src/main/java/com/platform/handler/UnsubscribeHandler.java
  54. 0 13
      platform-mp/src/main/java/com/platform/service/MpMenuService.java
  55. 0 177
      platform-mp/src/main/java/com/platform/service/WeixinService.java
  56. 0 34
      platform-schedule/pom.xml
  57. 0 149
      platform-schedule/src/main/java/com/platform/controller/ScheduleJobController.java
  58. 0 52
      platform-schedule/src/main/java/com/platform/controller/ScheduleJobLogController.java
  59. 0 38
      platform-schedule/src/main/java/com/platform/dao/ScheduleJobDao.java
  60. 0 29
      platform-schedule/src/main/java/com/platform/dao/ScheduleJobLogDao.java
  61. 0 71
      platform-schedule/src/main/java/com/platform/entity/ScheduleJobEntity.java
  62. 0 65
      platform-schedule/src/main/java/com/platform/entity/ScheduleJobLogEntity.java
  63. 0 23
      platform-schedule/src/main/java/com/platform/service/ScheduleJobLogService.java
  64. 0 73
      platform-schedule/src/main/java/com/platform/service/ScheduleJobService.java
  65. 0 28
      platform-schedule/src/main/java/com/platform/service/impl/ScheduleJobLogServiceImpl.java
  66. 0 121
      platform-schedule/src/main/java/com/platform/service/impl/ScheduleJobServiceImpl.java
  67. 0 79
      platform-schedule/src/main/java/com/platform/utils/ScheduleJob.java
  68. 0 45
      platform-schedule/src/main/java/com/platform/utils/ScheduleRunnable.java
  69. 0 149
      platform-schedule/src/main/java/com/platform/utils/ScheduleUtils.java
  70. 0 30
      platform-schedule/src/main/resources/com/platform/dao/ScheduleJobDao.xml
  71. 0 25
      platform-schedule/src/main/resources/com/platform/dao/ScheduleJobLogDao.xml
  72. 0 46
      platform-schedule/src/main/resources/platform-scheduler.xml
  73. 0 6
      platform-shop/pom.xml
  74. 0 17
      platform-shop/src/main/java/com/platform/controller/AppCensusController.java
  75. 8 4
      platform-shop/src/main/java/com/platform/controller/BrandController.java
  76. 13 17
      platform-shop/src/main/java/com/platform/controller/GoodsController.java
  77. 19 7
      platform-shop/src/main/java/com/platform/controller/SceneController.java
  78. 15 6
      platform-shop/src/main/java/com/platform/controller/SysUserController.java
  79. 13 7
      platform-shop/src/main/java/com/platform/controller/TokenController.java
  80. 8 5
      platform-shop/src/main/java/com/platform/service/custom/SceneCensusService.java
  81. 16 8
      platform-shop/src/main/java/com/platform/service/impl/BrandServiceImpl.java
  82. 8 4
      platform-shop/src/main/java/com/platform/task/SceneStatisticTask.java
  83. 0 3
      pom.xml
  84. 0 30
      uni-color-ui/README.md
  85. 0 54
      uni-color-ui/babel.config.js
  86. 0 68
      uni-color-ui/package.json
  87. 0 10
      uni-color-ui/postcss.config.js
  88. 0 28
      uni-color-ui/public/index.html
  89. 0 250
      uni-color-ui/src/App.vue
  90. 0 144
      uni-color-ui/src/Readme.md
  91. 0 184
      uni-color-ui/src/colorui/animation.css
  92. 0 69
      uni-color-ui/src/colorui/components/cu-custom.vue
  93. 0 1226
      uni-color-ui/src/colorui/icon.css
  94. 0 3912
      uni-color-ui/src/colorui/main.css
  95. 0 28
      uni-color-ui/src/main.js
  96. 0 61
      uni-color-ui/src/manifest.json
  97. 0 127
      uni-color-ui/src/pages.json
  98. 0 108
      uni-color-ui/src/pages/basics/avatar.vue
  99. 0 141
      uni-color-ui/src/pages/basics/background.vue
  100. 0 0
      uni-color-ui/src/pages/basics/button.vue

+ 0 - 35
platform-admin/pom.xml

@@ -38,38 +38,12 @@
         </dependency>
         </dependency>
     </dependencies>
     </dependencies>
 
 
-    <profiles>
-        <profile>
-            <id>dev</id>
-            <properties>
-                <env>dev</env>
-            </properties>
-            <activation>
-                <activeByDefault>true</activeByDefault>
-            </activation>
-        </profile>
-        <profile>
-            <id>prod</id>
-            <properties>
-                <env>prod</env>
-            </properties>
-        </profile>
-    </profiles>
-
     <build>
     <build>
         <scriptSourceDirectory>src/main/java</scriptSourceDirectory>
         <scriptSourceDirectory>src/main/java</scriptSourceDirectory>
         <resources>
         <resources>
             <resource>
             <resource>
-                <directory>src/main/resources/${env}</directory>
-                <filtering>true</filtering>
-            </resource>
-            <resource>
                 <directory>src/main/resources</directory>
                 <directory>src/main/resources</directory>
                 <filtering>true</filtering>
                 <filtering>true</filtering>
-                <excludes>
-                    <exclude>dev/*</exclude>
-                    <exclude>prod/*</exclude>
-                </excludes>
             </resource>
             </resource>
             <resource>
             <resource>
                 <directory>src/main/java</directory>
                 <directory>src/main/java</directory>
@@ -87,17 +61,8 @@
                     <failOnMissingWebXml>false</failOnMissingWebXml>
                     <failOnMissingWebXml>false</failOnMissingWebXml>
                     <webResources>
                     <webResources>
                         <resource>
                         <resource>
-                            <directory>src/main/resources/${env}</directory>
-                            <targetPath>WEB-INF/classes</targetPath>
-                            <filtering>true</filtering>
-                        </resource>
-                        <resource>
                             <directory>src/main/resources</directory>
                             <directory>src/main/resources</directory>
                             <filtering>true</filtering>
                             <filtering>true</filtering>
-                            <excludes>
-                                <exclude>dev/*</exclude>
-                                <exclude>prod/*</exclude>
-                            </excludes>
                         </resource>
                         </resource>
                     </webResources>
                     </webResources>
                 </configuration>
                 </configuration>

+ 0 - 68
platform-admin/src/main/resources/dev/log4j.properties

@@ -1,68 +0,0 @@
-log4j.rootLogger=INFO,stdout,info,warn,error,file
-#控制台输出
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.Threshold=INFO
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS}|%5p|%F.%M:%L|%m%n
-#INFO所有日志
-log4j.logger.file=info
-log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.file.File=../logs/info.log
-log4j.appender.file.datePattern='.'yyyy-MM-dd'.log'
-log4j.appender.file.append=true
-log4j.appender.file.Threshold=INFO
-log4j.appender.file.encoding=UTF-8
-log4j.appender.file.ImmediateFlush=true
-log4j.appender.file.layout=org.apache.log4j.PatternLayout
-log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS}|%5p|%F.%M:%L|%m%n
-#INFO日志
-log4j.logger.info=info
-log4j.appender.info=com.platform.log4j.GradeLogDailyRollingFileAppender
-log4j.appender.info.File=../logs/info/info.log
-log4j.appender.info.datePattern='.'yyyy-MM-dd'.log'
-log4j.appender.info.append=true
-log4j.appender.info.Threshold=INFO
-log4j.appender.info.encoding=UTF-8
-log4j.appender.info.ImmediateFlush=true
-log4j.appender.info.layout=org.apache.log4j.PatternLayout
-log4j.appender.info.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS}|%5p|%F.%M:%L|%m%n
-#WARN日志
-log4j.appender.warn=com.platform.log4j.GradeLogDailyRollingFileAppender
-log4j.appender.warn.File=../logs/warn/warn.log
-log4j.appender.warn.datePattern='.'yyyy-MM-dd'.log'
-log4j.appender.warn.append=true
-log4j.appender.warn.Threshold=WARN
-log4j.appender.warn.encoding=UTF-8
-log4j.appender.warn.ImmediateFlush=true
-log4j.appender.warn.layout=org.apache.log4j.PatternLayout
-log4j.appender.warn.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS}|%5p|%F.%M:%L|%m%n
-#ERROR日志
-log4j.appender.error=com.platform.log4j.GradeLogDailyRollingFileAppender
-log4j.appender.error.File=../logs/error/error.log
-log4j.appender.error.datePattern='.'yyyy-MM-dd'.log'
-log4j.appender.error.append=true
-log4j.appender.error.Threshold=ERROR
-log4j.appender.error.encoding=UTF-8
-log4j.appender.error.ImmediateFlush=true
-log4j.appender.error.layout=org.apache.log4j.PatternLayout
-log4j.appender.error.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS}|%5p|%F.%M:%L|%m%n
-#执行慢的SQL
-log4j.logger.com.alibaba.druid.filter.stat.StatFilter=ERROR,slowsql
-log4j.appender.slowsql=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.slowsql.File=../logs/slow_sql/slow_sql.log
-log4j.appender.slowsql.datePattern='.'yyyy-MM-dd'.log'
-log4j.appender.slowsql.append=true
-log4j.appender.slowsql.encoding=UTF-8
-log4j.appender.slowsql.ImmediateFlush=true
-log4j.appender.slowsql.layout=org.apache.log4j.PatternLayout
-log4j.appender.slowsql.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS}|%5p|%F.%M:%L|%m%n
-#控制台输出所有SQL
-#便于调试  生产环境注释
-log4j.logger.com.platform.dao=DEBUG,sql
-log4j.appender.sql=org.apache.log4j.ConsoleAppender
-log4j.appender.sql.Target=DEBUG
-log4j.appender.sql.layout=org.apache.log4j.PatternLayout
-log4j.appender.sql.layout.ConversionPattern=%m %n
-
-

+ 0 - 117
platform-admin/src/main/resources/dev/platform.properties

@@ -1,117 +0,0 @@
-jdbc.url=jdbc:mysql://120.24.202.7:3306/4dage-zfb?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&characterSetResults=utf8&autoReconnect=true
-jdbc.username=root
-jdbc.password=zfb@20210727%
-
-jdbc.initialSize=5
-jdbc.maxActive=30
-jdbc.minPoolSize=2
-jdbc.maxIdleTime=30000
-jdbc.idleConnectionTestPeriod=100
-
-
-#小程序ID
-wx.appId=wxf1eb182777211ed7
-#小程序密钥
-wx.secret=d1c7e5894ddf44d0bcc2d0da476bcc01
-#商户号
-wx.mchId=1384865002
-#支付签名
-wx.paySignKey=hangzhoutianmenkejizfbvr82350800
-#交易类型
-wx.tradeType=JSAPI
-#证书名称,对应不同的商户号
-#wx.certName=/cert/apiclient_cert.p12
-wx.certName=/root/user/java/apache-tomcat-8.0.51-platform/apiclient_cert.p12
-#支付回调地址
-wx.notifyUrl=https://testshop.4dkankan.com/platform-framework/api/pay/notify
-#获取code的请求地址
-wx.getCode=https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=%s&state=STAT#wechat_redirect
-#获取Web_access_tokenhttps的请求地址
-wx.webAccessTokenhttps = https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code
-#拉取用户信息的请求地址
-wx.userMessage=https://api.weixin.qq.com/sns/userinfo?access_token=%s&openid=%s&lang=zh_CN
-#微信统一下单接口路径
-wx.uniformorder=https://api.mch.weixin.qq.com/pay/unifiedorder
-#退款地址
-wx.refundUrl=https://api.mch.weixin.qq.com/secapi/pay/refund
-#退款查询地址
-wx.refundqueryUrl=https://api.mch.weixin.qq.com/pay/refundquery
-#微信查询订单状态
-wx.orderquery=https://api.mch.weixin.qq.com/pay/orderquery
-
-ali.webAccessTokenhttps=https://openapi.alipay.com/gateway.do
-ali.appId=
-ali.privateKey=
-ali.pubKey=
-
-#安全起见,暴露的短信接口需要配置有效的请求IP
-sms.validIp=127.0.0.1
-
-#演示环境  1:是  0:否
-sys.demo=0
-
-#微信公众号appId
-mp.appId=
-#微信公众号secret
-mp.secret=
-#令牌(Token)
-mp.token=
-#消息加解密密钥
-mp.aesKey=
-
-scenePath=https://zfb.4dkankan.com/
-sceneData=https://4dkk.4dage.com/
-showHtml=shop.html
-editHtml=editShopPC.html
-
-#H5 微信分享二维码url前缀
-
-h5.wx.mini.program.url.pre=pages/webview/index?id=
-
-
-oss.point=http://oss-cn-shenzhen.aliyuncs.com
-oss.key=LTAIUrvuHqj8pvry
-oss.secrey=JLOVl0k8Ke0aaM8nLMMiUAZ3EiiqI4
-oss.bucket=4d-tjw
-oss.video.file.path=domain/shop/video/
-oss.image.file.path=domain/shop/image/
-oss.excel.file.path=domain/shop/excel/
-oss.query.url=https://houseoss.4dkankan.com/
-
-#video-file-path: D:/video-files/
-video-file-path: shop/video-files/
-#file-backup-path: shop/im-files/
-file-backup-path: D:/im-files/
-
-#商品信息来自哪个小程序
-origin=fashilong
-
-webpSheelPath=/opt/libwebp-0.4.3-linux-x86-64/bin/cwebp.sh
-filePath=D:/platform/
-
-
-api.host.query.url=https://testopen.4dkankan.com/api/shop/format?
-api.host.url=https://testopen.4dkankan.com
-api.id= 10305d97abc0b40f79b1607491893621
-api.secret=10405fbabccca8f8cc91607491893623
-
-#四维看看的登录域名
-4dkankan.host=https://test.4dkankan.com/
-4dkankan.api.vr.show.host=https://testopen.4dkankan.com/
-
-#直播间默认商品信息
-goods.cover.image=https://4dkk.4dage.com/shop/huafa/20200915/17145240908b6e.jpg
-goods.name=钻石世家 18K金钻石戒指
-goods.price=4290.00
-goods.buy.url=https://item.jd.com/32579640875.html
-goods.id=1181354
-
-spring.redis.host=127.0.0.1
-spring.redis.port=6379
-
-base.dept.id=91
-
-
-
-wx_miniprogram_state=trial
-wx_subscribe.template.id=klhtcMH_MixbhY2AqKjZ6sl7y51UkpWJ4Xj4P4Cn9U0

+ 0 - 66
platform-admin/src/main/resources/prod/log4j.properties

@@ -1,66 +0,0 @@
-log4j.rootLogger=INFO,stdout,info,warn,error,file
-#控制台输出
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.Threshold=INFO
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS}|%5p|%F.%M:%L|%m%n
-#INFO所有日志
-log4j.logger.file=info
-log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.file.File=/usr/local/platform/logs/info.log
-log4j.appender.file.datePattern='.'yyyy-MM-dd'.log'
-log4j.appender.file.append=true
-log4j.appender.file.Threshold=INFO
-log4j.appender.file.encoding=UTF-8
-log4j.appender.file.ImmediateFlush=true
-log4j.appender.file.layout=org.apache.log4j.PatternLayout
-log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS}|%5p|%F.%M:%L|%m%n
-#INFO日志
-log4j.logger.info=info
-log4j.appender.info=com.platform.log4j.GradeLogDailyRollingFileAppender
-log4j.appender.info.File=/usr/local/platform/logs/info/info.log
-log4j.appender.info.datePattern='.'yyyy-MM-dd'.log'
-log4j.appender.info.append=true
-log4j.appender.info.Threshold=INFO
-log4j.appender.info.encoding=UTF-8
-log4j.appender.info.ImmediateFlush=true
-log4j.appender.info.layout=org.apache.log4j.PatternLayout
-log4j.appender.info.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS}|%5p|%F.%M:%L|%m%n
-#WARN日志
-log4j.appender.warn=com.platform.log4j.GradeLogDailyRollingFileAppender
-log4j.appender.warn.File=/usr/local/platform/logs/warn/warn.log
-log4j.appender.warn.datePattern='.'yyyy-MM-dd'.log'
-log4j.appender.warn.append=true
-log4j.appender.warn.Threshold=WARN
-log4j.appender.warn.encoding=UTF-8
-log4j.appender.warn.ImmediateFlush=true
-log4j.appender.warn.layout=org.apache.log4j.PatternLayout
-log4j.appender.warn.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS}|%5p|%F.%M:%L|%m%n
-#ERROR日志
-log4j.appender.error=com.platform.log4j.GradeLogDailyRollingFileAppender
-log4j.appender.error.File=/usr/local/platform/logs/error/error.log
-log4j.appender.error.datePattern='.'yyyy-MM-dd'.log'
-log4j.appender.error.append=true
-log4j.appender.error.Threshold=ERROR
-log4j.appender.error.encoding=UTF-8
-log4j.appender.error.ImmediateFlush=true
-log4j.appender.error.layout=org.apache.log4j.PatternLayout
-log4j.appender.error.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS}|%5p|%F.%M:%L|%m%n
-#执行慢的SQL
-log4j.logger.com.alibaba.druid.filter.stat.StatFilter=ERROR,slowsql
-log4j.appender.slowsql=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.slowsql.File=/usr/local/platform/logs/slow_sql/slow_sql.log
-log4j.appender.slowsql.datePattern='.'yyyy-MM-dd'.log'
-log4j.appender.slowsql.append=true
-log4j.appender.slowsql.encoding=UTF-8
-log4j.appender.slowsql.ImmediateFlush=true
-log4j.appender.slowsql.layout=org.apache.log4j.PatternLayout
-log4j.appender.slowsql.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS}|%5p|%F.%M:%L|%m%n
-#控制台输出所有SQL
-#便于调试  生产环境注释
-log4j.logger.com.platform.dao=DEBUG,sql
-log4j.appender.sql=org.apache.log4j.ConsoleAppender
-log4j.appender.sql.Target=DEBUG
-log4j.appender.sql.layout=org.apache.log4j.PatternLayout
-log4j.appender.sql.layout.ConversionPattern=%m %n

+ 0 - 114
platform-admin/src/main/resources/prod/platform.properties

@@ -1,114 +0,0 @@
-jdbc.url=jdbc:mysql://localhost:3306/4dage-zfb?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&characterSetResults=utf8&autoReconnect=true
-jdbc.username=root
-jdbc.password=4dkankancuikuan%
-
-jdbc.initialSize=5
-jdbc.maxActive=30
-jdbc.minPoolSize=2
-jdbc.maxIdleTime=30000
-jdbc.idleConnectionTestPeriod=100
-
-#小程序ID
-wx.appId=wxf1eb182777211ed7
-#小程序密钥
-wx.secret=d1c7e5894ddf44d0bcc2d0da476bcc01
-#商户号
-wx.mchId=1384865002
-#支付签名
-wx.paySignKey=hangzhoutianmenkejizfbvr82350800
-#交易类型
-wx.tradeType=JSAPI
-#证书名称,对应不同的商户号
-wx.certName=/root/user/java/apache-tomcat-8.0.51-platform/apiclient_cert.p12
-#支付回调地址
-wx.notifyUrl=https://shop.4dkankan.com/platform-framework/api/pay/notify
-#获取code的请求地址
-wx.getCode=https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=%s&state=STAT#wechat_redirect
-#获取Web_access_tokenhttps的请求地址
-wx.webAccessTokenhttps = https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code
-#拉取用户信息的请求地址
-wx.userMessage=https://api.weixin.qq.com/sns/userinfo?access_token=%s&openid=%s&lang=zh_CN
-#微信统一下单接口路径
-wx.uniformorder=https://api.mch.weixin.qq.com/pay/unifiedorder
-#退款地址
-wx.refundUrl=https://api.mch.weixin.qq.com/secapi/pay/refund
-#退款查询地址
-wx.refundqueryUrl=https://api.mch.weixin.qq.com/pay/refundquery
-#微信查询订单状态
-wx.orderquery=https://api.mch.weixin.qq.com/pay/orderquery
-
-ali.webAccessTokenhttps=https://openapi.alipay.com/gateway.do
-ali.appId=
-ali.privateKey=
-ali.pubKey=
-
-#安全起见,暴露的短信接口需要配置有效的请求IP
-sms.validIp=127.0.0.1
-
-#演示环境  1:是  0:否
-sys.demo=0
-
-#微信公众号appId
-mp.appId=
-#微信公众号secret
-mp.secret=
-#令牌(Token)
-mp.token=
-#消息加解密密钥
-mp.aesKey=
-
-scenePath=https://www.4dkankan.com/
-sceneData=https://4dkk.4dage.com/
-showHtml=shop.html
-editHtml=editShopPC.html
-
-#H5 微信分享二维码url前缀
-
-h5.wx.mini.program.url.pre=pages/webview/index?id=
-
-
-oss.point=http://oss-cn-shenzhen-internal.aliyuncs.com
-oss.key=LTAIUrvuHqj8pvry
-oss.secrey=JLOVl0k8Ke0aaM8nLMMiUAZ3EiiqI4
-oss.bucket=4d-tjw
-oss.video.file.path=domain/shop/video/
-oss.image.file.path=domain/shop/image/
-oss.excel.file.path=domain/shop/excel/
-oss.query.url=https://houseoss.4dkankan.com/
-
-video-file-path: shop/video-files/
-file-backup-path: shop/im-files/
-
-#商品信息来自哪个小程序
-origin=fashilong
-
-webpSheelPath=/opt/libwebp-0.4.3-linux-x86-64/bin/cwebp.sh
-filePath=/platform/
-
-api.host.query.url=https://open.4dkankan.com/api/shop/format?
-api.host.url=https://open.4dkankan.com
-api.id= 10305d97abc0b40f79b1607491893621
-api.secret=10405fbabccca8f8cc91607491893623
-
-
-#四维看看的登录域名
-4dkankan.host=https://www.4dkankan.com/
-4dkankan.api.vr.show.host=https://open.4dkankan.com/
-
-#直播间默认商品信息
-goods.cover.image=https://4dkk.4dage.com/shop/huafa/20200915/17145240908b6e.jpg
-goods.name=钻石世家 18K金钻石戒指
-goods.price=4290.00
-goods.buy.url=https://item.jd.com/32579640875.html
-goods.id=1181354
-
-
-spring.redis.host=127.0.0.1
-spring.redis.port=6379
-
-
-base.dept.id=91
-
-
-wx_miniprogram_state=formal
-wx_subscribe.template.id=klhtcMH_MixbhY2AqKjZ6sl7y51UkpWJ4Xj4P4Cn9U0

+ 1 - 1
platform-admin/src/main/resources/spring-jdbc.xml

@@ -15,7 +15,7 @@
 
 
     <tx:annotation-driven/>
     <tx:annotation-driven/>
     <!-- Import Properties -->
     <!-- Import Properties -->
-    <context:property-placeholder location="classpath*:platform.properties"/>
+    <context:property-placeholder location="classpath*:shop-platform.properties"/>
 
 
     <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
     <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
           init-method="init" destroy-method="close">
           init-method="init" destroy-method="close">

+ 1 - 1
platform-admin/src/main/resources/spring-mvc.xml

@@ -14,7 +14,7 @@
 		http://www.springframework.org/schema/mvc 
 		http://www.springframework.org/schema/mvc 
      	http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd">
      	http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd">
 
 
-    <context:component-scan base-package="com.platform"/>
+    <context:component-scan base-package="com.platform.*,com.alibaba.nacos.*"/>
     <context:annotation-config/>
     <context:annotation-config/>
     <mvc:default-servlet-handler/>
     <mvc:default-servlet-handler/>
     <aop:aspectj-autoproxy proxy-target-class="true"/>
     <aop:aspectj-autoproxy proxy-target-class="true"/>

+ 9 - 4
platform-api/src/main/java/com/platform/api/ApiGoodsController.java

@@ -24,8 +24,10 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.ResponseEntity;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.client.RestTemplate;
 
 
 import java.time.LocalDate;
 import java.time.LocalDate;
 import java.util.*;
 import java.util.*;
@@ -86,6 +88,9 @@ public class ApiGoodsController extends ApiBaseAction {
     @Value("${api.host.url}")
     @Value("${api.host.url}")
     private String apiHost;
     private String apiHost;
 
 
+    @Autowired
+    private RestTemplate restTemplate;
+
     /**
     /**
      */
      */
     @ApiOperation(value = "商品首页")
     @ApiOperation(value = "商品首页")
@@ -163,9 +168,9 @@ public class ApiGoodsController extends ApiBaseAction {
         }
         }
         String openApiurl = apiHost + "/4dage/shop/findHotIdByGoods" + "?goodsId=" + goodsId + "&origin=" + "4Dplaza" + "&pageSid=" + pageSid;
         String openApiurl = apiHost + "/4dage/shop/findHotIdByGoods" + "?goodsId=" + goodsId + "&origin=" + "4Dplaza" + "&pageSid=" + pageSid;
         log.info("获取商品绑定的热点id列表,请求openApi的url={}", openApiurl);
         log.info("获取商品绑定的热点id列表,请求openApi的url={}", openApiurl);
-        String apiResultStr = HttpClientUtil.doGet(openApiurl);
+        ResponseEntity<String> apiResultStr = restTemplate.getForEntity(openApiurl,String.class);
         log.info("api平台返回结果:{}" , apiResultStr);
         log.info("api平台返回结果:{}" , apiResultStr);
-        JSONObject rspObject = JSON.parseObject(apiResultStr);
+        JSONObject rspObject = JSON.parseObject(apiResultStr.getBody());
         JSONArray data = new JSONArray();
         JSONArray data = new JSONArray();
         if(null != rspObject){
         if(null != rspObject){
             data = rspObject.getJSONArray("data");
             data = rspObject.getJSONArray("data");
@@ -562,9 +567,9 @@ public class ApiGoodsController extends ApiBaseAction {
         requestParam.put("pageSid" , pageSid);
         requestParam.put("pageSid" , pageSid);
         String openApiurl = apiHost + "/4dage/shop/findHotIdByGoods";
         String openApiurl = apiHost + "/4dage/shop/findHotIdByGoods";
         log.info("获取商品绑定的热点id列表,请求openApi的url={},入参为:{}", openApiurl , JSON.toJSONString(requestParam));
         log.info("获取商品绑定的热点id列表,请求openApi的url={},入参为:{}", openApiurl , JSON.toJSONString(requestParam));
-        String apiResultStr = HttpClientUtil.doPostJson(openApiurl , JSON.toJSONString(requestParam));
+        ResponseEntity<String> apiResultStr = restTemplate.postForEntity(openApiurl , JSON.toJSONString(requestParam),String.class);
         log.info("api平台返回结果:{}" , apiResultStr);
         log.info("api平台返回结果:{}" , apiResultStr);
-        JSONObject rspObject = JSON.parseObject(apiResultStr);
+        JSONObject rspObject = JSON.parseObject(apiResultStr.getBody());
         if(null != rspObject){
         if(null != rspObject){
             JSONObject dataObj = rspObject.getJSONObject("data");
             JSONObject dataObj = rspObject.getJSONObject("data");
             if(null != dataObj){
             if(null != dataObj){

+ 28 - 0
platform-common/pom.xml

@@ -319,6 +319,34 @@
         </dependency>
         </dependency>
 
 
 
 
+        <dependency>
+            <groupId>com.alibaba.nacos</groupId>
+            <artifactId>nacos-spring-context</artifactId>
+            <version>1.1.1</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework</groupId>
+                    <artifactId>spring-context</artifactId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>javax.annotation-api</artifactId>
+                    <groupId>javax.annotation</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/com.netflix.ribbon/ribbon-loadbalancer -->
+        <dependency>
+            <groupId>com.netflix.ribbon</groupId>
+            <artifactId>ribbon-loadbalancer</artifactId>
+            <version>2.2.4</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.5</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
     </dependencies>
 
 
   <!--  <build>
   <!--  <build>

+ 18 - 13
platform-common/src/main/java/com/platform/controller/SysLoginController.java

@@ -27,15 +27,17 @@ import org.apache.shiro.subject.Subject;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
 import org.springframework.stereotype.Controller;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.ObjectUtils;
 import org.springframework.util.ObjectUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.client.RestTemplate;
 
 
 import javax.imageio.ImageIO;
 import javax.imageio.ImageIO;
-import javax.servlet.ServletException;
 import javax.servlet.ServletOutputStream;
 import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import java.awt.image.BufferedImage;
 import java.awt.image.BufferedImage;
@@ -77,11 +79,12 @@ public class SysLoginController {
     @Value("${scenePath}")
     @Value("${scenePath}")
     private String KankanHost;
     private String KankanHost;
 
 
-
+    @Autowired
+    private RestTemplate restTemplate;
 
 
 
 
     @RequestMapping("captcha.jpg")
     @RequestMapping("captcha.jpg")
-    public void captcha(HttpServletResponse response) throws ServletException, IOException {
+    public void captcha(HttpServletResponse response) throws IOException {
         response.setHeader("Cache-Control", "no-store, no-cache");
         response.setHeader("Cache-Control", "no-store, no-cache");
         response.setContentType("image/jpeg");
         response.setContentType("image/jpeg");
 
 
@@ -183,7 +186,7 @@ public class SysLoginController {
     @SysLog("登录")
     @SysLog("登录")
     @ResponseBody
     @ResponseBody
     @RequestMapping(value = "/sys/loginWithoutAuth", method = RequestMethod.POST)
     @RequestMapping(value = "/sys/loginWithoutAuth", method = RequestMethod.POST)
-    public R onlyLogin(@RequestBody UserOnlyLoginVo userOnlyLoginVo) throws IOException {
+    public R onlyLogin(@RequestBody UserOnlyLoginVo userOnlyLoginVo){
 
 
         ZhiHouseUserLoginVo userLoginVo = new ZhiHouseUserLoginVo();
         ZhiHouseUserLoginVo userLoginVo = new ZhiHouseUserLoginVo();
         userLoginVo.setUserName(userOnlyLoginVo.getUsername());
         userLoginVo.setUserName(userOnlyLoginVo.getUsername());
@@ -193,12 +196,13 @@ public class SysLoginController {
         userLoginVo.setUserPassword(userOnlyLoginVo.getPassword());
         userLoginVo.setUserPassword(userOnlyLoginVo.getPassword());
         userLoginVo.setArea("1234");
         userLoginVo.setArea("1234");
         String url = KankanHost + "api/platform/login";
         String url = KankanHost + "api/platform/login";
-        String json = JsonUtils.objectToJson(userLoginVo);
-        log.info("请求四维看看的参数为:{}" , json);
-        String kankanResult = HttpClientUtil.doPostJson(url, json);
+        ResponseEntity<String> kankanResult = restTemplate.postForEntity(url, userLoginVo,String.class);
+        if(kankanResult.getStatusCode()!= HttpStatus.OK){
+            return R.error("账户验证失败");
+        }
         //解析返回结果
         //解析返回结果
-        JSONObject res = JSONObject.parseObject(kankanResult);
-        log.info("四维看看返回登录数据:{}", kankanResult);
+        JSONObject res = JSONObject.parseObject(kankanResult.getBody());
+        log.info("四维看看返回登录数据:{}", kankanResult.getBody());
         R result = parseResult(res, "登录失败", userLoginVo);
         R result = parseResult(res, "登录失败", userLoginVo);
         if(StringUtils.equals(result.get("code").toString(),"0")){
         if(StringUtils.equals(result.get("code").toString(),"0")){
             SysUserEntity manager = sysUserService.queryByUserMobile(userOnlyLoginVo.getUsername());
             SysUserEntity manager = sysUserService.queryByUserMobile(userOnlyLoginVo.getUsername());
@@ -232,11 +236,12 @@ public class SysLoginController {
         userLoginVo.setUserPassword(password);
         userLoginVo.setUserPassword(password);
         userLoginVo.setArea("1234");
         userLoginVo.setArea("1234");
         String url = KankanHost + "api/platform/login";
         String url = KankanHost + "api/platform/login";
-        String json = JsonUtils.objectToJson(userLoginVo);
-        String kankanResult = HttpClientUtil.doPostJson(url, json);
+        ResponseEntity<String> resultEntity = restTemplate.postForEntity(url, userLoginVo, String.class);
+        if(resultEntity.getStatusCode()!= HttpStatus.OK){
+            return R.error("账户验证失败");
+        }
         //解析返回结果
         //解析返回结果
-        JSONObject res = JSONObject.parseObject(kankanResult);
-        log.info("四维看看返回登录数据:{}", res.toJSONString());
+        JSONObject res = JSONObject.parseObject(resultEntity.getBody());
         R result = parseResultWithoutAddUser(res, "登录失败");
         R result = parseResultWithoutAddUser(res, "登录失败");
         if (null != result && result.containsKey("code") && result.get("code").equals(0)) {
         if (null != result && result.containsKey("code") && result.get("code").equals(0)) {
             log.info("四维看看登录完成,将执行本地登录验证");
             log.info("四维看看登录完成,将执行本地登录验证");

+ 0 - 222
platform-common/src/main/java/com/platform/utils/HttpClientUtil.java

@@ -1,222 +0,0 @@
-package com.platform.utils;
-
-import lombok.extern.log4j.Log4j2;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.http.HttpEntity;
-import org.apache.http.NameValuePair;
-import org.apache.http.client.entity.UrlEncodedFormEntity;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.client.utils.URIBuilder;
-import org.apache.http.entity.ContentType;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.entity.mime.HttpMultipartMode;
-import org.apache.http.entity.mime.MultipartEntityBuilder;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.message.BasicNameValuePair;
-import org.apache.http.util.EntityUtils;
-import org.springframework.util.CollectionUtils;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.IOException;
-import java.net.URI;
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-
-/**
- * @author abnerhou
- * @date 2020/5/11 17:48
- * @desciption
- */
-@Slf4j
-public class HttpClientUtil {
-
-    public static String doGet(String url, Map<String, String> param) {
-
-        // 创建Httpclient对象
-        CloseableHttpClient httpclient = HttpClients.createDefault();
-
-        String resultString = "";
-        CloseableHttpResponse response = null;
-        try {
-            // 创建uri
-            URIBuilder builder = new URIBuilder(url);
-            if (param != null) {
-                for (String key : param.keySet()) {
-                    builder.addParameter(key, param.get(key));
-                }
-            }
-            URI uri = builder.build();
-
-            // 创建http GET请求
-            HttpGet httpGet = new HttpGet(uri);
-
-            // 执行请求
-            response = httpclient.execute(httpGet);
-            // 判断返回状态是否为200
-            if (response.getStatusLine().getStatusCode() == 200) {
-                resultString = EntityUtils.toString(response.getEntity(), "UTF-8");
-            }
-        } catch (Exception e) {
-            log.error("http调用执行get出错:{}" , e);
-        } finally {
-            try {
-                if (response != null) {
-                    response.close();
-                }
-                httpclient.close();
-            } catch (IOException e) {
-               log.error("http调用执行get关闭资源出错:{}" , e);
-            }
-        }
-        return resultString;
-    }
-
-    public static String doGet(String url) {
-        return doGet(url, null);
-    }
-
-    public static String doPost(String url, Map<String, String> param) {
-        // 创建Httpclient对象
-        CloseableHttpClient httpClient = HttpClients.createDefault();
-        CloseableHttpResponse response = null;
-        String resultString = "";
-        try {
-            // 创建Http Post请求
-            HttpPost httpPost = new HttpPost(url);
-            // 创建参数列表
-            if (param != null) {
-                List<NameValuePair> paramList = new ArrayList<>();
-                for (String key : param.keySet()) {
-                    paramList.add(new BasicNameValuePair(key, param.get(key)));
-                }
-                // 模拟表单
-                UrlEncodedFormEntity entity = new UrlEncodedFormEntity(paramList);
-                httpPost.setEntity(entity);
-            }
-            // 执行http请求
-            response = httpClient.execute(httpPost);
-            resultString = EntityUtils.toString(response.getEntity(), "utf-8");
-        } catch (Exception e) {
-            log.error("http执行post调用出错:{}" , e);
-        } finally {
-            try {
-                if(null != response){
-                    response.close();
-                }
-            } catch (IOException e) {
-                log.error("http执行post调用关闭资源出错:{}" , e);
-            }
-        }
-
-        return resultString;
-    }
-
-    public static String doPost(String url) {
-        return doPost(url, null);
-    }
-
-    public static String doPostMultipartFileWithForm(String url, MultipartFile file){
-        // 创建Httpclient对象
-        CloseableHttpClient httpClient = HttpClients.createDefault();
-        CloseableHttpResponse response = null;
-        String resultString = "";
-        try {
-            // 创建Http Post请求
-            HttpPost httpPost = new HttpPost(url);
-
-            //处理文件 后面的setMode是用来解决文件名称乱码的问题:以浏览器兼容模式运行,防止文件名乱码。
-            MultipartEntityBuilder builder = MultipartEntityBuilder.create().setMode(HttpMultipartMode.STRICT);
-            builder.setCharset(Charset.forName("UTF-8")).addBinaryBody("media", file.getBytes(), ContentType.MULTIPART_FORM_DATA, file.getOriginalFilename());
-            // 创建请求内容
-            HttpEntity httpEntity = builder.build();
-            httpPost.setEntity(httpEntity);
-            // 执行http请求
-            response = httpClient.execute(httpPost);
-            resultString = EntityUtils.toString(response.getEntity(), "utf-8");
-        } catch (Exception e) {
-            log.error("http执行post调用出错:{}" , e);
-        } finally {
-            try {
-                if(null != response){
-                    response.close();
-                }
-            } catch (IOException e) {
-                log.error("http执行post调用关闭资源出错:{}" , e);
-            }
-        }
-
-        return resultString;
-
-    }
-
-    public static String doPostJson(String url, String json) {
-        // 创建Httpclient对象
-        CloseableHttpClient httpClient = HttpClients.createDefault();
-        CloseableHttpResponse response = null;
-        String resultString = "";
-        try {
-            // 创建Http Post请求
-            HttpPost httpPost = new HttpPost(url);
-            // 创建请求内容
-            StringEntity entity = new StringEntity(json, ContentType.APPLICATION_JSON);
-            httpPost.setEntity(entity);
-            // 执行http请求
-            response = httpClient.execute(httpPost);
-            resultString = EntityUtils.toString(response.getEntity(), "utf-8");
-        } catch (Exception e) {
-            log.error("http执行post调用出错:{}" , e);
-        } finally {
-            try {
-                if(null != response){
-                    response.close();
-                }
-            } catch (IOException e) {
-                log.error("http执行post调用关闭资源出错:{}" , e);
-            }
-        }
-
-        return resultString;
-    }
-
-    public static String doPostJsonWithHeader(String url, String json ,Map<String, Object> headers) {
-        // 创建Httpclient对象
-        CloseableHttpClient httpClient = HttpClients.createDefault();
-        CloseableHttpResponse response = null;
-        String resultString = "";
-        try {
-            // 创建Http Post请求
-            HttpPost httpPost = new HttpPost(url);
-            // 创建请求内容
-            StringEntity entity = new StringEntity(json, ContentType.APPLICATION_JSON);
-            httpPost.setEntity(entity);
-
-            if(!CollectionUtils.isEmpty(headers)){
-                for (Map.Entry<String,Object> entry : headers.entrySet()){
-                    httpPost.addHeader(entry.getKey() , (String) entry.getValue());
-                }
-            }
-            // 执行http请求
-            response = httpClient.execute(httpPost);
-            resultString = EntityUtils.toString(response.getEntity(), "utf-8");
-        } catch (Exception e) {
-            log.error("http执行post调用出错:{}" , e);
-        } finally {
-            try {
-                if(null != response){
-                    response.close();
-                }
-            } catch (IOException e) {
-                log.error("http执行post调用关闭资源出错:{}" , e);
-            }
-        }
-
-        return resultString;
-    }
-
-}

+ 12 - 59
platform-common/src/main/java/com/platform/utils/ResourceUtil.java

@@ -1,7 +1,10 @@
 package com.platform.utils;
 package com.platform.utils;
 
 
-import java.io.UnsupportedEncodingException;
-import java.util.ResourceBundle;
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
 
 
 /**
 /**
  * 名称:ResourceUtil <br>
  * 名称:ResourceUtil <br>
@@ -11,68 +14,18 @@ import java.util.ResourceBundle;
  * @version 1.0
  * @version 1.0
  * @since 1.0.0
  * @since 1.0.0
  */
  */
-public class ResourceUtil {
-    private static ResourceUtil RESOURCE_UTIL = null;
+@Component
+public class ResourceUtil implements ApplicationContextAware {
 
 
-    private static ResourceBundle BUNDLE = java.util.ResourceBundle.getBundle("platform");
+    private static Environment environment;
 
 
-    private ResourceUtil() {
 
 
-    }
-
-    /**
-     * 工厂实现配置文件读取
-     *
-     * @param properties 参数
-     * @return ResourceUtil 工具类
-     */
-    public static ResourceUtil getInstance(String properties) {
-        if (RESOURCE_UTIL == null) {
-            RESOURCE_UTIL = new ResourceUtil();
-        }
-        if (properties != null) {
-            BUNDLE = java.util.ResourceBundle.getBundle(properties);
-        }
-        return RESOURCE_UTIL;
-    }
-
-    /**
-     * 工厂实现配置文件读取
-     *
-     * @return ResourceUtil
-     */
-    public static ResourceUtil getInstance() {
-        if (RESOURCE_UTIL == null) {
-            RESOURCE_UTIL = new ResourceUtil();
-        }
-        return RESOURCE_UTIL;
-    }
-
-    /**
-     * 主要功能:获取配置文件参数
-     * 注意事项:无
-     *
-     * @param name 参数名称
-     * @return 参数名称对应值
-     */
     public static String getConfigByName(String name) {
     public static String getConfigByName(String name) {
-        String value = "";
-        try {
-            value = new String(BUNDLE.getString(name).getBytes("iso8859-1"), "UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-        return value;
+        return environment.getProperty(name);
     }
     }
 
 
-    /**
-     * 主要功能:取得分隔符
-     * 注意事项:无
-     *
-     * @return 分隔符
-     */
-    public static String getSeparator() {
-        return System.getProperty("file.separator");
+    @Override
+    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+        ResourceUtil.environment = applicationContext.getEnvironment();
     }
     }
-
 }
 }

+ 31 - 29
platform-common/src/main/java/com/platform/utils/WxOpUtils.java

@@ -16,6 +16,7 @@ import org.apache.http.client.methods.HttpPost;
 import org.apache.http.entity.StringEntity;
 import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.impl.client.HttpClients;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.http.ResponseEntity;
@@ -37,6 +38,13 @@ import java.util.*;
 @Component
 @Component
 public class WxOpUtils {
 public class WxOpUtils {
 
 
+    private static RestTemplate restTemplate;
+
+    @Autowired
+    public void setRestTemplate(RestTemplate restTemplate){
+        WxOpUtils.restTemplate = restTemplate;
+    }
+
     public static final String SESSION_KEY = "session_key";
     public static final String SESSION_KEY = "session_key";
     public static final String WX_OPEN_ID_KEY = "openid";
     public static final String WX_OPEN_ID_KEY = "openid";
     public static final String WX_ACCESS_TOKEN = "WX_ACCESS_TOKEN_";
     public static final String WX_ACCESS_TOKEN = "WX_ACCESS_TOKEN_";
@@ -52,9 +60,6 @@ public class WxOpUtils {
     private static final String UP_LOAD_MEDIA = "https://api.weixin.qq.com/cgi-bin/media/upload";
     private static final String UP_LOAD_MEDIA = "https://api.weixin.qq.com/cgi-bin/media/upload";
     private static final String GET_TEMP_DATA_URL = "https://api.weixin.qq.com/cgi-bin/media/get";
     private static final String GET_TEMP_DATA_URL = "https://api.weixin.qq.com/cgi-bin/media/get";
 
 
-
-    private static RestTemplate restTemplate = new RestTemplate();
-
     private static String agencyWxAppId;
     private static String agencyWxAppId;
 
 
     private static String agencyWxAppSecret;
     private static String agencyWxAppSecret;
@@ -82,10 +87,10 @@ public class WxOpUtils {
         param.put("grant_type", "client_credential");
         param.put("grant_type", "client_credential");
         param.put("appid", appId);
         param.put("appid", appId);
         param.put("secret", secret);
         param.put("secret", secret);
-        String vxResult = HttpClientUtil.doGet(SUBSCRIBE_ACCESS_TOKEN_URL, param);
-        log.info(vxResult);
+        ResponseEntity<String> vxResult = restTemplate.getForEntity(SUBSCRIBE_ACCESS_TOKEN_URL,String.class, param);
+        log.info(vxResult.getBody());
 
 
-        AccessTokenModel accessTokenModel = JsonUtils.jsonToPojo(vxResult, AccessTokenModel.class);
+        AccessTokenModel accessTokenModel = JsonUtils.jsonToPojo(vxResult.getBody(), AccessTokenModel.class);
         //采用默认的缓存时长一个半小时
         //采用默认的缓存时长一个半小时
         LettuceRedisClientUtils.setStrKeyValue(redisKey , accessTokenModel.getAccess_token() , 5400);
         LettuceRedisClientUtils.setStrKeyValue(redisKey , accessTokenModel.getAccess_token() , 5400);
         return accessTokenModel.getAccess_token();
         return accessTokenModel.getAccess_token();
@@ -131,9 +136,9 @@ public class WxOpUtils {
         String accessToken = getAccessToken(appId, appSecret);
         String accessToken = getAccessToken(appId, appSecret);
         String url = PUBLIC_SUBSCRIBE_TWO_REQUEST_URL + accessToken;
         String url = PUBLIC_SUBSCRIBE_TWO_REQUEST_URL + accessToken;
         String json = JsonUtils.objectToJson(wxMssVO);
         String json = JsonUtils.objectToJson(wxMssVO);
-        String vxResult = HttpClientUtil.doPostJson(url, json);
+        ResponseEntity<String> vxResult = restTemplate.postForEntity(url, wxMssVO,String.class);
         //把信息封装为json
         //把信息封装为json
-        JSONObject res = JSONObject.parseObject(vxResult);
+        JSONObject res = JSONObject.parseObject(vxResult.getBody());
         //把信息封装到map
         //把信息封装到map
         Map<String, Object> map = parseJSON2Map(res);
         Map<String, Object> map = parseJSON2Map(res);
         if (null != map && map.containsKey("errcode")) {
         if (null != map && map.containsKey("errcode")) {
@@ -145,10 +150,9 @@ public class WxOpUtils {
                     log.info("token过期了");
                     log.info("token过期了");
                     accessToken = updateAccessToken(appId, appSecret);
                     accessToken = updateAccessToken(appId, appSecret);
                     url = PUBLIC_SUBSCRIBE_TWO_REQUEST_URL + accessToken;
                     url = PUBLIC_SUBSCRIBE_TWO_REQUEST_URL + accessToken;
-                    json = JsonUtils.objectToJson(wxMssVO);
-                    vxResult = HttpClientUtil.doPostJson(url, json);
+                    vxResult = restTemplate.postForEntity(url, wxMssVO,String.class);
                     //把信息封装为json
                     //把信息封装为json
-                    res = JSONObject.parseObject(vxResult);
+                    res = JSONObject.parseObject(vxResult.getBody());
                     //把信息封装到map
                     //把信息封装到map
                     map = parseJSON2Map(res);
                     map = parseJSON2Map(res);
                 }
                 }
@@ -179,10 +183,9 @@ public class WxOpUtils {
         wxMssVO.setLang("zh_CN");
         wxMssVO.setLang("zh_CN");
         wxMssVO.setPage(page);
         wxMssVO.setPage(page);
         String url = SUBSCRIBE_REQUEST_URL + accessToken;
         String url = SUBSCRIBE_REQUEST_URL + accessToken;
-        String json = JsonUtils.objectToJson(wxMssVO);
-        String vxResult = HttpClientUtil.doPostJson(url, json);
+        ResponseEntity<String> vxResult = restTemplate.postForEntity(url, wxMssVO,String.class);
         //把信息封装为json
         //把信息封装为json
-        JSONObject res = JSONObject.parseObject(vxResult);
+        JSONObject res = JSONObject.parseObject(vxResult.getBody());
         //把信息封装到map
         //把信息封装到map
         Map<String, Object> map = parseJSON2Map(res);
         Map<String, Object> map = parseJSON2Map(res);
         if (null != map && map.containsKey("errcode")) {
         if (null != map && map.containsKey("errcode")) {
@@ -195,10 +198,9 @@ public class WxOpUtils {
                     accessToken = updateAccessToken(appId, appSecret);
                     accessToken = updateAccessToken(appId, appSecret);
                     wxMssVO.setAccess_token(accessToken);
                     wxMssVO.setAccess_token(accessToken);
                     url = SUBSCRIBE_REQUEST_URL + accessToken;
                     url = SUBSCRIBE_REQUEST_URL + accessToken;
-                    json = JsonUtils.objectToJson(wxMssVO);
-                    vxResult = HttpClientUtil.doPostJson(url, json);
+                    vxResult = restTemplate.postForEntity(url, wxMssVO,String.class);
                     //把信息封装为json
                     //把信息封装为json
-                    res = JSONObject.parseObject(vxResult);
+                    res = JSONObject.parseObject(vxResult.getBody());
                     //把信息封装到map
                     //把信息封装到map
                     map = parseJSON2Map(res);
                     map = parseJSON2Map(res);
                 }
                 }
@@ -215,10 +217,10 @@ public class WxOpUtils {
         param.put("appid", appId);
         param.put("appid", appId);
         param.put("secret", secret);
         param.put("secret", secret);
 
 
-        String vxResult = HttpClientUtil.doGet(SUBSCRIBE_ACCESS_TOKEN_URL, param);
-        log.info(vxResult);
+        ResponseEntity<String> vxResult = restTemplate.getForEntity(SUBSCRIBE_ACCESS_TOKEN_URL,String.class, param);
+        log.info(vxResult.getBody());
 
 
-        AccessTokenModel accessTokenModel = JsonUtils.jsonToPojo(vxResult, AccessTokenModel.class);
+        AccessTokenModel accessTokenModel = JsonUtils.jsonToPojo(vxResult.getBody(), AccessTokenModel.class);
         //TODO:这里需要改成缓存到redis上去
         //TODO:这里需要改成缓存到redis上去
         //采用默认的缓存时长一个半小时
         //采用默认的缓存时长一个半小时
         LettuceRedisClientUtils.setAndExpStrKeyValue(redisKey , accessTokenModel.getAccess_token() , 5400);
         LettuceRedisClientUtils.setAndExpStrKeyValue(redisKey , accessTokenModel.getAccess_token() , 5400);
@@ -318,9 +320,9 @@ public class WxOpUtils {
             throw new CommonBaseException(ResultCodeEnum.D3014);
             throw new CommonBaseException(ResultCodeEnum.D3014);
         }
         }
         String url = CREATE_LIVE_ROOM_URL + "?access_token=" + token;
         String url = CREATE_LIVE_ROOM_URL + "?access_token=" + token;
-        String wxRspStr = HttpClientUtil.doPostJson(url , JSON.toJSONString(wxLiveRoomRequestVo));
-        log.info("创建直播间,微信返回内容为:{}" , wxRspStr);
-        JSONObject wxLiveRoomRspVo = JsonUtils.jsonToPojo(wxRspStr , JSONObject.class);
+        ResponseEntity<String> wxRspStr = restTemplate.postForEntity(url , JSON.toJSONString(wxLiveRoomRequestVo),String.class);
+        log.info("创建直播间,微信返回内容为:{}" , wxRspStr.getBody());
+        JSONObject wxLiveRoomRspVo = JsonUtils.jsonToPojo(wxRspStr.getBody() , JSONObject.class);
         return wxLiveRoomRspVo;
         return wxLiveRoomRspVo;
     }
     }
 
 
@@ -336,9 +338,9 @@ public class WxOpUtils {
         param.put("start" , start);
         param.put("start" , start);
         param.put("limit" , limit);
         param.put("limit" , limit);
         String url = GET_LIVE_ROOM_LIST_URL + "?access_token=" + token;
         String url = GET_LIVE_ROOM_LIST_URL + "?access_token=" + token;
-        String wxRspStr = HttpClientUtil.doPostJson(url ,  JSON.toJSONString(param));
-        log.info("创建直播间,微信返回内容为:{}" , wxRspStr);
-        JSONObject wxLiveRoomRspVo = JsonUtils.jsonToPojo(wxRspStr , JSONObject.class);
+        ResponseEntity<String> wxRspStr = restTemplate.postForEntity(url ,  JSON.toJSONString(param),String.class);
+        log.info("创建直播间,微信返回内容为:{}" , wxRspStr.getBody());
+        JSONObject wxLiveRoomRspVo = JsonUtils.jsonToPojo(wxRspStr.getBody() , JSONObject.class);
         return wxLiveRoomRspVo;
         return wxLiveRoomRspVo;
     }
     }
 
 
@@ -356,9 +358,9 @@ public class WxOpUtils {
         }
         }
 
 
         String url = GET_TEMP_DATA_URL + "?access_token=" + token + "&media_id=" + mediaId;
         String url = GET_TEMP_DATA_URL + "?access_token=" + token + "&media_id=" + mediaId;
-        String wxRsp = HttpClientUtil.doGet(url);
-        log.info("微信返回的照片链接为:{}" , wxRsp);
-        JSONObject jsonObject = JSON.parseObject(wxRsp);
+        ResponseEntity<String> wxRsp = restTemplate.getForEntity(url,String.class);
+        log.info("微信返回的照片链接为:{}" , wxRsp.getBody());
+        JSONObject jsonObject = JSON.parseObject(wxRsp.getBody());
         log.info("微信小程序返回数据为:{}" , jsonObject.toJSONString());
         log.info("微信小程序返回数据为:{}" , jsonObject.toJSONString());
         if(null != jsonObject){
         if(null != jsonObject){
             if(jsonObject.containsKey("video_url")){
             if(jsonObject.containsKey("video_url")){

+ 0 - 19
platform-gen/pom.xml

@@ -1,19 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <groupId>com.platform</groupId>
-        <artifactId>platform</artifactId>
-        <version>1.0.0</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>platform-gen</artifactId>
-    <packaging>jar</packaging>
-    <description>代码生成器模块</description>
-
-    <dependencies>
-        <dependency>
-            <groupId>com.platform</groupId>
-            <artifactId>platform-common</artifactId>
-            <version>1.0.0</version>
-        </dependency>
-    </dependencies>
-</project>

+ 0 - 77
platform-gen/src/main/java/com/platform/controller/SysGeneratorController.java

@@ -1,77 +0,0 @@
-package com.platform.controller;
-
-import com.alibaba.fastjson.JSON;
-import com.platform.service.SysGeneratorService;
-import com.platform.utils.DateUtils;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-import com.platform.utils.R;
-import com.platform.xss.XssHttpServletRequestWrapper;
-import org.apache.commons.io.IOUtils;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 代码生成器
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017年1月3日 下午6:35:28
- */
-@Controller
-@RequestMapping("/sys/generator")
-public class SysGeneratorController {
-    @Autowired
-    private SysGeneratorService sysGeneratorService;
-
-    /**
-     * 列表
-     */
-    @ResponseBody
-    @RequestMapping("/list")
-    @RequiresPermissions("sys:generator:list")
-    public R list(@RequestParam Map<String, Object> params) {
-        //查询列表数据
-        Query query = new Query(params);
-        List<Map<String, Object>> list = sysGeneratorService.queryList(query);
-        int total = sysGeneratorService.queryTotal(query);
-
-        PageUtils pageUtil = new PageUtils(list, total, query.getLimit(), query.getPage());
-
-        return R.ok().put("page", pageUtil);
-    }
-
-    /**
-     * 生成代码
-     */
-    @RequestMapping("/code")
-    @RequiresPermissions("sys:generator:code")
-    public void code(HttpServletRequest request, HttpServletResponse response) throws IOException {
-        String[] tableNames = new String[]{};
-        //获取表名,不进行xss过滤
-        HttpServletRequest orgRequest = XssHttpServletRequestWrapper.getOrgRequest(request);
-        String tables = orgRequest.getParameter("tables");
-        tableNames = JSON.parseArray(tables).toArray(tableNames);
-
-        byte[] data = sysGeneratorService.generatorCode(tableNames);
-
-        response.reset();
-        response.setHeader("Content-Disposition", "attachment; filename=\"AutoCode"
-                + DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN_YYYY_MM_DD_HH_MM_SS_SSS) + ".zip\"");
-        response.addHeader("Content-Length", "" + data.length);
-        response.setContentType("application/octet-stream; charset=UTF-8");
-
-        IOUtils.write(data, response.getOutputStream());
-    }
-}

+ 0 - 22
platform-gen/src/main/java/com/platform/dao/SysGeneratorDao.java

@@ -1,22 +0,0 @@
-package com.platform.dao;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 代码生成器
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年12月19日 下午3:32:04
- */
-public interface SysGeneratorDao {
-
-    List<Map<String, Object>> queryList(Map<String, Object> map);
-
-    int queryTotal(Map<String, Object> map);
-
-    Map<String, String> queryTable(String tableName);
-
-    List<Map<String, String>> queryColumns(String tableName);
-}

+ 0 - 25
platform-gen/src/main/java/com/platform/dao/SysOracleGeneratorDao.java

@@ -1,25 +0,0 @@
-package com.platform.dao;
-
-
-import com.platform.entity.ResultMap;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * oracle代码生成器
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017年07月23日 上午13:06:04
- */
-public interface SysOracleGeneratorDao {
-
-    List<Map<String, Object>> queryList(Map<String, Object> map);
-
-    int queryTotal(Map<String, Object> map);
-
-    Map<String, String> queryTable(String tableName);
-
-    List<ResultMap> queryColumns(String tableName);
-}

+ 0 - 82
platform-gen/src/main/java/com/platform/entity/ColumnEntity.java

@@ -1,82 +0,0 @@
-package com.platform.entity;
-
-/**
- * 列的属性
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年12月20日 上午12:01:45
- */
-public class ColumnEntity {
-    //列名
-    private String columnName;
-    //列名类型
-    private String dataType;
-    //列名备注
-    private String comments;
-
-    //属性名称(第一个字母大写),如:user_name => UserName
-    private String attrName;
-    //属性名称(第一个字母小写),如:user_name => userName
-    private String attrname;
-    //属性类型
-    private String attrType;
-    //auto_increment
-    private String extra;
-
-    public String getColumnName() {
-        return columnName;
-    }
-
-    public void setColumnName(String columnName) {
-        this.columnName = columnName;
-    }
-
-    public String getDataType() {
-        return dataType;
-    }
-
-    public void setDataType(String dataType) {
-        this.dataType = dataType;
-    }
-
-    public String getComments() {
-        return comments;
-    }
-
-    public void setComments(String comments) {
-        this.comments = comments;
-    }
-
-    public String getAttrname() {
-        return attrname;
-    }
-
-    public void setAttrname(String attrname) {
-        this.attrname = attrname;
-    }
-
-    public String getAttrName() {
-        return attrName;
-    }
-
-    public void setAttrName(String attrName) {
-        this.attrName = attrName;
-    }
-
-    public String getAttrType() {
-        return attrType;
-    }
-
-    public void setAttrType(String attrType) {
-        this.attrType = attrType;
-    }
-
-    public String getExtra() {
-        return extra;
-    }
-
-    public void setExtra(String extra) {
-        this.extra = extra;
-    }
-}

+ 0 - 60
platform-gen/src/main/java/com/platform/entity/ResultMap.java

@@ -1,60 +0,0 @@
-package com.platform.entity;
-
-/**
- * 名称:ResultMap <br>
- * 描述:查询表信息返回的BaseResultMap<br>
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-09-17 20:20
- */
-public class ResultMap {
-    /**
-     * 数据库字段名
-     */
-    private String columnName;
-    /**
-     * 字段类型
-     */
-    private String dataType;
-    /**
-     * 字段注释
-     */
-    private String columnComment;
-    /**
-     * 主键
-     */
-    private String columnKey;
-
-    public String getColumnName() {
-        return columnName;
-    }
-
-    public void setColumnName(String columnName) {
-        this.columnName = columnName;
-    }
-
-    public String getDataType() {
-        return dataType;
-    }
-
-    public void setDataType(String dataType) {
-        this.dataType = dataType;
-    }
-
-    public String getColumnComment() {
-        return columnComment;
-    }
-
-    public void setColumnComment(String columnComment) {
-        this.columnComment = columnComment;
-    }
-
-    public String getColumnKey() {
-        return columnKey;
-    }
-
-    public void setColumnKey(String columnKey) {
-        this.columnKey = columnKey;
-    }
-}

+ 0 - 74
platform-gen/src/main/java/com/platform/entity/TableEntity.java

@@ -1,74 +0,0 @@
-package com.platform.entity;
-
-import java.util.List;
-
-/**
- * 表数据
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年12月20日 上午12:02:55
- */
-public class TableEntity {
-    //表的名称
-    private String tableName;
-    //表的备注
-    private String comments;
-    //表的主键
-    private ColumnEntity pk;
-    //表的列名(不包含主键)
-    private List<ColumnEntity> columns;
-
-    //类名(第一个字母大写),如:sys_user => SysUser
-    private String className;
-    //类名(第一个字母小写),如:sys_user => sysUser
-    private String classname;
-
-    public String getTableName() {
-        return tableName;
-    }
-
-    public void setTableName(String tableName) {
-        this.tableName = tableName;
-    }
-
-    public String getComments() {
-        return comments;
-    }
-
-    public void setComments(String comments) {
-        this.comments = comments;
-    }
-
-    public ColumnEntity getPk() {
-        return pk;
-    }
-
-    public void setPk(ColumnEntity pk) {
-        this.pk = pk;
-    }
-
-    public List<ColumnEntity> getColumns() {
-        return columns;
-    }
-
-    public void setColumns(List<ColumnEntity> columns) {
-        this.columns = columns;
-    }
-
-    public String getClassName() {
-        return className;
-    }
-
-    public void setClassName(String className) {
-        this.className = className;
-    }
-
-    public String getClassname() {
-        return classname;
-    }
-
-    public void setClassname(String classname) {
-        this.classname = classname;
-    }
-}

+ 0 - 106
platform-gen/src/main/java/com/platform/generator/ApiMysqlGenerator.java

@@ -1,106 +0,0 @@
-package com.platform.generator;
-
-import com.baomidou.mybatisplus.generator.AutoGenerator;
-import com.baomidou.mybatisplus.generator.InjectionConfig;
-import com.baomidou.mybatisplus.generator.config.*;
-import com.baomidou.mybatisplus.generator.config.po.TableInfo;
-import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author abnerhou
- * @date 2020/9/11 19:32
- * @desciption
- */
-public class ApiMysqlGenerator {
-
-
-    public static void main(String[] args) {
-        AutoGenerator mpg = new AutoGenerator();
-
-        GlobalConfig gc = new GlobalConfig();
-        String projectPath = System.getProperty("user.dir");
-        gc.setOutputDir(projectPath + "/platform-api/src/main/java");
-        gc.setAuthor("abner");   // 作者
-        gc.setOpen(false);      //生成代码后是否打开文件夹
-        gc.setSwagger2(true);
-        gc.setMapperName("Api%sDao");
-        gc.setServiceImplName("Api%sServiceImpl");
-        gc.setServiceName("Api%sService");
-        gc.setEntityName("Api%sVo");
-//        gc.setXmlName("%sMapper");
-//        gc.setControllerName("%sController");
-        gc.setFileOverride(true);//是否覆盖
-        mpg.setGlobalConfig(gc);
-
-        DataSourceConfig dsc = new DataSourceConfig();
-        dsc.setUrl("jdbc:mysql://120.25.146.52:3306/4dage-zfb?useUnicode=true&serverTimezone=GMT&useSSL=false&characterEncoding=utf8");
-        dsc.setDriverName("com.mysql.jdbc.Driver");
-        dsc.setUsername("root");
-        dsc.setPassword("4dkk2020test%");
-        mpg.setDataSource(dsc);
-
-        // 包配置
-        PackageConfig pc = new PackageConfig();
-        pc.setModuleName("platform"); // 模块名称, 这里可以根据不同模块来写
-        pc.setParent("com"); // 父包名
-        pc.setMapper("dao");
-        pc.setController("controller");
-
-        mpg.setPackageInfo(pc);
-
-        // 配置模板
-        TemplateConfig templateConfig = new TemplateConfig();
-
-        //控制 不生成 controller
-        templateConfig.setController("");
-
-        templateConfig.setXml(null);
-        mpg.setTemplate(templateConfig);
-
-
-        // 注入自定义配置,可以在 VM 中使用 cfg.abc 【可无】
-        InjectionConfig cfg = new InjectionConfig() {
-            @Override
-            public void initMap() {
-                Map<String, Object> map = new HashMap<String, Object>();
-                map.put("abc", this.getConfig().getGlobalConfig().getAuthor() + "-mp");
-                this.setMap(map);
-            }
-        };
-
-        // 调整 xml 生成目录演示
-        List<FileOutConfig> focList = new ArrayList<FileOutConfig>();
-        focList.add(new FileOutConfig("/templates/mapper.xml.vm") {
-            @Override
-            public String outputFile(TableInfo tableInfo) {
-                String mapperCoreName = tableInfo.getEntityName().substring(3 , (tableInfo.getEntityName().length() - 2));
-                return  "E:\\code\\projects\\dev_shop\\platform-api\\src\\main\\resources\\com\\platform\\dao\\" +  "Api" + mapperCoreName + "Mapper.xml";
-            }
-        });
-        cfg.setFileOutConfigList(focList);
-        mpg.setCfg(cfg);
-
-
-        // 策略配置
-        StrategyConfig strategy = new StrategyConfig();
-        strategy.setNaming(NamingStrategy.underline_to_camel);
-        strategy.setColumnNaming(NamingStrategy.underline_to_camel);
-//        strategy.setSuperEntityClass("house.api.base.model");
-
-        strategy.setEntityLombokModel(true);
-       /* strategy.setInclude("tm_slide_show","tm_live_room_info",
-                "tm_scene_census","tm_brand_admin");  // 如果要生成多个,这里可以传入String[]
-        strategy.setInclude("tm_scene_census");*/  // 如果要生成多个,这里可以传入String[]
-//        strategy.setInclude("tm_deal_log");
-        strategy.setInclude("tm_brand_type");
-        mpg.setStrategy(strategy);
-        //TODO:使用的时候,释放出来就可以了
-        mpg.execute();
-        System.out.println("代码自动生成执行完成");
-    }
-}

+ 0 - 107
platform-gen/src/main/java/com/platform/generator/MysqlGenerator.java

@@ -1,107 +0,0 @@
-package com.platform.generator;
-
-import com.baomidou.mybatisplus.generator.AutoGenerator;
-import com.baomidou.mybatisplus.generator.InjectionConfig;
-import com.baomidou.mybatisplus.generator.config.*;
-import com.baomidou.mybatisplus.generator.config.po.TableInfo;
-import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author abnerhou
- * @date 2020/6/3 14:54
- * @desciption
- */
-public class MysqlGenerator {
-
-
-    public static void main(String[] args) {
-        AutoGenerator mpg = new AutoGenerator();
-
-        GlobalConfig gc = new GlobalConfig();
-        String projectPath = System.getProperty("user.dir");
-//        gc.setOutputDir(projectPath + "/platform-shop/src/main/java");
-        gc.setOutputDir(projectPath + "/platform-common/src/main/java");
-        gc.setAuthor("abner");   // 作者
-        gc.setOpen(false);      //生成代码后是否打开文件夹
-        gc.setSwagger2(true);
-        gc.setMapperName("%sDao");
-//        gc.setXmlName("%sMapper");
-//        gc.setControllerName("%sController");
-        gc.setFileOverride(true);//是否覆盖
-        mpg.setGlobalConfig(gc);
-
-        DataSourceConfig dsc = new DataSourceConfig();
-        dsc.setUrl("jdbc:mysql://120.25.146.52:3306/4dage-zfb?useUnicode=true&serverTimezone=GMT&useSSL=false&characterEncoding=utf8");
-        dsc.setDriverName("com.mysql.jdbc.Driver");
-        dsc.setUsername("root");
-        dsc.setPassword("4dkk2020test%");
-        mpg.setDataSource(dsc);
-
-        // 包配置
-        PackageConfig pc = new PackageConfig();
-        pc.setModuleName("platform"); // 模块名称, 这里可以根据不同模块来写
-        pc.setParent("com"); // 父包名
-        pc.setMapper("dao");
-        pc.setController("controller");
-
-        mpg.setPackageInfo(pc);
-
-        // 配置模板
-        TemplateConfig templateConfig = new TemplateConfig();
-
-        //控制 不生成 controller
-        templateConfig.setController("");
-
-        templateConfig.setXml(null);
-        mpg.setTemplate(templateConfig);
-
-
-        // 注入自定义配置,可以在 VM 中使用 cfg.abc 【可无】
-        InjectionConfig cfg = new InjectionConfig() {
-            @Override
-            public void initMap() {
-                Map<String, Object> map = new HashMap<String, Object>();
-                map.put("abc", this.getConfig().getGlobalConfig().getAuthor() + "-mp");
-                this.setMap(map);
-            }
-        };
-
-        // 调整 xml 生成目录演示
-        List<FileOutConfig> focList = new ArrayList<FileOutConfig>();
-        focList.add(new FileOutConfig("/templates/mapper.xml.vm") {
-            @Override
-            public String outputFile(TableInfo tableInfo) {
-                return  "E:\\code\\projects\\dev_shop\\platform-common\\src\\main\\resources\\com\\platform\\dao\\" + tableInfo.getEntityName() + "Mapper.xml";
-            }
-        });
-        cfg.setFileOutConfigList(focList);
-        mpg.setCfg(cfg);
-
-
-        // 策略配置
-        StrategyConfig strategy = new StrategyConfig();
-        strategy.setNaming(NamingStrategy.underline_to_camel);
-        strategy.setColumnNaming(NamingStrategy.underline_to_camel);
-//        strategy.setSuperEntityClass("house.api.base.model");
-
-        strategy.setEntityLombokModel(true);
-      /*  strategy.setInclude("tm_slide_show",
-                "tm_live_room_info",
-                "tm_live_goods","tm_scene_census",
-                "tm_task_log","tm_goods_visit_history",
-                "tm_brand_admin","tm_goods_detail_log");  // 如果要生成多个,这里可以传入String[]
-        strategy.setInclude("tm_scene_census"); */  // 如果要生成多个,这里可以传入String[]
-
-//        strategy.setInclude("tm_deal_log");
-        strategy.setInclude("sys_user_brand");
-        mpg.setStrategy(strategy);
-        //TODO:使用的时候,释放出来就可以了
-        mpg.execute();
-        System.out.println("代码自动生成执行完成");
-    }
-}

+ 0 - 27
platform-gen/src/main/java/com/platform/service/SysGeneratorService.java

@@ -1,27 +0,0 @@
-package com.platform.service;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 代码生成器
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年12月19日 下午3:33:38
- */
-public interface SysGeneratorService {
-
-    List<Map<String, Object>> queryList(Map<String, Object> map);
-
-    int queryTotal(Map<String, Object> map);
-
-    Map<String, String> queryTable(String tableName);
-
-    List<Map<String, String>> queryColumns(String tableName);
-
-    /**
-     * 生成代码
-     */
-    byte[] generatorCode(String[] tableNames);
-}

+ 0 - 125
platform-gen/src/main/java/com/platform/service/impl/SysGeneratorServiceImpl.java

@@ -1,125 +0,0 @@
-package com.platform.service.impl;
-
-import com.platform.dao.SysGeneratorDao;
-import com.platform.dao.SysOracleGeneratorDao;
-import com.platform.entity.ResultMap;
-import com.platform.service.SysGeneratorService;
-import com.platform.utils.Constant;
-import com.platform.utils.GenUtils;
-import com.platform.utils.StringUtils;
-import org.apache.commons.io.IOUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.io.ByteArrayOutputStream;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.zip.ZipOutputStream;
-
-@Service("sysGeneratorService")
-public class SysGeneratorServiceImpl implements SysGeneratorService {
-    @Autowired
-    private SysGeneratorDao sysGeneratorDao;
-    @Autowired
-    private SysOracleGeneratorDao sysOracleGeneratorDao;
-
-    @Override
-    public List<Map<String, Object>> queryList(Map<String, Object> map) {
-        if ("ORACLE".equals(Constant.USE_DATA)) {
-            List<Map<String, Object>> list = sysOracleGeneratorDao.queryList(map);
-
-            //oracle需转为驼峰命名
-            List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>();
-            for (Map<String, Object> stringObjectMap : list) {
-                Map<String, Object> objectMap = new HashMap<String, Object>();
-                for (String key : stringObjectMap.keySet()) {
-                    String mapKey = StringUtils.lineToHump(key);
-                    objectMap.put(mapKey, stringObjectMap.get(key));
-                }
-                mapList.add(objectMap);
-            }
-            return mapList;
-        }
-        return sysGeneratorDao.queryList(map);
-    }
-
-    @Override
-    public int queryTotal(Map<String, Object> map) {
-        if ("ORACLE".equals(Constant.USE_DATA)) {
-            return sysOracleGeneratorDao.queryTotal(map);
-        }
-        return sysGeneratorDao.queryTotal(map);
-    }
-
-    @Override
-    public Map<String, String> queryTable(String tableName) {
-        if ("ORACLE".equals(Constant.USE_DATA)) {
-            Map<String, String> objectMap = sysOracleGeneratorDao.queryTable(tableName);
-
-            //oracle需转为驼峰命名
-            Map<String, String> map = new HashMap<String, String>();
-            for (String key : objectMap.keySet()) {
-                String mapKey = StringUtils.lineToHump(key);
-                map.put(mapKey, objectMap.get(key));
-            }
-            return map;
-        }
-        return sysGeneratorDao.queryTable(tableName);
-    }
-
-    @Override
-    public List<Map<String, String>> queryColumns(String tableName) {
-        if ("ORACLE".equals(Constant.USE_DATA)) {
-            List<ResultMap> list = sysOracleGeneratorDao.queryColumns(tableName);
-
-            //oracle
-            List<Map<String, String>> mapList = new ArrayList<Map<String, String>>();
-            for (ResultMap stringObjectMap : list) {
-                // 获取实体类的所有属性,返回Field数组
-                Field[] field = stringObjectMap.getClass().getDeclaredFields();
-
-                Map<String, String> objectMap = new HashMap<String, String>();
-                for (int j = 0; j < field.length; j++) {
-                    // 获取属性的名字
-                    String name = field[j].getName();
-                    // 将属性的首字符大写,方便构造get,set方法
-                    String Name = name.substring(0, 1).toUpperCase() + name.substring(1);
-
-                    try {
-                        Method m = stringObjectMap.getClass().getMethod("get" + Name);
-                        // 调用getter方法获取属性值
-                        String value = (String) m.invoke(stringObjectMap);
-                        objectMap.put(name, value);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    }
-                }
-                mapList.add(objectMap);
-            }
-            return mapList;
-        }
-        return sysGeneratorDao.queryColumns(tableName);
-    }
-
-    @Override
-    public byte[] generatorCode(String[] tableNames) {
-        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-        ZipOutputStream zip = new ZipOutputStream(outputStream);
-
-        for (String tableName : tableNames) {
-            //查询表信息
-            Map<String, String> table = queryTable(tableName);
-            //查询列信息
-            List<Map<String, String>> columns = queryColumns(tableName);
-            //生成代码
-            GenUtils.generatorCode(table, columns, zip);
-        }
-        IOUtils.closeQuietly(zip);
-        return outputStream.toByteArray();
-    }
-
-}

+ 0 - 242
platform-gen/src/main/java/com/platform/utils/GenUtils.java

@@ -1,242 +0,0 @@
-package com.platform.utils;
-
-import com.platform.entity.ColumnEntity;
-import com.platform.entity.TableEntity;
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.configuration.PropertiesConfiguration;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.WordUtils;
-import org.apache.velocity.Template;
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.Velocity;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.util.*;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-
-/**
- * 代码生成器   工具类
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017年1月3日 下午6:35:28
- */
-public class GenUtils {
-
-    private static List<String> getTemplates() {
-        List<String> templates = new ArrayList<String>();
-        templates.add("template/Entity.java.vm");
-        templates.add("template/Dao.java.vm");
-        templates.add("template/Dao.xml.vm");
-        templates.add("template/Service.java.vm");
-        templates.add("template/ServiceImpl.java.vm");
-        templates.add("template/Controller.java.vm");
-        templates.add("template/list.html.vm");
-        templates.add("template/list.js.vm");
-        templates.add("template/menu.sql.vm");
-        return templates;
-    }
-
-    /**
-     * 生成代码
-     */
-    public static void generatorCode(Map<String, String> table,
-                                     List<Map<String, String>> columns, ZipOutputStream zip) {
-        //配置信息
-        Configuration config = getConfig();
-
-        //表信息
-        TableEntity tableEntity = new TableEntity();
-        tableEntity.setTableName(table.get("tableName"));
-        tableEntity.setComments(table.get("tableComment"));
-        String tablePrefix = table.get("tableName").split("_")[0];
-        //表名转换成Java类名
-        String className = tableToJava(tableEntity.getTableName(), tablePrefix);
-        tableEntity.setClassName(className);
-        tableEntity.setClassname(StringUtils.uncapitalize(className));
-
-        //列信息
-        List<ColumnEntity> columsList = new ArrayList<>();
-        boolean hasDate = false;
-        boolean hasBigDecimal = false;
-        for (Map<String, String> column : columns) {
-            ColumnEntity columnEntity = new ColumnEntity();
-            columnEntity.setColumnName(column.get("columnName"));
-            columnEntity.setDataType(column.get("dataType"));
-            columnEntity.setComments(column.get("columnComment"));
-            columnEntity.setExtra(column.get("extra"));
-
-            //列名转换成Java属性名
-            String attrName = columnToJava(columnEntity.getColumnName());
-            columnEntity.setAttrName(attrName);
-            columnEntity.setAttrname(StringUtils.uncapitalize(attrName));
-
-            //列的数据类型,转换成Java类型
-            String attrType = config.getString(columnEntity.getDataType(), "String");
-            columnEntity.setAttrType(attrType);
-
-            if ("Date".equals(attrType)) {
-                hasDate = true;
-            }
-            if ("BigDecimal".equals(attrType)) {
-                hasBigDecimal = true;
-            }
-            //是否主键
-            if ("ORACLE".equals(Constant.USE_DATA)) {
-                if ((column.get("columnName").equalsIgnoreCase(column.get("columnKey")) && tableEntity.getPk() == null)) {
-                    tableEntity.setPk(columnEntity);
-                }
-            } else {
-                if (("PRI".equalsIgnoreCase(column.get("columnKey")) && tableEntity.getPk() == null)) {
-                    tableEntity.setPk(columnEntity);
-                }
-            }
-
-            columsList.add(columnEntity);
-        }
-        tableEntity.setColumns(columsList);
-
-        //若没主键
-        if (tableEntity.getPk() == null) {
-            //设置columnName为id的为主键
-            boolean flag = true;
-            for (ColumnEntity columnEntity : tableEntity.getColumns()) {
-                if ("id".equals(columnEntity.getAttrname())) {
-                    tableEntity.setPk(columnEntity);
-                    flag = false;
-                    break;
-                }
-            }
-            //若无id字段则第一个字段为主键
-            if (flag) {
-                tableEntity.setPk(tableEntity.getColumns().get(0));
-            }
-        }
-
-        String pre = tablePrefix.replace("_", "").toLowerCase();
-
-        //设置velocity资源加载器
-        Properties prop = new Properties();
-        prop.put("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
-        Velocity.init(prop);
-
-        //封装模板数据
-        Map<String, Object> map = new HashMap<>();
-        map.put("tableName", tableEntity.getTableName());
-        map.put("comments", tableEntity.getComments());
-        map.put("pk", tableEntity.getPk());
-        map.put("className", tableEntity.getClassName());
-        map.put("classname", tableEntity.getClassname());
-        map.put("pathName", tableEntity.getClassname().toLowerCase());
-        map.put("columns", tableEntity.getColumns());
-        map.put("package", config.getString("package"));
-        map.put("author", config.getString("author"));
-        map.put("datetime", DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN));
-        map.put("hasDate", hasDate);
-        map.put("hasBigDecimal", hasBigDecimal);
-        map.put("pre", pre);
-        VelocityContext context = new VelocityContext(map);
-
-        //获取模板列表
-        List<String> templates = getTemplates();
-        for (String template : templates) {
-            //渲染模板
-            StringWriter sw = new StringWriter();
-            Template tpl = Velocity.getTemplate(template, "UTF-8");
-            tpl.merge(context, sw);
-
-            try {
-                //添加到zip
-                zip.putNextEntry(new ZipEntry(getFileName(template, tableEntity.getClassName(), config.getString("package"), pre)));
-                IOUtils.write(sw.toString(), zip, "UTF-8");
-                IOUtils.closeQuietly(sw);
-                zip.closeEntry();
-            } catch (IOException e) {
-                throw new RRException("渲染模板失败,表名:" + tableEntity.getTableName(), e);
-            }
-        }
-    }
-
-    /**
-     * 列名转换成Java属性名
-     */
-    private static String columnToJava(String columnName) {
-        return WordUtils.capitalizeFully(columnName, new char[]{'_'}).replace("_", "");
-    }
-
-    /**
-     * 表名转换成Java类名
-     */
-    public static String tableToJava(String tableName, String tablePrefix) {
-        if (StringUtils.isNotBlank(tablePrefix)) {
-            tableName = tableName.replace(tablePrefix, "");
-        }
-        return columnToJava(tableName);
-    }
-
-    /**
-     * 获取配置信息
-     */
-    private static Configuration getConfig() {
-        try {
-            return new PropertiesConfiguration("generator.properties");
-        } catch (ConfigurationException e) {
-            throw new RRException("获取配置文件失败,", e);
-        }
-    }
-
-    /**
-     * 获取文件名
-     */
-    private static String getFileName(String template, String className, String packageName, String tablePrefix) {
-
-        String packagePath = "main" + File.separator + "java" + File.separator;
-        if (StringUtils.isNotBlank(packageName)) {
-            packagePath += packageName.replace(".", File.separator) + File.separator;
-        }
-
-        if (template.contains("Entity.java.vm")) {
-            return packagePath + "entity" + File.separator + className + "Entity.java";
-        }
-
-        if (template.contains("Dao.java.vm")) {
-            return packagePath + "dao" + File.separator + className + "Dao.java";
-        }
-
-        if (template.contains("Dao.xml.vm")) {
-            return packagePath + "dao" + File.separator + className + "Dao.xml";
-        }
-
-        if (template.contains("Service.java.vm")) {
-            return packagePath + "service" + File.separator + className + "Service.java";
-        }
-
-        if (template.contains("ServiceImpl.java.vm")) {
-            return packagePath + "service" + File.separator + "impl" + File.separator + className + "ServiceImpl.java";
-        }
-
-        if (template.contains("Controller.java.vm")) {
-            return packagePath + "controller" + File.separator + className + "Controller.java";
-        }
-
-        if (template.contains("list.html.vm")) {
-            return "main" + File.separator + "webapp" + File.separator + "WEB-INF" + File.separator + "page"
-                    + File.separator + tablePrefix + File.separator + className.toLowerCase() + ".html";
-        }
-
-        if (template.contains("list.js.vm")) {
-            return "main" + File.separator + "webapp" + File.separator + "js" + File.separator + tablePrefix + File.separator + className.toLowerCase() + ".js";
-        }
-
-        if (template.contains("menu.sql.vm")) {
-            return className.toLowerCase() + "_menu.sql";
-        }
-
-        return null;
-    }
-}

+ 0 - 33
platform-gen/src/main/resources/com/platform/dao/SysGeneratorDao.xml

@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="com.platform.dao.SysGeneratorDao">
-	<select id="queryList" resultType="map">
-		select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables 
-			where table_schema = (select database()) 
-		<if test="tableName != null and tableName.trim() != ''">
-			and table_name like concat('%', #{tableName}, '%') 
-		</if>
-		order by create_time desc
-		<if test="offset != null and limit != null">
-			limit #{offset}, #{limit}
-		</if>
-	</select>
-	
-	<select id="queryTotal" resultType="int">
-		select count(*) from information_schema.tables where table_schema = (select database())
-		<if test="tableName != null and tableName.trim() != ''">
-			and table_name like concat('%', #{tableName}, '%') 
-		</if> 
-	</select> 
-	
-	<select id="queryTable" resultType="map">
-		select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables 
-			where table_schema = (select database()) and table_name = #{tableName}
-	</select> 
-	
-	<select id="queryColumns" resultType="map">
-		select column_name columnName, data_type dataType, column_comment columnComment, column_key columnKey, extra from information_schema.columns
- 			where table_name = #{tableName} and table_schema = (select database()) order by ordinal_position
-	</select>
-</mapper>

+ 0 - 67
platform-gen/src/main/resources/com/platform/dao/SysOracleGeneratorDao.xml

@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="com.platform.dao.SysOracleGeneratorDao">
-    <resultMap id="BaseResultMap" type="com.platform.entity.ResultMap">
-        <result column="column_name" property="columnName" jdbcType="VARCHAR"/>
-        <result column="data_type" property="dataType" jdbcType="VARCHAR"/>
-        <result column="column_comment" property="columnComment" jdbcType="VARCHAR"/>
-        <result column="column_key" property="columnKey" jdbcType="VARCHAR"/>
-    </resultMap>
-    <select id="queryList" resultType="map">
-        SELECT TABLE_NAME, COMMENTS table_Comment
-        FROM (SELECT ROWNUM AS RN,
-        USER_TAB_COMMENTS.TABLE_NAME TABLE_NAME,
-        USER_TAB_COMMENTS.COMMENTS COMMENTS,
-        USER_TABLES.TABLESPACE_NAME
-        FROM USER_TAB_COMMENTS
-        LEFT JOIN USER_TABLES
-        ON USER_TABLES.TABLE_NAME = USER_TAB_COMMENTS.TABLE_NAME
-        WHERE 1 = 1
-        <if test="tableName != null and tableName.trim() != ''">
-            AND USER_TABLES.table_Name LIKE concat(concat('%', #{tableName}), '%')
-        </if>
-        )
-        WHERE 1 = 1
-        <if test="offset != null and limit != null">
-            AND rn &gt;= #{offset} AND rn &lt;= #{rnum}
-        </if>
-    </select>
-
-    <select id="queryTotal" resultType="int">
-        SELECT COUNT(*)
-        FROM USER_TAB_COMMENTS
-        LEFT JOIN USER_TABLES
-        ON USER_TABLES.TABLE_NAME = USER_TAB_COMMENTS.TABLE_NAME
-        WHERE 1 = 1
-        <if test="tableName != null and tableName.trim() != ''">
-            and USER_TAB_COMMENTS.table_name like concat(concat('%', #{tableName}), '%')
-        </if>
-    </select>
-
-    <select id="queryTable" resultType="map">
-        SELECT USER_TAB_COMMENTS.TABLE_NAME TABLE_NAME,
-        USER_TAB_COMMENTS.COMMENTS   table_Comment,
-        USER_TABLES.TABLESPACE_NAME
-        FROM USER_TAB_COMMENTS
-        LEFT JOIN USER_TABLES
-        ON USER_TABLES.TABLE_NAME = USER_TAB_COMMENTS.TABLE_NAME
-        WHERE USER_TAB_COMMENTS.table_name = #{tableName}
-    </select>
-
-    <select id="queryColumns" resultMap="BaseResultMap">
-		select column_name column_name,
-       lower(DATA_TYPE ||
-             decode(DATA_TYPE,
-                    'DATE',
-                    '',
-                    '(' || nvl(DATA_PRECISION, data_length) ||
-                    nvl2(nullif(DATA_SCALE, 0), ',' || data_scale, '') || ')')) data_type,
-       (select comments from user_col_comments where table_name = #{tableName} and column_name = user_tab_columns.column_Name) column_comment,
-       (select col.column_name from user_constraints con, user_cons_columns col where con.constraint_name = col.constraint_name and con.constraint_type = 'P' and col.table_name = #{tableName}) column_key
-          from user_tab_columns
-          LEFT JOIN USER_TABLES
-            ON USER_TABLES.TABLE_NAME = user_tab_columns.TABLE_NAME
-         WHERE user_tab_columns.table_name = #{tableName}
-	</select>
-</mapper>

+ 0 - 29
platform-gen/src/main/resources/generator.properties

@@ -1,29 +0,0 @@
-#\u4EE3\u7801\u751F\u6210\u5668\uFF0C\u914D\u7F6E\u4FE1\u606F
-
-
-#\u5305\u540D
-package=com.platform
-#\u4F5C\u8005
-author=lipengjun
-
-#\u7C7B\u578B\u8F6C\u6362\uFF0C\u914D\u7F6E\u4FE1\u606F
-tinyint=Integer
-smallint=Integer
-mediumint=Integer
-int=Integer
-integer=Integer
-bigint=Long
-float=Float
-double=Double
-decimal=BigDecimal
-
-char=String
-varchar=String
-tinytext=String
-text=String
-mediumtext=String
-longtext=String
-
-date=Date
-datetime=Date
-timestamp=Date

+ 0 - 126
platform-gen/src/main/resources/template/Controller.java.vm

@@ -1,126 +0,0 @@
-/*
- * 类名称:${className}Controller.java
- * 包名称:${package}.controller
- *
- * 修改履历:
- *     日期                       修正者        主要内容
- *     ${datetime}        ${author}     初版做成
- *
- * Copyright (c) 2019-2019 微同科技
- */
-package ${package}.controller;
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.platform.annotation.SysLog;
-import com.platform.utils.R;
-import com.platform.controller.AbstractController;
-import ${package}.entity.${className}Entity;
-import ${package}.service.${className}Service;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * ${comments}Controller
- *
- * @author ${author}
- * @date ${datetime}
- */
-@RestController
-@RequestMapping("${pre}/${pathName}")
-public class ${className}Controller extends AbstractController {
-    @Autowired
-    private ${className}Service ${classname}Service;
-
-    /**
-     * 查看所有列表
-     *
-     * @param params 查询参数
-     * @return R
-     */
-    @RequestMapping("/queryAll")
-    @RequiresPermissions("${pre}:${pathName}:list")
-    public R queryAll(@RequestParam Map<String, Object> params) {
-        List<${className}Entity> list = ${classname}Service.queryAll(params);
-
-        return R.ok().put("list", list);
-    }
-
-    /**
-     * 分页查询${comments}
-     *
-     * @param params 查询参数
-     * @return R
-     */
-    @GetMapping("/list")
-    @RequiresPermissions("${pre}:${pathName}:list")
-    public R list(@RequestParam Map<String, Object> params) {
-        Page page = ${classname}Service.queryPage(params);
-
-        return R.ok().put("page", page);
-    }
-
-    /**
-     * 根据主键查询详情
-     *
-     * @param ${pk.attrname} 主键
-     * @return R
-     */
-    @RequestMapping("/info/{${pk.attrname}}")
-    @RequiresPermissions("${pre}:${pathName}:info")
-    public R info(@PathVariable("${pk.attrname}") ${pk.attrType} ${pk.attrname}) {
-        ${className}Entity ${classname} = ${classname}Service.getById(${pk.attrname});
-
-        return R.ok().put("${pathName}", ${classname});
-    }
-
-    /**
-     * 新增${comments}
-     *
-     * @param ${classname} ${classname}
-     * @return R
-     */
-    @SysLog("新增${comments}")
-    @RequestMapping("/save")
-    @RequiresPermissions("${pre}:${pathName}:save")
-    public R save(@RequestBody ${className}Entity ${classname}) {
-
-        ${classname}Service.add(${classname});
-
-        return R.ok();
-    }
-
-    /**
-     * 修改${comments}
-     *
-     * @param ${classname} ${classname}
-     * @return R
-     */
-    @SysLog("修改${comments}")
-    @RequestMapping("/update")
-    @RequiresPermissions("${pre}:${pathName}:update")
-    public R update(@RequestBody ${className}Entity ${classname}) {
-
-        ${classname}Service.update(${classname});
-
-        return R.ok();
-    }
-
-    /**
-     * 根据主键删除${comments}
-     *
-     * @param ${pk.attrname}s ${pk.attrname}s
-     * @return R
-     */
-    @SysLog("删除${comments}")
-    @RequestMapping("/delete")
-    @RequiresPermissions("${pre}:${pathName}:delete")
-    public R delete(@RequestBody ${pk.attrType}[] ${pk.attrname}s) {
-        ${classname}Service.deleteBatch(${pk.attrname}s);
-
-        return R.ok();
-    }
-}

+ 0 - 47
platform-gen/src/main/resources/template/Dao.java.vm

@@ -1,47 +0,0 @@
-/*
- * 类名称:${className}Dao.java
- * 包名称:${package}.dao
- *
- * 修改履历:
- *     日期                       修正者        主要内容
- *     ${datetime}        ${author}     初版做成
- *
- * Copyright (c) 2019-2019 微同科技
- */
-package ${package}.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import ${package}.entity.${className}Entity;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * ${comments}Dao
- *
- * @author ${author}
- * @date ${datetime}
- */
-@Mapper
-public interface ${className}Dao extends BaseMapper<${className}Entity> {
-
-    /**
-     * 查询所有列表
-     *
-     * @param params 查询参数
-     * @return List
-     */
-    List<${className}Entity> queryAll(@Param("params") Map<String, Object> params);
-
-    /**
-     * 自定义分页查询
-     *
-     * @param page   分页参数
-     * @param params 查询参数
-     * @return List
-     */
-    List<${className}Entity> select${className}Page(IPage page, @Param("params") Map<String, Object> params);
-}

+ 0 - 27
platform-gen/src/main/resources/template/Dao.xml.vm

@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="${package}.dao.${className}Dao">
-
-    <sql id="selectSql">
-        SELECT
-#foreach($column in $columns)
-        T.$column.columnName#if($velocityCount != $columns.size()),
-#end
-#end
-
-        FROM ${tableName} T
-        WHERE 1=1
-        <if test="params.name != null and params.name.trim() != ''">
-            AND T.NAME LIKE '%${params.name}%'
-        </if>
-    </sql>
-
-    <select id="select${className}Page" resultType="${package}.entity.${className}Entity">
-        <include refid="selectSql"/>
-    </select>
-
-    <select id="queryAll" resultType="${package}.entity.${className}Entity">
-        <include refid="selectSql"/>
-    </select>
-</mapper>

+ 0 - 49
platform-gen/src/main/resources/template/Entity.java.vm

@@ -1,49 +0,0 @@
-/*
- * 类名称:${className}Entity.java
- * 包名称:${package}.entity
- *
- * 修改履历:
- *     日期                       修正者        主要内容
- *     ${datetime}        ${author}     初版做成
- *
- * Copyright (c) 2019-2019 微同科技
- */
-package ${package}.entity;
-
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
-
-import java.io.Serializable;
-#if(${hasBigDecimal})
-import java.math.BigDecimal;
-#end
-#if(${hasDate})
-import java.util.Date;
-#end
-
-/**
- * ${comments}实体
- *
- * @author ${author}
- * @date ${datetime}
- */
-@Data
-@TableName("${tableName}")
-public class ${className}Entity implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-#foreach ($column in $columns)
-#if($column.columnName == $pk.columnName)
-    /**
-     * $column.comments
-     */
-    @TableId
-    private $column.attrType $column.attrname;
-#else
-    /**
-     * $column.comments
-     */
-    private $column.attrType $column.attrname;
-#end#end
-}

+ 0 - 75
platform-gen/src/main/resources/template/Service.java.vm

@@ -1,75 +0,0 @@
-/*
- * 类名称:${className}Service.java
- * 包名称:${package}.service
- *
- * 修改履历:
- *     日期                       修正者        主要内容
- *     ${datetime}        ${author}     初版做成
- *
- * Copyright (c) 2019-2019 微同科技
- */
-package ${package}.service;
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.IService;
-import ${package}.entity.${className}Entity;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * ${comments}Service接口
- *
- * @author ${author}
- * @date ${datetime}
- */
-public interface ${className}Service extends IService<${className}Entity> {
-
-    /**
-     * 查询所有列表
-     *
-     * @param params 查询参数
-     * @return List
-     */
-    List<${className}Entity> queryAll(Map<String, Object> params);
-
-    /**
-     * 分页查询${comments}
-     *
-     * @param params 查询参数
-     * @return Page
-     */
-    Page queryPage(Map<String, Object> params);
-
-    /**
-     * 新增${comments}
-     *
-     * @param ${classname} ${comments}
-     * @return 新增结果
-     */
-    boolean add(${className}Entity ${classname});
-
-    /**
-     * 根据主键更新${comments}
-     *
-     * @param ${classname} ${comments}
-     * @return 更新结果
-     */
-    boolean update(${className}Entity ${classname});
-
-    /**
-     * 根据主键删除${comments}
-     *
-     * @param ${pk.attrname} ${pk.attrname}
-     * @return 删除结果
-     */
-    boolean delete(${pk.attrType} ${pk.attrname});
-
-    /**
-     * 根据主键批量删除
-     *
-     * @param ${pk.attrname}s ${pk.attrname}s
-     * @return 删除结果
-     */
-    boolean deleteBatch(${pk.attrType}[] ${pk.attrname}s);
-}

+ 0 - 69
platform-gen/src/main/resources/template/ServiceImpl.java.vm

@@ -1,69 +0,0 @@
-/*
- * 类名称:${className}ServiceImpl.java
- * 包名称:${package}.service.impl
- *
- * 修改履历:
- *     日期                       修正者        主要内容
- *     ${datetime}        ${author}     初版做成
- *
- * Copyright (c) 2019-2019 微同科技
- */
-package ${package}.service.impl;
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.platform.utils.QueryPlus;
-import ${package}.dao.${className}Dao;
-import ${package}.entity.${className}Entity;
-import ${package}.service.${className}Service;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-/**
- * ${comments}Service实现类
- *
- * @author ${author}
- * @date ${datetime}
- */
-@Service("${classname}Service")
-public class ${className}ServiceImpl extends ServiceImpl<${className}Dao, ${className}Entity> implements ${className}Service {
-
-    @Override
-    public List<${className}Entity> queryAll(Map<String, Object> params) {
-        return baseMapper.queryAll(params);
-    }
-
-    @Override
-    public Page queryPage(Map<String, Object> params) {
-        //排序
-        params.put("sidx", "T.${pk.columnName}");
-        params.put("asc", false);
-        Page<${className}Entity> page = new QueryPlus<${className}Entity>(params).getPage();
-        return page.setRecords(baseMapper.select${className}Page(page, params));
-    }
-
-    @Override
-    public boolean add(${className}Entity ${classname}) {
-        return this.save(${classname});
-    }
-
-    @Override
-    public boolean update(${className}Entity ${classname}) {
-        return this.updateById(${classname});
-    }
-
-    @Override
-    public boolean delete(${pk.attrType} ${pk.attrname}) {
-        return this.removeById(${pk.attrname});
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public boolean deleteBatch(${pk.attrType}[] ${pk.attrname}s) {
-        return this.removeByIds(Arrays.asList(${pk.attrname}s));
-    }
-}

+ 0 - 60
platform-gen/src/main/resources/template/list.html.vm

@@ -1,60 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <title>${comments}</title>
-#set($header='#parse("sys/header.html")')
-#set($save='#if($shiro.hasPermission("'+${pathName}+':save"))')
-#set($update='#if($shiro.hasPermission("'+${pathName}+':update"))')
-#set($delete='#if($shiro.hasPermission("'+${pathName}+':delete"))')
-#set($end='#end')
-    $header
-</head>
-<body>
-<div id="rrapp" v-cloak>
-	<div v-show="showList">
-        <Row :gutter="16">
-            <div class="search-group">
-                <i-col span="4">
-                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
-                </i-col>
-                <i-button @click="query">查询</i-button>
-                <i-button @click="reloadSearch">重置</i-button>
-            </div>
-            <div class="buttons-group">
-                $save
-                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
-                $end
-                $update
-                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
-                $end
-                $delete
-                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
-                $end
-            </div>
-        </Row>
-	    <table id="jqGrid"></table>
-	    <div id="jqGridPager"></div>
-    </div>
-
-    <Card v-show="!showList">
-        <p slot="title">{{title}}</p>
-		<i-form ref="formValidate" :model="${classname}" :rules="ruleValidate" :label-width="80">
-#foreach($column in $columns)
-#if($column.columnName != $pk.columnName)
-            <Form-item label="${column.comments}" prop="${column.attrname}">
-                <i-input v-model="${classname}.${column.attrname}" placeholder="${column.comments}"/>
-            </Form-item>
-#end
-#end
-            <Form-item>
-                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
-                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
-                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
-            </Form-item>
-        </i-form>
-	</Card>
-</div>
-
-<script src="${rc.contextPath}/js/shop/${pathName}.js?_${date.systemTime}"></script>
-</body>
-</html>

+ 0 - 116
platform-gen/src/main/resources/template/list.js.vm

@@ -1,116 +0,0 @@
-$(function () {
-    $("#jqGrid").Grid({
-        url: '../${pathName}/list',
-        colModel: [
-#foreach($column in $columns)
-#if($column.columnName == $pk.columnName)
-			{label: '${column.attrname}', name: '${column.attrname}', index: '${column.columnName}', key: true, hidden: true},
-#else
-			{label: '${column.comments}', name: '${column.attrname}', index: '${column.columnName}', width: 80}#if($velocityCount != $columns.size()),
-#end#end#end
-]
-    });
-});
-
-let vm = new Vue({
-	el: '#rrapp',
-	data: {
-        showList: true,
-        title: null,
-		${classname}: {},
-		ruleValidate: {
-			name: [
-				{required: true, message: '名称不能为空', trigger: 'blur'}
-			]
-		},
-		q: {
-		    name: ''
-		}
-	},
-	methods: {
-		query: function () {
-			vm.reload();
-		},
-		add: function () {
-			vm.showList = false;
-			vm.title = "新增";
-			vm.${classname} = {};
-		},
-		update: function (event) {
-            let $pk.attrname = getSelectedRow("#jqGrid");
-			if ($pk.attrname == null) {
-				return;
-			}
-			vm.showList = false;
-            vm.title = "修改";
-
-            vm.getInfo(${pk.attrname})
-		},
-		saveOrUpdate: function (event) {
-            let url = vm.${classname}.${pk.attrname} == null ? "../${pathName}/save" : "../${pathName}/update";
-            Ajax.request({
-			    url: url,
-                params: JSON.stringify(vm.${classname}),
-                type: "POST",
-			    contentType: "application/json",
-                successCallback: function (r) {
-                    alert('操作成功', function (index) {
-                        vm.reload();
-                    });
-                }
-			});
-		},
-		del: function (event) {
-            let ${pk.attrname}s = getSelectedRows("#jqGrid");
-			if (${pk.attrname}s == null){
-				return;
-			}
-
-			confirm('确定要删除选中的记录?', function () {
-                Ajax.request({
-				    url: "../${pathName}/delete",
-                    params: JSON.stringify(${pk.attrname}s),
-                    type: "POST",
-				    contentType: "application/json",
-                    successCallback: function () {
-                        alert('操作成功', function (index) {
-                            vm.reload();
-                        });
-					}
-				});
-			});
-		},
-		getInfo: function(${pk.attrname}){
-            Ajax.request({
-                url: "../${pathName}/info/"+${pk.attrname},
-                async: true,
-                successCallback: function (r) {
-                    vm.${classname} = r.${classname};
-                }
-            });
-		},
-		reload: function (event) {
-			vm.showList = true;
-            let page = $("#jqGrid").jqGrid('getGridParam', 'page');
-			$("#jqGrid").jqGrid('setGridParam', {
-                postData: {'name': vm.q.name},
-                page: page
-            }).trigger("reloadGrid");
-            vm.handleReset('formValidate');
-		},
-        reloadSearch: function() {
-            vm.q = {
-                name: ''
-            }
-            vm.reload();
-        },
-        handleSubmit: function (name) {
-            handleSubmitValidate(this, name, function () {
-                vm.saveOrUpdate()
-            });
-        },
-        handleReset: function (name) {
-            handleResetForm(this, name);
-        }
-	}
-});

+ 0 - 13
platform-gen/src/main/resources/template/menu.sql.vm

@@ -1,16 +0,0 @@
-INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
-    VALUES ('1', '${comments}', '${pre}/${pathName}.html', NULL, '1', 'fa fa-file-code-o', '6');
-
-set @parentId = @@identity;
-
-INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
-    SELECT @parentId, '查看', null, '${pathName}:list,${pathName}:info', '2', null, '6';
-INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
-    SELECT @parentId, '新增', null, '${pathName}:save', '2', null, '6';
-INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
-    SELECT @parentId, '修改', null, '${pathName}:update', '2', null, '6';
-INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
-    SELECT @parentId, '删除', null, '${pathName}:delete', '2', null, '6';

+ 0 - 26
platform-mp/pom.xml

@@ -1,26 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <groupId>com.platform</groupId>
-        <artifactId>platform</artifactId>
-        <version>1.0.0</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>platform-mp</artifactId>
-    <packaging>jar</packaging>
-    <description>微信公众号</description>
-
-    <dependencies>
-        <dependency>
-            <groupId>com.platform</groupId>
-            <artifactId>platform-common</artifactId>
-            <version>1.0.0</version>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>com.github.binarywang</groupId>
-            <artifactId>weixin-java-mp</artifactId>
-            <version>${weixin-java-mp.version}</version>
-        </dependency>
-    </dependencies>
-
-</project>

+ 0 - 14
platform-mp/src/main/java/com/platform/builder/AbstractBuilder.java

@@ -1,14 +0,0 @@
-package com.platform.builder;
-
-import com.platform.service.WeixinService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public abstract class AbstractBuilder {
-    protected final Logger logger = LoggerFactory.getLogger(getClass());
-
-    public abstract WxMpXmlOutMessage build(String content,
-                                            WxMpXmlMessage wxMessage, WeixinService service);
-}

+ 0 - 21
platform-mp/src/main/java/com/platform/builder/ImageBuilder.java

@@ -1,21 +0,0 @@
-package com.platform.builder;
-
-import com.platform.service.WeixinService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutImageMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-
-public class ImageBuilder extends AbstractBuilder {
-
-    @Override
-    public WxMpXmlOutMessage build(String content, WxMpXmlMessage wxMessage,
-                                   WeixinService service) {
-
-        WxMpXmlOutImageMessage m = WxMpXmlOutMessage.IMAGE().mediaId(content)
-                .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser())
-                .build();
-
-        return m;
-    }
-
-}

+ 0 - 19
platform-mp/src/main/java/com/platform/builder/TextBuilder.java

@@ -1,19 +0,0 @@
-package com.platform.builder;
-
-import com.platform.service.WeixinService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutTextMessage;
-
-public class TextBuilder extends AbstractBuilder {
-
-    @Override
-    public WxMpXmlOutMessage build(String content, WxMpXmlMessage wxMessage,
-                                   WeixinService service) {
-        WxMpXmlOutTextMessage m = WxMpXmlOutMessage.TEXT().content(content)
-                .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser())
-                .build();
-        return m;
-    }
-
-}

+ 0 - 148
platform-mp/src/main/java/com/platform/controller/MpMenuController.java

@@ -1,148 +0,0 @@
-package com.platform.controller;
-
-import com.platform.service.MpMenuService;
-import com.platform.utils.R;
-import me.chanjar.weixin.common.api.WxConsts;
-import me.chanjar.weixin.common.bean.menu.WxMenu;
-import me.chanjar.weixin.common.bean.menu.WxMenuButton;
-import me.chanjar.weixin.mp.bean.menu.WxMpGetSelfMenuInfoResult;
-import me.chanjar.weixin.mp.bean.menu.WxMpMenu;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.*;
-
-/**
- * 公众号菜单Controller
- *
- * @author liepngjun
- * @email 939961241@qq.com
- * @date 2018-10-30 13:01:47
- */
-@Controller
-@RequestMapping("/mp/menu")
-public class MpMenuController {
-    @Autowired
-    private MpMenuService mpMenuService;
-
-    @GetMapping("/create")
-    @ResponseBody
-    public String menuCreate(@RequestBody WxMenu wxMenu) throws Exception {
-        return mpMenuService.menuCreate(wxMenu);
-    }
-
-    @GetMapping("/menuCreateSample")
-    @ResponseBody
-    public String menuCreateSample() throws Exception {
-        return mpMenuService.menuCreate(initMenu());
-    }
-
-    /**
-     * 初始化菜单,
-     * TODO 后面可以考虑把菜单存入数据库来维护
-     *
-     * @return
-     */
-    public WxMenu initMenu() {
-        WxMenuButton mainBtn1 = new WxMenuButton();
-        mainBtn1.setName("官网");
-        mainBtn1.setType(WxConsts.MenuButtonType.VIEW);
-        mainBtn1.setUrl("http://fly2you.cn");
-
-        WxMenuButton btn21 = new WxMenuButton();
-        btn21.setName("便利主义超市");
-        btn21.setType(WxConsts.MenuButtonType.MINIPROGRAM);
-        btn21.setUrl("http://mp.weixin.qq.com");
-        btn21.setAppId("wx2a601dffd92609df");
-        btn21.setPagePath("/pages/index/index");
-
-        WxMenuButton btn22 = new WxMenuButton();
-        btn22.setName("海数据在线");
-        btn22.setType(WxConsts.MenuButtonType.MINIPROGRAM);
-        btn22.setUrl("http://mp.weixin.qq.com");
-        btn22.setAppId("wx69de7e7034266a70");
-        btn22.setPagePath("/pages/index/index");
-
-        WxMenuButton mainBtn2 = new WxMenuButton();
-        mainBtn2.setName("客户案例");
-        mainBtn2.getSubButtons().add(btn21);
-        mainBtn2.getSubButtons().add(btn22);
-
-        WxMenuButton btn31 = new WxMenuButton();
-        btn31.setName("历史消息");
-        btn31.setType(WxConsts.MenuButtonType.VIEW);
-        btn31.setUrl("https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzIxMTc5MzUyMQ==#wechat_redirect");
-
-        WxMenuButton btn32 = new WxMenuButton();
-        btn32.setName("商务合作");
-        btn32.setType(WxConsts.MenuButtonType.VIEW);
-        btn32.setUrl("https://mp.weixin.qq.com/s/srJyUVzwK6wGwGFCQFch1A");
-
-        WxMenuButton btn33 = new WxMenuButton();
-        btn33.setName("更多资讯");
-        btn33.setType(WxConsts.MenuButtonType.VIEW);
-        btn33.setUrl("http://mp.weixin.qq.com/mp/homepage?__biz=MzIxMTc5MzUyMQ==&hid=1&sn=f8765358ef19c3423224069d333be5bf&scene=18#wechat_redirect");
-
-        WxMenuButton btn34 = new WxMenuButton();
-        btn34.setName("曾获荣誉");
-        btn34.setType(WxConsts.MenuButtonType.VIEW);
-        btn34.setUrl("https://mp.weixin.qq.com/s/5mbU7Kp2TavasrZhfOUc7w");
-
-        WxMenuButton mainBtn3 = new WxMenuButton();
-        mainBtn3.setName("更多");
-        mainBtn3.getSubButtons().add(btn31);
-        mainBtn3.getSubButtons().add(btn32);
-        mainBtn3.getSubButtons().add(btn33);
-        mainBtn3.getSubButtons().add(btn34);
-
-        WxMenu menu = new WxMenu();
-        menu.getButtons().add(mainBtn1);
-        menu.getButtons().add(mainBtn2);
-        menu.getButtons().add(mainBtn3);
-        return menu;
-    }
-
-    @GetMapping("/create/{json}")
-    @ResponseBody
-    public String menuCreate(@PathVariable String json) throws Exception {
-        return mpMenuService.menuCreate(json);
-    }
-
-    @GetMapping("/delete")
-    public void menuDelete() throws Exception {
-        mpMenuService.menuDelete();
-    }
-
-    @GetMapping("/delete/{menuId}")
-    public void menuDelete(@PathVariable String menuId) throws Exception {
-        mpMenuService.menuDelete(menuId);
-    }
-
-    @GetMapping("/get")
-    @ResponseBody
-    public WxMpMenu menuGet() throws Exception {
-        return mpMenuService.menuGet();
-    }
-
-    @GetMapping("/menuTryMatch/{userid}")
-    @ResponseBody
-    public WxMenu menuTryMatch(@PathVariable String userid) throws Exception {
-        return mpMenuService.menuTryMatch(userid);
-    }
-
-    @GetMapping("/getSelfMenuInfo")
-    @ResponseBody
-    public WxMpGetSelfMenuInfoResult getSelfMenuInfo() throws Exception {
-        return mpMenuService.getSelfMenuInfo();
-    }
-
-    /**
-     * 获取本地设置的菜单
-     *
-     * @return
-     */
-    @RequestMapping("/getMenu")
-    @ResponseBody
-    public R getMenu() {
-        return R.ok().put("menu", initMenu());
-    }
-}

+ 0 - 46
platform-mp/src/main/java/com/platform/entity/WxMenuKey.java

@@ -1,46 +0,0 @@
-package com.platform.entity;
-
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-/**
- * 菜单的dto对象
- *
- * @author liepngjun
- * @email 939961241@qq.com
- * @date 2018-12-16 13:01:47
- */
-public class WxMenuKey {
-    private String type;
-    private String content;
-
-    @Override
-    public String toString() {
-        return ToStringBuilder.reflectionToString(this);
-    }
-
-    public WxMenuKey() {
-
-    }
-
-    public WxMenuKey(String type, String content) {
-        this.type = type;
-        this.content = content;
-    }
-
-    public String getType() {
-        return this.type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public String getContent() {
-        return this.content;
-    }
-
-    public void setContent(String content) {
-        this.content = content;
-    }
-
-}

+ 0 - 11
platform-mp/src/main/java/com/platform/handler/AbstractHandler.java

@@ -1,11 +0,0 @@
-package com.platform.handler;
-
-import com.google.gson.Gson;
-import me.chanjar.weixin.mp.api.WxMpMessageHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public abstract class AbstractHandler implements WxMpMessageHandler {
-    protected Logger logger = LoggerFactory.getLogger(getClass());
-    protected final Gson gson = new Gson();
-}

+ 0 - 22
platform-mp/src/main/java/com/platform/handler/KfSessionHandler.java

@@ -1,22 +0,0 @@
-package com.platform.handler;
-
-import me.chanjar.weixin.common.session.WxSessionManager;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import org.springframework.stereotype.Component;
-
-import java.util.Map;
-
-@Component
-public class KfSessionHandler extends AbstractHandler {
-
-    @Override
-    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
-                                    Map<String, Object> context, WxMpService wxMpService,
-                                    WxSessionManager sessionManager) {
-        //TODO 对会话做处理
-        return null;
-    }
-
-}

+ 0 - 42
platform-mp/src/main/java/com/platform/handler/LocationHandler.java

@@ -1,42 +0,0 @@
-package com.platform.handler;
-
-import com.platform.builder.TextBuilder;
-import me.chanjar.weixin.common.api.WxConsts;
-import me.chanjar.weixin.common.session.WxSessionManager;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import org.springframework.stereotype.Component;
-
-import java.util.Map;
-
-@Component
-public class LocationHandler extends AbstractHandler {
-
-    @Override
-    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
-                                    Map<String, Object> context, WxMpService wxMpService,
-                                    WxSessionManager sessionManager) {
-        if (wxMessage.getMsgType().equals(WxConsts.XmlMsgType.LOCATION)) {
-            //TODO 接收处理用户发送的地理位置消息
-            try {
-                String content = "感谢反馈,您的的地理位置已收到!";
-                return new TextBuilder().build(content, wxMessage, null);
-            } catch (Exception e) {
-                this.logger.error("位置消息接收处理失败", e);
-                return null;
-            }
-        }
-
-        //上报地理位置事件
-        this.logger.info("\n上报地理位置 。。。 ");
-        this.logger.info("\n纬度 : " + wxMessage.getLatitude());
-        this.logger.info("\n经度 : " + wxMessage.getLongitude());
-        this.logger.info("\n精度 : " + String.valueOf(wxMessage.getPrecision()));
-
-        //TODO  可以将用户地理位置信息保存到本地数据库,以便以后使用
-
-        return null;
-    }
-
-}

+ 0 - 37
platform-mp/src/main/java/com/platform/handler/LogHandler.java

@@ -1,37 +0,0 @@
-package com.platform.handler;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import me.chanjar.weixin.common.session.WxSessionManager;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import org.springframework.stereotype.Component;
-
-import java.util.Map;
-
-@Component
-public class LogHandler extends AbstractHandler {
-    private static final ObjectMapper JSON = new ObjectMapper();
-
-    static {
-        JSON.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        JSON.configure(SerializationFeature.INDENT_OUTPUT, Boolean.TRUE);
-    }
-
-    @Override
-    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
-                                    Map<String, Object> context, WxMpService wxMpService,
-                                    WxSessionManager sessionManager) {
-        try {
-            this.logger.info("\n接收到请求消息,内容:{}", JSON.writeValueAsString(wxMessage));
-        } catch (JsonProcessingException e) {
-            e.printStackTrace();
-        }
-
-        return null;
-    }
-
-}

+ 0 - 65
platform-mp/src/main/java/com/platform/handler/MenuHandler.java

@@ -1,65 +0,0 @@
-package com.platform.handler;
-
-import com.alibaba.fastjson.JSON;
-import com.platform.builder.AbstractBuilder;
-import com.platform.builder.ImageBuilder;
-import com.platform.builder.TextBuilder;
-import com.platform.entity.WxMenuKey;
-import com.platform.service.WeixinService;
-import me.chanjar.weixin.common.api.WxConsts;
-import me.chanjar.weixin.common.session.WxSessionManager;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import org.springframework.stereotype.Component;
-
-import java.util.Map;
-
-@Component
-public class MenuHandler extends AbstractHandler {
-
-    @Override
-    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
-                                    Map<String, Object> context, WxMpService wxMpService,
-                                    WxSessionManager sessionManager) {
-        WeixinService weixinService = (WeixinService) wxMpService;
-
-        String key = wxMessage.getEventKey();
-        WxMenuKey menuKey;
-        try {
-            menuKey = JSON.parseObject(key, WxMenuKey.class);
-        } catch (Exception e) {
-            return WxMpXmlOutMessage.TEXT().content(key)
-                    .fromUser(wxMessage.getToUser())
-                    .toUser(wxMessage.getFromUser()).build();
-        }
-
-        AbstractBuilder builder = null;
-        switch (menuKey.getType()) {
-            case WxConsts.XmlMsgType.TEXT:
-                builder = new TextBuilder();
-                break;
-            case WxConsts.XmlMsgType.IMAGE:
-                builder = new ImageBuilder();
-                break;
-            case WxConsts.XmlMsgType.VOICE:
-                break;
-            case WxConsts.XmlMsgType.VIDEO:
-                break;
-            case WxConsts.XmlMsgType.NEWS:
-                break;
-            default:
-                break;
-        }
-
-        if (builder != null) {
-            try {
-                return builder.build(menuKey.getContent(), wxMessage, weixinService);
-            } catch (Exception e) {
-                this.logger.error(e.getMessage(), e);
-            }
-        }
-
-        return null;
-    }
-}

+ 0 - 121
platform-mp/src/main/java/com/platform/handler/MsgHandler.java

@@ -1,121 +0,0 @@
-package com.platform.handler;
-
-import com.platform.builder.TextBuilder;
-import com.platform.service.WeixinService;
-import me.chanjar.weixin.common.api.WxConsts;
-import me.chanjar.weixin.common.session.WxSessionManager;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutNewsMessage;
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-import java.util.Map;
-
-@Component
-public class MsgHandler extends AbstractHandler {
-    private static final Logger LOGGER = LoggerFactory.getLogger(MsgHandler.class);
-
-    @Override
-    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
-                                    Map<String, Object> context, WxMpService wxMpService,
-                                    WxSessionManager sessionManager) {
-
-        WeixinService weixinService = (WeixinService) wxMpService;
-
-        if (!wxMessage.getMsgType().equals(WxConsts.XmlMsgType.EVENT)) {
-            //TODO 可以选择将消息保存到本地
-        }
-
-        //当用户输入关键词如“你好”,“客服”等,并且有客服在线时,把消息转发给在线客服
-        if (StringUtils.startsWithAny(wxMessage.getContent(), "你好", "客服")
-                && weixinService.hasKefuOnline()) {
-            return WxMpXmlOutMessage
-                    .TRANSFER_CUSTOMER_SERVICE().fromUser(wxMessage.getToUser())
-                    .toUser(wxMessage.getFromUser()).build();
-        }
-
-        switch (wxMessage.getContent()) {
-            case "签到表单":
-                return sendInSignMessage(wxMessage, context, wxMpService, sessionManager);
-            case "发送弹幕":
-                return handleDanmu(wxMessage, context, wxMpService, sessionManager);
-            case "年会节目单":
-                return handleContent(wxMessage, context, wxMpService, sessionManager);
-            case "投票":
-                return handleVote(wxMessage, context, wxMpService, sessionManager);
-            default:
-                String content = "回复信息内容";
-                return new TextBuilder().build(content, wxMessage, weixinService);
-        }
-    }
-
-    private WxMpXmlOutNewsMessage sendInSignMessage(WxMpXmlMessage wxMessage,
-                                                    Map<String, Object> context, WxMpService wxMpService,
-                                                    WxSessionManager sessionManager) {
-
-        WxMpXmlOutNewsMessage.Item item = new WxMpXmlOutNewsMessage.Item();
-        item.setDescription("签到表单");
-        item.setPicUrl("https://mmbiz.qlogo.cn/mmbiz_jpg/rFTQWsGze4G89XqNehSdSBGt1ic6ricfgBvaxnXGhsicia3xhIaKJB0hWMIqDXqLXC3OmBKnwfMiaXaBbrECialjOJiaQ/0?wx_fmt=jpeg");
-        item.setTitle("签到");
-        item.setUrl("https://fly2you.cn");
-
-        WxMpXmlOutNewsMessage m = WxMpXmlOutMessage.NEWS()
-                .fromUser(wxMessage.getToUser())
-                .toUser(wxMessage.getFromUser())
-                .addArticle(item)
-                .build();
-        return m;
-    }
-
-    private WxMpXmlOutMessage handleDanmu(WxMpXmlMessage wxMessage, Map<String, Object> context,
-                                          WxMpService wxMpService, WxSessionManager sessionManager) {
-        WxMpXmlOutNewsMessage.Item item = new WxMpXmlOutNewsMessage.Item();
-        item.setDescription("发送弹幕");
-        item.setPicUrl("https://mmbiz.qlogo.cn/mmbiz_jpg/rFTQWsGze4G89XqNehSdSBGt1ic6ricfgBfr8ThJnpIIibwpPhGjGrKpraiaNULFLfv238cC3sIxgCYZza6TYLKicBg/0?wx_fmt=jpeg");
-        item.setTitle("评论上墙");
-        item.setUrl("https://fly2you.cn");
-
-        WxMpXmlOutNewsMessage m = WxMpXmlOutMessage.NEWS()
-                .fromUser(wxMessage.getToUser())
-                .toUser(wxMessage.getFromUser())
-                .addArticle(item)
-                .build();
-        return m;
-    }
-
-    private WxMpXmlOutMessage handleContent(WxMpXmlMessage wxMessage, Map<String, Object> context,
-                                            WxMpService wxMpService, WxSessionManager sessionManager) {
-        WxMpXmlOutNewsMessage.Item item = new WxMpXmlOutNewsMessage.Item();
-        item.setDescription("年会节目单");
-        item.setPicUrl("https://mmbiz.qlogo.cn/mmbiz/bVoOkrvEGHqgetjIc7VcFoCWgLCNaTOnZaXvR9J04EgxMfbm3WM9OreMfTcMcKN8UFkWtDwUbiatU7Qtxsutglg/0?wx_fmt=png");
-        item.setTitle("节目单");
-        item.setUrl("https://fly2you.cn");
-
-        WxMpXmlOutNewsMessage m = WxMpXmlOutMessage.NEWS()
-                .fromUser(wxMessage.getToUser())
-                .toUser(wxMessage.getFromUser())
-                .addArticle(item)
-                .build();
-        return m;
-    }
-
-    private WxMpXmlOutMessage handleVote(WxMpXmlMessage wxMessage, Map<String, Object> context,
-                                         WxMpService wxMpService, WxSessionManager sessionManager) {
-        WxMpXmlOutNewsMessage.Item item = new WxMpXmlOutNewsMessage.Item();
-        item.setDescription("来投票吧");
-        item.setPicUrl("https://mmbiz.qlogo.cn/mmbiz_jpg/rFTQWsGze4EdewBW92AAD6Ap8ydAQrgBnndVMdAIXB4CmGiaGiassibiaKhWID6icmdMg3kvWSejFd5omyUdjcvb0GA/0?wx_fmt=jpeg");
-        item.setTitle("投票");
-        item.setUrl("https://fly2you.cn");
-
-        WxMpXmlOutNewsMessage m = WxMpXmlOutMessage.NEWS()
-                .fromUser(wxMessage.getToUser())
-                .toUser(wxMessage.getFromUser())
-                .addArticle(item)
-                .build();
-        return m;
-    }
-}

+ 0 - 21
platform-mp/src/main/java/com/platform/handler/NullHandler.java

@@ -1,21 +0,0 @@
-package com.platform.handler;
-
-import me.chanjar.weixin.common.session.WxSessionManager;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import org.springframework.stereotype.Component;
-
-import java.util.Map;
-
-@Component
-public class NullHandler extends AbstractHandler {
-
-    @Override
-    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
-                                    Map<String, Object> context, WxMpService wxMpService,
-                                    WxSessionManager sessionManager) {
-        return null;
-    }
-
-}

+ 0 - 22
platform-mp/src/main/java/com/platform/handler/StoreCheckNotifyHandler.java

@@ -1,22 +0,0 @@
-package com.platform.handler;
-
-import me.chanjar.weixin.common.session.WxSessionManager;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import org.springframework.stereotype.Component;
-
-import java.util.Map;
-
-@Component
-public class StoreCheckNotifyHandler extends AbstractHandler {
-
-    @Override
-    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
-                                    Map<String, Object> context, WxMpService wxMpService,
-                                    WxSessionManager sessionManager) {
-        // TODO 处理门店审核事件
-        return null;
-    }
-
-}

+ 0 - 61
platform-mp/src/main/java/com/platform/handler/SubscribeHandler.java

@@ -1,61 +0,0 @@
-package com.platform.handler;
-
-import com.platform.builder.TextBuilder;
-import com.platform.service.WeixinService;
-import me.chanjar.weixin.common.error.WxErrorException;
-import me.chanjar.weixin.common.session.WxSessionManager;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import me.chanjar.weixin.mp.bean.result.WxMpUser;
-import org.springframework.stereotype.Component;
-
-import java.util.Map;
-
-@Component
-public class SubscribeHandler extends AbstractHandler {
-
-    @Override
-    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, Map<String, Object> context, WxMpService wxMpService,
-                                    WxSessionManager sessionManager) throws WxErrorException {
-
-        this.logger.info("新关注用户 OPENID: " + wxMessage.getFromUser());
-
-        WeixinService weixinService = (WeixinService) wxMpService;
-
-        // 获取微信用户基本信息
-        WxMpUser userWxInfo = weixinService.getUserService().userInfo(wxMessage.getFromUser(), null);
-
-        if (userWxInfo != null) {
-            // TODO 可以添加关注用户到本地
-        }
-
-        WxMpXmlOutMessage responseResult = null;
-        try {
-            responseResult = handleSpecial(wxMessage);
-        } catch (Exception e) {
-            this.logger.error(e.getMessage(), e);
-        }
-
-        if (responseResult != null) {
-            return responseResult;
-        }
-
-        try {
-            return new TextBuilder().build("感谢关注", wxMessage, weixinService);
-        } catch (Exception e) {
-            this.logger.error(e.getMessage(), e);
-        }
-
-        return null;
-    }
-
-    /**
-     * 处理特殊请求,比如如果是扫码进来的,可以做相应处理
-     */
-    protected WxMpXmlOutMessage handleSpecial(WxMpXmlMessage wxMessage) throws Exception {
-        //TODO
-        return null;
-    }
-
-}

+ 0 - 24
platform-mp/src/main/java/com/platform/handler/UnsubscribeHandler.java

@@ -1,24 +0,0 @@
-package com.platform.handler;
-
-import me.chanjar.weixin.common.session.WxSessionManager;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import org.springframework.stereotype.Component;
-
-import java.util.Map;
-
-@Component
-public class UnsubscribeHandler extends AbstractHandler {
-
-    @Override
-    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
-                                    Map<String, Object> context, WxMpService wxMpService,
-                                    WxSessionManager sessionManager) {
-        String openId = wxMessage.getFromUser();
-        this.logger.info("取消关注用户 OPENID: " + openId);
-        // TODO 可以更新本地数据库为取消关注状态
-        return null;
-    }
-
-}

+ 0 - 13
platform-mp/src/main/java/com/platform/service/MpMenuService.java

@@ -1,13 +0,0 @@
-package com.platform.service;
-
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.api.impl.WxMpMenuServiceImpl;
-import org.springframework.stereotype.Service;
-
-@Service("mpMenuService")
-public class MpMenuService extends WxMpMenuServiceImpl {
-
-    public MpMenuService(WxMpService wxMpService) {
-        super(wxMpService);
-    }
-}

+ 0 - 177
platform-mp/src/main/java/com/platform/service/WeixinService.java

@@ -1,177 +0,0 @@
-package com.platform.service;
-
-import com.platform.handler.*;
-import com.platform.utils.ResourceUtil;
-import me.chanjar.weixin.common.api.WxConsts;
-import me.chanjar.weixin.common.api.WxConsts.EventType;
-import me.chanjar.weixin.common.api.WxConsts.MenuButtonType;
-import me.chanjar.weixin.common.api.WxConsts.XmlMsgType;
-import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
-import me.chanjar.weixin.mp.api.WxMpMessageRouter;
-import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
-import me.chanjar.weixin.mp.bean.kefu.result.WxMpKfOnlineList;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import me.chanjar.weixin.mp.constant.WxMpEventConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.PostConstruct;
-
-@Service("weixinService")
-public class WeixinService extends WxMpServiceImpl {
-    private final Logger logger = LoggerFactory.getLogger(this.getClass());
-
-    @Autowired
-    protected LogHandler logHandler;
-
-    @Autowired
-    protected NullHandler nullHandler;
-
-    @Autowired
-    protected KfSessionHandler kfSessionHandler;
-
-    @Autowired
-    protected StoreCheckNotifyHandler storeCheckNotifyHandler;
-
-    @Autowired
-    private LocationHandler locationHandler;
-
-    @Autowired
-    private MenuHandler menuHandler;
-
-    @Autowired
-    private MsgHandler msgHandler;
-
-    @Autowired
-    private UnsubscribeHandler unsubscribeHandler;
-
-    @Autowired
-    private SubscribeHandler subscribeHandler;
-
-    private WxMpMessageRouter router;
-
-    @PostConstruct
-    public void init() {
-        final WxMpInMemoryConfigStorage config = new WxMpInMemoryConfigStorage();
-        // 设置微信公众号的appid
-        config.setAppId(ResourceUtil.getConfigByName("mp.appId"));
-        // 设置微信公众号的app corpSecret
-        config.setSecret(ResourceUtil.getConfigByName("mp.secret"));
-        // 设置微信公众号的token
-        config.setToken(ResourceUtil.getConfigByName("mp.token"));
-        // 设置消息加解密密钥
-        config.setAesKey(ResourceUtil.getConfigByName("mp.aesKey"));
-        super.setWxMpConfigStorage(config);
-
-        this.refreshRouter();
-    }
-
-    private void refreshRouter() {
-        final WxMpMessageRouter newRouter = new WxMpMessageRouter(this);
-
-        // 记录所有事件的日志
-        newRouter.rule().handler(this.logHandler).next();
-
-        // 接收客服会话管理事件
-        newRouter.rule().async(false).msgType(XmlMsgType.EVENT)
-                .event(WxMpEventConstants.CustomerService.KF_CREATE_SESSION)
-                .handler(this.kfSessionHandler).end();
-        newRouter.rule().async(false).msgType(XmlMsgType.EVENT)
-                .event(WxMpEventConstants.CustomerService.KF_CLOSE_SESSION)
-                .handler(this.kfSessionHandler).end();
-        newRouter.rule().async(false).msgType(XmlMsgType.EVENT)
-                .event(WxMpEventConstants.CustomerService.KF_SWITCH_SESSION)
-                .handler(this.kfSessionHandler).end();
-
-        // 门店审核事件
-        newRouter.rule().async(false).msgType(XmlMsgType.EVENT)
-                .event(WxMpEventConstants.POI_CHECK_NOTIFY)
-                .handler(this.storeCheckNotifyHandler)
-                .end();
-
-        // 自定义菜单事件
-        newRouter.rule().async(false).msgType(XmlMsgType.EVENT)
-                .event(WxConsts.MenuButtonType.CLICK).handler(this.getMenuHandler()).end();
-
-        // 点击菜单连接事件
-        newRouter.rule().async(false).msgType(XmlMsgType.EVENT)
-                .event(MenuButtonType.VIEW).handler(this.nullHandler).end();
-
-        // 关注事件
-        newRouter.rule().async(false).msgType(XmlMsgType.EVENT)
-                .event(EventType.SUBSCRIBE).handler(this.getSubscribeHandler())
-                .end();
-
-        // 取消关注事件
-        newRouter.rule().async(false).msgType(XmlMsgType.EVENT)
-                .event(EventType.UNSUBSCRIBE).handler(this.getUnsubscribeHandler())
-                .end();
-
-        // 上报地理位置事件
-        newRouter.rule().async(false).msgType(XmlMsgType.EVENT)
-                .event(EventType.LOCATION).handler(this.getLocationHandler()).end();
-
-        // 接收地理位置消息
-        newRouter.rule().async(false).msgType(XmlMsgType.LOCATION)
-                .handler(this.getLocationHandler()).end();
-
-        // 扫码事件
-        newRouter.rule().async(false).msgType(XmlMsgType.EVENT)
-                .event(EventType.SCAN).handler(this.getScanHandler()).end();
-
-        // 默认
-        newRouter.rule().async(false).handler(this.getMsgHandler()).end();
-
-        this.router = newRouter;
-    }
-
-
-    public WxMpXmlOutMessage route(WxMpXmlMessage message) {
-        try {
-            return this.router.route(message);
-        } catch (Exception e) {
-            this.logger.error(e.getMessage(), e);
-        }
-
-        return null;
-    }
-
-    public boolean hasKefuOnline() {
-        try {
-            WxMpKfOnlineList kfOnlineList = this.getKefuService().kfOnlineList();
-            return kfOnlineList != null && kfOnlineList.getKfOnlineList().size() > 0;
-        } catch (Exception e) {
-            this.logger.error("获取客服在线状态异常: " + e.getMessage(), e);
-        }
-
-        return false;
-    }
-
-    protected MenuHandler getMenuHandler() {
-        return this.menuHandler;
-    }
-
-    protected SubscribeHandler getSubscribeHandler() {
-        return this.subscribeHandler;
-    }
-
-    protected UnsubscribeHandler getUnsubscribeHandler() {
-        return this.unsubscribeHandler;
-    }
-
-    protected AbstractHandler getLocationHandler() {
-        return this.locationHandler;
-    }
-
-    protected MsgHandler getMsgHandler() {
-        return this.msgHandler;
-    }
-
-    protected AbstractHandler getScanHandler() {
-        return null;
-    }
-
-}

+ 0 - 34
platform-schedule/pom.xml

@@ -1,34 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <groupId>com.platform</groupId>
-        <artifactId>platform</artifactId>
-        <version>1.0.0</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>platform-schedule</artifactId>
-    <packaging>jar</packaging>
-    <description>定时任务模块</description>
-
-    <properties>
-        <quartz-version>2.2.3</quartz-version>
-    </properties>
-
-    <dependencies>
-        <dependency>
-            <groupId>com.platform</groupId>
-            <artifactId>platform-common</artifactId>
-            <version>1.0.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.quartz-scheduler</groupId>
-            <artifactId>quartz</artifactId>
-            <version>${quartz-version}</version>
-            <exclusions>
-                <exclusion>
-                    <artifactId>c3p0</artifactId>
-                    <groupId>c3p0</groupId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-    </dependencies>
-</project>

+ 0 - 149
platform-schedule/src/main/java/com/platform/controller/ScheduleJobController.java

@@ -1,149 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.SysLog;
-import com.platform.entity.ScheduleJobEntity;
-import com.platform.service.ScheduleJobService;
-import com.platform.utils.PageUtilsPlus;
-import com.platform.utils.R;
-import com.platform.validator.ValidatorUtils;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.Map;
-
-/**
- * 定时任务
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年11月28日 下午2:16:40
- */
-@RestController
-@RequestMapping("/sys/schedule")
-public class ScheduleJobController {
-    @Autowired
-    private ScheduleJobService scheduleJobService;
-
-    /**
-     * 分页查询定时任务
-     *
-     * @param params 查询参数
-     * @return R
-     */
-    @GetMapping("/list")
-    @RequiresPermissions("sys:schedule:list")
-    public R list(@RequestParam Map<String, Object> params) {
-        PageUtilsPlus pageUtil = scheduleJobService.queryPage(params);
-        return R.ok().put("page", pageUtil);
-    }
-
-    /**
-     * 根据主键查询详情
-     *
-     * @param jobId 主键
-     * @return R
-     */
-    @GetMapping("/info/{jobId}")
-    @RequiresPermissions("sys:schedule:info")
-    public R info(@PathVariable("jobId") Long jobId) {
-        ScheduleJobEntity schedule = scheduleJobService.getById(jobId);
-
-        return R.ok().put("schedule", schedule);
-    }
-
-    /**
-     * 新增定时任务
-     *
-     * @param scheduleJob scheduleJob
-     * @return R
-     */
-    @SysLog("新增定时任务")
-    @PostMapping("/save")
-    @RequiresPermissions("sys:schedule:save")
-    public R save(@RequestBody ScheduleJobEntity scheduleJob) {
-        ValidatorUtils.validateEntity(scheduleJob);
-
-        scheduleJobService.add(scheduleJob);
-
-        return R.ok();
-    }
-
-    /**
-     * 修改定时任务
-     *
-     * @param scheduleJob scheduleJob
-     * @return R
-     */
-    @SysLog("修改定时任务")
-    @PostMapping("/update")
-    @RequiresPermissions("sys:schedule:update")
-    public R update(@RequestBody ScheduleJobEntity scheduleJob) {
-        ValidatorUtils.validateEntity(scheduleJob);
-
-        scheduleJobService.update(scheduleJob);
-
-        return R.ok();
-    }
-
-    /**
-     * 删除定时任务
-     *
-     * @param jobIds jobIds
-     * @return R
-     */
-    @SysLog("删除定时任务")
-    @PostMapping("/delete")
-    @RequiresPermissions("sys:schedule:delete")
-    public R delete(@RequestBody Long[] jobIds) {
-        scheduleJobService.deleteBatch(jobIds);
-
-        return R.ok();
-    }
-
-    /**
-     * 立即执行任务
-     *
-     * @param jobIds jobIds
-     * @return R
-     */
-    @SysLog("立即执行任务")
-    @PostMapping("/run")
-    @RequiresPermissions("sys:schedule:run")
-    public R run(@RequestBody Long[] jobIds) {
-        scheduleJobService.run(jobIds);
-
-        return R.ok();
-    }
-
-    /**
-     * 暂停定时任务
-     *
-     * @param jobIds jobIds
-     * @return R
-     */
-    @SysLog("暂停定时任务")
-    @PostMapping("/pause")
-    @RequiresPermissions("sys:schedule:pause")
-    public R pause(@RequestBody Long[] jobIds) {
-        scheduleJobService.pause(jobIds);
-
-        return R.ok();
-    }
-
-    /**
-     * 恢复定时任务
-     *
-     * @param jobIds jobIds
-     * @return R
-     */
-    @SysLog("恢复定时任务")
-    @PostMapping("/resume")
-    @RequiresPermissions("sys:schedule:resume")
-    public R resume(@RequestBody Long[] jobIds) {
-        scheduleJobService.resume(jobIds);
-
-        return R.ok();
-    }
-
-}

+ 0 - 52
platform-schedule/src/main/java/com/platform/controller/ScheduleJobLogController.java

@@ -1,52 +0,0 @@
-package com.platform.controller;
-
-import com.platform.entity.ScheduleJobLogEntity;
-import com.platform.service.ScheduleJobLogService;
-import com.platform.utils.PageUtilsPlus;
-import com.platform.utils.R;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.Map;
-
-/**
- * 定时任务日志
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年12月1日 下午10:39:52
- */
-@RestController
-@RequestMapping("/sys/scheduleLog")
-public class ScheduleJobLogController {
-    @Autowired
-    private ScheduleJobLogService scheduleJobLogService;
-
-    /**
-     * 分页查询定时任务日志
-     *
-     * @param params 查询参数
-     * @return R
-     */
-    @GetMapping("/list")
-    @RequiresPermissions("sys:schedule:log")
-    public R list(@RequestParam Map<String, Object> params) {
-        PageUtilsPlus page = scheduleJobLogService.queryPage(params);
-
-        return R.ok().put("page", page);
-    }
-
-    /**
-     * 根据主键查询详情
-     *
-     * @param logId logId
-     * @return R
-     */
-    @GetMapping("/info/{logId}")
-    public R info(@PathVariable("logId") Long logId) {
-        ScheduleJobLogEntity log = scheduleJobLogService.getById(logId);
-
-        return R.ok().put("log", log);
-    }
-}

+ 0 - 38
platform-schedule/src/main/java/com/platform/dao/ScheduleJobDao.java

@@ -1,38 +0,0 @@
-package com.platform.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.platform.entity.ScheduleJobEntity;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 定时任务
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年12月1日 下午10:29:57
- */
-@Mapper
-public interface ScheduleJobDao extends BaseMapper<ScheduleJobEntity> {
-
-    /**
-     * 批量更新状态
-     *
-     * @param map map
-     * @return int
-     */
-    int updateBatch(Map<String, Object> map);
-
-    /**
-     * 自定义分页查询
-     *
-     * @param page   分页参数
-     * @param params 查询参数
-     * @return List
-     */
-    List<ScheduleJobEntity> selectScheduleJobPage(IPage page, @Param("params") Map<String, Object> params);
-}

+ 0 - 29
platform-schedule/src/main/java/com/platform/dao/ScheduleJobLogDao.java

@@ -1,29 +0,0 @@
-package com.platform.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.platform.entity.ScheduleJobLogEntity;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 定时任务日志Dao
- *
- * @author 李鹏军
- * @date 2019-01-22 10:13:48
- */
-@Mapper
-public interface ScheduleJobLogDao extends BaseMapper<ScheduleJobLogEntity> {
-
-    /**
-     * 自定义分页查询
-     *
-     * @param page   分页参数
-     * @param params 查询参数
-     * @return List
-     */
-    List<ScheduleJobLogEntity> selectScheduleJobLogPage(IPage page, @Param("params") Map<String, Object> params);
-}

+ 0 - 71
platform-schedule/src/main/java/com/platform/entity/ScheduleJobEntity.java

@@ -1,71 +0,0 @@
-package com.platform.entity;
-
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
-import org.hibernate.validator.constraints.NotBlank;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * 定时器
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年11月28日 下午12:54:44
- */
-@Data
-@TableName("SCHEDULE_JOB")
-public class ScheduleJobEntity implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 任务调度参数key
-     */
-    public static final String JOB_PARAM_KEY = "JOB_PARAM_KEY";
-
-    /**
-     * 任务id
-     */
-    @TableId
-    private Long jobId;
-
-    /**
-     * spring bean名称
-     */
-    @NotBlank(message = "bean名称不能为空")
-    private String beanName;
-
-    /**
-     * 方法名
-     */
-    @NotBlank(message = "方法名称不能为空")
-    private String methodName;
-
-    /**
-     * 参数
-     */
-    private String params;
-
-    /**
-     * cron表达式
-     */
-    @NotBlank(message = "cron表达式不能为空")
-    private String cronExpression;
-
-    /**
-     * 任务状态
-     */
-    private Integer status;
-
-    /**
-     * 备注
-     */
-    private String remark;
-
-    /**
-     * 创建时间
-     */
-    private Date createTime;
-}

+ 0 - 65
platform-schedule/src/main/java/com/platform/entity/ScheduleJobLogEntity.java

@@ -1,65 +0,0 @@
-package com.platform.entity;
-
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * 定时任务日志
- *
- * @author 李鹏军
- */
-@Data
-@TableName("SCHEDULE_JOB_LOG")
-public class ScheduleJobLogEntity implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 日志id
-     */
-    @TableId
-    private Long logId;
-
-    /**
-     * 任务id
-     */
-    private Long jobId;
-
-    /**
-     * spring bean名称
-     */
-    private String beanName;
-
-    /**
-     * 方法名
-     */
-    private String methodName;
-
-    /**
-     * 参数
-     */
-    private String params;
-
-    /**
-     * 任务状态    0:成功    1:失败
-     */
-    private Integer status;
-
-    /**
-     * 失败信息
-     */
-    private String error;
-
-    /**
-     * 耗时(单位:毫秒)
-     */
-    private Integer times;
-
-    /**
-     * 创建时间
-     */
-    private Date createTime;
-}

+ 0 - 23
platform-schedule/src/main/java/com/platform/service/ScheduleJobLogService.java

@@ -1,23 +0,0 @@
-package com.platform.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.platform.entity.ScheduleJobLogEntity;
-import com.platform.utils.PageUtilsPlus;
-
-import java.util.Map;
-
-/**
- * 定时任务日志
- *
- * @author 李鹏军
- */
-public interface ScheduleJobLogService extends IService<ScheduleJobLogEntity> {
-
-    /**
-     * 获取分页数据
-     *
-     * @param params 查询参数
-     * @return Page
-     */
-    PageUtilsPlus queryPage(Map<String, Object> params);
-}

+ 0 - 73
platform-schedule/src/main/java/com/platform/service/ScheduleJobService.java

@@ -1,73 +0,0 @@
-package com.platform.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.platform.entity.ScheduleJobEntity;
-import com.platform.utils.PageUtilsPlus;
-
-import java.util.Map;
-
-/**
- * 定时任务
- *
- * @author 李鹏军
- */
-public interface ScheduleJobService extends IService<ScheduleJobEntity> {
-
-    /**
-     * 获取分页数据
-     *
-     * @param params 查询参数
-     * @return Page
-     */
-    PageUtilsPlus queryPage(Map<String, Object> params);
-
-    /**
-     * 新增定时任务
-     *
-     * @param scheduleJob scheduleJob
-     */
-    void add(ScheduleJobEntity scheduleJob);
-
-    /**
-     * 更新定时任务
-     *
-     * @param scheduleJob scheduleJob
-     */
-    void update(ScheduleJobEntity scheduleJob);
-
-    /**
-     * 批量删除定时任务
-     *
-     * @param jobIds jobIds
-     */
-    void deleteBatch(Long[] jobIds);
-
-    /**
-     * 批量更新定时任务状态
-     *
-     * @param jobIds jobIds
-     * @param status status
-     */
-    void updateBatch(Long[] jobIds, int status);
-
-    /**
-     * 立即执行
-     *
-     * @param jobIds jobIds
-     */
-    void run(Long[] jobIds);
-
-    /**
-     * 暂停运行
-     *
-     * @param jobIds jobIds
-     */
-    void pause(Long[] jobIds);
-
-    /**
-     * 恢复运行
-     *
-     * @param jobIds jobIds
-     */
-    void resume(Long[] jobIds);
-}

+ 0 - 28
platform-schedule/src/main/java/com/platform/service/impl/ScheduleJobLogServiceImpl.java

@@ -1,28 +0,0 @@
-package com.platform.service.impl;
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.platform.dao.ScheduleJobLogDao;
-import com.platform.entity.ScheduleJobLogEntity;
-import com.platform.service.ScheduleJobLogService;
-import com.platform.utils.PageUtilsPlus;
-import com.platform.utils.QueryPlus;
-import org.springframework.stereotype.Service;
-
-import java.util.Map;
-
-/**
- * @author 李鹏军
- */
-@Service("scheduleJobLogService")
-public class ScheduleJobLogServiceImpl extends ServiceImpl<ScheduleJobLogDao, ScheduleJobLogEntity> implements ScheduleJobLogService {
-
-    @Override
-    public PageUtilsPlus queryPage(Map<String, Object> params) {
-        //排序
-        params.put("sidx", "T.CREATE_TIME");
-        params.put("asc", false);
-        Page<ScheduleJobLogEntity> page = new QueryPlus<ScheduleJobLogEntity>(params).getPage();
-        return new PageUtilsPlus(page.setRecords(baseMapper.selectScheduleJobLogPage(page, params)));
-    }
-}

+ 0 - 121
platform-schedule/src/main/java/com/platform/service/impl/ScheduleJobServiceImpl.java

@@ -1,121 +0,0 @@
-package com.platform.service.impl;
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.platform.dao.ScheduleJobDao;
-import com.platform.entity.ScheduleJobEntity;
-import com.platform.service.ScheduleJobService;
-import com.platform.utils.Constant;
-import com.platform.utils.PageUtilsPlus;
-import com.platform.utils.QueryPlus;
-import com.platform.utils.ScheduleUtils;
-import org.quartz.CronTrigger;
-import org.quartz.Scheduler;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import javax.annotation.PostConstruct;
-import java.util.*;
-
-/**
- * @author 李鹏军
- */
-@Service("scheduleJobService")
-public class ScheduleJobServiceImpl extends ServiceImpl<ScheduleJobDao, ScheduleJobEntity> implements ScheduleJobService {
-    @Autowired
-    private Scheduler scheduler;
-
-    /**
-     * 项目启动时,初始化定时器
-     */
-    @PostConstruct
-    public void init() {
-        List<ScheduleJobEntity> scheduleJobList = this.list();
-        for (ScheduleJobEntity scheduleJob : scheduleJobList) {
-            CronTrigger cronTrigger = ScheduleUtils.getCronTrigger(scheduler, scheduleJob.getJobId());
-            //如果不存在,则创建
-            if (cronTrigger == null) {
-                ScheduleUtils.createScheduleJob(scheduler, scheduleJob);
-            } else {
-                ScheduleUtils.updateScheduleJob(scheduler, scheduleJob);
-            }
-        }
-    }
-
-    @Override
-    public PageUtilsPlus queryPage(Map<String, Object> params) {
-        //排序
-        params.put("sidx", "T.CREATE_TIME");
-        params.put("asc", false);
-        Page<ScheduleJobEntity> page = new QueryPlus<ScheduleJobEntity>(params).getPage();
-        return new PageUtilsPlus(page.setRecords(baseMapper.selectScheduleJobPage(page, params)));
-    }
-
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void add(ScheduleJobEntity scheduleJob) {
-        scheduleJob.setCreateTime(new Date());
-        scheduleJob.setStatus(Constant.ScheduleStatus.NORMAL.getValue());
-        this.save(scheduleJob);
-
-        ScheduleUtils.createScheduleJob(scheduler, scheduleJob);
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void update(ScheduleJobEntity scheduleJob) {
-        ScheduleUtils.updateScheduleJob(scheduler, scheduleJob);
-
-        this.updateById(scheduleJob);
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void deleteBatch(Long[] jobIds) {
-        for (Long jobId : jobIds) {
-            ScheduleUtils.deleteScheduleJob(scheduler, jobId);
-        }
-
-        //删除数据
-        this.removeByIds(Arrays.asList(jobIds));
-    }
-
-    @Override
-    public void updateBatch(Long[] jobIds, int status) {
-        Map<String, Object> map = new HashMap<>(4);
-        map.put("list", jobIds);
-        map.put("status", status);
-        baseMapper.updateBatch(map);
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void run(Long[] jobIds) {
-        for (Long jobId : jobIds) {
-            ScheduleUtils.run(scheduler, this.getById(jobId));
-        }
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void pause(Long[] jobIds) {
-        for (Long jobId : jobIds) {
-            ScheduleUtils.pauseJob(scheduler, jobId);
-        }
-
-        updateBatch(jobIds, Constant.ScheduleStatus.PAUSE.getValue());
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void resume(Long[] jobIds) {
-        for (Long jobId : jobIds) {
-            ScheduleUtils.resumeJob(scheduler, jobId);
-        }
-
-        updateBatch(jobIds, Constant.ScheduleStatus.NORMAL.getValue());
-    }
-
-}

+ 0 - 79
platform-schedule/src/main/java/com/platform/utils/ScheduleJob.java

@@ -1,79 +0,0 @@
-package com.platform.utils;
-
-import com.platform.entity.ScheduleJobEntity;
-import com.platform.entity.ScheduleJobLogEntity;
-import com.platform.service.ScheduleJobLogService;
-import org.apache.commons.lang.StringUtils;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.scheduling.quartz.QuartzJobBean;
-
-import java.util.Date;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-
-
-/**
- * 定时任务
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年11月30日 下午12:44:21
- */
-public class ScheduleJob extends QuartzJobBean {
-    private Logger logger = LoggerFactory.getLogger(getClass());
-    private ExecutorService service = Executors.newSingleThreadExecutor();
-
-    @Override
-    protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
-        ScheduleJobEntity scheduleJob = (ScheduleJobEntity) context.getMergedJobDataMap()
-                .get(ScheduleJobEntity.JOB_PARAM_KEY);
-
-        //获取spring bean
-        ScheduleJobLogService scheduleJobLogService = (ScheduleJobLogService) SpringContextUtils.getBean("scheduleJobLogService");
-
-        //数据库保存执行记录
-        ScheduleJobLogEntity log = new ScheduleJobLogEntity();
-        log.setJobId(scheduleJob.getJobId());
-        log.setBeanName(scheduleJob.getBeanName());
-        log.setMethodName(scheduleJob.getMethodName());
-        log.setParams(scheduleJob.getParams());
-        log.setCreateTime(new Date());
-
-        //任务开始时间
-        long startTime = System.currentTimeMillis();
-
-        try {
-            //执行任务
-            logger.info("任务准备执行,任务ID:" + scheduleJob.getJobId());
-            ScheduleRunnable task = new ScheduleRunnable(scheduleJob.getBeanName(),
-                    scheduleJob.getMethodName(), scheduleJob.getParams());
-            Future<?> future = service.submit(task);
-
-            future.get();
-
-            //任务执行总时长
-            long times = System.currentTimeMillis() - startTime;
-            log.setTimes((int) times);
-            //任务状态    0:成功    1:失败
-            log.setStatus(0);
-
-            logger.info("任务执行完毕,任务ID:" + scheduleJob.getJobId() + "  总共耗时:" + times + "毫秒");
-        } catch (Exception e) {
-            logger.error("任务执行失败,任务ID:" + scheduleJob.getJobId(), e);
-
-            //任务执行总时长
-            long times = System.currentTimeMillis() - startTime;
-            log.setTimes((int) times);
-
-            //任务状态    0:成功    1:失败
-            log.setStatus(1);
-            log.setError(StringUtils.substring(e.toString(), 0, 2000));
-        } finally {
-            scheduleJobLogService.save(log);
-        }
-    }
-}

+ 0 - 45
platform-schedule/src/main/java/com/platform/utils/ScheduleRunnable.java

@@ -1,45 +0,0 @@
-package com.platform.utils;
-
-import org.apache.commons.lang.StringUtils;
-import org.springframework.util.ReflectionUtils;
-
-import java.lang.reflect.Method;
-
-/**
- * 执行定时任务
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年11月30日 下午12:49:33
- */
-public class ScheduleRunnable implements Runnable {
-    private Object target;
-    private Method method;
-    private String params;
-
-    public ScheduleRunnable(String beanName, String methodName, String params) throws NoSuchMethodException, SecurityException {
-        this.target = SpringContextUtils.getBean(beanName);
-        this.params = params;
-
-        if (StringUtils.isNotBlank(params)) {
-            this.method = target.getClass().getDeclaredMethod(methodName, String.class);
-        } else {
-            this.method = target.getClass().getDeclaredMethod(methodName);
-        }
-    }
-
-    @Override
-    public void run() {
-        try {
-            ReflectionUtils.makeAccessible(method);
-            if (StringUtils.isNotBlank(params)) {
-                method.invoke(target, params);
-            } else {
-                method.invoke(target);
-            }
-        } catch (Exception e) {
-            throw new RRException("执行定时任务失败", e);
-        }
-    }
-
-}

+ 0 - 149
platform-schedule/src/main/java/com/platform/utils/ScheduleUtils.java

@@ -1,149 +0,0 @@
-package com.platform.utils;
-
-import com.platform.entity.ScheduleJobEntity;
-import com.platform.utils.Constant.ScheduleStatus;
-import org.quartz.*;
-
-/**
- * 定时任务工具类
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年11月30日 下午12:44:59
- */
-public class ScheduleUtils {
-    private final static String JOB_NAME = "TASK_";
-
-    /**
-     * 获取触发器key
-     */
-    public static TriggerKey getTriggerKey(Long jobId) {
-        return TriggerKey.triggerKey(JOB_NAME + jobId);
-    }
-
-    /**
-     * 获取jobKey
-     */
-    public static JobKey getJobKey(Long jobId) {
-        return JobKey.jobKey(JOB_NAME + jobId);
-    }
-
-    /**
-     * 获取表达式触发器
-     */
-    public static CronTrigger getCronTrigger(Scheduler scheduler, Long jobId) {
-        try {
-            return (CronTrigger) scheduler.getTrigger(getTriggerKey(jobId));
-        } catch (SchedulerException e) {
-            throw new RRException("获取定时任务CronTrigger出现异常", e);
-        }
-    }
-
-    /**
-     * 创建定时任务
-     */
-    public static void createScheduleJob(Scheduler scheduler, ScheduleJobEntity scheduleJob) {
-        try {
-            //构建job信息
-            JobDetail jobDetail = JobBuilder.newJob(ScheduleJob.class).withIdentity(getJobKey(scheduleJob.getJobId())).build();
-
-            //表达式调度构建器
-            CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(scheduleJob.getCronExpression())
-                    .withMisfireHandlingInstructionDoNothing();
-
-            //按新的cronExpression表达式构建一个新的trigger
-            CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(getTriggerKey(scheduleJob.getJobId())).withSchedule(scheduleBuilder).build();
-
-            //放入参数,运行时的方法可以获取
-            jobDetail.getJobDataMap().put(ScheduleJobEntity.JOB_PARAM_KEY, scheduleJob);
-
-            scheduler.scheduleJob(jobDetail, trigger);
-
-            //暂停任务
-            if (scheduleJob.getStatus() == ScheduleStatus.PAUSE.getValue()) {
-                pauseJob(scheduler, scheduleJob.getJobId());
-            }
-        } catch (SchedulerException e) {
-            throw new RRException("创建定时任务失败", e);
-        }
-    }
-
-    /**
-     * 更新定时任务
-     */
-    public static void updateScheduleJob(Scheduler scheduler, ScheduleJobEntity scheduleJob) {
-        try {
-            TriggerKey triggerKey = getTriggerKey(scheduleJob.getJobId());
-
-            //表达式调度构建器
-            CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(scheduleJob.getCronExpression())
-                    .withMisfireHandlingInstructionDoNothing();
-
-            CronTrigger trigger = getCronTrigger(scheduler, scheduleJob.getJobId());
-
-            //按新的cronExpression表达式重新构建trigger
-            trigger = trigger.getTriggerBuilder().withIdentity(triggerKey).withSchedule(scheduleBuilder).build();
-
-            //参数
-            trigger.getJobDataMap().put(ScheduleJobEntity.JOB_PARAM_KEY, scheduleJob);
-
-            scheduler.rescheduleJob(triggerKey, trigger);
-
-            //暂停任务
-            if (scheduleJob.getStatus() == ScheduleStatus.PAUSE.getValue()) {
-                pauseJob(scheduler, scheduleJob.getJobId());
-            }
-
-        } catch (SchedulerException e) {
-            throw new RRException("更新定时任务失败", e);
-        }
-    }
-
-    /**
-     * 立即执行任务
-     */
-    public static void run(Scheduler scheduler, ScheduleJobEntity scheduleJob) {
-        try {
-            //参数
-            JobDataMap dataMap = new JobDataMap();
-            dataMap.put(ScheduleJobEntity.JOB_PARAM_KEY, scheduleJob);
-
-            scheduler.triggerJob(getJobKey(scheduleJob.getJobId()), dataMap);
-        } catch (SchedulerException e) {
-            throw new RRException("立即执行定时任务失败", e);
-        }
-    }
-
-    /**
-     * 暂停任务
-     */
-    public static void pauseJob(Scheduler scheduler, Long jobId) {
-        try {
-            scheduler.pauseJob(getJobKey(jobId));
-        } catch (SchedulerException e) {
-            throw new RRException("暂停定时任务失败", e);
-        }
-    }
-
-    /**
-     * 恢复任务
-     */
-    public static void resumeJob(Scheduler scheduler, Long jobId) {
-        try {
-            scheduler.resumeJob(getJobKey(jobId));
-        } catch (SchedulerException e) {
-            throw new RRException("暂停定时任务失败", e);
-        }
-    }
-
-    /**
-     * 删除定时任务
-     */
-    public static void deleteScheduleJob(Scheduler scheduler, Long jobId) {
-        try {
-            scheduler.deleteJob(getJobKey(jobId));
-        } catch (SchedulerException e) {
-            throw new RRException("删除定时任务失败", e);
-        }
-    }
-}

+ 0 - 30
platform-schedule/src/main/resources/com/platform/dao/ScheduleJobDao.xml

@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="com.platform.dao.ScheduleJobDao">
-
-	<!-- 批量更新状态 -->
-	<update id="updateBatch">
-		UPDATE SCHEDULE_JOB SET STATUS = #{status} WHERE JOB_ID IN
-		<foreach item="jobId" collection="list"  open="(" separator="," close=")">
-			#{jobId}
-		</foreach>
-	</update>
-
-	<select id="selectScheduleJobPage" resultType="com.platform.entity.ScheduleJobEntity">
-		SELECT
-		T.JOB_ID,
-		T.BEAN_NAME,
-		T.METHOD_NAME,
-		T.PARAMS,
-		T.CRON_EXPRESSION,
-		T.STATUS,
-		T.REMARK,
-		T.CREATE_TIME
-		FROM SCHEDULE_JOB T
-		WHERE 1=1
-		<if test="params.beanName != null and params.beanName.trim() != ''">
-			AND T.BEAN_NAME LIKE '%${params.beanName}%'
-		</if>
-	</select>
-</mapper>

+ 0 - 25
platform-schedule/src/main/resources/com/platform/dao/ScheduleJobLogDao.xml

@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="com.platform.dao.ScheduleJobLogDao">
-	<select id="selectScheduleJobLogPage" resultType="com.platform.entity.ScheduleJobLogEntity">
-		SELECT
-		T.LOG_ID,
-		T.JOB_ID,
-		T.BEAN_NAME,
-		T.METHOD_NAME,
-		T.PARAMS,
-		T.STATUS,
-		T.ERROR,
-		T.TIMES,
-		T.CREATE_TIME
-		FROM SCHEDULE_JOB_LOG T
-		WHERE 1=1
-		<if test="params.beanName != null and params.beanName.trim() != ''">
-			AND T.BEAN_NAME LIKE '%${params.beanName}%'
-		</if>
-		<if test="params.methodName != null and params.methodName.trim() != ''">
-			AND T.METHOD_NAME LIKE '%${params.methodName}%'
-		</if>
-	</select>
-</mapper>

+ 0 - 46
platform-schedule/src/main/resources/platform-scheduler.xml

@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="
-        http://www.springframework.org/schema/beans 
-        http://www.springframework.org/schema/beans/spring-beans-4.2.xsd">
-
-	<bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
-        <property name="dataSource" ref="dataSource" />
-        <property name="quartzProperties">
-            <props>
-                <prop key="org.quartz.scheduler.instanceName">PlatformScheduler</prop>
-                <prop key="org.quartz.scheduler.instanceId">AUTO</prop>
-                <!-- 线程池配置 -->
-                <prop key="org.quartz.threadPool.class">org.quartz.simpl.SimpleThreadPool</prop>
-                <prop key="org.quartz.threadPool.threadCount">20</prop>
-                <prop key="org.quartz.threadPool.threadPriority">5</prop>
-                <!-- JobStore 配置 -->
-                <prop key="org.quartz.jobStore.class">org.quartz.impl.jdbcjobstore.JobStoreTX</prop>
-                <!-- 集群配置 -->
-                <prop key="org.quartz.jobStore.isClustered">true</prop>
-                <prop key="org.quartz.jobStore.clusterCheckinInterval">15000</prop>
-                <prop key="org.quartz.jobStore.maxMisfiresToHandleAtATime">1</prop>
-                
-                <prop key="org.quartz.jobStore.misfireThreshold">12000</prop>
-				<!-- 表前缀 -->
-                <prop key="org.quartz.jobStore.tablePrefix">QRTZ_</prop>
-            </props>
-        </property>
-
-        <property name="schedulerName" value="PlatformScheduler" />
-
-        <!--延时启动 -->
-        <property name="startupDelay" value="30" />
-
-        <property name="applicationContextSchedulerContextKey" value="applicationContextKey" />
-
-        <!--可选,QuartzScheduler 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了 -->
-        <property name="overwriteExistingJobs" value="true" />
-
-        <!-- 设置自动启动   默认为true -->
-        <property name="autoStartup" value="true" />
-
-    </bean>
-	
-</beans>

+ 0 - 6
platform-shop/pom.xml

@@ -22,12 +22,6 @@
             <artifactId>mybatis-plus-core</artifactId>
             <artifactId>mybatis-plus-core</artifactId>
             <version>3.1.0</version>
             <version>3.1.0</version>
         </dependency>
         </dependency>
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-lang3</artifactId>
-            <version>3.5</version>
-            <scope>compile</scope>
-        </dependency>
         <!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
         <!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
         <dependency>
         <dependency>
             <groupId>com.alibaba</groupId>
             <groupId>com.alibaba</groupId>

+ 0 - 17
platform-shop/src/main/java/com/platform/controller/AppCensusController.java

@@ -7,13 +7,11 @@ import com.platform.annotation.CanUserUpdateRecord;
 import com.platform.entity.*;
 import com.platform.entity.*;
 import com.platform.enums.ResultCodeEnum;
 import com.platform.enums.ResultCodeEnum;
 import com.platform.exception.CommonBaseException;
 import com.platform.exception.CommonBaseException;
-import com.platform.service.GoodsService;
 import com.platform.service.custom.GoodsVisitHistoryService;
 import com.platform.service.custom.GoodsVisitHistoryService;
 import com.platform.service.custom.SceneCensusService;
 import com.platform.service.custom.SceneCensusService;
 import com.platform.service.custom.TmBrandAdminService;
 import com.platform.service.custom.TmBrandAdminService;
 import com.platform.service.impl.BrandServiceImpl;
 import com.platform.service.impl.BrandServiceImpl;
 import com.platform.service.impl.UserServiceImpl;
 import com.platform.service.impl.UserServiceImpl;
-import com.platform.utils.HttpClientUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiImplicitParams;
@@ -47,9 +45,6 @@ import java.util.Map;
 public class AppCensusController {
 public class AppCensusController {
 
 
     @Autowired
     @Autowired
-    private GoodsService goodsService;
-
-    @Autowired
     private BrandServiceImpl brandService;
     private BrandServiceImpl brandService;
 
 
     @Autowired
     @Autowired
@@ -209,18 +204,6 @@ public class AppCensusController {
         return Result.success(tmSceneCensus);
         return Result.success(tmSceneCensus);
     }
     }
 
 
-
-    public JSONArray getDataFromKanKan(String url, Map<String, Object> params) {
-        if (StringUtils.isBlank(url)) {
-            throw new CommonBaseException(ResultCodeEnum.D101, "入参不全,无法获取四维场景列表");
-        }
-        String kankanResult = HttpClientUtil.doPostJson(url, JSON.toJSONString(params));
-        //把信息封装为json
-        JSONObject res = JSONObject.parseObject(kankanResult);
-        JSONArray mySceneList = parseKanKanRsp(res);
-        return mySceneList;
-    }
-
     public JSONArray parseKanKanRsp(JSONObject result) {
     public JSONArray parseKanKanRsp(JSONObject result) {
         if (null == result) {
         if (null == result) {
             throw new CommonBaseException(ResultCodeEnum.D101, "四维看看返回数据异常");
             throw new CommonBaseException(ResultCodeEnum.D101, "四维看看返回数据异常");

+ 8 - 4
platform-shop/src/main/java/com/platform/controller/BrandController.java

@@ -23,6 +23,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.ObjectUtils;
 import org.springframework.util.ObjectUtils;
@@ -67,6 +68,9 @@ public class BrandController extends AbstractController{
     @Autowired
     @Autowired
     private MySysUserBrandService mySysUserBrandService;
     private MySysUserBrandService mySysUserBrandService;
 
 
+    @Value("${scenePath}")
+    private String scenePath;
+
     /**
     /**
      * 用户绑定品牌
      * 用户绑定品牌
      */
      */
@@ -326,7 +330,7 @@ public class BrandController extends AbstractController{
         JSONArray pageArray = null;
         JSONArray pageArray = null;
         JSONObject pageObject = null;
         JSONObject pageObject = null;
 
 
-        String scenePath = ResourceUtil.getConfigByName("scenePath");
+        String scenePath = this.scenePath;
         String sceneData = ResourceUtil.getConfigByName("sceneData");
         String sceneData = ResourceUtil.getConfigByName("sceneData");
 
 
         for(BrandEntity entity : list){
         for(BrandEntity entity : list){
@@ -454,7 +458,7 @@ public class BrandController extends AbstractController{
     @CanUserUpdateRecord
     @CanUserUpdateRecord
     @RequestMapping("/saveGoodsHot")
     @RequestMapping("/saveGoodsHot")
     public R saveGoodsHot(@RequestParam Map<String, Object> params) throws Exception {
     public R saveGoodsHot(@RequestParam Map<String, Object> params) throws Exception {
-        String scenePath = ResourceUtil.getConfigByName("scenePath");
+        String scenePath = this.scenePath;
         String origin = ResourceUtil.getConfigByName("origin");
         String origin = ResourceUtil.getConfigByName("origin");
 
 
         HttpRequestorUtil util = new HttpRequestorUtil();
         HttpRequestorUtil util = new HttpRequestorUtil();
@@ -481,7 +485,7 @@ public class BrandController extends AbstractController{
     @CanUserUpdateRecord
     @CanUserUpdateRecord
     @RequestMapping("/deleteGoodsHot")
     @RequestMapping("/deleteGoodsHot")
     public R deleteGoodsHot(@RequestParam Map<String, Object> params) throws Exception {
     public R deleteGoodsHot(@RequestParam Map<String, Object> params) throws Exception {
-        String scenePath = ResourceUtil.getConfigByName("scenePath");
+        String scenePath = this.scenePath;
         String origin = ResourceUtil.getConfigByName("origin");
         String origin = ResourceUtil.getConfigByName("origin");
 
 
         HttpRequestorUtil util = new HttpRequestorUtil();
         HttpRequestorUtil util = new HttpRequestorUtil();
@@ -510,7 +514,7 @@ public class BrandController extends AbstractController{
             String sceneNum = sceneUrl.split("\\?m=")[1];
             String sceneNum = sceneUrl.split("\\?m=")[1];
             sceneNum = sceneNum.substring(0, sceneNum.indexOf("&"));
             sceneNum = sceneNum.substring(0, sceneNum.indexOf("&"));
 
 
-            String scenePath = ResourceUtil.getConfigByName("scenePath");
+            String scenePath = this.scenePath;
             String editHtml = ResourceUtil.getConfigByName("editHtml");
             String editHtml = ResourceUtil.getConfigByName("editHtml");
             String origin = ResourceUtil.getConfigByName("origin");
             String origin = ResourceUtil.getConfigByName("origin");
             HttpRequestorUtil util = new HttpRequestorUtil();
             HttpRequestorUtil util = new HttpRequestorUtil();

+ 13 - 17
platform-shop/src/main/java/com/platform/controller/GoodsController.java

@@ -18,10 +18,12 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.ResponseEntity;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.client.RestTemplate;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.util.*;
 import java.util.*;
@@ -62,6 +64,9 @@ public class GoodsController extends AbstractController{
     @Value("${api.secret}")
     @Value("${api.secret}")
     private String appSecret;
     private String appSecret;
 
 
+    @Autowired
+    private RestTemplate restTemplate;
+
     /**
     /**
      * 查看列表
      * 查看列表
      */
      */
@@ -181,12 +186,10 @@ public class GoodsController extends AbstractController{
             String sortMapStr = JSONObject.toJSONString(sortMap);
             String sortMapStr = JSONObject.toJSONString(sortMap);
             log.info("待加密的数据={}" ,sortMapStr + appSecret + timeStamp);
             log.info("待加密的数据={}" ,sortMapStr + appSecret + timeStamp);
             String sign  = SHAUtils.getSHA256(sortMapStr + appSecret + timeStamp);
             String sign  = SHAUtils.getSHA256(sortMapStr + appSecret + timeStamp);
-
-            String openApiurl = apiHostQueryUrl + "appId=" + appId + "&sign=" + sign + "&token=" + token + "&timeStamp=" + timeStamp;
-            log.info("请求openApi的url={}", openApiurl);
-            String apiResultStr = HttpClientUtil.doPostJson(openApiurl , sortMapStr);
-            log.info("api平台返回结果:{}" , apiResultStr);
-            return R.ok(apiResultStr);
+            String openApiurl = apiHostQueryUrl + "?appId={1}&sign={2}&token={3}&timeStamp={4}";
+            ResponseEntity<String> apiResultStr = restTemplate.postForEntity(openApiurl , sortMapStr,String.class,appId,sign,token,timeStamp);
+            log.info("api平台返回结果:{}" , apiResultStr.getBody());
+            return R.ok(apiResultStr.getBody());
         }else{
         }else{
             log.info("当前商品[{}]的品牌没有vr场景或者场景码为空,不需要上送api平台" , goods.getId());
             log.info("当前商品[{}]的品牌没有vr场景或者场景码为空,不需要上送api平台" , goods.getId());
             return R.ok();
             return R.ok();
@@ -244,12 +247,10 @@ public class GoodsController extends AbstractController{
             String sortMapStr = JSONObject.toJSONString(sortMap);
             String sortMapStr = JSONObject.toJSONString(sortMap);
             log.info("待加密的数据={}" ,sortMapStr + appSecret + timeStamp);
             log.info("待加密的数据={}" ,sortMapStr + appSecret + timeStamp);
             String sign  = SHAUtils.getSHA256(sortMapStr + appSecret + timeStamp);
             String sign  = SHAUtils.getSHA256(sortMapStr + appSecret + timeStamp);
-
-            String openApiurl = apiHostQueryUrl + "appId=" + appId + "&sign=" + sign + "&token=" + token + "&timeStamp=" + timeStamp;
-            log.info("请求openApi的url={}", openApiurl);
-            String apiResultStr = HttpClientUtil.doPostJson(openApiurl , sortMapStr);
+            String openApiurl = apiHostQueryUrl + "?appId={1}&sign={2}&token={3}&timeStamp={4}";
+            ResponseEntity<String> apiResultStr = restTemplate.postForEntity(openApiurl , sortMapStr,String.class,appId,sign,token,timeStamp);
             log.info("api平台返回结果:{}" , apiResultStr);
             log.info("api平台返回结果:{}" , apiResultStr);
-            return R.ok(apiResultStr);
+            return R.ok(apiResultStr.getBody());
         }else{
         }else{
             log.info("当前商品[{}]的品牌没有vr场景或者场景码为空,不需要上送api平台" , goods.getId());
             log.info("当前商品[{}]的品牌没有vr场景或者场景码为空,不需要上送api平台" , goods.getId());
             return R.ok();
             return R.ok();
@@ -266,12 +267,7 @@ public class GoodsController extends AbstractController{
     private   Map<String, Object> sortMapByKey(Map<String, Object>map) {
     private   Map<String, Object> sortMapByKey(Map<String, Object>map) {
         Map<String, Object> treemap = new TreeMap<String, Object>(map);
         Map<String, Object> treemap = new TreeMap<String, Object>(map);
         List<Map.Entry<String, Object>> list = new ArrayList<Map.Entry<String, Object>>(treemap.entrySet());
         List<Map.Entry<String, Object>> list = new ArrayList<Map.Entry<String, Object>>(treemap.entrySet());
-        Collections.sort(list, new Comparator<Map.Entry<String, Object>>() {
-            @Override
-            public int compare(Map.Entry<String, Object> o1, Map.Entry<String, Object> o2) {
-                return org.apache.commons.lang3.StringUtils.compare(o1.getKey() , o2.getKey());
-            }
-        });
+        Collections.sort(list, (o1, o2) -> org.apache.commons.lang3.StringUtils.compare(o1.getKey() , o2.getKey()));
         return treemap;
         return treemap;
     }
     }
 
 

+ 19 - 7
platform-shop/src/main/java/com/platform/controller/SceneController.java

@@ -19,10 +19,15 @@ import io.swagger.annotations.*;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.ResponseEntity;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.ObjectUtils;
 import org.springframework.util.ObjectUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.client.RestTemplate;
 
 
 import java.util.*;
 import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
@@ -54,6 +59,12 @@ public class SceneController extends AbstractController{
     @Autowired
     @Autowired
     private DepartmentUtils departmentUtils;
     private DepartmentUtils departmentUtils;
 
 
+    @Value("${scenePath}")
+    private String scenePath;
+
+    @Autowired
+    private RestTemplate restTemplate;
+
     /**
     /**
      * 更新显示状态
      * 更新显示状态
      */
      */
@@ -74,7 +85,7 @@ public class SceneController extends AbstractController{
             requestScene.setToken(sceneParam.getToken());
             requestScene.setToken(sceneParam.getToken());
             requestScene.setNums("'"+sceneParam.getSceneNum()+"'");
             requestScene.setNums("'"+sceneParam.getSceneNum()+"'");
             requestScene.setUserId(-1L);
             requestScene.setUserId(-1L);
-            String url = ResourceUtil.getConfigByName("scenePath") + "scene/list";
+            String url = scenePath + "scene/list";
             JSONObject mySceneJsonData = getSceneFromKanKan(url , requestScene);
             JSONObject mySceneJsonData = getSceneFromKanKan(url , requestScene);
             if(ObjectUtils.isEmpty(mySceneJsonData) || !mySceneJsonData.containsKey("list")){
             if(ObjectUtils.isEmpty(mySceneJsonData) || !mySceneJsonData.containsKey("list")){
                 log.error("场景码错误!");
                 log.error("场景码错误!");
@@ -199,7 +210,7 @@ public class SceneController extends AbstractController{
                 requestScene.setPhone(user.getMobile());
                 requestScene.setPhone(user.getMobile());
             }
             }
         }
         }
-        String url = ResourceUtil.getConfigByName("scenePath") + "scene/list";
+        String url = scenePath + "scene/list";
         JSONObject mySceneJsonData = getSceneFromKanKan(url , requestScene);
         JSONObject mySceneJsonData = getSceneFromKanKan(url , requestScene);
         if(ObjectUtils.isEmpty(mySceneJsonData) || !mySceneJsonData.containsKey("list")){
         if(ObjectUtils.isEmpty(mySceneJsonData) || !mySceneJsonData.containsKey("list")){
             return R.ok().put("page", null);
             return R.ok().put("page", null);
@@ -247,11 +258,12 @@ public class SceneController extends AbstractController{
         if(org.apache.commons.lang3.StringUtils.isBlank(url )){
         if(org.apache.commons.lang3.StringUtils.isBlank(url )){
             throw new CommonBaseException(ResultCodeEnum.D101 , "入参不全,无法获取四维场景列表");
             throw new CommonBaseException(ResultCodeEnum.D101 , "入参不全,无法获取四维场景列表");
         }
         }
-        Map<String, Object> headers = new HashMap<>();
-        headers.put("token", requestScene.getToken());
-        String kankanResult = HttpClientUtil.doPostJsonWithHeader(url, JSON.toJSONString(requestScene), headers);
+        HttpHeaders headers = new HttpHeaders();
+        headers.add("token", requestScene.getToken());
+        HttpEntity<Object> formEntity = new HttpEntity<>(requestScene, headers);
+        ResponseEntity<String> kankanResult = restTemplate.postForEntity(url,formEntity,String.class);
         //把信息封装为json
         //把信息封装为json
-        JSONObject res = JSONObject.parseObject(kankanResult);
+        JSONObject res = JSONObject.parseObject(kankanResult.getBody());
         return parseKanKanRsp(res);
         return parseKanKanRsp(res);
     }
     }
 
 
@@ -296,7 +308,7 @@ public class SceneController extends AbstractController{
         requestScene.setToken(token);
         requestScene.setToken(token);
         requestScene.setNums("'"+SceneEntity.getSceneNum()+"'");
         requestScene.setNums("'"+SceneEntity.getSceneNum()+"'");
         requestScene.setUserId(-1L);
         requestScene.setUserId(-1L);
-        String url = ResourceUtil.getConfigByName("scenePath") + "scene/list";
+        String url = scenePath + "scene/list";
         JSONObject mySceneJsonData = getSceneFromKanKan(url , requestScene);
         JSONObject mySceneJsonData = getSceneFromKanKan(url , requestScene);
         if(ObjectUtils.isEmpty(mySceneJsonData) || !mySceneJsonData.containsKey("list")){
         if(ObjectUtils.isEmpty(mySceneJsonData) || !mySceneJsonData.containsKey("list")){
             return R.error("场景码错误!");
             return R.error("场景码错误!");

+ 15 - 6
platform-shop/src/main/java/com/platform/controller/SysUserController.java

@@ -6,7 +6,9 @@ import com.platform.annotation.SysLog;
 import com.platform.entity.SysDeptEntity;
 import com.platform.entity.SysDeptEntity;
 import com.platform.entity.SysRoleEntity;
 import com.platform.entity.SysRoleEntity;
 import com.platform.entity.SysUserEntity;
 import com.platform.entity.SysUserEntity;
-import com.platform.service.*;
+import com.platform.service.SysRoleService;
+import com.platform.service.SysUserRoleService;
+import com.platform.service.SysUserService;
 import com.platform.service.custom.MySysUserBrandService;
 import com.platform.service.custom.MySysUserBrandService;
 import com.platform.service.impl.SysDeptServiceImpl;
 import com.platform.service.impl.SysDeptServiceImpl;
 import com.platform.utils.*;
 import com.platform.utils.*;
@@ -16,14 +18,16 @@ import com.platform.validator.group.AddGroup;
 import com.platform.validator.group.UpdateGroup;
 import com.platform.validator.group.UpdateGroup;
 import io.swagger.annotations.*;
 import io.swagger.annotations.*;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang.ArrayUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.apache.shiro.crypto.hash.Sha256Hash;
 import org.apache.shiro.crypto.hash.Sha256Hash;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.ResponseEntity;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.ObjectUtils;
 import org.springframework.util.ObjectUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.client.RestTemplate;
 
 
 import java.util.*;
 import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
@@ -55,6 +59,12 @@ public class SysUserController extends AbstractController {
     @Autowired
     @Autowired
     private SysDeptServiceImpl sysDeptService;
     private SysDeptServiceImpl sysDeptService;
 
 
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @Value("${scenePath}")
+    private String scenePath;
+
 
 
     /**
     /**
      * 店铺绑定的用户列表
      * 店铺绑定的用户列表
@@ -155,11 +165,10 @@ public class SysUserController extends AbstractController {
         }
         }
         Map<String, Object> mp = new HashMap<>();
         Map<String, Object> mp = new HashMap<>();
         mp.put("phone", phoneNum);
         mp.put("phone", phoneNum);
-        String url = ResourceUtil.getConfigByName("scenePath") + "user/checkUserExists";
-        String json = JsonUtils.objectToJson(mp);
-        String kankanResult = HttpClientUtil.doPostJson(url, json);
+        String url = scenePath + "user/checkUserExists";
+        ResponseEntity<String> kankanResult = restTemplate.postForEntity(url, mp,String.class);
         //解析返回结果
         //解析返回结果
-        JSONObject res = JSONObject.parseObject(kankanResult);
+        JSONObject res = JSONObject.parseObject(kankanResult.getBody());
         log.info("四维看看返回登录数据:{}", res.toJSONString());
         log.info("四维看看返回登录数据:{}", res.toJSONString());
         if (!res.containsKey("code")) {
         if (!res.containsKey("code")) {
             return R.error("系统故障,请稍后重试");
             return R.error("系统故障,请稍后重试");

+ 13 - 7
platform-shop/src/main/java/com/platform/controller/TokenController.java

@@ -1,17 +1,19 @@
 package com.platform.controller;
 package com.platform.controller;
 
 
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.platform.entity.Result;
 import com.platform.entity.Result;
 import com.platform.enums.ResultCodeEnum;
 import com.platform.enums.ResultCodeEnum;
-import com.platform.utils.HttpClientUtil;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.ResponseEntity;
 import org.springframework.util.ObjectUtils;
 import org.springframework.util.ObjectUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.client.RestTemplate;
 
 
-import java.util.HashMap;
 import java.util.Map;
 import java.util.Map;
 
 
 @RestController
 @RestController
@@ -23,6 +25,9 @@ public class TokenController {
     @Value("${scenePath}")
     @Value("${scenePath}")
     private String KankanHost;
     private String KankanHost;
 
 
+    @Autowired
+    private RestTemplate restTemplate;
+
     @PostMapping("/renewToken")
     @PostMapping("/renewToken")
     @ResponseBody
     @ResponseBody
     public Result renewToken(@RequestBody Map<String,String> param) {
     public Result renewToken(@RequestBody Map<String,String> param) {
@@ -31,10 +36,11 @@ public class TokenController {
         }
         }
         // 判断token是否有效
         // 判断token是否有效
         String url = KankanHost + "api/platform/generateSceneEditToken";
         String url = KankanHost + "api/platform/generateSceneEditToken";
-        Map<String, Object> headers = new HashMap<>();
-        headers.put("token", param.get("token"));
-        String kankanResult = HttpClientUtil.doPostJsonWithHeader(url, JSON.toJSONString(param), headers);
-        return parseKanKanRsp(kankanResult);
+        HttpHeaders headers = new HttpHeaders();
+        headers.add("token", param.get("token"));
+        HttpEntity<Object> formEntity = new HttpEntity<>(param, headers);
+        ResponseEntity<String> kankanResult = restTemplate.postForEntity(url,formEntity,String.class);
+        return parseKanKanRsp(kankanResult.getBody());
     }
     }
 
 
     private Result parseKanKanRsp(String result) {
     private Result parseKanKanRsp(String result) {

+ 8 - 5
platform-shop/src/main/java/com/platform/service/custom/SceneCensusService.java

@@ -1,6 +1,5 @@
 package com.platform.service.custom;
 package com.platform.service.custom;
 
 
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -10,17 +9,18 @@ import com.platform.enums.IdStarterEnum;
 import com.platform.enums.ResultCodeEnum;
 import com.platform.enums.ResultCodeEnum;
 import com.platform.exception.CommonBaseException;
 import com.platform.exception.CommonBaseException;
 import com.platform.service.impl.TmSceneCensusServiceImpl;
 import com.platform.service.impl.TmSceneCensusServiceImpl;
-import com.platform.utils.HttpClientUtil;
 import com.platform.utils.UUidGenerator;
 import com.platform.utils.UUidGenerator;
 import com.platform.vo.FdKanKanStasticVo;
 import com.platform.vo.FdKanKanStasticVo;
-import lombok.extern.log4j.Log4j2;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.CollectionUtils;
+import org.springframework.web.client.RestTemplate;
 
 
 import java.time.LocalDate;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
@@ -44,6 +44,9 @@ public class SceneCensusService extends TmSceneCensusServiceImpl {
     @Value("${4dkankan.host}")
     @Value("${4dkankan.host}")
     private String kankanHost;
     private String kankanHost;
 
 
+    @Autowired
+    private RestTemplate restTemplate;
+
     @Transactional(propagation = Propagation.REQUIRES_NEW,rollbackFor = Exception.class)
     @Transactional(propagation = Propagation.REQUIRES_NEW,rollbackFor = Exception.class)
     public int addSceneCensus(TmSceneCensus tmSceneCensus){
     public int addSceneCensus(TmSceneCensus tmSceneCensus){
         if(null == tmSceneCensus){
         if(null == tmSceneCensus){
@@ -229,9 +232,9 @@ public class SceneCensusService extends TmSceneCensusServiceImpl {
         if (StringUtils.isBlank(url)) {
         if (StringUtils.isBlank(url)) {
             throw new CommonBaseException(ResultCodeEnum.D101, "入参不全,无法获取四维场景列表");
             throw new CommonBaseException(ResultCodeEnum.D101, "入参不全,无法获取四维场景列表");
         }
         }
-        String kankanResult = HttpClientUtil.doPostJson(url, JSON.toJSONString(params));
+        ResponseEntity<String> kankanResult = restTemplate.postForEntity(url, params,String.class);
         //把信息封装为json
         //把信息封装为json
-        JSONObject res = JSONObject.parseObject(kankanResult);
+        JSONObject res = JSONObject.parseObject(kankanResult.getBody());
         JSONArray mySceneList = parseKanKanRsp(res);
         JSONArray mySceneList = parseKanKanRsp(res);
         return mySceneList;
         return mySceneList;
     }
     }

+ 16 - 8
platform-shop/src/main/java/com/platform/service/impl/BrandServiceImpl.java

@@ -21,9 +21,11 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.ObjectUtils;
 import org.springframework.util.ObjectUtils;
+import org.springframework.web.client.RestTemplate;
 
 
 import java.io.File;
 import java.io.File;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
@@ -71,6 +73,12 @@ public class BrandServiceImpl implements BrandService {
     @Value("${api.secret}")
     @Value("${api.secret}")
     private String appSecret;
     private String appSecret;
 
 
+    @Value("${scenePath}")
+    private String scenePath;
+
+    @Autowired
+    private RestTemplate restTemplate;
+
     @Override
     @Override
     public IPage<BrandEntity> queryBrandBindList(Long pageNum, Long pageSize,  String sceneName,String brandName,
     public IPage<BrandEntity> queryBrandBindList(Long pageNum, Long pageSize,  String sceneName,String brandName,
                                                  List<Long> deptIdList , Integer type,Long userId,Integer livestreamStatus) {
                                                  List<Long> deptIdList , Integer type,Long userId,Integer livestreamStatus) {
@@ -272,9 +280,9 @@ public class BrandServiceImpl implements BrandService {
 
 
         String openApiurl = apiHostQueryUrl + "/api/shop/formatBrand?" + "appId=" + appId + "&sign=" + sign + "&token=" + token + "&timeStamp=" + timeStamp;
         String openApiurl = apiHostQueryUrl + "/api/shop/formatBrand?" + "appId=" + appId + "&sign=" + sign + "&token=" + token + "&timeStamp=" + timeStamp;
         log.info("请求openApi的url={}", openApiurl);
         log.info("请求openApi的url={}", openApiurl);
-        String apiResultStr = HttpClientUtil.doPostJson(openApiurl , sortMapStr);
-        log.info("api平台返回结果:{}" , apiResultStr);
-        return R.ok(apiResultStr);
+        ResponseEntity<String> apiResultStr = restTemplate.postForEntity(openApiurl , sortMapStr,String.class);
+        log.info("api平台返回结果:{}" , apiResultStr.getBody());
+        return R.ok(apiResultStr.getBody());
 
 
     }
     }
 
 
@@ -282,13 +290,13 @@ public class BrandServiceImpl implements BrandService {
         if(org.apache.commons.lang3.StringUtils.isBlank(sceneNum)){
         if(org.apache.commons.lang3.StringUtils.isBlank(sceneNum)){
             return null;
             return null;
         }
         }
-        String url = ResourceUtil.getConfigByName("scenePath") + "api/scene/getInfo?num=" + sceneNum;
+        String url = scenePath + "api/scene/getInfo?num=" + sceneNum;
         log.info("请求的url为:{}" ,url);
         log.info("请求的url为:{}" ,url);
         JSONObject resObj = null;
         JSONObject resObj = null;
         try{
         try{
-            String resultString = HttpClientUtil.doGet(url);
-            log.info("四维看看返回场景详情:{}" , JSON.toJSONString(resultString));
-            resObj = JSON.parseObject(resultString , JSONObject.class);
+            ResponseEntity<String> resultString = restTemplate.getForEntity(url,String.class);
+            log.info("四维看看返回场景详情:{}" , JSON.toJSONString(resultString.getBody()));
+            resObj = JSON.parseObject(resultString.getBody() , JSONObject.class);
         }catch (Exception e){
         }catch (Exception e){
             e.printStackTrace();
             e.printStackTrace();
             return null;
             return null;
@@ -297,7 +305,7 @@ public class BrandServiceImpl implements BrandService {
             return "";
             return "";
         }
         }
         int code = resObj.getInteger("code");
         int code = resObj.getInteger("code");
-        if(code != 0){
+        if(code != 200){
             log.error("调用四维看看失败");
             log.error("调用四维看看失败");
             return "";
             return "";
         }
         }

+ 8 - 4
platform-shop/src/main/java/com/platform/task/SceneStatisticTask.java

@@ -9,16 +9,17 @@ import com.platform.entity.TmTaskLog;
 import com.platform.service.custom.*;
 import com.platform.service.custom.*;
 import com.platform.service.impl.BrandServiceImpl;
 import com.platform.service.impl.BrandServiceImpl;
 import com.platform.service.impl.OrderServiceImpl;
 import com.platform.service.impl.OrderServiceImpl;
-import com.platform.utils.HttpClientUtil;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.ResponseEntity;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.CollectionUtils;
+import org.springframework.web.client.RestTemplate;
 
 
 import java.time.LocalDate;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
@@ -65,6 +66,9 @@ public class SceneStatisticTask {
     @Value("${4dkankan.api.vr.show.host}")
     @Value("${4dkankan.api.vr.show.host}")
     private String openApiUrl;
     private String openApiUrl;
 
 
+   @Autowired
+    private RestTemplate restTemplate;
+
 
 
     /**
     /**
      * 默认是fixedDelay 上一次执行完毕时间后执行下一轮
      * 默认是fixedDelay 上一次执行完毕时间后执行下一轮
@@ -319,9 +323,9 @@ public class SceneStatisticTask {
                 //从商圈API获取店铺下面所有商品的数量
                 //从商圈API获取店铺下面所有商品的数量
                 String shopApiUrl = openApiUrl + "4dage/shop/getGoodsNum?sceneNum=" + brandEntity.getSceneNum();
                 String shopApiUrl = openApiUrl + "4dage/shop/getGoodsNum?sceneNum=" + brandEntity.getSceneNum();
 
 
-                String resultString = HttpClientUtil.doGet(shopApiUrl);
-                log.info("商圈api返回详情:{}", JSON.toJSONString(resultString));
-                JSONObject resObj = JSON.parseObject(resultString, JSONObject.class);
+                ResponseEntity<String> resultString = restTemplate.getForEntity(shopApiUrl,String.class);
+                log.info("商圈api返回详情:{}", resultString.getBody());
+                JSONObject resObj = JSON.parseObject(resultString.getBody(), JSONObject.class);
                 if (null != resObj) {
                 if (null != resObj) {
                     int code = resObj.getInteger("code");
                     int code = resObj.getInteger("code");
                     if (code == 0) {
                     if (code == 0) {

+ 0 - 3
pom.xml

@@ -9,13 +9,10 @@
 
 
     <modules>
     <modules>
         <module>platform-common</module> <!-- 公共模块 -->
         <module>platform-common</module> <!-- 公共模块 -->
-<!--        <module>platform-schedule</module> &lt;!&ndash; 定时任务模块 &ndash;&gt;-->
-        <module>platform-gen</module> <!-- 代码生成器模块 -->
         <module>platform-api</module> <!-- API模块 -->
         <module>platform-api</module> <!-- API模块 -->
         <module>platform-admin</module>
         <module>platform-admin</module>
         <module>platform-shop</module>
         <module>platform-shop</module>
         <module>platform-framework</module>
         <module>platform-framework</module>
-        <module>platform-mp</module><!-- 微信公众号模版 -->
     </modules>
     </modules>
 
 
     <properties>
     <properties>

+ 0 - 30
uni-color-ui/README.md

@@ -1,30 +0,0 @@
-# uni-app-mall
-uni-mall商城参考项目
-
-## Project setup
-```
-yarn install
-```
-
-### Compiles and hot-reloads for development
-```
-yarn run serve
-```
-
-### Compiles and minifies for production
-```
-yarn run build
-```
-
-### Run your tests
-```
-yarn run test
-```
-
-### Lints and fixes files
-```
-yarn run lint
-```
-
-### Customize configuration
-See [Configuration Reference](https://cli.vuejs.org/config/).

+ 0 - 54
uni-color-ui/babel.config.js

@@ -1,54 +0,0 @@
-const plugins = []
-
-if (process.env.UNI_OPT_TREESHAKINGNG) {
-  plugins.push(require('@dcloudio/vue-cli-plugin-uni-optimize/packages/babel-plugin-uni-api/index.js'))
-}
-
-if (process.env.UNI_PLATFORM === 'app-plus' && process.env.UNI_USING_V8) {
-  const path = require('path')
-
-  const isWin = /^win/.test(process.platform)
-
-  const normalizePath = path => (isWin ? path.replace(/\\/g, '/') : path)
-
-  const input = normalizePath(process.env.UNI_INPUT_DIR)
-  try {
-    plugins.push([
-      require('@dcloudio/vue-cli-plugin-hbuilderx/packages/babel-plugin-console'),
-      {
-        file (file) {
-          file = normalizePath(file)
-          if (file.indexOf(input) === 0) {
-            return path.relative(input, file)
-          }
-          return false
-        }
-      }
-    ])
-  } catch (e) {}
-}
-
-process.UNI_LIBRARIES = process.UNI_LIBRARIES || ['@dcloudio/uni-ui']
-process.UNI_LIBRARIES.forEach(libraryName => {
-  plugins.push([
-    'import',
-    {
-      'libraryName': libraryName,
-      'customName': (name) => {
-        return `${libraryName}/lib/${name}/${name}`
-      }
-    }
-  ])
-})
-module.exports = {
-  presets: [
-    [
-      '@vue/app',
-      {
-        modules: 'commonjs',
-        useBuiltIns: process.env.UNI_PLATFORM === 'h5' ? 'usage' : 'entry'
-      }
-    ]
-  ],
-  plugins
-}

+ 0 - 68
uni-color-ui/package.json

@@ -1,68 +0,0 @@
-{
-  "name": "uni-app-mall",
-  "version": "0.1.0",
-  "private": true,
-  "scripts": {
-    "serve": "npm run dev:h5",
-    "build": "npm run build:h5",
-    "build:app-plus": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build",
-    "build:custom": "cross-env NODE_ENV=production uniapp-cli custom",
-    "build:h5": "cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build",
-    "build:mp-alipay": "cross-env NODE_ENV=production UNI_PLATFORM=mp-alipay vue-cli-service uni-build",
-    "build:mp-baidu": "cross-env NODE_ENV=production UNI_PLATFORM=mp-baidu vue-cli-service uni-build",
-    "build:mp-qq": "cross-env NODE_ENV=production UNI_PLATFORM=mp-qq vue-cli-service uni-build",
-    "build:mp-toutiao": "cross-env NODE_ENV=production UNI_PLATFORM=mp-toutiao vue-cli-service uni-build",
-    "build:mp-weixin": "cross-env NODE_ENV=production UNI_PLATFORM=mp-weixin vue-cli-service uni-build",
-    "dev:app-plus": "cross-env NODE_ENV=development UNI_PLATFORM=app-plus vue-cli-service uni-build --watch",
-    "dev:custom": "cross-env NODE_ENV=development uniapp-cli custom",
-    "dev:h5": "cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve",
-    "dev:mp-alipay": "cross-env NODE_ENV=development UNI_PLATFORM=mp-alipay vue-cli-service uni-build --watch",
-    "dev:mp-baidu": "cross-env NODE_ENV=development UNI_PLATFORM=mp-baidu vue-cli-service uni-build --watch",
-    "dev:mp-qq": "cross-env NODE_ENV=development UNI_PLATFORM=mp-qq vue-cli-service uni-build --watch",
-    "dev:mp-toutiao": "cross-env NODE_ENV=development UNI_PLATFORM=mp-toutiao vue-cli-service uni-build --watch",
-    "dev:mp-weixin": "cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch",
-    "info": "node node_modules/@dcloudio/vue-cli-plugin-uni/commands/info.js"
-  },
-  "dependencies": {
-    "@dcloudio/uni-app-plus": "*",
-    "@dcloudio/uni-h5": "*",
-    "@dcloudio/uni-helper-json": "*",
-    "@dcloudio/uni-mp-alipay": "*",
-    "@dcloudio/uni-mp-baidu": "*",
-    "@dcloudio/uni-mp-qq": "*",
-    "@dcloudio/uni-mp-toutiao": "*",
-    "@dcloudio/uni-mp-weixin": "*",
-    "@dcloudio/uni-stat": "*",
-    "flyio": "^0.6.2",
-    "regenerator-runtime": "^0.12.1",
-    "vue": "^2.6.10",
-    "vuex": "^3.0.1"
-  },
-  "devDependencies": {
-    "@dcloudio/uni-cli-shared": "*",
-    "@dcloudio/uni-template-compiler": "*",
-    "@dcloudio/vue-cli-plugin-hbuilderx": "latest",
-    "@dcloudio/vue-cli-plugin-uni": "latest",
-    "@dcloudio/vue-cli-plugin-uni-optimize": "latest",
-    "@dcloudio/webpack-uni-mp-loader": "*",
-    "@dcloudio/webpack-uni-pages-loader": "*",
-    "@types/html5plus": "*",
-    "@types/uni-app": "*",
-    "@vue/cli-plugin-babel": "3.5.1",
-    "@vue/cli-service": "^3.11.0",
-    "babel-plugin-import": "^1.11.0",
-    "mini-types": "*",
-    "miniprogram-api-typings": "^2.8.0-2",
-    "node-sass": "^4.11.0",
-    "postcss-comment": "^2.0.0",
-    "sass-loader": "^7.1.0",
-    "vue-template-compiler": "^2.6.10"
-  },
-  "browserslist": [
-    "Android >= 4.4",
-    "ios >= 8"
-  ],
-  "uni-app": {
-    "scripts": {}
-  }
-}

+ 0 - 10
uni-color-ui/postcss.config.js

@@ -1,10 +0,0 @@
-module.exports = {
-  parser: require('postcss-comment'),
-  plugins: [
-    require('postcss-import'),
-    require('autoprefixer')({
-      remove: process.env.UNI_PLATFORM !== 'h5'
-    }),
-    require('@dcloudio/vue-cli-plugin-uni/packages/postcss')
-  ]
-}

+ 0 - 28
uni-color-ui/public/index.html

@@ -1,28 +0,0 @@
-<!DOCTYPE html>
-<html lang="zh-CN">
-
-    <head>
-        <meta charset="utf-8">
-        <meta http-equiv="X-UA-Compatible" content="IE=edge">
-        <title>
-            <%= htmlWebpackPlugin.options.title %>
-        </title>
-        <script>
-            document.addEventListener('DOMContentLoaded', function() {
-                document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
-            })
-            var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
-            document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
-        </script>
-        <link rel="stylesheet" href="<%= BASE_URL %>static/index.css" />
-    </head>
-
-    <body>
-        <noscript>
-            <strong>Please enable JavaScript to continue.</strong>
-        </noscript>
-        <div id="app"></div>
-        <!-- built files will be auto injected -->
-    </body>
-
-</html>

+ 0 - 250
uni-color-ui/src/App.vue

@@ -1,250 +0,0 @@
-<script>
-	import Vue from 'vue'
-	export default {
-		onLaunch: function() {
-			uni.getSystemInfo({
-				success: function(e) {
-					// #ifndef MP
-					Vue.prototype.StatusBar = e.statusBarHeight;
-					if (e.platform == 'android') {
-						Vue.prototype.CustomBar = e.statusBarHeight + 50;
-					} else {
-						Vue.prototype.CustomBar = e.statusBarHeight + 45;
-					};
-					// #endif
-
-					// #ifdef MP-WEIXIN
-					Vue.prototype.StatusBar = e.statusBarHeight;
-					let custom = wx.getMenuButtonBoundingClientRect();
-					Vue.prototype.Custom = custom;
-					Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
-					// #endif
-
-					// #ifdef MP-ALIPAY
-					Vue.prototype.StatusBar = e.statusBarHeight;
-					Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
-					// #endif
-				}
-			})
-
-			Vue.prototype.ColorList = [{
-					title: '嫣红',
-					name: 'red',
-					color: '#e54d42'
-				},
-				{
-					title: '桔橙',
-					name: 'orange',
-					color: '#f37b1d'
-				},
-				{
-					title: '明黄',
-					name: 'yellow',
-					color: '#fbbd08'
-				},
-				{
-					title: '橄榄',
-					name: 'olive',
-					color: '#8dc63f'
-				},
-				{
-					title: '森绿',
-					name: 'green',
-					color: '#39b54a'
-				},
-				{
-					title: '天青',
-					name: 'cyan',
-					color: '#1cbbb4'
-				},
-				{
-					title: '海蓝',
-					name: 'blue',
-					color: '#0081ff'
-				},
-				{
-					title: '姹紫',
-					name: 'purple',
-					color: '#6739b6'
-				},
-				{
-					title: '木槿',
-					name: 'mauve',
-					color: '#9c26b0'
-				},
-				{
-					title: '桃粉',
-					name: 'pink',
-					color: '#e03997'
-				},
-				{
-					title: '棕褐',
-					name: 'brown',
-					color: '#a5673f'
-				},
-				{
-					title: '玄灰',
-					name: 'grey',
-					color: '#8799a3'
-				},
-				{
-					title: '草灰',
-					name: 'gray',
-					color: '#aaaaaa'
-				},
-				{
-					title: '墨黑',
-					name: 'black',
-					color: '#333333'
-				},
-				{
-					title: '雅白',
-					name: 'white',
-					color: '#ffffff'
-				},
-			]
-
-		},
-		onShow: function() {
-			console.log('App Show')
-		},
-		onHide: function() {
-			console.log('App Hide')
-		}
-
-	}
-</script>
-
-<style>
-	@import "colorui/main.css";
-	@import "colorui/icon.css";
-
-	.nav-list {
-		display: flex;
-		flex-wrap: wrap;
-		padding: 0px 40upx 0px;
-		justify-content: space-between;
-	}
-
-	.nav-li {
-		padding: 30upx;
-		border-radius: 12upx;
-		width: 45%;
-		margin: 0 2.5% 40upx;
-		background-image: url(https://platform-wxmall.oss-cn-beijing.aliyuncs.com/uni-app-mall/cc3b1807-c684-4b83-8f80-80e5b8a6b975.png);
-		background-size: cover;
-		background-position: center;
-		position: relative;
-		z-index: 1;
-	}
-
-	.nav-li::after {
-		content: "";
-		position: absolute;
-		z-index: -1;
-		background-color: inherit;
-		width: 100%;
-		height: 100%;
-		left: 0;
-		bottom: -10%;
-		border-radius: 10upx;
-		opacity: 0.2;
-		transform: scale(0.9, 0.9);
-	}
-
-	.nav-li.cur {
-		color: #fff;
-		background: rgb(94, 185, 94);
-		box-shadow: 4upx 4upx 6upx rgba(94, 185, 94, 0.4);
-	}
-
-	.nav-title {
-		font-size: 32upx;
-		font-weight: 300;
-	}
-
-	.nav-title::first-letter {
-		font-size: 40upx;
-		margin-right: 4upx;
-	}
-
-	.nav-name {
-		font-size: 28upx;
-		text-transform: Capitalize;
-		margin-top: 20upx;
-		position: relative;
-	}
-
-	.nav-name::before {
-		content: "";
-		position: absolute;
-		display: block;
-		width: 40upx;
-		height: 6upx;
-		background: #fff;
-		bottom: 0;
-		right: 0;
-		opacity: 0.5;
-	}
-
-	.nav-name::after {
-		content: "";
-		position: absolute;
-		display: block;
-		width: 100upx;
-		height: 1px;
-		background: #fff;
-		bottom: 0;
-		right: 40upx;
-		opacity: 0.3;
-	}
-
-	.nav-name::first-letter {
-		font-weight: bold;
-		font-size: 36upx;
-		margin-right: 1px;
-	}
-
-	.nav-li text {
-		position: absolute;
-		right: 30upx;
-		top: 30upx;
-		font-size: 52upx;
-		width: 60upx;
-		height: 60upx;
-		text-align: center;
-		line-height: 60upx;
-	}
-
-	.text-light {
-		font-weight: 300;
-	}
-
-	@keyframes show {
-		0% {
-			transform: translateY(-50px);
-		}
-
-		60% {
-			transform: translateY(40upx);
-		}
-
-		100% {
-			transform: translateY(0px);
-		}
-	}
-
-	@-webkit-keyframes show {
-		0% {
-			transform: translateY(-50px);
-		}
-
-		60% {
-			transform: translateY(40upx);
-		}
-
-		100% {
-			transform: translateY(0px);
-		}
-	}
-</style>

+ 0 - 144
uni-color-ui/src/Readme.md

@@ -1,144 +0,0 @@
-<p style="text-align: center;"><img src="https://image.weilanwl.com/uni/UniAppReadme.jpg" alt="ColorUI简介"></img></p>
-
-## 前言
-ColorUI是一个css库!!!在你引入样式后可以根据class来调用组件,一些含有交互的操作我也有简单写,可以为你开发提供一些思路。插件市场版本如果和更新日志不一样,请移步Github下载。有组件需求或者Bug提交也可以移步到issues。
-
-## 交流
-微信群:加入微信群请先添加开发者微信,备注UniApp插件市场。QQ群:240787041 或扫描二维码。
-<p style="text-align: center;"><img src="https://image.weilanwl.com/colorui/githubQrcode.jpg" alt="" style="max-width:100%;" width="748"></p>				  
-
-## 素材
-ColorUI在语雀有个群友共同在维护的知识库,里面有一些群友改的模板和UI素材供开发使用哦!
-[语雀-ColorUI群资源](https://www.yuque.com/colorui)
- 
-## 开始使用
-下载源码解压,复制根目录的 `/colorui` 文件夹到你的根目录
-
-`App.vue` 引入关键Css `main.css` `icon.css`
-```
-<style>
-    @import "colorui/main.css";
-	@import "colorui/icon.css";
-	@import "app.css"; /* 你的项目css */
-	....
-</style>
-```
-
-------
-
-## 使用自定义导航栏
-导航栏作为常用组件有做简单封装,当然你也可以直接复制代码结构自己修改,达到个性化目的。
-
-`App.vue` 获得系统信息
-```
-onLaunch: function() {
-	uni.getSystemInfo({
-		success: function(e) {
-			// #ifndef MP
-			Vue.prototype.StatusBar = e.statusBarHeight;
-			if (e.platform == 'android') {
-				Vue.prototype.CustomBar = e.statusBarHeight + 50;
-			} else {
-				Vue.prototype.CustomBar = e.statusBarHeight + 45;
-			};
-			// #endif
-			// #ifdef MP-WEIXIN
-			Vue.prototype.StatusBar = e.statusBarHeight;
-			let custom = wx.getMenuButtonBoundingClientRect();
-			Vue.prototype.Custom = custom;
-			Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
-			// #endif		
-			// #ifdef MP-ALIPAY
-			Vue.prototype.StatusBar = e.statusBarHeight;
-			Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
-			// #endif
-		}
-	})
-},
-```
-
-`pages.json` 配置取消系统导航栏
-```
-"globalStyle": {
-	"navigationStyle": "custom"
-},
-```
-复制代码结构可以直接使用,注意全局变量的获取。
-
-使用封装,在`main.js` 引入 `cu-custom` 组件。
-```
-import cuCustom from './colorui/components/cu-custom.vue'
-Vue.component('cu-custom',cuCustom)
-```
-
-`page.vue` 页面可以直接调用了
-```
-<cu-custom bgColor="bg-gradual-blue" :isBack="true">
-	<block slot="backText">返回</block>
-	<block slot="content">导航栏</block>
-</cu-custom>
-```
-| 参数       | 作用   |类型    |  默认值 |
-| --------   | -----:  |-----:  | :----:  |
-| bgColor    | 背景颜色类名 |String  |   ''    |
-| isBack     | 是否开启返回 | Boolean |   false |
-| bgImage    | 背景图片路径 | String  |  ''     |
-
-| slot块       | 作用   |
-| --------   | -----:  |
-| backText    | 返回时的文字 | 
-| content     | 中间区域 | 
-| right    | 右侧区域(小程序端可使用范围很窄!)  | 
-
-
-------
-
-
-## 使用自定义Tabbar
-这部分暂时没有封装,思路可以参考下我的源码,原理是一个主页面引入多个页面,在主页面进行切换显示。这样可以解决切换时闪烁的问题。
-
-
-------
-
-
-## 更新日志
-
- * 2019年4月25日 v2.1.6
-    *  删除var变量 向下兼容安卓APP
-	*  优化单选等表单控件
-
- * 2019年4月25日 v2.1.5
-    *  优化图片上传
-    *  优化一些点击区域过小
-    *  优化图标旋转
-    *  优化demo显示
-    *  优化阴影
-    *  修复支付宝小程序编译出错
-
- * 2019年4月14日 v2.1.4
-    *  新增多种阴影
-	*  修复一些var属性的错误
-	*  修复轮播图控制点隐藏不了
-	*  修改图标类名
-	*  修复表单组件里上传图片 ios没有图片显示问题
-
- 
- * 2019年4月01日 v2.1.3
-    *  优化代码,支持支付宝小程序
-	*  textarea 样式还原
-
- * 2019年3月28日 v2.1.2
-	*  修复列表组件样式
-	*  优化主样式代码
-
- * 2019年3月27日 v2.1.1
-    *  新增多种扩展
-    *  优化堆叠轮播图
-    *  优化消息列表
-	*  优化导航栏的封装
-	*  修复卡片评论错位(3月27日16:32:17)
-
-* 2019年3月25日 v2.1.0
-    *  完成元素,组件移植
-	*  icon文件更改名称,避免图标冲突
-	*  针对不同端口做了优化

+ 0 - 184
uni-color-ui/src/colorui/animation.css

@@ -1,184 +0,0 @@
-/* 
-  Animation 微动画  
-  基于ColorUI组建库的动画模块 by 文晓港 2019年3月26日19:52:28
- */
-
-/* css 滤镜 控制黑白底色gif的 */
-.gif-black{  
-  mix-blend-mode: screen;  
-}
-.gif-white{  
-  mix-blend-mode: multiply; 
-}
-
-
-/* Animation css */
-[class*=animation-] {
-    animation-duration: .5s;
-    animation-timing-function: ease-out;
-    animation-fill-mode: both
-}
-
-.animation-fade {
-    animation-name: fade;
-    animation-duration: .8s;
-    animation-timing-function: linear
-}
-
-.animation-scale-up {
-    animation-name: scale-up
-}
-
-.animation-scale-down {
-    animation-name: scale-down
-}
-
-.animation-slide-top {
-    animation-name: slide-top
-}
-
-.animation-slide-bottom {
-    animation-name: slide-bottom
-}
-
-.animation-slide-left {
-    animation-name: slide-left
-}
-
-.animation-slide-right {
-    animation-name: slide-right
-}
-
-.animation-shake {
-    animation-name: shake
-}
-
-.animation-reverse {
-    animation-direction: reverse
-}
-
-@keyframes fade {
-    0% {
-        opacity: 0
-    }
-
-    100% {
-        opacity: 1
-    }
-}
-
-@keyframes scale-up {
-    0% {
-        opacity: 0;
-        transform: scale(.2)
-    }
-
-    100% {
-        opacity: 1;
-        transform: scale(1)
-    }
-}
-
-@keyframes scale-down {
-    0% {
-        opacity: 0;
-        transform: scale(1.8)
-    }
-
-    100% {
-        opacity: 1;
-        transform: scale(1)
-    }
-}
-
-@keyframes slide-top {
-    0% {
-        opacity: 0;
-        transform: translateY(-100%)
-    }
-
-    100% {
-        opacity: 1;
-        transform: translateY(0)
-    }
-}
-
-@keyframes slide-bottom {
-    0% {
-        opacity: 0;
-        transform: translateY(100%)
-    }
-
-    100% {
-        opacity: 1;
-        transform: translateY(0)
-    }
-}
-
-@keyframes shake {
-
-    0%,
-    100% {
-        transform: translateX(0)
-    }
-
-    10% {
-        transform: translateX(-9px)
-    }
-
-    20% {
-        transform: translateX(8px)
-    }
-
-    30% {
-        transform: translateX(-7px)
-    }
-
-    40% {
-        transform: translateX(6px)
-    }
-
-    50% {
-        transform: translateX(-5px)
-    }
-
-    60% {
-        transform: translateX(4px)
-    }
-
-    70% {
-        transform: translateX(-3px)
-    }
-
-    80% {
-        transform: translateX(2px)
-    }
-
-    90% {
-        transform: translateX(-1px)
-    }
-}
-
-@keyframes slide-left {
-    0% {
-        opacity: 0;
-        transform: translateX(-100%)
-    }
-
-    100% {
-        opacity: 1;
-        transform: translateX(0)
-    }
-}
-
-@keyframes slide-right {
-    0% {
-        opacity: 0;
-        transform: translateX(100%)
-    }
-
-    100% {
-        opacity: 1;
-        transform: translateX(0)
-    }
-}

+ 0 - 69
uni-color-ui/src/colorui/components/cu-custom.vue

@@ -1,69 +0,0 @@
-<template>
-	<view>
-		<view class="cu-custom" :style="[{height:CustomBar + 'px'}]">
-			<view class="cu-bar fixed" :style="style" :class="[bgImage!=''?'none-bg text-white bg-img':'',bgColor]">
-				<view class="action" @tap="BackPage" v-if="isBack">
-					<text class="cuIcon-back"></text>
-					<slot name="backText"></slot>
-				</view>
-				<view class="content" :style="[{top:StatusBar + 'px'}]">
-					<slot name="content"></slot>
-				</view>
-				<slot name="right"></slot>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				StatusBar: this.StatusBar,
-				CustomBar: this.CustomBar
-			};
-		},
-		name: 'cu-custom',
-		computed: {
-			style() {
-				var StatusBar= this.StatusBar;
-				var CustomBar= this.CustomBar;
-				var bgImage = this.bgImage;
-				var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`;
-				if (this.bgImage) {
-					style = `${style}background-image:url(${bgImage});`;
-				}
-				return style
-			}
-		},
-		props: {
-			bgColor: {
-				type: String,
-				default: ''
-			},
-			isBack: {
-				type: [Boolean, String],
-				default: false
-			},
-			bgImage: {
-				type: String,
-				default: ''
-			},
-		},
-		methods: {
-			BackPage() {
-				if (getCurrentPages().length < 2 && 'undefined' !== typeof __wxConfig) {
-					let url = '/' + __wxConfig.pages[0]
-					return uni.redirectTo({url})
-				}
-				uni.navigateBack({
-					delta: 1
-				});
-			}
-		}
-	}
-</script>
-
-<style>
-
-</style>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 1226
uni-color-ui/src/colorui/icon.css


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 3912
uni-color-ui/src/colorui/main.css


+ 0 - 28
uni-color-ui/src/main.js

@@ -1,28 +0,0 @@
-import Vue from 'vue'
-import App from './App'
-
-import basics from './pages/basics/home.vue'
-Vue.component('basics',basics)
-
-import components from './pages/component/home.vue'
-Vue.component('components',components)
-
-import plugin from './pages/plugin/home.vue'
-Vue.component('plugin',plugin)
-
-import cuCustom from './colorui/components/cu-custom.vue'
-Vue.component('cu-custom',cuCustom)
-
-Vue.config.productionTip = false
-
-App.mpType = 'app'
-
-const app = new Vue({
-    ...App
-})
-app.$mount()
-
- 
-
-
-

+ 0 - 61
uni-color-ui/src/manifest.json

@@ -1,61 +0,0 @@
-{
-    "name" : "ColorUi for UniApp",
-    "appid" : "",
-    "description" : "",
-    "versionName" : "ColorUi for UniApp 2.1.4",
-    "versionCode" : 214,
-    "transformPx" : false,
-    "app-plus" : {
-        /* 5+App特有相关 */
-        "modules" : {},
-        /* 模块配置 */
-        "distribute" : {
-            /* 应用发布信息 */
-            "android" : {
-                /* android打包配置 */
-                "permissions" : [
-                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
-                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
-                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
-                    "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
-                    "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
-                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
-                    "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
-                    "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
-                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
-                    "<uses-feature android:name=\"android.hardware.camera\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
-                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
-                ]
-            },
-            "ios" : {},
-            /* ios打包配置 */
-            "sdkConfigs" : {}
-        }
-    },
-    /* SDK配置 */
-    "quickapp" : {},
-    /* 快应用特有相关 */
-    "mp-weixin" : {
-        /* 小程序特有相关 */
-        "appid" : "",
-        "setting" : {
-            "urlCheck" : false,
-            "es6" : true
-        }
-    },
-    "h5" : {
-        "title" : "ColorUi for UniApp",
-        "domain" : "demo.color-ui.com"
-    }
-}

+ 0 - 127
uni-color-ui/src/pages.json

@@ -1,127 +0,0 @@
-{
-	"pages": [
-		//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
-		{
-			"path": "pages/index/index",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/layout",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/background",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/text",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/icon",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/button",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/design",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/tag",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/avatar",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/progress",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/shadow",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/loading",
-			"style": {}
-		},
-		{
-			"path": "pages/component/bar",
-			"style": {}
-		},
-		{
-			"path": "pages/component/nav",
-			"style": {}
-		},
-		{
-			"path": "pages/component/list",
-			"style": {}
-		},
-		{
-			"path": "pages/component/card",
-			"style": {}
-		},
-		{
-			"path": "pages/component/form",
-			"style": {}
-		},
-		{
-			"path": "pages/component/timeline",
-			"style": {}
-		},
-		{
-			"path": "pages/component/chat",
-			"style": {}
-		},
-		{
-			"path": "pages/component/swiper",
-			"style": {}
-		},
-		{
-			"path": "pages/component/modal",
-			"style": {}
-		},
-		{
-			"path": "pages/component/steps",
-			"style": {}
-		}, {
-			"path": "pages/plugin/indexes",
-			"style": {}
-		}, {
-			"path": "pages/plugin/animation",
-			"style": {}
-		}, {
-			"path": "pages/plugin/drawer",
-			"style": {}
-		}, {
-			"path": "pages/plugin/verticalnav",
-			"style": {}
-		}
-	],
-	"globalStyle": {
-		"mp-alipay": {
-			/* 支付宝小程序特有相关 */
-			"transparentTitle": "always",
-			"allowsBounceVertical": "NO"
-		},
-		"navigationBarBackgroundColor": "#0081ff",
-		"navigationBarTitleText": "ColorUi for UniApp",
-		"navigationStyle": "custom",
-		"navigationBarTextStyle": "white"
-	},
-	"usingComponts": true,
-		"condition": { //模式配置,仅开发期间生效
-		"current": 0, //当前激活的模式(list 的索引项)
-		"list": [{
-				"name": "表单", //模式名称
-				"path": "pages/component/form", //启动页面
-				"query": "" //启动参数
-			}
-		]
-	}
-
-}

+ 0 - 108
uni-color-ui/src/pages/basics/avatar.vue

@@ -1,108 +0,0 @@
-<template>
-	<view>
-		<cu-custom bgColor="bg-gradual-blue" :isBack="true"><block slot="backText">返回</block><block slot="content">头像</block></cu-custom>
-		<view class="cu-bar bg-white">
-			<view class="action">
-				<text class="cuIcon-title text-blue"></text>头像形状
-			</view>
-		</view>
-		<view class="padding">
-			<view class="cu-avatar round" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg)"></view>
-			<view class="cu-avatar radius margin-left" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg);"></view>
-		</view>
-		<view class="cu-bar bg-white margin-top">
-			<view class="action">
-				<text class="cuIcon-title text-blue"></text>头像尺寸
-			</view>
-		</view>
-		<view class="padding">
-			<view class="cu-avatar sm round margin-left" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg)"></view>
-			<view class="cu-avatar round margin-left" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg);"></view>
-			<view class="cu-avatar lg round margin-left" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big25002.jpg);"></view>
-			<view class="cu-avatar xl round margin-left" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg);"></view>
-		</view>
-		<view class="padding">
-			<view class="cu-avatar sm round margin-left bg-red"> A</view>
-			<view class="cu-avatar round margin-left bg-red">B</view>
-			<view class="cu-avatar lg round margin-left bg-red">C</view>
-			<view class="cu-avatar xl round margin-left bg-red">D</view>
-		</view>
-		<view class="padding">
-			<view class="cu-avatar sm round margin-left bg-red"> 蔚</view>
-			<view class="cu-avatar round margin-left bg-red">蓝</view>
-			<view class="cu-avatar lg round margin-left bg-red">
-				<text>wl</text>
-			</view>
-			<view class="cu-avatar xl round margin-left bg-red">
-				<text class="avatar-text">网络</text>
-			</view>
-		</view>
-		<view class="cu-bar bg-white margin-top">
-			<view class="action">
-				<text class="cuIcon-title text-blue"></text>内嵌文字(图标)
-			</view>
-		</view>
-		<view class="padding">
-			<view class="cu-avatar radius">
-				<text class="cuIcon-people"></text>
-			</view>
-			<view class="cu-avatar radius margin-left">
-				<text>港</text>
-			</view>
-		</view>
-
-		<view class="cu-bar bg-white margin-top">
-			<view class="action">
-				<text class="cuIcon-title text-blue"></text>头像颜色
-			</view>
-		</view>
-		<view class="padding-sm">
-			<view class="cu-avatar round lg margin-xs" :class="'bg-' + item.name" v-for="(item,index) in ColorList" :key="index">
-				<text class="avatar-text">{{item.name}}</text>
-			</view>
-		</view>
-		<view class="cu-bar bg-white margin-top">
-			<view class="action">
-				<text class="cuIcon-title text-blue"></text>头像组
-			</view>
-		</view>
-		<view class="padding">
-			<view class="cu-avatar-group">
-				<view class="cu-avatar round lg" v-for="(item,index) in avatar" :key="index" :style="[{ backgroundImage:'url(' + avatar[index] + ')' }]"></view>
-			</view>
-		</view>
-
-		<view class="cu-bar bg-white margin-top">
-			<view class="action">
-				<text class="cuIcon-title text-blue"></text>头像标签
-			</view>
-		</view>
-		<view class="padding">
-			<view class="cu-avatar round lg margin-left"  v-for="(item,index) in avatar" :key="index" :style="[{ backgroundImage:'url(' + avatar[index] + ')' }]">
-				<view class="cu-tag badge" :class="index%2==0?'cuIcon-female bg-pink':'cuIcon-male bg-blue'"></view>
-			</view>
-		</view>
-
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				ColorList: this.ColorList,
-				avatar: [
-					'https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg',
-					'https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg',
-					'https://ossweb-img.qq.com/images/lol/web201310/skin/big25002.jpg',
-					'https://ossweb-img.qq.com/images/lol/web201310/skin/big91012.jpg'
-				],
-
-			};
-		}
-	}
-</script>
-
-<style>
-
-</style>

+ 0 - 141
uni-color-ui/src/pages/basics/background.vue

@@ -1,141 +0,0 @@
-<template>
-	<view>
-		<cu-custom bgColor="bg-gradual-blue" :isBack="true">
-			<block slot="backText">返回</block>
-			<block slot="content">背景</block>
-		</cu-custom>
-		<view class="cu-bar bg-white solid-bottom">
-			<view class="action">
-				<text class='cuIcon-title text-blue'></text>深色背景
-			</view>
-		</view>
-		<view class="grid col-3 padding-sm">
-			<view class="padding-sm" v-for="(item,index) in ColorList" :key="index">
-				<view class="padding radius text-center shadow-blur" :class="'bg-' + item.name">
-					<view class="text-lg">{{item.title}}</view>
-					<view class="margin-top-sm text-Abc">{{item.name}}</view>
-				</view>
-			</view>
-		</view>
-		<view class="cu-bar bg-white solid-bottom">
-			<view class="action">
-				<text class="cuIcon-title text-blue"></text>淡色背景
-			</view>
-		</view>
-		<view class="grid col-3 bg-white padding-sm">
-			<view class="padding-sm" v-for="(item,index) in ColorList" :key="index" v-if="index<12">
-				<view class="padding radius text-center light" :class="'bg-' + item.name">
-					<view class="text-lg">{{item.title}}</view>
-					<view class="margin-top-sm text-Abc">{{item.name}}</view>
-				</view>
-			</view>
-		</view>
-		<view class="cu-bar bg-white solid-bottom margin-top">
-			<view class="action">
-				<text class="cuIcon-title text-blue"></text>渐变背景
-			</view>
-		</view>
-		<view class="grid col-2 padding-sm">
-			<view class="padding-sm">
-				<view class="bg-gradual-red padding radius text-center shadow-blur">
-					<view class="text-lg">魅红</view>
-					<view class="margin-top-sm text-Abc">#f43f3b - #ec008c</view>
-				</view>
-			</view>
-			<view class="padding-sm">
-				<view class="bg-gradual-orange padding radius text-center shadow-blur">
-					<view class="text-lg">鎏金</view>
-					<view class="margin-top-sm text-Abc">#ff9700 - #ed1c24</view>
-				</view>
-			</view>
-			<view class="padding-sm">
-				<view class="bg-gradual-green padding radius text-center shadow-blur">
-					<view class="text-lg">翠柳</view>
-					<view class="margin-top-sm text-Abc">#39b54a - #8dc63f</view>
-				</view>
-			</view>
-			<view class="padding-sm">
-				<view class="bg-gradual-blue padding radius text-center shadow-blur">
-					<view class="text-lg">靛青</view>
-					<view class="margin-top-sm text-Abc">#0081ff - #1cbbb4</view>
-				</view>
-			</view>
-			<view class="padding-sm">
-				<view class="bg-gradual-purple padding radius text-center shadow-blur">
-					<view class="text-lg">惑紫</view>
-					<view class="margin-top-sm text-Abc">#9000ff - #5e00ff</view>
-				</view>
-			</view>
-			<view class="padding-sm">
-				<view class="bg-gradual-pink padding radius text-center shadow-blur">
-					<view class="text-lg">霞彩</view>
-					<view class="margin-top-sm text-Abc">#ec008c - #6739b6</view>
-				</view>
-			</view>
-		</view>
-		<view class="cu-bar bg-white margin-top">
-			<view class="action">
-				<text class="cuIcon-title text-blue"></text>图片背景
-			</view>
-		</view>
-		<view class="bg-img bg-mask flex align-center" style="background-image: url('https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg');height: 414upx;">
-			<view class="padding-xl text-white">
-				<view class="padding-xs text-xxl text-bold">
-					钢铁之翼
-				</view>
-				<view class="padding-xs text-lg">
-					Only the guilty need fear me.
-				</view>
-			</view>
-		</view>
-<!-- 		<view class="cu-bar bg-white margin-top">
-			<view class="action">
-				<text class="cuIcon-title text-blue"></text>视频背景
-			</view>
-		</view>
-		<view class="bg-video bg-mask flex align-center" style="height: 422upx;">
-			<video src="https://yz.lol.qq.com/v1/assets/videos/aatrox-splashvideo.webm" autoplay loop muted :show-play-btn="false"
-			 :controls="false" objectFit="cover"></video>
-			<cover-view class="padding-xl text-white ">
-				<cover-view class="padding-xs  text-xxl text-bold">
-					暗裔剑魔
-				</cover-view>
-				<cover-view class="padding-xs">
-					我必须连同希望一起毁坏……
-				</cover-view>
-			</cover-view>
-		</view> -->
-		
-		<view class="cu-bar bg-white margin-top">
-			<view class="action">
-				<text class="cuIcon-title text-blue"></text>透明背景(文字层)
-			</view>
-		</view>
-		<view class="grid col-2">
-			<view class="bg-img padding-bottom-xl" style="background-image: url('https://ossweb-img.qq.com/images/lol/web201310/skin/big10007.jpg');height: 207upx;">
-				<view class="bg-shadeTop padding padding-bottom-xl">
-					上面开始
-				</view>
-			</view>
-			<view class="bg-img padding-top-xl flex align-end" style="background-image: url('https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg');height: 207upx;">
-				<view class="bg-shadeBottom padding padding-top-xl flex-sub">
-					下面开始
-				</view>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				ColorList: this.ColorList,
-			};
-		}
-	}
-</script>
-
-<style>
-
-</style>

+ 0 - 0
uni-color-ui/src/pages/basics/button.vue


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio