package cn.axzo.msg.center.inside.notices.controller.pending;

import cn.axzo.msg.center.api.PendingMessageServiceApi;
import cn.axzo.msg.center.api.request.PendingMessagePageReq;
import cn.axzo.msg.center.api.request.PendingMessageTemporarilyStatisticReq;
import cn.axzo.msg.center.api.response.PendingMessageBriefRes;
import cn.axzo.msg.center.api.response.PendingMessageStatisticRes;
import cn.axzo.msg.center.api.response.PendingMessageTemporarilyStatisticRes;
import cn.axzo.msg.center.api.response.PendingMessageTemporarilyTypeRes;
import cn.axzo.msg.center.inside.notices.config.PendingMessageBizConfig;
import cn.axzo.msg.center.inside.notices.service.PendingMessageService;
import cn.azxo.framework.common.model.CommonResponse;
import cn.azxo.framework.common.model.Page;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @description
 *   待办消息的controller
 *   由于需要给二方服务提供SDK，为了防止URL的重复定义，这里选择实现SDK的API接口
 *
 * @author cold_blade
 * @date 2023/8/30
 * @version 1.0
 */
@RestController
public class PendingMessageStatisticController implements PendingMessageServiceApi {

    @Resource
    private PendingMessageService pendingMessageService;

    @Resource
    private PendingMessageBizConfig pendingMessageBizConfig;

    @Override
    public CommonResponse<List<PendingMessageTemporarilyStatisticRes>> temporarilyStatistic(
            PendingMessageTemporarilyStatisticReq request) {
        return CommonResponse.success(pendingMessageService.temporarilyStatistic(request));
    }

    @Override
    public CommonResponse<PendingMessageStatisticRes> temporarilyPage(PendingMessagePageReq request) {
        return CommonResponse.success(pendingMessageService.temporarilyPage(request));
    }

    @Override
    public CommonResponse<List<PendingMessageTemporarilyTypeRes>> listTemporarilyTypes() {
        return CommonResponse.success(pendingMessageService.listTemporarilyTypes());
    }

    @Override
    public CommonResponse<Page<PendingMessageBriefRes>> pageQuery(PendingMessagePageReq request) {
        return CommonResponse.success(pendingMessageService.pageQuery(request));
    }

}
