package com.sqx.modules.member.controller.app;

import com.sqx.common.utils.Result;
import com.sqx.modules.app.annotation.Login;
import com.sqx.modules.member.dto.SpecialFavorStudentVerifyDTO;
import com.sqx.modules.member.service.SpecialFavorStudentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@Api(tags = "特殊照顾学生")
@RestController
@RequestMapping("app/special-favor-student")
@RequiredArgsConstructor
public class AppSpecialFavorStudentController {
    
    private final SpecialFavorStudentService specialFavorStudentService;

    @Login
    @ApiOperation("特殊照顾学生认证审核")
    @PostMapping("verify")
    public Result verify(@RequestBody @Valid SpecialFavorStudentVerifyDTO dto, @RequestAttribute("userId") Long userId) {
        specialFavorStudentService.verify(userId, dto);
        return Result.success();
    }
}
