|
@@ -9,6 +9,7 @@ import cn.reghao.tnb.user.app.model.dto.WalletDto;
|
|
|
import cn.reghao.tnb.user.app.model.po.Wallet;
|
|
import cn.reghao.tnb.user.app.model.po.Wallet;
|
|
|
import cn.reghao.tnb.user.app.model.vo.BillRecord;
|
|
import cn.reghao.tnb.user.app.model.vo.BillRecord;
|
|
|
import cn.reghao.tnb.user.app.service.WalletService;
|
|
import cn.reghao.tnb.user.app.service.WalletService;
|
|
|
|
|
+import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.http.MediaType;
|
|
@@ -45,12 +46,17 @@ public class UserWalletController {
|
|
|
@Operation(summary = "获取钱包账单", description = "N")
|
|
@Operation(summary = "获取钱包账单", description = "N")
|
|
|
@AuthUser
|
|
@AuthUser
|
|
|
@GetMapping(value = "/bill", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@GetMapping(value = "/bill", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
|
+ @HystrixCommand(fallbackMethod = "getWalletBillHystrix")
|
|
|
public String getWalletBill() {
|
|
public String getWalletBill() {
|
|
|
long loginUser = UserContext.getUser();
|
|
long loginUser = UserContext.getUser();
|
|
|
List<BillRecord> list = walletService.getWalletBill(loginUser);
|
|
List<BillRecord> list = walletService.getWalletBill(loginUser);
|
|
|
return WebResult.success(list);
|
|
return WebResult.success(list);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public String getWalletBillHystrix(){
|
|
|
|
|
+ return WebResult.failWithMsg("hystrix fallback");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Operation(summary = "向钱包充值", description = "N")
|
|
@Operation(summary = "向钱包充值", description = "N")
|
|
|
@AuthUser
|
|
@AuthUser
|
|
|
@PostMapping("/charge")
|
|
@PostMapping("/charge")
|