You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
98 lines
3.0 KiB
98 lines
3.0 KiB
package com.teaching.backend.controller.umsAdmin; |
|
|
|
import com.teaching.backend.common.BaseResponse; |
|
import com.teaching.backend.common.CommonResult; |
|
import com.teaching.backend.model.dto.umsAdmin.UmsStudentPageQueryDTO; |
|
import com.teaching.backend.model.entity.umsAdmin.UmsStudentManage; |
|
import com.teaching.backend.service.umsAdmin.UmsStudentManageService; |
|
import io.swagger.annotations.Api; |
|
import io.swagger.annotations.ApiOperation; |
|
import lombok.extern.slf4j.Slf4j; |
|
import org.springframework.beans.factory.annotation.Autowired; |
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import java.util.ArrayList; |
|
import java.util.List; |
|
import java.util.Map; |
|
|
|
@RestController |
|
@Api(tags = "学生管理") |
|
@RequestMapping("/api/studentManage") |
|
@Slf4j |
|
public class UmsStudentManageController { |
|
|
|
@Autowired |
|
private UmsStudentManageService umsStudentManageService; |
|
|
|
/** |
|
* 学生管理分页查询 |
|
* @param umsStudentPageQueryDTO |
|
* @return |
|
*/ |
|
@GetMapping("/page") |
|
@ApiOperation("学生管理分页查询") |
|
public CommonResult<Map<String, Object>> page(UmsStudentPageQueryDTO umsStudentPageQueryDTO){ |
|
Map<String, Object> pageResult = umsStudentManageService.pageQuery(umsStudentPageQueryDTO); |
|
return CommonResult.success(pageResult); |
|
} |
|
|
|
/** |
|
* 启用禁用学生账号 |
|
* @param status |
|
* @param id |
|
* @return |
|
*/ |
|
@PostMapping("/status/{status}") |
|
@ApiOperation("启用禁用员工账号") |
|
public CommonResult startOrStop(@PathVariable String status, Long id){ |
|
umsStudentManageService.startOrStop(status,id); |
|
return CommonResult.success("修改成功"); |
|
} |
|
|
|
/** |
|
* 根据id查询学生信息 |
|
* @param id |
|
* @return |
|
*/ |
|
@GetMapping("/{id}") |
|
@ApiOperation("根据id查询学生信息") |
|
public CommonResult<UmsStudentManage> getById(@PathVariable Long id){ |
|
UmsStudentManage umsStudentManage = umsStudentManageService.getByIdStudentAndUser(id); |
|
return CommonResult.success(umsStudentManage); |
|
} |
|
|
|
/** |
|
* 编辑学生信息 |
|
* @param umsStudentManage |
|
* @return |
|
*/ |
|
@PutMapping |
|
@ApiOperation("编辑学生信息") |
|
public CommonResult update(@RequestBody UmsStudentManage umsStudentManage){ |
|
umsStudentManageService.updateStudentAndUser(umsStudentManage); |
|
return CommonResult.success("修改成功"); |
|
} |
|
|
|
/** |
|
* 根据ids批量删除 |
|
* @param ids |
|
* @return |
|
*/ |
|
@ApiOperation("学生信息批量删除") |
|
@DeleteMapping("/batchDelete") |
|
public CommonResult<String> batchDelete(@RequestParam List<Long> ids){ |
|
return umsStudentManageService.batchRemove(ids); |
|
} |
|
|
|
/** |
|
* 根据ids初始密码 |
|
* @param ids |
|
* @return |
|
*/ |
|
@ApiOperation("学生信息批量初始密码") |
|
@PutMapping("/initialPassword") |
|
public CommonResult<String> initialPassword(@RequestParam List<Long> ids){ |
|
return umsStudentManageService.initialPassword(ids); |
|
} |
|
|
|
}
|
|
|