package com.ics.admin.controller.meeting;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ics.common.core.domain.R;
import com.ics.common.core.controller.BaseController;
import com.ics.admin.domain.meeting.StaffCustomer;
import com.ics.admin.service.meeting.IStaffCustomerService;
import org.wf.jwtp.annotation.RequiresPermissions;

/**
 * 用户企业 提供者
 *
 * @author ics
 * @date 2024-04-08
 */
@RestController
@RequestMapping("customer")
public class StaffCustomerController extends BaseController {

    @Autowired
    private IStaffCustomerService staffCustomerService;

    /**
     * 查询用户企业
     */
    @GetMapping("get/{id}")
    public StaffCustomer get(@PathVariable("id") Long id) {
        return staffCustomerService.selectStaffCustomerById(id);
    }

    /**
     * 查询用户企业列表
     */
    @RequiresPermissions("meeting:customer:list")
    @GetMapping("list")
    public R list(StaffCustomer staffCustomer) {
        startPage();
        return result(staffCustomerService.selectStaffCustomerList(staffCustomer));
    }


    /**
     * 新增保存用户企业
     */
    @RequiresPermissions("meeting:customer:add")
    @PostMapping("save")
    public R addSave(@RequestBody StaffCustomer staffCustomer) {
        return toAjax(staffCustomerService.insertStaffCustomer(staffCustomer));
    }

    /**
     * 修改保存用户企业
     */
    @RequiresPermissions("meeting:customer:edit")
    @PostMapping("update")
    public R editSave(@RequestBody StaffCustomer staffCustomer) {
        return toAjax(staffCustomerService.updateStaffCustomer(staffCustomer));
    }

    /**
     * 删除用户企业
     */
    @RequiresPermissions("meeting:customer:remove")
    @PostMapping("remove")
    public R remove(String ids) {
        return toAjax(staffCustomerService.deleteStaffCustomerByIds(ids));
    }

}
