package cn.pluss.platform.controller.device;

import cn.pluss.platform.base.BaseModelController;
import cn.pluss.platform.device.DeviceGoodTagService;
import cn.pluss.platform.entity.DeviceGoodTag;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/deviceGoodTag")
public class DeviceGoodTagController extends BaseModelController<DeviceGoodTagService, DeviceGoodTag> {

    @GetMapping("index")
    public String index() {
        return "device/tag/list";
    }

    @GetMapping({"detail/{id}", "detail"})
    public String detail(HttpServletRequest request, @PathVariable(value = "id", required = false) Integer id) {
        DeviceGoodTag entity = baseService.getById(id);
        request.setAttribute("entity", entity);
        return "device/tag/detail";
    }
}
