修复BUG

master
Aaaaaaaa 2024-09-08 11:34:48 +08:00
parent 17ff72aad9
commit 49495ba8ce
5 changed files with 34 additions and 0 deletions

View File

@ -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;
}
}

View File

@ -44,6 +44,8 @@ public interface ProductApiMapper extends BaseMapper<Product> {
Integer iftest(Product product);
//表的回显
Product showByproductId(Integer productId);
}

View File

@ -64,4 +64,13 @@ public interface ProductApiService extends IService<Product> {
*/
Integer iftest(Product product);
/**
*
* @param productId
* @return
*/
Product showByproductId(Integer productId);
}

View File

@ -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;
}
}

View File

@ -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>