|
|
@@ -29,15 +29,11 @@ import shop.alien.storeplatform.feign.AlienAIFeign;
|
|
|
import shop.alien.storeplatform.service.OperationalActivityService;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
-import java.time.Instant;
|
|
|
-import java.time.LocalDate;
|
|
|
-import java.time.LocalDateTime;
|
|
|
-import java.time.ZoneId;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
-import java.util.stream.Collectors;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 运营活动服务实现类
|
|
|
@@ -108,7 +104,25 @@ public class OperationalActivityServiceImpl implements OperationalActivityServic
|
|
|
} else {
|
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
|
ObjectNode requestBody = objectMapper.createObjectNode();
|
|
|
- requestBody.put("text", dto.getImgDescribe());
|
|
|
+
|
|
|
+ String tpl = "活动名称:%s\n"
|
|
|
+ + "活动时间:%s - %s\n"
|
|
|
+ + "用户可参与次数:%s\n"
|
|
|
+ + "活动规则:%s\n"
|
|
|
+ + "优惠券发放数量:%s\n"
|
|
|
+ + "图片描述:%s";
|
|
|
+
|
|
|
+ String filled = String.format(
|
|
|
+ tpl,
|
|
|
+ dto.getActivityName(),
|
|
|
+ dto.getStartTime(),
|
|
|
+ dto.getEndTime(),
|
|
|
+ dto.getParticipationLimit(),
|
|
|
+ dto.getActivityRule(),
|
|
|
+ dto.getCouponQuantity(),
|
|
|
+ dto.getImgDescribe()
|
|
|
+ );
|
|
|
+ requestBody.put("text", filled);
|
|
|
// 调用接口,传递Bearer token
|
|
|
String authorization = "Bearer " + accessToken;
|
|
|
JsonNode response = alienAIFeign.generatePromotionImage(authorization, requestBody);
|