package com.bonus.canteen.core.pay.common.controller;

import com.bonus.canteen.core.pay.common.constants.PayChannelEnum;
import com.bonus.canteen.core.pay.common.constants.PayTypeEnum;
import com.bonus.common.core.web.domain.AjaxResult;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping({"/api/v2/pay"})
public class PayController {
   private static final Logger log = LoggerFactory.getLogger(PayController.class);

   @GetMapping({"/all/type"})
//   @RequiresGuest
   @ApiOperation("获取所有支付方式")
   public AjaxResult getPayTypeEnumList() {
      List<Map<String, Object>> allEnumsList = PayTypeEnum.getAllEnumsList();
      return AjaxResult.success(allEnumsList);
   }

   @GetMapping({"/all/channel"})
   @ApiOperation("获取所有支付渠道")
   public AjaxResult getPayChannelEnumList() {
      List<Map<String, Object>> allEnumsList = PayChannelEnum.getAllEnumsList();
      return AjaxResult.success(allEnumsList);
   }
}
