StudentController.java
2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.dto.student.LoginDTO;
import com.meishu.model.StudentDO;
import com.meishu.service.StudentService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 学生表 前端控制器
* </p>
*
* @author Tuyp
* @since 2023-07-11
*/
@RestController
@Api(tags = "学生表")
@RequestMapping("/student")
public class StudentController {
@Autowired
private StudentService studentService;
@PostMapping("login")
@ApiOperation("登录 idCard examCode ")
public ResponseVO login(@RequestBody LoginDTO loginDTO)throws Exception{
return ResponseData.generateCreatedResponse(0,studentService.login(loginDTO));
}
@PostMapping("students")
@ApiOperation("查看学生 userName")
public ResponseVO students(@RequestBody StudentDO studentDO){
return ResponseData.generateCreatedResponse(0,studentService.students(studentDO));
}
@PostMapping("deleteStudent")
@ApiOperation("删除学生 id ")
public ResponseVO deleteStudent(@RequestBody StudentDO studentDO){
return ResponseData.generateCreatedResponse(0,studentService.deleteStudent(studentDO));
}
@PostMapping("updateStudent")
@ApiOperation("编辑学生 id userName idCard companyName")
public ResponseVO updateStudent(@RequestBody StudentDO studentDO){
return ResponseData.generateCreatedResponse(0,studentService.updateStudent(studentDO));
}
@PostMapping("addStudent")
@ApiOperation("添加学生 userName idCard companyName")
public ResponseVO addStudent(@RequestBody StudentDO studentDO){
return ResponseData.generateCreatedResponse(0,studentService.addStudent(studentDO));
}
}