package com.xunmei.system.controller;

import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.xunmei.common.log.annotation.Log;
import com.xunmei.common.log.enums.BusinessType;
import com.xunmei.common.security.annotation.RequiresPermissions;
import com.xunmei.system.domain.SysWorkTimeSetDayofweek;
import com.xunmei.system.service.ISysWorkTimeSetDayofweekService;
import com.xunmei.common.core.web.controller.BaseController;
import com.xunmei.common.core.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xunmei.common.core.web.page.TableDataInfo;

/**
 * 【请填写功能名称】Controller
 *
 * @author xunmei
 * @date 2023-08-15
 */
@Api(tags = {"SysWorkTimeSetDayofweek"})
@RestController
@RequestMapping("/dayofweek")
public class SysWorkTimeSetDayofweekController extends BaseController {
    @Autowired
    private ISysWorkTimeSetDayofweekService sysWorkTimeSetDayofweekService;

    /**
     * 查询【请填写功能名称】列表
     */
    @ApiOperation(value = "查询SysWorkTimeSetDayofweek列表")
    @RequiresPermissions("system:dayofweek:list")
    @GetMapping("/list")
    public TableDataInfo<SysWorkTimeSetDayofweek> list(SysWorkTimeSetDayofweek sysWorkTimeSetDayofweek) {

        return sysWorkTimeSetDayofweekService.selectPage(sysWorkTimeSetDayofweek);
    }


    /**
     * 获取【请填写功能名称】详细信息
     */
    @ApiOperation(value = "获取SysWorkTimeSetDayofweek详细信息")
    @RequiresPermissions("system:dayofweek:query")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(sysWorkTimeSetDayofweekService.selectSysWorkTimeSetDayofweekById(id));
    }

    /**
     * 新增【请填写功能名称】
     */
    @ApiOperation(value = "新增SysWorkTimeSetDayofweek")
    @RequiresPermissions("system:dayofweek:add")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody SysWorkTimeSetDayofweek sysWorkTimeSetDayofweek) {
        return toAjax(sysWorkTimeSetDayofweekService.insertSysWorkTimeSetDayofweek(sysWorkTimeSetDayofweek));
    }

    /**
     * 修改【请填写功能名称】
     */
    @ApiOperation(value = "修改SysWorkTimeSetDayofweek")
    @RequiresPermissions("system:dayofweek:edit")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody SysWorkTimeSetDayofweek sysWorkTimeSetDayofweek) {
        return toAjax(sysWorkTimeSetDayofweekService.updateSysWorkTimeSetDayofweek(sysWorkTimeSetDayofweek));
    }

    /**
     * 删除【请填写功能名称】
     */
    @ApiOperation(value = "删除SysWorkTimeSetDayofweek")
    @RequiresPermissions("system:dayofweek:remove")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(sysWorkTimeSetDayofweekService.deleteSysWorkTimeSetDayofweekByIds(ids));
    }
}
