phpcjl
2024-12-11 f5ef4dc87297dad9c238d18006d4cef022dd30f5
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
@@ -28,6 +28,7 @@
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
@@ -79,12 +80,15 @@
        AppUserShop appUserShop = new AppUserShop();
        appUserShop.setAppUserId(loginUserApplet.getUserid());
        appUserShop.setShopId(shop.getId());
        appUserClient.addAppUserShop(appUserShop);
        R<Void> r = appUserClient.addAppUserShop(appUserShop);
        if (R.isError(r)){
            throw new RuntimeException("添加失败");
        }
        return R.ok();
    }
    @PostMapping("/getDetailById")
    @GetMapping("/getDetailById")
    @ApiOperation(value = "门店详情", tags = {"后台管理-门店管理-门店详情"})
    public R<Shop> getDetailById(@RequestParam("id") Long id){
        Shop byId = shopService.getById(id);
@@ -206,5 +210,12 @@
        return R.ok(list);
    }
    @GetMapping("/getShopIdByName")
    R<Set<Integer>> getShopIdByName(@RequestParam String shopName){
        List<Shop> list = shopService.list(new LambdaQueryWrapper<Shop>()
                .like(Shop::getName, shopName));
        return R.ok(list.stream().map(Shop::getId).collect(Collectors.toSet()));
    }
}