package com.ghy.web.controller.worker;

import com.ghy.common.core.domain.AjaxResult;
import com.ghy.common.core.text.Convert;
import com.ghy.worker.domain.SpecialSkill;
import com.ghy.worker.service.SpecialSkillService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 特殊技能
 *
 * @author HH 2022/6/7
 */
@Controller
@RequestMapping("special/skill")
public class SpecialSkillController {

    @Resource
    private SpecialSkillService specialSkillService;

    @PostMapping("list")
    @ResponseBody
    public AjaxResult list(@RequestBody SpecialSkill specialSkill) {
        return AjaxResult.success(specialSkillService.list(specialSkill));
    }

    @PostMapping("save")
    @ResponseBody
    public AjaxResult insert(@RequestBody SpecialSkill specialSkill) {
        specialSkillService.insert(specialSkill);
        return AjaxResult.success("保存成功");
    }

    @PutMapping("update")
    @ResponseBody
    public AjaxResult update(@RequestBody SpecialSkill specialSkill) {
        specialSkillService.update(specialSkill);
        return AjaxResult.success("修改成功");
    }

    @DeleteMapping("delete")
    @ResponseBody
    public AjaxResult delete(String ids) {
        specialSkillService.delete(Convert.toLongArray(ids));
        return AjaxResult.success("保存成功");
    }

}


