|
|
@@ -118,15 +118,23 @@ public class NfttController extends MyController {
|
|
|
// ** detail_image_list (json) **
|
|
|
// 数据库字段是 JSON 类型,需要存储 JSON 字符串
|
|
|
// 获取 JSON 数组
|
|
|
- JSONArray detailImageListArray = requestBodyJson.getJSONArray("detail_image_list");
|
|
|
- if (detailImageListArray == null || detailImageListArray.isEmpty()) {
|
|
|
+ JSONArray detailImageList = requestBodyJson.getJSONArray("detail_image_list");
|
|
|
+ if (detailImageList == null || detailImageList.isEmpty()) {
|
|
|
// EmptyInterface 应该已经保证了 non-null,但可能为空数组
|
|
|
// 如果图片列表不能为空,这里可以返回错误
|
|
|
renderJson(MyRet.fail("介绍图URL列表(detail_image_list)不能为空"));
|
|
|
return;
|
|
|
}
|
|
|
// 转换为 JSON 字符串存储
|
|
|
- nftt.set("detail_image_list", detailImageListArray.toJSONString());
|
|
|
+ nftt.set("detail_image_list", detailImageList.toJSONString());
|
|
|
+
|
|
|
+ // ** banner_image_list (json) **
|
|
|
+ JSONArray bannerImageList = requestBodyJson.getJSONArray("banner_image_list");
|
|
|
+ if (bannerImageList == null || bannerImageList.isEmpty()) {
|
|
|
+ renderJson(MyRet.fail("banner URL列表(banner_image_list)不能为空"));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ nftt.set("banner_image_list", bannerImageList.toJSONString());
|
|
|
|
|
|
// ** purchased_quantity (int) - 默认值 **
|
|
|
// 这是一个内部字段,通常在创建时初始化为 0
|
|
|
@@ -287,9 +295,15 @@ public class NfttController extends MyController {
|
|
|
}
|
|
|
|
|
|
// 详情列表
|
|
|
- JSONArray detailImageListArray = requestBodyJson.getJSONArray("detail_image_list");
|
|
|
- if (detailImageListArray != null) {
|
|
|
- nftt.set("detail_image_list", detailImageListArray.toJSONString());
|
|
|
+ JSONArray detailImageList = requestBodyJson.getJSONArray("detail_image_list");
|
|
|
+ if (detailImageList != null) {
|
|
|
+ nftt.set("detail_image_list", detailImageList.toJSONString());
|
|
|
+ }
|
|
|
+
|
|
|
+ // banner图片列表
|
|
|
+ JSONArray bannerImageList = requestBodyJson.getJSONArray("banner_image_list");
|
|
|
+ if (bannerImageList != null) {
|
|
|
+ nftt.set("banner_image_list", bannerImageList.toJSONString());
|
|
|
}
|
|
|
|
|
|
// 最后执行更新
|