package com.zhongshu.card.server.core.controller.pay.senseless;

import com.github.microservice.auth.security.annotations.ResourceAuth;
import com.github.microservice.auth.security.type.AuthType;
import com.zhongshu.card.client.model.pay.UnionApplySignParam;
import com.zhongshu.card.server.core.service.pay.ChinaumsSenselessPayService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("senselessPay/chinaums")
@Tag(name = "银联无感支付", description = "银联无感支付接口")
public class ChinaumsSenselessPayController {

    @Autowired
    private ChinaumsSenselessPayService chinaumsSenselessPayService;


    @Operation(summary = "签约申请", description = "签约申请")
    @RequestMapping(value = "signApply", method = RequestMethod.POST)
    @ResourceAuth(value = "user", type = AuthType.User)
    public Object signApply(@RequestBody UnionApplySignParam param){
        return chinaumsSenselessPayService.signApply(param);
    }

    @Operation(summary = "解约", description = "解约")
    @RequestMapping(value = "signCancel", method = RequestMethod.GET)
    @ResourceAuth(value = "user", type = AuthType.User)
    public Object signCancel(){
        return chinaumsSenselessPayService.signCancel(null, null);
    }

    @Operation(summary = "查询用户签约信息", description = "查询用户签约信息")
    @RequestMapping(value = "queryUserSignInfo", method = RequestMethod.GET)
    @ResourceAuth(value = "user", type = AuthType.User)
    public Object queryUserSignInfo(){
        return chinaumsSenselessPayService.queryUserSignInfo(null, null);
    }

}
