package com.jwipc.supplier.controller.pc;

import com.jwipc.supplier.dto.RelationBidDTO;
import com.jwipc.supplier.logic.SupRelationBidLogic;
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;
@Controller
@RequestMapping(MODULE_ROOT + "/supRelation")
@RequiredArgsConstructor
public class SupplierBidRelationPageController {

    private final SupRelationBidLogic supRelationBidLogic;
    @GetMapping("/index")
    public String index() {
        return MODULE_ROOT + "/supplierRelationBid/list";
    }
    @GetMapping("/detail")
    public String detail(Model model, Long id) {
        RelationBidDTO relationBidDTO;
        relationBidDTO = supRelationBidLogic.getById(id);
        model.addAttribute("relationBidDTO", relationBidDTO);
        return MODULE_ROOT + "/supplierRelationBid/detail";
    }
    @GetMapping("userPurchaseOrgAdd")
    public String userPurchaseGroupAdd(Model model, Long userId) {
        model.addAttribute("userId", userId);
        return MODULE_ROOT + "/purchaseOrg/user_purchase_org_add";
    }
}
