/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ifish.controller;

import com.ifish.bean.PageResult;
import com.ifish.bean.Tbl_Push_List;
import com.ifish.enums.ResultEnum;
import com.ifish.helper.PushMessageHelperI;
import com.ifish.util.IfishUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @author Administrator
 */
@RestController
@RequestMapping("/push")
public class PushMessage {

    @Autowired
    private PushMessageHelperI pushMessageHelperI;

    /**
     * 获取推送消息列表
     *
     * @param pushId
     * @param userId
     * @param firstResult
     * @param pageSize
     * @return
     */
    @RequestMapping(value = "/getPushList", method = RequestMethod.GET)
    public Object pushListInf(String pushType, Integer userId, Integer firstResult, Integer pageSize) {

        try {
            return pushMessageHelperI.getPushList(pushType, userId, firstResult, pageSize);
        } catch (Exception e) {
            return IfishUtil.returnJson(ResultEnum.fail101.getKey(), "");
        }
    }

    /**
     * 删除推送消息
     *
     * @param userId
     * @param pushId
     * @return
     */
    @RequestMapping(value = "/deletePushList", method = RequestMethod.GET)
    public Object deletePushList(Integer userId, Integer pushId) {

        try {
            return pushMessageHelperI.deletePushList(userId, pushId);
        } catch (Exception e) {
            return IfishUtil.returnJson(ResultEnum.fail101.getKey(), "");
        }
    }

}
