| 37 | import java.util.concurrent.CompletableFuture; |
| 38 | |
| 39 | @Controller |
| 40 | public class IndexController { |
| 41 | @Autowired private ImgService imgService; |
| 42 | @Autowired private SysConfigService sysConfigService; |
| 43 | @Autowired private ConfdataService confdataService; |
| 44 | @Autowired private UploadConfigService uploadConfigService; |
| 45 | @Autowired private UploadServicel uploadServicel; |
| 46 | @Autowired private deleImages deleimages; |
| 47 | @Autowired private IRedisService iRedisService; |
| 48 | @Autowired private AppClientService appClientService; |
| 49 | @Autowired private WebDAVImageupload webDAVImageupload; |
| 50 | public static String version = "20240130"; |
| 51 | @RequestMapping(value = "/") |
| 52 | public String Welcome(Model model, HttpServletRequest httpServletRequest) { |
| 53 | model.addAttribute("name", "服务端程序(开源版)"); |
| 54 | model.addAttribute("version", version); |
| 55 | model.addAttribute("ip", GetIPS.getIpAddr(httpServletRequest)); |
| 56 | model.addAttribute("links", "https://github.com/Hello-hao/tbed"); |
| 57 | return "welcome"; |
| 58 | } |
| 59 | |
| 60 | @RequestMapping(value = "/webInfo") |
| 61 | @ResponseBody |
| 62 | public Msg webInfo() { |
| 63 | Msg msg = new Msg(); |
| 64 | final Confdata confdata = confdataService.selectConfdata("config"); |
| 65 | JSONObject cd = JSONObject.parseObject(confdata.getJsondata()); |
| 66 | UploadConfig updateConfig = uploadConfigService.getUpdateConfig(); |
| 67 | SysConfig sysConfig = sysConfigService.getstate(); |
| 68 | JSONObject jsonObject = new JSONObject(); |
| 69 | AppClient appClient = appClientService.getAppClientData("app"); |
| 70 | jsonObject.put("webname", cd.getString("webname")); |
| 71 | jsonObject.put("systype","free"); |
| 72 | jsonObject.put("version",version); |
| 73 | jsonObject.put("websubtitle", cd.getString("websubtitle")); |
| 74 | jsonObject.put("keywords", cd.getString("keywords")); |
| 75 | jsonObject.put("webms", cd.getString("webms")); |
| 76 | jsonObject.put("explain", cd.getString("explain")); |
| 77 | jsonObject.put("baidu", cd.getString("baidu")); |
| 78 | jsonObject.put("links", cd.getString("links")); |
| 79 | jsonObject.put("aboutinfo", cd.getString("aboutinfo")); |
| 80 | jsonObject.put("logo", cd.getString("logo")); |
| 81 | jsonObject.put("webfavicons", cd.getString("webfavicons")); |
| 82 | jsonObject.put("api", updateConfig.getApi()); |
| 83 | jsonObject.put("register", sysConfig.getRegister()); |
| 84 | jsonObject.put("isuse", appClient.getIsuse()); |
| 85 | jsonObject.put("clientname", appClient.getAppname()); |
| 86 | jsonObject.put("clientlogo", appClient.getApplogo()); |
| 87 | jsonObject.put("appupdate", appClient.getAppupdate()); |
| 88 | jsonObject.put("serverVersion",version); |
| 89 | msg.setData(jsonObject); |
| 90 | return msg; |
| 91 | } |
| 92 | @PostMapping(value = {"/uploadChunkFile","/client/uploadChunkFile"}) |
| 93 | @ResponseBody |
| 94 | @CrossOrigin |
| 95 | public Msg uploadChunk(HttpServletRequest request,Chunk chunk) { |
| 96 | Msg msg = new Msg(); |
nothing calls this directly
no outgoing calls
no test coverage detected