提交 ddb024fb authored 作者: inroi's avatar inroi

微调

上级 3534142d
...@@ -6,10 +6,7 @@ import com.system.transfer.response.RestResponse; ...@@ -6,10 +6,7 @@ import com.system.transfer.response.RestResponse;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* @author Inori * @author Inori
...@@ -29,7 +26,13 @@ public class LicFileController { ...@@ -29,7 +26,13 @@ public class LicFileController {
return licFileService.licInfoFileImport(inVo); return licFileService.licInfoFileImport(inVo);
} }
@ApiOperation("Lic文件下载") @ApiOperation("获取MAC地址")
@GetMapping("/lic/info/file/download")
public RestResponse macAddressDetail() {
return licFileService.macAddressDetail();
}
@ApiOperation("流下载文件(测试)")
@PostMapping("/lic/info/file/download") @PostMapping("/lic/info/file/download")
public RestResponse licInfoFileDownload() { public RestResponse licInfoFileDownload() {
return licFileService.licInfoFileDownload(); return licFileService.licInfoFileDownload();
......
...@@ -16,7 +16,18 @@ public interface ILicFileService { ...@@ -16,7 +16,18 @@ public interface ILicFileService {
*/ */
RestResponse licInfoFileImport(LicInfoFileImportInVo inVo); RestResponse licInfoFileImport(LicInfoFileImportInVo inVo);
/**
* 获取MAC地址
*
* @return 结果
*/
RestResponse macAddressDetail();
/**
* 流下载文件(测试)
*
* @return 结果
*/
RestResponse licInfoFileDownload(); RestResponse licInfoFileDownload();
......
...@@ -13,6 +13,9 @@ import org.springframework.stereotype.Service; ...@@ -13,6 +13,9 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.io.*; import java.io.*;
import java.net.InetAddress;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.Map; import java.util.Map;
...@@ -64,6 +67,16 @@ public class LicFileServiceImpl implements ILicFileService { ...@@ -64,6 +67,16 @@ public class LicFileServiceImpl implements ILicFileService {
} }
@Override @Override
public RestResponse macAddressDetail() {
try {
return RestResponse.success(LocalMacUtil.getLocalMac(InetAddress.getLocalHost()));
} catch (SocketException | UnknownHostException e) {
e.printStackTrace();
return RestResponse.fail("获取MAC地址失败");
}
}
@Override
public RestResponse licInfoFileDownload() { public RestResponse licInfoFileDownload() {
BufferedInputStream bis = null; BufferedInputStream bis = null;
FileOutputStream fos = null; FileOutputStream fos = null;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论