//package com.gree.mall.miniapp.controller.exchange;
//
//import com.baomidou.mybatisplus.core.metadata.IPage;
//import com.gree.mall.miniapp.exception.RemoteServiceException;
//import com.gree.mall.miniapp.helper.ResponseHelper;
//import com.gree.mall.miniapp.logic.user.ExchangeCodeLogic;
//import com.gree.mall.miniapp.plus.entity.GiftExchangeCode;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//import javax.servlet.http.HttpServletRequest;
//import java.math.BigDecimal;
//import java.text.ParseException;
//import java.util.Map;
//
//@Slf4j
//@RestController
//@Api(value = "兑换码API", tags ={"兑换码API"} )
//@RequestMapping(value = "/exchange/code", produces = "application/json; charset=utf-8")
//public class ExchangeCodeController {
//
//    @Autowired
//    ExchangeCodeLogic exchangeCodeLogic;
//
//
//    @GetMapping("/count")
//    @ApiOperation(value = "优惠码统计")
//    public ResponseHelper<Map<String,Object>> upload(
//            HttpServletRequest request
//    ) throws RemoteServiceException {
//        Map<String, Object> map = exchangeCodeLogic.count(request);
//        return ResponseHelper.success(map);
//    }
//
//    @GetMapping("/list")
//    @ApiOperation(value = "优惠码列表")
//    public ResponseHelper<IPage<GiftExchangeCode>> upload(
//            @ApiParam(required = false, value = "1=已使用 0=未使用") @RequestParam(required = false) Integer status,
//            @ApiParam(required = true, value = "pageNo") @RequestParam(required = true) Integer pageNo,
//            @ApiParam(required = true, value = "pageSize") @RequestParam(required = true) Integer pageSize,
//            HttpServletRequest request
//    ) throws RemoteServiceException {
//        IPage<GiftExchangeCode> list = exchangeCodeLogic.list(status, pageNo, pageSize, request);
//        return ResponseHelper.success(list);
//    }
//
//    @PostMapping("/bind")
//    @ApiOperation(value = "生成优惠码")
//    public ResponseHelper bindExchangeCode(
//            @ApiParam(required = true, value = "金额") @RequestParam(required = true)BigDecimal amount,
//            @ApiParam(required = true, value = "天") @RequestParam(required = true)Integer day,
//            HttpServletRequest request
//    ) throws RemoteServiceException, ParseException, InterruptedException {
//        exchangeCodeLogic.bindExchangeCode(amount,day, request);
//        return ResponseHelper.success();
//    }
//
//
//
//
//
//}
