商品 添加称重商品 和 套餐商品

This commit is contained in:
2024-11-19 15:08:35 +08:00
parent e8dd3778ac
commit 53e7443817
6 changed files with 144 additions and 77 deletions

View File

@@ -102,10 +102,13 @@ public class ListUtil {
}
public static<T> String listChangeString(List<T> listString){
return listString.stream()
.map(Object::toString)
.collect(Collectors.joining(", "));
public static <T> String listToJsonString(List<T> list) {
ObjectMapper objectMapper = new ObjectMapper();
try {
return objectMapper.writeValueAsString(list);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
}
public static String mapToString(Map<String, String> map) {