zhibing.pu
2024-08-24 cc788c86acd2983d791fbd3e50a9b30335b91953
ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/mongodb/service/impl/GroundLockRealTimeDataServiceImpl.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.GroundLockRealTimeData;
import com.ruoyi.integration.mongodb.service.GroundLockRealTimeDataService;
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 GroundLockRealTimeDataServiceImpl implements GroundLockRealTimeDataService {
    @Autowired
    private MongoTemplate mongoTemplate;
    @Override
    public int create(GroundLockRealTimeData groundLockRealTimeData) {
        mongoTemplate.save(groundLockRealTimeData);
        return IotConstant.SUCCESS;
    }
    @Override
    public GroundLockRealTimeData findById(String id) {
        return mongoTemplate.findById(id, GroundLockRealTimeData.class);
    }
    @Override
    public List<GroundLockRealTimeData> findAll() {
        return mongoTemplate.findAll(GroundLockRealTimeData.class);
    }
}