package com.ruoyi.integration.mongodb.service.impl;
|
|
import com.ruoyi.integration.iotda.constant.IotConstant;
|
import com.ruoyi.integration.api.model.PlatformRemoteUpdate;
|
import com.ruoyi.integration.mongodb.service.PlatformRemoteUpdateService;
|
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 PlatformRemoteUpdateServiceImpl implements PlatformRemoteUpdateService {
|
@Autowired
|
private MongoTemplate mongoTemplate;
|
@Override
|
public int create(PlatformRemoteUpdate platformRemoteUpdate) {
|
mongoTemplate.save(platformRemoteUpdate);
|
return IotConstant.SUCCESS;
|
}
|
|
@Override
|
public PlatformRemoteUpdate findById(String id) {
|
return mongoTemplate.findById(id, PlatformRemoteUpdate.class);
|
}
|
|
@Override
|
public List<PlatformRemoteUpdate> findAll() {
|
return mongoTemplate.findAll(PlatformRemoteUpdate.class);
|
}
|
}
|