package com.yh.saas.plugin.yiliangyiyun.controller;


import com.baomidou.mybatisplus.plugins.Page;
import com.winsea.svc.base.base.entity.CommonCompany;
import com.yh.saas.plugin.yiliangyiyun.entity.OpenServiceInfo;
import com.yh.saas.plugin.yiliangyiyun.service.IOpenServiceInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 开通业务表 前端控制器
 * </p>
 *
 * @author Gdc
 * @since 2021-10-08
 */
@RestController
@RequestMapping("/openServiceInfo")
public class OpenServiceInfoController {
    @Autowired
    private IOpenServiceInfoService iOpenServiceInfoService;
    /**
     * 开通业务列表
     * @param openServiceInfo
     * @return
     */
    @GetMapping("/selectOpenServiceInfo")
    public Page<OpenServiceInfo> selectOpenServiceInfo(OpenServiceInfo openServiceInfo) {
        return iOpenServiceInfoService.selectOpenServiceInfo(openServiceInfo);
    }
    /**
     * 添加
     * @param openServiceInfo
     * @return
     */
    @PostMapping("/api/addInfo")
    public String addInfo(@RequestBody OpenServiceInfo openServiceInfo) {
        return iOpenServiceInfoService.addInfo(openServiceInfo);
    }
    /**
     * 查询当前人的公司
     * @param phone
     * @return
     */
    @GetMapping("/selectCommonCompany")
    public List<CommonCompany> selectCommonCompany(String phone) {
        return iOpenServiceInfoService.selectCommonCompany(phone);
    }
}

