Authored by mali

并发测试代码

... ... @@ -23,4 +23,6 @@ public interface SellerWalletMapper {
int returnMoney(SellerWallet sw);
SellerWallet selectByUidNType(SellerWallet condition);
void updateMoneyForTest();
}
\ No newline at end of file
... ...
... ... @@ -136,5 +136,9 @@
<update id="returnMoney" parameterType="com.yohoufo.dal.order.model.SellerWallet" >
update seller_wallet set amount = 0 ,status = 0,update_time = #{updateTime,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER} and amount = #{amount,jdbcType=DECIMAL} and status=1
</update>
<update id="updateMoneyForTest">
update seller_wallet set amount = amount + 10 where id = 3
</update>
</mapper>
\ No newline at end of file
... ...
package com.yohoufo.product.controller.test;
import com.yoho.tools.docs.ApiOperation;
import com.yohoufo.common.ApiResponse;
import com.yohoufo.common.annotation.IgnoreSession;
import com.yohoufo.common.annotation.IgnoreSignature;
import com.yohoufo.dal.order.SellerWalletMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* Created by li.ma on 2018/11/21.
*/
@RestController
public class TestSynDbController {
@Autowired
private SellerWalletMapper sellerWalletMapperl;
@ApiOperation(name = "ufo.product.testSynDb", desc="测试")
@IgnoreSignature
@IgnoreSession
@RequestMapping(params = "method=ufo.product.testSynDb")
public ApiResponse testSynDb() {
sellerWalletMapperl.updateMoneyForTest();
return new ApiResponse.ApiResponseBuilder().code(200).message("热搜词列表").build();
}
}
... ...