-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47bc68e
commit fd10a24
Showing
23 changed files
with
501 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,9 +8,7 @@ | |
### 基础功能 | ||
|
||
1. 角色管理、用户管理、菜单管理 | ||
|
||
2. 商品管理、品牌管理、分类管理 | ||
2. | ||
2. 商品管理、品牌管理、分类管理 | ||
|
||
### 拓展功能 | ||
|
||
|
36 changes: 36 additions & 0 deletions
36
spzx/spzx-manager/src/main/java/com/manager/controller/CategoryBrandController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,44 @@ | ||
package com.manager.controller; | ||
|
||
import com.github.pagehelper.PageInfo; | ||
import com.manager.service.CategoryBrandService; | ||
import com.model.dto.product.CategoryBrandDto; | ||
import com.model.entity.product.CategoryBrand; | ||
import com.model.vo.common.Result; | ||
import com.model.vo.common.ResultCodeEnum; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
/** | ||
* @author 帕斯卡的芦苇 | ||
* @date 2025/1/20 | ||
**/ | ||
@RestController | ||
@RequestMapping("/admin/product/categoryBrand") | ||
public class CategoryBrandController { | ||
@Autowired | ||
private CategoryBrandService categoryBrandService; | ||
|
||
@GetMapping("/list/{pageNum}/{pageSize}") | ||
public Result<PageInfo<CategoryBrand>> listCategoryBrand(@PathVariable("pageNum") Integer pageNum, | ||
@PathVariable("pageSize") Integer pageSize, | ||
CategoryBrandDto categoryBrandDto) { | ||
PageInfo<CategoryBrand> categoryBrandPageInfo = categoryBrandService.listCategoryBrand(pageNum, pageSize, categoryBrandDto); | ||
return Result.build(categoryBrandPageInfo, ResultCodeEnum.SUCCESS); | ||
} | ||
@PostMapping("/save") | ||
public Result save(@RequestBody CategoryBrand categoryBrand) { | ||
categoryBrandService.save(categoryBrand); | ||
return Result.build(null,ResultCodeEnum.SUCCESS); | ||
} | ||
@PutMapping("/update") | ||
public Result update(@RequestBody CategoryBrand categoryBrand) { | ||
categoryBrandService.update(categoryBrand); | ||
return Result.build(null,ResultCodeEnum.SUCCESS); | ||
} | ||
@DeleteMapping("/delete/{id}") | ||
public Result delete(@PathVariable("id") Long id) { | ||
categoryBrandService.delete(id); | ||
return Result.build(null,ResultCodeEnum.SUCCESS); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
spzx/spzx-manager/src/main/java/com/manager/controller/ProductSpecController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.manager.controller; | ||
|
||
import com.github.pagehelper.PageInfo; | ||
import com.manager.service.ProductSpecService; | ||
import com.model.entity.product.ProductSpec; | ||
import com.model.vo.common.Result; | ||
import com.model.vo.common.ResultCodeEnum; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
/** | ||
* @author 帕斯卡的芦苇 | ||
* @date 2025/1/21 | ||
**/ | ||
@RestController | ||
@RequestMapping("/admin/product/productSpec") | ||
public class ProductSpecController { | ||
@Autowired | ||
ProductSpecService productSpecService; | ||
@GetMapping("/listByPage/{pageNum}/{pageSize}") | ||
public Result<PageInfo<ProductSpec>> listByPage(@PathVariable("pageNum") Integer pageNum, | ||
@PathVariable("pageSize") Integer pageSize){ | ||
PageInfo<ProductSpec> productSpecPageInfo = productSpecService.listByPage(pageNum,pageSize); | ||
return Result.build(productSpecPageInfo, ResultCodeEnum.SUCCESS); | ||
} | ||
@PostMapping("/save") | ||
public Result saveProductSpec(@RequestBody ProductSpec productSpec) { | ||
productSpecService.saveProductSpec(productSpec); | ||
return Result.build(null,ResultCodeEnum.SUCCESS); | ||
} | ||
@PutMapping("/updateById") | ||
public Result updateProductSpec( @RequestBody ProductSpec productSpec) { | ||
productSpecService.updateProductSpec(productSpec); | ||
return Result.build(null,ResultCodeEnum.SUCCESS); | ||
} | ||
@DeleteMapping("/deleteById/{id}") | ||
public Result deleteProductSpec(@PathVariable("id") Long id) { | ||
productSpecService.deleteProductSpec(id); | ||
return Result.build(null,ResultCodeEnum.SUCCESS); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
spzx/spzx-manager/src/main/java/com/manager/controller/productController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.manager.controller; | ||
|
||
import com.github.pagehelper.PageInfo; | ||
import com.manager.service.ProductService; | ||
import com.model.dto.product.ProductDto; | ||
import com.model.entity.product.Product; | ||
import com.model.vo.common.Result; | ||
import com.model.vo.common.ResultCodeEnum; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
/** | ||
* @author 帕斯卡的芦苇 | ||
* @date 2025/1/22 | ||
**/ | ||
@RestController | ||
@RequestMapping("/admin/product/product") | ||
public class productController { | ||
@Autowired | ||
private ProductService productService; | ||
@GetMapping("/listByPage/{pageNum}/{pageSize}") | ||
public Result<PageInfo<Product>> listByPage(@PathVariable("pageNum") Integer pageNum, | ||
@PathVariable("pageSize") Integer pageSize, | ||
ProductDto productDto){ | ||
PageInfo<Product> productPageInfo =productService.listByPage(pageNum,pageSize,productDto); | ||
return Result.build(productPageInfo, ResultCodeEnum.SUCCESS); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
spzx/spzx-manager/src/main/java/com/manager/mapper/CategoryBrandMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.manager.mapper; | ||
|
||
import com.model.dto.product.CategoryBrandDto; | ||
import com.model.entity.product.CategoryBrand; | ||
import org.apache.ibatis.annotations.Mapper; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author 帕斯卡的芦苇 | ||
* @date 2025/1/20 | ||
**/ | ||
@Mapper | ||
public interface CategoryBrandMapper { | ||
List<CategoryBrand> listCategoryBrand(CategoryBrandDto categoryBrandDto); | ||
|
||
void save(CategoryBrand categoryBrand); | ||
|
||
void update(CategoryBrand categoryBrand); | ||
|
||
void delete(Long id); | ||
} |
16 changes: 16 additions & 0 deletions
16
spzx/spzx-manager/src/main/java/com/manager/mapper/ProductMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.manager.mapper; | ||
|
||
import com.model.dto.product.ProductDto; | ||
import com.model.entity.product.Product; | ||
import org.apache.ibatis.annotations.Mapper; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author 帕斯卡的芦苇 | ||
* @date 2025/1/22 | ||
**/ | ||
@Mapper | ||
public interface ProductMapper { | ||
List<Product> listByPage(ProductDto productDto); | ||
} |
21 changes: 21 additions & 0 deletions
21
spzx/spzx-manager/src/main/java/com/manager/mapper/ProductSpecMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.manager.mapper; | ||
|
||
import com.model.entity.product.ProductSpec; | ||
import org.apache.ibatis.annotations.Mapper; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author 帕斯卡的芦苇 | ||
* @date 2025/1/21 | ||
**/ | ||
@Mapper | ||
public interface ProductSpecMapper { | ||
List<ProductSpec> listByPage(); | ||
|
||
void saveProductSpec(ProductSpec productSpec); | ||
|
||
void updateProductSpec(ProductSpec productSpec); | ||
|
||
void deleteProductSpec(Long id); | ||
} |
20 changes: 20 additions & 0 deletions
20
spzx/spzx-manager/src/main/java/com/manager/service/CategoryBrandService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.manager.service; | ||
|
||
import com.github.pagehelper.PageInfo; | ||
import com.model.dto.product.CategoryBrandDto; | ||
import com.model.entity.product.CategoryBrand; | ||
|
||
/** | ||
* @author 帕斯卡的芦苇 | ||
* @date 2025/1/20 | ||
**/ | ||
public interface CategoryBrandService { | ||
|
||
PageInfo<CategoryBrand> listCategoryBrand(Integer pageNum, Integer pageSize, CategoryBrandDto categoryBrandDto); | ||
|
||
void save(CategoryBrand categoryBrand); | ||
|
||
void update(CategoryBrand categoryBrand); | ||
|
||
void delete(Long id); | ||
} |
13 changes: 13 additions & 0 deletions
13
spzx/spzx-manager/src/main/java/com/manager/service/ProductService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.manager.service; | ||
|
||
import com.github.pagehelper.PageInfo; | ||
import com.model.dto.product.ProductDto; | ||
import com.model.entity.product.Product; | ||
|
||
/** | ||
* @author 帕斯卡的芦苇 | ||
* @date 2025/1/22 | ||
**/ | ||
public interface ProductService { | ||
PageInfo<Product> listByPage(Integer pageNum, Integer pageSize, ProductDto productDto); | ||
} |
18 changes: 18 additions & 0 deletions
18
spzx/spzx-manager/src/main/java/com/manager/service/ProductSpecService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.manager.service; | ||
|
||
import com.github.pagehelper.PageInfo; | ||
import com.model.entity.product.ProductSpec; | ||
|
||
/** | ||
* @author 帕斯卡的芦苇 | ||
* @date 2025/1/21 | ||
**/ | ||
public interface ProductSpecService { | ||
PageInfo<ProductSpec> listByPage(Integer pageNum, Integer pageSize); | ||
|
||
void saveProductSpec(ProductSpec productSpec); | ||
|
||
void updateProductSpec(ProductSpec productSpec); | ||
|
||
void deleteProductSpec(Long id); | ||
} |
53 changes: 53 additions & 0 deletions
53
spzx/spzx-manager/src/main/java/com/manager/service/impl/CategoryBrandServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.manager.service.impl; | ||
|
||
import com.github.pagehelper.PageHelper; | ||
import com.github.pagehelper.PageInfo; | ||
import com.manager.mapper.CategoryBrandMapper; | ||
import com.manager.service.CategoryBrandService; | ||
import com.model.dto.product.CategoryBrandDto; | ||
import com.model.entity.product.CategoryBrand; | ||
import com.model.vo.common.ResultCodeEnum; | ||
import com.service.exception.BusinessException; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author 帕斯卡的芦苇 | ||
* @date 2025/1/20 | ||
**/ | ||
@Service | ||
public class CategoryBrandServiceImpl implements CategoryBrandService { | ||
@Autowired | ||
private CategoryBrandMapper categoryBrandMapper; | ||
@Override | ||
public PageInfo<CategoryBrand> listCategoryBrand(Integer pageNum, Integer pageSize, CategoryBrandDto categoryBrandDto) { | ||
PageHelper.startPage(pageNum,pageSize); | ||
List<CategoryBrand> categoryBrands = categoryBrandMapper.listCategoryBrand(categoryBrandDto); | ||
PageInfo<CategoryBrand> pageInfo = new PageInfo(categoryBrands); | ||
return pageInfo; | ||
} | ||
|
||
@Override | ||
public void save(CategoryBrand categoryBrand) { | ||
CategoryBrandDto categoryBrandDto = new CategoryBrandDto(); | ||
categoryBrandDto.setBrandId(categoryBrand.getBrandId()); | ||
categoryBrandDto.setCategoryId(categoryBrand.getCategoryId()); | ||
List<CategoryBrand> categoryBrands = categoryBrandMapper.listCategoryBrand(categoryBrandDto); | ||
if(!categoryBrands.isEmpty()) { | ||
throw new BusinessException(ResultCodeEnum.CATEGOREBRAND_IS_EXISTS); | ||
} | ||
categoryBrandMapper.save(categoryBrand); | ||
} | ||
|
||
@Override | ||
public void update(CategoryBrand categoryBrand) { | ||
categoryBrandMapper.update(categoryBrand); | ||
} | ||
|
||
@Override | ||
public void delete(Long id) { | ||
categoryBrandMapper.delete(id); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
spzx/spzx-manager/src/main/java/com/manager/service/impl/ProductServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.manager.service.impl; | ||
|
||
import com.github.pagehelper.PageHelper; | ||
import com.github.pagehelper.PageInfo; | ||
import com.manager.mapper.ProductMapper; | ||
import com.manager.service.ProductService; | ||
import com.model.dto.product.ProductDto; | ||
import com.model.entity.product.Product; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author 帕斯卡的芦苇 | ||
* @date 2025/1/22 | ||
**/ | ||
@Service | ||
public class ProductServiceImpl implements ProductService { | ||
@Autowired | ||
ProductMapper productMapper; | ||
@Override | ||
public PageInfo<Product> listByPage(Integer pageNum, Integer pageSize, ProductDto productDto) { | ||
PageHelper.startPage(pageNum,pageSize); | ||
List<Product> productList = productMapper.listByPage(productDto); | ||
PageInfo<Product> productPageInfo =new PageInfo(productList); | ||
return productPageInfo; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
spzx/spzx-manager/src/main/java/com/manager/service/impl/ProductSpecServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.manager.service.impl; | ||
|
||
import com.github.pagehelper.PageHelper; | ||
import com.github.pagehelper.PageInfo; | ||
import com.manager.mapper.ProductSpecMapper; | ||
import com.manager.service.ProductSpecService; | ||
import com.model.entity.product.ProductSpec; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author 帕斯卡的芦苇 | ||
* @date 2025/1/21 | ||
**/ | ||
@Service | ||
public class ProductSpecServiceImpl implements ProductSpecService { | ||
@Autowired | ||
ProductSpecMapper productSpecMapper; | ||
|
||
@Override | ||
public PageInfo<ProductSpec> listByPage(Integer pageNum, Integer pageSize) { | ||
PageHelper.startPage(pageNum,pageSize); | ||
List<ProductSpec> productSpecList = productSpecMapper.listByPage(); | ||
PageInfo<ProductSpec> productSpecPageInfo =new PageInfo(productSpecList); | ||
return productSpecPageInfo; | ||
} | ||
|
||
@Override | ||
public void saveProductSpec(ProductSpec productSpec) { | ||
productSpecMapper.saveProductSpec(productSpec); | ||
} | ||
|
||
@Override | ||
public void updateProductSpec(ProductSpec productSpec) { | ||
productSpecMapper.updateProductSpec(productSpec); | ||
} | ||
|
||
@Override | ||
public void deleteProductSpec(Long id) { | ||
productSpecMapper.deleteProductSpec(id); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
spzx/spzx-manager/src/main/java/com/manager/service/impl/SysMenuServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...n/java/com/manager/helper/MenuHelper.java → ...ain/java/com/manager/util/MenuHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.