|
|
@@ -789,6 +789,37 @@ public class GoGenerateService {
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ public Mono<StringBuilder> getOutImportDomainCommon(Mono<PlanNewCommon> mono) {
|
|
|
+ return mono.flatMap(saveRequest -> {
|
|
|
+ if (Objects.isNull(saveRequest.importDomain()) || saveRequest.importDomain().isEmpty()) {
|
|
|
+ throw new BaseException("入口页域名值不可为空");
|
|
|
+ }
|
|
|
+ return template.select(Query.query(Criteria.where("group_type_id").is(saveRequest.importDomain())
|
|
|
+ .and("status").is(1)
|
|
|
+ .and("type").is(1)
|
|
|
+ .and("deleted_at").isNull()), DomainSelect.class)
|
|
|
+ .collectList()
|
|
|
+ .switchIfEmpty(Mono.just(List.of())).flatMap(b -> {
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
+ if (Objects.nonNull(b) && !b.isEmpty()) {
|
|
|
+ DomainSelect domainSelect = b.get(RandomUtil.randomInt(0, b.size()));
|
|
|
+ stringBuilder.append("http://");
|
|
|
+ stringBuilder.append(get6Str());
|
|
|
+ stringBuilder.append(".");
|
|
|
+ stringBuilder.append(domainSelect.domain());
|
|
|
+ stringBuilder.append("/index.html?code=");
|
|
|
+ stringBuilder.append(saveRequest.code());
|
|
|
+ stringBuilder.append("&sk=");
|
|
|
+ stringBuilder.append(IdUtil.fastSimpleUUID());
|
|
|
+ } else {
|
|
|
+ throw new BaseException("通过入口页域名值查询域名返回结果为空");
|
|
|
+ }
|
|
|
+ return Mono.just(stringBuilder);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
public Mono<StringBuilder> getStringBuilderMono(PlanReq saveRequest) {
|
|
|
if (Objects.isNull(saveRequest.getPlanNewId()) || "".equals(saveRequest.getPlanNewId())) {
|
|
|
return template.select(Query.query(Criteria.where("group_type_id").is(saveRequest.getGroupId())
|