成分中的Ingredient()无法应用于:
预期:实际 参数:参数:“ FLTO”,“面粉玉米饼”,Ingredient.Type.WRAP
包括所有必需的进口商品
这里的成分类:
package com.taco.cloud.other;
import lombok.Data;
import lombok.RequiredArgsConstructor;
@Data
@RequiredArgsConstructor
public class Ingredient {
private final String id;
private final String name;
private final Type type;
public Ingredient() {
name = null;
id = null;
type = null;
}
public static enum Type{
WRAP, PROTEIN, VEGGIES, CHEESE, SAUCE}
}
这里是DesingTacoController类:
package com.taco.cloud.controllers;
import com.taco.cloud.other.Ingredient;
import java.util.Arrays;
import java.util.List;
import com.taco.cloud.other.Ingredient.Type;
@Slf4j
@Controller
@RequestMapping("/desing")
public class DesignTacoController {
@GetMapping
public String showDesignForm(Model model){
List<Ingredient> ingredients = Arrays.asList(
new Ingredient("FLTO", "Flour Tortilla", Ingredient.Type.WRAP),
...
答案 0 :(得分:0)
该错误是由于Ingredient类没有getter&setters和构造方法而导致的。问题与龙目岛有关。