package org.springblade.modules.signinrecords.controller;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiParam;
|
import lombok.AllArgsConstructor;
|
import org.springblade.core.mp.support.Condition;
|
import org.springblade.core.mp.support.Query;
|
import org.springblade.core.tool.api.R;
|
import org.springblade.core.tool.utils.Func;
|
import org.springblade.modules.signinrecords.entity.SignInRecords;
|
import org.springblade.modules.signinrecords.service.SignInRecordsService;
|
import org.springblade.modules.signinrecords.vo.SignInRecordsVo;
|
import org.springframework.web.bind.annotation.*;
|
|
/**
|
* @author zhongrj
|
* @time 2021-12-09
|
* @desc 考试签到记录控制层
|
*/
|
@RestController
|
@AllArgsConstructor
|
@RequestMapping("/signInRecords")
|
public class SignInRecordsController {
|
|
private final SignInRecordsService signInRecordsService;
|
|
|
/**
|
* 自定义分页
|
* @param query page,size
|
* @param signInRecords 考试签到记录信息对象
|
*/
|
@GetMapping("/page")
|
public R<IPage<SignInRecordsVo>> page(SignInRecordsVo signInRecords, Query query) {
|
IPage<SignInRecordsVo> pages = signInRecordsService.selectSignInRecordsPage(Condition.getPage(query), signInRecords);
|
return R.data(pages);
|
}
|
|
/**
|
* 新增
|
* @param signInRecords 考试签到记录信息对象
|
*/
|
@PostMapping("/save")
|
@ApiOperation(value = "新增", notes = "传入signInRecords")
|
public R save(@RequestBody SignInRecords signInRecords){
|
return R.data(signInRecordsService.save(signInRecords));
|
}
|
|
|
/**
|
* 修改
|
* @param signInRecords 考试签到记录信息对象
|
*/
|
@PostMapping("/update")
|
public R update(@RequestBody SignInRecords signInRecords){
|
return R.status(signInRecordsService.updateById(signInRecords));
|
}
|
|
/**
|
* 新增或修改
|
* @param signInRecords 考试签到记录信息对象
|
*/
|
@PostMapping("/submit")
|
public R submit(@RequestBody SignInRecords signInRecords){
|
return R.data(signInRecordsService.saveOrUpdate(signInRecords));
|
}
|
|
/**
|
* 删除
|
* @param ids 考试签到记录信息ids 数组
|
*/
|
@PostMapping("/remove")
|
public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
|
return R.status(signInRecordsService.removeByIds(Func.toLongList(ids)));
|
}
|
|
/**
|
* 详情
|
* @param signInRecords 考试签到记录信息对象
|
*/
|
@GetMapping("/detail")
|
@ApiOperation(value = "详情", notes = "传入signInRecords")
|
public R<SignInRecords> detail(SignInRecords signInRecords) {
|
SignInRecords detail = signInRecordsService.getOne(Condition.getQueryWrapper(signInRecords));
|
return R.data(detail);
|
}
|
|
}
|