Merge remote-tracking branch 'origin/weiran'

dev2
WeiRan 2024-09-03 15:37:45 +08:00
commit c64db627a0
4 changed files with 36 additions and 5 deletions

View File

@ -40,5 +40,35 @@ public class UserProductCount {
*/ */
private Integer testCount; private Integer testCount;
public Integer getTestId() {
return testId;
}
public void setTestId(Integer testId) {
this.testId = testId;
}
public long getUserId() {
return userId;
}
public void setUserId(long userId) {
this.userId = userId;
}
public Integer getProductId() {
return productId;
}
public void setProductId(Integer productId) {
this.productId = productId;
}
public Integer getTestCount() {
return testCount;
}
public void setTestCount(Integer testCount) {
this.testCount = testCount;
}
} }

View File

@ -55,6 +55,7 @@ public class ProducttestController {
@Operation(summary = "测试次数-1",description = "测试次数-1") @Operation(summary = "测试次数-1",description = "测试次数-1")
public void reducetestcount(@Validated @RequestBody UserProductCount userProductCount){ public void reducetestcount(@Validated @RequestBody UserProductCount userProductCount){
Integer reducetestcount = producttestService.reducetestcount(userProductCount); Integer reducetestcount = producttestService.reducetestcount(userProductCount);
} }

View File

@ -36,10 +36,10 @@ public class ProducttestServiceImpl extends ServiceImpl<ProducttestMapper, UserP
*/ */
@Override @Override
public UserProductCount findcount(UserProductCount userProductCount, HttpServletRequest request) { public UserProductCount findcount(UserProductCount userProductCount, HttpServletRequest request) {
String token = SecurityUtils.getToken();// 获取当前Token // String token = SecurityUtils.getToken();// 获取当前Token
LoginUser loginUser = tokenService.getLoginUser(token); // 获取当前登录用户 // LoginUser loginUser = tokenService.getLoginUser(token); // 获取当前登录用户
Long userid = loginUser.getUserid(); // Long userid = loginUser.getUserid();
userProductCount.setUserId(userid); // userProductCount.setUserId(userid);
return producttestMapper.findcount(userProductCount); return producttestMapper.findcount(userProductCount);
} }

View File

@ -16,7 +16,7 @@
left join product on user_product_count.product_id=product.product_id left join product on user_product_count.product_id=product.product_id
<where> <where>
and user_product_count.user_id=#{userId} and user_product_count.user_id=#{userId}
<if test="product_id!=null and product_id!=''"> <if test="productId!=null">
and user_product_count.product_id=#{productId} and user_product_count.product_id=#{productId}
</if> </if>
</where> </where>