package com.ruoyi.cms.controller.app;


import com.ruoyi.cms.service.AppSkillService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.AppSkill;
import com.ruoyi.common.core.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


import java.util.List;


/**
 * 用户技能信息
 *
 * @author 
 * @email 
 * @date 2025-10-21 12:22:09
 */
@RestController
@RequestMapping("/appskill/list")
@Api(tags = "移动端:用户技能")
public class AppSkillController extends BaseController {
    @Autowired
    private AppSkillService appSkillService;

    /**
     * 列表
     */
    @ApiOperation("获取工作经历详细信息")
    @GetMapping("/list")
    public TableDataInfo list(AppSkill appSkill){
        startPage();
        List<AppSkill> list=appSkillService.getList(appSkill);
        return getDataTable(list);
    }


    /**
     * 信息
     */
    @ApiOperation("获取工作经历详细信息")
    @GetMapping(value = "/{id}")
    public AjaxResult info(@PathVariable("id") Long id){
        return success(appSkillService.getAppskillById(id));
    }

    /**
     * 保存
     */
    @ApiOperation("获取工作经历详细信息")
    @PostMapping("/add")
    public AjaxResult save(@RequestBody AppSkill appSkill){
        return toAjax(appSkillService.insertAppskill(appSkill));
    }

    /**
     * 修改
     */
    @ApiOperation("获取工作经历详细信息")
    @PutMapping("/edit")
    public AjaxResult update(@RequestBody AppSkill appSkill){
        return toAjax(appSkillService.updateAppskillById(appSkill));
    }

    /**
     * 删除
     */
    @ApiOperation("获取工作经历详细信息")
    @DeleteMapping("/{id}")
    public AjaxResult delete(@ApiParam("主键id") @PathVariable Long id){
        return toAjax(appSkillService.removeAppskillIds(new Long[]{id}));
    }

}
