diff --git a/README.md b/README.md index 75297c7..707cbc6 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ austin项目**核心流程**:`austin-api`接收到发送消息请求,直接 目前引用的中间件教程的安装姿势均基于`Centos 7.6`(**完全部署所有的服务,大概8G内存**),austin项目**强依赖**`MySQL`/`Redis`/`Kafka`/`apollo`,**弱依赖**`prometheus`/`graylog`/`flink`/`xxl-job`。如果缺少相关的组件可戳:[安装相关组件教程](INSTALL.md)。 +实在想要拉下clone项目后不部署环境直接启动,我这提供了[会员服务](https://mp.weixin.qq.com/s?__biz=MzI4Njg5MDA5NA==&mid=2247505577&idx=1&sn=5114f8f583755899c2946fbea0b22e4b&chksm=ebd497a8dca31ebe8f98344483a00c860863dfc3586e51eed95b25988151427fee8101311f4f&token=735778370&lang=zh_CN#rd) **1**、austin使用的MySQL版本**5.7x**。如果目前使用的MySQL版本8.0,注意改变`pom.xml`所依赖的版本 @@ -141,11 +142,14 @@ curl -XPOST "127.0.0.1:8080/send" -H 'Content-Type: application/json' -d '{"co + **Java3y**公众号在持续更新austin系列文章,**保姆级**讲解搭建项目的过程(包括技术选型以及一些业务的探讨)以及相关环境的搭建。**扫下面的码直接关注,带你了解整个项目** 如果你需要用这个项目写在简历上,**强烈建议关注公众号看实现细节的思路**。如果⽂档中有任何的不懂的问题,都可以直接来找我询问,我乐意帮助你们!公众号下有我的联系方式 +[会员服务](https://mp.weixin.qq.com/s?__biz=MzI4Njg5MDA5NA==&mid=2247505577&idx=1&sn=5114f8f583755899c2946fbea0b22e4b&chksm=ebd497a8dca31ebe8f98344483a00c860863dfc3586e51eed95b25988151427fee8101311f4f&token=735778370&lang=zh_CN#rd) + ## 如何准备面试? diff --git a/austin-common/src/main/java/com/java3y/austin/common/enums/IdType.java b/austin-common/src/main/java/com/java3y/austin/common/enums/IdType.java index d3b1961..3b9aea5 100644 --- a/austin-common/src/main/java/com/java3y/austin/common/enums/IdType.java +++ b/austin-common/src/main/java/com/java3y/austin/common/enums/IdType.java @@ -21,6 +21,7 @@ public enum IdType { EMAIL(50, "email"), ENTERPRISE_USER_ID(60, "enterprise_user_id"), DING_DING_USER_ID(70, "ding_ding_user_id"), + CID(80, "cid"), ; private Integer code; diff --git a/austin-service-api-impl/src/main/java/com/java3y/austin/service/api/impl/action/AssembleAction.java b/austin-service-api-impl/src/main/java/com/java3y/austin/service/api/impl/action/AssembleAction.java index b69592d..ef0ecdf 100644 --- a/austin-service-api-impl/src/main/java/com/java3y/austin/service/api/impl/action/AssembleAction.java +++ b/austin-service-api-impl/src/main/java/com/java3y/austin/service/api/impl/action/AssembleAction.java @@ -2,6 +2,7 @@ package com.java3y.austin.service.api.impl.action; import cn.hutool.core.util.ReflectUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.google.common.base.Throwables; @@ -114,7 +115,7 @@ public class AssembleAction implements BusinessProcess { if (StrUtil.isNotBlank(originValue)) { String resultValue = ContentHolderUtil.replacePlaceHolder(originValue, variables); - Object resultObj = JSON.parseObject(resultValue, field.getType()); + Object resultObj = JSONUtil.isJsonObj(resultValue) ? JSONUtil.toBean(resultValue, field.getType()) : resultValue; ReflectUtil.setFieldValue(contentModel, field, resultObj); } } diff --git a/austin-web/src/main/java/com/java3y/austin/web/controller/RefreshTokenController.java b/austin-web/src/main/java/com/java3y/austin/web/controller/RefreshTokenController.java new file mode 100644 index 0000000..e0f89a5 --- /dev/null +++ b/austin-web/src/main/java/com/java3y/austin/web/controller/RefreshTokenController.java @@ -0,0 +1,46 @@ +package com.java3y.austin.web.controller; + + +import com.java3y.austin.common.enums.ChannelType; +import com.java3y.austin.common.vo.BasicResultVO; +import com.java3y.austin.cron.handler.RefreshDingDingAccessTokenHandler; +import com.java3y.austin.cron.handler.RefreshGeTuiAccessTokenHandler; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * @Author 3y + */ +@Api(tags = {"手动刷新token的接口"}) +@RestController +public class RefreshTokenController { + + + @Autowired + private RefreshDingDingAccessTokenHandler refreshDingDingAccessTokenHandler; + @Autowired + private RefreshGeTuiAccessTokenHandler refreshGeTuiAccessTokenHandler; + + /** + * 按照不同的渠道刷新对应的Token,channelType取值来源com.java3y.austin.common.enums.ChannelType + * @param channelType + * @return + */ + @ApiOperation(value = "手动刷新token", notes = "钉钉/个推 token刷新") + @GetMapping("/refresh") + public BasicResultVO refresh(Integer channelType) { + if (ChannelType.PUSH.getCode().equals(channelType)) { + refreshGeTuiAccessTokenHandler.execute(); + } + if (ChannelType.DING_DING_WORK_NOTICE.getCode().equals(channelType)) { + refreshDingDingAccessTokenHandler.execute(); + + } + return BasicResultVO.success("刷新成功"); + } + +}