From 6a553a3330236faaec9198530aa6c6d8fced8f19 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Mon, 14 Mar 2022 12:20:41 +0400 Subject: [PATCH] #7 -- move news classes to different package --- data/db.mv.db | Bin 49152 -> 45056 bytes .../ru/ulstu/controller/IndexController.java | 2 +- .../java/ru/ulstu/meeting/MeetingService.java | 2 +- .../java/ru/ulstu/{model => news}/News.java | 3 ++- .../{controller => news}/NewsController.java | 4 +--- .../{repository => news}/NewsRepository.java | 3 +-- .../ulstu/{service => news}/NewsService.java | 5 ++--- 7 files changed, 8 insertions(+), 11 deletions(-) rename src/main/java/ru/ulstu/{model => news}/News.java (97%) rename src/main/java/ru/ulstu/{controller => news}/NewsController.java (97%) rename src/main/java/ru/ulstu/{repository => news}/NewsRepository.java (86%) rename src/main/java/ru/ulstu/{service => news}/NewsService.java (94%) diff --git a/data/db.mv.db b/data/db.mv.db index 1c534f284e2845a2346862a6ae7b9e030cd401ca..231f77aadfb0bba9dea517dc39380e13bf954380 100644 GIT binary patch delta 5372 zcmeHLTWl0n7@pZ~3%itFpme)iq&Ew#+3wEl&g{+(#4I8xO1UbxAmq%=Hf^^H-EGj2 zw9!Y6TKnzCgTyo;f?SbJlL5BE*;O%gouC z`Okm;|Np-8{bziu-cc;49I*;;U+q}8Wb*U z4C*nt59PHBoHX z?9dCuYMIdIGx-r+E2e_Xq0w__X4|7VkNIbQGu!h8Ny!H@4Ez0l#*42Nx4&zdm6FA8 zJhFvpVZb-h1`X3~jcyiF?k%zs!cM`3wsx2?gK)bo?z6l|C)6u=G27WG-PQ~AR+1MTu z5Q}_D15u-ZC?zy8W&=?Lf4W(oACZ^Y?owgWDvd)b`1V*R)EUZ#&}hl`xy zVb4L7-{h@bR2>&1Cp4bbQlob`v^FM>8>9+Etwt0%Sd1_aR^O3rV$Z^j z_I9{25t@@IFtz(!TE^So2938VasJd?jz*T2&vG7^-OB)KCkE+vX13GbDhJ5sQ^qee-U z9%=MQ6*$U@mJ-ODV`M@}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Alz`ANiD_@%?RN)bYwUPK|sPkoazvpW*pr_+iRFd%eQOKE5yD^2kYP zZc4NRyOz>@Nd5V!s{awgpdT?*+YZA#nqWC{FDF3ev5Uw5-8%wGLcbjW*+&hj-+Q`a d;LX4OKN$aq<8N;KZ*t>*8_t2(wXL52|Nq`&z*GPL diff --git a/src/main/java/ru/ulstu/controller/IndexController.java b/src/main/java/ru/ulstu/controller/IndexController.java index 9774e53..15eb735 100644 --- a/src/main/java/ru/ulstu/controller/IndexController.java +++ b/src/main/java/ru/ulstu/controller/IndexController.java @@ -9,7 +9,7 @@ package ru.ulstu.controller; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; -import ru.ulstu.service.NewsService; +import ru.ulstu.news.NewsService; @Controller public class IndexController { diff --git a/src/main/java/ru/ulstu/meeting/MeetingService.java b/src/main/java/ru/ulstu/meeting/MeetingService.java index fb92aef..904b54d 100644 --- a/src/main/java/ru/ulstu/meeting/MeetingService.java +++ b/src/main/java/ru/ulstu/meeting/MeetingService.java @@ -3,7 +3,7 @@ package ru.ulstu.meeting; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; -import ru.ulstu.service.NewsService; +import ru.ulstu.news.NewsService; import javax.validation.constraints.NotNull; diff --git a/src/main/java/ru/ulstu/model/News.java b/src/main/java/ru/ulstu/news/News.java similarity index 97% rename from src/main/java/ru/ulstu/model/News.java rename to src/main/java/ru/ulstu/news/News.java index f6ab364..002a79b 100644 --- a/src/main/java/ru/ulstu/model/News.java +++ b/src/main/java/ru/ulstu/news/News.java @@ -1,7 +1,8 @@ -package ru.ulstu.model; +package ru.ulstu.news; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.web.multipart.MultipartFile; +import ru.ulstu.model.BaseEntity; import javax.persistence.Entity; import javax.persistence.Lob; diff --git a/src/main/java/ru/ulstu/controller/NewsController.java b/src/main/java/ru/ulstu/news/NewsController.java similarity index 97% rename from src/main/java/ru/ulstu/controller/NewsController.java rename to src/main/java/ru/ulstu/news/NewsController.java index 139daa5..5d811b4 100644 --- a/src/main/java/ru/ulstu/controller/NewsController.java +++ b/src/main/java/ru/ulstu/news/NewsController.java @@ -4,7 +4,7 @@ * */ -package ru.ulstu.controller; +package ru.ulstu.news; import org.springframework.data.domain.Page; import org.springframework.security.access.annotation.Secured; @@ -17,10 +17,8 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -import ru.ulstu.model.News; import ru.ulstu.model.OffsetablePageRequest; import ru.ulstu.model.UserRoleConstants; -import ru.ulstu.service.NewsService; import javax.validation.Valid; import java.io.IOException; diff --git a/src/main/java/ru/ulstu/repository/NewsRepository.java b/src/main/java/ru/ulstu/news/NewsRepository.java similarity index 86% rename from src/main/java/ru/ulstu/repository/NewsRepository.java rename to src/main/java/ru/ulstu/news/NewsRepository.java index f7f4fcf..fcf5c7f 100644 --- a/src/main/java/ru/ulstu/repository/NewsRepository.java +++ b/src/main/java/ru/ulstu/news/NewsRepository.java @@ -1,9 +1,8 @@ -package ru.ulstu.repository; +package ru.ulstu.news; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; -import ru.ulstu.model.News; import java.util.List; diff --git a/src/main/java/ru/ulstu/service/NewsService.java b/src/main/java/ru/ulstu/news/NewsService.java similarity index 94% rename from src/main/java/ru/ulstu/service/NewsService.java rename to src/main/java/ru/ulstu/news/NewsService.java index feac00a..2c55c9c 100644 --- a/src/main/java/ru/ulstu/service/NewsService.java +++ b/src/main/java/ru/ulstu/news/NewsService.java @@ -1,10 +1,9 @@ -package ru.ulstu.service; +package ru.ulstu.news; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; -import ru.ulstu.model.News; -import ru.ulstu.repository.NewsRepository; +import ru.ulstu.service.FileUtil; import javax.validation.constraints.NotNull; import java.io.IOException;