|
@@ -9,15 +9,13 @@ import com.zhongshu.reward.server.core.domain.WalletReceipts;
|
|
|
import com.zhongshu.reward.server.core.service.Impl.InviteRecordFeignServiceImpl;
|
|
|
import com.zhongshu.reward.server.core.service.WalletReceiptsService;
|
|
|
import com.zhongshu.reward.server.core.util.DateUtils;
|
|
|
-import com.zhongshu.vip.client.model.param.VipUserParam;
|
|
|
-import com.zswl.cloud.bdb.client.vo.InviteReceiptsRoleVo;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.apache.commons.lang3.ObjectUtils;
|
|
|
-import org.springframework.beans.BeanUtils;
|
|
|
+
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
+import redis.clients.jedis.Jedis;
|
|
|
|
|
|
import java.time.LocalDate;
|
|
|
import java.util.Calendar;
|
|
@@ -126,8 +124,34 @@ public class TestController {
|
|
|
|
|
|
@ApiOperation("生成持续订购返利")
|
|
|
@PostMapping("autoReceipts")
|
|
|
- public Object autoReceipts(){
|
|
|
- walletReceiptsService.autoReceipts();
|
|
|
+ public Object autoReceipts(@RequestParam("month") Integer month){
|
|
|
+
|
|
|
+ walletReceiptsService.testAutoReceipts(month);
|
|
|
return ResultContent.buildSuccess();
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+// @PostMapping("testLock")
|
|
|
+// public void testLock(){
|
|
|
+// boolean lock = jedisUtil.lock("user_1001", 1000);
|
|
|
+//// RedisDistributedLock lock = new RedisDistributedLock(jedis, "user_1001", 1000);
|
|
|
+//
|
|
|
+// try {
|
|
|
+// if (lock) {
|
|
|
+// // 执行业务逻辑
|
|
|
+// System.out.println("执行业务逻辑...");
|
|
|
+// // 模拟耗时操作
|
|
|
+// Thread.sleep(2000);
|
|
|
+// } else {
|
|
|
+// System.out.println("未获取到锁,其他实例可能正在操作...");
|
|
|
+// }
|
|
|
+// } catch (InterruptedException e) {
|
|
|
+// e.printStackTrace();
|
|
|
+// } finally {
|
|
|
+// jedisUtil.unlock("user_1001");
|
|
|
+//// jedisUtil.del()
|
|
|
+// }
|
|
|
+// }
|
|
|
}
|