36 changed files with 1651 additions and 0 deletions
@ -0,0 +1,103 @@ |
|||
package com.qs.serve.modules.goods.controller; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.qs.serve.common.model.annotation.SysLog; |
|||
import com.qs.serve.common.model.dto.PageVo; |
|||
import com.qs.serve.common.model.dto.R; |
|||
import com.qs.serve.common.model.enums.BizType; |
|||
import com.qs.serve.common.model.enums.SystemModule; |
|||
import com.qs.serve.common.util.PageUtil; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import com.qs.serve.modules.goods.entity.GoodsCategory; |
|||
import com.qs.serve.modules.goods.service.GoodsCategoryService; |
|||
|
|||
import javax.validation.Valid; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 商品 分类 后台接口 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Slf4j |
|||
@AllArgsConstructor |
|||
@RestController |
|||
@RequestMapping("goods/category") |
|||
public class GoodsCategoryController { |
|||
|
|||
private GoodsCategoryService goodsCategoryService; |
|||
|
|||
/** |
|||
* 翻页查询 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@GetMapping("/page") |
|||
@PreAuthorize("hasRole('goods:category:query')") |
|||
public R<PageVo<GoodsCategory>> getPage(GoodsCategory param){ |
|||
PageUtil.startPage(); |
|||
LambdaQueryWrapper<GoodsCategory> categoryWrapper = new LambdaQueryWrapper<>(param); |
|||
List<GoodsCategory> list = goodsCategoryService.list(categoryWrapper); |
|||
return R.byPageHelperList(list); |
|||
} |
|||
|
|||
/** |
|||
* 根据ID查询 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@GetMapping("/getById/{id}") |
|||
@SysLog(module = SystemModule.GOODS, title = "分类", biz = BizType.QUERY) |
|||
@PreAuthorize("hasRole('goods:category:query')") |
|||
public R<GoodsCategory> getById(@PathVariable("id") String id){ |
|||
GoodsCategory goodsCategory = goodsCategoryService.getById(id); |
|||
return R.ok(goodsCategory); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 根据ID更新 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/updateById") |
|||
@SysLog(module = SystemModule.GOODS, title = "分类", biz = BizType.UPDATE) |
|||
@PreAuthorize("hasRole('goods:category:update')") |
|||
public R<?> updateById(@RequestBody @Valid GoodsCategory param){ |
|||
boolean result = goodsCategoryService.updateById(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 新增分类 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/save") |
|||
@SysLog(module = SystemModule.GOODS, title = "分类", biz = BizType.INSERT) |
|||
@PreAuthorize("hasRole('goods:category:insert')") |
|||
public R<?> save(@RequestBody @Valid GoodsCategory param){ |
|||
boolean result = goodsCategoryService.save(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 删除分类 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@DeleteMapping("/deleteById/{id}") |
|||
@SysLog(module = SystemModule.GOODS, title = "分类", biz = BizType.DELETE) |
|||
@PreAuthorize("hasRole('goods:category:delete')") |
|||
public R<?> deleteById(@PathVariable("id") String id){ |
|||
boolean result = goodsCategoryService.removeById(id); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,103 @@ |
|||
package com.qs.serve.modules.goods.controller; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.qs.serve.common.model.annotation.SysLog; |
|||
import com.qs.serve.common.model.dto.PageVo; |
|||
import com.qs.serve.common.model.dto.R; |
|||
import com.qs.serve.common.model.enums.BizType; |
|||
import com.qs.serve.common.model.enums.SystemModule; |
|||
import com.qs.serve.common.util.PageUtil; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import com.qs.serve.modules.goods.entity.GoodsSku; |
|||
import com.qs.serve.modules.goods.service.GoodsSkuService; |
|||
|
|||
import javax.validation.Valid; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 商品 sku 后台接口 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Slf4j |
|||
@AllArgsConstructor |
|||
@RestController |
|||
@RequestMapping("goods/sku") |
|||
public class GoodsSkuController { |
|||
|
|||
private GoodsSkuService goodsSkuService; |
|||
|
|||
/** |
|||
* 翻页查询 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@GetMapping("/page") |
|||
@PreAuthorize("hasRole('goods:sku:query')") |
|||
public R<PageVo<GoodsSku>> getPage(GoodsSku param){ |
|||
PageUtil.startPage(); |
|||
LambdaQueryWrapper<GoodsSku> skuWrapper = new LambdaQueryWrapper<>(param); |
|||
List<GoodsSku> list = goodsSkuService.list(skuWrapper); |
|||
return R.byPageHelperList(list); |
|||
} |
|||
|
|||
/** |
|||
* 根据ID查询 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@GetMapping("/getById/{id}") |
|||
@SysLog(module = SystemModule.GOODS, title = "sku", biz = BizType.QUERY) |
|||
@PreAuthorize("hasRole('goods:sku:query')") |
|||
public R<GoodsSku> getById(@PathVariable("id") String id){ |
|||
GoodsSku goodsSku = goodsSkuService.getById(id); |
|||
return R.ok(goodsSku); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 根据ID更新 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/updateById") |
|||
@SysLog(module = SystemModule.GOODS, title = "sku", biz = BizType.UPDATE) |
|||
@PreAuthorize("hasRole('goods:sku:update')") |
|||
public R<?> updateById(@RequestBody @Valid GoodsSku param){ |
|||
boolean result = goodsSkuService.updateById(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 新增sku |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/save") |
|||
@SysLog(module = SystemModule.GOODS, title = "sku", biz = BizType.INSERT) |
|||
@PreAuthorize("hasRole('goods:sku:insert')") |
|||
public R<?> save(@RequestBody @Valid GoodsSku param){ |
|||
boolean result = goodsSkuService.save(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 删除sku |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@DeleteMapping("/deleteById/{id}") |
|||
@SysLog(module = SystemModule.GOODS, title = "sku", biz = BizType.DELETE) |
|||
@PreAuthorize("hasRole('goods:sku:delete')") |
|||
public R<?> deleteById(@PathVariable("id") String id){ |
|||
boolean result = goodsSkuService.removeById(id); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,103 @@ |
|||
package com.qs.serve.modules.goods.controller; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.qs.serve.common.model.annotation.SysLog; |
|||
import com.qs.serve.common.model.dto.PageVo; |
|||
import com.qs.serve.common.model.dto.R; |
|||
import com.qs.serve.common.model.enums.BizType; |
|||
import com.qs.serve.common.model.enums.SystemModule; |
|||
import com.qs.serve.common.util.PageUtil; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import com.qs.serve.modules.goods.entity.GoodsSkuSpecValue; |
|||
import com.qs.serve.modules.goods.service.GoodsSkuSpecValueService; |
|||
|
|||
import javax.validation.Valid; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 商品 sku规格值 后台接口 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Slf4j |
|||
@AllArgsConstructor |
|||
@RestController |
|||
@RequestMapping("goods/skuSpecValue") |
|||
public class GoodsSkuSpecValueController { |
|||
|
|||
private GoodsSkuSpecValueService goodsSkuSpecValueService; |
|||
|
|||
/** |
|||
* 翻页查询 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@GetMapping("/page") |
|||
@PreAuthorize("hasRole('goods:skuSpecValue:query')") |
|||
public R<PageVo<GoodsSkuSpecValue>> getPage(GoodsSkuSpecValue param){ |
|||
PageUtil.startPage(); |
|||
LambdaQueryWrapper<GoodsSkuSpecValue> skuSpecValueWrapper = new LambdaQueryWrapper<>(param); |
|||
List<GoodsSkuSpecValue> list = goodsSkuSpecValueService.list(skuSpecValueWrapper); |
|||
return R.byPageHelperList(list); |
|||
} |
|||
|
|||
/** |
|||
* 根据ID查询 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@GetMapping("/getById/{id}") |
|||
@SysLog(module = SystemModule.GOODS, title = "sku规格值", biz = BizType.QUERY) |
|||
@PreAuthorize("hasRole('goods:skuSpecValue:query')") |
|||
public R<GoodsSkuSpecValue> getById(@PathVariable("id") String id){ |
|||
GoodsSkuSpecValue goodsSkuSpecValue = goodsSkuSpecValueService.getById(id); |
|||
return R.ok(goodsSkuSpecValue); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 根据ID更新 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/updateById") |
|||
@SysLog(module = SystemModule.GOODS, title = "sku规格值", biz = BizType.UPDATE) |
|||
@PreAuthorize("hasRole('goods:skuSpecValue:update')") |
|||
public R<?> updateById(@RequestBody @Valid GoodsSkuSpecValue param){ |
|||
boolean result = goodsSkuSpecValueService.updateById(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 新增sku规格值 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/save") |
|||
@SysLog(module = SystemModule.GOODS, title = "sku规格值", biz = BizType.INSERT) |
|||
@PreAuthorize("hasRole('goods:skuSpecValue:insert')") |
|||
public R<?> save(@RequestBody @Valid GoodsSkuSpecValue param){ |
|||
boolean result = goodsSkuSpecValueService.save(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 删除sku规格值 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@DeleteMapping("/deleteById/{id}") |
|||
@SysLog(module = SystemModule.GOODS, title = "sku规格值", biz = BizType.DELETE) |
|||
@PreAuthorize("hasRole('goods:skuSpecValue:delete')") |
|||
public R<?> deleteById(@PathVariable("id") String id){ |
|||
boolean result = goodsSkuSpecValueService.removeById(id); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,103 @@ |
|||
package com.qs.serve.modules.goods.controller; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.qs.serve.common.model.annotation.SysLog; |
|||
import com.qs.serve.common.model.dto.PageVo; |
|||
import com.qs.serve.common.model.dto.R; |
|||
import com.qs.serve.common.model.enums.BizType; |
|||
import com.qs.serve.common.model.enums.SystemModule; |
|||
import com.qs.serve.common.util.PageUtil; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import com.qs.serve.modules.goods.entity.GoodsSpec; |
|||
import com.qs.serve.modules.goods.service.GoodsSpecService; |
|||
|
|||
import javax.validation.Valid; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 商品 规格 后台接口 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Slf4j |
|||
@AllArgsConstructor |
|||
@RestController |
|||
@RequestMapping("goods/spec") |
|||
public class GoodsSpecController { |
|||
|
|||
private GoodsSpecService goodsSpecService; |
|||
|
|||
/** |
|||
* 翻页查询 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@GetMapping("/page") |
|||
@PreAuthorize("hasRole('goods:spec:query')") |
|||
public R<PageVo<GoodsSpec>> getPage(GoodsSpec param){ |
|||
PageUtil.startPage(); |
|||
LambdaQueryWrapper<GoodsSpec> specWrapper = new LambdaQueryWrapper<>(param); |
|||
List<GoodsSpec> list = goodsSpecService.list(specWrapper); |
|||
return R.byPageHelperList(list); |
|||
} |
|||
|
|||
/** |
|||
* 根据ID查询 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@GetMapping("/getById/{id}") |
|||
@SysLog(module = SystemModule.GOODS, title = "规格", biz = BizType.QUERY) |
|||
@PreAuthorize("hasRole('goods:spec:query')") |
|||
public R<GoodsSpec> getById(@PathVariable("id") String id){ |
|||
GoodsSpec goodsSpec = goodsSpecService.getById(id); |
|||
return R.ok(goodsSpec); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 根据ID更新 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/updateById") |
|||
@SysLog(module = SystemModule.GOODS, title = "规格", biz = BizType.UPDATE) |
|||
@PreAuthorize("hasRole('goods:spec:update')") |
|||
public R<?> updateById(@RequestBody @Valid GoodsSpec param){ |
|||
boolean result = goodsSpecService.updateById(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 新增规格 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/save") |
|||
@SysLog(module = SystemModule.GOODS, title = "规格", biz = BizType.INSERT) |
|||
@PreAuthorize("hasRole('goods:spec:insert')") |
|||
public R<?> save(@RequestBody @Valid GoodsSpec param){ |
|||
boolean result = goodsSpecService.save(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 删除规格 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@DeleteMapping("/deleteById/{id}") |
|||
@SysLog(module = SystemModule.GOODS, title = "规格", biz = BizType.DELETE) |
|||
@PreAuthorize("hasRole('goods:spec:delete')") |
|||
public R<?> deleteById(@PathVariable("id") String id){ |
|||
boolean result = goodsSpecService.removeById(id); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,103 @@ |
|||
package com.qs.serve.modules.goods.controller; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.qs.serve.common.model.annotation.SysLog; |
|||
import com.qs.serve.common.model.dto.PageVo; |
|||
import com.qs.serve.common.model.dto.R; |
|||
import com.qs.serve.common.model.enums.BizType; |
|||
import com.qs.serve.common.model.enums.SystemModule; |
|||
import com.qs.serve.common.util.PageUtil; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import com.qs.serve.modules.goods.entity.GoodsSpecValue; |
|||
import com.qs.serve.modules.goods.service.GoodsSpecValueService; |
|||
|
|||
import javax.validation.Valid; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 商品 规格值 后台接口 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Slf4j |
|||
@AllArgsConstructor |
|||
@RestController |
|||
@RequestMapping("goods/specValue") |
|||
public class GoodsSpecValueController { |
|||
|
|||
private GoodsSpecValueService goodsSpecValueService; |
|||
|
|||
/** |
|||
* 翻页查询 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@GetMapping("/page") |
|||
@PreAuthorize("hasRole('goods:specValue:query')") |
|||
public R<PageVo<GoodsSpecValue>> getPage(GoodsSpecValue param){ |
|||
PageUtil.startPage(); |
|||
LambdaQueryWrapper<GoodsSpecValue> specValueWrapper = new LambdaQueryWrapper<>(param); |
|||
List<GoodsSpecValue> list = goodsSpecValueService.list(specValueWrapper); |
|||
return R.byPageHelperList(list); |
|||
} |
|||
|
|||
/** |
|||
* 根据ID查询 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@GetMapping("/getById/{id}") |
|||
@SysLog(module = SystemModule.GOODS, title = "规格值", biz = BizType.QUERY) |
|||
@PreAuthorize("hasRole('goods:specValue:query')") |
|||
public R<GoodsSpecValue> getById(@PathVariable("id") String id){ |
|||
GoodsSpecValue goodsSpecValue = goodsSpecValueService.getById(id); |
|||
return R.ok(goodsSpecValue); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 根据ID更新 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/updateById") |
|||
@SysLog(module = SystemModule.GOODS, title = "规格值", biz = BizType.UPDATE) |
|||
@PreAuthorize("hasRole('goods:specValue:update')") |
|||
public R<?> updateById(@RequestBody @Valid GoodsSpecValue param){ |
|||
boolean result = goodsSpecValueService.updateById(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 新增规格值 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/save") |
|||
@SysLog(module = SystemModule.GOODS, title = "规格值", biz = BizType.INSERT) |
|||
@PreAuthorize("hasRole('goods:specValue:insert')") |
|||
public R<?> save(@RequestBody @Valid GoodsSpecValue param){ |
|||
boolean result = goodsSpecValueService.save(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 删除规格值 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@DeleteMapping("/deleteById/{id}") |
|||
@SysLog(module = SystemModule.GOODS, title = "规格值", biz = BizType.DELETE) |
|||
@PreAuthorize("hasRole('goods:specValue:delete')") |
|||
public R<?> deleteById(@PathVariable("id") String id){ |
|||
boolean result = goodsSpecValueService.removeById(id); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,103 @@ |
|||
package com.qs.serve.modules.goods.controller; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.qs.serve.common.model.annotation.SysLog; |
|||
import com.qs.serve.common.model.dto.PageVo; |
|||
import com.qs.serve.common.model.dto.R; |
|||
import com.qs.serve.common.model.enums.BizType; |
|||
import com.qs.serve.common.model.enums.SystemModule; |
|||
import com.qs.serve.common.util.PageUtil; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import com.qs.serve.modules.goods.entity.GoodsSpu; |
|||
import com.qs.serve.modules.goods.service.GoodsSpuService; |
|||
|
|||
import javax.validation.Valid; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 商品 spu 后台接口 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Slf4j |
|||
@AllArgsConstructor |
|||
@RestController |
|||
@RequestMapping("goods/spu") |
|||
public class GoodsSpuController { |
|||
|
|||
private GoodsSpuService goodsSpuService; |
|||
|
|||
/** |
|||
* 翻页查询 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@GetMapping("/page") |
|||
@PreAuthorize("hasRole('goods:spu:query')") |
|||
public R<PageVo<GoodsSpu>> getPage(GoodsSpu param){ |
|||
PageUtil.startPage(); |
|||
LambdaQueryWrapper<GoodsSpu> spuWrapper = new LambdaQueryWrapper<>(param); |
|||
List<GoodsSpu> list = goodsSpuService.list(spuWrapper); |
|||
return R.byPageHelperList(list); |
|||
} |
|||
|
|||
/** |
|||
* 根据ID查询 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@GetMapping("/getById/{id}") |
|||
@SysLog(module = SystemModule.GOODS, title = "spu", biz = BizType.QUERY) |
|||
@PreAuthorize("hasRole('goods:spu:query')") |
|||
public R<GoodsSpu> getById(@PathVariable("id") String id){ |
|||
GoodsSpu goodsSpu = goodsSpuService.getById(id); |
|||
return R.ok(goodsSpu); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 根据ID更新 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/updateById") |
|||
@SysLog(module = SystemModule.GOODS, title = "spu", biz = BizType.UPDATE) |
|||
@PreAuthorize("hasRole('goods:spu:update')") |
|||
public R<?> updateById(@RequestBody @Valid GoodsSpu param){ |
|||
boolean result = goodsSpuService.updateById(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 新增spu |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/save") |
|||
@SysLog(module = SystemModule.GOODS, title = "spu", biz = BizType.INSERT) |
|||
@PreAuthorize("hasRole('goods:spu:insert')") |
|||
public R<?> save(@RequestBody @Valid GoodsSpu param){ |
|||
boolean result = goodsSpuService.save(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 删除spu |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@DeleteMapping("/deleteById/{id}") |
|||
@SysLog(module = SystemModule.GOODS, title = "spu", biz = BizType.DELETE) |
|||
@PreAuthorize("hasRole('goods:spu:delete')") |
|||
public R<?> deleteById(@PathVariable("id") String id){ |
|||
boolean result = goodsSpuService.removeById(id); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,103 @@ |
|||
package com.qs.serve.modules.goods.controller; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.qs.serve.common.model.annotation.SysLog; |
|||
import com.qs.serve.common.model.dto.PageVo; |
|||
import com.qs.serve.common.model.dto.R; |
|||
import com.qs.serve.common.model.enums.BizType; |
|||
import com.qs.serve.common.model.enums.SystemModule; |
|||
import com.qs.serve.common.util.PageUtil; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import com.qs.serve.modules.goods.entity.GoodsSpuSpec; |
|||
import com.qs.serve.modules.goods.service.GoodsSpuSpecService; |
|||
|
|||
import javax.validation.Valid; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 商品 spu规格 后台接口 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Slf4j |
|||
@AllArgsConstructor |
|||
@RestController |
|||
@RequestMapping("goods/spuSpec") |
|||
public class GoodsSpuSpecController { |
|||
|
|||
private GoodsSpuSpecService goodsSpuSpecService; |
|||
|
|||
/** |
|||
* 翻页查询 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@GetMapping("/page") |
|||
@PreAuthorize("hasRole('goods:spuSpec:query')") |
|||
public R<PageVo<GoodsSpuSpec>> getPage(GoodsSpuSpec param){ |
|||
PageUtil.startPage(); |
|||
LambdaQueryWrapper<GoodsSpuSpec> spuSpecWrapper = new LambdaQueryWrapper<>(param); |
|||
List<GoodsSpuSpec> list = goodsSpuSpecService.list(spuSpecWrapper); |
|||
return R.byPageHelperList(list); |
|||
} |
|||
|
|||
/** |
|||
* 根据ID查询 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@GetMapping("/getById/{id}") |
|||
@SysLog(module = SystemModule.GOODS, title = "spu规格", biz = BizType.QUERY) |
|||
@PreAuthorize("hasRole('goods:spuSpec:query')") |
|||
public R<GoodsSpuSpec> getById(@PathVariable("id") String id){ |
|||
GoodsSpuSpec goodsSpuSpec = goodsSpuSpecService.getById(id); |
|||
return R.ok(goodsSpuSpec); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 根据ID更新 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/updateById") |
|||
@SysLog(module = SystemModule.GOODS, title = "spu规格", biz = BizType.UPDATE) |
|||
@PreAuthorize("hasRole('goods:spuSpec:update')") |
|||
public R<?> updateById(@RequestBody @Valid GoodsSpuSpec param){ |
|||
boolean result = goodsSpuSpecService.updateById(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 新增spu规格 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/save") |
|||
@SysLog(module = SystemModule.GOODS, title = "spu规格", biz = BizType.INSERT) |
|||
@PreAuthorize("hasRole('goods:spuSpec:insert')") |
|||
public R<?> save(@RequestBody @Valid GoodsSpuSpec param){ |
|||
boolean result = goodsSpuSpecService.save(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 删除spu规格 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@DeleteMapping("/deleteById/{id}") |
|||
@SysLog(module = SystemModule.GOODS, title = "spu规格", biz = BizType.DELETE) |
|||
@PreAuthorize("hasRole('goods:spuSpec:delete')") |
|||
public R<?> deleteById(@PathVariable("id") String id){ |
|||
boolean result = goodsSpuSpecService.removeById(id); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,87 @@ |
|||
package com.qs.serve.modules.goods.entity; |
|||
|
|||
import java.time.LocalDateTime; |
|||
import java.io.Serializable; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* 分类 实体类 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Data |
|||
@TableName("goods_category") |
|||
public class GoodsCategory implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** PK */ |
|||
@TableId(type = IdType.AUTO) |
|||
private Long id; |
|||
|
|||
/** (1:开启;0:关闭) */ |
|||
@NotBlank(message = "(1:开启;0:关闭)不能为空") |
|||
@Length(max = 2,message = "(1:开启;0:关闭)长度不能超过2字") |
|||
private String enable; |
|||
|
|||
/** 父分类编号 */ |
|||
@Length(max = 32,message = "父分类编号长度不能超过32字") |
|||
private String parentId; |
|||
|
|||
/** 名称 */ |
|||
@Length(max = 16,message = "名称长度不能超过16字") |
|||
private String name; |
|||
|
|||
/** 描述 */ |
|||
@Length(max = 255,message = "描述长度不能超过255字") |
|||
private String description; |
|||
|
|||
/** 图片 */ |
|||
@Length(max = 255,message = "图片长度不能超过255字") |
|||
private String picUrl; |
|||
|
|||
/** 排序 */ |
|||
private Integer sort; |
|||
|
|||
/** 创建时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private LocalDateTime createTime; |
|||
|
|||
/** 最后更新时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private LocalDateTime updateTime; |
|||
|
|||
/** 所属租户 */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String tenantId; |
|||
|
|||
/** 逻辑删除标记(0:显示;1:隐藏) */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String delFlag; |
|||
|
|||
/** 创建人 */ |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private String createBy; |
|||
|
|||
/** 更新人 */ |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private String updateBy; |
|||
|
|||
} |
|||
|
@ -0,0 +1,103 @@ |
|||
package com.qs.serve.modules.goods.entity; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
import java.io.Serializable; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* sku 实体类 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Data |
|||
@TableName("goods_sku") |
|||
public class GoodsSku implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** PK */ |
|||
@TableId(type = IdType.AUTO) |
|||
private Long id; |
|||
|
|||
/** sku编码 */ |
|||
@Length(max = 32,message = "sku编码长度不能超过32字") |
|||
private String skuCode; |
|||
|
|||
/** 商品Id */ |
|||
@NotNull(message = "商品Id不能为空") |
|||
private Long spuId; |
|||
|
|||
/** 图片 */ |
|||
@Length(max = 500,message = "图片长度不能超过500字") |
|||
private String picUrl; |
|||
|
|||
/** 销售价格 */ |
|||
private BigDecimal salesPrice; |
|||
|
|||
/** 市场价 */ |
|||
private BigDecimal marketPrice; |
|||
|
|||
/** 成本价 */ |
|||
private BigDecimal costPrice; |
|||
|
|||
/** 库存 */ |
|||
@NotNull(message = "库存不能为空") |
|||
private Integer stock; |
|||
|
|||
/** 重量(kg) */ |
|||
@NotNull(message = "重量(kg)不能为空") |
|||
private BigDecimal weight; |
|||
|
|||
/** 体积(m³) */ |
|||
@NotNull(message = "体积(m³)不能为空") |
|||
private BigDecimal volume; |
|||
|
|||
/** 是否启用1、是;0否 */ |
|||
@NotBlank(message = "是否启用1、是;0否不能为空") |
|||
@Length(max = 2,message = "是否启用1、是;0否长度不能超过2字") |
|||
private String enable; |
|||
|
|||
/** 版本号 */ |
|||
private Integer version; |
|||
|
|||
/** 最后更新时间 */ |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private LocalDateTime updateTime; |
|||
|
|||
/** 创建时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private LocalDateTime createTime; |
|||
|
|||
/** 所属租户 */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String tenantId; |
|||
|
|||
/** 逻辑删除标记(0:显示;1:隐藏) */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String delFlag; |
|||
|
|||
/** 创建人 */ |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private String createBy; |
|||
|
|||
/** 更新人 */ |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private String updateBy; |
|||
|
|||
} |
|||
|
@ -0,0 +1,77 @@ |
|||
package com.qs.serve.modules.goods.entity; |
|||
|
|||
import java.time.LocalDateTime; |
|||
import java.io.Serializable; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* sku规格值 实体类 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Data |
|||
@TableName("goods_sku_spec_value") |
|||
public class GoodsSkuSpecValue implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** PK */ |
|||
@TableId(type = IdType.AUTO) |
|||
private Long id; |
|||
|
|||
/** spu_id */ |
|||
private Long spuId; |
|||
|
|||
/** sku_id */ |
|||
@NotNull(message = "sku_id不能为空") |
|||
private Long skuId; |
|||
|
|||
/** 规格值id */ |
|||
@NotNull(message = "规格值id不能为空") |
|||
private Long specValueId; |
|||
|
|||
/** 排序字段 */ |
|||
private Integer sort; |
|||
|
|||
/** 创建时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private LocalDateTime createTime; |
|||
|
|||
/** 更新时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private LocalDateTime updateTime; |
|||
|
|||
/** 创建人 */ |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private String createBy; |
|||
|
|||
/** 更新人 */ |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private String updateBy; |
|||
|
|||
/** 所属租户 */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String tenantId; |
|||
|
|||
/** 逻辑删除标记(0:显示;1:隐藏) */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String delFlag; |
|||
|
|||
} |
|||
|
@ -0,0 +1,66 @@ |
|||
package com.qs.serve.modules.goods.entity; |
|||
|
|||
import java.time.LocalDateTime; |
|||
import java.io.Serializable; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* 规格 实体类 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Data |
|||
@TableName("goods_spec") |
|||
public class GoodsSpec implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** PK */ |
|||
@TableId(type = IdType.AUTO) |
|||
private Long id; |
|||
|
|||
/** 名称 */ |
|||
@NotBlank(message = "名称不能为空") |
|||
@Length(max = 50,message = "名称长度不能超过50字") |
|||
private String name; |
|||
|
|||
/** 创建时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private LocalDateTime createTime; |
|||
|
|||
/** 最后更新时间 */ |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private LocalDateTime updateTime; |
|||
|
|||
/** 创建人 */ |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private String createBy; |
|||
|
|||
/** 更新人 */ |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private String updateBy; |
|||
|
|||
/** 所属租户 */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String tenantId; |
|||
|
|||
/** 逻辑删除标记(0:显示;1:隐藏) */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String delFlag; |
|||
|
|||
} |
|||
|
@ -0,0 +1,70 @@ |
|||
package com.qs.serve.modules.goods.entity; |
|||
|
|||
import java.time.LocalDateTime; |
|||
import java.io.Serializable; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* 规格值 实体类 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Data |
|||
@TableName("goods_spec_value") |
|||
public class GoodsSpecValue implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** PK */ |
|||
@TableId(type = IdType.AUTO) |
|||
private Long id; |
|||
|
|||
/** 规格Id */ |
|||
@NotNull(message = "规格Id不能为空") |
|||
private Long specId; |
|||
|
|||
/** 名称 */ |
|||
@NotBlank(message = "名称不能为空") |
|||
@Length(max = 50,message = "名称长度不能超过50字") |
|||
private String name; |
|||
|
|||
/** 创建时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private LocalDateTime createTime; |
|||
|
|||
/** 最后更新时间 */ |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private LocalDateTime updateTime; |
|||
|
|||
/** 创建人 */ |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private String createBy; |
|||
|
|||
/** 更新人 */ |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private String updateBy; |
|||
|
|||
/** 所属租户 */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String tenantId; |
|||
|
|||
/** 逻辑删除标记(0:显示;1:隐藏) */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String delFlag; |
|||
|
|||
} |
|||
|
@ -0,0 +1,102 @@ |
|||
package com.qs.serve.modules.goods.entity; |
|||
|
|||
import java.time.LocalDateTime; |
|||
import java.io.Serializable; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* spu 实体类 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Data |
|||
@TableName("goods_spu") |
|||
public class GoodsSpu implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** PK */ |
|||
@TableId(type = IdType.AUTO) |
|||
private Long id; |
|||
|
|||
/** 商品编码 */ |
|||
@NotBlank(message = "商品编码不能为空") |
|||
@Length(max = 32,message = "商品编码长度不能超过32字") |
|||
private String spuCode; |
|||
|
|||
/** 商品名字 */ |
|||
@NotBlank(message = "商品名字不能为空") |
|||
@Length(max = 200,message = "商品名字长度不能超过200字") |
|||
private String name; |
|||
|
|||
/** 一级分类ID */ |
|||
@NotNull(message = "一级分类ID不能为空") |
|||
private Long categoryFirst; |
|||
|
|||
/** 二级分类ID */ |
|||
private Long categorySecond; |
|||
|
|||
/** 三级分类ID */ |
|||
private Long categoryThird; |
|||
|
|||
/** 商品图片 */ |
|||
@NotBlank(message = "商品图片不能为空") |
|||
@Length(max = 1024,message = "商品图片长度不能超过1024字") |
|||
private String picUrls; |
|||
|
|||
/** 是否上架(1是 0否) */ |
|||
@NotBlank(message = "是否上架(1是 0否)不能为空") |
|||
@Length(max = 2,message = "是否上架(1是 0否)长度不能超过2字") |
|||
private String shelf; |
|||
|
|||
/** 排序字段 */ |
|||
@NotNull(message = "排序字段不能为空") |
|||
private Integer sort; |
|||
|
|||
/** 销量 */ |
|||
private Integer saleNum; |
|||
|
|||
/** 0统一规格;1多规格 */ |
|||
@Length(max = 2,message = "0统一规格;1多规格长度不能超过2字") |
|||
private String specType; |
|||
|
|||
/** 创建时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private LocalDateTime createTime; |
|||
|
|||
/** 最后更新时间 */ |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private LocalDateTime updateTime; |
|||
|
|||
/** 创建人 */ |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private String createBy; |
|||
|
|||
/** 更新人 */ |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private String updateBy; |
|||
|
|||
/** 所属租户 */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String tenantId; |
|||
|
|||
/** 逻辑删除标记(0:显示;1:隐藏) */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String delFlag; |
|||
|
|||
} |
|||
|
@ -0,0 +1,74 @@ |
|||
package com.qs.serve.modules.goods.entity; |
|||
|
|||
import java.time.LocalDateTime; |
|||
import java.io.Serializable; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* spu规格 实体类 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Data |
|||
@TableName("goods_spu_spec") |
|||
public class GoodsSpuSpec implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** PK */ |
|||
@TableId(type = IdType.ASSIGN_UUID) |
|||
private String id; |
|||
|
|||
/** spu_id */ |
|||
@NotNull(message = "spu_id不能为空") |
|||
private Long spuId; |
|||
|
|||
/** spec_id */ |
|||
@NotNull(message = "spec_id不能为空") |
|||
private Long specId; |
|||
|
|||
/** 排序字段 */ |
|||
private Integer sort; |
|||
|
|||
/** 创建时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private LocalDateTime createTime; |
|||
|
|||
/** 更新时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private LocalDateTime updateTime; |
|||
|
|||
/** 创建人 */ |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private String createBy; |
|||
|
|||
/** 更新人 */ |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private String updateBy; |
|||
|
|||
/** 所属租户 */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String tenantId; |
|||
|
|||
/** 逻辑删除标记(0:显示;1:隐藏) */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String delFlag; |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.goods.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.qs.serve.modules.goods.entity.GoodsCategory; |
|||
|
|||
/** |
|||
* 分类 Mapper |
|||
* @author YenHex |
|||
* @date 2022-10-09 |
|||
*/ |
|||
public interface GoodsCategoryMapper extends BaseMapper<GoodsCategory> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.goods.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.qs.serve.modules.goods.entity.GoodsSku; |
|||
|
|||
/** |
|||
* sku Mapper |
|||
* @author YenHex |
|||
* @date 2022-10-09 |
|||
*/ |
|||
public interface GoodsSkuMapper extends BaseMapper<GoodsSku> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.goods.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.qs.serve.modules.goods.entity.GoodsSkuSpecValue; |
|||
|
|||
/** |
|||
* sku规格值 Mapper |
|||
* @author YenHex |
|||
* @date 2022-10-09 |
|||
*/ |
|||
public interface GoodsSkuSpecValueMapper extends BaseMapper<GoodsSkuSpecValue> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.goods.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.qs.serve.modules.goods.entity.GoodsSpec; |
|||
|
|||
/** |
|||
* 规格 Mapper |
|||
* @author YenHex |
|||
* @date 2022-10-09 |
|||
*/ |
|||
public interface GoodsSpecMapper extends BaseMapper<GoodsSpec> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.goods.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.qs.serve.modules.goods.entity.GoodsSpecValue; |
|||
|
|||
/** |
|||
* 规格值 Mapper |
|||
* @author YenHex |
|||
* @date 2022-10-09 |
|||
*/ |
|||
public interface GoodsSpecValueMapper extends BaseMapper<GoodsSpecValue> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.goods.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.qs.serve.modules.goods.entity.GoodsSpu; |
|||
|
|||
/** |
|||
* spu Mapper |
|||
* @author YenHex |
|||
* @date 2022-10-09 |
|||
*/ |
|||
public interface GoodsSpuMapper extends BaseMapper<GoodsSpu> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.goods.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.qs.serve.modules.goods.entity.GoodsSpuSpec; |
|||
|
|||
/** |
|||
* spu规格 Mapper |
|||
* @author YenHex |
|||
* @date 2022-10-09 |
|||
*/ |
|||
public interface GoodsSpuSpecMapper extends BaseMapper<GoodsSpuSpec> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.goods.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.qs.serve.modules.goods.entity.GoodsCategory; |
|||
|
|||
/** |
|||
* 分类 服务接口 |
|||
* @author YenHex |
|||
* @date 2022-10-09 |
|||
*/ |
|||
public interface GoodsCategoryService extends IService<GoodsCategory> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.goods.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.qs.serve.modules.goods.entity.GoodsSku; |
|||
|
|||
/** |
|||
* sku 服务接口 |
|||
* @author YenHex |
|||
* @date 2022-10-09 |
|||
*/ |
|||
public interface GoodsSkuService extends IService<GoodsSku> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.goods.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.qs.serve.modules.goods.entity.GoodsSkuSpecValue; |
|||
|
|||
/** |
|||
* sku规格值 服务接口 |
|||
* @author YenHex |
|||
* @date 2022-10-09 |
|||
*/ |
|||
public interface GoodsSkuSpecValueService extends IService<GoodsSkuSpecValue> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.goods.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.qs.serve.modules.goods.entity.GoodsSpec; |
|||
|
|||
/** |
|||
* 规格 服务接口 |
|||
* @author YenHex |
|||
* @date 2022-10-09 |
|||
*/ |
|||
public interface GoodsSpecService extends IService<GoodsSpec> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.goods.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.qs.serve.modules.goods.entity.GoodsSpecValue; |
|||
|
|||
/** |
|||
* 规格值 服务接口 |
|||
* @author YenHex |
|||
* @date 2022-10-09 |
|||
*/ |
|||
public interface GoodsSpecValueService extends IService<GoodsSpecValue> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.goods.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.qs.serve.modules.goods.entity.GoodsSpu; |
|||
|
|||
/** |
|||
* spu 服务接口 |
|||
* @author YenHex |
|||
* @date 2022-10-09 |
|||
*/ |
|||
public interface GoodsSpuService extends IService<GoodsSpu> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.goods.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.qs.serve.modules.goods.entity.GoodsSpuSpec; |
|||
|
|||
/** |
|||
* spu规格 服务接口 |
|||
* @author YenHex |
|||
* @date 2022-10-09 |
|||
*/ |
|||
public interface GoodsSpuSpecService extends IService<GoodsSpuSpec> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,22 @@ |
|||
package com.qs.serve.modules.goods.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import com.qs.serve.modules.goods.entity.GoodsCategory; |
|||
import com.qs.serve.modules.goods.service.GoodsCategoryService; |
|||
import com.qs.serve.modules.goods.mapper.GoodsCategoryMapper; |
|||
|
|||
/** |
|||
* 分类 服务实现类 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class GoodsCategoryServiceImpl extends ServiceImpl<GoodsCategoryMapper,GoodsCategory> implements GoodsCategoryService { |
|||
|
|||
} |
|||
|
@ -0,0 +1,22 @@ |
|||
package com.qs.serve.modules.goods.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import com.qs.serve.modules.goods.entity.GoodsSku; |
|||
import com.qs.serve.modules.goods.service.GoodsSkuService; |
|||
import com.qs.serve.modules.goods.mapper.GoodsSkuMapper; |
|||
|
|||
/** |
|||
* sku 服务实现类 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper,GoodsSku> implements GoodsSkuService { |
|||
|
|||
} |
|||
|
@ -0,0 +1,22 @@ |
|||
package com.qs.serve.modules.goods.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import com.qs.serve.modules.goods.entity.GoodsSkuSpecValue; |
|||
import com.qs.serve.modules.goods.service.GoodsSkuSpecValueService; |
|||
import com.qs.serve.modules.goods.mapper.GoodsSkuSpecValueMapper; |
|||
|
|||
/** |
|||
* sku规格值 服务实现类 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class GoodsSkuSpecValueServiceImpl extends ServiceImpl<GoodsSkuSpecValueMapper,GoodsSkuSpecValue> implements GoodsSkuSpecValueService { |
|||
|
|||
} |
|||
|
@ -0,0 +1,22 @@ |
|||
package com.qs.serve.modules.goods.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import com.qs.serve.modules.goods.entity.GoodsSpec; |
|||
import com.qs.serve.modules.goods.service.GoodsSpecService; |
|||
import com.qs.serve.modules.goods.mapper.GoodsSpecMapper; |
|||
|
|||
/** |
|||
* 规格 服务实现类 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class GoodsSpecServiceImpl extends ServiceImpl<GoodsSpecMapper,GoodsSpec> implements GoodsSpecService { |
|||
|
|||
} |
|||
|
@ -0,0 +1,22 @@ |
|||
package com.qs.serve.modules.goods.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import com.qs.serve.modules.goods.entity.GoodsSpecValue; |
|||
import com.qs.serve.modules.goods.service.GoodsSpecValueService; |
|||
import com.qs.serve.modules.goods.mapper.GoodsSpecValueMapper; |
|||
|
|||
/** |
|||
* 规格值 服务实现类 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class GoodsSpecValueServiceImpl extends ServiceImpl<GoodsSpecValueMapper,GoodsSpecValue> implements GoodsSpecValueService { |
|||
|
|||
} |
|||
|
@ -0,0 +1,22 @@ |
|||
package com.qs.serve.modules.goods.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import com.qs.serve.modules.goods.entity.GoodsSpu; |
|||
import com.qs.serve.modules.goods.service.GoodsSpuService; |
|||
import com.qs.serve.modules.goods.mapper.GoodsSpuMapper; |
|||
|
|||
/** |
|||
* spu 服务实现类 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class GoodsSpuServiceImpl extends ServiceImpl<GoodsSpuMapper,GoodsSpu> implements GoodsSpuService { |
|||
|
|||
} |
|||
|
@ -0,0 +1,22 @@ |
|||
package com.qs.serve.modules.goods.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import com.qs.serve.modules.goods.entity.GoodsSpuSpec; |
|||
import com.qs.serve.modules.goods.service.GoodsSpuSpecService; |
|||
import com.qs.serve.modules.goods.mapper.GoodsSpuSpecMapper; |
|||
|
|||
/** |
|||
* spu规格 服务实现类 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class GoodsSpuSpecServiceImpl extends ServiceImpl<GoodsSpuSpecMapper,GoodsSpuSpec> implements GoodsSpuSpecService { |
|||
|
|||
} |
|||
|
Loading…
Reference in new issue