|
@@ -1,8 +1,13 @@
|
|
|
package com.content.controller;
|
|
package com.content.controller;
|
|
|
import com.base.exception.WyMusicException;
|
|
import com.base.exception.WyMusicException;
|
|
|
|
|
+import com.base.utils.Result;
|
|
|
|
|
+import com.content.config.SecurityUtil;
|
|
|
|
|
+import com.content.domain.po.ShopSwipper;
|
|
|
import com.content.domain.po.Swipper;
|
|
import com.content.domain.po.Swipper;
|
|
|
|
|
+import com.content.service.IShopSwipperService;
|
|
|
import com.content.service.ISwipperService;
|
|
import com.content.service.ISwipperService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.security.core.context.SecurityContextHolder;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
@@ -18,17 +23,30 @@ import java.util.List;
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
|
-@RequestMapping("/swipper")
|
|
|
|
|
|
|
+@RequestMapping("/content/swipper")
|
|
|
public class SwipperController {
|
|
public class SwipperController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ISwipperService swipperService;
|
|
private ISwipperService swipperService;
|
|
|
- @GetMapping("/content")
|
|
|
|
|
- public List<Swipper> content(){
|
|
|
|
|
- return swipperService.list();
|
|
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IShopSwipperService iShopSwipperService;
|
|
|
|
|
+ @GetMapping("/find/recommend")
|
|
|
|
|
+ public Result<List<Swipper>> findRecommend(){
|
|
|
|
|
+ return Result.success(swipperService.list());
|
|
|
|
|
+ }
|
|
|
|
|
+ @GetMapping("/shop")
|
|
|
|
|
+ public Result<List<ShopSwipper>> Shop(){
|
|
|
|
|
+ return Result.success(iShopSwipperService.list());
|
|
|
}
|
|
}
|
|
|
@GetMapping("/test")
|
|
@GetMapping("/test")
|
|
|
public List<Swipper> test() {
|
|
public List<Swipper> test() {
|
|
|
WyMusicException.cast("账号或密码错误");
|
|
WyMusicException.cast("账号或密码错误");
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ @GetMapping("/test1")
|
|
|
|
|
+ public String test1() {
|
|
|
|
|
+ Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
|
|
|
|
|
+ System.out.println(principal);
|
|
|
|
|
+ return principal.toString();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|