티스토리 뷰
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | package texas.sbq.travel.controllers; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.function.Consumer; import java.util.function.Function; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; 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.RestController; import org.springframework.web.multipart.MultipartFile; import texas.sbq.travel.domains.Article; import texas.sbq.travel.domains.Pager; import texas.sbq.travel.enums.Messenger; import texas.sbq.travel.services.ArticleService; import texas.sbq.travel.utils.Box; import texas.sbq.travel.utils.Crawler; import texas.sbq.travel.utils.Filer; import texas.sbq.travel.utils.Proxy; @RestController @RequestMapping("/articles") public class ArticleController extends Proxy { @Autowired ArticleService articleService; @Autowired Article article; @Autowired Crawler crawler; @Autowired Pager pager; @Autowired Filer filemgr; @Autowired Article board; @Autowired Box<Object> trunk; @PostMapping("/{category}") public Messenger post(@RequestBody Article article) { articleService.save(article); return Messenger.SUCCESS; } @GetMapping("/{group}/{id}") public Messenger get(@PathVariable("group") String category, @PathVariable("id") String articleSeq) { article.setCategory(category); article.setArticleSeq(articleSeq); articleService.detail(article); return Messenger.SUCCESS; } @GetMapping("/{group}/{pageSize}/{nowPage}/{option}/{search}") public List<Article> get(@PathVariable("pageSize") String pageSize, @PathVariable("nowPage") String nowPage, @PathVariable("option") String option, @PathVariable("search") String search, @PathVariable("group") String category) { pager.setCtype(category); articleService.count(null); pager.setRowCount(0); pager.setPageSize(Integer.parseInt(pageSize)); pager.setBlockSize(5); pager.setNowPage(integer(nowPage)); pager.setOption(option); pager.setSearch(search); pager.paging(); List<Article> list = null; return list; } @PutMapping("/") public Messenger put(@RequestBody Article article) { articleService.edit(article); return Messenger.SUCCESS; } @DeleteMapping("/{id}") public Messenger delete(@PathVariable String id) { articleService.remove(id); return Messenger.SUCCESS; } } | cs |
'0. 정보통신' 카테고리의 다른 글
[스프링부트] AWS CORS 이슈 ... 리액트 부분과 Controller #35 (0) | 2020.06.18 |
---|---|
82537 트래블 ArticleService.java (0) | 2020.06.02 |
81540. 마이바티스 템플릿 (0) | 2020.05.29 |
82540. 인텔리제이 스프링부트(spring boot) + 마이바티스(mybatis) + 하이버네이트(JPA) 최소 설정파일들 (0) | 2020.05.27 |
Mybatis 로 Spring-Boot 와 H2DB 를 연동하기 (0) | 2020.05.24 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- docker
- Python
- SpringBoot
- Oracle
- SQLAlchemy
- COLAB
- maven
- database
- mariadb
- intellij
- Mlearn
- springMVC
- terms
- Mongo
- vscode
- Algorithm
- ERD
- FLASK
- tensorflow
- nodejs
- Django
- KAFKA
- Java
- Git
- AWS
- React
- JUnit
- JPA
- jQuery
- Eclipse
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
글 보관함