diff --git a/luoo_music/src/main/java/com/luoo/music/controller/ArticleController.java b/luoo_music/src/main/java/com/luoo/music/controller/ArticleController.java deleted file mode 100644 index d315454..0000000 --- a/luoo_music/src/main/java/com/luoo/music/controller/ArticleController.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.luoo.music.controller; -import java.util.List; -import java.util.Map; - -import com.luoo.music.client.UserClient; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.web.bind.annotation.*; -import com.luoo.music.pojo.Article; -import com.luoo.music.service.ArticleService; - -import api.PageResult; -import api.Result; - -/** - * 控制器层 - * @author Administrator - * - */ -@RestController -@CrossOrigin -@RequestMapping("/article") -public class ArticleController { - - @Autowired - private ArticleService articleService; - - @Autowired - private UserClient userClient; - - @GetMapping("/admin") - public Result findAdmin(){ - return userClient.findAll(); - } - - @PutMapping("/examine/{articleId}") - public Result examine (@PathVariable String articleId){ - - articleService.updateState(articleId); - return Result.success(); - } - - @PutMapping("/thumbup/{articleId}") - public Result thumbup (@PathVariable String articleId){ - - articleService.addThumbup(articleId); - return Result.success(); - } - - /** - * 查询全部数据 - * @return - */ - @GetMapping - public Result> findAll(){ - return Result.success(articleService.findAll()); - } - - /** - * 根据ID查询 - * @param id ID - * @return - */ - @GetMapping("/{id}") - public Result
findById(@PathVariable String id){ - return Result.success(articleService.findById(id)); - } - - @GetMapping("/findByVolid/{volid}") - public Result
findByVolid(@PathVariable String volid){ - return Result.success(articleService.findByVolid(volid)); - } - - - /** - * 分页+多条件查询 - * @param searchMap 查询条件封装 - * @param page 页码 - * @param size 页大小 - * @return 分页结果 - */ - @PostMapping("/search/{page}/{size}") - public Result> findSearch(@RequestBody Map searchMap , @PathVariable int page, @PathVariable int size){ - Page
pageList = articleService.findSearch(searchMap, page, size); - return Result.success(new PageResult
(pageList.getTotalElements(), pageList.getContent()) ); - } - - /** - * 根据条件查询 - * @param searchMap - * @return - */ - @PostMapping("/search") - public Result> findSearch( @RequestBody Map searchMap){ - return Result.success(articleService.findSearch(searchMap)); - } - - /** - * 增加 - * @param article - */ - @PostMapping - public Result add(@RequestBody Article article ){ - articleService.add(article); - return Result.success(); - } - - /** - * 修改 - * @param article - */ - @PutMapping("/{id}") - public Result update(@RequestBody Article article, @PathVariable String id ){ - article.setId(id); - articleService.update(article); - return Result.success(); - } - - /** - * 删除 - * @param id - */ - @DeleteMapping("/{id}") - public Result delete(@PathVariable String id ){ - articleService.deleteById(id); - return Result.success(); - } - -} diff --git a/luoo_music/src/main/java/com/luoo/music/controller/ChannelController.java b/luoo_music/src/main/java/com/luoo/music/controller/ChannelController.java deleted file mode 100644 index 1483bea..0000000 --- a/luoo_music/src/main/java/com/luoo/music/controller/ChannelController.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.luoo.music.controller; -import java.util.List; -import java.util.Map; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.web.bind.annotation.*; - -import com.luoo.music.pojo.Channel; -import com.luoo.music.service.ChannelService; - -import api.PageResult; -import api.Result; - -/** - * 控制器层 - * @author Administrator - * - */ -@RestController -@CrossOrigin -@RequestMapping("/channel") -public class ChannelController { - - @Autowired - private ChannelService channelService; - - - /** - * 查询全部数据 - * @return - */ - @GetMapping - public Result> findAll(){ - return Result.success(channelService.findAll()); - } - - /** - * 根据ID查询 - * @param id ID - * @return - */ - @GetMapping("/{id}") - public Result findById(@PathVariable String id){ - return Result.success(channelService.findById(id)); - } - - - /** - * 分页+多条件查询 - * @param searchMap 查询条件封装 - * @param page 页码 - * @param size 页大小 - * @return 分页结果 - */ - @PostMapping("/search/{page}/{size}") - public Result> findSearch(@RequestBody Map searchMap , @PathVariable int page, @PathVariable int size){ - Page pageList = channelService.findSearch(searchMap, page, size); - return Result.success(new PageResult(pageList.getTotalElements(), pageList.getContent()) ); - } - - /** - * 根据条件查询 - * @param searchMap - * @return - */ - @PostMapping("/search") - public Result> findSearch( @RequestBody Map searchMap){ - return Result.success(channelService.findSearch(searchMap)); - } - - /** - * 增加 - * @param channel - */ - @PostMapping - public Result add(@RequestBody Channel channel ){ - channelService.add(channel); - return Result.success(); - } - - /** - * 修改 - * @param channel - */ - @PutMapping("/{id}") - public Result update(@RequestBody Channel channel, @PathVariable String id ){ - channel.setId(id); - channelService.update(channel); - return Result.success(); - } - - /** - * 删除 - * @param id - */ - @DeleteMapping("/{id}") - public Result delete(@PathVariable String id ){ - channelService.deleteById(id); - return Result.success(); - } - -} diff --git a/luoo_music/src/main/java/com/luoo/music/controller/ColumnController.java b/luoo_music/src/main/java/com/luoo/music/controller/ColumnController.java deleted file mode 100644 index 625fdea..0000000 --- a/luoo_music/src/main/java/com/luoo/music/controller/ColumnController.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.luoo.music.controller; -import java.util.List; -import java.util.Map; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.web.bind.annotation.*; - -import com.luoo.music.pojo.Column; -import com.luoo.music.service.ColumnService; - -import api.PageResult; -import api.Result; - -/** - * 控制器层 - * @author Administrator - * - */ -@RestController -@CrossOrigin -@RequestMapping("/column") -public class ColumnController { - - @Autowired - private ColumnService columnService; - - - /** - * 查询全部数据 - * @return - */ - @GetMapping - public Result> findAll(){ - return Result.success(columnService.findAll()); - } - - /** - * 根据ID查询 - * @param id ID - * @return - */ - @GetMapping("/{id}") - public Result findById(@PathVariable String id){ - return Result.success(columnService.findById(id)); - } - - - /** - * 分页+多条件查询 - * @param searchMap 查询条件封装 - * @param page 页码 - * @param size 页大小 - * @return 分页结果 - */ - @PostMapping("/search/{page}/{size}") - public Result> findSearch(@RequestBody Map searchMap , @PathVariable int page, @PathVariable int size){ - Page pageList = columnService.findSearch(searchMap, page, size); - return Result.success(new PageResult(pageList.getTotalElements(), pageList.getContent()) ); - } - - /** - * 根据条件查询 - * @param searchMap - * @return - */ - @PostMapping("/search") - public Result> findSearch( @RequestBody Map searchMap){ - return Result.success(columnService.findSearch(searchMap)); - } - - /** - * 增加 - * @param column - */ - @PostMapping - public Result add(@RequestBody Column column ){ - columnService.add(column); - return Result.success(); - } - - /** - * 修改 - * @param column - */ - @PutMapping("/{id}") - public Result update(@RequestBody Column column, @PathVariable String id ){ - column.setId(id); - columnService.update(column); - return Result.success(); - } - - /** - * 删除 - * @param id - */ - @DeleteMapping("/{id}") - public Result delete(@PathVariable String id ){ - columnService.deleteById(id); - return Result.success(); - } - -} diff --git a/luoo_music/src/main/java/com/luoo/music/controller/S3Controller.java b/luoo_music/src/main/java/com/luoo/music/controller/S3Controller.java deleted file mode 100644 index 05ceabc..0000000 --- a/luoo_music/src/main/java/com/luoo/music/controller/S3Controller.java +++ /dev/null @@ -1,75 +0,0 @@ -//package com.luoo.music.controller; -// -// -//import api.Result; -//import com.luoo.music.service.S3Service; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.web.bind.annotation.CrossOrigin; -//import org.springframework.web.bind.annotation.GetMapping; -//import org.springframework.web.bind.annotation.PostMapping; -//import org.springframework.web.bind.annotation.RestController; -//import org.springframework.web.multipart.MultipartFile; -// -//import java.io.UnsupportedEncodingException; -//import java.text.SimpleDateFormat; -//import java.util.Date; -//import java.util.List; -// -//@RestController -//@CrossOrigin -//public class S3Controller { -// -// @Autowired -// private S3Service s3Service; -// -// -// @GetMapping("/awstest") -// public Result test() throws UnsupportedEncodingException { -// -//// s3Service.listObjects() -// List list = s3Service.list(); -// return Result.success(); -// } -// -// -// /** -// * 文件存储目录规划 -// * -// * music 存放期刊和期刊歌曲 二级目录为期刊期刊号 三级目录存放期刊歌曲和封面图片和歌曲图片 -// * -// * song 存放通用歌曲 -// * -// * image存放图片 -// * -// * img -// * -// * user/avatar/111.jpg -// * -// * -// * -// * -// */ -// @PostMapping("/awsUpload") -// public Result upload(MultipartFile file) { -// -// SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); -//// String fileName = UUID.randomUUID().toString().trim().replaceAll("-", ""); -// -// -// String filePath = sdf.format(new Date()) + "/" + file.getOriginalFilename(); -// try{ -// int code = s3Service.singleUpload("indie", filePath, file); -// -// } catch (Exception ex){ -// } -// -// -// return Result.success(); -// } -// -// @PostMapping("/awsCopy") -// public Result copy() { -// s3Service.copy(); -// return Result.success(); -// } -//}