package cn.gistack.sm.exam.controller;
|
|
import java.util.Arrays;
|
|
import cn.gistack.sm.exam.entity.ExamPlanUser;
|
import cn.gistack.sm.exam.service.IExamPlanUserService;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import lombok.AllArgsConstructor;
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
import org.springblade.core.mp.support.Condition;
|
import org.springblade.core.mp.support.Query;
|
import org.springblade.core.tool.api.R;
|
import org.springframework.web.bind.annotation.*;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
|
/**
|
* @Description: 考核名录
|
*/
|
@Slf4j
|
@Api(tags="考核名录")
|
@RestController
|
@RequestMapping("/exam/examPlanUser")
|
@AllArgsConstructor
|
public class ExamPlanUserController extends BladeController {
|
private IExamPlanUserService examPlanUserService;
|
|
/**
|
* 分页列表查询
|
*
|
*/
|
@ApiOperation(value="考核名录-分页列表查询", notes="考核名录-分页列表查询")
|
@GetMapping(value = "/list")
|
public R<?> queryPageList(ExamPlanUser examPlanUser, Query query) {
|
IPage<ExamPlanUser> pageList = examPlanUserService.page(Condition.getPage(query), Condition.getQueryWrapper(examPlanUser));
|
return R.data(pageList);
|
}
|
|
/**
|
* 添加
|
*
|
* @param examPlanUser
|
* @return
|
*/
|
@ApiOperation(value="考核名录-添加", notes="考核名录-添加")
|
@PostMapping(value = "/add")
|
public R<?> add(@RequestBody ExamPlanUser examPlanUser) {
|
return R.data(examPlanUserService.save(examPlanUser));
|
}
|
|
/**
|
* 编辑
|
*
|
* @param examPlanUser
|
* @return
|
*/
|
@ApiOperation(value="考核名录-编辑", notes="考核名录-编辑")
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
public R<?> edit(@RequestBody ExamPlanUser examPlanUser) {
|
return R.data(examPlanUserService.updateById(examPlanUser));
|
}
|
|
/**
|
* 通过id删除
|
*
|
* @param id
|
* @return
|
*/
|
@ApiOperation(value="考核名录-通过id删除", notes="考核名录-通过id删除")
|
@PostMapping(value = "/delete")
|
public R<?> delete(@RequestParam(name="id",required=true) String id) {
|
return R.data(examPlanUserService.removeById(id));
|
}
|
|
/**
|
* 批量删除
|
*
|
* @param ids
|
* @return
|
*/
|
@ApiOperation(value="考核名录-批量删除", notes="考核名录-批量删除")
|
@PostMapping(value = "/deleteBatch")
|
public R<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
return R.data(this.examPlanUserService.removeByIds(Arrays.asList(ids.split(","))));
|
}
|
|
/**
|
* 通过id查询
|
*
|
* @param id
|
* @return
|
*/
|
@ApiOperation(value="考核名录-通过id查询", notes="考核名录-通过id查询")
|
@GetMapping(value = "/queryById")
|
public R<?> queryById(@RequestParam(name="id",required=true) String id) {
|
ExamPlanUser examPlanUser = examPlanUserService.getById(id);
|
return R.data(examPlanUser);
|
}
|
|
}
|