From fc03a0df2edbf308351d3fb4027919e1d1d30e51 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Fri, 25 Jul 2025 15:20:45 +0800
Subject: [PATCH] feat(mall): 添加衣服图案和位置的额外属性
---
src/main/java/cc/mrbird/febs/mall/controller/HSController.java | 80 +++++++++++++-------------
src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesLocationRemarkVo.java | 5 +
src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesPatternInfoVo.java | 5 +
src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesSocialServiceImpl.java | 8 ++
src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesLocationInfoVo.java | 5 +
src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesOrderServiceImpl.java | 11 +++
src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesPatternRemarkVo.java | 5 +
src/main/java/cc/mrbird/febs/mall/entity/ClothesPattern.java | 4
8 files changed, 81 insertions(+), 42 deletions(-)
diff --git a/src/main/java/cc/mrbird/febs/mall/controller/HSController.java b/src/main/java/cc/mrbird/febs/mall/controller/HSController.java
index 486182f..17b6279 100644
--- a/src/main/java/cc/mrbird/febs/mall/controller/HSController.java
+++ b/src/main/java/cc/mrbird/febs/mall/controller/HSController.java
@@ -18,7 +18,7 @@
// 从环境变量中获取您的Key鉴权。此为默认方式,您可根据需要进行修改
private static String ak = "AKLTZTQxZjMyZTUxMWJmNDEyNDkzNWExOGQ3ODllNzhhNmQ";
private static String sk = "TmpFeE1qZ3haREExTW1JeE5HRTBZVGc1WlRRNVlqWXpORGd5TWpsak5HWQ==";
- private static String ep_id = "ep-20250724165858-g5rwk";
+ private static String ep_id = "ep-20250724113103-fn6pg";
// 此为默认路径,您可根据业务所在地域进行配置
static String baseUrl = "https://ark.cn-beijing.volces.com/api/v3";
static ConnectionPool connectionPool = new ConnectionPool(5, 1, TimeUnit.SECONDS);
@@ -28,56 +28,56 @@
public static void main(String[] args) {
System.out.println("\n----- standard request -----");
// 2. 构建对话历史(AI提问→用户回答)
-// List<ChatMessage> messages = Arrays.asList(
-// // System消息:定义AI角色和行为
-// ChatMessage.builder()
-// .role(ChatMessageRole.SYSTEM)
-// .content("你是同事相处顾问,任务流程:\n1) 先提出一个关于团队协作的问题\n2) 用户回答后,分析回答的不足\n3) 提供具体的改进建议和示例")
-// .build(),
-// // Assistant消息:AI的初始问题
-// ChatMessage.builder()
-// .role(ChatMessageRole.ASSISTANT)
-// .content("组员成为了销冠,组长的你该如何表达自己的称赞,同时给其他组员加油?")
-// .build(),
-// // User消息:用户的回答
-// ChatMessage.builder()
-// .role(ChatMessageRole.USER)
-// .content("干的漂亮。")
-// .build()
-// );
List<ChatMessage> messages = Arrays.asList(
// System消息:定义AI角色和行为
ChatMessage.builder()
.role(ChatMessageRole.SYSTEM)
- .content("\"content\": \"###\n" +
- "假如你是一位专业的彩票数据分析师,你将根据双色球历史开奖记录相关信息,来解决回答关于双色球历史开奖结果相关问题的任务。根据以下规则一步步执行:\n" +
- "1. 回答问题时需提供准确的红球号码。\n" +
- "2. 回答问题时需提供准确的蓝球号码。\n" +
- "3. 回答问题时需提供准确的开奖日期。\n" +
- "\n" +
- "参考例子:\n" +
- "无\n" +
- "\n" +
- "请回答问题:\n" +
- "关于双色球历史开奖结果的问题\n" +
- "输出:\n" +
- "\n" +
- "要求:\n" +
- "1 输出包含准确的红球号码、蓝球号码和开奖日期。\n" +
- "2 表述清晰准确。\n" +
- "###")
+ .content("你是同事相处顾问,任务流程:\n1) 先提出一个关于团队协作的问题\n2) 用户回答后,分析回答的不足\n3) 提供具体的改进建议和示例")
.build(),
// Assistant消息:AI的初始问题
-// ChatMessage.builder()
-// .role(ChatMessageRole.ASSISTANT)
-// .content("组员成为了销冠,组长的你该如何表达自己的称赞,同时给其他组员加油?")
-// .build(),
+ ChatMessage.builder()
+ .role(ChatMessageRole.ASSISTANT)
+ .content("组员成为了销冠,组长的你该如何表达自己的称赞,同时给其他组员加油?")
+ .build(),
// User消息:用户的回答
ChatMessage.builder()
.role(ChatMessageRole.USER)
- .content("第2025001期双色球开奖结果是什么?")
+ .content("干的漂亮。")
.build()
);
+// List<ChatMessage> messages = Arrays.asList(
+// // System消息:定义AI角色和行为
+// ChatMessage.builder()
+// .role(ChatMessageRole.SYSTEM)
+// .content("\"content\": \"###\n" +
+// "假如你是一位专业的彩票数据分析师,你将根据双色球历史开奖记录相关信息,来解决回答关于双色球历史开奖结果相关问题的任务。根据以下规则一步步执行:\n" +
+// "1. 回答问题时需提供准确的红球号码。\n" +
+// "2. 回答问题时需提供准确的蓝球号码。\n" +
+// "3. 回答问题时需提供准确的开奖日期。\n" +
+// "\n" +
+// "参考例子:\n" +
+// "无\n" +
+// "\n" +
+// "请回答问题:\n" +
+// "关于双色球历史开奖结果的问题\n" +
+// "输出:\n" +
+// "\n" +
+// "要求:\n" +
+// "1 输出包含准确的红球号码、蓝球号码和开奖日期。\n" +
+// "2 表述清晰准确。\n" +
+// "###")
+// .build(),
+// // Assistant消息:AI的初始问题
+//// ChatMessage.builder()
+//// .role(ChatMessageRole.ASSISTANT)
+//// .content("组员成为了销冠,组长的你该如何表达自己的称赞,同时给其他组员加油?")
+//// .build(),
+// // User消息:用户的回答
+// ChatMessage.builder()
+// .role(ChatMessageRole.USER)
+// .content("第2025001期双色球开奖结果是什么?")
+// .build()
+// );
ChatCompletionRequest chatCompletionRequest = ChatCompletionRequest.builder()
// 指定您创建的方舟推理接入点 ID,此处已帮您修改为您的推理接入点 ID
.model(ep_id)
diff --git a/src/main/java/cc/mrbird/febs/mall/entity/ClothesPattern.java b/src/main/java/cc/mrbird/febs/mall/entity/ClothesPattern.java
index 2ed1303..58a624a 100644
--- a/src/main/java/cc/mrbird/febs/mall/entity/ClothesPattern.java
+++ b/src/main/java/cc/mrbird/febs/mall/entity/ClothesPattern.java
@@ -22,8 +22,8 @@
private String name;
private String image;
private String content;
- private String boxWidth;
- private String boxHeight;
+ private Integer boxWidth;
+ private Integer boxHeight;
private Integer leftPercent;
private Integer topPercent;
private BigDecimal price;
diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesOrderServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesOrderServiceImpl.java
index cf4dea8..ea2ca5e 100644
--- a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesOrderServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesOrderServiceImpl.java
@@ -257,6 +257,12 @@
vo.setPatternPrice(clothesPattern.getPrice());
vo.setPatternRemark(entity.getRemark());
vo.setPatternImage(clothesPattern.getImage());
+ vo.setBoxHeight(clothesPattern.getBoxHeight());
+ vo.setBoxWidth(clothesPattern.getBoxWidth());
+ vo.setLeftPercent(clothesPattern.getLeftPercent());
+ vo.setTopPercent(clothesPattern.getTopPercent());
+
+
vos.add(vo);
totalPatternPrice = totalPatternPrice.add(clothesPattern.getPrice());
@@ -281,6 +287,11 @@
vo.setLocationPrice(location.getPrice());
vo.setLocationRemark(entity.getRemark());
vo.setLocationImage(location.getImage());
+
+ vo.setBoxHeight(location.getBoxHeight());
+ vo.setBoxWidth(location.getBoxWidth());
+ vo.setLeftPercent(location.getLeftPercent());
+ vo.setTopPercent(location.getTopPercent());
vos.add(vo);
totalLocationPrice = totalLocationPrice.add(location.getPrice());
diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesSocialServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesSocialServiceImpl.java
index f96587c..2bcd490 100644
--- a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesSocialServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesSocialServiceImpl.java
@@ -533,6 +533,10 @@
vo.setPatternPrice(pattern.getPrice());
vo.setPatternId(pattern.getId());
vo.setPatternRemark(patternRemark.getRemark());
+ vo.setBoxHeight(pattern.getBoxHeight());
+ vo.setBoxWidth(pattern.getBoxWidth());
+ vo.setLeftPercent(pattern.getLeftPercent());
+ vo.setTopPercent(pattern.getTopPercent());
patternRemarkList.add( vo);
totalPatternAmount = totalPatternAmount.add(pattern.getPrice());
@@ -557,6 +561,10 @@
vo.setLocationImage(clothesLocation.getImage());
vo.setLocationPrice(clothesLocation.getPrice());
vo.setLocationId(clothesLocation.getId());
+ vo.setBoxHeight(clothesLocation.getBoxHeight());
+ vo.setBoxWidth(clothesLocation.getBoxWidth());
+ vo.setLeftPercent(clothesLocation.getLeftPercent());
+ vo.setTopPercent(clothesLocation.getTopPercent());
locationRemarkList.add(vo);
totalLocationAmount = totalLocationAmount.add(clothesLocation.getPrice());
diff --git a/src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesLocationInfoVo.java b/src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesLocationInfoVo.java
index bb0b12f..770a89c 100644
--- a/src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesLocationInfoVo.java
+++ b/src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesLocationInfoVo.java
@@ -21,4 +21,9 @@
private BigDecimal locationPrice = BigDecimal.ZERO;
@ApiModelProperty(value = "反面自定义内容")
private String locationRemark;
+
+ private Integer boxWidth;
+ private Integer boxHeight;
+ private Integer leftPercent;
+ private Integer topPercent;
}
diff --git a/src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesLocationRemarkVo.java b/src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesLocationRemarkVo.java
index 004acde..e15ae65 100644
--- a/src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesLocationRemarkVo.java
+++ b/src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesLocationRemarkVo.java
@@ -21,4 +21,9 @@
private BigDecimal locationPrice = BigDecimal.ZERO;
@ApiModelProperty(value = "反面自定义内容")
private String locationRemark;
+
+ private Integer boxWidth;
+ private Integer boxHeight;
+ private Integer leftPercent;
+ private Integer topPercent;
}
diff --git a/src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesPatternInfoVo.java b/src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesPatternInfoVo.java
index 4373f80..11a32e3 100644
--- a/src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesPatternInfoVo.java
+++ b/src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesPatternInfoVo.java
@@ -21,4 +21,9 @@
private BigDecimal patternPrice = BigDecimal.ZERO;
@ApiModelProperty(value = "正面自定义内容")
private String patternRemark;
+
+ private String boxWidth;
+ private String boxHeight;
+ private Integer leftPercent;
+ private Integer topPercent;
}
diff --git a/src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesPatternRemarkVo.java b/src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesPatternRemarkVo.java
index 0b5ad52..81748b1 100644
--- a/src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesPatternRemarkVo.java
+++ b/src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesPatternRemarkVo.java
@@ -21,4 +21,9 @@
private BigDecimal patternPrice = BigDecimal.ZERO;
@ApiModelProperty(value = "正面自定义内容")
private String patternRemark;
+
+ private Integer boxWidth;
+ private Integer boxHeight;
+ private Integer leftPercent;
+ private Integer topPercent;
}
--
Gitblit v1.9.1