记得上下班打卡 | git大法好,push需谨慎

Commit a06bbb94 authored by 张国柄's avatar 张国柄

opt;

parent c7f17547
...@@ -32,6 +32,7 @@ import io.swagger.annotations.ApiOperation; ...@@ -32,6 +32,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -51,7 +52,7 @@ import java.util.stream.IntStream; ...@@ -51,7 +52,7 @@ import java.util.stream.IntStream;
@Api(tags = "商品管理") @Api(tags = "商品管理")
@Slf4j @Slf4j
@Validated @Validated
@RestController @Controller
@RequestMapping("store/mgt/goods") @RequestMapping("store/mgt/goods")
public class GoblinStoreMgtGoodsController { public class GoblinStoreMgtGoodsController {
@Autowired @Autowired
...@@ -66,6 +67,7 @@ public class GoblinStoreMgtGoodsController { ...@@ -66,6 +67,7 @@ public class GoblinStoreMgtGoodsController {
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "SPU列表") @ApiOperation(value = "SPU列表")
@PostMapping("list") @PostMapping("list")
@ResponseBody
public ResponseDto<PagedResult<GoblinStoreMgtGoodsListVo>> list(@Valid @RequestBody GoblinStoreMgtGoodsFilterParam storeMgtGoodsFilterParam) { public ResponseDto<PagedResult<GoblinStoreMgtGoodsListVo>> list(@Valid @RequestBody GoblinStoreMgtGoodsFilterParam storeMgtGoodsFilterParam) {
String currentUid = CurrentUtil.getCurrentUid(); String currentUid = CurrentUtil.getCurrentUid();
if (!goblinRedisUtils.hasStoreId(currentUid, storeMgtGoodsFilterParam.getStoreId())) { if (!goblinRedisUtils.hasStoreId(currentUid, storeMgtGoodsFilterParam.getStoreId())) {
...@@ -120,6 +122,7 @@ public class GoblinStoreMgtGoodsController { ...@@ -120,6 +122,7 @@ public class GoblinStoreMgtGoodsController {
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
@ApiOperation(value = "SPU管理") @ApiOperation(value = "SPU管理")
@PostMapping("operate") @PostMapping("operate")
@ResponseBody
public ResponseDto<Object> action(@Valid @RequestBody GoblinStoreMgtGoodsActionParam storeMgtGoodsActionParam) { public ResponseDto<Object> action(@Valid @RequestBody GoblinStoreMgtGoodsActionParam storeMgtGoodsActionParam) {
String currentUid = CurrentUtil.getCurrentUid(); String currentUid = CurrentUtil.getCurrentUid();
if (!goblinRedisUtils.hasStoreId(currentUid, storeMgtGoodsActionParam.getStoreId())) { if (!goblinRedisUtils.hasStoreId(currentUid, storeMgtGoodsActionParam.getStoreId())) {
...@@ -149,6 +152,7 @@ public class GoblinStoreMgtGoodsController { ...@@ -149,6 +152,7 @@ public class GoblinStoreMgtGoodsController {
@ApiOperationSupport(order = 4) @ApiOperationSupport(order = 4)
@ApiOperation(value = "SPU添加") @ApiOperation(value = "SPU添加")
@PutMapping("add") @PutMapping("add")
@ResponseBody
public ResponseDto<Object> add(@Valid @RequestBody GoblinStoreMgtGoodsAddParam storeMgtGoodsAddParam) { public ResponseDto<Object> add(@Valid @RequestBody GoblinStoreMgtGoodsAddParam storeMgtGoodsAddParam) {
String currentUid = CurrentUtil.getCurrentUid(); String currentUid = CurrentUtil.getCurrentUid();
String storeId = storeMgtGoodsAddParam.getStoreId(); String storeId = storeMgtGoodsAddParam.getStoreId();
...@@ -235,6 +239,7 @@ public class GoblinStoreMgtGoodsController { ...@@ -235,6 +239,7 @@ public class GoblinStoreMgtGoodsController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "spuId", value = "商品ID"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "spuId", value = "商品ID"),
}) })
@GetMapping("info") @GetMapping("info")
@ResponseBody
public ResponseDto<GoblinStoreMgtGoodsInfoVo> info(@NotBlank(message = "店铺ID不能为空") @RequestParam String storeId, public ResponseDto<GoblinStoreMgtGoodsInfoVo> info(@NotBlank(message = "店铺ID不能为空") @RequestParam String storeId,
@NotBlank(message = "商品ID不能为空") @RequestParam String spuId) { @NotBlank(message = "商品ID不能为空") @RequestParam String spuId) {
if (!goblinRedisUtils.hasStoreId(CurrentUtil.getCurrentUid(), storeId)) { if (!goblinRedisUtils.hasStoreId(CurrentUtil.getCurrentUid(), storeId)) {
...@@ -249,6 +254,7 @@ public class GoblinStoreMgtGoodsController { ...@@ -249,6 +254,7 @@ public class GoblinStoreMgtGoodsController {
@ApiOperationSupport(order = 6) @ApiOperationSupport(order = 6)
@ApiOperation(value = "商品编辑:SPU编辑", notes = "只修改商品信息,不包含规格相关信息") @ApiOperation(value = "商品编辑:SPU编辑", notes = "只修改商品信息,不包含规格相关信息")
@PostMapping("edit_spu") @PostMapping("edit_spu")
@ResponseBody
public ResponseDto<Object> editSpu(@Valid @RequestBody GoblinStoreMgtGoodsAddParam storeMgtGoodsAddParam) { public ResponseDto<Object> editSpu(@Valid @RequestBody GoblinStoreMgtGoodsAddParam storeMgtGoodsAddParam) {
String currentUid = CurrentUtil.getCurrentUid(); String currentUid = CurrentUtil.getCurrentUid();
String storeId = storeMgtGoodsAddParam.getStoreId(); String storeId = storeMgtGoodsAddParam.getStoreId();
...@@ -285,6 +291,7 @@ public class GoblinStoreMgtGoodsController { ...@@ -285,6 +291,7 @@ public class GoblinStoreMgtGoodsController {
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 7)
@ApiOperation(value = "商品编辑:SKU编辑", notes = "只修改单品信息,不包含商品信息") @ApiOperation(value = "商品编辑:SKU编辑", notes = "只修改单品信息,不包含商品信息")
@PostMapping("edit_sku") @PostMapping("edit_sku")
@ResponseBody
public ResponseDto<Object> editSku(@Valid @RequestBody GoblinStoreMgtGoodsEditSkuParam storeMgtGoodsEditSkuParam) { public ResponseDto<Object> editSku(@Valid @RequestBody GoblinStoreMgtGoodsEditSkuParam storeMgtGoodsEditSkuParam) {
String currentUid = CurrentUtil.getCurrentUid(); String currentUid = CurrentUtil.getCurrentUid();
if (!goblinRedisUtils.hasStoreId(currentUid, storeMgtGoodsEditSkuParam.getStoreId())) { if (!goblinRedisUtils.hasStoreId(currentUid, storeMgtGoodsEditSkuParam.getStoreId())) {
...@@ -423,6 +430,7 @@ public class GoblinStoreMgtGoodsController { ...@@ -423,6 +430,7 @@ public class GoblinStoreMgtGoodsController {
@ApiOperationSupport(order = 8) @ApiOperationSupport(order = 8)
@ApiOperation(value = "商品编辑:SKU添加") @ApiOperation(value = "商品编辑:SKU添加")
@PutMapping("edit_sku/add") @PutMapping("edit_sku/add")
@ResponseBody
public ResponseDto<Object> editSkuAdd(@Valid @RequestBody GoblinStoreMgtGoodsEditSkuParam storeMgtGoodsEditSkuParam) { public ResponseDto<Object> editSkuAdd(@Valid @RequestBody GoblinStoreMgtGoodsEditSkuParam storeMgtGoodsEditSkuParam) {
String currentUid = CurrentUtil.getCurrentUid(); String currentUid = CurrentUtil.getCurrentUid();
if (!goblinRedisUtils.hasStoreId(currentUid, storeMgtGoodsEditSkuParam.getStoreId())) { if (!goblinRedisUtils.hasStoreId(currentUid, storeMgtGoodsEditSkuParam.getStoreId())) {
...@@ -496,6 +504,7 @@ public class GoblinStoreMgtGoodsController { ...@@ -496,6 +504,7 @@ public class GoblinStoreMgtGoodsController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "skuId", value = "单品ID"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "skuId", value = "单品ID"),
}) })
@PostMapping("edit_sku/del") @PostMapping("edit_sku/del")
@ResponseBody
public ResponseDto<Object> editSkuDel(@NotBlank(message = "店铺ID不能为空") String storeId, public ResponseDto<Object> editSkuDel(@NotBlank(message = "店铺ID不能为空") String storeId,
@NotBlank(message = "单品ID不能为空") String skuId) { @NotBlank(message = "单品ID不能为空") String skuId) {
String currentUid = CurrentUtil.getCurrentUid(); String currentUid = CurrentUtil.getCurrentUid();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment