package com.ruoyi.integration.mongodb.service.impl; import com.ruoyi.integration.iotda.constant.IotConstant; import com.ruoyi.integration.api.model.BmsDemandAndChargerExportation; import com.ruoyi.integration.mongodb.service.BmsDemandAndChargerExportationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.stereotype.Service; import java.util.List; @Service public class BmsDemandAndChargerExportationServiceImpl implements BmsDemandAndChargerExportationService { @Autowired private MongoTemplate mongoTemplate; @Override public int create(BmsDemandAndChargerExportation bmsDemandAndChargerExportation) { mongoTemplate.save(bmsDemandAndChargerExportation); return IotConstant.SUCCESS; } @Override public BmsDemandAndChargerExportation findById(String id) { return mongoTemplate.findById(id, BmsDemandAndChargerExportation.class); } @Override public List findAll() { return mongoTemplate.findAll(BmsDemandAndChargerExportation.class); } }