Bladeren bron

Merge branch 'package' of GameCenter/game-center into dev

zhimo 1 jaar geleden
bovenliggende
commit
3dd625d99c

+ 23 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/task/GameMonitorAlarmTask.java

@@ -1,6 +1,9 @@
 package com.zanxiang.game.data.serve.task;
 package com.zanxiang.game.data.serve.task;
 
 
+import com.zanxiang.game.data.serve.pojo.properties.SmsProperties;
 import com.zanxiang.game.data.serve.service.IGameMonitorAlarmService;
 import com.zanxiang.game.data.serve.service.IGameMonitorAlarmService;
+import com.zanxiang.module.sms.pojo.SendResult;
+import com.zanxiang.module.sms.service.impl.AliSmsService;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
@@ -10,6 +13,8 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
+import java.util.*;
 import java.util.concurrent.*;
 import java.util.concurrent.*;
 
 
 /**
 /**
@@ -26,6 +31,12 @@ public class GameMonitorAlarmTask {
     @Autowired
     @Autowired
     private IGameMonitorAlarmService gameMonitorAlarmService;
     private IGameMonitorAlarmService gameMonitorAlarmService;
 
 
+    @Resource
+    private SmsProperties smsProperties;
+
+    @Resource
+    private AliSmsService aliSmsService;
+
     private ExecutorService taskScheduler = Executors.newSingleThreadExecutor();
     private ExecutorService taskScheduler = Executors.newSingleThreadExecutor();
 
 
 
 
@@ -54,6 +65,7 @@ public class GameMonitorAlarmTask {
                     log.info("定时任务游戏监控告警出错", e);
                     log.info("定时任务游戏监控告警出错", e);
                 }
                 }
             }catch (Exception e){
             }catch (Exception e){
+
                 log.error("定时任务游戏监控告警出错", e);
                 log.error("定时任务游戏监控告警出错", e);
             }
             }
         });
         });
@@ -61,10 +73,21 @@ public class GameMonitorAlarmTask {
             //两分钟执行不完就超时
             //两分钟执行不完就超时
             future.get(120, TimeUnit.SECONDS);
             future.get(120, TimeUnit.SECONDS);
         } catch (Exception e) {
         } catch (Exception e) {
+            sendMsg("定时任务游戏监控告警超时");
             log.error("定时任务游戏监控告警超时", e);
             log.error("定时任务游戏监控告警超时", e);
             future.cancel(true);
             future.cancel(true);
         }
         }
     }
     }
 
 
+    private void sendMsg(String msg) {
+        log.info("发送告警消息:{}", msg);
+        Date date = new Date();
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Map<String, String> params = new HashMap<>();
+        params.put(smsProperties.getMsgParamName(), msg);
+        params.put(smsProperties.getTimeParamName(),formatter.format(date));
+        String number = "15765577867";
+        aliSmsService.send(smsProperties.getDefaultSignName(), smsProperties.getDefaultStstemErrorTemplate(), params, number);
+    }
 
 
 }
 }

+ 1 - 1
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/SDKApplication.java

@@ -23,7 +23,7 @@ public class SDKApplication {
 
 
     public static void main(String[] args) {
     public static void main(String[] args) {
         SpringApplication.run(SDKApplication.class, args);
         SpringApplication.run(SDKApplication.class, args);
-        System.out.println("赞象SDK服务启动成功 <H5端加配置字段, 回传修改> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象SDK服务启动成功 <H5端加配置字段, 回传修改1> ( ´・・)ノ(._.`) \n" +
                 " ___________ _   __\n" +
                 " ___________ _   __\n" +
                 "/  ___|  _  \\ | / /\n" +
                 "/  ___|  _  \\ | / /\n" +
                 "\\ `--.| | | | |/ / \n" +
                 "\\ `--.| | | | |/ / \n" +

+ 1 - 1
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/GameAppletServiceImpl.java

@@ -192,7 +192,7 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
                 .gameName(game.getName())
                 .gameName(game.getName())
                 .isPut(game.getIsPut())
                 .isPut(game.getIsPut())
                 .h5GameConfigDTO(Strings.isBlank(h5GameConfig) ? null : JsonUtil.toObj(h5GameConfig, H5GameConfigDTO.class))
                 .h5GameConfigDTO(Strings.isBlank(h5GameConfig) ? null : JsonUtil.toObj(h5GameConfig, H5GameConfigDTO.class))
-                .h5GameConfigMap(Strings.isBlank(h5GameConfig) ? null : JsonUtil.toMapWithClass(h5GameConfig, Map.class))
+                .h5GameConfigMap(Strings.isBlank(h5GameConfig) ? null : JsonUtil.toMap(h5GameConfig, Map.class, Object.class))
                 .build();
                 .build();
     }
     }
 }
 }