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.StaffOpen;
import com.ics.admin.service.meeting.IStaffOpenService;
import org.wf.jwtp.annotation.RequiresPermissions;

/**
 * 用户和小程序关联 提供者
 *
 * @author ics
 * @date 2024-06-25
 */
@RestController
@RequestMapping("open")
public class StaffOpenController extends BaseController {

    @Autowired
    private IStaffOpenService staffOpenService;

    /**
     * 查询用户和小程序关联
     */
    @GetMapping("get/{id}")
    public StaffOpen get(@PathVariable("id") Long id) {
        return staffOpenService.selectStaffOpenById(id);
    }

    /**
     * 查询用户和小程序关联列表
     */
    @RequiresPermissions("meeting:open:list")
    @GetMapping("list")
    public R list(StaffOpen staffOpen) {
        startPage();
        return result(staffOpenService.selectStaffOpenList(staffOpen));
    }


    /**
     * 新增保存用户和小程序关联
     */
    @RequiresPermissions("meeting:open:add")
    @PostMapping("save")
    public R addSave(@RequestBody StaffOpen staffOpen) {
        return toAjax(staffOpenService.insertStaffOpen(staffOpen));
    }

    /**
     * 修改保存用户和小程序关联
     */
    @RequiresPermissions("meeting:open:edit")
    @PostMapping("update")
    public R editSave(@RequestBody StaffOpen staffOpen) {
        return toAjax(staffOpenService.updateStaffOpen(staffOpen));
    }

    /**
     * 删除用户和小程序关联
     */
    @RequiresPermissions("meeting:open:remove")
    @PostMapping("remove")
    public R remove(String ids) {
        return toAjax(staffOpenService.deleteStaffOpenByIds(ids));
    }

}
