linyanbin666 commented on a change in pull request #7026:
URL: https://github.com/apache/dolphinscheduler/pull/7026#discussion_r775111480



##########
File path: 
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java
##########
@@ -443,4 +447,62 @@ private String getHiddenPassword() {
         return result;
     }
 
+    /**
+     * query datasource list created by user
+     *
+     * @param userId user id
+     * @return datasource list
+     */
+    @Override
+    public List<DataSource> queryCreatedByUser(int userId) {
+        return 
dataSourceMapper.selectList(Wrappers.<DataSource>lambdaQuery().eq(DataSource::getUserId,
 userId));
+    }
+
+    /**
+     * transfer datasource list owned by the user
+     *
+     * @param transferredUserId transferred user id
+     * @param receivedUserId received user id
+     * @param transferredIds transferred ids
+     * @return transfer result code
+     */
+    @Override
+    public Map<String, Object> transferOwnedData(int transferredUserId, int 
receivedUserId, List<Integer> transferredIds) {
+        Map<String, Object> result = new HashMap<>();
+
+        List<DataSource> dataSources = 
dataSourceMapper.selectList(Wrappers.<DataSource>lambdaQuery()
+                .eq(DataSource::getUserId, transferredUserId)
+                .in(DataSource::getId, transferredIds)
+        );
+        Set<Integer> realDataSourceIds = 
dataSources.stream().map(DataSource::getId).collect(Collectors.toSet());
+        // update datasource owner
+        int updatedDatasourceNum = dataSourceMapper.update(null, 
Wrappers.<DataSource>lambdaUpdate()

Review comment:
       Yes, it has been modified.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to