diff --git a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminCartController.java b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminCartController.java deleted file mode 100644 index dd1a7aa1..00000000 --- a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminCartController.java +++ /dev/null @@ -1,94 +0,0 @@ -package org.linlinjava.litemall.admin.web; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.linlinjava.litemall.admin.annotation.LoginAdmin; -import org.linlinjava.litemall.db.domain.LitemallCart; -import org.linlinjava.litemall.db.service.LitemallCartService; -import org.linlinjava.litemall.db.service.LitemallGoodsService; -import org.linlinjava.litemall.db.service.LitemallProductService; -import org.linlinjava.litemall.db.service.LitemallUserService; -import org.linlinjava.litemall.core.util.ResponseUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@RestController -@RequestMapping("/admin/cart") -public class AdminCartController { - private final Log logger = LogFactory.getLog(AdminCartController.class); - - @Autowired - private LitemallCartService cartService; - @Autowired - private LitemallUserService userService; - @Autowired - private LitemallGoodsService goodsService; - @Autowired - private LitemallProductService productService; - - @GetMapping("/list") - public Object list(@LoginAdmin Integer adminId, - Integer userId, Integer goodsId, - @RequestParam(value = "page", defaultValue = "1") Integer page, - @RequestParam(value = "limit", defaultValue = "10") Integer limit, - String sort, String order){ - if(adminId == null){ - return ResponseUtil.fail401(); - } - List cartList = cartService.querySelective(userId, goodsId, page, limit, sort, order); - int total = cartService.countSelective(userId, goodsId, page, limit, sort, order); - - Map data = new HashMap<>(); - data.put("total", total); - data.put("items", cartList); - - return ResponseUtil.ok(data); - } - - /* - * 目前的逻辑不支持管理员创建 - */ - @PostMapping("/create") - public Object create(@LoginAdmin Integer adminId, @RequestBody LitemallCart cart){ - if(adminId == null){ - return ResponseUtil.fail401(); - } - - return ResponseUtil.fail501(); - } - - @GetMapping("/read") - public Object read(@LoginAdmin Integer adminId, Integer id){ - if(adminId == null){ - return ResponseUtil.fail401(); - } - - LitemallCart cart = cartService.findById(id); - return ResponseUtil.ok(cart); - } - - /* - * 目前的逻辑不支持管理员创建 - */ - @PostMapping("/update") - public Object update(@LoginAdmin Integer adminId, @RequestBody LitemallCart cart){ - if(adminId == null){ - return ResponseUtil.fail401(); - } - return ResponseUtil.fail501(); - } - - @PostMapping("/delete") - public Object delete(@LoginAdmin Integer adminId, @RequestBody LitemallCart cart){ - if(adminId == null){ - return ResponseUtil.fail401(); - } - cartService.deleteById(cart.getId()); - return ResponseUtil.ok(); - } - -} diff --git a/litemall-admin/src/api/cart.js b/litemall-admin/src/api/cart.js deleted file mode 100644 index 7825d527..00000000 --- a/litemall-admin/src/api/cart.js +++ /dev/null @@ -1,41 +0,0 @@ -import request from '@/utils/request' - -export function listCart(query) { - return request({ - url: '/cart/list', - method: 'get', - params: query - }) -} - -export function createCart(data) { - return request({ - url: '/cart/create', - method: 'post', - data - }) -} - -export function readCart(data) { - return request({ - url: '/cart/read', - method: 'get', - data - }) -} - -export function updateCart(data) { - return request({ - url: '/cart/update', - method: 'post', - data - }) -} - -export function deleteCart(data) { - return request({ - url: '/cart/delete', - method: 'post', - data - }) -} diff --git a/litemall-admin/src/router/index.js b/litemall-admin/src/router/index.js index 3f96052b..de73dd83 100644 --- a/litemall-admin/src/router/index.js +++ b/litemall-admin/src/router/index.js @@ -66,8 +66,7 @@ export const asyncRouterMap = [ { path: 'address', component: _import('user/address'), name: 'address', meta: { title: '收货地址', noCache: true }}, { path: 'collect', component: _import('user/collect'), name: 'collect', meta: { title: '会员收藏', noCache: true }}, { path: 'footprint', component: _import('user/footprint'), name: 'footprint', meta: { title: '会员足迹', noCache: true }}, - { path: 'history', component: _import('user/history'), name: 'history', meta: { title: '搜索历史', noCache: true }}, - { path: 'cart', component: _import('user/cart'), name: 'cart', meta: { title: '购物车', noCache: true }} + { path: 'history', component: _import('user/history'), name: 'history', meta: { title: '搜索历史', noCache: true }} ] }, diff --git a/litemall-admin/src/views/user/cart.vue b/litemall-admin/src/views/user/cart.vue deleted file mode 100644 index a2aac59f..00000000 --- a/litemall-admin/src/views/user/cart.vue +++ /dev/null @@ -1,236 +0,0 @@ - - - \ No newline at end of file