move upload files code to new package

This commit is contained in:
DOHA 2019-08-02 14:35:36 +03:00
parent 31d74aa6a4
commit 5fabe70b8a
7 changed files with 15 additions and 15 deletions

View File

@ -1,8 +1,8 @@
package com.baeldung.mongodb.daos;
package com.baeldung.mongodb.file.daos;
import org.springframework.data.mongodb.repository.MongoRepository;
import com.baeldung.mongodb.models.Photo;
import com.baeldung.mongodb.file.models.Photo;
public interface PhotoRepository extends MongoRepository<Photo, String> {

View File

@ -1,4 +1,4 @@
package com.baeldung.mongodb.models;
package com.baeldung.mongodb.file.models;
import org.bson.types.Binary;
import org.springframework.data.annotation.Id;

View File

@ -1,4 +1,4 @@
package com.baeldung.mongodb.services;
package com.baeldung.mongodb.file.services;
import java.io.IOException;
@ -8,8 +8,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import com.baeldung.mongodb.daos.PhotoRepository;
import com.baeldung.mongodb.models.Photo;
import com.baeldung.mongodb.file.daos.PhotoRepository;
import com.baeldung.mongodb.file.models.Photo;
@Service
public class PhotoService {

View File

@ -1,4 +1,4 @@
package com.baeldung.mongodb.services;
package com.baeldung.mongodb.file.services;
import java.io.IOException;
@ -11,7 +11,7 @@ import org.springframework.data.mongodb.gridfs.GridFsTemplate;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import com.baeldung.mongodb.models.Video;
import com.baeldung.mongodb.file.models.Video;
import com.mongodb.BasicDBObject;
import com.mongodb.DBObject;
import com.mongodb.client.gridfs.model.GridFSFile;

View File

@ -1,4 +1,4 @@
package com.baeldung.mongodb.web;
package com.baeldung.mongodb.file.web;
import java.io.IOException;
import java.util.Base64;
@ -12,8 +12,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import com.baeldung.mongodb.models.Photo;
import com.baeldung.mongodb.services.PhotoService;
import com.baeldung.mongodb.file.models.Photo;
import com.baeldung.mongodb.file.services.PhotoService;
@Controller
public class PhotoController {

View File

@ -1,4 +1,4 @@
package com.baeldung.mongodb.web;
package com.baeldung.mongodb.file.web;
import java.io.IOException;
@ -14,8 +14,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import com.baeldung.mongodb.models.Video;
import com.baeldung.mongodb.services.VideoService;
import com.baeldung.mongodb.file.models.Video;
import com.baeldung.mongodb.file.services.VideoService;
@Controller
public class VideoController {