package com.sckw.example.controller;

import com.sckw.payment.api.dubbo.PayCenterDubboService;
import com.sckw.payment.api.model.constant.ChannelEnum;
import com.sckw.payment.api.model.dto.MemberDetail;
import com.sckw.payment.api.model.dto.WalletDto;
import com.sckw.payment.api.model.dto.common.R;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/test")
public class TestController {
    @DubboReference(version = "2.0.0", group = "design", check = false)
    private PayCenterDubboService payCenterDubboService;

    @GetMapping("/detail")
    public R<MemberDetail> download(@RequestParam("uid") Long uid, String channel) {
        return payCenterDubboService.memberDetail(uid, ChannelEnum.HF);
    }

    @GetMapping("/wall")
    public R<List<WalletDto>> wall(@RequestParam("uid") Long uid, String channel, Long filter) {
        return payCenterDubboService.wallet(uid, null, filter);
    }

}
