| | |
| | | import com.zy.asrs.service.AppVersionService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.util.ClassUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.*; |
| | | import java.net.InetAddress; |
| | | import java.net.UnknownHostException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class AppVersionController extends BaseController { |
| | | |
| | | @Value("${server.port}") |
| | | private String port; |
| | | @Autowired |
| | | private AppVersionService appVersionService; |
| | | |
| | |
| | | response.setStatus(404); |
| | | } |
| | | } |
| | | @RequestMapping("/appVersion/downloadApp/getIp") |
| | | public R qrDownload() { |
| | | String ipAddress = ""; |
| | | String url = ""; |
| | | try { |
| | | InetAddress inetAddress = InetAddress.getLocalHost(); |
| | | ipAddress = inetAddress.getHostAddress(); |
| | | System.out.println("本机IP地址:" + ipAddress); |
| | | } catch (UnknownHostException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | url = "http://" + ipAddress + ":" + port; |
| | | return R.ok().add(url); |
| | | } |
| | | } |