package com.usky.iot.controller.web;


import com.usky.common.core.bean.ApiResult;
import com.usky.common.core.bean.CommonPage;
import com.usky.iot.domain.CrmCustomRemind;
import com.usky.iot.service.CrmCustomRemindService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

/**
 * <p>
 * 客户提醒信息表 前端控制器
 * </p>
 *
 * @author han
 * @since 2023-06-27
 */
@RestController
@RequestMapping("/crmCustomRemind")
public class CrmCustomRemindController {

    @Autowired
    private CrmCustomRemindService crmCustomRemindService;

    /**
     * 发送
     * @param crmCustomRemind
     * @return
     */
    @PostMapping
    public ApiResult<Void> add(@RequestBody CrmCustomRemind crmCustomRemind){
        crmCustomRemindService.add(crmCustomRemind);
        return ApiResult.success();
    }

    /**
     * 分页
     * @param current
     * @param size
     * @return
     */
    @GetMapping("/page")
    public ApiResult<CommonPage<CrmCustomRemind>> page(@RequestParam(value = "current", required = false, defaultValue = "1") Integer current,
                                                       @RequestParam(value = "size", required = false, defaultValue = "10") Integer size,
                                                       @RequestParam(value = "customId") Integer customId){
        return ApiResult.success(crmCustomRemindService.page(current,size,customId));
    }

}

