AccessTokenController.java 1.38 KB
package com.meishu.controller;


import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.dto.token.GetAllStudentsDTO;
import com.meishu.dto.token.GetAllTeachersDTO;
import com.meishu.model.AdministerDO;
import com.meishu.model.UserRoleDO;
import com.meishu.service.AccessTokenService;
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 2021-05-10
 */
@RestController
@Api(tags = "公共接口")
@RequestMapping("/public")
public class AccessTokenController {

    @Autowired
    private AccessTokenService accessTokenService;

    @PostMapping("getAllTeachers")
    public ResponseVO getAllTeachers(@RequestBody GetAllTeachersDTO getAllTeachersDTO){
        return ResponseData.generateCreatedResponse(0,accessTokenService.getAllTeachers(getAllTeachersDTO));
    }

    @PostMapping("getAllStudents")
    public ResponseVO getAllStudents(@RequestBody GetAllStudentsDTO getAllStudentsDTO){
        return ResponseData.generateCreatedResponse(0,accessTokenService.getAllStudents(getAllStudentsDTO));
    }

}