Commit b05140b9 authored by Junling Bu's avatar Junling Bu
Browse files

litemall-core微调

parent 94463c26
...@@ -54,8 +54,6 @@ public class StorageService { ...@@ -54,8 +54,6 @@ public class StorageService {
storageInfo.setName(fileName); storageInfo.setName(fileName);
storageInfo.setSize((int) contentLength); storageInfo.setSize((int) contentLength);
storageInfo.setType(contentType); storageInfo.setType(contentType);
storageInfo.setAddTime(LocalDateTime.now());
storageInfo.setModified(LocalDateTime.now());
storageInfo.setKey(key); storageInfo.setKey(key);
storageInfo.setUrl(url); storageInfo.setUrl(url);
litemallStorageService.add(storageInfo); litemallStorageService.add(storageInfo);
......
...@@ -24,6 +24,22 @@ public class JacksonUtil { ...@@ -24,6 +24,22 @@ public class JacksonUtil {
return null; return null;
} }
public static List<String> parseStringList(String body, String field) {
ObjectMapper mapper = new ObjectMapper();
JsonNode node = null;
try {
node = mapper.readTree(body);
JsonNode leaf = node.get(field);
if(leaf != null)
return mapper.convertValue(leaf, new TypeReference<List<String>>(){});
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public static Integer parseInteger(String body, String field) { public static Integer parseInteger(String body, String field) {
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
JsonNode node = null; JsonNode node = null;
...@@ -46,7 +62,7 @@ public class JacksonUtil { ...@@ -46,7 +62,7 @@ public class JacksonUtil {
JsonNode leaf = node.get(field); JsonNode leaf = node.get(field);
if(leaf != null) if(leaf != null)
return mapper.convertValue(leaf, new TypeReference<List<String>>(){}); return mapper.convertValue(leaf, new TypeReference<List<Integer>>(){});
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment