| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.account.api.model.AppUserShop; |
| | | import com.ruoyi.account.service.AppUserShopService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | |
| | | @RestController |
| | | @RequestMapping("/appUserShop") |
| | | public class AppUserShopController { |
| | | @Resource |
| | | private AppUserShopService appUserShopService; |
| | | |
| | | @PostMapping("/addAppUserShop") |
| | | public R<Void> add(@RequestBody AppUserShop appUserShop) { |
| | | appUserShopService.save(appUserShop); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/shop/{userId}") |
| | | public R<List<AppUserShop>> getAppUserShop(@PathVariable("userId") Long userId) { |
| | | return R.ok(appUserShopService.list(new LambdaQueryWrapper<AppUserShop>() |
| | | .eq(AppUserShop::getAppUserId,userId))); |
| | | } |
| | | |
| | | |
| | | |