|
|
@@ -10,6 +10,7 @@ import com.webflux.launchadmin.config.BaseContextHandler;
|
|
|
import com.webflux.launchadmin.global.BaseException;
|
|
|
import com.webflux.launchadmin.mysql.controller.planNew.req.*;
|
|
|
import com.webflux.launchadmin.mysql.controller.planNew.res.*;
|
|
|
+import com.webflux.launchadmin.mysql.entity.listening.ListeningPlanNew;
|
|
|
import com.webflux.launchadmin.mysql.entity.planNew.*;
|
|
|
import com.webflux.launchadmin.mysql.service.planNew.goGenerate.GoGenerateService;
|
|
|
import com.webflux.launchadmin.mysql.service.planNew.structure.GoRequest;
|
|
|
@@ -66,24 +67,43 @@ public class PlanNewOutController {
|
|
|
* @return {@link Mono}<{@link RStatus}<{@link DomainSelectRes}>>
|
|
|
*/
|
|
|
@GetMapping("domain/select")
|
|
|
- public Mono<RStatus<DomainSelectRes>> domainSelect(@RequestParam("code") String code,@RequestParam("type") String type ){
|
|
|
- Mono<PlanNew> code1 = template.selectOne(Query.query(Criteria.where("code").is(code)), PlanNew.class)
|
|
|
- .switchIfEmpty(Mono.error(new BaseException("code错误")))
|
|
|
- .onErrorResume(throwable -> Mono.error(new Exception(throwable.getMessage())));
|
|
|
- Mono<DomainSelectRes> domainSelectResMono1 = code1.flatMap(f -> template.select(Query.query(Criteria.where("group_type_id").is(f.groupId())
|
|
|
- .and("status").is(1).and("type").is(type)), DomainSelect.class)
|
|
|
- .switchIfEmpty(Mono.error(new BaseException("查询domain为空")))
|
|
|
- .onErrorResume(throwable -> Mono.error(new Exception(throwable.getMessage()))).collectList().flatMap(fm -> {
|
|
|
- DomainSelectRes domainSelectRes = new DomainSelectRes();
|
|
|
- int i = RandomUtil.randomInt(0, fm.size());
|
|
|
- String domain = fm.get(i).domain();
|
|
|
- String string = RandomUtil.randomString("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", 6);
|
|
|
- domainSelectRes.setDomain(string+"."+domain);
|
|
|
- domainSelectRes.setPath("");
|
|
|
- domainSelectRes.setUnique(IdUtil.fastSimpleUUID());
|
|
|
- return Mono.just(domainSelectRes);
|
|
|
- }));
|
|
|
- return RStatus.success(domainSelectResMono1);
|
|
|
+
|
|
|
+ public Mono<RStatus<DomainSelectRes>> domainSelect(@RequestParam("code") String code,@RequestParam("type") String type ,@RequestParam("typePlan") Integer typePlan ){
|
|
|
+ if (1 == typePlan) {
|
|
|
+ Mono<PlanNew> code1 = template.selectOne(Query.query(Criteria.where("code").is(code)), PlanNew.class);
|
|
|
+ Mono<DomainSelectRes> domainSelectResMono1 = code1.flatMap(f -> template.select(Query.query(Criteria.where("group_type_id").is(f.groupId())
|
|
|
+ .and("status").is(1).and("type").is(type)), DomainSelect.class)
|
|
|
+ .switchIfEmpty(Mono.error(new BaseException("查询domain为空")))
|
|
|
+ .onErrorResume(throwable -> Mono.error(new Exception(throwable.getMessage()))).collectList().flatMap(fm -> {
|
|
|
+ DomainSelectRes domainSelectRes = new DomainSelectRes();
|
|
|
+ int i = RandomUtil.randomInt(0, fm.size());
|
|
|
+ String domain = fm.get(i).domain();
|
|
|
+ String string = RandomUtil.randomString("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", 6);
|
|
|
+ domainSelectRes.setDomain(string+"."+domain);
|
|
|
+ domainSelectRes.setPath("");
|
|
|
+ domainSelectRes.setUnique(IdUtil.fastSimpleUUID());
|
|
|
+ return Mono.just(domainSelectRes);
|
|
|
+ }));
|
|
|
+ return RStatus.success(domainSelectResMono1);
|
|
|
+ }else if(2==typePlan){
|
|
|
+ Mono<ListeningPlanNew> code1 = template.selectOne(Query.query(Criteria.where("code").is(code)), ListeningPlanNew.class);
|
|
|
+ Mono<DomainSelectRes> domainSelectResMono1 = code1.flatMap(f -> template.select(Query.query(Criteria.where("group_type_id").is(f.groupId())
|
|
|
+ .and("status").is(1).and("type").is(type)), DomainSelect.class)
|
|
|
+ .switchIfEmpty(Mono.error(new BaseException("查询domain为空")))
|
|
|
+ .onErrorResume(throwable -> Mono.error(new Exception(throwable.getMessage()))).collectList().flatMap(fm -> {
|
|
|
+ DomainSelectRes domainSelectRes = new DomainSelectRes();
|
|
|
+ int i = RandomUtil.randomInt(0, fm.size());
|
|
|
+ String domain = fm.get(i).domain();
|
|
|
+ String string = RandomUtil.randomString("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", 6);
|
|
|
+ domainSelectRes.setDomain(string+"."+domain);
|
|
|
+ domainSelectRes.setPath("");
|
|
|
+ domainSelectRes.setUnique(IdUtil.fastSimpleUUID());
|
|
|
+ return Mono.just(domainSelectRes);
|
|
|
+ }));
|
|
|
+ return RStatus.success(domainSelectResMono1);
|
|
|
+ }
|
|
|
+ throw new BaseException("typePlan 类型错误");
|
|
|
+
|
|
|
}
|
|
|
/**
|
|
|
* 列表返回images(列表内容),shareQrurl(背景组) ,baiduDot,retAudio
|