“djh”
5 天以前 7acaebcb01438578ded72491f39105db893982ef
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
package com.gkhy.exam.admin.controller.app;
 
 
import com.gkhy.exam.common.api.CommonResult;
import com.gkhy.exam.system.domain.ExStudent;
import com.gkhy.exam.system.service.ExStudentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
 
/**
 * <p>
 * 学员前端控制器
 * </p>
 *
 * @author kzy
 * @since 2024-06-06 13:53:17
 */
@Api(tags = "APP学员前端控制器")
@RestController
@RequestMapping("/app/student")
public class AppStudentController {
    @Autowired
    private ExStudentService studentService;
 
    @PreAuthorize("hasAnyAuthority('train:exam:student')")
    @ApiOperation(value = "根据id获取学员信息")
    @GetMapping(value = { "/{studentId}" })
    public CommonResult getStudentInfo(@PathVariable(value = "studentId", required = true) Long studentId)
    {
        return CommonResult.success(studentService.selectStudentById(studentId));
    }
 
    @PreAuthorize("hasAnyAuthority('train:exam:student')")
    @ApiOperation(value = "重置密码")
    @PutMapping(value = "/resetPwd")
    public CommonResult restPwd(@RequestBody ExStudent student){
        studentService.resetUserPwd(student);
        return CommonResult.success();
    }
}