修复BUG
parent
17ff72aad9
commit
49495ba8ce
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.cloud.market.controller;
|
||||
|
||||
import com.dtflys.forest.annotation.Get;
|
||||
import com.muyu.cloud.market.domin.Product;
|
||||
import com.muyu.cloud.market.domin.req.ProductAddReq;
|
||||
import com.muyu.cloud.market.domin.req.ProductListReq;
|
||||
|
@ -162,4 +163,12 @@ public class ProductApiController {
|
|||
Integer iftest = productApiService.iftest(product);
|
||||
return Result.success(iftest);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/showByproductId/{productId}")
|
||||
@Operation(summary = "根据productId进行回显")
|
||||
Product showByproductId(@RequestParam("productId") Integer productId){
|
||||
Product product = productApiService.showByproductId(productId);
|
||||
return product;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,6 +44,8 @@ public interface ProductApiMapper extends BaseMapper<Product> {
|
|||
|
||||
Integer iftest(Product product);
|
||||
|
||||
//表的回显
|
||||
Product showByproductId(Integer productId);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -64,4 +64,13 @@ public interface ProductApiService extends IService<Product> {
|
|||
判断测试次数
|
||||
*/
|
||||
Integer iftest(Product product);
|
||||
|
||||
|
||||
/**
|
||||
* 回显
|
||||
* @param productId
|
||||
* @return
|
||||
*/
|
||||
Product showByproductId(Integer productId);
|
||||
|
||||
}
|
||||
|
|
|
@ -131,5 +131,11 @@ public class ProductApiServiceImpl extends ServiceImpl<ProductApiMapper, Product
|
|||
return iftest;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Product showByproductId(Integer productId) {
|
||||
Product product = productApiMapper.showByproductId(productId);
|
||||
return product;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -25,6 +25,14 @@
|
|||
SELECT product.user_count from product where product_id =#{productId}
|
||||
</select>
|
||||
|
||||
<select id="showByproductId" resultType="com.muyu.cloud.market.domin.Product">
|
||||
SELECT `product`.product_id,
|
||||
`product`.product_name
|
||||
FROM `product`
|
||||
WHERE
|
||||
`product`.product_id = #{productId}
|
||||
</select>
|
||||
|
||||
<update id="reducetestcount">
|
||||
update product set user_count=user_count-1 where product_id=#{productId}
|
||||
</update>
|
||||
|
|
Loading…
Reference in New Issue