无关风月
2024-07-11 eb6b6dbb35a9f029e0b7d269773685c19fd40976
cloud-server-other/src/main/java/com/dsh/other/controller/StoreConfigController.java
@@ -27,27 +27,70 @@
    private StoreConfigService storeConfigService;
    @ResponseBody
    @PostMapping("/base/store/queryStoreConfig")
    @ApiOperation(value = "获取门店模块配置", tags = {"APP-加入玩湃"})
    @ApiImplicitParams({
            @ApiImplicitParam(value = "门店id", name = "storeId", dataType = "int", required = true),
    })
    public ResultUtil<List<StoreConfigVo>> queryStoreConfig(Integer storeId){
        if(null == storeId){
    public ResultUtil<List<StoreConfigVo>> queryStoreConfig(Integer storeId) {
        if (null == storeId) {
            return ResultUtil.paranErr("storeId");
        }
        try {
            List<StoreConfig> list = storeConfigService.list(new QueryWrapper<StoreConfig>().eq("storeId", storeId).orderByAsc("sort").eq("isOpen",1));
            List<StoreConfig> list = storeConfigService.list(new QueryWrapper<StoreConfig>().eq("storeId", storeId).orderByAsc("sort").eq("isOpen", 1));
            List<StoreConfigVo> listVo = new ArrayList<>();
            for (StoreConfig storeConfig : list) {
                StoreConfigVo storeConfigVo = new StoreConfigVo();
                BeanUtils.copyProperties(storeConfig, storeConfigVo);
                if (storeConfig.getBackgroundImage() == null || storeConfig.getBackgroundImage().equals("")) {
                    switch (storeConfigVo.getType()) {
                        case 1: {
                            storeConfigVo.setBackgroundImage("https://we-park-life.oss-cn-beijing.aliyuncs.com/img/8b7073a4d33d4eea9f0d173cb4db92a7.png");
                            break;
                        }
                        case 2: {
                            storeConfigVo.setBackgroundImage("https://we-park-life.oss-cn-beijing.aliyuncs.com/img/f60f1622ae184475ad703ec60bbcbeff.png");
                            break;
                        }
                        case 3: {
                            storeConfigVo.setBackgroundImage("https://we-park-life.oss-cn-beijing.aliyuncs.com/img/08c5eca72fca4d479d21905d25870ef8.png");
                            break;
                        }
                        case 4: {
                            storeConfigVo.setBackgroundImage("https://we-park-life.oss-cn-beijing.aliyuncs.com/img/8602be35e6cf4f76819b7b2d7b588efc.png");
                            break;
                        }
                        case 5: {
                            storeConfigVo.setBackgroundImage("https://we-park-life.oss-cn-beijing.aliyuncs.com/img/694f84a1e2ba4d2c919f4f4ffaadece2.png");
                            break;
                        }
                        case 6: {
                            storeConfigVo.setBackgroundImage("https://we-park-life.oss-cn-beijing.aliyuncs.com/img/81a83d229fea46a78be6a3ec1d5b7d6e.png");
                            break;
                        }
                        case 7: {
                            storeConfigVo.setBackgroundImage("https://we-park-life.oss-cn-beijing.aliyuncs.com/img/312763e7565c48f2a16021c162c76018.png");
                            break;
                        }
                        case 8: {
                            storeConfigVo.setBackgroundImage("https://we-park-life.oss-cn-beijing.aliyuncs.com/img/0771fb3bd4de43c08492d0912209e51f.png");
                            break;
                        }
                    }
                }
                listVo.add(storeConfigVo);
            }
            return ResultUtil.success(listVo);
        }catch (Exception e){
        } catch (Exception e) {
            e.printStackTrace();
            return ResultUtil.runErr();
        }