|
@@ -21,8 +21,8 @@ import com.qs.mp.common.enums.ErrorCodeEnum;
|
|
|
import com.qs.mp.common.enums.GoodsStatusEnum;
|
|
|
import com.qs.mp.common.utils.LogUtil;
|
|
|
import com.qs.mp.web.controller.common.BaseApiController;
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.*;
|
|
|
+
|
|
|
import java.net.URLDecoder;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashSet;
|
|
@@ -30,8 +30,6 @@ import java.util.LinkedHashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
-import io.swagger.annotations.ApiResponse;
|
|
|
-import io.swagger.annotations.ApiResponses;
|
|
|
import ma.glasnost.orika.MapperFacade;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -40,10 +38,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
/**
|
|
|
* @auther liugl
|
|
@@ -130,6 +125,24 @@ public class GoodsMgrController extends BaseApiController {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @PostMapping("/update/sortWeight")
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:goods:edit')")
|
|
|
+ @ApiOperation("更新商品排序权重")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "goodsId", value = "商品ID", required = true, dataType = "Long", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "sortWeight", value = "排序权重", required = true, dataType = "Integer", paramType = "query")
|
|
|
+ })
|
|
|
+ public AjaxResult updateSortWeight(@RequestParam Long goodsId,
|
|
|
+ @RequestParam Integer sortWeight) {
|
|
|
+
|
|
|
+ Goods goods = new Goods();
|
|
|
+ goods.setGoodsId(goodsId);
|
|
|
+ goods.setSortWeight(sortWeight);
|
|
|
+ return AjaxResult.success(goodsService.updateById(goods));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 获取商品详情信息
|
|
|
*
|