package com.sptg.permissions.biz.controller;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.permissions.api.entity.SmsRecords;
import com.sptg.permissions.api.feigns.SmsFeign;
import com.sptg.permissions.biz.service.SmsServiceInterface;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * title: SmsController
 * package: com.sptg.permissions.biz.controller
 * description: 短信 控制器
 *
 *
 *
 */

@RestController
public class SmsController implements SmsFeign {

    private final SmsServiceInterface smsServiceInterface;

    @Autowired
    public SmsController(SmsServiceInterface smsServiceInterface) {
        this.smsServiceInterface = smsServiceInterface;
    }

    @Override
    @PostMapping(value = "/sms/pagingByCondition")
    public ResultBean<Page<SmsRecords>> pagingByCondition(@RequestBody SmsRecords smsRecords){
        return this.smsServiceInterface.pagingByCondition(smsRecords);
    }

    @Override
    @PostMapping(value = "/sms/insert")
    public ResultBean<Boolean> insertSms(@RequestBody SmsRecords smsRecords){
        return this.smsServiceInterface.insertSms(smsRecords);
    }
}
