package org.dromara.erp.controller;

import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.erp.domain.query.ErpModelKindQuery;
import org.dromara.erp.domain.vo.ErpModelKindVo;
import org.dromara.erp.service.IErpModelKindService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ERP 型号类别控制器
 *
 * @Author: Trae
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/erp/modelKind")
public class ErpModelKindController {

    private final IErpModelKindService erpModelKindService;

    /**
     * 查询型号类别列表（按父级ID分级）
     */
    @GetMapping("/list")
    public R<List<ErpModelKindVo>> list(ErpModelKindQuery query) {
        return R.ok(erpModelKindService.queryList(query));
    }

}
