package com.iailab.module.data.api.ind;
|
|
import com.iailab.framework.common.util.object.ConvertUtils;
|
import com.iailab.module.data.api.ind.dto.ApiIndItemDTO;
|
import com.iailab.module.data.api.ind.dto.ApiIndItemQueryDTO;
|
import com.iailab.module.data.api.ind.dto.ApiIndItemValueDTO;
|
import com.iailab.module.data.ind.collection.IndItemCollector;
|
import com.iailab.module.data.ind.item.service.IndItemService;
|
import com.iailab.module.data.ind.item.vo.IndItemValueVO;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.validation.annotation.Validated;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import java.util.List;
|
|
/**
|
* @author PanZhibao
|
* @Description
|
* @createTime 2024年10月04日
|
*/
|
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
@Validated
|
public class IndItemApiImpl implements IndItemApi {
|
|
@Autowired
|
private IndItemCollector indItemCollector;
|
|
@Autowired
|
private IndItemService indItemService;
|
|
@Override
|
public List<ApiIndItemValueDTO> queryIndItemDefaultValue(String itemNo){
|
List<IndItemValueVO> list = indItemCollector.queryValue(itemNo);
|
return ConvertUtils.sourceToTarget(list, ApiIndItemValueDTO.class);
|
}
|
|
@Override
|
public List<ApiIndItemValueDTO> queryIndItemHistoryValue(ApiIndItemQueryDTO dto) {
|
List<IndItemValueVO> list = indItemCollector.queryValue(dto.getItemNo(), dto.getStart(), dto.getEnd());
|
return ConvertUtils.sourceToTarget(list, ApiIndItemValueDTO.class);
|
}
|
|
@Override
|
public ApiIndItemDTO getInfoById(String id) {
|
return ConvertUtils.sourceToTarget(indItemService.get(id), ApiIndItemDTO.class);
|
}
|
}
|