package com.jwipc.sys.controller.pc;

import com.jwipc.sys.dto.SapLogInfoDTO;
import com.jwipc.sys.logic.SapLogLogic;
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.sys.constant.ModuleConst.MODULE_ROOT;

/**
 * <p>
 * sap日志 前端控制器
 * </p>
 *
 * @author shenyang.ou
 * @since 2024-01-29
 */
@Controller
@RequestMapping(MODULE_ROOT + "/sapLog")
@RequiredArgsConstructor
public class SapLogPageController {
    private final SapLogLogic sapLogLogic;

    @GetMapping("/index")
    public String index() {
        return MODULE_ROOT + "/log/sap/list";
    }

    @GetMapping("/look")
    public String look(Model model, String id) {
        SapLogInfoDTO dto = sapLogLogic.getById(id);
        model.addAttribute("data", dto);
        return MODULE_ROOT + "/log/sap/look";
    }

}
