package com.tmerclub.cloud.payment.controller.platform;

import com.tmerclub.cloud.common.response.ServerResponseEntity;
import com.tmerclub.cloud.payment.dto.LockMemberDTO;
import com.tmerclub.cloud.payment.service.AllinpayService;
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.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lanhai
 */
@Tag(name = "通联支付-会员接口(平台端)")
@RestController("platformAllinpayMemberController")
@RequestMapping("/p/allinpay/member")
public class AllinpayMemberController {

    @Autowired
    private AllinpayService allinpayService;

    @Operation(summary = "锁定会员", description = "锁定会员")
    @PutMapping("/lockMember")
    public ServerResponseEntity<Void> lockMember(@RequestBody LockMemberDTO lockMemberDTO) {
        allinpayService.lockMember(lockMemberDTO);
        return ServerResponseEntity.success();
    }

    @Operation(summary = "解锁会员", description = "解锁会员")
    @PutMapping("/unlockMember")
    public ServerResponseEntity<Void> unlockMember(@RequestBody LockMemberDTO lockMemberDTO) {
        allinpayService.unlockMember(lockMemberDTO);
        return ServerResponseEntity.success();
    }
}
