kongzy
2024-07-05 14821e28286d773ad5ff2c13510e39c5eb117daf
exam-admin/src/main/java/com/gkhy/exam/admin/web/ExStudentController.java
@@ -2,6 +2,7 @@
import com.gkhy.exam.common.annotation.Log;
import com.gkhy.exam.common.annotation.RepeatSubmit;
import com.gkhy.exam.common.api.CommonResult;
import com.gkhy.exam.common.enums.BusinessType;
import com.gkhy.exam.system.domain.ExStudent;
@@ -11,7 +12,6 @@
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -48,6 +48,7 @@
        return CommonResult.success(studentService.selectStudentById(studentId));
    }
    @RepeatSubmit
    @Log(title = "学员管理", businessType = BusinessType.INSERT)
    @ApiOperation(value = "新增学员")
    @PostMapping
@@ -55,20 +56,23 @@
        return CommonResult.success(studentService.insertStudent(student));
    }
    @RepeatSubmit
    @Log(title = "学员管理", businessType = BusinessType.UPDATE)
    @ApiOperation(value = "编辑学员")
    @PutMapping
    public CommonResult edit(@Validated @RequestBody ExStudent student){
    public CommonResult edit(@RequestBody ExStudent student){
        return CommonResult.success(studentService.updateStudent(student));
    }
    @Log(title = "学员管理", businessType = BusinessType.UPDATE)
    @RepeatSubmit
    @Log(title = "学员管理", businessType = BusinessType.DELETE)
    @ApiOperation(value = "删除学员")
    @DeleteMapping(value = { "/{studentId}" })
    public CommonResult delete(@PathVariable(value = "studentId", required = true) Long studentId){
        return CommonResult.success(studentService.deleteStudentById(studentId));
    }
    @RepeatSubmit
    @Log(title = "学员管理", businessType = BusinessType.UPDATE)
    @ApiOperation(value = "重置密码")
    @PutMapping(value = "/resetPwd")
@@ -77,4 +81,17 @@
        return CommonResult.success();
    }
    @ApiOperation(value = "校验手机号是否唯一")
    @PostMapping(value = "/checkPhoneUnique")
    public CommonResult checkPhoneUnique(@RequestBody ExStudent student){
        return CommonResult.success(studentService.checkPhoneUnique(student));
    }
    @ApiOperation(value = "校验身份证是否为一")
    @PostMapping(value = "/checkIdNoUnique")
    public CommonResult checkIdNoUnique(@RequestBody ExStudent student){
        return CommonResult.success(studentService.checkIdNoUnique(student));
    }
}