|
@@ -0,0 +1,46 @@
|
|
|
+package com.flow.service.impl;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.flow.common.core.model.PageResult;
|
|
|
+import com.flow.common.mybatis.service.impl.BaseServiceImpl;
|
|
|
+import com.flow.dao.ConnectorDao;
|
|
|
+import com.flow.entity.ConnectorEntity;
|
|
|
+import com.flow.model.ConnectorQuery;
|
|
|
+import com.flow.service.ConnectorService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+
|
|
|
+@Service
|
|
|
+public class ConnectorServiceImpl extends BaseServiceImpl<ConnectorDao, ConnectorEntity> implements ConnectorService {
|
|
|
+ @Autowired
|
|
|
+ private ConnectorDao connectorDao;
|
|
|
+
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ @Override
|
|
|
+ public ConnectorEntity create(ConnectorEntity connectorEntity) {
|
|
|
+ connectorDao.insert(connectorEntity);
|
|
|
+ return connectorEntity;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ @Override
|
|
|
+ public ConnectorEntity update(ConnectorEntity connectorEntity) {
|
|
|
+ connectorDao.updateById(connectorEntity);
|
|
|
+ return connectorEntity;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ConnectorEntity get(Long id) {
|
|
|
+ return connectorDao.selectById(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageResult<ConnectorEntity> query(ConnectorQuery connectorQuery) {
|
|
|
+ ConnectorEntity connectorEntity = connectorQuery.toEntity();
|
|
|
+ Page<ConnectorEntity> page = connectorDao.lambdaQueryChain()
|
|
|
+ .setEntity(connectorEntity)
|
|
|
+ .page(new Page<>(connectorQuery.getPage(), connectorQuery.getLimit()));
|
|
|
+ return new PageResult<>(page.getTotal(), page.getRecords());
|
|
|
+ }
|
|
|
+}
|