| | |
| | | import org.example.common.ServerResponse; |
| | | import org.example.pojo.User; |
| | | import org.example.util.JwtUtil; |
| | | import org.example.util.RedisUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.context.ConfigurableApplicationContext; |
| | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.InputStreamReader; |
| | | import java.util.Set; |
| | | |
| | | @RestController |
| | | @RequestMapping("/api") |
| | |
| | | if (exitCode != 0) { |
| | | return ServerResponse.createByErrorMsg(pathName+"重启失败"); |
| | | } |
| | | |
| | | Set<String> keys = RedisUtil.keys(pathName); |
| | | keys.forEach(f->{ |
| | | RedisUtil.delete(f); |
| | | }); |
| | | log.info(pathName+"缓存清理完成,数量:" + keys.size()); |
| | | return ServerResponse.createBySuccess(pathName+"重启成功"); |
| | | } catch (IOException | InterruptedException e) { |
| | | e.printStackTrace(); |