|
|
@@ -223,14 +223,13 @@ public class PlanNewCommonController {
|
|
|
*/
|
|
|
@GetMapping("getPlanInfo/{type}/{planId}")
|
|
|
public Mono<RStatus<PlanNewCommon>> planNewInfo(@PathVariable("type") @NotNull Integer type, @PathVariable("planId") @NotNull String planId) {
|
|
|
- if (type == 3) {
|
|
|
+
|
|
|
// 交友计划
|
|
|
Mono<PlanNewCommon> planNewCommonMono = template.selectOne(Query.query(Criteria.where("id").is(planId)), PlanNewCommon.class)
|
|
|
.switchIfEmpty(Mono.error(new BaseException("计划id异常")))
|
|
|
.onErrorResume(throwable -> Mono.error(new Exception("计划id异常")));
|
|
|
return RStatus.success(planNewCommonMono);
|
|
|
- }
|
|
|
- throw new BaseException("type类型错误");
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -242,7 +241,7 @@ public class PlanNewCommonController {
|
|
|
*/
|
|
|
@GetMapping("copyById/{type}/{planId}")
|
|
|
public Mono<RStatus<String>> copyById(@PathVariable("type") @NotNull Integer type, @PathVariable("planId") @NotNull String planId) {
|
|
|
- if (type == 3) {
|
|
|
+
|
|
|
// 交友计划
|
|
|
String userName = BaseContextHandler.getUserName();
|
|
|
String userId = BaseContextHandler.getUserId();
|
|
|
@@ -303,8 +302,7 @@ public class PlanNewCommonController {
|
|
|
}
|
|
|
});
|
|
|
return RStatus.success(stringMono);
|
|
|
- }
|
|
|
- throw new BaseException("type类型错误");
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -316,7 +314,7 @@ public class PlanNewCommonController {
|
|
|
*/
|
|
|
@DeleteMapping("deleteById/{type}/{planId}")
|
|
|
public Mono<RStatus<Long>> deleteById(@PathVariable("type") @NotNull Integer type, @PathVariable("planId") @NotNull String planId) {
|
|
|
- if (type == 3) {
|
|
|
+
|
|
|
// 交友计划
|
|
|
Query plan = Query.query(Criteria.where("id").is(planId));
|
|
|
Mono<Long> planNewCommon = template.delete(plan, PlanNewCommon.class)
|
|
|
@@ -328,7 +326,6 @@ public class PlanNewCommonController {
|
|
|
.switchIfEmpty(Mono.just(0L));
|
|
|
Mono<Long> longMono = Mono.zip(poster, planNewCommon).flatMap(f -> Mono.just(f.getT1()));
|
|
|
return RStatus.success(longMono);
|
|
|
- }
|
|
|
- throw new BaseException("type类型错误");
|
|
|
+
|
|
|
}
|
|
|
}
|