This commit is contained in:
wangjinlei
2024-05-24 15:12:08 +08:00
parent 1d09fbb0b3
commit 6e3cc44319
12 changed files with 280 additions and 58 deletions

View File

@@ -1,54 +0,0 @@
package com.peanut.modules.book.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.peanut.common.utils.R;
import com.peanut.modules.book.entity.ShopStore;
import com.peanut.modules.book.service.ShopStoreService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@Slf4j
@RestController
@RequestMapping("book/shopStore")
public class ShopStoreController {
@Autowired
private ShopStoreService shopStoreService;
/**
* 获取小店列表
*/
@RequestMapping("/getStoreList")
public R getStoreList(@RequestBody Map params){
MPJLambdaWrapper<ShopStore> wrapper = new MPJLambdaWrapper();
if (params.containsKey("name")&&!"".equals(params.get("name").toString())){
wrapper.like(ShopStore::getName,params.get("name").toString());
}
Page<ShopStore> page = shopStoreService.page(new Page<>(
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
return R.ok().put("result", page);
}
@RequestMapping(path = "/getStoreById")
public R getStoreById(String id) {
return R.ok().put("result",shopStoreService.getById(id));
}
@RequestMapping(path = "/saveOrUpdateStore")
public R saveOrUpdateStore(@RequestBody ShopStore store) {
shopStoreService.saveOrUpdate(store);
return R.ok();
}
@RequestMapping(path = "/delStore")
public R delStore(String id) {
shopStoreService.removeById(id);
return R.ok();
}
}

View File

@@ -1,7 +1,7 @@
package com.peanut.modules.book.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.peanut.modules.book.entity.ShopStore;
import com.peanut.modules.common.entity.ShopStore;
public interface ShopStoreService extends IService<ShopStore> {
}