删除不用的controller

main
JH 10 months ago
parent 1113b70a0f
commit aaa24e442b

@ -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<Void> examine (@PathVariable String articleId){
articleService.updateState(articleId);
return Result.success();
}
@PutMapping("/thumbup/{articleId}")
public Result<Void> thumbup (@PathVariable String articleId){
articleService.addThumbup(articleId);
return Result.success();
}
/**
*
* @return
*/
@GetMapping
public Result<List<Article>> findAll(){
return Result.success(articleService.findAll());
}
/**
* ID
* @param id ID
* @return
*/
@GetMapping("/{id}")
public Result<Article> findById(@PathVariable String id){
return Result.success(articleService.findById(id));
}
@GetMapping("/findByVolid/{volid}")
public Result<Article> findByVolid(@PathVariable String volid){
return Result.success(articleService.findByVolid(volid));
}
/**
* +
* @param searchMap
* @param page
* @param size
* @return
*/
@PostMapping("/search/{page}/{size}")
public Result<PageResult<Article>> findSearch(@RequestBody Map searchMap , @PathVariable int page, @PathVariable int size){
Page<Article> pageList = articleService.findSearch(searchMap, page, size);
return Result.success(new PageResult<Article>(pageList.getTotalElements(), pageList.getContent()) );
}
/**
*
* @param searchMap
* @return
*/
@PostMapping("/search")
public Result<List<Article>> findSearch( @RequestBody Map searchMap){
return Result.success(articleService.findSearch(searchMap));
}
/**
*
* @param article
*/
@PostMapping
public Result<Void> add(@RequestBody Article article ){
articleService.add(article);
return Result.success();
}
/**
*
* @param article
*/
@PutMapping("/{id}")
public Result<Void> update(@RequestBody Article article, @PathVariable String id ){
article.setId(id);
articleService.update(article);
return Result.success();
}
/**
*
* @param id
*/
@DeleteMapping("/{id}")
public Result<Void> delete(@PathVariable String id ){
articleService.deleteById(id);
return Result.success();
}
}

@ -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<List<Channel>> findAll(){
return Result.success(channelService.findAll());
}
/**
* ID
* @param id ID
* @return
*/
@GetMapping("/{id}")
public Result<Channel> findById(@PathVariable String id){
return Result.success(channelService.findById(id));
}
/**
* +
* @param searchMap
* @param page
* @param size
* @return
*/
@PostMapping("/search/{page}/{size}")
public Result<PageResult<Channel>> findSearch(@RequestBody Map searchMap , @PathVariable int page, @PathVariable int size){
Page<Channel> pageList = channelService.findSearch(searchMap, page, size);
return Result.success(new PageResult<Channel>(pageList.getTotalElements(), pageList.getContent()) );
}
/**
*
* @param searchMap
* @return
*/
@PostMapping("/search")
public Result<List<Channel>> findSearch( @RequestBody Map searchMap){
return Result.success(channelService.findSearch(searchMap));
}
/**
*
* @param channel
*/
@PostMapping
public Result<Void> add(@RequestBody Channel channel ){
channelService.add(channel);
return Result.success();
}
/**
*
* @param channel
*/
@PutMapping("/{id}")
public Result<Void> update(@RequestBody Channel channel, @PathVariable String id ){
channel.setId(id);
channelService.update(channel);
return Result.success();
}
/**
*
* @param id
*/
@DeleteMapping("/{id}")
public Result<Void> delete(@PathVariable String id ){
channelService.deleteById(id);
return Result.success();
}
}

@ -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<List<Column>> findAll(){
return Result.success(columnService.findAll());
}
/**
* ID
* @param id ID
* @return
*/
@GetMapping("/{id}")
public Result<Column> findById(@PathVariable String id){
return Result.success(columnService.findById(id));
}
/**
* +
* @param searchMap
* @param page
* @param size
* @return
*/
@PostMapping("/search/{page}/{size}")
public Result<PageResult<Column>> findSearch(@RequestBody Map searchMap , @PathVariable int page, @PathVariable int size){
Page<Column> pageList = columnService.findSearch(searchMap, page, size);
return Result.success(new PageResult<Column>(pageList.getTotalElements(), pageList.getContent()) );
}
/**
*
* @param searchMap
* @return
*/
@PostMapping("/search")
public Result<List<Column>> findSearch( @RequestBody Map searchMap){
return Result.success(columnService.findSearch(searchMap));
}
/**
*
* @param column
*/
@PostMapping
public Result<Void> add(@RequestBody Column column ){
columnService.add(column);
return Result.success();
}
/**
*
* @param column
*/
@PutMapping("/{id}")
public Result<Void> update(@RequestBody Column column, @PathVariable String id ){
column.setId(id);
columnService.update(column);
return Result.success();
}
/**
*
* @param id
*/
@DeleteMapping("/{id}")
public Result<Void> delete(@PathVariable String id ){
columnService.deleteById(id);
return Result.success();
}
}

@ -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();
// }
//}
Loading…
Cancel
Save