|
@@ -13,7 +13,6 @@ import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
-import org.apache.commons.lang.StringUtils;
|
|
|
|
import org.springframework.http.HttpHeaders;
|
|
import org.springframework.http.HttpHeaders;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
@@ -25,7 +24,7 @@ import java.util.List;
|
|
* @author : Charles
|
|
* @author : Charles
|
|
* @date : 2021/4/14
|
|
* @date : 2021/4/14
|
|
*/
|
|
*/
|
|
-@Api(tags="二手商品API")
|
|
|
|
|
|
+@Api(tags = "二手商品API")
|
|
@RestController
|
|
@RestController
|
|
@RequiredArgsConstructor
|
|
@RequiredArgsConstructor
|
|
@RequestMapping("/commodity/second")
|
|
@RequestMapping("/commodity/second")
|
|
@@ -38,17 +37,18 @@ public class SecondHandApi {
|
|
*/
|
|
*/
|
|
@ApiOperation("二手商品列表(旧:/product/getSecondHandProductList)")
|
|
@ApiOperation("二手商品列表(旧:/product/getSecondHandProductList)")
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
- @ApiImplicitParam(required = false, name = "secondHandType", value = "二手商品分类,1二手仪器,2临期产品,3其他"),
|
|
|
|
- @ApiImplicitParam(required = false, name = "instrumentType", value = "二手仪器分类的类型,1轻光电、2重光电、3耗材配件"),
|
|
|
|
- @ApiImplicitParam(required = false, name = "name", value = "二手商品名称搜索关键词"),
|
|
|
|
- @ApiImplicitParam(required = false, name = "pageNum", value = "页码"),
|
|
|
|
- @ApiImplicitParam(required = false, name = "pageSize", value = "每页数量")
|
|
|
|
|
|
+ @ApiImplicitParam(required = false, name = "userId", value = "机构用户id"),
|
|
|
|
+ @ApiImplicitParam(required = false, name = "secondHandType", value = "二手商品分类,1二手仪器,2临期产品,3其他"),
|
|
|
|
+ @ApiImplicitParam(required = false, name = "instrumentType", value = "二手仪器分类的类型,1轻光电、2重光电、3耗材配件"),
|
|
|
|
+ @ApiImplicitParam(required = false, name = "name", value = "二手商品名称搜索关键词"),
|
|
|
|
+ @ApiImplicitParam(required = false, name = "pageNum", value = "页码"),
|
|
|
|
+ @ApiImplicitParam(required = false, name = "pageSize", value = "每页数量")
|
|
})
|
|
})
|
|
@GetMapping("list")
|
|
@GetMapping("list")
|
|
- public ResponseJson<PaginationVo<SecondListVo>> getSecondHandList(Integer secondHandType, Integer instrumentType, String name,
|
|
|
|
|
|
+ public ResponseJson<PaginationVo<SecondListVo>> getSecondHandList(Integer userId, Integer secondHandType, Integer instrumentType, String name,
|
|
@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
@RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
|
|
@RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
|
|
- return secondHandService.getSecondHandList(secondHandType, instrumentType, name, pageNum, pageSize);
|
|
|
|
|
|
+ return secondHandService.getSecondHandList(userId, secondHandType, instrumentType, name, pageNum, pageSize);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -57,10 +57,13 @@ public class SecondHandApi {
|
|
* @param productId 商品表的商品Id
|
|
* @param productId 商品表的商品Id
|
|
*/
|
|
*/
|
|
@ApiOperation("二手商品详情(旧:/product/getSecondHandProductDetail)")
|
|
@ApiOperation("二手商品详情(旧:/product/getSecondHandProductDetail)")
|
|
- @ApiImplicitParam(required = true, name = "productId", value = "商品Id")
|
|
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(required = true, name = "userId", value = "机构用户id"),
|
|
|
|
+ @ApiImplicitParam(required = true, name = "productId", value = "商品Id")
|
|
|
|
+ })
|
|
@GetMapping("detail")
|
|
@GetMapping("detail")
|
|
- public ResponseJson<SecondDetailVo> getSecondDetail(Integer productId) {
|
|
|
|
- return secondHandService.getSecondHandDetail(productId);
|
|
|
|
|
|
+ public ResponseJson<SecondDetailVo> getSecondDetail(Integer userId, Integer productId) {
|
|
|
|
+ return secondHandService.getSecondHandDetail(userId, productId);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -94,7 +97,7 @@ public class SecondHandApi {
|
|
@ApiOperation("发布二手商品(旧:/product/releaseSecondHandProduct)")
|
|
@ApiOperation("发布二手商品(旧:/product/releaseSecondHandProduct)")
|
|
@Idempotent(prefix = "idempotent_secondhand", keys = {"#secondDto"}, expire = 5)
|
|
@Idempotent(prefix = "idempotent_secondhand", keys = {"#secondDto"}, expire = 5)
|
|
@PostMapping("/release")
|
|
@PostMapping("/release")
|
|
- public ResponseJson releaseSecondHand(SecondDto secondDto, @RequestHeader HttpHeaders headers){
|
|
|
|
|
|
+ public ResponseJson releaseSecondHand(SecondDto secondDto, @RequestHeader HttpHeaders headers) {
|
|
return secondHandService.releaseSecondHand(secondDto, headers);
|
|
return secondHandService.releaseSecondHand(secondDto, headers);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -107,16 +110,16 @@ public class SecondHandApi {
|
|
*/
|
|
*/
|
|
@ApiOperation("二手下单页面商品(旧:/product/getOrderSecondHandProductList)")
|
|
@ApiOperation("二手下单页面商品(旧:/product/getOrderSecondHandProductList)")
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
- @ApiImplicitParam(required = false, name = "searchKeyword", value = "二手商品搜索关键词"),
|
|
|
|
- @ApiImplicitParam(required = false, name = "secondHandType", value = "二手商品分类,1二手仪器,2临期产品,3其他"),
|
|
|
|
- @ApiImplicitParam(required = false, name = "instrumentType", value = "二手仪器分类的类型,1轻光电、2重光电、3耗材配件"),
|
|
|
|
- @ApiImplicitParam(required = false, name = "pageNum", value = "页码"),
|
|
|
|
- @ApiImplicitParam(required = false, name = "pageSize", value = "每页数量")
|
|
|
|
|
|
+ @ApiImplicitParam(required = false, name = "searchKeyword", value = "二手商品搜索关键词"),
|
|
|
|
+ @ApiImplicitParam(required = false, name = "secondHandType", value = "二手商品分类,1二手仪器,2临期产品,3其他"),
|
|
|
|
+ @ApiImplicitParam(required = false, name = "instrumentType", value = "二手仪器分类的类型,1轻光电、2重光电、3耗材配件"),
|
|
|
|
+ @ApiImplicitParam(required = false, name = "pageNum", value = "页码"),
|
|
|
|
+ @ApiImplicitParam(required = false, name = "pageSize", value = "每页数量")
|
|
})
|
|
})
|
|
@GetMapping("order/products")
|
|
@GetMapping("order/products")
|
|
public ResponseJson<PaginationVo<SecondListVo>> getOrderPageSecondList(String searchKeyword, Integer secondHandType, Integer instrumentType,
|
|
public ResponseJson<PaginationVo<SecondListVo>> getOrderPageSecondList(String searchKeyword, Integer secondHandType, Integer instrumentType,
|
|
- @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
|
|
- @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
|
|
|
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
|
|
+ @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
|
|
return secondHandService.getOrderPageSecondList(searchKeyword, secondHandType, instrumentType, pageNum, pageSize);
|
|
return secondHandService.getOrderPageSecondList(searchKeyword, secondHandType, instrumentType, pageNum, pageSize);
|
|
}
|
|
}
|
|
|
|
|