Browse Source

关掉功能

master
nili 2 weeks ago
parent
commit
66f5a87ef1
  1. 11
      game-service/src/main/java/awesome/group/game/service/cache/JedisManager.java
  2. 21
      game-service/src/main/java/awesome/group/game/service/matrix/SuperAdminService.java
  3. 7
      game-web/src/main/java/awesome/group/game/web/rest/matrix/SuperAdminController.java

11
game-service/src/main/java/awesome/group/game/service/cache/JedisManager.java

@ -109,6 +109,17 @@ public class JedisManager {
} }
} }
public void set(String key, String value) {
Assert.notNull(key, "key is null");
Assert.notNull(value, "value is null");
try (Jedis jedis = getJedis()) {
jedis.set(key, value);
} catch (Exception e) {
throw e;
}
}
public void set(String key, String value, int expireSeconds) { public void set(String key, String value, int expireSeconds) {
Assert.notNull(key, "key is null"); Assert.notNull(key, "key is null");
Assert.notNull(value, "value is null"); Assert.notNull(value, "value is null");

21
game-service/src/main/java/awesome/group/game/service/matrix/SuperAdminService.java

@ -5,6 +5,8 @@ import awesome.group.game.dao.mapper.*;
import awesome.group.game.service.bo.AddMockScheduleReq; import awesome.group.game.service.bo.AddMockScheduleReq;
import awesome.group.game.service.bo.matrix.AppNormalConfig; import awesome.group.game.service.bo.matrix.AppNormalConfig;
import awesome.group.game.service.bo.matrix.WhiteUserBo; import awesome.group.game.service.bo.matrix.WhiteUserBo;
import awesome.group.game.service.cache.CacheKey;
import awesome.group.game.service.cache.JedisManager;
import awesome.group.game.service.common.log.L; import awesome.group.game.service.common.log.L;
import awesome.group.game.service.util.Constants; import awesome.group.game.service.util.Constants;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -57,6 +59,9 @@ public class SuperAdminService {
@Autowired @Autowired
private SuperAdminService superAdminService; private SuperAdminService superAdminService;
@Autowired
private JedisManager jedisManager;
public List<MatrixEvilApp> evilAppList() { public List<MatrixEvilApp> evilAppList() {
List<MatrixEvilApp> app = evilAppMapper.selectList(null); List<MatrixEvilApp> app = evilAppMapper.selectList(null);
Collections.reverse(app); Collections.reverse(app);
@ -123,6 +128,22 @@ public class SuperAdminService {
} }
} }
public void disableByChannel(String channel) {
List<MatrixApp> list = appMapper.selectByChannel(channel);
for (MatrixApp app : list) {
jedisManager.set("disable_" + app.getCode(), "1");
}
String cacheKey = CacheKey.disableChannel();
jedisManager.sadd(cacheKey, channel);
}
public void enableByChannel(String channel) {
List<MatrixApp> list = appMapper.selectByChannel(channel);
for (MatrixApp app : list) {
jedisManager.del("disable_" + app.getCode());
}
}
public void changeInnerUser(Integer userId, int status) { public void changeInnerUser(Integer userId, int status) {
innerUserMapper.updateStatus(userId, status); innerUserMapper.updateStatus(userId, status);
} }

7
game-web/src/main/java/awesome/group/game/web/rest/matrix/SuperAdminController.java

@ -92,4 +92,11 @@ public class SuperAdminController {
superAdminService.addMockSchedule(bo, RequestContext.getAdminID()); superAdminService.addMockSchedule(bo, RequestContext.getAdminID());
return new R<>(R.CODE_SUCCESS, "ok", null); return new R<>(R.CODE_SUCCESS, "ok", null);
} }
@GetMapping("/disableByChannel")
@RestApi
public R<Void> disableByChannel(@RequestParam String channel) {
superAdminService.disableByChannel(channel);
return new R<>(R.CODE_SUCCESS, "ok", null);
}
} }

Loading…
Cancel
Save