File tree 3 files changed +55
-4
lines changed
applications/rest-service/src/main
java/org/springframework/sbm
components/sbm-recipes-boot-upgrade/src/main/java/org/springframework/sbm/boot/upgrade_27_30/report/helper 3 files changed +55
-4
lines changed Original file line number Diff line number Diff line change 15
15
*/
16
16
package org .springframework .sbm ;
17
17
18
+ import lombok .Getter ;
19
+ import lombok .Setter ;
20
+ import lombok .Value ;
18
21
import org .springframework .beans .factory .annotation .Autowired ;
19
22
import org .springframework .http .MediaType ;
20
23
import org .springframework .sbm .boot .upgrade_27_30 .report .SpringBootUpgradeReportRenderer ;
@@ -58,10 +61,17 @@ public String applyRecipes(@RequestParam("recipeNames[]") String[] recipeNames)
58
61
59
62
@ PostMapping (path = "/spring-boot-upgrade" )
60
63
@ ResponseBody
61
- public void applyRecipes2 (@ RequestBody String recipeNames ) {
64
+ public void applyRecipes2 (@ RequestBody Recipe recipeNames ) {
62
65
ProjectContext context = contextHolder .getProjectContext ();
63
- List .of (recipeNames ).forEach (recipeName -> applyCommand .execute (context , recipeName ));
66
+ recipeNames .getRecipes ().forEach (
67
+ recipeName -> applyCommand .execute (context , recipeName )
68
+ );
64
69
applyCommand .execute (context , REPORT_RECIPE );
65
70
}
66
71
67
- }
72
+ @ Getter
73
+ @ Setter
74
+ static class Recipe {
75
+ private List <String > recipes ;
76
+ }
77
+ }
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ function applyRecipes(btn) {
72
72
url : "http://localhost:8080/spring-boot-upgrade" ,
73
73
contentType : 'application/json' ,
74
74
data : JSON . stringify ( {
75
- recipes : $ ( btn ) . attr ( 'recipe' )
75
+ recipes : [ $ ( btn ) . attr ( 'recipe' ) ]
76
76
} ) ,
77
77
beforeSend : function ( ) {
78
78
state . startedRunningRecipe ( ) ;
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2021 - 2022 the original author or authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ package org .springframework .sbm .boot .upgrade_27_30 .report .helper ;
18
+
19
+ import org .springframework .sbm .boot .upgrade_27_30 .report .SpringBootUpgradeReportSection ;
20
+ import org .springframework .sbm .engine .context .ProjectContext ;
21
+ import org .springframework .sbm .properties .api .PropertiesSource ;
22
+
23
+ import java .util .List ;
24
+ import java .util .Map ;
25
+
26
+ public class MissingHelper implements SpringBootUpgradeReportSection .Helper <String >{
27
+ @ Override
28
+ public String getDescription () {
29
+ return null ;
30
+ }
31
+
32
+ @ Override
33
+ public boolean evaluate (ProjectContext context ) {
34
+ return false ;
35
+ }
36
+
37
+ @ Override
38
+ public Map <String , String > getData () {
39
+ return null ;
40
+ }
41
+ }
You can’t perform that action at this time.
0 commit comments