package com.jwipc.supplier.controller.pc;

import com.jwipc.supplier.dto.SupplierBaseDTO;
import com.jwipc.supplier.logic.SupplierLogic;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import static com.jwipc.supplier.constant.ModuleConst.MODULE_ROOT;

/**
 * <p> </p>
 *
 * @author ZhangJie
 * @version 1.0
 * @since JDK 1.8
 */
@Controller
@RequestMapping(MODULE_ROOT + "/sqescore/page")
@RequiredArgsConstructor
public class SupplierSqeScorePageController {
    private final SupplierLogic supplierLogic;

    @GetMapping("index")
    public String index(Long supplierId, Model model) {
        model.addAttribute("supplierId", supplierId);
        SupplierBaseDTO supplierBaseDTO = supplierLogic.getById(supplierId);
        model.addAttribute("supplierGenre", supplierBaseDTO.getSupplierGenre());
        return MODULE_ROOT + "/sqescore/index";
    }


}
