Pu Zhibing
2025-01-14 66df2da5f7c05787ff215a66cfc882bc238bbcc4
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/UserShopController.java
@@ -1,13 +1,11 @@
package com.ruoyi.system.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.model.UserShop;
import com.ruoyi.system.service.UserShopService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@@ -56,4 +54,28 @@
        userShopService.save(userShop);
        return R.ok();
    }
    /**
     * 删除后台账号和门店关系数据
     * @param userShop
     * @return
     */
    @PostMapping("/delUserShop")
    public R delUserShop(@RequestBody UserShop userShop){
        userShopService.remove(new LambdaQueryWrapper<UserShop>().eq(UserShop::getUserId, userShop.getUserId()).eq(UserShop::getShopId, userShop.getShopId()));
        return R.ok();
    }
    /**
     * 删除门店所有关系数据
     * @param shopId
     * @return
     */
    @PostMapping("/delShopAllUserShop")
    public R delShopAllUserShop(@RequestParam("shopId") Integer shopId){
        userShopService.remove(new LambdaQueryWrapper<UserShop>().eq(UserShop::getShopId, shopId));
        return R.ok();
    }
}