From 92dd97a119e2c083cb6e1e15eeb2b931e6bd5542 Mon Sep 17 00:00:00 2001 From: DyCTaTOR <125912249+DyCTaTOR@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:51:34 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BD=D0=B0=D1=8F=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .hintrc | 5 + data.mv.db | Bin 1892352 -> 1978368 bytes .../directions/api/DirectionsController.java | 4 + .../entrysData/api/EntrysDataController.java | 123 +++++++++++------- .../example/demo/news/api/NewsController.java | 5 + src/main/resources/templates/default.html | 4 +- .../resources/templates/direction-edit.html | 2 +- src/main/resources/templates/directions.html | 5 +- src/main/resources/templates/news.html | 6 +- src/main/resources/templates/user-edit.html | 50 +++++++ 10 files changed, 155 insertions(+), 49 deletions(-) create mode 100644 .hintrc diff --git a/.hintrc b/.hintrc new file mode 100644 index 0000000..aa8de6b --- /dev/null +++ b/.hintrc @@ -0,0 +1,5 @@ +{ + "extends": [ + "development" + ] +} \ No newline at end of file diff --git a/data.mv.db b/data.mv.db index 0ad20824f75105347f871dffbfd3264e20cb697c..5f6b52311ec1b6deebd5e097b39ea795aa76abec 100644 GIT binary patch delta 50721 zcmeHw3z!^LwQlvh=l$rOneLvR%uIOYF(h5DuIhn9W}+gA2mvKvfH2inT>&A<UVGGyQwd5 zQ(y3=zR*p5;ivl|v7A+~2CgV=fM$(a>q=V&)q(Za)q`^0%)yh!6y4 zm*62=daf|A^|JNQW?9c^Ma8rRK2+Mg<+6<%py}4YhSJqr2j!wXuyvz7D66i$bK?GY z#p@+0@~ilZ6593M&h7OjH3kP?0tYW|dVeTbiZGj_C|sx#7w!C1-f+YIfK1j(-Q?`1r=Die5t7 zcE&pz9eCI4u{PRvZ&!Z6R@m7}>}*91pUo)cOyO+0As5l6@pPgq?+Pby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%$hi!f)Z~QD(9Zs(B|Prjzw=M5A#PiGo}} zS=z2hSXL>I@83AZ@S%!?o{HlJIKHYiR+EonLxadJB`+T$c$AP zEzztH!H2Z_1QDM8jL{C^5r;qej1=8C;@~WcIF2|Vzcot@XNvx6)ZZ%@Vo)|S&W0Y{ zWW`E2t1@g`+|yQbb^N_e-rA~5MOojHF{9h};Ngd8XLN(E{q!_DtbN<YyugDJZ_nA}L>T)<_hj{hV?A&A{DCh|&3maH0*?B^aoF;7vR^&*bh;ey zMb00*+DFZVJycQ#|9vS1<{e3&r9OFI>IttV;l6Lw#(H}Sv;BGwis3o3N6U(l7tI{h zdntD~pl;~SG`+5KhlA#EjQJOaPI4S${_(Kk)A*duCv+OjTQr!sdhvHUi2V3s+XPb2 z-|Q1QSSJazkbMQ(can#h|W`u6A+!dbbu3`dkre?d_pBB1@HA5P`6-f2Ui599bAhX z+pJ1XsAF)=6?NtoO{73>{a6tB#L5v}M(g6{EI-(pX12eDh#tsz;l`?eLR> znN#tj>%k*V`8LFSTMLv^KRQslzvw!LQUj+mm$_Ym$6e}`XEKdoF22yMgAeWGU2r1! zx`#X(_~w%8obwsR@BJQObutO3$o;Dgko#}eKt2^gt{qvk5Nm^6E;>No9KX{_2LA_Y CC3+eF diff --git a/src/main/java/com/example/demo/directions/api/DirectionsController.java b/src/main/java/com/example/demo/directions/api/DirectionsController.java index 3bcc38b..390f0ac 100644 --- a/src/main/java/com/example/demo/directions/api/DirectionsController.java +++ b/src/main/java/com/example/demo/directions/api/DirectionsController.java @@ -67,8 +67,12 @@ public class DirectionsController { @GetMapping public String getAllWithDepartment( @RequestParam(name=PAGE_ATTRIBUTE, defaultValue = "0") int page, + @RequestParam(name="reset", required = false, defaultValue = "false") String reset, Model model, String name) { + if (reset.contains("true")){ + name = ""; + } final Map attributes = PageAttributesMapper. toAttributes(directionsService.getAllWithDepartment(page, Constants.DEFAULT_PAGE_SIZE, name), this::toGroupedDto); model.addAllAttributes(attributes); diff --git a/src/main/java/com/example/demo/entrysData/api/EntrysDataController.java b/src/main/java/com/example/demo/entrysData/api/EntrysDataController.java index b43ef63..c6dffb6 100644 --- a/src/main/java/com/example/demo/entrysData/api/EntrysDataController.java +++ b/src/main/java/com/example/demo/entrysData/api/EntrysDataController.java @@ -4,22 +4,23 @@ import java.util.List; import java.util.Map; import org.modelmapper.ModelMapper; +import org.modelmapper.TypeToken; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.example.demo.core.api.PageAttributesMapper; import com.example.demo.core.configuration.Constants; +import com.example.demo.department.api.DepartmentDto; import com.example.demo.department.service.DepartmentService; import com.example.demo.entrysData.model.EntrysDataEntity; -import com.example.demo.entrysData.model.EntrysDataGrouped; import com.example.demo.entrysData.model.EntrysDataGroupedDepartment; import com.example.demo.entrysData.service.EntrysDataService; @@ -31,6 +32,8 @@ public class EntrysDataController { public static final String URL = "/users"; private static final String USERS_VIEW = "users"; private static final String USERS_EDIT_VIEW = "user-edit"; + private static final String DEPARTMENTS_ATTRIBUTE = "departments"; + private static final String DEPARTMENT_ITEM_ATTRIBUTE = "departmentItem"; private static final String USERS_ATTRIBUTE = "users"; private static final String PAGE_ATTRIBUTE = "page"; private final EntrysDataService entrysDataService; @@ -44,14 +47,10 @@ public class EntrysDataController { this.departmentService = departmentService; } - private EntrysDataDto toDto(EntrysDataEntity entity) { + private EntrysDataDto toDto(EntrysDataEntity entity){ return modelMapper.map(entity, EntrysDataDto.class); } - private EntrysDataGroupedDto toDto(EntrysDataGrouped entity) { - return modelMapper.map(entity, EntrysDataGroupedDto.class); - } - private EntrysDataGroupedDepartmentDto toDto(EntrysDataGroupedDepartment entity){ return modelMapper.map(entity, EntrysDataGroupedDepartmentDto.class); } @@ -62,17 +61,16 @@ public class EntrysDataController { return entity; } - // @GetMapping - // public PageDto getAll( - // @RequestParam(name = "departmentId", defaultValue = "0") Long departmentId, - // @RequestParam(name = "page", defaultValue = "0") int page, - // @RequestParam(name = "size", defaultValue = Constants.DEFAULT_PAGE_SIZE) int size) { - // return PageDtoMapper.toDto(entrysDataService.getAll(departmentId, page, size), this::toDto); - // } + private List getDepartments(){ + return modelMapper.map(departmentService.getAll(), new TypeToken>(){}.getType()); + } + + private DepartmentDto getDepartment(Long id){ + return modelMapper.map(departmentService.get(id), new TypeToken(){}.getType()); + } @GetMapping public String getAll( - @RequestParam(name = "departmentId", defaultValue = "0") Long departmentId, @RequestParam(name = PAGE_ATTRIBUTE, defaultValue = "0") int page, Model model){ final Map attributes = PageAttributesMapper. @@ -83,35 +81,72 @@ public class EntrysDataController { return USERS_VIEW; } - @GetMapping("/{id}") - public EntrysDataDto get(@PathVariable(name = "id") Long id) { - return toDto(entrysDataService.get(id)); + @GetMapping("/edit/") + public String create(Model model, + @RequestParam(name = PAGE_ATTRIBUTE, defaultValue = "0") int page) { + model.addAttribute(USERS_ATTRIBUTE, new EntrysDataDto()); + model.addAttribute(DEPARTMENTS_ATTRIBUTE, getDepartments()); + model.addAttribute(PAGE_ATTRIBUTE, page); + return USERS_EDIT_VIEW; } - @PostMapping - public EntrysDataDto create(@RequestBody @Valid EntrysDataDto dto) { - return toDto(entrysDataService.create(toEntity(dto))); + @PostMapping("/edit/") + public String create( + @ModelAttribute(name = USERS_ATTRIBUTE) @Valid EntrysDataDto dto, + @RequestParam(name = PAGE_ATTRIBUTE, defaultValue = "0") int page, + BindingResult bindingResult, + Model model, + RedirectAttributes redirectAttributes){ + if (bindingResult.hasErrors()) { + model.addAttribute(PAGE_ATTRIBUTE, page); + return USERS_EDIT_VIEW; + } + redirectAttributes.addAttribute(PAGE_ATTRIBUTE, page); + entrysDataService.create(toEntity(dto)); + return Constants.REDIRECT_VIEW + URL; + } + + @GetMapping("/edit/{id}") + public String update( + @PathVariable(name = "id") Long id, + @RequestParam(name = PAGE_ATTRIBUTE, defaultValue = "0") int page, + Model model) { + if (id <= 0) { + throw new IllegalArgumentException(); + } + EntrysDataEntity entity = entrysDataService.get(id); + model.addAttribute(USERS_ATTRIBUTE, toDto(entity)); + model.addAttribute(DEPARTMENTS_ATTRIBUTE, getDepartments()); + model.addAttribute(PAGE_ATTRIBUTE, page); + return USERS_EDIT_VIEW; + } + + @PostMapping("/edit/{id}") + public String update( + @PathVariable(name = "id") Long id, + @RequestParam(name = PAGE_ATTRIBUTE, defaultValue = "0") int page, + @ModelAttribute(name = USERS_ATTRIBUTE) @Valid EntrysDataDto dto, + BindingResult bindingResult, + Model model, + RedirectAttributes redirectAttributes) { + if (bindingResult.hasErrors()) { + return USERS_EDIT_VIEW; + } + if (id <= 0) { + throw new IllegalArgumentException(); + } + redirectAttributes.addAttribute(PAGE_ATTRIBUTE, page); + entrysDataService.update(id, toEntity(dto)); + return Constants.REDIRECT_VIEW + URL; } - @PutMapping("/{id}") - public EntrysDataDto update(@PathVariable(name = "id") Long id, @RequestBody EntrysDataDto dto) { - return toDto(entrysDataService.update(id, toEntity(dto))); - } - - @DeleteMapping("/{id}") - public EntrysDataDto delete(@PathVariable(name = "id") Long id) { - return toDto(entrysDataService.delete(id)); - } - - @PutMapping("/{id}/password") - public EntrysDataDto updatePassword(@PathVariable(name = "id") Long id, - @RequestParam(name = "newPassword") String newPas, - @RequestParam(name = "oldPassword") String oldPas) { - return toDto(entrysDataService.updatePassword(id, newPas, oldPas)); - } - - @GetMapping("/count") - public List getCount() { - return entrysDataService.getCount().stream().map(this::toDto).toList(); - } + @PostMapping("/delete/{id}") + public String delete( + @PathVariable(name = "id") Long id, + @RequestParam(name = PAGE_ATTRIBUTE, defaultValue = "0") int page, + RedirectAttributes redirectAttributes) { + redirectAttributes.addAttribute(PAGE_ATTRIBUTE, page); + entrysDataService.delete(id); + return Constants.REDIRECT_VIEW + URL; +} } diff --git a/src/main/java/com/example/demo/news/api/NewsController.java b/src/main/java/com/example/demo/news/api/NewsController.java index c1aa97d..00c7d7c 100644 --- a/src/main/java/com/example/demo/news/api/NewsController.java +++ b/src/main/java/com/example/demo/news/api/NewsController.java @@ -68,7 +68,12 @@ public class NewsController { @RequestParam(name=PAGE_ATTRIBUTE, defaultValue = "0") int page, @RequestParam(name="departmentId", required = false) Long departmentId, @RequestParam(name=DESCRIPTION_ATTRIBUTE, required = false) String description, + @RequestParam(name="reset", required = false, defaultValue = "false") String reset, Model model) { + if (reset.contains("true")){ + description = ""; + departmentId = null; + } final Map attributes = PageAttributesMapper. toAttributes(newsService.getAll(page, Constants.DEFAULT_PAGE_SIZE_FOR_NEWS, departmentId, description), this::toDto); model.addAllAttributes(attributes); diff --git a/src/main/resources/templates/default.html b/src/main/resources/templates/default.html index b5e472c..e811db7 100644 --- a/src/main/resources/templates/default.html +++ b/src/main/resources/templates/default.html @@ -16,7 +16,7 @@