diff --git a/Dockerfile b/Dockerfile index 7c4d9d6..f01f029 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # 使用openjdk8的镜像 FROM openjdk:8-jre -ENV PARAMS="" +ENV PARAMS="--spring.profiles.active=docker" # 设置工作目录 WORKDIR /build diff --git a/austin-web/src/main/java/com/java3y/austin/web/config/CrossConfig.java b/austin-web/src/main/java/com/java3y/austin/web/config/CrossConfig.java new file mode 100644 index 0000000..8d06093 --- /dev/null +++ b/austin-web/src/main/java/com/java3y/austin/web/config/CrossConfig.java @@ -0,0 +1,22 @@ +package com.java3y.austin.web.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * @author 3y + * 跨域配置 + */ +@Configuration +public class CrossConfig implements WebMvcConfigurer { + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedOriginPatterns("*") + .allowedMethods("GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS") + .allowCredentials(true) + .maxAge(3600) + .allowedHeaders("*"); + } +} diff --git a/austin-web/src/main/java/com/java3y/austin/web/controller/ChannelAccountController.java b/austin-web/src/main/java/com/java3y/austin/web/controller/ChannelAccountController.java index c6c393d..b2fd3a7 100644 --- a/austin-web/src/main/java/com/java3y/austin/web/controller/ChannelAccountController.java +++ b/austin-web/src/main/java/com/java3y/austin/web/controller/ChannelAccountController.java @@ -2,7 +2,6 @@ package com.java3y.austin.web.controller; import cn.hutool.core.util.StrUtil; -import com.java3y.austin.common.constant.AustinConstant; import com.java3y.austin.common.vo.BasicResultVO; import com.java3y.austin.support.domain.ChannelAccount; import com.java3y.austin.web.service.ChannelAccountService; @@ -13,7 +12,9 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import java.util.stream.Collectors; /** @@ -25,7 +26,6 @@ import java.util.stream.Collectors; @RestController @RequestMapping("/account") @Api("渠道账号管理接口") -@CrossOrigin(origins = AustinConstant.ORIGIN_VALUE, allowCredentials = "true", allowedHeaders = "*") public class ChannelAccountController { @Autowired diff --git a/austin-web/src/main/java/com/java3y/austin/web/controller/DataController.java b/austin-web/src/main/java/com/java3y/austin/web/controller/DataController.java index c886021..3f59eae 100644 --- a/austin-web/src/main/java/com/java3y/austin/web/controller/DataController.java +++ b/austin-web/src/main/java/com/java3y/austin/web/controller/DataController.java @@ -1,7 +1,6 @@ package com.java3y.austin.web.controller; import cn.hutool.core.util.StrUtil; -import com.java3y.austin.common.constant.AustinConstant; import com.java3y.austin.common.enums.RespStatusEnum; import com.java3y.austin.common.vo.BasicResultVO; import com.java3y.austin.web.service.DataService; @@ -24,7 +23,6 @@ import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("/trace") @Api("获取数据接口(全链路追踪)") -@CrossOrigin(origins = AustinConstant.ORIGIN_VALUE, allowCredentials = "true", allowedHeaders = "*") public class DataController { @Autowired private DataService dataService; diff --git a/austin-web/src/main/java/com/java3y/austin/web/controller/MaterialController.java b/austin-web/src/main/java/com/java3y/austin/web/controller/MaterialController.java index c48da71..bbd77c4 100644 --- a/austin-web/src/main/java/com/java3y/austin/web/controller/MaterialController.java +++ b/austin-web/src/main/java/com/java3y/austin/web/controller/MaterialController.java @@ -1,26 +1,13 @@ package com.java3y.austin.web.controller; -import cn.hutool.core.util.IdUtil; -import com.alibaba.fastjson.JSON; -import com.dingtalk.api.DefaultDingTalkClient; -import com.dingtalk.api.DingTalkClient; -import com.dingtalk.api.request.OapiMediaUploadRequest; -import com.dingtalk.api.response.OapiMediaUploadResponse; -import com.java3y.austin.common.constant.AustinConstant; -import com.java3y.austin.common.constant.SendAccountConstant; import com.java3y.austin.common.enums.ChannelType; -import com.java3y.austin.common.enums.FileType; import com.java3y.austin.common.vo.BasicResultVO; import com.java3y.austin.web.service.MaterialService; -import com.java3y.austin.web.vo.DataParam; -import com.java3y.austin.web.vo.amis.UserTimeLineVo; -import com.taobao.api.FileItem; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -34,8 +21,6 @@ import org.springframework.web.multipart.MultipartFile; @RestController @RequestMapping("/material") @Api("素材管理接口") -@CrossOrigin(origins = AustinConstant.ORIGIN_VALUE, allowCredentials = "true", allowedHeaders = "*") - public class MaterialController { @Autowired diff --git a/austin-web/src/main/java/com/java3y/austin/web/controller/MessageTemplateController.java b/austin-web/src/main/java/com/java3y/austin/web/controller/MessageTemplateController.java index 4d9776a..9b65a3c 100644 --- a/austin-web/src/main/java/com/java3y/austin/web/controller/MessageTemplateController.java +++ b/austin-web/src/main/java/com/java3y/austin/web/controller/MessageTemplateController.java @@ -5,7 +5,6 @@ import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.google.common.base.Throwables; -import com.java3y.austin.common.constant.AustinConstant; import com.java3y.austin.common.enums.RespStatusEnum; import com.java3y.austin.common.vo.BasicResultVO; import com.java3y.austin.service.api.domain.MessageParam; @@ -45,7 +44,6 @@ import java.util.stream.Collectors; @RestController @RequestMapping("/messageTemplate") @Api("发送消息") -@CrossOrigin(origins = AustinConstant.ORIGIN_VALUE, allowCredentials = "true", allowedHeaders = "*") public class MessageTemplateController { @Autowired diff --git a/austin-web/src/main/java/com/java3y/austin/web/controller/MiniProgramController.java b/austin-web/src/main/java/com/java3y/austin/web/controller/MiniProgramController.java index 32a9b8e..87b241c 100644 --- a/austin-web/src/main/java/com/java3y/austin/web/controller/MiniProgramController.java +++ b/austin-web/src/main/java/com/java3y/austin/web/controller/MiniProgramController.java @@ -4,7 +4,6 @@ package com.java3y.austin.web.controller; import cn.binarywang.wx.miniapp.api.WxMaSubscribeService; import cn.hutool.http.HttpUtil; import com.google.common.base.Throwables; -import com.java3y.austin.common.constant.AustinConstant; import com.java3y.austin.common.enums.RespStatusEnum; import com.java3y.austin.common.vo.BasicResultVO; import com.java3y.austin.support.utils.WxServiceUtils; @@ -29,7 +28,6 @@ import java.util.List; @RestController @RequestMapping("/miniProgram") @Api("微信服务号") -@CrossOrigin(origins = {AustinConstant.ORIGIN_VALUE}, allowCredentials = "true", allowedHeaders = "*", methods = {RequestMethod.PUT, RequestMethod.POST, RequestMethod.GET}) public class MiniProgramController { @Autowired @@ -78,17 +76,16 @@ public class MiniProgramController { /** * 登录凭证校验 + *

+ * 临时给小程序登录使用,正常消息推送平台不会有此接口 * * @return */ @GetMapping("/sync/openid") @ApiOperation("登录凭证校验") - public BasicResultVO syncOpenId(String code) { - String appId = "xxx"; - String secret = "xxxxx"; + public BasicResultVO syncOpenId(String code, String appId, String secret) { String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + appId + "&secret=" + secret + "&js_code=" + code + "&grant_type=authorization_code"; String result = HttpUtil.get(url); - System.out.println(result); return BasicResultVO.success(result); } diff --git a/austin-web/src/main/java/com/java3y/austin/web/controller/OfficialAccountController.java b/austin-web/src/main/java/com/java3y/austin/web/controller/OfficialAccountController.java index 6ab2ffc..ea200d0 100644 --- a/austin-web/src/main/java/com/java3y/austin/web/controller/OfficialAccountController.java +++ b/austin-web/src/main/java/com/java3y/austin/web/controller/OfficialAccountController.java @@ -2,7 +2,6 @@ package com.java3y.austin.web.controller; import com.google.common.base.Throwables; -import com.java3y.austin.common.constant.AustinConstant; import com.java3y.austin.common.enums.RespStatusEnum; import com.java3y.austin.common.vo.BasicResultVO; import com.java3y.austin.support.utils.WxServiceUtils; @@ -28,8 +27,6 @@ import java.util.List; @RestController @RequestMapping("/officialAccount") @Api("微信服务号") -@CrossOrigin(origins = {AustinConstant.ORIGIN_VALUE, "https://aisuda.bce.baidu.com", "http://localhost:8080"} - , allowCredentials = "true", allowedHeaders = "*", methods = {RequestMethod.PUT, RequestMethod.POST, RequestMethod.GET}) public class OfficialAccountController { @Autowired diff --git a/austin-web/src/main/resources/application-dev.properties b/austin-web/src/main/resources/application-dev.properties new file mode 100644 index 0000000..81c188d --- /dev/null +++ b/austin-web/src/main/resources/application-dev.properties @@ -0,0 +1,153 @@ +# TODO please replace 【must】 config value +# TODO please replace 【must】 config value +# TODO please replace 【must】 config value + +# todo [database] ip/port/username/password 【must】 +austin.database.ip=austin.mysql +austin.database.port=5004 +austin.database.username=root +austin.database.password=root123_A + +# todo [redis] ip/port/password【must】 +austin.redis.ip=austin.redis +austin.redis.port=5003 +austin.redis.password=austin + +# TODO choose : kafka/eventBus/rocketMq/rabbitMq, default eventBus +austin.mq.pipeline=eventBus + +# todo [kafka] ip/port【optional】, if austin.mq.pipeline=kafka 【must】 +austin.kafka.ip=austin.kafka +austin.kafka.port=9092 + +# todo [rocketMq] 【optional】, if austin.mq.pipeline=rocketMq【must】 +austin.rocketmq.nameserver.ip= +austin.rocketmq.nameserver.port= + +# todo [rabbitMq] 【optional】, if austin.mq.pipeline=rabbitMq【must】 +austin.rabbitmq.ip= +austin.rabbitmq.port= + +# todo [xxl-job] switch 【optional】, if austin.xxl.job.enabled=true 【must】 +austin.xxl.job.enabled=false +austin.xxl.job.ip=127.0.0.1 +austin.xxl.job.port=6767 + +# todo choose: apollo/nacos switch 【optional】 ,if apollo and nacos both false, use local.properties +austin.apollo.enabled=false +austin.nacos.enabled=false + +# todo [grayLog] ip 【optional】 +austin.grayLog.ip=austin.graylog + +# TODO if windows os and need upload file to send message ,replace path !【optional】 +austin.business.upload.crowd.path=/Users/3y/temp + +########################################## database start ########################################## +# notice:mysql version 5.7x !!! +spring.datasource.url=jdbc:mysql://${austin.database.ip}:${austin.database.port}/austin?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull +spring.datasource.username=${austin.database.username} +spring.datasource.password=${austin.database.password} +spring.datasource.driver-class-name=com.mysql.jdbc.Driver +########################################## database end ########################################## + +########################################## kafka start ########################################## +spring.kafka.bootstrap-servers=${austin.kafka.ip}:${austin.kafka.port} +spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer +spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer +spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer +spring.kafka.consumer.value-deserializer=org.apache.kafka.common.serialization.StringDeserializer +spring.kafka.consumer.auto.offset.reset=earliest +spring.kafka.consumer.auto-commit-interval=1000 +spring.kafka.consumer.enable-auto-commit=true + +### +austin.business.topic.name=austinBusiness +austin.business.recall.topic.name=austinRecall +austin.business.recall.group.name=recallGroupId +austin.business.log.topic.name=austinTraceLog +### TODO kafka tag filter,if you need, replace tagIdValue ,eg:com.java3y.austin.yyy +austin.business.tagId.key=kafka_tag_id +austin.business.tagId.value=com.java3y.austin.3y +########################################## kafka end ########################################## + + +########################################## rocketMq start ########################################## +rocketmq.name-server=${austin.rocketmq.nameserver.ip}:${austin.rocketmq.nameserver.port} +rocketmq.producer.group=unique-producer-group +austin.rocketmq.biz.consumer.group=unique-biz-consumer-group +austin.rocketmq.recall.consumer.group=unique-recall-consumer-group +########################################## rocketMq end ########################################## + + +########################################## RabbitMq start ########################################## +spring.rabbitmq.host=${austin.rabbitmq.ip} +spring.rabbitmq.port=${austin.rabbitmq.port} +server.port=8080 +spring.application.name=cl +spring.rabbitmq.username=root +spring.rabbitmq.password=123456 +spring.rabbitmq.publisher-confirm-type=correlated +spring.rabbitmq.publisher-returns=true +spring.rabbitmq.virtual-host=/ +austin.rabbitmq.topic.name=austinRabbit +austin.rabbitmq.exchange.name=austin.point +########################################## RabbitMq end ########################################## + +########################################## redis start ########################################## +spring.redis.host=${austin.redis.ip} +spring.redis.port=${austin.redis.port} +spring.redis.password=${austin.redis.password} +########################################## redis end ########################################## + + +########################################## xxl start ########################################## +xxl.job.admin.addresses=http://${austin.xxl.job.ip}:${austin.xxl.job.port}/xxl-job-admin +xxl.job.admin.username=admin +xxl.job.admin.password=123456 +xxl.job.executor.appname=austin +xxl.job.executor.jobHandlerName=austinJob +xxl.job.executor.ip= +xxl.job.executor.port=6666 +xxl.job.executor.logpath=logs/xxl +xxl.job.executor.logretentiondays=30 +xxl.job.accessToken= +########################################## xxl end ########################################## + +########################################## apollo start ########################################## +app.id=austin +apollo.bootstrap.enabled=${austin.apollo.enabled} +apollo.bootstrap.namespaces=boss.austin,dynamic-tp-apollo-dtp.yml +########################################## apollo end ########################################## + +########################################## nacos start ########################################## +austin.nacos.server= +austin.nacos.username= +austin.nacos.password= +austin.nacos.dataId=austin +austin.nacos.group=DEFAULT_GROUP +austin.nacos.namespace=9537c674-f3a6-4203-b286-ef0c36bfacb2 +nacos.config.enabled=${austin.nacos.enabled} +########################################## nacos end ########################################## + +########################################## httpUtils start ########################################## +ok.http.connect-timeout=30 +ok.http.keep-alive-duration=300 +ok.http.max-idle-connections=200 +ok.http.read-timeout=30 +ok.http.write-timeout=30 +########################################## httpUtils end ########################################## + +########################################## monitor start ########################################## +management.endpoint.health.show-details=always +management.endpoint.metrics.enabled=true +management.endpoint.prometheus.enabled=true +management.endpoints.web.exposure.include=* +management.metrics.export.prometheus.enabled=true +management.health.rabbit.enabled=false +########################################## monitor end ########################################## + +########################################## system start ########################################## +server.shutdown=graceful +########################################## system end ########################################## + diff --git a/austin-web/src/main/resources/application-docker.properties b/austin-web/src/main/resources/application-docker.properties new file mode 100644 index 0000000..57db57b --- /dev/null +++ b/austin-web/src/main/resources/application-docker.properties @@ -0,0 +1,153 @@ +# TODO please replace 【must】 config value +# TODO please replace 【must】 config value +# TODO please replace 【must】 config value + +# todo [database] ip/port/username/password 【must】 +austin.database.ip=mysql +austin.database.port=3306 +austin.database.username=root +austin.database.password=root123_A + +# todo [redis] ip/port/password【must】 +austin.redis.ip=redis +austin.redis.port=6379 +austin.redis.password=austin + +# TODO choose : kafka/eventBus/rocketMq/rabbitMq, default eventBus +austin.mq.pipeline=eventBus + +# todo [kafka] ip/port【optional】, if austin.mq.pipeline=kafka 【must】 +austin.kafka.ip=austin.kafka +austin.kafka.port=9092 + +# todo [rocketMq] 【optional】, if austin.mq.pipeline=rocketMq【must】 +austin.rocketmq.nameserver.ip= +austin.rocketmq.nameserver.port= + +# todo [rabbitMq] 【optional】, if austin.mq.pipeline=rabbitMq【must】 +austin.rabbitmq.ip= +austin.rabbitmq.port= + +# todo [xxl-job] switch 【optional】, if austin.xxl.job.enabled=true 【must】 +austin.xxl.job.enabled=false +austin.xxl.job.ip=127.0.0.1 +austin.xxl.job.port=6767 + +# todo choose: apollo/nacos switch 【optional】 ,if apollo and nacos both false, use local.properties +austin.apollo.enabled=false +austin.nacos.enabled=false + +# todo [grayLog] ip 【optional】 +austin.grayLog.ip=austin.graylog + +# TODO if windows os and need upload file to send message ,replace path !【optional】 +austin.business.upload.crowd.path=/Users/3y/temp + +########################################## database start ########################################## +# notice:mysql version 5.7x !!! +spring.datasource.url=jdbc:mysql://${austin.database.ip}:${austin.database.port}/austin?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull +spring.datasource.username=${austin.database.username} +spring.datasource.password=${austin.database.password} +spring.datasource.driver-class-name=com.mysql.jdbc.Driver +########################################## database end ########################################## + +########################################## kafka start ########################################## +spring.kafka.bootstrap-servers=${austin.kafka.ip}:${austin.kafka.port} +spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer +spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer +spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer +spring.kafka.consumer.value-deserializer=org.apache.kafka.common.serialization.StringDeserializer +spring.kafka.consumer.auto.offset.reset=earliest +spring.kafka.consumer.auto-commit-interval=1000 +spring.kafka.consumer.enable-auto-commit=true + +### +austin.business.topic.name=austinBusiness +austin.business.recall.topic.name=austinRecall +austin.business.recall.group.name=recallGroupId +austin.business.log.topic.name=austinTraceLog +### TODO kafka tag filter,if you need, replace tagIdValue ,eg:com.java3y.austin.yyy +austin.business.tagId.key=kafka_tag_id +austin.business.tagId.value=com.java3y.austin.3y +########################################## kafka end ########################################## + + +########################################## rocketMq start ########################################## +rocketmq.name-server=${austin.rocketmq.nameserver.ip}:${austin.rocketmq.nameserver.port} +rocketmq.producer.group=unique-producer-group +austin.rocketmq.biz.consumer.group=unique-biz-consumer-group +austin.rocketmq.recall.consumer.group=unique-recall-consumer-group +########################################## rocketMq end ########################################## + + +########################################## RabbitMq start ########################################## +spring.rabbitmq.host=${austin.rabbitmq.ip} +spring.rabbitmq.port=${austin.rabbitmq.port} +server.port=8080 +spring.application.name=cl +spring.rabbitmq.username=root +spring.rabbitmq.password=123456 +spring.rabbitmq.publisher-confirm-type=correlated +spring.rabbitmq.publisher-returns=true +spring.rabbitmq.virtual-host=/ +austin.rabbitmq.topic.name=austinRabbit +austin.rabbitmq.exchange.name=austin.point +########################################## RabbitMq end ########################################## + +########################################## redis start ########################################## +spring.redis.host=${austin.redis.ip} +spring.redis.port=${austin.redis.port} +spring.redis.password=${austin.redis.password} +########################################## redis end ########################################## + + +########################################## xxl start ########################################## +xxl.job.admin.addresses=http://${austin.xxl.job.ip}:${austin.xxl.job.port}/xxl-job-admin +xxl.job.admin.username=admin +xxl.job.admin.password=123456 +xxl.job.executor.appname=austin +xxl.job.executor.jobHandlerName=austinJob +xxl.job.executor.ip= +xxl.job.executor.port=6666 +xxl.job.executor.logpath=logs/xxl +xxl.job.executor.logretentiondays=30 +xxl.job.accessToken= +########################################## xxl end ########################################## + +########################################## apollo start ########################################## +app.id=austin +apollo.bootstrap.enabled=${austin.apollo.enabled} +apollo.bootstrap.namespaces=boss.austin,dynamic-tp-apollo-dtp.yml +########################################## apollo end ########################################## + +########################################## nacos start ########################################## +austin.nacos.server= +austin.nacos.username= +austin.nacos.password= +austin.nacos.dataId=austin +austin.nacos.group=DEFAULT_GROUP +austin.nacos.namespace=9537c674-f3a6-4203-b286-ef0c36bfacb2 +nacos.config.enabled=${austin.nacos.enabled} +########################################## nacos end ########################################## + +########################################## httpUtils start ########################################## +ok.http.connect-timeout=30 +ok.http.keep-alive-duration=300 +ok.http.max-idle-connections=200 +ok.http.read-timeout=30 +ok.http.write-timeout=30 +########################################## httpUtils end ########################################## + +########################################## monitor start ########################################## +management.endpoint.health.show-details=always +management.endpoint.metrics.enabled=true +management.endpoint.prometheus.enabled=true +management.endpoints.web.exposure.include=* +management.metrics.export.prometheus.enabled=true +management.health.rabbit.enabled=false +########################################## monitor end ########################################## + +########################################## system start ########################################## +server.shutdown=graceful +########################################## system end ########################################## + diff --git a/austin-web/src/main/resources/application.properties b/austin-web/src/main/resources/application.properties index 81c188d..257b306 100644 --- a/austin-web/src/main/resources/application.properties +++ b/austin-web/src/main/resources/application.properties @@ -1,153 +1 @@ -# TODO please replace 【must】 config value -# TODO please replace 【must】 config value -# TODO please replace 【must】 config value - -# todo [database] ip/port/username/password 【must】 -austin.database.ip=austin.mysql -austin.database.port=5004 -austin.database.username=root -austin.database.password=root123_A - -# todo [redis] ip/port/password【must】 -austin.redis.ip=austin.redis -austin.redis.port=5003 -austin.redis.password=austin - -# TODO choose : kafka/eventBus/rocketMq/rabbitMq, default eventBus -austin.mq.pipeline=eventBus - -# todo [kafka] ip/port【optional】, if austin.mq.pipeline=kafka 【must】 -austin.kafka.ip=austin.kafka -austin.kafka.port=9092 - -# todo [rocketMq] 【optional】, if austin.mq.pipeline=rocketMq【must】 -austin.rocketmq.nameserver.ip= -austin.rocketmq.nameserver.port= - -# todo [rabbitMq] 【optional】, if austin.mq.pipeline=rabbitMq【must】 -austin.rabbitmq.ip= -austin.rabbitmq.port= - -# todo [xxl-job] switch 【optional】, if austin.xxl.job.enabled=true 【must】 -austin.xxl.job.enabled=false -austin.xxl.job.ip=127.0.0.1 -austin.xxl.job.port=6767 - -# todo choose: apollo/nacos switch 【optional】 ,if apollo and nacos both false, use local.properties -austin.apollo.enabled=false -austin.nacos.enabled=false - -# todo [grayLog] ip 【optional】 -austin.grayLog.ip=austin.graylog - -# TODO if windows os and need upload file to send message ,replace path !【optional】 -austin.business.upload.crowd.path=/Users/3y/temp - -########################################## database start ########################################## -# notice:mysql version 5.7x !!! -spring.datasource.url=jdbc:mysql://${austin.database.ip}:${austin.database.port}/austin?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull -spring.datasource.username=${austin.database.username} -spring.datasource.password=${austin.database.password} -spring.datasource.driver-class-name=com.mysql.jdbc.Driver -########################################## database end ########################################## - -########################################## kafka start ########################################## -spring.kafka.bootstrap-servers=${austin.kafka.ip}:${austin.kafka.port} -spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer -spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer -spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer -spring.kafka.consumer.value-deserializer=org.apache.kafka.common.serialization.StringDeserializer -spring.kafka.consumer.auto.offset.reset=earliest -spring.kafka.consumer.auto-commit-interval=1000 -spring.kafka.consumer.enable-auto-commit=true - -### -austin.business.topic.name=austinBusiness -austin.business.recall.topic.name=austinRecall -austin.business.recall.group.name=recallGroupId -austin.business.log.topic.name=austinTraceLog -### TODO kafka tag filter,if you need, replace tagIdValue ,eg:com.java3y.austin.yyy -austin.business.tagId.key=kafka_tag_id -austin.business.tagId.value=com.java3y.austin.3y -########################################## kafka end ########################################## - - -########################################## rocketMq start ########################################## -rocketmq.name-server=${austin.rocketmq.nameserver.ip}:${austin.rocketmq.nameserver.port} -rocketmq.producer.group=unique-producer-group -austin.rocketmq.biz.consumer.group=unique-biz-consumer-group -austin.rocketmq.recall.consumer.group=unique-recall-consumer-group -########################################## rocketMq end ########################################## - - -########################################## RabbitMq start ########################################## -spring.rabbitmq.host=${austin.rabbitmq.ip} -spring.rabbitmq.port=${austin.rabbitmq.port} -server.port=8080 -spring.application.name=cl -spring.rabbitmq.username=root -spring.rabbitmq.password=123456 -spring.rabbitmq.publisher-confirm-type=correlated -spring.rabbitmq.publisher-returns=true -spring.rabbitmq.virtual-host=/ -austin.rabbitmq.topic.name=austinRabbit -austin.rabbitmq.exchange.name=austin.point -########################################## RabbitMq end ########################################## - -########################################## redis start ########################################## -spring.redis.host=${austin.redis.ip} -spring.redis.port=${austin.redis.port} -spring.redis.password=${austin.redis.password} -########################################## redis end ########################################## - - -########################################## xxl start ########################################## -xxl.job.admin.addresses=http://${austin.xxl.job.ip}:${austin.xxl.job.port}/xxl-job-admin -xxl.job.admin.username=admin -xxl.job.admin.password=123456 -xxl.job.executor.appname=austin -xxl.job.executor.jobHandlerName=austinJob -xxl.job.executor.ip= -xxl.job.executor.port=6666 -xxl.job.executor.logpath=logs/xxl -xxl.job.executor.logretentiondays=30 -xxl.job.accessToken= -########################################## xxl end ########################################## - -########################################## apollo start ########################################## -app.id=austin -apollo.bootstrap.enabled=${austin.apollo.enabled} -apollo.bootstrap.namespaces=boss.austin,dynamic-tp-apollo-dtp.yml -########################################## apollo end ########################################## - -########################################## nacos start ########################################## -austin.nacos.server= -austin.nacos.username= -austin.nacos.password= -austin.nacos.dataId=austin -austin.nacos.group=DEFAULT_GROUP -austin.nacos.namespace=9537c674-f3a6-4203-b286-ef0c36bfacb2 -nacos.config.enabled=${austin.nacos.enabled} -########################################## nacos end ########################################## - -########################################## httpUtils start ########################################## -ok.http.connect-timeout=30 -ok.http.keep-alive-duration=300 -ok.http.max-idle-connections=200 -ok.http.read-timeout=30 -ok.http.write-timeout=30 -########################################## httpUtils end ########################################## - -########################################## monitor start ########################################## -management.endpoint.health.show-details=always -management.endpoint.metrics.enabled=true -management.endpoint.prometheus.enabled=true -management.endpoints.web.exposure.include=* -management.metrics.export.prometheus.enabled=true -management.health.rabbit.enabled=false -########################################## monitor end ########################################## - -########################################## system start ########################################## -server.shutdown=graceful -########################################## system end ########################################## - +spring.profiles.active=dev \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 5d666aa..eefef6a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ version: '3' services: - austin-mysql: + mysql: environment: TZ: Asia/Shanghai MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' @@ -9,7 +9,7 @@ services: restart: always container_name: austin-mysql image: mysql:5.7 - hostname: austin-mysql + hostname: mysql command: --init-file /docker-entrypoint-initdb.d/init.sql volumes: - ./sql/austin.sql:/docker-entrypoint-initdb.d/init.sql @@ -17,12 +17,12 @@ services: - 23306:3306 networks: - app - austin-redis: + redis: image: redis:3.2 ports: - 16379:6379 restart: always - container_name: austin-redis + container_name: redis networks: - app austin: