|
|
@@ -4,6 +4,7 @@ import cn.hutool.core.util.RandomUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.common.util.Times;
|
|
|
import com.cyksj.config.TgMiniConfig;
|
|
|
import com.cyksj.config.YhCertMiniConfig;
|
|
|
@@ -204,6 +205,27 @@ public class MiniServiceImpl implements MiniService {
|
|
|
return weChatService.generateCode(accessToken, req.getPath());
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public String generateGptMiniSchema(MiniSchemaReq req) throws Exception {
|
|
|
+ if (StrUtil.isEmpty(req.getPath())) {
|
|
|
+ throw BusinessRuntimeException.getInstance("请传入小程序跳转路径");
|
|
|
+ }
|
|
|
+ String query = StrUtil.EMPTY;
|
|
|
+ if (StrUtil.isNotBlank(req.getDsCode())) {
|
|
|
+ query = "dsCode=" + req.getDsCode();
|
|
|
+ }
|
|
|
+ //调用微信小程序接口
|
|
|
+ String accessToken = weChatService.getAccessToken(tgMiniConfig.getAppId());
|
|
|
+ TargetAppletSchemeReq targetAppletSchemeReq = new TargetAppletSchemeReq();
|
|
|
+ targetAppletSchemeReq.setExpireType(0l);
|
|
|
+ targetAppletSchemeReq.setExpireTime((System.currentTimeMillis() / 1000) + Times.second_per_day);
|
|
|
+ targetAppletSchemeReq.setIsExpired(false);
|
|
|
+ TargetAppletSchemeReq.JumpWxa jumpWxa = new TargetAppletSchemeReq.JumpWxa(req.getPath(), query);
|
|
|
+ targetAppletSchemeReq.setJumpWxa(jumpWxa);
|
|
|
+ String miniSchema = weChatService.generateSchema(accessToken, targetAppletSchemeReq);
|
|
|
+ return miniSchema;
|
|
|
+ }
|
|
|
+
|
|
|
public void updateArticleMarkNum(Integer type, Long articleId, Integer offset) {
|
|
|
Integer success = 0;
|
|
|
while (success != 1) {
|