package com.cmvr.ti.service.ex;

import cn.hutool.core.text.StrPool;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.cmvr.test.service.ex.ExTiVehicleFunctionService;
import com.cmvr.ti.model.domain.TiVehicleFunction;
import com.cmvr.ti.service.ITiVehicleFunctionService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class ExTiVehicleFunctionServiceImpl implements ExTiVehicleFunctionService {

    private final ITiVehicleFunctionService tiVehicleFunctionService;

    @Override
    public JSONArray queryByIds(String ids) {
        List<TiVehicleFunction> tiVehicleFunctions = tiVehicleFunctionService.listByIds(StrUtil.split(StrPool.COMMA, ids));
        return JSONArray.from(tiVehicleFunctions);
    }

    @Override
    public JSONObject queryById(Long id) {
        return JSONObject.from(tiVehicleFunctionService.getById(id));
    }


}
