Bläddra i källkod

删除多余的东西

tuonina 5 år sedan
förälder
incheckning
9b543894e2
100 ändrade filer med 3 tillägg och 4302 borttagningar
  1. 0 6
      cloud-bus/README.md
  2. 0 14
      cloud-bus/build.gradle
  3. 0 10
      cloud-bus/src/main/java/cn/gygxzc/envir/bus/QueueName.java
  4. 0 53
      cloud-bus/src/main/java/cn/gygxzc/envir/bus/RabbitConfiguration.java
  5. 0 90
      cloud-bus/src/main/java/cn/gygxzc/envir/bus/entity/PushModel.java
  6. 0 19
      cloud-bus/src/main/java/cn/gygxzc/envir/bus/mail/IFeignMailSender.java
  7. 0 12
      cloud-bus/src/main/java/cn/gygxzc/envir/bus/mail/IMailBusSender.java
  8. 0 27
      cloud-bus/src/main/java/cn/gygxzc/envir/bus/mail/impl/MailBusSenderImpl.java
  9. 0 17
      cloud-bus/src/main/java/cn/gygxzc/envir/bus/message/IMessagePusher.java
  10. 0 32
      cloud-bus/src/main/java/cn/gygxzc/envir/bus/message/impl/MessagePusher.java
  11. 0 13
      cloud-bus/src/main/java/cn/gygxzc/tina/cloud/bus/constant/QueueName.java
  12. 0 27
      cloud-bus/src/main/java/cn/gygxzc/tina/cloud/bus/framweork/bean/FrameworkBean.java
  13. 0 31
      cloud-bus/src/main/java/cn/gygxzc/tina/cloud/bus/framweork/receiver/FrameworkReceiver.java
  14. 0 22
      cloud-bus/src/main/java/cn/gygxzc/tina/cloud/bus/framweork/receiver/LoggerReceiver.java
  15. 0 36
      cloud-bus/src/main/java/cn/gygxzc/tina/cloud/bus/messager/bean/MessageBean.java
  16. 0 15
      cloud-bus/src/main/java/cn/gygxzc/tina/cloud/bus/messager/sender/IMessagerSender.java
  17. 0 42
      cloud-bus/src/main/java/cn/gygxzc/tina/cloud/bus/messager/sender/impl/MessagerSender.java
  18. 0 26
      cloud-bus/src/main/java/cn/gygxzc/tina/cloud/bus/utils/GsonUtils.java
  19. 0 15
      fastdfs-client/build.gradle
  20. 0 20
      fastdfs-client/src/main/java/cn/gygxzc/cloud/tina/fastdfs/client/EnableFastDFSClient.java
  21. 0 20
      fastdfs-client/src/main/java/cn/gygxzc/cloud/tina/fastdfs/client/FastDFSClientConfiguration.java
  22. 0 60
      fastdfs-client/src/main/java/cn/gygxzc/cloud/tina/fastdfs/client/controller/FdfsDownloadController.java
  23. 0 120
      fastdfs-client/src/main/java/cn/gygxzc/cloud/tina/fastdfs/client/controller/FdfsUploadController.java
  24. 0 32
      fastdfs-client/src/main/java/cn/gygxzc/cloud/tina/fastdfs/client/mata/CommonFileMata.java
  25. 0 42
      fastdfs-client/src/main/java/cn/gygxzc/cloud/tina/fastdfs/client/mata/FailedStorePath.java
  26. 0 28
      fastdfs-client/src/main/java/cn/gygxzc/cloud/tina/fastdfs/client/utils/FileUtils.java
  27. 0 27
      fastdfs-client/src/main/resources/application-fdfs.yml
  28. 0 60
      fastdfs-client/src/test/java/cn/gygxzc/cloud/tina/fdfs/RxJavaTest.java
  29. 0 14
      fastdfs-client/src/test/java/cn/gygxzc/cloud/tina/fdfs/utils/FileUtilsTest.java
  30. 0 6
      settings.gradle
  31. 1 1
      tuon-core/src/main/java/cn/tonyandmoney/tuon/core/session/SessionUtils.java
  32. 0 1
      tuon-core/src/main/kotlin/cn/tonyandmoney/tuon/core/config/CustomWebMvcConfiguration.kt
  33. 1 1
      tuon-qywx/src/main/kotlin/cn/tonyandmoney/tuon/qywx/controller/QywxController.kt
  34. 0 12
      tuon-sign/build.gradle
  35. 0 8
      tuon-sign/src/main/java/cn/tonyandmoney/sign/SignProperties.java
  36. 1 2
      tuon-web/src/main/resources/bootstrap.yml
  37. 0 18
      zen-api/build.gradle
  38. 0 12
      zen-api/src/main/java/cn/gygxzc/envir/biz/dao/Dao.java
  39. 0 27
      zen-api/src/main/java/cn/gygxzc/envir/sys/config/properties/ShiroRedisCacheProperties.java
  40. 0 44
      zen-api/src/main/java/cn/gygxzc/envir/sys/config/properties/ShiroSessionProperties.java
  41. 0 16
      zen-api/src/main/java/cn/gygxzc/envir/test/dao/ITestLogDao.java
  42. 0 22
      zen-api/src/main/java/cn/gygxzc/envir/test/model/TestLog.java
  43. 0 39
      zen-api/src/main/java/cn/gygxzc/envir/test/service/ITestLogService.java
  44. 0 51
      zen-api/src/main/java/cn/gygxzc/envir/test/service/impl/TestLogService.java
  45. 0 8
      zen-api/src/main/kotlin/cn/gygxzc/envir/biz/Biz.kt
  46. 0 8
      zen-api/src/main/kotlin/cn/gygxzc/envir/biz/dao/Dao.kt
  47. 0 9
      zen-api/src/main/kotlin/cn/gygxzc/envir/sys/dto/LoginDto.kt
  48. 0 197
      zen-api/src/main/kotlin/cn/gygxzc/envir/sys/model/CommonFile.java
  49. 0 65
      zen-api/src/main/kotlin/cn/gygxzc/envir/sys/service/IFUserService.kt
  50. 0 33
      zen-api/src/main/kotlin/cn/gygxzc/envir/sys/service/IFileInfoService.kt
  51. 0 23
      zen-api/src/main/kotlin/cn/gygxzc/envir/sys/service/ILoginService.kt
  52. 0 50
      zen-api/src/main/kotlin/cn/gygxzc/envir/utils/Byte2Hex.kt
  53. 0 119
      zen-api/src/main/kotlin/cn/gygxzc/envir/utils/MD5Salt.kt
  54. 0 21
      zen-api/src/main/kotlin/com/gxzc/zen/api/sys/common/DictTypeTree.kt
  55. 0 56
      zen-api/src/main/kotlin/com/gxzc/zen/api/sys/common/MenuTree.kt
  56. 0 40
      zen-api/src/main/kotlin/com/gxzc/zen/api/sys/common/RoleTree.kt
  57. 0 14
      zen-api/src/main/kotlin/com/gxzc/zen/logging/annotation/LogAnnotation.kt
  58. 0 56
      zen-api/src/main/kotlin/com/gxzc/zen/logging/model/LogAuth.kt
  59. 0 55
      zen-api/src/main/kotlin/com/gxzc/zen/logging/model/LogBiz.kt
  60. 0 66
      zen-api/src/main/kotlin/com/gxzc/zen/logging/model/LogDB.kt
  61. 0 86
      zen-api/src/main/kotlin/com/gxzc/zen/logging/model/LogRequest.kt
  62. 0 12
      zen-api/src/main/kotlin/com/gxzc/zen/logging/model/MQLog.kt
  63. 0 18
      zen-api/src/main/resources/mapper/test/TestLogMapper.xml
  64. 0 141
      zen-api/src/main/resources/templates/entity.java.vm
  65. 0 92
      zen-api/src/main/resources/templates/entity.kt.vm
  66. 0 25
      zen-api/src/main/resources/templates/mapper.java.vm
  67. 0 22
      zen-api/src/main/resources/templates/service.java.vm
  68. 0 32
      zen-api/src/main/resources/templates/serviceImpl.java.vm
  69. 0 21
      zen-core/build.gradle
  70. 0 91
      zen-core/src/main/java/cn/gygxzc/envir/core/base/BaseModel.java
  71. 0 191
      zen-core/src/main/java/cn/gygxzc/envir/core/entity/MailEntity.java
  72. 0 12
      zen-core/src/main/java/cn/gygxzc/envir/core/ex/ParamMissException.java
  73. 0 108
      zen-core/src/main/java/cn/gygxzc/envir/core/logger/CoreLoggerEvent.java
  74. 0 12
      zen-core/src/main/java/cn/gygxzc/envir/core/logger/ILoggerSender.java
  75. 0 13
      zen-core/src/main/java/cn/gygxzc/envir/core/logger/IMarkerName.java
  76. 0 175
      zen-core/src/main/java/cn/gygxzc/envir/core/logger/LogMessage.java
  77. 0 51
      zen-core/src/main/java/cn/gygxzc/envir/core/logger/MQAppender.java
  78. 0 87
      zen-core/src/main/java/cn/gygxzc/envir/core/logger/MQAsyncAppender.java
  79. 0 16
      zen-core/src/main/java/cn/gygxzc/envir/core/orm/DataSourceConfiguration.java
  80. 0 126
      zen-core/src/main/java/cn/gygxzc/envir/core/redis/JedisConnectionConfiguration.java
  81. 0 68
      zen-core/src/main/java/cn/gygxzc/envir/core/redis/RedisAutoConfiguration.java
  82. 0 157
      zen-core/src/main/java/cn/gygxzc/envir/core/redis/RedisConnectionConfiguration.java
  83. 0 40
      zen-core/src/main/java/cn/gygxzc/envir/core/utils/ApplicationUtils.java
  84. 0 26
      zen-core/src/main/java/cn/gygxzc/envir/core/utils/GsonUtils.java
  85. 0 26
      zen-core/src/main/java/cn/gygxzc/envir/core/utils/HttpUtils.java
  86. 0 8
      zen-core/src/main/kotlin/cn/gygxzc/envir/core/CoreConst.kt
  87. 0 75
      zen-core/src/main/kotlin/cn/gygxzc/envir/core/caffeine/CaffeineConfiguration.kt
  88. 0 31
      zen-core/src/main/kotlin/cn/gygxzc/envir/core/caffeine/CaffeineProperties.kt
  89. 0 11
      zen-core/src/main/kotlin/cn/gygxzc/envir/core/exceptions/InvalidRequestException.kt
  90. 0 119
      zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/Generator.kt
  91. 0 56
      zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/MybatisPlusConfig.kt
  92. 0 112
      zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/base/IPhysicalMapper.kt
  93. 0 47
      zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/handler/CustomMetaObjectHandler.kt
  94. 0 51
      zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/injector/LogicMoreSqlInjector.kt
  95. 0 28
      zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/injector/enums/SqlMethodCopy.kt
  96. 0 22
      zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/injector/method/Delete.kt
  97. 0 23
      zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/injector/method/DeleteBatchIds.kt
  98. 0 21
      zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/injector/method/DeleteById.kt
  99. 0 20
      zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/injector/method/DeleteByMap.kt
  100. 0 20
      zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/injector/method/SelectById.kt

+ 0 - 6
cloud-bus/README.md

@@ -1,6 +0,0 @@
-# Spring Cloud Bus 消息总线
-服务间消息通知调用。
-
-如果不需要不依赖该包。
-
-用法见里面的代码

+ 0 - 14
cloud-bus/build.gradle

@@ -1,14 +0,0 @@
-
-group 'cn.gygxzc.tina'
-version '1.0'
-
-sourceCompatibility = 1.8
-
-repositories {
-    mavenCentral()
-}
-
-dependencies {
-    compile 'org.springframework.cloud:spring-cloud-starter-stream-rabbit'
-    compile project(":zen-core")
-}

+ 0 - 10
cloud-bus/src/main/java/cn/gygxzc/envir/bus/QueueName.java

@@ -1,10 +0,0 @@
-package cn.gygxzc.envir.bus;
-
-/**
- * @author tuonina
- * @createTime 2019/3/4
- */
-public interface QueueName {
-
-    String EMAIL="Email";
-}

+ 0 - 53
cloud-bus/src/main/java/cn/gygxzc/envir/bus/RabbitConfiguration.java

@@ -1,53 +0,0 @@
-package cn.gygxzc.envir.bus;
-
-import cn.gygxzc.tina.cloud.bus.constant.QueueName;
-import cn.gygxzc.tina.cloud.bus.framweork.receiver.LoggerReceiver;
-import cn.gygxzc.tina.cloud.bus.messager.sender.IMessagerSender;
-import cn.gygxzc.tina.cloud.bus.messager.sender.impl.MessagerSender;
-import org.springframework.amqp.core.AmqpTemplate;
-import org.springframework.amqp.core.Queue;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * Created by niantuo on 2018/9/29.
- * rabbit配置.
- * 暂时对这个不了解,暂时使用自动配置结果
- * 注意分包方式。
- * 只要导入该包,即可自动配置,无需再用注解。
- */
-
-@Configuration
-@ComponentScan("cn.gygxzc.tina.cloud.bus")
-public class RabbitConfiguration {
-
-
-    /***
-     * 这个如果需要使用,改成自己项目的名称
-     * @return 消息队列
-     */
-    @Bean
-    public Queue frameworkQueue() {
-        return new Queue(QueueName.Framework);
-    }
-
-
-    @Bean
-    public IMessagerSender messagerSender(AmqpTemplate template){
-        return new MessagerSender(template);
-    }
-
-
-//    @Bean
-//    public Queue logQueue(){
-//        return  new Queue(QueueName.LOG);
-//    }
-//
-//
-//    @Bean
-//    public LoggerReceiver loggerReceiver(){
-//        return new LoggerReceiver();
-//    }
-
-}

+ 0 - 90
cloud-bus/src/main/java/cn/gygxzc/envir/bus/entity/PushModel.java

@@ -1,90 +0,0 @@
-package cn.gygxzc.envir.bus.entity;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Created by niantuo on 2018/12/17.
- * 消息推送的模型
- * @see   PushModel
- * type 为100 表示群发系统消息。content 应该是富文本。toUserIds 可为null或者是空
- */
-
-public class PushModel {
-
-    public static final int TYPE_SYS=100;//群发的系统消息
-
-    private String content;
-    private int type;
-    private String contentType;
-    private String urls;
-    private String title;
-    private String remark;
-    private List<Long> toUserIds = new ArrayList<>();
-
-    public String getContent() {
-        return content;
-    }
-
-    public void setContent(String content) {
-        this.content = content;
-    }
-
-    public int getType() {
-        return type;
-    }
-
-    public void setType(int type) {
-        this.type = type;
-    }
-
-    public String getContentType() {
-        return contentType;
-    }
-
-    public void setContentType(String contentType) {
-        this.contentType = contentType;
-    }
-
-    public String getUrls() {
-        return urls;
-    }
-
-    public void setUrls(String urls) {
-        this.urls = urls;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-
-    public List<Long> getToUserIds() {
-        return toUserIds;
-    }
-
-    public void setToUserIds(List<Long> toUserIds) {
-        this.toUserIds = toUserIds;
-    }
-
-
-    /**
-     * 这个先随便写点吧,
-     * @return
-     */
-    @Override
-    public String toString() {
-        return String.format("type: %s,content:%s",type,content);
-    }
-}

+ 0 - 19
cloud-bus/src/main/java/cn/gygxzc/envir/bus/mail/IFeignMailSender.java

@@ -1,19 +0,0 @@
-package cn.gygxzc.envir.bus.mail;
-
-import cn.gygxzc.envir.core.entity.MailEntity;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-
-/**
- * 用Feign进行服务间调用方式发送邮件
- *
- * @author tuonina
- * @createTime 2019/3/4
- */
-@FeignClient("msg")
-public interface IFeignMailSender {
-
-    @PostMapping(value = "/mail")
-    void sendMail(@RequestBody MailEntity mail);
-}

+ 0 - 12
cloud-bus/src/main/java/cn/gygxzc/envir/bus/mail/IMailBusSender.java

@@ -1,12 +0,0 @@
-package cn.gygxzc.envir.bus.mail;
-
-import cn.gygxzc.envir.core.entity.MailEntity;
-
-/**
- * @author tuonina
- * @createTime 2019/3/4
- */
-public interface IMailBusSender {
-
-    void sendMail(MailEntity mail);
-}

+ 0 - 27
cloud-bus/src/main/java/cn/gygxzc/envir/bus/mail/impl/MailBusSenderImpl.java

@@ -1,27 +0,0 @@
-package cn.gygxzc.envir.bus.mail.impl;
-
-import cn.gygxzc.envir.bus.QueueName;
-import cn.gygxzc.envir.bus.mail.IMailBusSender;
-import cn.gygxzc.envir.core.entity.MailEntity;
-import org.springframework.amqp.core.AmqpTemplate;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-/**
- * @author tuonina
- * @createTime 2019/3/4
- */
-@Service
-public class MailBusSenderImpl implements IMailBusSender {
-    private final AmqpTemplate template;
-
-    @Autowired
-    public MailBusSenderImpl(AmqpTemplate template) {
-        this.template = template;
-    }
-
-    @Override
-    public void sendMail(MailEntity mail) {
-        template.convertAndSend(QueueName.EMAIL, mail);
-    }
-}

+ 0 - 17
cloud-bus/src/main/java/cn/gygxzc/envir/bus/message/IMessagePusher.java

@@ -1,17 +0,0 @@
-package cn.gygxzc.envir.bus.message;
-
-import cn.gygxzc.envir.bus.entity.PushModel;
-
-import java.util.List;
-
-/**
- * Created by niantuo on 2018/12/17.
- */
-
-public interface IMessagePusher {
-
-    void pushTo(List<Long> userIds, PushModel model);
-
-
-
-}

+ 0 - 32
cloud-bus/src/main/java/cn/gygxzc/envir/bus/message/impl/MessagePusher.java

@@ -1,32 +0,0 @@
-package cn.gygxzc.envir.bus.message.impl;
-
-import cn.gygxzc.envir.bus.entity.PushModel;
-import cn.gygxzc.envir.bus.message.IMessagePusher;
-import cn.gygxzc.tina.cloud.bus.constant.QueueName;
-import cn.gygxzc.tina.cloud.bus.utils.GsonUtils;
-import org.springframework.amqp.core.AmqpTemplate;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * Created by niantuo on 2018/12/17.
- * 消息推送的服务
- */
-@Service
-public class MessagePusher implements IMessagePusher {
-
-    private final AmqpTemplate amqpTemplate;
-
-    @Autowired
-    public MessagePusher(AmqpTemplate amqpTemplate) {
-        this.amqpTemplate = amqpTemplate;
-    }
-
-    @Override
-    public void pushTo(List<Long> userIds, PushModel model) {
-        model.setToUserIds(userIds);
-        amqpTemplate.convertAndSend(QueueName.PUSHER, GsonUtils.toJson(model));
-    }
-}

+ 0 - 13
cloud-bus/src/main/java/cn/gygxzc/tina/cloud/bus/constant/QueueName.java

@@ -1,13 +0,0 @@
-package cn.gygxzc.tina.cloud.bus.constant;
-
-/**
- * Created by niantuo on 2018/9/29.
- * 消息队列的名称,固定的
- */
-
-public interface QueueName {
-    String Messager = "Messager";
-    String PUSHER = "PUSHER";//消息推送服务
-    String Framework = "Framework";
-    String LOG = "LOG";
-}

+ 0 - 27
cloud-bus/src/main/java/cn/gygxzc/tina/cloud/bus/framweork/bean/FrameworkBean.java

@@ -1,27 +0,0 @@
-package cn.gygxzc.tina.cloud.bus.framweork.bean;
-
-/**
- * Created by niantuo on 2018/9/29.
- * 框架消息的实体类
- */
-
-public class FrameworkBean {
-    private int cloud;
-    private String message;
-
-    public int getCloud() {
-        return cloud;
-    }
-
-    public void setCloud(int cloud) {
-        this.cloud = cloud;
-    }
-
-    public String getMessage() {
-        return message;
-    }
-
-    public void setMessage(String message) {
-        this.message = message;
-    }
-}

+ 0 - 31
cloud-bus/src/main/java/cn/gygxzc/tina/cloud/bus/framweork/receiver/FrameworkReceiver.java

@@ -1,31 +0,0 @@
-package cn.gygxzc.tina.cloud.bus.framweork.receiver;
-
-import cn.gygxzc.tina.cloud.bus.constant.QueueName;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.amqp.rabbit.annotation.RabbitHandler;
-import org.springframework.amqp.rabbit.annotation.RabbitListener;
-import org.springframework.stereotype.Component;
-
-/**
- * Created by niantuo on 2018/9/29.
- * 框架消息接收者,这个扯淡的
- */
-@Component
-@RabbitListener(queues = {QueueName.Framework})
-public class FrameworkReceiver {
-
-    private Logger logger = LoggerFactory.getLogger(FrameworkReceiver.class);
-
-    /**
-     * 接收消息处理
-     *
-     * @param receiver 消息实体类
-     */
-    @RabbitHandler
-    public void process(FrameworkReceiver receiver) {
-        logger.info("receive :{}", receiver);
-    }
-
-
-}

+ 0 - 22
cloud-bus/src/main/java/cn/gygxzc/tina/cloud/bus/framweork/receiver/LoggerReceiver.java

@@ -1,22 +0,0 @@
-package cn.gygxzc.tina.cloud.bus.framweork.receiver;
-
-import cn.gygxzc.envir.core.logger.LogMessage;
-import cn.gygxzc.tina.cloud.bus.constant.QueueName;
-import org.springframework.amqp.rabbit.annotation.RabbitHandler;
-import org.springframework.amqp.rabbit.annotation.RabbitListener;
-import org.springframework.stereotype.Component;
-
-/**
- * Created by niantuo on 2018/11/5.
- * 日志收集器.
- */
-@Component
-@RabbitListener(queues = QueueName.LOG)
-public class LoggerReceiver {
-
-    @RabbitHandler
-    public void mqLog(LogMessage message) {
-        System.out.printf("message:%s",message);
-    }
-
-}

+ 0 - 36
cloud-bus/src/main/java/cn/gygxzc/tina/cloud/bus/messager/bean/MessageBean.java

@@ -1,36 +0,0 @@
-package cn.gygxzc.tina.cloud.bus.messager.bean;
-
-import java.io.Serializable;
-
-/**
- * Created by niantuo on 2018/9/29.
- * 消息发送的实体类
- */
-
-public class MessageBean implements Serializable {
-    public static final long serialVersionUID = 1L;
-    private int code;
-    private String message;
-
-    public int getCode() {
-        return code;
-    }
-
-    public void setCode(int code) {
-        this.code = code;
-    }
-
-    public String getMessage() {
-        return message;
-    }
-
-    public void setMessage(String message) {
-        this.message = message;
-    }
-
-    @Override
-    public String toString() {
-        return "code: " + code + "  message: " + message;
-    }
-
-}

+ 0 - 15
cloud-bus/src/main/java/cn/gygxzc/tina/cloud/bus/messager/sender/IMessagerSender.java

@@ -1,15 +0,0 @@
-package cn.gygxzc.tina.cloud.bus.messager.sender;
-
-import cn.gygxzc.envir.core.logger.ILoggerSender;
-import cn.gygxzc.tina.cloud.bus.messager.bean.MessageBean;
-
-/**
- * Created by niantuo on 2018/9/29.
- * 定义发送消息给消息中心的消息发送者
- */
-
-public interface IMessagerSender extends ILoggerSender {
-
-    void send(MessageBean message);
-
-}

+ 0 - 42
cloud-bus/src/main/java/cn/gygxzc/tina/cloud/bus/messager/sender/impl/MessagerSender.java

@@ -1,42 +0,0 @@
-package cn.gygxzc.tina.cloud.bus.messager.sender.impl;
-
-import cn.gygxzc.envir.core.logger.LogMessage;
-import cn.gygxzc.tina.cloud.bus.constant.QueueName;
-import cn.gygxzc.tina.cloud.bus.messager.bean.MessageBean;
-import cn.gygxzc.tina.cloud.bus.messager.sender.IMessagerSender;
-import org.springframework.amqp.core.AmqpTemplate;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-/**
- * Created by niantuo on 2018/9/29.
- * 发送给消息中心的发送者
- */
-@Component
-public class MessagerSender implements IMessagerSender {
-
-    private final AmqpTemplate amqpTemplate;
-
-    @Autowired
-    public MessagerSender(AmqpTemplate amqpTemplate) {
-        this.amqpTemplate = amqpTemplate;
-    }
-
-    /**
-     * 发送消息给消息中心
-     *
-     * @param message 消息内容
-     */
-    @Override
-    public void send(MessageBean message) {
-        amqpTemplate.convertAndSend(QueueName.Messager, message);
-    }
-
-
-    @Override
-    public void send(LogMessage message) {
-        amqpTemplate.convertAndSend(QueueName.LOG, message);
-    }
-
-
-}

+ 0 - 26
cloud-bus/src/main/java/cn/gygxzc/tina/cloud/bus/utils/GsonUtils.java

@@ -1,26 +0,0 @@
-package cn.gygxzc.tina.cloud.bus.utils;
-
-import com.google.gson.Gson;
-
-/**
- * Created by niantuo on 2018/11/5.
- */
-
-public class GsonUtils {
-    private final static Gson mGson = new Gson();
-
-    public static String toJson(Object obj) {
-        return mGson.toJson(obj);
-    }
-
-    /**
-     * 实际上如果是数组,这样子是解析不出来的吧。
-     * @param clz 要返回的类型
-     * @param json 原始json数据
-     * @param <T> 泛型
-     * @return
-     */
-    public static <T> T fromJson(Class<T> clz, String json) {
-        return mGson.fromJson(json, clz);
-    }
-}

+ 0 - 15
fastdfs-client/build.gradle

@@ -1,15 +0,0 @@
-group 'cn.gygxzc.cloud'
-version '1.0'
-
-sourceCompatibility = 1.8
-
-repositories {
-    mavenCentral()
-}
-
-dependencies {
-    testCompile group: 'junit', name: 'junit', version: '4.12'
-    // https://mvnrepository.com/artifact/com.github.tobato/fastdfs-client
-    compile("com.github.tobato:fastdfs-client:1.26.3")
-
-}

+ 0 - 20
fastdfs-client/src/main/java/cn/gygxzc/cloud/tina/fastdfs/client/EnableFastDFSClient.java

@@ -1,20 +0,0 @@
-package cn.gygxzc.cloud.tina.fastdfs.client;
-
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Created by niantuo on 2018/10/27.
- * 开启dfs客户端支持
- */
-@Configuration
-@Documented
-@Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
-@Target({java.lang.annotation.ElementType.TYPE})
-@Import(value = {FastDFSClientConfiguration.class})
-public @interface EnableFastDFSClient {
-}

+ 0 - 20
fastdfs-client/src/main/java/cn/gygxzc/cloud/tina/fastdfs/client/FastDFSClientConfiguration.java

@@ -1,20 +0,0 @@
-package cn.gygxzc.cloud.tina.fastdfs.client;
-
-import com.github.tobato.fastdfs.FdfsClientConfig;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.EnableMBeanExport;
-import org.springframework.context.annotation.Import;
-import org.springframework.jmx.support.RegistrationPolicy;
-
-/**
- * Created by niantuo on 2018/10/27.
- * 使用fastDFS 客户端配置
- */
-
-@Configuration
-@ComponentScan
-@Import(FdfsClientConfig.class)
-@EnableMBeanExport(registration = RegistrationPolicy.IGNORE_EXISTING)
-public class FastDFSClientConfiguration {
-}

+ 0 - 60
fastdfs-client/src/main/java/cn/gygxzc/cloud/tina/fastdfs/client/controller/FdfsDownloadController.java

@@ -1,60 +0,0 @@
-package cn.gygxzc.cloud.tina.fastdfs.client.controller;
-
-import com.github.tobato.fastdfs.proto.storage.DownloadCallback;
-import com.github.tobato.fastdfs.service.FastFileStorageClient;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-/**
- * Created by niantuo on 2018/10/29.
- * 文件下载或者说是
- */
-@Controller
-@RequestMapping("/files")
-public class FdfsDownloadController {
-
-    @Autowired
-    private FastFileStorageClient storageClient;
-
-    @RequestMapping("/{group}/{path}")
-    public void download(@PathVariable("group") String group, @PathVariable("path") String path, HttpServletResponse response) {
-        InputStream inputStream = null;
-        OutputStream outputStream = null;
-        try {
-            inputStream = storageClient.downloadFile(group, path, ins -> ins);
-            outputStream = response.getOutputStream();
-            byte[] bytes = new byte[1024];
-            while ((inputStream.read(bytes)) != -1) {
-                outputStream.write(bytes, 0, bytes.length);
-            }
-            response.flushBuffer();
-        } catch (IOException e) {
-            throw new RuntimeException("文件下载失败,请重试。");
-        } finally {
-            if (inputStream != null) {
-                try {
-                    inputStream.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-            if (outputStream != null) {
-                try {
-                    outputStream.flush();
-                    outputStream.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-
-            }
-        }
-    }
-
-}

+ 0 - 120
fastdfs-client/src/main/java/cn/gygxzc/cloud/tina/fastdfs/client/controller/FdfsUploadController.java

@@ -1,120 +0,0 @@
-package cn.gygxzc.cloud.tina.fastdfs.client.controller;
-
-import cn.gygxzc.cloud.tina.fastdfs.client.mata.CommonFileMata;
-import cn.gygxzc.cloud.tina.fastdfs.client.mata.FailedStorePath;
-import cn.gygxzc.cloud.tina.fastdfs.client.utils.FileUtils;
-import com.github.tobato.fastdfs.domain.MataData;
-import com.github.tobato.fastdfs.domain.StorePath;
-import com.github.tobato.fastdfs.proto.AbstractFdfsCommand;
-import com.github.tobato.fastdfs.service.FastFileStorageClient;
-import io.reactivex.Observable;
-import io.reactivex.Single;
-import io.reactivex.SingleOnSubscribe;
-import io.reactivex.schedulers.Schedulers;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.IOException;
-import java.util.*;
-import java.util.concurrent.TimeUnit;
-
-
-/**
- * Created by niantuo on 2018/10/27.
- * 文件上传接口。
- * 文件上传的接口
- */
-@RestController
-@RequestMapping("/files/upload")
-public class FdfsUploadController {
-
-    @Autowired
-    private FastFileStorageClient storageClient;
-
-
-    /**
-     * 上传文件,需要自己附带一些信息
-     *
-     * @param file     文件本身信息
-     * @param fileMata 文件的自定义数据
-     * @return 文件的
-     */
-    @PostMapping
-    public Object upload(@RequestParam("file") MultipartFile file, CommonFileMata fileMata) {
-
-        Set<MataData> mataData = fileMata.mataData(file);
-        String fileExtName = FileUtils.getFileExtName(file.getOriginalFilename());
-        try {
-            return storageClient.uploadFile(file.getInputStream(), file.getSize(), fileExtName, mataData);
-        } catch (IOException e) {
-            throw new RuntimeException("文件上传失败,请重试。");
-        }
-    }
-
-    /**
-     * 多文件上传。
-     * 暂时这种方式不知道会有什么风险。
-     * 把这个线程挂起来是不是也浪费了一些性能。
-     *
-     * @param files    文件信息
-     * @param fileMata 文件描述
-     * @return 文件的下载路径,不保证,顺序
-     */
-    @PostMapping("/multi")
-    public Object multiUpload(@RequestParam("files") List<MultipartFile> files, CommonFileMata fileMata) {
-
-        final Object mLock = new Object();
-        List<FailedStorePath> failedStorePaths = new ArrayList<>();
-        List<StorePath> storePaths = new ArrayList<>();
-        Observable.fromIterable(files)
-                .flatMapSingle(file -> uploadToFdfs(file, fileMata))
-                .doOnNext(storePath -> {
-                    if (storePath instanceof FailedStorePath) {
-                        failedStorePaths.add((FailedStorePath) storePath);
-                    } else {
-                        storePaths.add(storePath);
-                    }
-                })
-                .toList()
-                .subscribe(results -> {
-                    synchronized (mLock) {
-                        mLock.notifyAll();
-                    }
-                });
-        synchronized (mLock) {
-            try {
-                mLock.wait();
-            } catch (InterruptedException e) {
-                e.printStackTrace();
-            }
-        }
-        Map<String, Object> results = new HashMap<>();
-        results.put("paths", storePaths);
-        results.put("error", failedStorePaths);
-        return results;
-    }
-
-
-    /**
-     * 多文件上传,有可能只有一两个文件失败,这个时候,需要做一些处理.
-     * 设置文件上传最大的超时时长为两分钟,过长会影响用户体验
-     *
-     * @param file     上传的文件
-     * @param fileMata 文件的描述
-     * @return 文件的地址信息
-     */
-    private Single<StorePath> uploadToFdfs(MultipartFile file, CommonFileMata fileMata) {
-        return Single.create((SingleOnSubscribe<StorePath>) subscriber -> {
-            Set<MataData> mataData = fileMata.mataData(file);
-            String fileExtName = file.getOriginalFilename();
-            StorePath storePath = storageClient.uploadFile(file.getInputStream(), file.getSize(), fileExtName, mataData);
-            subscriber.onSuccess(storePath);
-        })
-                .timeout(2, TimeUnit.MINUTES)
-                .retry(3)
-                .onErrorReturn(throwable -> new FailedStorePath(file))
-                .subscribeOn(Schedulers.io());
-    }
-
-}

+ 0 - 32
fastdfs-client/src/main/java/cn/gygxzc/cloud/tina/fastdfs/client/mata/CommonFileMata.java

@@ -1,32 +0,0 @@
-package cn.gygxzc.cloud.tina.fastdfs.client.mata;
-
-import com.github.tobato.fastdfs.domain.MataData;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * Created by niantuo on 2018/10/27.
- */
-
-public class CommonFileMata {
-    private String description;
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public Set<MataData> mataData(MultipartFile file){
-        Set<MataData> mataDataSet = new HashSet<>();
-        mataDataSet.add(new MataData("originalName",file.getOriginalFilename()));
-        mataDataSet.add(new MataData("size",String.valueOf(file.getSize())));
-        mataDataSet.add(new MataData("name",file.getName()));
-        mataDataSet.add(new MataData("description",description));
-        return mataDataSet;
-    }
-}

+ 0 - 42
fastdfs-client/src/main/java/cn/gygxzc/cloud/tina/fastdfs/client/mata/FailedStorePath.java

@@ -1,42 +0,0 @@
-package cn.gygxzc.cloud.tina.fastdfs.client.mata;
-
-import com.github.tobato.fastdfs.domain.StorePath;
-import org.springframework.web.multipart.MultipartFile;
-
-/**
- * Created by niantuo on 2018/10/27.
- * 上传失败的storePath
- */
-
-public class FailedStorePath extends StorePath {
-
-    private String originalName;
-    private String fileName;
-
-
-    public FailedStorePath(MultipartFile file){
-        this.fileName = file.getName();
-        this.originalName = file.getOriginalFilename();
-    }
-
-    public FailedStorePath(String fileName, String originalName) {
-        this.originalName = originalName;
-        this.fileName = fileName;
-    }
-
-    public void setFileName(String fileName) {
-        this.fileName = fileName;
-    }
-
-    public void setOriginalName(String originalName) {
-        this.originalName = originalName;
-    }
-
-    public String getFileName() {
-        return fileName;
-    }
-
-    public String getOriginalName() {
-        return originalName;
-    }
-}

+ 0 - 28
fastdfs-client/src/main/java/cn/gygxzc/cloud/tina/fastdfs/client/utils/FileUtils.java

@@ -1,28 +0,0 @@
-package cn.gygxzc.cloud.tina.fastdfs.client.utils;
-
-import org.apache.commons.lang.StringUtils;
-
-/**
- * Created by niantuo on 2018/10/29.
- * 文件相关的方法
- */
-
-public class FileUtils {
-    private final static String UNKNOWN_EXT = "unknown";
-
-    /**
-     * 获取文件的后缀名称
-     *
-     * @return 文件的后缀
-     */
-    public static String getFileExtName(String fileName) {
-        if (StringUtils.isBlank(fileName)) {
-            return UNKNOWN_EXT;
-        }
-        int index = fileName.lastIndexOf(".");
-        if (index == 0) {
-            return UNKNOWN_EXT;
-        }
-        return fileName.substring(index + 1);
-    }
-}

+ 0 - 27
fastdfs-client/src/main/resources/application-fdfs.yml

@@ -1,27 +0,0 @@
-
-
-# fdfs 分布式文件服务器
-
----
-spring:
-  profiles: dev
-fdfs:
-  connect-timeout: 600
-  so-timeout: 1500
-  thumb-image:
-    height: 150
-    width: 150
-  tracker-list:
-    - 192.168.1.206:22122
----
-spring:
-  profiles: prod
-
-fdfs:
-  connect-timeout: 600
-  so-timeout: 1500
-  thumb-image:
-    height: 150
-    width: 150
-  tracker-list:
-  -  192.168.1.206:22122

+ 0 - 60
fastdfs-client/src/test/java/cn/gygxzc/cloud/tina/fdfs/RxJavaTest.java

@@ -1,60 +0,0 @@
-package cn.gygxzc.cloud.tina.fdfs;
-
-import io.reactivex.Observable;
-import io.reactivex.Single;
-import io.reactivex.SingleEmitter;
-import io.reactivex.SingleOnSubscribe;
-import io.reactivex.schedulers.Schedulers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Created by niantuo on 2018/10/27.
- * 这种方式的确是可以使用的,但是不知道在实际过程中会不会表现很糟糕
- */
-
-public class RxJavaTest {
-
-    public static void main(String[] args) {
-        List<Integer> integers = new ArrayList<>();
-        final Object mLock = new Object();
-        integers.add(1000);
-        integers.add(2000);
-        integers.add(2500);
-        integers.add(500);
-        integers.add(1500);
-        long startTime = System.currentTimeMillis();
-        Observable.fromIterable(integers)
-                .flatMapSingle(RxJavaTest::task)
-                .doOnNext(threadId->{
-                    System.out.printf("onNex: %d,threadId:%d \n",System.currentTimeMillis(),threadId);
-                })
-                .toList()
-                .subscribe(list->{
-                    System.out.printf("complete time: %d \n",System.currentTimeMillis());
-                    synchronized (mLock){
-                        mLock.notifyAll();
-                    }
-                });
-        synchronized (mLock){
-            try {
-                mLock.wait();
-            } catch (InterruptedException e) {
-                e.printStackTrace();
-            }
-        }
-        System.out.printf("main thread:%d  耗时:%d  \n",System.currentTimeMillis(),System.currentTimeMillis()-startTime);
-    }
-
-    private static Single<Long> task(long sleep){
-        return Single.create((SingleOnSubscribe<Long>) emitter -> {
-            System.out.printf("current thread: %d,start Time: %d \n",Thread.currentThread().getId(),System.currentTimeMillis());
-            Thread.sleep(sleep);
-            emitter.onSuccess(Thread.currentThread().getId());
-            System.out.printf("current thread: %d,end Time: %d \n",Thread.currentThread().getId(),System.currentTimeMillis());
-        }).subscribeOn(Schedulers.io())
-                .retry(3);
-    }
-
-}

+ 0 - 14
fastdfs-client/src/test/java/cn/gygxzc/cloud/tina/fdfs/utils/FileUtilsTest.java

@@ -1,14 +0,0 @@
-package cn.gygxzc.cloud.tina.fdfs.utils;
-
-import cn.gygxzc.cloud.tina.fastdfs.client.utils.FileUtils;
-
-/**
- * Created by niantuo on 2018/10/29.
- */
-
-public class FileUtilsTest {
-    public static void main(String[] args) {
-        String fileName="123.png";
-        System.out.printf("extName:%s", FileUtils.getFileExtName(fileName));
-    }
-}

+ 0 - 6
settings.gradle

@@ -1,10 +1,4 @@
 rootProject.name = 'tuon-framework'
-//include 'zen-core'
-//include 'zen-api'
-//include 'zen-web'
-//include 'cloud-bus'
-//include 'fastdfs-client'
-include 'tuon-sign'
 include 'tuon-core'
 include 'tuon-web'
 include 'tuon-qywx'

+ 1 - 1
tuon-core/src/main/java/cn/tonyandmoney/tuon/core/session/SessionUtils.java

@@ -63,7 +63,7 @@ public class SessionUtils {
      * 异步获取用户信息,如果当前没有用户信息,则抛出异常
      * 一下三个方法是为WebFlux 服务下实现的
      *
-     * @param exchange
+     * @param exchange 这个
      * @return
      */
     public static <T extends IUser> Mono<T> getUser(ServerWebExchange exchange) {

+ 0 - 1
tuon-core/src/main/kotlin/cn/tonyandmoney/tuon/core/config/CustomWebMvcConfiguration.kt

@@ -39,7 +39,6 @@ class CustomWebMvcConfiguration : WebMvcConfigurationSupport() {
      * session注入和移除
      */
     @Bean
-    @Order(Order.)
     fun sessionFilter(): Filter {
         return SessionFillFilter()
     }

+ 1 - 1
tuon-qywx/src/main/kotlin/cn/tonyandmoney/tuon/qywx/controller/QywxController.kt

@@ -68,7 +68,7 @@ class QywxController {
                     @RequestParam("agentId") agentId: String,
                     exchange: ServerWebExchange): Mono<BaseResp<IUser>> {
 
-        return SessionUtils.getUser<WxUser>(exchange)
+        return SessionUtils.getUser<IUser>(exchange)
                 .onErrorResume(SessionNoUserException::class.java) {
                     if (code.isNullOrBlank()) {
                         Mono.error(OpException(WxErrorCode.ERR_CODE))

+ 0 - 12
tuon-sign/build.gradle

@@ -1,12 +0,0 @@
-group 'cn.tonyandmoney.tuon'
-version '0.0.1'
-
-sourceCompatibility = 1.8
-
-repositories {
-    mavenCentral()
-}
-
-dependencies {
-    testCompile group: 'junit', name: 'junit', version: '4.12'
-}

+ 0 - 8
tuon-sign/src/main/java/cn/tonyandmoney/sign/SignProperties.java

@@ -1,8 +0,0 @@
-package cn.tonyandmoney.sign;
-
-/**
- * 主要用于数据签名。
- * 暂时不考虑数据签名
- */
-public class SignProperties {
-}

+ 1 - 2
tuon-web/src/main/resources/bootstrap.yml

@@ -8,8 +8,7 @@ spring:
   application:
     name: tuon
   profiles:
-    active: dev
-    include: orm,cache,msg
+    active: sit
   cloud:
     config:
       profile: ${spring.profiles.active}

+ 0 - 18
zen-api/build.gradle

@@ -1,18 +0,0 @@
-buildscript {
-    repositories {
-        mavenCentral()
-    }
-    dependencies {
-        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
-        classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
-        classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
-    }
-}
-
-
-dependencies {
-    compile 'io.jsonwebtoken:jjwt-api:0.10.5'
-    runtime 'io.jsonwebtoken:jjwt-impl:0.10.5',
-            'io.jsonwebtoken:jjwt-jackson:0.10.5'
-    compile project(":zen-core")
-}

+ 0 - 12
zen-api/src/main/java/cn/gygxzc/envir/biz/dao/Dao.java

@@ -1,12 +0,0 @@
-package cn.gygxzc.envir.biz.dao;
-
-import com.baomidou.mybatisplus.core.toolkit.IdWorker;
-
-/**
- * Created by niantuo on 2018/9/28.
- * 把 Dao 类写在该路径下
- */
-
-public class Dao {
-
-}

+ 0 - 27
zen-api/src/main/java/cn/gygxzc/envir/sys/config/properties/ShiroRedisCacheProperties.java

@@ -1,27 +0,0 @@
-package cn.gygxzc.envir.sys.config.properties;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
-
-/**
- * @program: Zen-Framework
- * @description: ${description}
- * @author: tuonina
- * @create: 2018-09-20 21:23
- **/
-@ConfigurationProperties(prefix = "shiro.redis")
-public class ShiroRedisCacheProperties extends RedisStandaloneConfiguration {
-
-    /**
-     * 是否启动该redis缓存
-     */
-    private boolean enable = true;
-
-    public void setEnable(boolean enable) {
-        this.enable = enable;
-    }
-
-    public boolean isEnable() {
-        return enable;
-    }
-}

+ 0 - 44
zen-api/src/main/java/cn/gygxzc/envir/sys/config/properties/ShiroSessionProperties.java

@@ -1,44 +0,0 @@
-package cn.gygxzc.envir.sys.config.properties;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-import java.time.Duration;
-
-/**
- * @program: Zen-Framework
- * @description: ${description}
- * @author: tuonina
- * @create: 2018-09-20 21:52
- **/
-@ConfigurationProperties(prefix = "shiro.session")
-public class ShiroSessionProperties {
-
-    private String prefix;
-    private Duration expired = Duration.ofDays(1);
-    private String jwtKey;
-
-
-    public void setJwtKey(String jwtKey) {
-        this.jwtKey = jwtKey;
-    }
-
-    public String getJwtKey() {
-        return jwtKey;
-    }
-
-    public String getPrefix() {
-        return prefix;
-    }
-
-    public void setPrefix(String prefix) {
-        this.prefix = prefix;
-    }
-
-    public Duration getExpired() {
-        return expired;
-    }
-
-    public void setExpired(Duration expired) {
-        this.expired = expired;
-    }
-}

+ 0 - 16
zen-api/src/main/java/cn/gygxzc/envir/test/dao/ITestLogDao.java

@@ -1,16 +0,0 @@
-package cn.gygxzc.envir.test.dao;
-
-import cn.gygxzc.envir.test.model.TestLog;
-import cn.gygxzc.envir.core.orm.base.IPhysicalMapper;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.springframework.stereotype.Repository;
-
-/**
- * Created by niantuo on 2018/9/30.
- * 数据库dao类
- *
- * @see IPhysicalMapper  物理操作需要继承该类
- */
-@Repository
-public interface ITestLogDao extends BaseMapper<TestLog>, IPhysicalMapper<TestLog> {
-}

+ 0 - 22
zen-api/src/main/java/cn/gygxzc/envir/test/model/TestLog.java

@@ -1,22 +0,0 @@
-package cn.gygxzc.envir.test.model;
-
-
-import cn.gygxzc.envir.core.base.BaseModel;
-import com.baomidou.mybatisplus.annotation.TableName;
-
-/**
- * Created by niantuo on 2018/9/30.
- * 测试用的数据库表模型
- */
-@TableName(value = "test_log")
-public class TestLog extends BaseModel {
-    private String message;
-
-    public void setMessage(String message) {
-        this.message = message;
-    }
-
-    public String getMessage() {
-        return message;
-    }
-}

+ 0 - 39
zen-api/src/main/java/cn/gygxzc/envir/test/service/ITestLogService.java

@@ -1,39 +0,0 @@
-package cn.gygxzc.envir.test.service;
-
-import cn.gygxzc.envir.test.model.TestLog;
-
-/**
- * Created by niantuo on 2018/9/30.
- */
-
-public interface ITestLogService {
-
-    /**
-     * 添加数据
-     *
-     * @param log 添加数据
-     */
-    TestLog addLog(TestLog log);
-
-    /**
-     * 更新数据
-     *
-     * @param log 数据对象
-     */
-    void update(TestLog log);
-
-    /**
-     * 物理删除
-     *
-     * @param id 记录的id
-     */
-    void physicalDeleteById(long id);
-
-    /**
-     * 逻辑删除
-     *
-     * @param id 记录的id
-     */
-    void deleteById(long id);
-
-}

+ 0 - 51
zen-api/src/main/java/cn/gygxzc/envir/test/service/impl/TestLogService.java

@@ -1,51 +0,0 @@
-package cn.gygxzc.envir.test.service.impl;
-
-import cn.gygxzc.envir.test.dao.ITestLogDao;
-import cn.gygxzc.envir.test.model.TestLog;
-import cn.gygxzc.envir.test.service.ITestLogService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-/**
- * Created by niantuo on 2018/9/30.
- */
-@Service
-public class TestLogService implements ITestLogService {
-    private final static Logger logger = LoggerFactory.getLogger(TestLogService.class);
-
-    private final ITestLogDao testLogDao;
-
-    @Autowired
-    public TestLogService(ITestLogDao testLogDao) {
-        this.testLogDao = testLogDao;
-    }
-
-
-    @Override
-    public TestLog addLog(TestLog log) {
-        int result = testLogDao.insert(log);
-        logger.info("add log  result:{},entity:{}", result, log);
-        return log;
-    }
-
-    @Override
-    public void update(TestLog log) {
-        int result = testLogDao.updateById(log);
-        logger.info("update result:{},entity:{}", result, log);
-    }
-
-    @Override
-    public void physicalDeleteById(long id) {
-        int result = testLogDao.physicalDeleteById(id);
-        logger.info("physicalDeleteById result:{}", result);
-
-    }
-
-    @Override
-    public void deleteById(long id) {
-        int result = testLogDao.deleteById(id);
-        logger.info("deleteById  result:{}", result);
-    }
-}

+ 0 - 8
zen-api/src/main/kotlin/cn/gygxzc/envir/biz/Biz.kt

@@ -1,8 +0,0 @@
-package cn.gygxzc.envir.biz
-
-/**
- * Created by niantuo on 2018/9/21.
- * 自己的业务逻辑可以写在这里面
- */
-    
- 

+ 0 - 8
zen-api/src/main/kotlin/cn/gygxzc/envir/biz/dao/Dao.kt

@@ -1,8 +0,0 @@
-package cn.gygxzc.envir.biz.dao
-
-/**
- * Created by niantuo on 2018/9/28.
- * 该路径下写 数据类 DAO 类文件
- */
-    
- 

+ 0 - 9
zen-api/src/main/kotlin/cn/gygxzc/envir/sys/dto/LoginDto.kt

@@ -1,9 +0,0 @@
-package cn.gygxzc.envir.sys.dto
-
-/**
- * Created by niantuo on 2018/9/28.
- */
-
-data class LoginDto(var username:String="",
-               var password:String="") {
-}

+ 0 - 197
zen-api/src/main/kotlin/cn/gygxzc/envir/sys/model/CommonFile.java

@@ -1,197 +0,0 @@
-package cn.gygxzc.envir.sys.model;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * Created by niantuo on 2018/12/10.
- * 文件属性.
- */
-@TableName("common_files")
-public class CommonFile implements Serializable, Cloneable {
-
-    public static final long serialVersionUID = 1L;
-
-    private Long id;
-    private Boolean enable;
-    private String fileName;
-    private Long fileSize;
-    private String originName;
-    private String fileType;
-    private String fileDesc;
-    private String fullPath;
-    private String clientKey;
-    private String useType;
-    private String remark;
-    private String createBy;
-    private Date createTime;
-    private String updateBy;
-    private Date updateTime;
-    private String fileMd5;
-    private Boolean failed;
-
-
-    public CommonFile() {
-
-    }
-
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public void setEnable(Boolean enable) {
-        this.enable = enable;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public Boolean getEnable() {
-        return enable;
-    }
-
-    public String getFileName() {
-        return fileName;
-    }
-
-    public void setFileMd5(String fileMd5) {
-        this.fileMd5 = fileMd5;
-    }
-
-    public String getFileMd5() {
-        return fileMd5;
-    }
-
-    public void setFailed(Boolean failed) {
-        this.failed = failed;
-    }
-
-    public Boolean getFailed() {
-        return failed;
-    }
-
-
-    public void setFileName(String fileName) {
-        this.fileName = fileName;
-    }
-
-    public Long getFileSize() {
-        return fileSize;
-    }
-
-    public void setFileSize(Long fileSize) {
-        this.fileSize = fileSize;
-    }
-
-    public String getOriginName() {
-        return originName;
-    }
-
-    public void setOriginName(String originName) {
-        this.originName = originName;
-    }
-
-    public String getFileType() {
-        return fileType;
-    }
-
-    public void setFileType(String fileType) {
-        this.fileType = fileType;
-    }
-
-    public String getFileDesc() {
-        return fileDesc;
-    }
-
-    public void setFileDesc(String fileDesc) {
-        this.fileDesc = fileDesc;
-    }
-
-    public String getFullPath() {
-        return fullPath;
-    }
-
-    public void setFullPath(String fullPath) {
-        this.fullPath = fullPath;
-    }
-
-    public String getClientKey() {
-        return clientKey;
-    }
-
-    public void setClientKey(String clientKey) {
-        this.clientKey = clientKey;
-    }
-
-    public String getUseType() {
-        return useType;
-    }
-
-    public void setUseType(String useType) {
-        this.useType = useType;
-    }
-
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-
-    public String getCreateBy() {
-        return createBy;
-    }
-
-    public void setCreateBy(String createBy) {
-        this.createBy = createBy;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public String getUpdateBy() {
-        return updateBy;
-    }
-
-    public void setUpdateBy(String updateBy) {
-        this.updateBy = updateBy;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    @Override
-    public CommonFile clone() throws CloneNotSupportedException {
-        CommonFile commonFile = (CommonFile) super.clone();
-        commonFile.setOriginName(originName);
-        commonFile.setFileName(fileName);
-        commonFile.setClientKey(clientKey);
-        commonFile.setRemark(remark);
-        commonFile.setUseType(useType);
-        commonFile.setFileDesc(fileDesc);
-        commonFile.setFileSize(fileSize);
-        commonFile.setFullPath(fullPath);
-        commonFile.setFileMd5(fileMd5);
-        return commonFile;
-    }
-
-    @Override
-    public String toString() {
-        return String.format("{ fileName: %s  originName: %s ,fullPath:%s }", fileName, originName, fullPath);
-    }
-}

+ 0 - 65
zen-api/src/main/kotlin/cn/gygxzc/envir/sys/service/IFUserService.kt

@@ -1,65 +0,0 @@
-package cn.gygxzc.envir.sys.service
-
-import cn.gygxzc.cloud.tina.auth.annotation.ResourceApi
-import cn.gygxzc.cloud.tina.auth.enums.ResourceLevel
-import cn.gygxzc.tina.cloud.jwt.session.bean.User
-import org.springframework.cloud.openfeign.FeignClient
-import org.springframework.web.bind.annotation.PathVariable
-import org.springframework.web.bind.annotation.RequestBody
-import org.springframework.web.bind.annotation.RequestMapping
-import org.springframework.web.bind.annotation.RequestMethod
-
-/**
- * Created by niantuo on 2018/12/17.
- * 通过feign 调用获取用户信心。
- */
-@FeignClient("sys")
-interface IFUserService {
-
-
-    /**
-     * 根据用户的id获取用户信息
-     */
-    @RequestMapping(method = [RequestMethod.POST], value = ["/feign/user"])
-    fun getUserInfoByIds(@RequestBody ids: List<Long>): List<User>
-
-    /**
-     * 根据用户的id获取用户信息
-     */
-    @RequestMapping("/feign/user/{id}", method = [RequestMethod.GET])
-    fun getUserInfo(@PathVariable("id") id: Long): User?
-
-    /**
-     * 根据用户的账号获取用户信息
-     */
-    @RequestMapping("/feign/user/info/{account}", method = [RequestMethod.GET])
-    fun getUserByAccount(@PathVariable("account") account: String): User?
-
-    /**
-     * 根据用户的id获取用户的账号信息
-     */
-    @RequestMapping("/feign/user/account/{id}", method = [RequestMethod.GET])
-    fun getAccountById(@PathVariable("id") id: Long): String?
-
-    /**
-     * 根据用户id获取用户的账号信息...
-     * 这个不知道有什么用...
-     */
-    @RequestMapping("/feign/user/accounts", method = [RequestMethod.POST])
-    fun getAccountByIds(@RequestBody ids: List<Long>): List<String>
-
-
-    /**
-     * 根据用户的id修改用户信息,并不是全部信息。
-     */
-    @RequestMapping("/feign/user/{id}", method = [RequestMethod.PUT])
-    fun updateUserInfo(@PathVariable("id") id: Long, @RequestBody user: User)
-
-    /**
-     * 根据用户账户批量获取用户信息
-     */
-    @RequestMapping("/feign/user/info", method = [RequestMethod.POST])
-    @ResourceApi(name = "", level = ResourceLevel.AUTHC)
-    fun getUserInfoByAccounts(@RequestBody accounts: List<String>): List<User>
-
-}

+ 0 - 33
zen-api/src/main/kotlin/cn/gygxzc/envir/sys/service/IFileInfoService.kt

@@ -1,33 +0,0 @@
-package cn.gygxzc.envir.sys.service
-
-import cn.gygxzc.envir.sys.model.CommonFile
-import org.springframework.cloud.openfeign.FeignClient
-import org.springframework.web.bind.annotation.RequestBody
-import org.springframework.web.bind.annotation.RequestMapping
-import org.springframework.web.bind.annotation.RequestMethod
-
-/**
- * Created by niantuo on 2018/12/20.
- * 获取文件的信息服务
- */
-@FeignClient("gateway")
-interface IFileInfoService {
-
-    /**
-     * 根据文件的id获取文件的详细信息
-     *
-     * @param ids 文件的id
-     * @return 文件的详细信息
-     */
-    @RequestMapping(value = ["/info"], method = [RequestMethod.POST])
-    fun queryByIds(@RequestBody ids: List<Long>): List<CommonFile>
-
-    /**
-     * 根据文件的id获取文件的简单信息
-     *
-     * @param ids 文件的id
-     * @return 文件的简略信息
-     */
-    @RequestMapping(value = ["/info/simp"], method = [RequestMethod.POST])
-    fun querySimpByIds(@RequestBody ids: List<Long>): List<CommonFile>
-}

+ 0 - 23
zen-api/src/main/kotlin/cn/gygxzc/envir/sys/service/ILoginService.kt

@@ -1,23 +0,0 @@
-package cn.gygxzc.envir.sys.service
-
-import cn.gygxzc.envir.sys.dto.LoginDto
-import com.gxzc.zen.common.dto.ResponseDto
-import org.springframework.cloud.openfeign.FeignClient
-import org.springframework.web.bind.annotation.RequestBody
-import org.springframework.web.bind.annotation.RequestMapping
-import org.springframework.web.bind.annotation.RequestMethod
-
-/**
- * Created by niantuo on 2018/9/21.
- * 登陆远程调用登陆系统的登录方法
- */
-@FeignClient("sys")
-interface ILoginService {
-
-    /**
-     * 登陆,返回jwt token验证
-     */
-    @RequestMapping(method = [RequestMethod.POST], value = ["/auth/v2/login"])
-    fun login(@RequestBody dto: LoginDto): ResponseDto
-
-}

+ 0 - 50
zen-api/src/main/kotlin/cn/gygxzc/envir/utils/Byte2Hex.kt

@@ -1,50 +0,0 @@
-package cn.gygxzc.envir.utils
-
-import java.util.*
-
-/**
- * 字节 16进制字串转换工具类
- * @author NorthLan
- * @date 2018/4/23
- * @url https://noahlan.com
- */
-object Byte2Hex {
-
-    /**
-     *
-     * 字节转换为 16 进制字符串
-     *
-     * @param b
-     * 字节
-     * @return
-     */
-    fun byte2Hex(b: Byte): String {
-        var hex = Integer.toHexString(b.toInt())
-        if (hex.length > 2) {
-            hex = hex.substring(hex.length - 2)
-        }
-        while (hex.length < 2) {
-            hex = "0$hex"
-        }
-        return hex
-    }
-
-
-    /**
-     *
-     * 字节数组转换为 16 进制字符串
-     *
-     * @param bytes
-     * 字节数组
-     * @return
-     */
-    fun byte2Hex(bytes: ByteArray): String {
-        val formatter = Formatter()
-        for (b in bytes) {
-            formatter.format("%02x", b)
-        }
-        val hash = formatter.toString()
-        formatter.close()
-        return hash
-    }
-}

+ 0 - 119
zen-api/src/main/kotlin/cn/gygxzc/envir/utils/MD5Salt.kt

@@ -1,119 +0,0 @@
-package cn.gygxzc.envir.utils
-
-import org.slf4j.LoggerFactory
-import java.security.MessageDigest
-
-
-/**
- *
- * @author NorthLan
- * @date 2018/3/5
- * @url https://noahlan.com
- */
-class MD5Salt {
-    companion object {
-        private val logger = LoggerFactory.getLogger(MD5Salt::class.java)
-        private const val ALGORITHM = "MD5"
-        private const val CUT_SYMBOL = "#"
-
-        /**
-         * md5 盐值加密字符串
-         * @param salt
-         * 				盐值
-         * @param rawText
-         *				需要加密的字符串
-         * @return
-         */
-        fun md5SaltEncode(salt: String, rawText: String): String? {
-            return MD5Salt(salt, ALGORITHM).encode(rawText)
-        }
-
-        /**
-         * 判断md5 盐值加密内容是否正确
-         * @param salt
-         * 盐值
-         * @param encodeText
-         * 加密后的文本内容
-         * @param rawText
-         * 加密前的文本内容
-         * @return
-         */
-        fun md5SaltValid(salt: String, encodeText: String, rawText: String): Boolean {
-            return MD5Salt(salt, ALGORITHM).isValid(encodeText, rawText)
-        }
-    }
-
-    private var salt: String? = null
-    private var algorithm: String? = null
-
-    private constructor()
-
-    constructor(salt: String, algorithm: String) {
-        this.salt = salt
-        this.algorithm = algorithm
-    }
-
-    /**
-     * 字符串盐值加密
-     * @param rawText
-     * 需要加密的字符串
-     * @return
-     */
-    fun encode(rawText: String): String? {
-        try {
-            val md = MessageDigest.getInstance(this.algorithm)
-            //加密后的字符串
-            return Byte2Hex.byte2Hex(md.digest(mergeRawTextAndSalt(rawText).toByteArray()))
-        } catch (e: Exception) {
-            logger.error(" MD5Salt encode exception.")
-            e.printStackTrace()
-        }
-        return null
-    }
-
-    /**
-     *
-     *
-     *
-     * 判断加密内容是否正确
-     *
-     *
-     * @param encodeText
-     * 加密后的文本内容
-     * @param rawText
-     * 加密前的文本内容
-     * @return
-     */
-    fun isValid(encodeText: String, rawText: String): Boolean {
-        return this.encode(rawText).equals(encodeText)
-    }
-
-    /**
-     *
-     *
-     *
-     * 合并混淆盐值至加密内容
-     *
-     *
-     * @param rawText
-     * 需要加密的字符串
-     * @return
-     */
-    private fun mergeRawTextAndSalt(rawText: String?): String {
-        var tmp = rawText
-        if (tmp == null) {
-            tmp = ""
-        }
-
-        return if (this.salt == null || "" == this.salt) {
-            tmp
-        } else {
-            val mt = StringBuffer()
-            mt.append(tmp)
-            mt.append(CUT_SYMBOL)
-            mt.append(this.salt)
-            mt.toString()
-        }
-    }
-
-}

+ 0 - 21
zen-api/src/main/kotlin/com/gxzc/zen/api/sys/common/DictTypeTree.kt

@@ -1,21 +0,0 @@
-package com.gxzc.zen.api.sys.common
-
-import com.gxzc.zen.common.util.common.TreeNode
-
-/**
- * 字典结构树
- * @author NorthLan
- * @date 2018/4/28
- * @url https://noahlan.com
- */
-//@JsonInclude(JsonInclude.Include.NON_EMPTY) // jackson 忽略空值
-open class DictTypeTree : TreeNode() {
-    /**
-     * 目录码
-     */
-    var code: String? = null
-    /**
-     * 标签
-     */
-    var label: String? = null
-}

+ 0 - 56
zen-api/src/main/kotlin/com/gxzc/zen/api/sys/common/MenuTree.kt

@@ -1,56 +0,0 @@
-package com.gxzc.zen.api.sys.common
-
-import com.gxzc.zen.common.util.common.TreeNode
-
-/**
- * 菜单树
- * @author NorthLan
- * @date 2018/4/28
- * @url https://noahlan.com
- */
-class MenuTree : TreeNode() {
-    companion object {
-        const val serialVersionUID = 5640224091610000005L
-    }
-
-    /**
-     * 菜单编码
-     */
-    var code: String? = null
-    /**
-     * 菜单类型(0:菜单组;1:菜单;)
-     */
-    var type: Int? = null
-    /**
-     * 菜单标题
-     */
-    var title: String? = null
-    /**
-     * 请求地址(前端)
-     */
-    var uri: String? = null
-    /**
-     * 图标名称
-     */
-    var icon: String? = null
-    /**
-     * 扩展字段1
-     */
-    var ext1: String? = null
-    /**
-     * 扩展字段2
-     */
-    var ext2: String? = null
-    /**
-     * 扩展字段3
-     */
-    var ext3: String? = null
-    /**
-     * 扩展字段4
-     */
-    var ext4: String? = null
-    /**
-     * 扩展字段5
-     */
-    var ext5: String? = null
-}

+ 0 - 40
zen-api/src/main/kotlin/com/gxzc/zen/api/sys/common/RoleTree.kt

@@ -1,40 +0,0 @@
-package com.gxzc.zen.api.sys.common
-
-import com.gxzc.zen.common.util.common.TreeNode
-
-/**
- * 角色树 @see also SysRole
- * @author NorthLan
- * @date 2018/4/28
- * @url https://noahlan.com
- */
-class RoleTree : TreeNode() {
-    /**
-     * 角色名称
-     */
-    var name: String? = null
-    /**
-     * 角色代码
-     */
-    var code: String? = null
-    /**
-     * 扩展字段1
-     */
-    var ext1: String? = null
-    /**
-     * 扩展字段2
-     */
-    var ext2: String? = null
-    /**
-     * 扩展字段3
-     */
-    var ext3: String? = null
-    /**
-     * 扩展字段4
-     */
-    var ext4: String? = null
-    /**
-     * 扩展字段5
-     */
-    var ext5: String? = null
-}

+ 0 - 14
zen-api/src/main/kotlin/com/gxzc/zen/logging/annotation/LogAnnotation.kt

@@ -1,14 +0,0 @@
-package com.gxzc.zen.logging.annotation
-
-/**
- * <p>
- * 使用在Controller方法上<br>
- * 用于配置 请求日志
- * </p>
- * @author NorthLan
- * @date 2018/8/23
- * @url https://noahlan.com
- */
-@Target(AnnotationTarget.FUNCTION)
-@Retention(AnnotationRetention.RUNTIME)
-annotation class LogAnnotation(val ignore: Boolean = false, val remark: String = "")

+ 0 - 56
zen-api/src/main/kotlin/com/gxzc/zen/logging/model/LogAuth.kt

@@ -1,56 +0,0 @@
-package com.gxzc.zen.logging.model
-
-import java.io.Serializable
-import java.util.*
-
-/**
- * 登录/登出 日志 data class
- * @author NorthLan
- * @date 2018/8/23
- * @url https://noahlan.com
- */
-open class LogAuth : Serializable {
-    companion object {
-        private const val serialVersionUID = 10000000000000001L
-    }
-
-    /**
-     * 类型
-     */
-    var type: Int = 1
-
-    /**
-     * 登陆方式
-     */
-    var method: Int = 1
-
-    /**
-     * 操作人account
-     */
-    var operatorAccount: String? = null
-
-    /**
-     * 操作人name
-     */
-    var operatorName: String? = null
-
-    /**
-     * 操作开始时间
-     */
-    var operatorStartTime: Date = Date()
-
-    /**
-     * 操作结束时间
-     */
-    var operatorEndTime: Date = Date()
-
-    /**
-     * 客户端host
-     */
-    var remoteHost: String? = null
-
-    /**
-     * 备注
-     */
-    var remark: String? = null
-}

+ 0 - 55
zen-api/src/main/kotlin/com/gxzc/zen/logging/model/LogBiz.kt

@@ -1,55 +0,0 @@
-package com.gxzc.zen.logging.model
-
-import java.io.Serializable
-import java.util.*
-
-/**
- *
- * @author NorthLan
- * @date 2018/8/23e
- * @url https://noahlan.com
- */
-open class LogBiz : Serializable {
-    companion object {
-        private const val serialVersionUID = 10000000000000004L
-    }
-
-    /**
-     * 平台ID
-     */
-    var platformId: Int? = null
-    /**
-     * 业务ID
-     */
-    var bizCode: String? = null
-
-    /**
-     * 业务内容(需自行组装)
-     */
-    var bizContent: String? = null
-
-    /**
-     * 操作人account
-     */
-    var operatorAccount: String? = null
-
-    /**
-     * 操作人name
-     */
-    var operatorName: String? = null
-
-    /**
-     * 业务开始时间
-     */
-    var operatorStartTime: Date = Date()
-
-    /**
-     * 业务结束时间
-     */
-    var operatorEndTime: Date = Date()
-
-    /**
-     * 备注
-     */
-    var remark: String? = null
-}

+ 0 - 66
zen-api/src/main/kotlin/com/gxzc/zen/logging/model/LogDB.kt

@@ -1,66 +0,0 @@
-package com.gxzc.zen.logging.model
-
-import java.io.Serializable
-import java.util.*
-
-/**
- * 数据库日志 model
- * @author NorthLan
- * @date 2018/8/23
- * @url https://noahlan.com
- */
-open class LogDB : Serializable {
-    companion object {
-        private const val serialVersionUID = 10000000000000003L
-    }
-
-    /**
-     * 平台ID
-     */
-    var platformId: Int? = null
-
-    /**
-     * 操作 类型
-     */
-    var type: Int = 1
-
-    /**
-     * 执行sql
-     */
-    var sql: String? = null
-
-    /**
-     * 表名
-     */
-    var tableId: String? = null
-
-    /**
-     * 表名 Comment中的
-     */
-    var tableName: String? = null
-
-    /**
-     * 操作人account
-     */
-    var operatorAccount: String? = null
-
-    /**
-     * 操作人name
-     */
-    var operatorName: String? = null
-
-    /**
-     * 操作开始时间
-     */
-    var operatorStartTime: Date = Date()
-
-    /**
-     * 操作结束时间
-     */
-    var operatorEndTime: Date = Date()
-
-    /**
-     * 备注
-     */
-    var remark: String? = null
-}

+ 0 - 86
zen-api/src/main/kotlin/com/gxzc/zen/logging/model/LogRequest.kt

@@ -1,86 +0,0 @@
-package com.gxzc.zen.logging.model
-
-import java.io.Serializable
-import java.util.*
-
-/**
- * 请求日志 model
- * @author NorthLan
- * @date 2018/8/23
- * @url https://noahlan.com
- */
-open class LogRequest : Serializable {
-    companion object {
-        private const val serialVersionUID = 10000000000000002L
-    }
-
-    /**
-     * 平台ID
-     */
-    var platformId: Int? = null
-
-    /**
-     * 请求URI
-     */
-    var requestUri: String? = null
-
-    /**
-     * 请求方法
-     */
-    var requestMethod: String? = null
-
-    /**
-     * 请求携带参数
-     */
-    var requestParam: String? = null
-
-    /**
-     * 请求内容体
-     */
-    var requestBody: String? = null
-
-    /**
-     * 返回内容
-     */
-    var responseBody: String? = null
-
-    /**
-     * targetMethod 请求方法
-     */
-    var method: String? = null
-
-    /**
-     * 操作人account
-     */
-    var operatorAccount: String? = null
-
-    /**
-     * 操作人name
-     */
-    var operatorName: String? = null
-
-    /**
-     * 操作开始时间
-     */
-    var operatorStartTime: Date = Date()
-
-    /**
-     * 操作结束时间
-     */
-    var operatorEndTime: Date = Date()
-
-    /**
-     * 客户端host
-     */
-    var remoteHost: String? = null
-
-    /**
-     * 异常信息
-     */
-    var exMsg: String? = null
-
-    /**
-     * 备注
-     */
-    var remark: String? = null
-}

+ 0 - 12
zen-api/src/main/kotlin/com/gxzc/zen/logging/model/MQLog.kt

@@ -1,12 +0,0 @@
-package com.gxzc.zen.logging.model
-
-/**
- * MQLog 数据类
- * @author NorthLan
- * @date 2018/9/2
- * @url https://noahlan.com
- */
-data class MQLog(
-        val ignore: Boolean = false, // 是否忽略此条Log信息
-        val remark: String? = null // 此条Log信息的remark
-)

+ 0 - 18
zen-api/src/main/resources/mapper/test/TestLogMapper.xml

@@ -1,18 +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="cn.gygxzc.envir.test.dao.ITestLogDao">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="cn.gygxzc.envir.test.model.TestLog">
-        <result column="id" property="id"/>
-        <result column="create_time" property="createTime"/>
-        <result column="create_by" property="createBy"/>
-        <result column="update_time" property="updateTime"/>
-        <result column="update_by" property="updateBy"/>
-        <result column="enable" property="enable"/>
-        <result column="remark" property="remark"/>
-        <result column="message" property="message"/>
-    </resultMap>
-
-
-</mapper>

+ 0 - 141
zen-api/src/main/resources/templates/entity.java.vm

@@ -1,141 +0,0 @@
-package ${package.Entity};
-
-#foreach($pkg in ${table.importPackages})
-import ${pkg};
-#end
-#if(${entityLombokModel})
-
-import com.baomidou.mybatisplus.annotations.Version;
-
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-#end
-
-/**
- * <p>
- * $!{table.comment}
- * </p>
- *
- * @author ${author}
- * @since ${date}
- */
-#if(${entityLombokModel})
-@Data
-    #if(${superEntityClass})
-    @EqualsAndHashCode(callSuper = true)
-    #end
-@Accessors(chain = true)
-#end
-###if(${table.convert})
-@TableName("${table.name}")
-###end
-#if(${superEntityClass})
-public class ${entity} extends ${superEntityClass}#if(${activeRecord})<${entity}>#end {
-#elseif(${activeRecord})
-public class ${entity} extends Model<${entity}> {
-#else
-public class ${entity} implements Serializable {
-#end
-
-private static final long serialVersionUID = 1L;
-
-## ----------  BEGIN 字段循环遍历  ----------
-#foreach($field in ${table.fields})
-    #if(${field.keyFlag})
-        #set($keyPropertyName=${field.propertyName})
-    #end
-    #if("$!field.comment" != "")
-    /**
-     * ${field.comment}
-     */
-    #end
-    #if(${field.keyFlag})
-    ## 主键
-        #if(${field.keyIdentityFlag})
-        @TableId(value = "${field.name}", type = IdType.AUTO)
-        #elseif(!$null.isNull(${idType}) && "$!idType" != "")
-        @TableId(value = "${field.name}", type = IdType.${idType})
-        #elseif(${field.convert})
-        @TableId("${field.name}")
-        #end
-    ## 普通字段
-    #elseif(${field.fill})
-    ## -----   存在字段填充设置   -----
-        #if(${field.convert})
-        @TableField(value = "${field.name}", fill = FieldFill.${field.fill})
-        #else
-        @TableField(fill = FieldFill.${field.fill})
-        #end
-    #elseif(${field.convert})
-    @TableField("${field.name}")
-    #end
-## 乐观锁注解
-    #if(${versionFieldName}==${field.name})
-    @Version
-    #end
-## 逻辑删除注解
-    #if(${logicDeleteFieldName}==${field.name})
-    @TableLogic
-    #end
-private ${field.propertyType} ${field.propertyName};
-#end
-## ----------  END 字段循环遍历  ----------
-
-#if(!${entityLombokModel})
-    #foreach($field in ${table.fields})
-        #if(${field.propertyType.equals("boolean")})
-            #set($getprefix="is")
-        #else
-            #set($getprefix="get")
-        #end
-
-    public ${field.propertyType} ${getprefix}${field.capitalName}() {
-            return ${field.propertyName};
-            }
-
-        #if(${entityBuilderModel})
-        public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
-        #else
-        public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
-        #end
-            this.${field.propertyName} = ${field.propertyName};
-        #if(${entityBuilderModel})
-                return this;
-        #end
-            }
-    #end
-#end
-
-#if(${entityColumnConstant})
-    #foreach($field in ${table.fields})
-    public static final String ${field.name.toUpperCase()} = "${field.name}";
-
-    #end
-#end
-#if(${activeRecord})
-@Override
-protected Serializable pkVal() {
-    #if(${keyPropertyName})
-            return this.${keyPropertyName};
-    #else
-            return this.id;
-    #end
-        }
-
-#end
-#if(!${entityLombokModel})
-@Override
-public String toString() {
-        return "${entity}{" +
-    #foreach($field in ${table.fields})
-        #if($!{velocityCount}==1)
-                "${field.propertyName}=" + ${field.propertyName} +
-        #else
-                ", ${field.propertyName}=" + ${field.propertyName} +
-        #end
-    #end
-        "}";
-        }
-#end
-        }

+ 0 - 92
zen-api/src/main/resources/templates/entity.kt.vm

@@ -1,92 +0,0 @@
-package ${package.Entity}
-
-import com.baomidou.mybatisplus.annotations.TableName
-#foreach($pkg in ${table.importPackages})
-import ${pkg}
-#end
-
-/**
- * <p>
- * $!{table.comment}
- * </p>
- *
- * @author ${author}
- * @since ${date}
- */
-###if(${table.convert})
-@TableName("${table.name}")
-###end
-open class ${entity} : #if(${superEntityClass})${superEntityClass}#if(${activeRecord})<${entity}>#end() {
-#elseif(${activeRecord}) Model<${entity}>() {
-#else Serializable {
-#end
-#if(${entityColumnConstant})
-    companion object {
-    #foreach($field in ${table.fields})
-        const val ${field.name.toUpperCase()} : String = "${field.name}"
-    #end
-}
-#end
-## ----------  BEGIN 字段循环遍历  ----------
-#foreach($field in ${table.fields})
-#if(${field.keyFlag})
-    #set($keyPropertyName=${field.propertyName})
-#end
-#if("$!field.comment" != "")
-    /**
-     * ${field.comment}
-     */
-#end
-#if(${field.keyFlag})
-## 主键
-    #if(${field.keyIdentityFlag})
-    @TableId(value = "${field.name}", type = IdType.AUTO)
-    #elseif(!$null.isNull(${idType}) && "$!idType" != "")
-    @TableId(value = "${field.name}", type = IdType.${idType})
-    #elseif(${field.convert})
-    @TableId("${field.name}")
-    #end
-## 普通字段
-#elseif(${field.fill})
-## -----   存在字段填充设置   -----
-    #if(${field.convert})
-    @TableField(value = "${field.name}", fill = FieldFill.${field.fill})
-    #else
-    @TableField(fill = FieldFill.${field.fill})
-    #end
-#elseif(${field.convert})
-@TableField("${field.name}")
-#end
-## 乐观锁注解
-#if(${versionFieldName}==${field.name})
-@Version
-#end
-## 逻辑删除注解
-#if(${logicDeleteFieldName}==${field.name})
-@TableLogic
-#end
-    var ${field.propertyName}: #if(${field.propertyType} == "Integer")Int#else${field.propertyType}#end? = null#if($foreach.count!=${table.fields.size()})#end
-
-#end
-## ----------  END 字段循环遍历  ----------
-#if(${activeRecord})
-    override fun pkVal(): Serializable {
-        #if(${keyPropertyName})
-        return ${keyPropertyName} !
-        #else
-        return id!!
-        #end
-    }
-#end
-##    override fun toString(): String {
-##        return "${entity}{" +
-###foreach($field in ${table.fields})
-###if($!{velocityCount}==1)
-##        "${field.propertyName}=" + ${field.propertyName} +
-###else
-##        ", ${field.propertyName}=" + ${field.propertyName} +
-###end
-###end
-##        "}"
-##    }
-}

+ 0 - 25
zen-api/src/main/resources/templates/mapper.java.vm

@@ -1,25 +0,0 @@
-package ${package.Mapper}#if(!${kotlin});#end
-
-
-import ${package.Entity}.${entity}#if(!${kotlin});#end
-
-import ${superMapperClassPackage}#if(!${kotlin});#end
-
-import org.springframework.stereotype.Repository#if(!${kotlin});#end
-
-/**
- * <p>
- * $!{table.comment} Mapper 接口
- * </p>
- *
- * @author ${author}
- * @since ${date}
- */
-@Repository
-#if(${kotlin})
-interface ${table.mapperName} : ${superMapperClass}<${entity}>
-#else
-public interface ${table.mapperName} extends ${superMapperClass}<${entity}> {
-
-}
-#end

+ 0 - 22
zen-api/src/main/resources/templates/service.java.vm

@@ -1,22 +0,0 @@
-package ${package.Service}#if(!${kotlin});#end
-
-
-import ${package.Entity}.${entity}#if(!${kotlin});#end
-
-import ${superServiceClassPackage}#if(!${kotlin});#end
-
-/**
- * <p>
- * $!{table.comment} 服务类
- * </p>
- *
- * @author ${author}
- * @since ${date}
- */
-#if(${kotlin})
-interface ${table.serviceName} : ${superServiceClass}<${entity}>
-#else
-public interface ${table.serviceName} extends ${superServiceClass}<${entity}> {
-
-}
-#end

+ 0 - 32
zen-api/src/main/resources/templates/serviceImpl.java.vm

@@ -1,32 +0,0 @@
-package ${package.ServiceImpl}#if(!${kotlin});#end
-
-
-import ${package.Entity}.${entity}#if(!${kotlin});#end
-
-import ${package.Mapper}.${table.mapperName}#if(!${kotlin});#end
-
-import ${package.Service}.${table.serviceName}#if(!${kotlin});#end
-
-import ${superServiceImplClassPackage}#if(!${kotlin});#end
-
-import org.springframework.stereotype.Service#if(!${kotlin});#end
-
-
-/**
- * <p>
- * $!{table.comment} 服务实现类
- * </p>
- *
- * @author ${author}
- * @since ${date}
- */
-@Service
-#if(${kotlin})
-class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} {
-
-}
-#else
-public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} {
-
-}
-#end

+ 0 - 21
zen-core/build.gradle

@@ -1,21 +0,0 @@
-buildscript {
-    repositories {
-        mavenCentral()
-    }
-    dependencies {
-        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
-        classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
-        classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
-    }
-}
-
-
-repositories {
-    mavenCentral()
-}
-
-dependencies {
-    compile 'io.jsonwebtoken:jjwt-api:0.10.5'
-    runtime 'io.jsonwebtoken:jjwt-impl:0.10.5',
-            'io.jsonwebtoken:jjwt-jackson:0.10.5'
-}

+ 0 - 91
zen-core/src/main/java/cn/gygxzc/envir/core/base/BaseModel.java

@@ -1,91 +0,0 @@
-package cn.gygxzc.envir.core.base;
-
-import com.baomidou.mybatisplus.annotation.*;
-import com.fasterxml.jackson.annotation.JsonFormat;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * Created by niantuo on 2018/9/30.
- * 数据库类的基类
- */
-
-public class BaseModel implements Serializable {
-
-    public static final long serialVersionUID = 1L;
-
-    @TableId(type = IdType.ID_WORKER)
-    private Long id;
-    @TableLogic
-    private Boolean enable;
-
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @TableField(fill = FieldFill.INSERT)
-    private Date createTime;
-    @TableField(fill = FieldFill.INSERT)
-    private String createBy;
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @TableField(fill = FieldFill.UPDATE)
-    private Date updateTime;
-    @TableField(fill = FieldFill.UPDATE)
-    private String updateBy;
-
-    private String remark;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Boolean getEnable() {
-        return enable;
-    }
-
-    public void setEnable(Boolean enable) {
-        this.enable = enable;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public String getCreateBy() {
-        return createBy;
-    }
-
-    public void setCreateBy(String createBy) {
-        this.createBy = createBy;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public String getUpdateBy() {
-        return updateBy;
-    }
-
-    public void setUpdateBy(String updateBy) {
-        this.updateBy = updateBy;
-    }
-
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-}

+ 0 - 191
zen-core/src/main/java/cn/gygxzc/envir/core/entity/MailEntity.java

@@ -1,191 +0,0 @@
-package cn.gygxzc.envir.core.entity;
-
-import cn.gygxzc.envir.core.ex.ParamMissException;
-import com.baomidou.mybatisplus.core.toolkit.IdWorker;
-import org.springframework.util.StringUtils;
-
-import javax.activation.DataSource;
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-
-/**
- * @author tuonina
- * @createTime 2019/2/25
- * 自定义的邮件实体类
- */
-public class MailEntity implements Serializable {
-
-    public final static long serialVersionUID = 2L;
-    public final static String SEP = ",";
-
-    private Long id;
-    private String to;
-    private String subject;
-    private String content;
-    private String attachments;
-    private MailType type = MailType.SIMP;
-    private String rscPath;
-    private String filePath;
-    private String rscId;
-    /**
-     * 抄送收件人信息
-     * 收件人能看见抄送人信息
-     */
-    private List<String> cc;
-    /**
-     * 匿名抄送收件人,
-     * 匿名:表示收件人看不见抄送人的邮箱地址
-     */
-    private List<String> bcc;
-    private DataSource dataSource;
-    private String fileName;
-    private Date createTime;
-
-    public MailEntity() {
-        this.cc = Collections.emptyList();
-        this.bcc = Collections.emptyList();
-        this.createTime = new Date();
-        id = IdWorker.getId();
-    }
-
-    public void setDataSource(DataSource dataSource) {
-        this.dataSource = dataSource;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public DataSource getDataSource() {
-        return dataSource;
-    }
-
-    public void setFileName(String fileName) {
-        this.fileName = fileName;
-    }
-
-    public String getFileName() {
-        return fileName;
-    }
-
-    public String getTo() {
-        return to;
-    }
-
-    public void setTo(String to) {
-        this.to = to;
-    }
-
-    public String getSubject() {
-        return subject;
-    }
-
-    public void setSubject(String subject) {
-        this.subject = subject;
-    }
-
-    public String getContent() {
-        return content;
-    }
-
-    public void setContent(String content) {
-        this.content = content;
-    }
-
-    public String getAttachments() {
-        return attachments;
-    }
-
-    public void setAttachments(String attachments) {
-        this.attachments = attachments;
-    }
-
-    public void setFilePath(String filePath) {
-        this.filePath = filePath;
-    }
-
-    public String getFilePath() {
-        return filePath;
-    }
-
-    public MailType getType() {
-        return type;
-    }
-
-    public void setType(MailType type) {
-        this.type = type;
-    }
-
-    public String getRscPath() {
-        return rscPath;
-    }
-
-    public void setRscPath(String rscPath) {
-        this.rscPath = rscPath;
-    }
-
-    public String getRscId() {
-        return rscId;
-    }
-
-    public void setRscId(String rscId) {
-        this.rscId = rscId;
-    }
-
-    public List<String> getCc() {
-        return cc;
-    }
-
-    public void setCc(List<String> cc) {
-        this.cc = cc;
-    }
-
-
-    public List<String> getBcc() {
-        return bcc;
-    }
-
-    public void setBcc(List<String> bcc) {
-        this.bcc = bcc;
-    }
-
-    public void checkParams() throws RuntimeException {
-        if (!StringUtils.hasLength(to)) {
-            throw new ParamMissException("无发送对象!");
-        }
-        if (!StringUtils.hasLength(subject)) {
-            throw new ParamMissException("无邮件主题!");
-        }
-        if (!StringUtils.hasLength(content)) {
-            throw new ParamMissException("无邮件内容!");
-        }
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    /**
-     * SIMP  纯文档,也不存在附件的
-     */
-    public enum MailType {
-        SIMP, HTML, ATTACHMENTS, TEMPLATE
-    }
-
-    @Override
-    public String toString() {
-        return String.format("to:%s  ", to) +
-                String.format("subject:%s  ", subject) +
-                String.format("content:%s  ", content);
-    }
-}

+ 0 - 12
zen-core/src/main/java/cn/gygxzc/envir/core/ex/ParamMissException.java

@@ -1,12 +0,0 @@
-package cn.gygxzc.envir.core.ex;
-
-/**
- * @author tuonina
- * @createTime 2019/2/25
- */
-public class ParamMissException extends RuntimeException {
-
-    public ParamMissException(String message){
-        super(message);
-    }
-}

+ 0 - 108
zen-core/src/main/java/cn/gygxzc/envir/core/logger/CoreLoggerEvent.java

@@ -1,108 +0,0 @@
-package cn.gygxzc.envir.core.logger;
-
-import ch.qos.logback.classic.Level;
-import ch.qos.logback.classic.spi.ILoggingEvent;
-import ch.qos.logback.classic.spi.IThrowableProxy;
-import ch.qos.logback.classic.spi.LoggerContextVO;
-import cn.gygxzc.tina.cloud.jwt.session.bean.User;
-import org.slf4j.Marker;
-
-import java.util.Map;
-
-/**
- * @author tuonina
- * @createTime 2019/3/25
- */
-public class CoreLoggerEvent implements ILoggingEvent {
-
-
-    private ILoggingEvent realEvent;
-    private User user;
-
-    public CoreLoggerEvent(ILoggingEvent event){
-        this.realEvent = event;
-    }
-
-    public void setUser(User user) {
-        this.user = user;
-    }
-
-    public User getUser() {
-        return user;
-    }
-
-    @Override
-    public String getThreadName() {
-        return realEvent.getThreadName();
-    }
-
-    @Override
-    public Level getLevel() {
-        return realEvent.getLevel();
-    }
-
-    @Override
-    public String getMessage() {
-        return realEvent.getMessage();
-    }
-
-    @Override
-    public Object[] getArgumentArray() {
-        return realEvent.getArgumentArray();
-    }
-
-    @Override
-    public String getFormattedMessage() {
-        return realEvent.getFormattedMessage();
-    }
-
-    @Override
-    public String getLoggerName() {
-        return realEvent.getLoggerName();
-    }
-
-    @Override
-    public LoggerContextVO getLoggerContextVO() {
-        return realEvent.getLoggerContextVO();
-    }
-
-    @Override
-    public IThrowableProxy getThrowableProxy() {
-        return realEvent.getThrowableProxy();
-    }
-
-    @Override
-    public StackTraceElement[] getCallerData() {
-        return realEvent.getCallerData();
-    }
-
-    @Override
-    public boolean hasCallerData() {
-        return realEvent.hasCallerData();
-    }
-
-    @Override
-    public Marker getMarker() {
-        return realEvent.getMarker();
-    }
-
-    @Override
-    public Map<String, String> getMDCPropertyMap() {
-        return realEvent.getMDCPropertyMap();
-    }
-
-    @Override
-    public Map<String, String> getMdc() {
-        return realEvent.getMdc();
-    }
-
-    @Override
-    public long getTimeStamp() {
-        return realEvent.getTimeStamp();
-    }
-
-    @Override
-    public void prepareForDeferredProcessing() {
-        realEvent.prepareForDeferredProcessing();
-    }
-}

+ 0 - 12
zen-core/src/main/java/cn/gygxzc/envir/core/logger/ILoggerSender.java

@@ -1,12 +0,0 @@
-package cn.gygxzc.envir.core.logger;
-
-/**
- * @program: Zen-Framework
- * @description: ${description}
- * @author: tuonina
- * @create: 2018-12-15 18:48
- **/
-public interface ILoggerSender {
-
-    public void send(LogMessage message);
-}

+ 0 - 13
zen-core/src/main/java/cn/gygxzc/envir/core/logger/IMarkerName.java

@@ -1,13 +0,0 @@
-package cn.gygxzc.envir.core.logger;
-
-/**
- * @author tuonina
- * @createTime 2019/3/25
- */
-public interface IMarkerName {
-
-    String REQ="REQ";
-    String OP="OP";
-    String ERR="ERR";
-    String BIZ_ERR="BIZ_ERR";
-}

+ 0 - 175
zen-core/src/main/java/cn/gygxzc/envir/core/logger/LogMessage.java

@@ -1,175 +0,0 @@
-package cn.gygxzc.envir.core.logger;
-
-import ch.qos.logback.classic.spi.ILoggingEvent;
-import cn.gygxzc.envir.core.utils.GsonUtils;
-import cn.gygxzc.tina.cloud.jwt.session.bean.User;
-import org.slf4j.Marker;
-
-import java.io.Serializable;
-
-/**
- * Created by niantuo on 2018/11/5.
- * 分布式日志记录
- */
-
-public class LogMessage implements Serializable {
-
-
-    public static final long serialVersionUID = 1L;
-
-    private String sysName;
-    private String threadName;
-    private String level;
-    private String message;
-    private String arguments;
-    private String formattedMessage;
-    private String loggerName;
-    private String callerData;
-    private String marker;
-    private String propertyMap;
-    private Long timeStamp;
-    private Long userId;
-    private String account;
-    private String errMsg;
-
-    public LogMessage() {
-
-    }
-
-    public LogMessage(ILoggingEvent event, String name) {
-        this.sysName = name;
-        this.threadName = event.getThreadName();
-        level = event.getLevel().levelStr;
-        message = event.getMessage();
-        arguments = GsonUtils.toJson(event.getArgumentArray());
-        formattedMessage = event.getFormattedMessage();
-        loggerName = event.getLoggerName();
-        callerData = GsonUtils.toJson(event.getCallerData());
-
-        propertyMap = GsonUtils.toJson(event.getMDCPropertyMap());
-        timeStamp = event.getTimeStamp();
-        errMsg = GsonUtils.toJson(event.getThrowableProxy());
-        Marker eventMarker = event.getMarker();
-        if (eventMarker != null) {
-            marker = eventMarker.toString();
-        }
-    }
-
-    public void setUser(User user){
-        if (user==null)return;
-        setUserId(user.getId());
-        setAccount(user.getAccount());
-    }
-
-    public void setUserId(Long userId) {
-        this.userId = userId;
-    }
-
-    public Long getUserId() {
-        return userId;
-    }
-
-    public void setAccount(String account) {
-        this.account = account;
-    }
-
-    public String getAccount() {
-        return account;
-    }
-
-    public void setSysName(String sysName) {
-        this.sysName = sysName;
-    }
-
-    public String getSysName() {
-        return sysName;
-    }
-
-    public String getThreadName() {
-        return threadName;
-    }
-
-    public void setThreadName(String threadName) {
-        this.threadName = threadName;
-    }
-
-    public String getLevel() {
-        return level;
-    }
-
-    public void setLevel(String level) {
-        this.level = level;
-    }
-
-    public String getMessage() {
-        return message;
-    }
-
-    public void setMessage(String message) {
-        this.message = message;
-    }
-
-    public String getArguments() {
-        return arguments;
-    }
-
-    public void setArguments(String arguments) {
-        this.arguments = arguments;
-    }
-
-    public String getFormattedMessage() {
-        return formattedMessage;
-    }
-
-    public void setFormattedMessage(String formattedMessage) {
-        this.formattedMessage = formattedMessage;
-    }
-
-    public String getLoggerName() {
-        return loggerName;
-    }
-
-    public void setLoggerName(String loggerName) {
-        this.loggerName = loggerName;
-    }
-
-    public String getCallerData() {
-        return callerData;
-    }
-
-    public void setCallerData(String callerData) {
-        this.callerData = callerData;
-    }
-
-    public String getMarker() {
-        return marker;
-    }
-
-    public void setMarker(String marker) {
-        this.marker = marker;
-    }
-
-    public String getPropertyMap() {
-        return propertyMap;
-    }
-
-    public void setPropertyMap(String propertyMap) {
-        this.propertyMap = propertyMap;
-    }
-
-    public Long getTimeStamp() {
-        return timeStamp;
-    }
-
-    public void setTimeStamp(Long timeStamp) {
-        this.timeStamp = timeStamp;
-    }
-
-    public void setErrMsg(String errMsg) {
-        this.errMsg = errMsg;
-    }
-
-    public String getErrMsg() {
-        return errMsg;
-    }
-}

+ 0 - 51
zen-core/src/main/java/cn/gygxzc/envir/core/logger/MQAppender.java

@@ -1,51 +0,0 @@
-package cn.gygxzc.envir.core.logger;
-
-import ch.qos.logback.classic.spi.ILoggingEvent;
-import ch.qos.logback.core.AppenderBase;
-import cn.gygxzc.envir.core.utils.ApplicationUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Created by niantuo on 2018/11/5.
- * 这个异步日志收集。
- * 利用Rabbitmq 消息中间件,将日志异步传递的日志分析系统中统计去记录和处理
- */
-public class MQAppender extends AppenderBase<ILoggingEvent> {
-    private final static Logger logger = LoggerFactory.getLogger(MQAppender.class);
-
-    private ILoggerSender mMessageSender;
-    private String sysName;
-
-    public MQAppender() {
-        logger.debug("construct");
-    }
-
-    public void setSysName(String sysName) {
-        this.sysName = sysName;
-    }
-
-    public String getSysName() {
-        return sysName;
-    }
-
-    private void ensureSender() {
-        if (mMessageSender == null) {
-            mMessageSender = ApplicationUtils.getBean(ILoggerSender.class);
-        }
-    }
-
-
-    @Override
-    protected void append(ILoggingEvent eventObject) {
-        LogMessage message = new LogMessage(eventObject, sysName);
-        if (eventObject instanceof CoreLoggerEvent){
-            message.setUser(((CoreLoggerEvent) eventObject).getUser());
-        }
-        ensureSender();
-        if (mMessageSender != null) {
-            mMessageSender.send(message);
-        }
-    }
-
-}

+ 0 - 87
zen-core/src/main/java/cn/gygxzc/envir/core/logger/MQAsyncAppender.java

@@ -1,87 +0,0 @@
-package cn.gygxzc.envir.core.logger;
-
-import ch.qos.logback.classic.Level;
-import ch.qos.logback.classic.spi.ILoggingEvent;
-import ch.qos.logback.core.AsyncAppenderBase;
-import ch.qos.logback.core.spi.FilterReply;
-import ch.qos.logback.core.status.WarnStatus;
-import cn.gygxzc.tina.cloud.jwt.session.utils.SessionUtils;
-
-/**
- * @author tuonina
- * @createTime 2019/3/25
- */
-public class MQAsyncAppender extends AsyncAppenderBase<ILoggingEvent> {
-
-
-    private boolean includeCallerData = false;
-    /**
-     * The guard prevents an appender from repeatedly calling its own doAppend
-     * method.
-     */
-    private ThreadLocal<Boolean> guard = new ThreadLocal<Boolean>();
-    private int statusRepeatCount = 0;
-    private int exceptionCount = 0;
-    private static final int ALLOWED_REPEATS = 3;
-
-
-    @Override
-    public void doAppend(ILoggingEvent eventObject) {
-        // WARNING: The guard check MUST be the first statement in the
-        // doAppend() method.
-        // prevent re-entry.
-        if (Boolean.TRUE.equals(guard.get())) {
-            return;
-        }
-        try {
-            guard.set(Boolean.TRUE);
-            if (!this.started) {
-                if (statusRepeatCount++ < ALLOWED_REPEATS) {
-                    addStatus(new WarnStatus("Attempted to append to non started appender [" + name + "].", this));
-                }
-                return;
-            }
-
-            if (getFilterChainDecision(eventObject) == FilterReply.DENY) {
-                return;
-            }
-
-            CoreLoggerEvent loggerEvent = new CoreLoggerEvent(eventObject);
-            loggerEvent.setUser(SessionUtils.getUser());
-            // ok, we now invoke derived class' implementation of append
-            this.append(loggerEvent);
-
-        } catch (Exception e) {
-            if (exceptionCount++ < ALLOWED_REPEATS) {
-                addError("Appender [" + name + "] failed to append.", e);
-            }
-        } finally {
-            guard.set(Boolean.FALSE);
-        }
-    }
-
-    /**
-     * Events of level TRACE, DEBUG and INFO are deemed to be discardable.
-     *
-     * @param event
-     * @return true if the event is of level TRACE, DEBUG or INFO false otherwise.
-     */
-    protected boolean isDiscardable(ILoggingEvent event) {
-        Level level = event.getLevel();
-        return level.toInt() <= Level.INFO_INT;
-    }
-
-    protected void preprocess(ILoggingEvent eventObject) {
-        eventObject.prepareForDeferredProcessing();
-        if (includeCallerData)
-            eventObject.getCallerData();
-    }
-
-    public boolean isIncludeCallerData() {
-        return includeCallerData;
-    }
-
-    public void setIncludeCallerData(boolean includeCallerData) {
-        this.includeCallerData = includeCallerData;
-    }
-}

+ 0 - 16
zen-core/src/main/java/cn/gygxzc/envir/core/orm/DataSourceConfiguration.java

@@ -1,16 +0,0 @@
-package cn.gygxzc.envir.core.orm;
-
-import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.jdbc.datasource.init.DataSourceInitializer;
-
-/**
- * Created by niantuo on 2018/12/13.
- */
-@Configuration
-@AutoConfigureBefore(MybatisPlusAutoConfiguration.class)
-public class DataSourceConfiguration {
-
-
-}

+ 0 - 126
zen-core/src/main/java/cn/gygxzc/envir/core/redis/JedisConnectionConfiguration.java

@@ -1,126 +0,0 @@
-package cn.gygxzc.envir.core.redis;
-
-import org.apache.commons.pool2.impl.GenericObjectPool;
-import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.data.redis.JedisClientConfigurationBuilderCustomizer;
-import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Primary;
-import org.springframework.data.redis.connection.RedisClusterConfiguration;
-import org.springframework.data.redis.connection.RedisConnectionFactory;
-import org.springframework.data.redis.connection.RedisSentinelConfiguration;
-import org.springframework.data.redis.connection.jedis.JedisClientConfiguration;
-import org.springframework.data.redis.connection.jedis.JedisConnection;
-import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
-import org.springframework.util.StringUtils;
-import redis.clients.jedis.Jedis;
-import redis.clients.jedis.JedisPoolConfig;
-
-import java.time.Duration;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Created by niantuo on 2018/11/1.
- * Jedis 配置
- */
-
-@Configuration
-@EnableConfigurationProperties(RedisProperties.class)
-@ConditionalOnClass({GenericObjectPool.class, JedisConnection.class, Jedis.class})
-public class JedisConnectionConfiguration extends RedisConnectionConfiguration {
-
-    private final RedisProperties properties;
-
-    private final List<JedisClientConfigurationBuilderCustomizer> builderCustomizers;
-
-    JedisConnectionConfiguration(RedisProperties properties,
-                                 ObjectProvider<RedisSentinelConfiguration> sentinelConfiguration,
-                                 ObjectProvider<RedisClusterConfiguration> clusterConfiguration,
-                                 ObjectProvider<List<JedisClientConfigurationBuilderCustomizer>> builderCustomizers) {
-        super(properties, sentinelConfiguration, clusterConfiguration);
-        this.properties = properties;
-        this.builderCustomizers = builderCustomizers
-                .getIfAvailable(Collections::emptyList);
-    }
-
-    @Bean
-    @Primary
-    public RedisConnectionFactory redisConnectionFactory() {
-        return createJedisConnectionFactory();
-    }
-
-    private JedisConnectionFactory createJedisConnectionFactory() {
-        JedisClientConfiguration clientConfiguration = getJedisClientConfiguration();
-        if (getSentinelConfig() != null) {
-            return new JedisConnectionFactory(getSentinelConfig(), clientConfiguration);
-        }
-        if (getClusterConfiguration() != null) {
-            return new JedisConnectionFactory(getClusterConfiguration(),
-                    clientConfiguration);
-        }
-        return new JedisConnectionFactory(getStandaloneConfig(), clientConfiguration);
-    }
-
-    private JedisClientConfiguration getJedisClientConfiguration() {
-        JedisClientConfiguration.JedisClientConfigurationBuilder builder = applyProperties(
-                JedisClientConfiguration.builder());
-        RedisProperties.Pool pool = this.properties.getJedis().getPool();
-        if (pool != null) {
-            applyPooling(pool, builder);
-        }
-        if (StringUtils.hasText(this.properties.getUrl())) {
-            customizeConfigurationFromUrl(builder);
-        }
-        customize(builder);
-        return builder.build();
-    }
-
-    private JedisClientConfiguration.JedisClientConfigurationBuilder applyProperties(
-            JedisClientConfiguration.JedisClientConfigurationBuilder builder) {
-        if (this.properties.isSsl()) {
-            builder.useSsl();
-        }
-        if (this.properties.getTimeout() != null) {
-            Duration timeout = this.properties.getTimeout();
-            builder.readTimeout(timeout).connectTimeout(timeout);
-        }
-        return builder;
-    }
-
-    private void applyPooling(RedisProperties.Pool pool,
-                              JedisClientConfiguration.JedisClientConfigurationBuilder builder) {
-        builder.usePooling().poolConfig(jedisPoolConfig(pool));
-    }
-
-    private JedisPoolConfig jedisPoolConfig(RedisProperties.Pool pool) {
-        JedisPoolConfig config = new JedisPoolConfig();
-        config.setMaxTotal(pool.getMaxActive());
-        config.setMaxIdle(pool.getMaxIdle());
-        config.setMinIdle(pool.getMinIdle());
-        if (pool.getMaxWait() != null) {
-            config.setMaxWaitMillis(pool.getMaxWait().toMillis());
-        }
-        return config;
-    }
-
-    private void customizeConfigurationFromUrl(
-            JedisClientConfiguration.JedisClientConfigurationBuilder builder) {
-        RedisConnectionConfiguration.ConnectionInfo connectionInfo = parseUrl(this.properties.getUrl());
-        if (connectionInfo.isUseSsl()) {
-            builder.useSsl();
-        }
-    }
-
-    private void customize(
-            JedisClientConfiguration.JedisClientConfigurationBuilder builder) {
-        for (JedisClientConfigurationBuilderCustomizer customizer : this.builderCustomizers) {
-            customizer.customize(builder);
-        }
-    }
-
-
-}

+ 0 - 68
zen-core/src/main/java/cn/gygxzc/envir/core/redis/RedisAutoConfiguration.java

@@ -1,68 +0,0 @@
-package cn.gygxzc.envir.core.redis;
-
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.cache.CacheManager;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Primary;
-import org.springframework.data.redis.cache.RedisCacheManager;
-import org.springframework.data.redis.connection.RedisConnectionFactory;
-import org.springframework.data.redis.core.RedisOperations;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.data.redis.core.StringRedisTemplate;
-import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
-import org.springframework.data.redis.serializer.StringRedisSerializer;
-
-import java.text.SimpleDateFormat;
-
-/**
- * Created by niantuo on 2018/11/1.
- * redis 缓存配置
- */
-@Configuration
-@ConditionalOnClass(RedisOperations.class)
-@EnableConfigurationProperties(RedisProperties.class)
-public class RedisAutoConfiguration {
-
-
-    @Primary
-    @Bean("redisCacheManager")
-    public CacheManager cacheManager(RedisConnectionFactory connectionFactory) {
-        return RedisCacheManager.create(connectionFactory);
-
-    }
-
-    @Primary
-    @Bean("redisTemplate")
-    public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
-        RedisTemplate<Object, Object> template = new RedisTemplate<>();
-        StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
-        template.setKeySerializer(stringRedisSerializer);
-        template.setHashKeySerializer(stringRedisSerializer);
-
-
-        ObjectMapper objectMapper = new ObjectMapper();
-        objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
-        objectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY);
-
-        GenericJackson2JsonRedisSerializer jsonRedisSerializer = new GenericJackson2JsonRedisSerializer(objectMapper);
-        template.setValueSerializer(jsonRedisSerializer);
-        template.setHashValueSerializer(jsonRedisSerializer);
-        template.setConnectionFactory(redisConnectionFactory);
-        return template;
-    }
-
-    @Bean
-    @Primary
-    public StringRedisTemplate stringRedisTemplate(RedisConnectionFactory redisConnectionFactory) {
-        StringRedisTemplate template = new StringRedisTemplate();
-        template.setConnectionFactory(redisConnectionFactory);
-        return template;
-    }
-
-
-}

+ 0 - 157
zen-core/src/main/java/cn/gygxzc/envir/core/redis/RedisConnectionConfiguration.java

@@ -1,157 +0,0 @@
-package cn.gygxzc.envir.core.redis;
-
-import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
-import org.springframework.data.redis.connection.*;
-import org.springframework.util.Assert;
-import org.springframework.util.StringUtils;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Created by niantuo on 2018/11/1.
- * 完全的抄袭源代码
- */
-
-public class RedisConnectionConfiguration {
-
-    private final RedisProperties properties;
-
-    private final RedisSentinelConfiguration sentinelConfiguration;
-
-    private final RedisClusterConfiguration clusterConfiguration;
-
-    protected RedisConnectionConfiguration(RedisProperties properties,
-                                           ObjectProvider<RedisSentinelConfiguration> sentinelConfigurationProvider,
-                                           ObjectProvider<RedisClusterConfiguration> clusterConfigurationProvider) {
-        this.properties = properties;
-        this.sentinelConfiguration = sentinelConfigurationProvider.getIfAvailable();
-        this.clusterConfiguration = clusterConfigurationProvider.getIfAvailable();
-    }
-
-    protected final RedisStandaloneConfiguration getStandaloneConfig() {
-        RedisStandaloneConfiguration config = new RedisStandaloneConfiguration();
-        if (StringUtils.hasText(this.properties.getUrl())) {
-            ConnectionInfo connectionInfo = parseUrl(this.properties.getUrl());
-            config.setHostName(connectionInfo.getHostName());
-            config.setPort(connectionInfo.getPort());
-            config.setPassword(RedisPassword.of(connectionInfo.getPassword()));
-        } else {
-            config.setHostName(this.properties.getHost());
-            config.setPort(this.properties.getPort());
-            config.setPassword(RedisPassword.of(this.properties.getPassword()));
-        }
-        config.setDatabase(this.properties.getDatabase());
-        return config;
-    }
-
-    protected final RedisSentinelConfiguration getSentinelConfig() {
-        if (this.sentinelConfiguration != null) {
-            return this.sentinelConfiguration;
-        }
-        RedisProperties.Sentinel sentinelProperties = this.properties.getSentinel();
-        if (sentinelProperties != null) {
-            RedisSentinelConfiguration config = new RedisSentinelConfiguration();
-            config.master(sentinelProperties.getMaster());
-            config.setSentinels(createSentinels(sentinelProperties));
-            if (this.properties.getPassword() != null) {
-                config.setPassword(RedisPassword.of(this.properties.getPassword()));
-            }
-            config.setDatabase(this.properties.getDatabase());
-            return config;
-        }
-        return null;
-    }
-
-    /**
-     * Create a {@link RedisClusterConfiguration} if necessary.
-     *
-     * @return {@literal null} if no cluster settings are set.
-     */
-    protected final RedisClusterConfiguration getClusterConfiguration() {
-        if (this.clusterConfiguration != null) {
-            return this.clusterConfiguration;
-        }
-        if (this.properties.getCluster() == null) {
-            return null;
-        }
-        RedisProperties.Cluster clusterProperties = this.properties.getCluster();
-        RedisClusterConfiguration config = new RedisClusterConfiguration(
-                clusterProperties.getNodes());
-        if (clusterProperties.getMaxRedirects() != null) {
-            config.setMaxRedirects(clusterProperties.getMaxRedirects());
-        }
-        if (this.properties.getPassword() != null) {
-            config.setPassword(RedisPassword.of(this.properties.getPassword()));
-        }
-        return config;
-    }
-
-    private List<RedisNode> createSentinels(RedisProperties.Sentinel sentinel) {
-        List<RedisNode> nodes = new ArrayList<>();
-        for (String node : sentinel.getNodes()) {
-            try {
-                String[] parts = StringUtils.split(node, ":");
-                Assert.state(parts.length == 2, "Must be defined as 'host:port'");
-                nodes.add(new RedisNode(parts[0], Integer.valueOf(parts[1])));
-            } catch (RuntimeException ex) {
-                throw new IllegalStateException(
-                        "Invalid redis sentinel " + "property '" + node + "'", ex);
-            }
-        }
-        return nodes;
-    }
-
-    protected ConnectionInfo parseUrl(String url) {
-        try {
-            URI uri = new URI(url);
-            boolean useSsl = (url.startsWith("rediss://"));
-            String password = null;
-            if (uri.getUserInfo() != null) {
-                password = uri.getUserInfo();
-                int index = password.indexOf(':');
-                if (index >= 0) {
-                    password = password.substring(index + 1);
-                }
-            }
-            return new ConnectionInfo(uri, useSsl, password);
-        } catch (URISyntaxException ex) {
-            throw new IllegalArgumentException("Malformed url '" + url + "'", ex);
-        }
-    }
-
-    protected static class ConnectionInfo {
-
-        private final URI uri;
-
-        private final boolean useSsl;
-
-        private final String password;
-
-        public ConnectionInfo(URI uri, boolean useSsl, String password) {
-            this.uri = uri;
-            this.useSsl = useSsl;
-            this.password = password;
-        }
-
-        public boolean isUseSsl() {
-            return this.useSsl;
-        }
-
-        public String getHostName() {
-            return this.uri.getHost();
-        }
-
-        public int getPort() {
-            return this.uri.getPort();
-        }
-
-        public String getPassword() {
-            return this.password;
-        }
-
-    }
-}

+ 0 - 40
zen-core/src/main/java/cn/gygxzc/envir/core/utils/ApplicationUtils.java

@@ -1,40 +0,0 @@
-package cn.gygxzc.envir.core.utils;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.BeansException;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-import org.springframework.stereotype.Component;
-
-/**
- * Created by niantuo on 2018/11/5.
- * 获取bean类
- */
-@Component
-public class ApplicationUtils implements ApplicationContextAware {
-
-    private static ApplicationContext mContext;
-    private final static Logger logger = LoggerFactory.getLogger(ApplicationUtils.class);
-
-
-    /**
-     * @param clz s
-     * @param <T>
-     * @return
-     */
-    public static <T> T getBean(Class<T> clz) {
-        if (mContext == null) return null;
-        try {
-            return mContext.getBean(clz);
-        } catch (Exception ignored) {
-            logger.info("no bean found {}",clz.getName());
-        }
-        return null;
-    }
-
-    @Override
-    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
-        mContext = applicationContext;
-    }
-}

+ 0 - 26
zen-core/src/main/java/cn/gygxzc/envir/core/utils/GsonUtils.java

@@ -1,26 +0,0 @@
-package cn.gygxzc.envir.core.utils;
-
-import com.google.gson.Gson;
-
-/**
- * Created by niantuo on 2018/11/5.
- */
-
-public class GsonUtils {
-    private final static Gson mGson = new Gson();
-
-    public static String toJson(Object obj) {
-        return mGson.toJson(obj);
-    }
-
-    /**
-     * 实际上如果是数组,这样子是解析不出来的吧。
-     * @param clz 要返回的类型
-     * @param json 原始json数据
-     * @param <T> 泛型
-     * @return
-     */
-    public static <T> T fromJson(Class<T> clz, String json) {
-        return mGson.fromJson(json, clz);
-    }
-}

+ 0 - 26
zen-core/src/main/java/cn/gygxzc/envir/core/utils/HttpUtils.java

@@ -1,26 +0,0 @@
-package cn.gygxzc.envir.core.utils;
-
-import org.springframework.web.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * Created by niantuo on 2018/10/19.
- * 工具类
- */
-
-public class HttpUtils {
-
-    /**
-     * 获取请求体
-     * @return 请求
-     */
-    public HttpServletRequest getRequest(){
-        return ((ServletRequestAttributes)(RequestContextHolder.getRequestAttributes())).getRequest();
-    }
-
-    public static ServletRequestAttributes getRequestAttributes(){
-        return (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
-    }
-}

+ 0 - 8
zen-core/src/main/kotlin/cn/gygxzc/envir/core/CoreConst.kt

@@ -1,8 +0,0 @@
-package cn.gygxzc.envir.core
-
-/**
- * @author tuonina
- * @createTime 2019/2/26
- * 系统界别的常量
- */
-

+ 0 - 75
zen-core/src/main/kotlin/cn/gygxzc/envir/core/caffeine/CaffeineConfiguration.kt

@@ -1,75 +0,0 @@
-package cn.gygxzc.envir.core.caffeine
-
-import com.github.benmanes.caffeine.cache.Caffeine
-import org.springframework.beans.factory.annotation.Autowired
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
-import org.springframework.boot.context.properties.EnableConfigurationProperties
-import org.springframework.cache.CacheManager
-import org.springframework.cache.caffeine.CaffeineCache
-import org.springframework.cache.support.SimpleCacheManager
-import org.springframework.context.annotation.Bean
-import org.springframework.context.annotation.Configuration
-import java.util.concurrent.TimeUnit
-
-/**
- * Created by niantuo on 2018/9/29.
- * caffeine 缓存配置
- */
-
-@Configuration
-@EnableConfigurationProperties(CaffeineProperties::class)
-@ConditionalOnProperty(prefix = "cache.caffeine", name = arrayOf("enable"), havingValue = "true")
-open class CaffeineConfiguration {
-
-    @Autowired
-    private lateinit var properties: CaffeineProperties
-
-    @Bean("caffeineCacheManager")
-   open fun caffeineCacheManager(): CacheManager {
-        return SimpleCacheManager().also {
-            it.setCaches(buildCache())
-        }
-    }
-
-    fun buildCache(): MutableCollection<CaffeineCache> {
-        val collection = mutableListOf<CaffeineCache>()
-        properties.cacheSpec.forEach { name, spec ->
-            run {
-                val builder = Caffeine.newBuilder().also {
-                    if (spec.initialCapacity > 0) {
-                        it.initialCapacity(spec.initialCapacity)
-                    }
-                    if (spec.maximumSize > 0) {
-                        it.maximumSize(spec.maximumSize)
-                    }
-                    if (spec.maximumWeight > 0) {
-                        it.maximumWeight(spec.maximumWeight)
-                    }
-                    if (spec.expireAfterAccess > 0) {
-                        it.expireAfterAccess(spec.expireAfterAccess, TimeUnit.SECONDS)
-                    }
-                    if (spec.expireAfterWrite > 0) {
-                        it.expireAfterWrite(spec.expireAfterWrite, TimeUnit.SECONDS)
-                    }
-                    if (spec.refreshAfterWrite > 0) {
-                        it.refreshAfterWrite(spec.refreshAfterWrite, TimeUnit.SECONDS)
-                    }
-                    if (spec.isWeakKeys) {
-                        it.weakKeys()
-                    }
-                    if (spec.isWeakValues) {
-                        it.weakValues()
-                    }
-                    if (spec.isSoftValues) {
-                        it.softValues()
-                    }
-                    if (spec.isRecordStats) {
-                        it.recordStats()
-                    }
-                }
-                collection.add(CaffeineCache(name, builder.build()))
-            }
-        }
-        return collection
-    }
-}

+ 0 - 31
zen-core/src/main/kotlin/cn/gygxzc/envir/core/caffeine/CaffeineProperties.kt

@@ -1,31 +0,0 @@
-package cn.gygxzc.envir.core.caffeine
-
-import org.springframework.boot.context.properties.ConfigurationProperties
-import java.util.*
-
-/**
- * Created by niantuo on 2018/9/29.
- * caffeine 内存缓存配置
- */
-@ConfigurationProperties(prefix = "cache.caffeine")
-class CaffeineProperties {
-
-    var enable = true
-    var cacheSpec = HashMap<String, CacheSpec>()
-
-    /**
-     * 缓存配置
-     */
-    class CacheSpec {
-        var initialCapacity: Int = 0
-        var maximumSize: Long = 0
-        var maximumWeight: Long = 0
-        var expireAfterAccess: Long = 0
-        var expireAfterWrite: Long = 0
-        var refreshAfterWrite: Long = 0
-        var isWeakKeys: Boolean = false
-        var isWeakValues: Boolean = false
-        var isSoftValues: Boolean = false
-        var isRecordStats: Boolean = false
-    }
-}

+ 0 - 11
zen-core/src/main/kotlin/cn/gygxzc/envir/core/exceptions/InvalidRequestException.kt

@@ -1,11 +0,0 @@
-package cn.gygxzc.envir.core.exceptions
-
-import java.lang.RuntimeException
-
-/**
- * @author tuonina
- * @createTime 2019/2/26
- * 无效请求,比如请求头不满足约定
- */
-class InvalidRequestException(errMsg:String) :RuntimeException(errMsg) {
-}

+ 0 - 119
zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/Generator.kt

@@ -1,119 +0,0 @@
-package cn.gygxzc.envir.core.orm
-
-import com.baomidou.mybatisplus.annotation.DbType
-import com.baomidou.mybatisplus.generator.AutoGenerator
-import com.baomidou.mybatisplus.generator.InjectionConfig
-import com.baomidou.mybatisplus.generator.config.*
-import com.baomidou.mybatisplus.generator.config.converts.MySqlTypeConvert
-import com.baomidou.mybatisplus.generator.config.po.TableInfo
-import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy
-import java.io.File
-
-/**
- * 代码生成器
- * @author NorthLan
- * @date 2018/1/24
- * @url https://noahlan.me
- */
-fun main(args: Array<String>) {
-    generate(true, "NorthLan", "test", DataSourceConfig().also {
-        it.dbType = DbType.MYSQL
-        it.typeConvert = MySqlTypeConvert()
-        it.driverName = "com.mysql.jdbc.Driver"
-        it.username = "archives"
-        it.password = "archives"
-        it.url = "jdbc:mysql://192.168.1.10:3306/archives_sys?characterEncoding=utf8"
-        //        it.url = "jdbc:mysql://127.0.0.1:3306/archives_mgr?characterEncoding=utf8"
-        //        it.username = "root"
-        //        it.password = "root"
-    })
-}
-
-/**
- * 代码生成器具体执行方法<br>
- * @param isKotlin 是否生成kotlin代码
- * @param author 作者
- * @param pkgType 包类别 (sys/bus)
- * @param dataSourceConfig 数据源配置
- */
-fun generate(isKotlin: Boolean, author: String, pkgType: String, dataSourceConfig: DataSourceConfig) {
-    val mpg = AutoGenerator()
-
-    val path = File("zen-api").absolutePath
-
-    // 全局配置
-    mpg.globalConfig = GlobalConfig().also {
-        it.outputDir = if (isKotlin) {
-            "$path/src/main/kotlin"
-        } else {
-            "$path/src/main/java"
-        }
-        it.isFileOverride = true
-        it.isActiveRecord = false
-        it.isEnableCache = false
-        it.isOpen = false
-        it.author = author
-        it.isKotlin = isKotlin
-        it.isBaseResultMap = true
-        it.isBaseColumnList = false
-        it.mapperName = "%sMapper"
-        it.xmlName = "%sMapper"
-        it.serviceName = "I%sService"
-        it.serviceImplName = "%sServiceImpl"
-    }
-
-    // 数据源
-    mpg.dataSource = dataSourceConfig
-
-    // 策略配置
-    mpg.strategy = StrategyConfig().also {
-        it.isEntityLombokModel = true
-        it.isEntityLombokModel = true
-        it.isCapitalMode = false
-        it.naming = NamingStrategy.underline_to_camel
-//        it.setTablePrefix("t")
-        it.superEntityClass = "com.gxzc.zen.common.base.BaseModel"
-        it.setSuperEntityColumns("id", "create_by", "create_time", "update_by", "update_time", "remark", "enable")
-        it.superMapperClass = "com.gxzc.zen.common.base.IBaseMapper"
-        it.superServiceClass = "com.gxzc.zen.common.base.IBaseService"
-        it.superServiceImplClass = "com.baomidou.mybatisplus.service.impl.ServiceImpl"
-//            superControllerClass = ""
-        it.setInclude("sys_upload_info")
-        it.isEntityBooleanColumnRemoveIsPrefix = true
-        it.logicDeleteFieldName = "enable"
-//            setExclude("")
-    }
-
-    // 包配置
-    mpg.packageInfo = PackageConfig().also {
-        it.parent = "com.gxzc.zen.api.$pkgType"
-        it.entity = "model"
-    }
-
-
-    val cfg = object : InjectionConfig() {
-        override fun initMap() {
-        }
-    }.also {
-        it.fileOutConfigList = ArrayList<FileOutConfig>().also {
-            it.add(object : FileOutConfig("/templates/mapper.xml.vm") {
-                override fun outputFile(tableInfo: TableInfo?): String {
-                    return "$path/src/main/resources/mapping/$pkgType/${tableInfo?.mapperName}.xml"
-                }
-            })
-        }
-    }
-
-    mpg.cfg = cfg
-
-    mpg.template = TemplateConfig().also {
-        it.controller = null // 不生成controller
-        it.xml = null
-//        it.service = null
-//        it.mapper = null
-    }
-
-    mpg.execute()
-}
-
-

+ 0 - 56
zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/MybatisPlusConfig.kt

@@ -1,56 +0,0 @@
-package cn.gygxzc.envir.core.orm
-
-import cn.gygxzc.envir.core.orm.handler.CustomMetaObjectHandler
-import cn.gygxzc.envir.core.orm.injector.LogicMoreSqlInjector
-import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler
-import com.baomidou.mybatisplus.core.injector.ISqlInjector
-import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor
-import com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor
-import org.springframework.context.annotation.Bean
-import org.springframework.context.annotation.Configuration
-import org.springframework.context.annotation.Profile
-import org.springframework.transaction.annotation.EnableTransactionManagement
-
-/**
- *
- * @author NorthLan at 2018/1/30
- * mybatis plus 配置
- */
-@Configuration
-@EnableTransactionManagement
-open class MybatisPlusConfig {
-
-
-    /**
-     * 并不会自动注入
-     */
-    @Bean
-    open fun physicalSqlInjector(): ISqlInjector {
-        return LogicMoreSqlInjector()
-    }
-
-
-    /**
-     * 性能分析插件
-     * // 开发环境开启
-     */
-    @Bean
-    @Profile("dev")
-    open fun performanceInterceptor(): PerformanceInterceptor {
-        return PerformanceInterceptor().also { it.isFormat = true }
-    }
-
-    /**
-     * 分页插件
-     */
-    @Bean
-    open fun paginationInterceptor(): PaginationInterceptor {
-        return PaginationInterceptor()
-    }
-
-    @Bean
-    open fun metaObjectHandler(): MetaObjectHandler {
-        return CustomMetaObjectHandler()
-    }
-
-}

+ 0 - 112
zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/base/IPhysicalMapper.kt

@@ -1,112 +0,0 @@
-package cn.gygxzc.envir.core.orm.base
-
-import com.baomidou.mybatisplus.core.conditions.Wrapper
-import com.baomidou.mybatisplus.core.metadata.IPage
-import com.baomidou.mybatisplus.core.toolkit.Constants
-import org.apache.ibatis.annotations.Param
-import java.io.Serializable
-
-/**
- * Created by niantuo on 2018/9/29.
- * 实现物理操作的mapper基类
- */
-
-interface IPhysicalMapper<T> {
-
-
-    /**
-     *
-     *
-     * 根据 entity 条件,删除记录
-     *
-     *
-     * @param queryWrapper 实体对象封装操作类(可以为 null)
-     */
-    fun physicalDelete(@Param(Constants.WRAPPER) queryWrapper: Wrapper<T>): Int
-
-    /**
-     *
-     *
-     * 根据 ID 删除
-     *
-     *
-     * @param id 主键ID
-     */
-    fun physicalDeleteById(id: Serializable): Int
-
-    /**
-     *
-     *
-     * 根据 columnMap 条件,删除记录
-     *
-     *
-     * @param columnMap 表字段 map 对象
-     */
-    fun physicalDeleteByMap(@Param(Constants.COLUMN_MAP) columnMap: Map<String, Any>): Int
-
-
-
-    /**
-     *
-     *
-     * 删除(根据ID 批量删除)
-     *
-     *
-     * @param idList 主键ID列表(不能为 null 以及 empty)
-     */
-    fun physicalDeleteBatchIds(@Param(Constants.COLLECTION) idList: Collection<Serializable>): Int
-
-    /**
-     *
-     *
-     * 根据 ID 修改
-     *
-     *
-     * @param entity 实体对象
-     */
-    fun physicalUpdateById(@Param(Constants.ENTITY) entity: T): Int
-
-    /**
-     *
-     *
-     * 根据 whereEntity 条件,更新记录
-     *
-     *
-     * @param entity        实体对象 (set 条件值,不能为 null)
-     * @param updateWrapper 实体对象封装操作类(可以为 null,里面的 entity 用于生成 where 语句)
-     */
-    fun physicalUpdate(@Param(Constants.ENTITY) entity: T, @Param(Constants.WRAPPER) updateWrapper: Wrapper<T>): Int
-
-    /**
-     *
-     *
-     * 根据 ID 查询
-     * 物理查询,忽略逻辑删除配置
-     *
-     * @param id 主键ID
-     */
-    fun physicalSelectById(id: Serializable): T
-
-
-    /**
-     *
-     *
-     * 根据 entity 条件,查询全部记录
-     *
-     *
-     * @param queryWrapper 实体对象封装操作类(可以为 null)
-     */
-    fun physicalsSelectList(@Param(Constants.WRAPPER) queryWrapper: Wrapper<T>): List<T>
-
-
-    /**
-     *
-     *
-     * 根据 entity 条件,查询全部记录(并翻页)
-     *
-     *
-     * @param page         分页查询条件(可以为 RowBounds.DEFAULT)
-     * @param queryWrapper 实体对象封装操作类(可以为 null)
-     */
-    fun physicalSelectPage(page: IPage<T>, @Param(Constants.WRAPPER) queryWrapper: Wrapper<T>): IPage<T>
-}

+ 0 - 47
zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/handler/CustomMetaObjectHandler.kt

@@ -1,47 +0,0 @@
-package cn.gygxzc.envir.core.orm.handler
-
-import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler
-import org.apache.ibatis.reflection.MetaObject
-import org.slf4j.LoggerFactory
-
-/**
- * 公共字段自动填充
- * 多线程 + WebSocket 下不适用
- * @author NorthLan
- * @date 2018/1/31
- * @url https://noahlan.com
- */
-class CustomMetaObjectHandler : MetaObjectHandler {
-    companion object {
-        val logger = LoggerFactory.getLogger(CustomMetaObjectHandler::class.java)!!
-    }
-
-    /**
-     * 公告字段插入的时候填充数据
-     */
-    override fun insertFill(metaObject: MetaObject?) {
-//        try {
-//            if (getFieldValByName("createBy", metaObject) == null) {
-//                val curUser = SessionUtils.getUser()?.account
-//                setFieldValByName("createBy", curUser, metaObject)
-//            }
-//            if (getFieldValByName("createTime", metaObject) == null) {
-//                setFieldValByName("createTime", Date(), metaObject)
-//            }
-//        } catch (e: Throwable) {
-//            logger.warn("insertFill error, cause: ", e)
-//        }
-    }
-
-    override fun updateFill(metaObject: MetaObject?) {
-//        try {
-//            if (getFieldValByName("updateBy", metaObject) == null) {
-//                val curUser = SessionUtils.getUser()?.account
-//                setFieldValByName("updateBy", curUser, metaObject)
-//            }
-//            setFieldValByName("updateTime", Date(), metaObject)
-//        } catch (e: Throwable) {
-//            logger.warn("updateFill error, cause: ", e)
-//        }
-    }
-}

+ 0 - 51
zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/injector/LogicMoreSqlInjector.kt

@@ -1,51 +0,0 @@
-package cn.gygxzc.envir.core.orm.injector
-
-import cn.gygxzc.envir.core.orm.injector.method.*
-import com.baomidou.mybatisplus.core.injector.AbstractMethod
-import com.baomidou.mybatisplus.core.injector.AbstractSqlInjector
-import com.baomidou.mybatisplus.core.injector.SqlRunnerInjector
-import com.baomidou.mybatisplus.core.injector.methods.Insert
-import com.baomidou.mybatisplus.extension.injector.methods.*
-import org.apache.ibatis.session.Configuration
-
-/**
- * Created by niantuo on 2018/9/29.
- * 注入器
- */
-
-class LogicMoreSqlInjector : AbstractSqlInjector() {
-
-    override fun getMethodList(): MutableList<AbstractMethod> {
-        return mutableListOf(
-                Insert(),
-                LogicDelete(),
-                LogicDeleteByMap(),
-                LogicDeleteById(),
-                LogicDeleteBatchByIds(),
-                LogicUpdate(),
-                LogicUpdateById(),
-                LogicSelectById(),
-                LogicSelectBatchByIds(),
-                LogicSelectByMap(),
-                LogicSelectOne(),
-                LogicSelectCount(),
-                LogicSelectMaps(),
-                LogicSelectMapsPage(),
-                LogicSelectObjs(),
-                LogicSelectList(),
-                LogicSelectPage(),
-                Delete(),
-                DeleteBatchIds(),
-                DeleteById(),
-                DeleteByMap(),
-                SelectById(),
-                SelectList(),
-                SelectPage(),
-                Update(),
-                UpdateById())
-    }
-
-    override fun injectSqlRunner(configuration: Configuration?) {
-        SqlRunnerInjector().inject(configuration)
-    }
-}

+ 0 - 28
zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/injector/enums/SqlMethodCopy.kt

@@ -1,28 +0,0 @@
-package cn.gygxzc.envir.core.orm.injector.enums
-
-/**
- * Created by niantuo on 2018/9/29.
- * 所以实际上这个是从mybatis-plus复制过来的,好尴尬呀
- * @see com.baomidou.mybatisplus.core.enums.SqlMethod
- */
-
-enum class SqlMethodCopy(val method:String,val desc:String,val sql:String) {
-
-    /**
-     * 删除
-     */
-    DELETE_BY_ID("physicalDeleteById", "根据ID 删除一条数据", "<script>\nDELETE FROM %s WHERE %s=#{%s}\n</script>"),
-    DELETE_BY_MAP("physicalDeleteByMap", "根据columnMap 条件删除记录", "<script>\nDELETE FROM %s %s\n</script>"),
-    DELETE("physicalDelete", "根据 entity 条件删除记录", "<script>\nDELETE FROM %s %s\n</script>"),
-    DELETE_BATCH_BY_IDS("physicalDeleteBatchIds", "根据ID集合,批量删除数据", "<script>\nDELETE FROM %s WHERE %s IN (%s)\n</script>"),
-
-    SELECT_BY_ID("physicalSelectById", "根据ID 查询一条数据", "SELECT %s FROM %s WHERE %s=#{%s}"),
-    SELECT_PAGE("physicalSelectPage", "查询满足条件所有数据(并翻页)", "<script>\nSELECT %s FROM %s %s\n</script>"),
-    SELECT_LIST("physicalsSelectList", "查询满足条件所有数据", "<script>\nSELECT %s FROM %s %s\n</script>"),
-
-    /**
-     * 修改
-     */
-    UPDATE_BY_ID("physicalUpdateById", "根据ID 选择修改数据", "<script>\nUPDATE %s %s WHERE %s=#{%s} %s\n</script>"),
-    UPDATE("physicalUpdate", "根据 whereEntity 条件,更新记录", "<script>\nUPDATE %s %s %s\n</script>"),
-}

+ 0 - 22
zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/injector/method/Delete.kt

@@ -1,22 +0,0 @@
-package cn.gygxzc.envir.core.orm.injector.method
-
-import cn.gygxzc.envir.core.orm.injector.enums.SqlMethodCopy
-import com.baomidou.mybatisplus.core.injector.AbstractMethod
-import com.baomidou.mybatisplus.core.metadata.TableInfo
-import org.apache.ibatis.mapping.MappedStatement
-
-/**
- * Created by niantuo on 2018/9/29.
- * 在逻辑删除的大环境下实现物理删除
- */
-
-class Delete : AbstractMethod() {
-    override fun injectMappedStatement(mapperClass: Class<*>, modelClass: Class<*>, tableInfo: TableInfo): MappedStatement {
-        val sqlMethod = SqlMethodCopy.DELETE
-        val sql = String.format(sqlMethod.sql, tableInfo.tableName,
-                sqlWhereEntityWrapper(tableInfo))
-        val sqlSource = languageDriver.createSqlSource(configuration, sql, modelClass)
-        return addUpdateMappedStatement(mapperClass, modelClass, sqlMethod.method, sqlSource)
-    }
-
-}

+ 0 - 23
zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/injector/method/DeleteBatchIds.kt

@@ -1,23 +0,0 @@
-package cn.gygxzc.envir.core.orm.injector.method
-
-import cn.gygxzc.envir.core.orm.injector.enums.SqlMethodCopy
-import com.baomidou.mybatisplus.core.injector.AbstractMethod
-import com.baomidou.mybatisplus.core.metadata.TableInfo
-import com.baomidou.mybatisplus.core.toolkit.Constants
-import com.baomidou.mybatisplus.core.toolkit.StringPool
-import com.baomidou.mybatisplus.core.toolkit.sql.SqlScriptUtils
-import org.apache.ibatis.mapping.MappedStatement
-
-/**
- * Created by niantuo on 2018/9/29.
- */
-
-class DeleteBatchIds : AbstractMethod() {
-    override fun injectMappedStatement(mapperClass: Class<*>, modelClass: Class<*>, tableInfo: TableInfo): MappedStatement {
-        val sqlMethod = SqlMethodCopy.DELETE_BATCH_BY_IDS
-        val sql = String.format(sqlMethod.sql, tableInfo.tableName, tableInfo.keyColumn,
-                SqlScriptUtils.convertForeach("#{item}", Constants.COLLECTION, null, "item", StringPool.COMMA))
-        val sqlSource = languageDriver.createSqlSource(configuration, sql, modelClass)
-        return this.addDeleteMappedStatement(mapperClass, sqlMethod.method, sqlSource)
-    }
-}

+ 0 - 21
zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/injector/method/DeleteById.kt

@@ -1,21 +0,0 @@
-package cn.gygxzc.envir.core.orm.injector.method
-
-import cn.gygxzc.envir.core.orm.injector.enums.SqlMethodCopy
-import com.baomidou.mybatisplus.core.injector.AbstractMethod
-import com.baomidou.mybatisplus.core.metadata.TableInfo
-import org.apache.ibatis.mapping.MappedStatement
-
-/**
- * Created by niantuo on 2018/9/29.
- */
-
-class DeleteById : AbstractMethod() {
-    override fun injectMappedStatement(mapperClass: Class<*>, modelClass: Class<*>, tableInfo: TableInfo): MappedStatement {
-        val sqlMethod = SqlMethodCopy.DELETE_BY_ID
-        val sqlSource = languageDriver.createSqlSource(configuration, String.format(sqlMethod.sql,
-                tableInfo.tableName, tableInfo.keyColumn, tableInfo.keyProperty), modelClass)
-        return this.addDeleteMappedStatement(mapperClass, sqlMethod.method, sqlSource)
-    }
-
-
-}

+ 0 - 20
zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/injector/method/DeleteByMap.kt

@@ -1,20 +0,0 @@
-package cn.gygxzc.envir.core.orm.injector.method
-
-import cn.gygxzc.envir.core.orm.injector.enums.SqlMethodCopy
-import com.baomidou.mybatisplus.core.injector.AbstractMethod
-import com.baomidou.mybatisplus.core.metadata.TableInfo
-import org.apache.ibatis.mapping.MappedStatement
-
-/**
- * Created by niantuo on 2018/9/29.
- */
-
-class DeleteByMap : AbstractMethod() {
-    override fun injectMappedStatement(mapperClass: Class<*>, modelClass: Class<*>, tableInfo: TableInfo): MappedStatement {
-        val sqlMethod = SqlMethodCopy.DELETE_BY_MAP
-        val sqlSource = languageDriver.createSqlSource(configuration, String.format(sqlMethod.sql,
-                tableInfo.tableName, this.sqlWhereByMap(tableInfo)), modelClass)
-        return this.addDeleteMappedStatement(mapperClass, sqlMethod.method, sqlSource)
-    }
-
-}

+ 0 - 20
zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/injector/method/SelectById.kt

@@ -1,20 +0,0 @@
-package cn.gygxzc.envir.core.orm.injector.method
-
-import cn.gygxzc.envir.core.orm.injector.enums.SqlMethodCopy
-import com.baomidou.mybatisplus.core.injector.AbstractMethod
-import com.baomidou.mybatisplus.core.metadata.TableInfo
-import org.apache.ibatis.mapping.MappedStatement
-import org.apache.ibatis.scripting.defaults.RawSqlSource
-
-/**
- * Created by niantuo on 2018/9/29.
- */
-
-class SelectById : AbstractMethod() {
-    override fun injectMappedStatement(mapperClass: Class<*>, modelClass: Class<*>, tableInfo: TableInfo): MappedStatement {
-        val sqlMethod = SqlMethodCopy.SELECT_BY_ID
-        val sqlSource = RawSqlSource(configuration, String.format(sqlMethod.sql, this.sqlSelectColumns(tableInfo, false),
-                tableInfo.tableName, tableInfo.keyColumn, tableInfo.keyProperty), Any::class.java)
-        return this.addSelectMappedStatement(mapperClass, sqlMethod.method, sqlSource, modelClass, tableInfo)
-    }
-}

Vissa filer visades inte eftersom för många filer har ändrats