package com.ywt.alipaympapi.controller;

import com.alibaba.fastjson.JSON;
import com.ywt.model.ResponseVO;
import com.ywt.request.OrderReminderQueryRequest;
import com.ywt.response.OrderReminderResponse;
import com.ywt.alipaympapi.service.IOrderReminderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Desc
 */
@RestController
@Slf4j
public class OrderRemindController {

    @Autowired
    private IOrderReminderService orderReminderService;

    /**
     * 首页消息提醒
     *
     * @param request
     * @return
     */
    @PostMapping("miniProRequest.order.remind")
    public ResponseVO<OrderReminderResponse> userIndexReminderInfo(OrderReminderQueryRequest request) {
        log.info("request:{}", JSON.toJSONString(request));
        return ResponseVO.success(orderReminderService.userIndexReminderInfo(request.getAppId(), request.getUserId()));
    }
    /**
     * 首页消息提醒列表
     *
     * @param request
     * @return
     */
    @PostMapping("miniProRequest.order.remindList")
    public ResponseVO<List<OrderReminderResponse>> userIndexReminderInfoList(OrderReminderQueryRequest request) {
        log.info("request:{}", JSON.toJSONString(request));
        return ResponseVO.success(orderReminderService.userIndexReminderInfoList(request.getAppId(), request.getUserId()));
    }
}
