1、docker-compose启动austin

2、微信服务号登录 接入中
master
3y 3 years ago
parent d9725f6726
commit fac98a7c4c

@ -5,10 +5,9 @@ ENV PARAMS="--spring.profiles.active=docker"
# 设置工作目录
WORKDIR /build
# 将jar包复制到容器中
ADD ./austin-web/target/austin-web-0.0.1-SNAPSHOT.jar ./austin.jar
# 暴露8080端口
EXPOSE 8080
# 运行jar包
ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS austin.jar $PARAMS"]

@ -0,0 +1,24 @@
package com.java3y.austin.web.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
/**
*
*
* @author 3y
*/
@Slf4j
@RestController
@Api("健康检测")
public class HealthController {
@GetMapping("/")
@ApiOperation("/健康检测")
public String health() {
return "success";
}
}

@ -1,6 +1,9 @@
package com.java3y.austin.web.controller;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.google.common.base.Throwables;
import com.java3y.austin.common.enums.RespStatusEnum;
import com.java3y.austin.common.vo.BasicResultVO;
@ -11,12 +14,17 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.result.WxMpQrCodeTicket;
import me.chanjar.weixin.mp.bean.template.WxMpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
*
@ -79,4 +87,50 @@ public class OfficialAccountController {
}
/**
*
* https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Access_Overview.html
* 使
*
* @return
*/
@GetMapping("/receipt")
@ApiOperation("/接收微信的事件消息")
public String receiptMessage(String signature, String timestamp, String nonce, String echostr) {
log.info("get weixin signature:{},:{},nonce:{},echostr:{}", signature, timestamp, nonce, echostr);
if (StrUtil.isNotBlank(echostr)) {
return echostr;
}
return null;
}
/**
* 使
*
* @param accountId Id
* @return
*/
@GetMapping("/qrCode")
@ApiOperation("/生成 服务号 二维码")
public BasicResultVO getQrCode(Long accountId) {
if (accountId == null) {
return BasicResultVO.fail(RespStatusEnum.CLIENT_BAD_PARAMETERS);
}
try {
// 生成随机值,获取服务号二维码 且 用于校验登录
String id = IdUtil.getSnowflake().nextIdStr();
WxMpService wxMpService = wxServiceUtils.getOfficialAccountServiceMap().get(accountId);
WxMpQrCodeTicket ticket = wxMpService.getQrcodeService().qrCodeCreateTmpTicket(id, 2592000);
String url = wxMpService.getQrcodeService().qrCodePictureUrl(ticket.getTicket());
Map<Object, Object> result = MapUtil.of(new String[][]{{"url", url}, {"id", id}});
return BasicResultVO.success(result);
} catch (Exception e) {
log.error("OfficialAccountController#getQrCode fail:{}", Throwables.getStackTraceAsString(e));
return BasicResultVO.fail(RespStatusEnum.SERVICE_ERROR);
}
}
}

@ -1,6 +1,7 @@
# TODO please replace 【must】 config value
# TODO please replace 【must】 config value
# TODO please replace 【must】 config value
server.port=8080
# todo [database] ip/port/username/password 【must】
austin.database.ip=austin.mysql
@ -83,8 +84,6 @@ austin.rocketmq.recall.consumer.group=unique-recall-consumer-group
########################################## 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

@ -1,15 +1,16 @@
# TODO please replace 【must】 config value
# TODO please replace 【must】 config value
# TODO please replace 【must】 config value
server.port=8080
# todo [database] ip/port/username/password 【must】
austin.database.ip=mysql
austin.database.ip=austin-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.ip=austin-redis
austin.redis.port=6379
austin.redis.password=austin
@ -45,7 +46,7 @@ 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.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
@ -83,8 +84,6 @@ austin.rocketmq.recall.consumer.group=unique-recall-consumer-group
########################################## 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

@ -1 +1,2 @@
spring.profiles.active=dev
spring.profiles.active=dev
spring.application.name=austin

@ -1,6 +1,6 @@
version: '3'
services:
mysql:
austin-mysql:
environment:
TZ: Asia/Shanghai
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
@ -17,12 +17,12 @@ services:
- 23306:3306
networks:
- app
redis:
austin-redis:
image: redis:3.2
ports:
- 16379:6379
restart: always
container_name: redis
container_name: austin-redis
networks:
- app
austin:

Loading…
Cancel
Save