package com.bonus.bracelet.controller;

import com.bonus.bracelet.service.TemporarilyPersonService;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.common.entity.bracelet.BraceletParamsDto;
import com.bonus.common.log.annotation.SysLog;
import com.bonus.common.log.enums.OperaType;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @className:TemporarilyPersonController
 * @author:cwchen
 * @date:2024-09-30-9:23
 * @version:1.0
 * @description:临时人员-controller
 */
@RestController
@RequestMapping("/temporarilyPerson/")
@Slf4j
public class TemporarilyPersonController extends BaseController {

    @Resource(name = "TemporarilyPersonService")
    private TemporarilyPersonService service;

    @GetMapping("list")
    @SysLog(title = "临时人员管理", businessType = OperaType.QUERY, logType = 0, module = "基础管理->临时人员管理", details = "查询临时人员列表")
    public TableDataInfo list(BraceletParamsDto dto) {
        startPage();
        TableDataInfo tableDataInfo = service.getTemporarilyPersons(dto);
        return tableDataInfo;
    }

    @PostMapping("delTemporarilyPerson")
    @SysLog(title = "临时人员管理", businessType = OperaType.DELETE, logType = 0, module = "基础管理->临时人员管理", details = "删除临时人员")
    public AjaxResult delTemporarilyPerson(@RequestBody BraceletParamsDto dto) {
        return service.delTemporarilyPerson(dto);
    }
}
