zhibing.pu
2024-08-24 cc788c86acd2983d791fbd3e50a9b30335b91953
ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/mongodb/service/impl/BmsDemandAndChargerExportationServiceImpl.java
New file
@@ -0,0 +1,31 @@
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<BmsDemandAndChargerExportation> findAll() {
        return mongoTemplate.findAll(BmsDemandAndChargerExportation.class);
    }
}