Commit 23fcaf9f by 涂亚平

项目修复

1 parent 0c436f31
Showing with 0 additions and 4433 deletions
package com.meishu;
import com.alibaba.druid.support.http.StatViewServlet;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.bind.annotation.RestController;
@RestController
@SpringBootApplication
@MapperScan(basePackages = {"com.meishu.mapper"})
@EnableScheduling
@EnableAsync
public class MeishuApplication {
public static void main(String[] args) {
SpringApplication.run(MeishuApplication.class, args);
}
@Bean
public ServletRegistrationBean druidStatViewServlet() {
//先配置管理后台的servLet,访问的入口为/druid/
ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(
new StatViewServlet(), "/druid/*");
// IP白名单 (没有配置或者为空,则允许所有访问)
servletRegistrationBean.addInitParameter("allow", "127.0.0.1");
// IP黑名单 (存在共同时,deny优先于allow)
servletRegistrationBean.addInitParameter("deny", "");
servletRegistrationBean.addInitParameter("loginUsername", "admin");
servletRegistrationBean.addInitParameter("loginPassword", "yhkl1234");
servletRegistrationBean.addInitParameter("resetEnable", "false");
return servletRegistrationBean;
}
}
package com.meishu.common;
public enum Code {
USERNAMENOTFOUND(10001, "用户不存在"),
BADCREDENTIALS(10002,"账户或者密码错误"),
ACCOUNTEXPIRED(10003,"账户过期"),
LOCKEDEXCEPTION(10004, "账户已锁定"),
DISABLEDEXCEPTION(10005,"账户已禁用"),
ACCESSDENIED(10006,"无权限访问"),
AUTHENTICATION(10007,"身份验证异常"),
NOHANDLERFOUND(10008,"找不到相应的视图处理器"),
PARAM_INVALID(10009, "参数不合法"),
TOKEN_EXCEPTION(10010, "Token不合法"),
TOKEN_EXPIRED(10011, "Token已过期"),
OSS_ERROR(10012, "OSS文件上传异常"),
Network_ERROR(90000, "网络请求失败"),
SERVER_INTERNAL_ERROR(99999, "服务器内部错误"),
;
private Integer code;
private String message;
Code(Integer code, String message) {
this.code = code;
this.message = message;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
package com.meishu.common;
import com.meishu.common.configure.RemoteProperties;
import lombok.Data;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
/**
* 返回数据
*
* @author DengMin
* @date 2019/08/27 13:57
**/
@Data
@EnableConfigurationProperties(RemoteProperties.class)
public class ResponseData {
public static <T> ResponseVO<T> generateCreatedResponse(int code) {
return (ResponseVO<T>) ResponseVO.builder()
.code(code)
.message(RemoteProperties.getMessage(code))
.build();
}
public static <T> ResponseVO<T> generateCreatedResponse(int code, String message) {
return (ResponseVO<T>) ResponseVO.builder()
.code(code)
.message(message)
.build();
}
public static <T> ResponseVO<T> generateCreatedResponse(int code, T data) {
return (ResponseVO<T>) ResponseVO.builder()
.code(code)
.message(RemoteProperties.getMessage(code))
.data(data)
.build();
}
public static <T> ResponseVO<T> generateCreatedResponse(int code, String message, T data) {
return (ResponseVO<T>) ResponseVO.builder()
.code(code)
.message(message)
.data(data)
.build();
}
public static <T> ResponseVO<T> generateCreatedResponse(int code, String message, String path) {
return (ResponseVO<T>) ResponseVO.builder()
.code(code)
.message(message)
.path(path)
.build();
}
}
\ No newline at end of file
package com.meishu.common;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ResponseVO<T> {
private Integer code;
private String message;
private T data;
private String path;
}
\ No newline at end of file
package com.meishu.common.configure;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Data
@Component
@ConfigurationProperties(prefix = "sms")
public class AliyunSmsProperties {
private String product;
private String domain;
private String accessKeyId;
private String accessKeySecret;
}
package com.meishu.common.configure;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.core.config.GlobalConfig;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.meishu.common.handler.MetaHandler;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @author: tuyp
* @create: 2020-08-12 12:01
*/
@Configuration
@ConditionalOnClass(value = {PaginationInterceptor.class})
public class MybatisPlusConfig {
/**
* 分页
* @return
*/
@Bean
public PaginationInterceptor paginationInterceptor(){
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
paginationInterceptor.setDialectType(DbType.MYSQL.getDb());
return paginationInterceptor;
}
//
// /**
// * 打印 sql
// */
// @Bean
// public PerformanceInterceptor performanceInterceptor() {
// PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor();
// //格式化sql语句
// Properties properties = new Properties();
// properties.setProperty("format", "false");
// performanceInterceptor.setProperties(properties);
// return performanceInterceptor;
// }
/**
* 自动填充功能
* @return
*/
@Bean
public GlobalConfig globalConfig() {
GlobalConfig globalConfig = new GlobalConfig();
globalConfig.setMetaObjectHandler(new MetaHandler());
return globalConfig;
}
}
package com.meishu.common.configure;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
/**
* <p>
* 读取状态码
* </p>
*
* @author DengMin
* @date Created in 2020/08/24
*/
@Component
@ConfigurationProperties(prefix = "meishu")
@PropertySource(value = "classpath:code.properties", encoding = "UTF-8")
public class RemoteProperties {
private static Map<Integer, String> codeMessage = new HashMap<>();
public static String getMessage(Integer code) {
return codeMessage.get(code);
}
public Map<Integer, String> getCodeMessage() {
return codeMessage;
}
public void setCodeMessage(Map<Integer, String> codeMessage) {
RemoteProperties.codeMessage = codeMessage;
}
}
\ No newline at end of file
package com.meishu.common.configure;
import org.springframework.context.annotation.Bean;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import java.util.ArrayList;
import java.util.List;
@Component
public class RestTemplateConfig {
@Bean
public RestTemplate restTemplate() {
RestTemplate restTemplate = new RestTemplate();
restTemplate.getMessageConverters().add(new WxMappingJackson2HttpMessageConverter());
return restTemplate;
}
public class WxMappingJackson2HttpMessageConverter extends MappingJackson2HttpMessageConverter {
public WxMappingJackson2HttpMessageConverter(){
List<MediaType> mediaTypes = new ArrayList<>();
mediaTypes.add(MediaType.TEXT_PLAIN);
mediaTypes.add(MediaType.TEXT_HTML);
setSupportedMediaTypes(mediaTypes);
}
}
}
package com.meishu.common.configure;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
.pathMapping("/")
.select()
.apis(RequestHandlerSelectors.basePackage("com.meishu"))
.paths(PathSelectors.any())
.build().apiInfo(new ApiInfoBuilder()
.title("市西cms")
.description("接口文档规范")
.version("1.0")
// .contact(new Contact("啊啊啊啊","www.youkehulian.com","tcp@meishu.com"))
// .license("The Apache License")
// .licenseUrl("http://www.baidu.com")
.build());
}
}
package com.meishu.common.configure;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* @author: tuyp
* @create: 2020-06-01 16:46
*/
@Component
@Data
@ConfigurationProperties(prefix = "vod")
public class VODConfig {
private String appId;
private String secretId;
private String secretKey;
private String api;
private String region;
}
package com.meishu.common.configure;
import com.meishu.common.interceptor.AuthenticationInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* @author DengMin
* @date 2020/07/06
**/
@Configuration
public class WebConfig implements WebMvcConfigurer {
@Autowired
private AuthenticationInterceptor authenticationInterceptor;
/**
* 跨域支持
*
* @param registry
*/
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
// .allowCredentials(true)
.allowedOrigins("*")
.allowedMethods("GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS")
.maxAge(3600);
}
/**
* Swagger
* @param registry
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
}
/**
* 鉴权
* @param registry
*/
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(authenticationInterceptor)
.excludePathPatterns("/static/*")
.addPathPatterns("/**");
}
}
\ No newline at end of file
package com.meishu.common.configure;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
@Aspect
@Component
public class WebLogAspect {
private final Logger logger = LoggerFactory.getLogger(WebLogAspect.class);
@Pointcut("execution(public * com.meishu.controller.*.*(..))")//切入点描述 这个是controller包的切入点
public void controllerLog(){}//签名,可以理解成这个切入点的一个名称
@Pointcut("execution(public * com.meishu.controller.*.*(..))")
public void serviceImplLog(){}
@Before("controllerLog()") //在切入点的方法run之前要干的
public void logBeforeController(JoinPoint joinPoint) {
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
//这个RequestContextHolder是Springmvc提供来获得请求的东西
HttpServletRequest request = ((ServletRequestAttributes)requestAttributes).getRequest();
// 记录下请求内容
logger.info("####requestUrl : " + request.getRequestURL().toString());
logger.info("####requestParam : " + Arrays.toString(joinPoint.getArgs()));
}
// @Around("serviceImplLog()")
// public Object afterController(ProceedingJoinPoint proceedingJoinPoint) {
//
// Object result = null;
//
// try{
// result = proceedingJoinPoint.proceed();
// logger.info("====reulst"+result);
// }catch (Throwable e){
// MyException myException =(MyException)e;
// throw myException;
// }
// return result;
// }
}
\ No newline at end of file
package com.meishu.common.configure;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Data
@Configuration
@ConfigurationProperties(prefix = "wechat")
public class WechatConfig {
private String appId;
private String appSecret;
private String msgUrl;
private String templateId;
private String agentId;
}
package com.meishu.common.constant;
public class AttendanceConstant {
/**
* 创建预约api
*/
public static final String CREATE_TOPIC_URL = "https://open.api.roomis.com.cn/api/my/booking/spaces/{spaceId}/events";
/**
* 考勤api
*/
public static final String GET_ATTENDANCE_URL = "https://open.api.roomis.com.cn/api/attendance/{id}";
/**
* 创建人ID
*/
public static Long organizerId = 200000222L;
/**
* 开始时间
*/
public static String startTime = "07:00:00";
/**
* 结束时间
*/
public static String endTime = "21:00:00";
}
package com.meishu.common.constant;
import lombok.Getter;
@Getter
public enum Code {
USERNAMENOTFOUND(1001, "用户不存在"),
BADCREDENTIALS(1002,"账户或者密码错误"),
ACCOUNTEXPIRED(1003,"账户过期"),
LOCKEDEXCEPTION(1004, "账户已锁定"),
DISABLEDEXCEPTION(1005,"账户已禁用"),
ACCESSDENIED(1006,"无权限访问"),
AUTHENTICATION(1007,"身份验证异常"),
NOHANDLERFOUND(1008,"找不到相应的视图处理器"),
PARAM_INVALID(1009, "参数不合法"),
TOKEN_EXCEPTION(1010, "无效的令牌"),
TOKEN_EXPIRED(1011, "令牌已过期"),
TOKEN_VERIFICATION_FAILED(1013, "令牌验证失败"),
OSS_ERROR(1012, "OSS文件上传异常"),
Network_ERROR(9000, "网络请求失败"),
SERVER_INTERNAL_ERROR(99999, "服务器内部错误"),
;
private Integer code;
private String message;
Code(Integer code, String message) {
this.code = code;
this.message = message;
}
}
package com.meishu.common.constant;
public class WxConstant {
/**
* app id
*/
public static final String APPID = "wx75ec06e9ce50ef73";
/**
* 秘钥
*/
public static final String SECRENT = "c039d32804278503474dfcf7cb3944b9";
/**
* 获取访问用户身份
*/
public static final String GETUSERINFO = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token={access_token}&code={code}";
/**
* 读取成员
*/
public static final String GET = "https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token={access_token}&userid={userid}";
/**
* 获取access_token
*/
public static final String GET_SUITE_TOKEN = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={appid}&secret={secret}";
/**
* 扫码登陆回调地址
*/
public static final String QR_REDIRECT_URL = "http://massadmin.youkehulian.com";
}
package com.meishu.common.exception;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.configure.RemoteProperties;
import com.meishu.common.constant.Code;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.validation.BindException;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.NoHandlerFoundException;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
/**
* 异常处理
* @author DengMin
* @date 2020/07/14
**/
@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {
/**
* 自定义异常
* @param e
* @return
*/
@ExceptionHandler(value = HttpException.class)
public ResponseVO<T> handlerException(HttpServletRequest request, HttpException e) {
String message = RemoteProperties.getMessage(e.getCode());
if(StringUtils.isBlank(message)) {
message = e.getMessage();
}
String url = request.getRequestURI();
return ResponseData.generateCreatedResponse(e.getCode(), message, url);
}
/**
* 404
* @param request
* @return
*/
@ExceptionHandler(value = NoHandlerFoundException.class)
public ResponseVO<T> NoHandlerFoundException(HttpServletRequest request) {
String url = request.getRequestURI();
return ResponseData.generateCreatedResponse(Code.NOHANDLERFOUND.getCode(), Code.NOHANDLERFOUND.getMessage(), url);
}
/**
* 请求方式错误
* @param request
* @return
*/
@ExceptionHandler(value = HttpRequestMethodNotSupportedException.class)
public ResponseVO<T> HttpRequestMethodNotSupportedException(HttpServletRequest request) {
String url = request.getRequestURI();
return ResponseData.generateCreatedResponse(Code.NOHANDLERFOUND.getCode(), Code.NOHANDLERFOUND.getMessage(), url);
}
/**
* 参数不合法
* @param e
* @return
*/
@ExceptionHandler(MethodArgumentNotValidException.class)
public ResponseVO<T> validateException(MethodArgumentNotValidException e){
final List<String> errList = new ArrayList<>();
e.getBindingResult().getAllErrors().stream().forEach(x -> {
errList.add(x.getDefaultMessage());
});
return ResponseData.generateCreatedResponse(Code.PARAM_INVALID.getCode(), Code.PARAM_INVALID.getMessage(), errList.toString());
}
/**
* JSON 序列化异常
* @param e
* @return
*/
@ExceptionHandler(HttpMessageNotReadableException.class)
public ResponseVO<T> exceptionHandler(HttpMessageNotReadableException e) {
log.error(e.getMessage());
return ResponseData.generateCreatedResponse(Code.PARAM_INVALID.getCode(), Code.PARAM_INVALID.getMessage()+":{"+e.getMessage()+"}");
}
/**
* 校验异常
* @param e
* @return
*/
@ExceptionHandler(BindException.class)
public ResponseVO<T> BindException(BindException e){
final List<String> errList = new ArrayList<>();
e.getBindingResult().getAllErrors().stream().forEach(x -> {
errList.add(x.getDefaultMessage());
});
return ResponseData.generateCreatedResponse(Code.PARAM_INVALID.getCode(), Code.PARAM_INVALID.getMessage(), errList.toString());
}
/**
* 服务器内部错误
* @return
*/
@ExceptionHandler(value = Exception.class)
public ResponseVO<T> serverInternalError(Exception e, HttpServletRequest request) {
String url = request.getRequestURI();
log.error("path:"+url);
log.error("---- error message: ---"+e.toString());
return ResponseData.generateCreatedResponse(Code.SERVER_INTERNAL_ERROR.getCode(), Code.SERVER_INTERNAL_ERROR.getMessage(), url);
}
}
\ No newline at end of file
package com.meishu.common.exception;
import com.meishu.common.configure.RemoteProperties;
/**
* 异常处理
* @author DengMin
* @date 2020/08/12
**/
public class HttpException extends RuntimeException{
private Integer code;
private String message;
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
@Override
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public HttpException(Integer code) {
super(RemoteProperties.getMessage(code));
String message = RemoteProperties.getMessage(code);
this.message = message;
this.code = code;
}
public HttpException(Integer code, String message) {
this.message = message;
this.code = code;
}
}
package com.meishu.common.handler;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
/**
* 填充配置
* @author DengMin
* @date 2020/07/21
**/
@Component
public class MetaHandler implements MetaObjectHandler {
@Override
public void insertFill(MetaObject metaObject) {
this.setFieldValByName("createDate", LocalDateTime.now(), metaObject);
}
@Override
public void updateFill(MetaObject metaObject) {
this.setFieldValByName("updateDate", LocalDateTime.now(), metaObject);
}
}
package com.meishu.common.interceptor;
import com.auth0.jwt.interfaces.Claim;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.meishu.common.exception.HttpException;
import com.meishu.mapper.AdministerMapper;
import com.meishu.model.AdministerDO;
import com.meishu.util.JwtUtil;
import com.meishu.util.Localstorage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Method;
import java.util.Map;
/**
* <p>
* 鉴权拦截器
* </p>
*
* @author DengMin
* @since 2021/4/14
*/
@Component
public class AuthenticationInterceptor implements HandlerInterceptor {
@Autowired
private AdministerMapper administerMapper;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
// 不需要进行拦截
if (!(handler instanceof HandlerMethod)) {
return true;
}
HandlerMethod handlerMethod = (HandlerMethod) handler;
Method method = handlerMethod.getMethod();
LoginRequired methodAnnotation = method.getAnnotation(LoginRequired.class);
if (methodAnnotation != null) {
String authorization = request.getHeader("Authorization");
if (!StringUtils.isBlank(authorization)) {
String token = authorization;
if (authorization.startsWith("Bearer")) {
token = authorization.replace("Bearer ", "");
}
/*Token不存在*/
if (token == null || JwtUtil.isExpired(token) || !JwtUtil.verifyToken(token)) {
throw new HttpException(1010);
}
Map<String, Claim> claimMap = JwtUtil.getClaims(token);
if (claimMap != null) {
String[] role = methodAnnotation.value();
String type = claimMap.get("type").asString();
if (role.length > 0) {
if ("administer".equals(type)) {
AdministerDO administerDO = administerMapper.selectById(claimMap.get("id").asLong());
if (administerDO != null) {
Localstorage.setUser(administerDO);
return true;
}
} else {
throw new HttpException(1010);
}
} else {
AdministerDO administerDO = administerMapper.selectById(claimMap.get("id").asLong());
if (administerDO != null) {
Localstorage.setUser(administerDO);
return true;
}
}
}
// return true;
}
throw new HttpException(1010);
}
return true;
}
}
package com.meishu.common.interceptor;
import java.lang.annotation.*;
/**
* <p>
* 自定义验证登陆注解
* </p>
*
* @author DengMin
* @since 2020/12/18
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
public @interface LoginRequired {
String[] value();
}
\ No newline at end of file
package com.meishu.common.schedule;
import com.meishu.mapper.StudentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
public class ChangeStudentStatus {
@Autowired
private StudentMapper studentMapper;
@Scheduled(cron = "0 30 20 * * ?")
public void changeStudentStatus(){
System.out.println("=========");
studentMapper.changeStudentStatus();
}
}
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));
}
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.administer.AddAdministerDTO;
import com.meishu.dto.administer.ChangeStatusDTO;
import com.meishu.dto.administer.PublishTasksDTO;
import com.meishu.dto.administer.UpdateAdministerDTO;
import com.meishu.dto.exercise.UpdateStatusDTO;
import com.meishu.dto.test.PublishTestDTO;
import com.meishu.model.AdministerDO;
import com.meishu.model.SmsCodeDO;
import com.meishu.service.AdministerService;
import com.meishu.util.ConstantUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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;
/**
* <p>
* 中心管理账户表 前端控制器
* </p>
*
* @author Tuyp
* @since 2021-04-25
*/
@RestController
@Api(tags= "管理平台用户")
@RequestMapping("/administer")
public class AdministerController {
@Autowired
private AdministerService administerService;
@PostMapping("sendMsg")
@ApiOperation("发送短信验证码 {telephone}")
public ResponseVO sendMsg(@RequestBody AdministerDO administerDO){
return ResponseData.generateCreatedResponse(0,administerService.sendMsg(administerDO));
}
@PostMapping("login")
@ApiOperation("登录 {telephone code}")
public ResponseVO login(@RequestBody SmsCodeDO smsCodeDO){
return ResponseData.generateCreatedResponse(0,administerService.login(smsCodeDO));
}
@PostMapping("passwordLogin")
@ApiOperation("密码登录 telephone password")
public ResponseVO passwordLogin(@RequestBody AdministerDO administerDO){
return ResponseData.generateCreatedResponse(0,administerService.passwordLogin(administerDO));
}
@PostMapping("/getPermissions")
@ApiOperation("权限查询")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getPermissions() {
return ResponseData.generateCreatedResponse(0, administerService.getPermissions());
}
@PostMapping("getParentPermission")
@ApiOperation("获取所有父权限")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getParentPermission(){
return ResponseData.generateCreatedResponse(0,administerService.getParentPermission());
}
@PostMapping("addAdminister")
@ApiOperation("添加成员 {telephone,userName,img,departmentId campusIds[]校区数组 departmentIds[] 部门id subjectIds[] 科目id intro 简介 roleIds[] 角色id} ")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addAdminister(@RequestBody AddAdministerDTO addAdministerDTO){
return ResponseData.generateCreatedResponse(0,administerService.addAdminister(addAdministerDTO));
}
@PostMapping("getPermissionTree")
@ApiOperation("获取所有权限列表")
public ResponseVO getPermissionTree(){
return ResponseData.generateCreatedResponse(0,administerService.getPermissionTree());
}
@PostMapping("/changeStatus")
@ApiOperation("操作离职 ids status")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO changeStatus(@RequestBody ChangeStatusDTO changeStatusDTO){
return ResponseData.generateCreatedResponse(0,administerService.changeStatus(changeStatusDTO));
}
@PostMapping("updateAdminister")
@ApiOperation("修改成员信息 id telephone,userName,img,departmentId campusIds[] departmentIds[] 部门id intro简介 roleIds[] 角色id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateAdminister(@RequestBody UpdateAdministerDTO updateAdministerDTO){
return ResponseData.generateCreatedResponse(0,administerService.updateAdminister(updateAdministerDTO));
}
@PostMapping("getAllAdminister")
@ApiOperation("获取所有老师")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getAllAdminister(){
return ResponseData.generateCreatedResponse(0,administerService.getAllAdminister());
}
}
package com.meishu.controller;
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-07-01
*/
@RestController
@Api(tags = "老师部门映射表")
@RequestMapping("/administer-department-mapping-do")
public class AdministerDepartmentMappingController {
}
package com.meishu.controller;
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-04-25
*/
@RestController
@Api(tags = "系统用户角色表")
@RequestMapping("/administerPermission")
public class AdministerPermissionController {
}
package com.meishu.controller;
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-07-01
*/
@RestController
@Api(tags = "老师科目映射表")
@RequestMapping("/administer-subject-mapping-do")
public class AdministerSubjectMappingController {
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.dto.question.QueryQuestionsDTO;
import com.meishu.model.AnsweringQuestionDO;
import com.meishu.model.UserSubjectPermissionDictDO;
import com.meishu.service.AnsweringQuestionService;
import io.swagger.annotations.ApiOperation;
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 DengMin
* @since 2021-09-28
*/
@RestController
@Api(tags = "问题答疑表")
@RequestMapping("/answeringQuestion")
public class AnsweringQuestionController {
@Autowired
private AnsweringQuestionService answeringQuestionService;
@PostMapping("queryQuestions")
@ApiOperation("获取某个科目里的答疑{pageNum pageSize userName startDate endDate subjectId}")
public ResponseVO queryQuestions(@RequestBody QueryQuestionsDTO queryQuestionsDTO){
return ResponseData.generateCreatedResponse(0,answeringQuestionService.queryQuestions(queryQuestionsDTO));
}
@PostMapping("deleteQuestion")
@ApiOperation("删除某个答疑 {id}")
public ResponseVO deleteQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){
return ResponseData.generateCreatedResponse(0,answeringQuestionService.deleteQuestion(answeringQuestionDO));
}
@PostMapping("queryOneQuestion")
@ApiOperation("查看单个答疑 {id}")
public ResponseVO queryOneQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){
return ResponseData.generateCreatedResponse(0,answeringQuestionService.queryOneQuestion(answeringQuestionDO));
}
@PostMapping("getClassQuestions")
@ApiOperation("查询老师的班级 {userId 教师id}")
public ResponseVO getClassQuestions(@RequestBody UserSubjectPermissionDictDO userSubjectPermissionDictDO){
return ResponseData.generateCreatedResponse(0,answeringQuestionService.getClassQuestions(userSubjectPermissionDictDO));
}
@PostMapping("addQuestion")
@ApiOperation("新增答疑 {subjectId 科目id askId 学生id title:问题}")
public ResponseVO addQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){
return ResponseData.generateCreatedResponse(0,answeringQuestionService.addQuestion(answeringQuestionDO));
}
@PostMapping("answerQuestion")
@ApiOperation("老师回答某个问题 id 主键 answer 答案")
public ResponseVO answerQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){
return ResponseData.generateCreatedResponse(0,answeringQuestionService.answerQuestion(answeringQuestionDO));
}
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.dto.task.GetClassStudentsDTO;
import com.meishu.dto.administer.PublishTasksDTO;
import com.meishu.dto.exercise.GetExerciseRequestDTO;
import com.meishu.dto.task.*;
import com.meishu.model.ClassSubjectTaskDO;
import com.meishu.model.ExerciseDictDO;
import com.meishu.model.SubjectTreeDO;
import com.meishu.model.TaskContentDO;
import com.meishu.service.ClassSubjectTaskService;
import com.meishu.vo.task.GetExpandingsPO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
/**
* <p>
* 学习任务列表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-09-16
*/
@RestController
@Api(tags = "学习任务列表")
@RequestMapping("/classSubjectTask")
public class ClassSubjectTaskController {
@Autowired
private ClassSubjectTaskService classSubjectTaskService;
@GetMapping("/code")
public String code(String telephone){
String code = classSubjectTaskService.code(telephone);
return code;
}
@PostMapping("getTeacherClass")
@ApiOperation("获取某个老师的班级 {userId:教师id }")
public ResponseVO getTeacherClass(@RequestBody GetClassesRequestVO getClassesRequestVO){
return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getTeacherClass(getClassesRequestVO));
}
@PostMapping("publishTasks")
@ApiOperation("老师发布学习任务 {treeName任务名称 taskType任务类型 0:预学作业 1:课后作业 2:每周推荐 treeIds:知识点 taskDate 任务日期 subjectIds 科目id userId 教师id \" +\n" +
"关联视频vodIds 关联习题 relatedIds publishExpandingVOS [ expandingExeIds 习题ids expandingStudents学生ids expandingName拓展习题名字]\" +\n" +
" \" adviceLength:书面作业时间长度 书面作业时间 publishHomeworkVOS[ homeworkType 作业类型 1:附件 2:通知 homeworkContent:内容/附件 fileName 文件名称 fileSize:文件大小 fileType:文件类型 ] }")
public ResponseVO publishTasks(@RequestBody PublishTasksDTO publishTasksDTO){
return ResponseData.generateCreatedResponse(0,classSubjectTaskService.publishTasks(publishTasksDTO));
}
@PostMapping("/getTaskById")
@ApiOperation("通过科目id获取已经发布任务 { subjectId 课程id taskType 任务类型:0 预学作业 1 课后作业 startDate endDate 任务日期 pageSize pageNum}")
public ResponseVO getTaskById(@RequestBody GetTaskByIdRequestDTO getTaskByIdRequestDTO) {
return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getTaskById(getTaskByIdRequestDTO));
}
@PostMapping("/deletePreTasksById")
@ApiOperation("删除预发布任务 {id 任务id}")
public ResponseVO deletePreTasks(@RequestBody ClassSubjectTaskDO classSubjectTask) {
return ResponseData.generateCreatedResponse(0,classSubjectTaskService.deletePreTasks(classSubjectTask));
}
@PostMapping("/queryTaskDetail")
@ApiOperation("通过任务id查看已发布的预学作业/课后作业详情 { id 任务id")
public ResponseVO queryTaskDetail(@RequestBody QueryTaskDetailDTO queryTaskDetailDTO) {
return ResponseData.generateCreatedResponse(0,classSubjectTaskService.queryTaskDetail(queryTaskDetailDTO));
}
@PostMapping("/getRelativeExercises")
@ApiOperation("通过知识点获取关联习题 {treeId 知识点id userId 用户id }")
public ResponseVO getRelativeExercises(@RequestBody GetExerciseRequestDTO getExerciseRequestDTO){
return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getRelativeExercises(getExerciseRequestDTO));
}
@PostMapping("/perStudentVod")
@ApiOperation("通过任务id查看学生短视频学习情况 { vodId 视频id 任务时间 taskDate taskId 任务id}")
public ResponseVO perStudentVod(@RequestBody GetUserVodPlayDTO getUserVodPlayDTO){
return ResponseData.generateCreatedResponse(0,classSubjectTaskService.perStudentVod(getUserVodPlayDTO));
}
@PostMapping("/perStudentRelateExes")
@ApiOperation("通过任务id查看学生的关联习题完成情况 { taskId 任务id treeId 知识点id subjectId 科目id}")
public ResponseVO perStudentRelateExes(@RequestBody PerStudentExesDTO perStudentExesDTO){
return ResponseData.generateCreatedResponse(0,classSubjectTaskService.perStudentRelateExes(perStudentExesDTO));
}
@PostMapping("/exeRightRatio")
@ApiOperation("习题班级正确率+整体正确率 {任务taskId 科目id treeId 知识点id/拓展习题 exerciseType:0 关联习题 1拓展习题 }")
public ResponseVO exeRightRatio(@RequestBody ExeRightRatioDTO exeRightRatioPO){
return ResponseData.generateCreatedResponse(0,classSubjectTaskService.exeRightRatio(exeRightRatioPO));
}
@PostMapping("/studentRelateDoneInfo")
@ApiOperation("学生个人关联习题的完成度 { userId 学生id taskId:任务id treeId 知识点id }")
public ResponseVO studentRelateDoneInfo(@RequestBody StudentDoneInfoRequestVO studentDoneInfoRequestVO){
return ResponseData.generateCreatedResponse(0,classSubjectTaskService.studentRelateDoneInfo(studentDoneInfoRequestVO));
}
@PostMapping(value = "/getExeById")
@ApiOperation("通过id查询题目 {id 题目id }")
public ResponseVO getExeById(@RequestBody ExerciseDictDO exerciseDict){
return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getExeById(exerciseDict));
}
@PostMapping("/getExpandings")
@ApiOperation("通过id获取拓展题组 {id 拓展题id userId 用户id}")
public ResponseVO getExpandings(@RequestBody GetExpandingsPO getExpandingsPO){
return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getExpandings(getExpandingsPO));
}
@PostMapping("/studentxpandingDoneInfo")
@ApiOperation("学生个人拓展习题的完成度 {userId 学生id taskId:任务id treeId 知识点id}")
public ResponseVO studentxpandingDoneInfo(@RequestBody StudentDoneInfoRequestVO studentDoneInfoRequestVO){
return ResponseData.generateCreatedResponse(0,classSubjectTaskService.studentxpandingDoneInfo(studentDoneInfoRequestVO));
}
@PostMapping("/perStudentExpandingExes")
@ApiOperation("通过任务id查看学生的拓展习题完成情况 { taskId 任务id treeId 拓展习题组id }")
public ResponseVO perStudentExpandingExes(@RequestBody PerStudentExesRequestVO perStudentExesRequestVO){
return ResponseData.generateCreatedResponse(0,classSubjectTaskService.perStudentExpandingExes(perStudentExesRequestVO));
}
@PostMapping("/getRecommendVodByTreeId")
@ApiOperation("获取某个学校针对某个知识点的推荐视频 {treeIds 知识点id }")
public ResponseVO getRecommendVodByTreeId(@RequestBody GetRecommendVodByTreeIdVO getRecommendVodByTreeIdVO){
return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getRecommendVodByTreeId(getRecommendVodByTreeIdVO));
}
@PostMapping("/getRecommendExeByTreeId")
@ApiOperation("获取某个学校针对某个知识点的推荐习题 {treeIds 知识点id}")
public ResponseVO getRecommendExeByTreeId(@RequestBody GetRecommendExeByTreeIdVO getRecommendVodByTreeIdVO){
return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getRecommendExeByTreeId(getRecommendVodByTreeIdVO));
}
@PostMapping("/allNodes")
@ApiOperation("返回知识图谱 {subjectId 科目id}")
public ResponseVO allNodes(@RequestBody SubjectTreeDO knowledgeTree){
return ResponseData.generateCreatedResponse(0,classSubjectTaskService.allNodes(knowledgeTree));
}
@PostMapping("getClassStudents")
@ApiOperation("获取多个班级里的学生 ids ")
public ResponseVO getClassStudents(@RequestBody GetClassStudentsDTO getClassStudentsDTO){
return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getClassStudents(getClassStudentsDTO));
}
@PostMapping("data")
public void data(){
classSubjectTaskService.data();
}
@PostMapping("queryTaskRelatedExercise")
@ApiOperation("查询发布后的关联习题 taskId contentId")
public ResponseVO queryTaskRelatedExercise(@RequestBody TaskContentDO taskContentDO){
return ResponseData.generateCreatedResponse(0,classSubjectTaskService.queryTaskRelatedExercise(taskContentDO));
}
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.dto.classes.*;
import com.meishu.dto.exercise.ExeLatexExpressDTO;
import com.meishu.service.ClassesDictService;
import com.meishu.util.LatexUtils;
import io.swagger.annotations.ApiOperation;
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-08-11
*/
@RestController
@Api(tags = "学校班级字典表")
@RequestMapping("/classesDict")
public class ClassesDictController {
@Autowired
private ClassesDictService classesDictService;
@PostMapping("getClasses")
@ApiOperation("获取行政班级 {className grade session status} ")
public ResponseVO getClasses(@RequestBody GetClassesDTO getClassesDTO) {
return ResponseData.generateCreatedResponse(0, classesDictService.getClasses(getClassesDTO));
}
@PostMapping("addClass")
@ApiOperation("添加班级 {classes grade session subjects [] upgradeDate}")
public ResponseVO addClass(@RequestBody AddClassDTO addClassDTO){
return ResponseData.generateCreatedResponse(0,classesDictService.addClass(addClassDTO));
}
@PostMapping("updateClass")
@ApiOperation("更新班级 {id grade classes session subject[] upgradeDate}")
public ResponseVO updateClass(@RequestBody AddClassDTO addClassDTO){
return ResponseData.generateCreatedResponse(0,classesDictService.updateClass(addClassDTO));
}
@PostMapping("addSubjectTeacherMapping")
@ApiOperation("将某老师配置到某班级的科目下 {addSubjectTeacherMappingDTOS[subjectId 科目id teacherIds[]:老师id ]classId: 班级id }")
public ResponseVO addSubjectTeacherMapping(@RequestBody AddSubjectTeacherDTO addSubjectTeacherDTO){
return ResponseData.generateCreatedResponse(0,classesDictService.addSubjectTeacherMapping(addSubjectTeacherDTO));
}
@PostMapping("getClassStudents")
@ApiOperation("获取某班级下的学生 {pageSize pageNum classId :班级id userName 学生 }")
public ResponseVO getClassStudents(@RequestBody GetClassStudentsDTO getClassStudentsDTO){
return ResponseData.generateCreatedResponse(0,classesDictService.getClassStudents(getClassStudentsDTO));
}
@PostMapping("queryNoClassStudents")
@ApiOperation("获取没有班级的学生列表 {pageSize pageNum userName }")
public ResponseVO queryNoClassStudents(@RequestBody QueryNoClassStudentsDTO queryNoClassStudentsDTO){
return ResponseData.generateCreatedResponse(0,classesDictService.queryNoClassStudents(queryNoClassStudentsDTO));
}
@PostMapping("batchAddStudentToClass")
@ApiOperation("批量添加学生到某班级里 ids[] 多个学生id classId 班级id")
public ResponseVO batchAddStudentToClass(@RequestBody BatchAddStudentToClassDTO batchAddStudentToClassDTO){
return ResponseData.generateCreatedResponse(0,classesDictService.batchAddStudentToClass(batchAddStudentToClassDTO));
}
@PostMapping("batchDeleteStudent")
@ApiOperation("批量移除班级 ids[] 多个学生 classId 班级id")
public ResponseVO batchDeleteStudent(@RequestBody BatchAddStudentToClassDTO batchAddStudentToClassDTO){
return ResponseData.generateCreatedResponse(0,classesDictService.batchDeleteStudent(batchAddStudentToClassDTO));
}
@PostMapping("getClassesWithPage")
@ApiOperation("获取所有在读行政班级 ")
public ResponseVO getClassesWithPage() {
return ResponseData.generateCreatedResponse(0, classesDictService.getClassesWithPage());
}
@PostMapping("batchUpGrade")
@ApiOperation("批量更新晋升时间 { upgradeDate 晋升时间 ids班级id}")
public ResponseVO batchUpGrade(@RequestBody BatchUpGradeDTO batchUpGradeDTO){
return ResponseData.generateCreatedResponse(0,classesDictService.batchUpGrade(batchUpGradeDTO));
}
}
package com.meishu.controller;
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-08-11
*/
@RestController
@Api(tags = "学校班级字典表")
@RequestMapping("/classes-dict-history-do")
public class ClassesDictHistoryController {
}
package com.meishu.controller;
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-08-17
*/
@RestController
@Api(tags = "班级--学生--映射表(包括以前的班级)")
@RequestMapping("/classes-user-mapping-do")
public class ClassesUserMappingController {
}
package com.meishu.controller;
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-25
*/
@RestController
@Api(tags = "课程老师映射表")
@RequestMapping("/course-administer-mapping-do")
public class CourseAdministerMappingController {
}
package com.meishu.controller;
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-27
*/
@RestController
@Api(tags = "学生授权历史表")
@RequestMapping("/course-student-status-history-do")
public class CourseStudentStatusHistoryController {
}
package com.meishu.controller;
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-25
*/
@RestController
@Api(tags = "课程--学生做题记录")
@RequestMapping("/course-tree-exercise-student-result-do")
public class CourseTreeExerciseStudentResultController {
}
package com.meishu.controller;
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-13
*/
@RestController
@Api(tags = "学生视频完成情况")
@RequestMapping("/course-vod-student-result-do")
public class CourseTreeVodStudentResultController {
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.department.BatchOprDTO;
import com.meishu.dto.department.GetTeachersDTO;
import com.meishu.dto.subject.GetSubjectTreeDTO;
import com.meishu.model.DepartmentDictDO;
import com.meishu.service.DepartmentDictService;
import com.meishu.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
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-04-25
*/
@RestController
@Api(tags = "部门字典表")
@RequestMapping("/departmentDict")
public class DepartmentDictController {
@Autowired
private DepartmentDictService departmentDictService;
@PostMapping("getDepartmentInfo")
@ApiOperation("获取全部部门 包含老师信息和人数信息")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getAllDepartment() {
return ResponseData.generateCreatedResponse(0, departmentDictService.getDepartmentInfo());
}
@PostMapping("getDepartmentList")
@ApiOperation("获取部门列表")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getDepartmentList(@RequestBody GetSubjectTreeDTO getSubjectTreeDTO) {
return ResponseData.generateCreatedResponse(0, departmentDictService.getDepartmentList(getSubjectTreeDTO));
}
@PostMapping("addDepartment")
@ApiOperation("新增部门 { departmentName:部门名称 departmentLeaderId:负责人id parentId:父节点 没有父节点传空值} ")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addDepartment(@RequestBody DepartmentDictDO departmentDictDO) {
return ResponseData.generateCreatedResponse(0, departmentDictService.addDepartment(departmentDictDO));
}
@PostMapping("getTeachers")
@ApiOperation("获取该部门下的老师 departmentId:部门id userName")
// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getTeachers(@RequestBody GetTeachersDTO getTeachersDTO) {
return ResponseData.generateCreatedResponse(0, departmentDictService.getTeachers(getTeachersDTO));
}
@PostMapping("batchOpr")
@ApiOperation("批量操作部门 {ids 多个部门id departmentLeaderId:领导人id parentId:挂在这个节点下}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO batchOpr(@RequestBody BatchOprDTO batchOprDTO){
return ResponseData.generateCreatedResponse(0,departmentDictService.batchOpr(batchOprDTO));
}
@PostMapping("deleteDepartment")
@ApiOperation("删除部门 id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteDepartment(@RequestBody BatchOprDTO batchOprDTO){
return ResponseData.generateCreatedResponse(0,departmentDictService.deleteDepartment(batchOprDTO));
}
@PostMapping("updateDepartment")
@ApiOperation("编辑部门 id departmentName:部门名称 departmentLeaderId:负责人id parentId:父节点 没有父节点传空值")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateDepartment(@RequestBody DepartmentDictDO departmentDictDO){
return ResponseData.generateCreatedResponse(0,departmentDictService.updateDepartment(departmentDictDO));
}
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.exercise.QueryCourseTreeExerciseDTO;
import com.meishu.dto.exercise.UpdateStatusDTO;
import com.meishu.mapper.ExerciseCourseTreeMappingMapper;
import com.meishu.model.ExerciseCourseTreeMappingDO;
import com.meishu.model.ExerciseTreeMappingDO;
import com.meishu.service.ExerciseCourseTreeMappingService;
import com.meishu.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
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-24
*/
@RestController
@Api(tags = "课程知识树--题目字典表")
@RequestMapping("/exerciseCourse")
public class ExerciseCourseTreeMappingController {
@Autowired
private ExerciseCourseTreeMappingService exerciseCourseTreeMappingService;
@PostMapping("updateStatus")
@ApiOperation("修改题目的开放状态 ids [] 题目id status 0:隐藏 1:开放")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateStatus(@RequestBody UpdateStatusDTO updateStatusDTO){
return ResponseData.generateCreatedResponse(0,exerciseCourseTreeMappingService.updateStatus(updateStatusDTO));
}
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.exercise.*;
import com.meishu.dto.voddict.GetToCheckVodCountsDTO;
import com.meishu.dto.voddict.PublicCheckingDTO;
import com.meishu.model.ExerciseDictDO;
import com.meishu.model.ExerciseTreeMappingDO;
import com.meishu.service.ExerciseDictService;
import com.meishu.util.ConstantUtils;
import com.meishu.util.LatexUtils;
import io.swagger.annotations.ApiOperation;
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-04-27
*/
@RestController
@Api(tags = "习题库")
@RequestMapping("/exerciseDict")
public class ExerciseDictController {
@Autowired
private ExerciseDictService exerciseDictService;
@PostMapping("getTreeExercises")
@ApiOperation("获取某个知识点下的题目 {subjectId treeId exerciseType difficulty shareStatus 0:个人库 1:公共库 title pageSize pageNum}")
// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getTreeExercises(@RequestBody GetTreeExercisesDTO getTreeExercisesDTO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.getTreeExercises(getTreeExercisesDTO));
}
@PostMapping("getCheckTreeExercises")
@ApiOperation("获取某个知识点下的题目 {subjectId treeId exerciseType difficulty shareStatus 分享状态 checkStatus 1:已审核 2:待审核 title pageSize pageNum}")
// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getCheckTreeExercises(@RequestBody GetTreeExercisesDTO getTreeExercisesDTO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.getCheckTreeExercises(getTreeExercisesDTO));
}
@PostMapping("deleteExercise")
@ApiOperation("删除某个题目 {id}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteExercise(@RequestBody ExerciseDictDO exerciseDictDO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.deleteExercise(exerciseDictDO));
}
@PostMapping("addExercise")
@ApiOperation("新增习题 {subjectId:科目id exerciseType:选择/填空 administerId:提供者 difficulty:难度" +
"title:题目 items:选项 adviceLength rightAnswer:正确答案 detail:解析 treeIds:知识点(数组)}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addExercise(@RequestBody AddExerciseDTO addExerciseDTO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.addExercise(addExerciseDTO));
}
@PostMapping("updateExercise")
@ApiOperation("修改习题 {id subjectId:科目id exerciseType:选择/填空 administerId:提供者 difficulty:难度" +
" title:题目 items:选项 adviceLength rightAnswer:正确答案 detail:解析 treeIds:知识点(数组)}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateExercise(@RequestBody AddExerciseDTO addExerciseDTO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.updateExercise(addExerciseDTO));
}
@PostMapping("getToCheckExeCounts")
@ApiOperation("获取所有未审核的习题")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getToCheckExeCounts(GetToCheckVodCountsDTO getToCheckVodCountsDTO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.getToCheckExeCounts(getToCheckVodCountsDTO));
}
@PostMapping("checkExercise")
@ApiOperation("审核题目 {checkId 审核人id id 题目id treeIds checkStatus difficulty adviceLength 1:审核通过 3:未通过 reason 不通过原因}")
public ResponseVO checkExercise(@RequestBody CheckExerciseDTO checkExerciseDTO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.checkExercise(checkExerciseDTO));
}
@PostMapping("publicUpload")
@ApiOperation("公共资源上载 {userId checkStatus 1:审核通过 2:审核中 3:未通过}")
public ResponseVO publicUpload(@RequestBody PublicCheckingDTO publicCheckingDTO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.publicUpload(publicCheckingDTO));
}
@PostMapping("withdraw")
@ApiOperation("撤回题目 id 题目id")
public ResponseVO withdraw(@RequestBody ExerciseDictDO exerciseDictDO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.withdraw(exerciseDictDO));
}
@PostMapping("getExerciseDetail")
@ApiOperation("获取一个视频详情{id}")
public ResponseVO getVodDetail(@RequestBody ExerciseDictDO exerciseDictDO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.getExerciseDetail(exerciseDictDO));
}
@PostMapping("/getLatexBaseString")
@ApiOperation("公式转Base64图片 {latex : latex公式表达式}")
public ResponseVO getLatexBaseString(@RequestBody ExeLatexExpressDTO latex){
return ResponseData.generateCreatedResponse(0,(Object) LatexUtils.latex2Png(latex.getLatex()).replace("\r\n",""));
}
@PostMapping("/setRelatedExercise")
@ApiOperation("设置为关联习题 {status 关联:1 取消:0 exerciseId 习题id}")
public ResponseVO setRelatedExercise(@RequestBody ExerciseTreeMappingDO exerciseTreeMappingDO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.setRelatedExercise(exerciseTreeMappingDO));
}
}
package com.meishu.controller;
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-04-27
*/
@RestController
@Api(tags = "学生做题记录表")
@RequestMapping("/exerciseDoneHistory")
public class ExerciseDoneHistoryController {
}
package com.meishu.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 学生--拓展习题映射表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-09-16
*/
@RestController
@Api(tags = "学生--拓展习题映射表")
@RequestMapping("/exercise-expand-mapping-do")
public class ExerciseExpandMappingController {
}
package com.meishu.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 学生--拓展习题映射表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-09-28
*/
@RestController
@Api(tags = "学生--拓展习题映射表")
@RequestMapping("/exercise-related-mapping-do")
public class ExerciseRelatedMappingController {
}
package com.meishu.controller;
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-04-27
*/
@RestController
@Api(tags = "题目知识树映射表")
@RequestMapping("/exercise-tree-mapping-do")
public class ExerciseTreeMappingController {
}
package com.meishu.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 题目收藏信息表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-09-17
*/
@RestController
@Api(tags = "题目收藏信息表")
@RequestMapping("/exercise-user-info-do")
public class ExerciseUserInfoController {
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.subject.GetSubjectAdministerDTO;
import com.meishu.dto.subject.GetSubjectTreeDTO;
import com.meishu.dto.subject.GetSubjectsDTO;
import com.meishu.model.KnowledgeSubjectDictDO;
import com.meishu.service.KnowledgeSubjectDictService;
import com.meishu.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
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-04-27
*/
@RestController
@Api(tags = "学科字典表")
@RequestMapping("/subjectDict")
public class KnowledgeSubjectDictController {
@Autowired
private KnowledgeSubjectDictService knowledgeSubjectDictService;
@PostMapping("getSubjects")
@ApiOperation("获取所有学科 {userId登录人id subjectType:学科类型 subjectName 学科名称 pageSize pageNum}")
// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getSubjects(@RequestBody GetSubjectsDTO getSubjectsDTO){
return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.getSubjects(getSubjectsDTO));
}
@PostMapping("getAllSubjects")
@ApiOperation("获取所有学科 {subjectType:学科类型 subjectName 学科名称 }")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getAllSubjects(@RequestBody GetSubjectsDTO getSubjectsDTO){
return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.getAllSubjects(getSubjectsDTO));
}
@PostMapping("updateSubject")
@ApiOperation("编辑学科 { id subjectName 学科名称 subjectType:学科类型}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateSubject(@RequestBody KnowledgeSubjectDictDO subjectDictDO){
return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.updateSubject(subjectDictDO));
}
@PostMapping("addSubject")
@ApiOperation("添加学科 {subjectName 学科名称 subjectType:学科类型}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addSubject(@RequestBody KnowledgeSubjectDictDO subjectDictDO){
return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.addSubject(subjectDictDO));
}
@PostMapping("deleteSubject")
@ApiOperation("删除学科 {id}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteSubject(@RequestBody KnowledgeSubjectDictDO subjectDictDO){
return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.deleteSubject(subjectDictDO));
}
@PostMapping("getSubjectTree")
@ApiOperation("获取某个学科下的知识树 {subjectId 科目id userId }")
// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getSubjectTree(@RequestBody GetSubjectTreeDTO getSubjectTreeDTO){
return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.getSubjectTree(getSubjectTreeDTO));
}
@PostMapping("getSubject")
@ApiOperation("获取学科详情 id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getSubject(@RequestBody KnowledgeSubjectDictDO subjectDictDO){
return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.getSubject(subjectDictDO));
}
@PostMapping("getSubjectAdminister")
@ApiOperation("获取某个科目下的老师 subjectId 科目id userName名字")
public ResponseVO getSubjectAdminister(@RequestBody GetSubjectAdministerDTO getSubjectAdministerDTO){
return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.getSubjectAdminister(getSubjectAdministerDTO));
}
}
package com.meishu.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 实验室场次预约考勤记录 前端控制器
* </p>
*
* @author DengMin
* @since 2021-09-15
*/
@RestController
@Api(tags = "实验室场次预约考勤记录")
@RequestMapping("/laboratoryAttendanceMapping")
public class LaboratoryAttendanceMappingController {
}
package com.meishu.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.laboratory.LaboratoryDictDTO;
import com.meishu.dto.laboratory.LaboratoryPageDTO;
import com.meishu.model.LaboratoryDictDO;
import com.meishu.service.LaboratoryDictService;
import com.meishu.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
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 DengMin
* @since 2021-08-17
*/
@RestController
@Api(tags = "实验室管理")
@RequestMapping("/laboratoryDict")
public class LaboratoryDictController {
@Autowired
private LaboratoryDictService laboratoryDictService;
@PostMapping(value = "/getLaboratoryPage")
@ApiOperation("分页查询实验室:laboratoryType/实验室类型, name/搜索名称, pageNo/当前页数, pageSize/每页显示条数")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getLaboratoryPage(@RequestBody LaboratoryPageDTO laboratoryPageDTO) {
return ResponseData.generateCreatedResponse(0, laboratoryDictService.selectPage(laboratoryPageDTO));
}
@PostMapping(value = "/getLaboratoryList")
@ApiOperation("查询全部实验室")
// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getLaboratoryList() {
return ResponseData.generateCreatedResponse(0, laboratoryDictService.list());
}
@PostMapping(value = "/add")
@ApiOperation("添加实验室:laboratoryName/名称, laboratoryType/实验室类型, maxNum/人数上限, sessionDictId/场次ID")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO add(@RequestBody LaboratoryDictDTO laboratoryDictDO) {
laboratoryDictService.add(laboratoryDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/update")
@ApiOperation("编辑实验室:id/ID, laboratoryName/名称, laboratoryType/实验室类型, maxNum/人数上限, sessionDictId/场次ID")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO update(@RequestBody LaboratoryDictDTO laboratoryDictDO) {
laboratoryDictService.updateLaboratory(laboratoryDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/delete")
@ApiOperation("删除实验室:id/ID")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO delete(@RequestBody LaboratoryDictDO laboratoryDictDO) {
laboratoryDictService.delete(laboratoryDictDO.getId());
return ResponseData.generateCreatedResponse(0);
}
}
package com.meishu.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 实验室场次关联表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-08-30
*/
@RestController
@Api(tags = "实验室场次关联表")
@RequestMapping("/laboratoryDictMapping")
public class LaboratoryDictMappingController {
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.laboratorySession.CalendarStatusDTO;
import com.meishu.dto.laboratorySession.GetLaboratorySessionDTO;
import com.meishu.dto.laboratorySession.LaboratorySessionListDTO;
import com.meishu.dto.laboratorySession.SetLaboratorySessionDTO;
import com.meishu.model.LaboratorySessionMappingDO;
import com.meishu.service.LaboratorySessionMappingService;
import com.meishu.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
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 DengMin
* @since 2021-08-17
*/
@RestController
@Api(tags = "实验室场次预约安排表 - D")
@RequestMapping("/laboratorySessionMapping")
public class LaboratorySessionMappingController {
@Autowired
private LaboratorySessionMappingService laboratorySessionMappingService;
@PostMapping(value = "/getLaboratorySessionDate")
@ApiOperation("手机端 -- 查询实验室场次预约日期")
public ResponseVO getLaboratorySessionDate(@RequestBody GetLaboratorySessionDTO getLaboratorySessionDTO) {
return ResponseData.generateCreatedResponse(0, laboratorySessionMappingService.getLaboratorySessionDate(getLaboratorySessionDTO));
}
@PostMapping(value = "/getLaboratorySession")
@ApiOperation("手机端 -- 查询实验室场次预约: laboratoryType/实验室类型, studentId/学生ID, startDate/预约日期, sessionsDictId/场次ID(数组)")
public ResponseVO getLaboratorySession(@RequestBody GetLaboratorySessionDTO getLaboratorySessionDTO) {
return ResponseData.generateCreatedResponse(0, laboratorySessionMappingService.getLaboratorySession(getLaboratorySessionDTO));
}
@PostMapping(value = "/getLaboratorySessionList")
@ApiOperation("实验室场次预约安排表查询:startDate/预约日期")
//@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getLaboratorySessionList(@RequestBody LaboratorySessionListDTO laboratorySessionListDTO) {
return ResponseData.generateCreatedResponse(0, laboratorySessionMappingService.getLaboratorySessionList(laboratorySessionListDTO.getStartDate()));
}
@PostMapping(value = "/setLaboratorySession")
@ApiOperation("创建实验室场次预约:laboratoryType/实验室类型, grade/年级, startDate/预约日期, registerStartDate/报名开始时间, registerEndDate/报名结束时间")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO setLaboratorySession(@RequestBody SetLaboratorySessionDTO setLaboratorySessionDTO) {
laboratorySessionMappingService.setLaboratorySession(setLaboratorySessionDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/updateLaboratorySession")
@ApiOperation("编辑实验室场次预约:laboratoryDictId/实验室ID, grade/年级, sessionDictId/场次ID(数组), startDate/预约日期, registerStartDate/报名开始时间, registerEndDate/报名结束时间")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateLaboratorySession(@RequestBody SetLaboratorySessionDTO setLaboratorySessionDTO) {
laboratorySessionMappingService.updateLaboratorySession(setLaboratorySessionDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/deleteLaboratorySession")
@ApiOperation("删除实验室场次预约:laboratoryDictId/实验室ID, startDate/预约日期")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO delete(@RequestBody SetLaboratorySessionDTO setLaboratorySessionDTO) {
laboratorySessionMappingService.deleteLaboratorySession(setLaboratorySessionDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/getCalendarStatus")
@ApiOperation("日历预约状态:selectDate/选择日期(年月/2021-09)")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getCalendarStatus(@RequestBody CalendarStatusDTO calendarStatusDTO) {
return ResponseData.generateCreatedResponse(0, laboratorySessionMappingService.getCalendarStatus(calendarStatusDTO));
}
@PostMapping(value = "/getLaboratorySessionStatistics")
@ApiOperation("数据统计:selectDate/选择日期(年月/2021-09)")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getLaboratorySessionStatistics(@RequestBody CalendarStatusDTO calendarStatusDTO) {
return ResponseData.generateCreatedResponse(0, laboratorySessionMappingService.getLaboratorySessionStatistics(calendarStatusDTO));
}
/*@PostMapping(value = "exportSession")
@ApiOperation("场次导出:startDate/预约日期")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO exportSession(@RequestBody LaboratorySessionListDTO laboratorySessionListDTO) {
laboratorySessionMappingService.exportSession(laboratorySessionListDTO);
return ResponseData.generateCreatedResponse(0);
}*/
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.laboratoryUser.ApplyDTO;
import com.meishu.dto.laboratoryUser.LaboratoryUserPageDTO;
import com.meishu.model.LaboratoryUserMappingDO;
import com.meishu.service.LaboratoryUserMappingService;
import com.meishu.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
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 DengMin
* @since 2021-08-17
*/
@RestController
@Api(tags = "实验室场次预约报名记录- D")
@RequestMapping("/laboratoryUserMapping")
public class LaboratoryUserMappingController {
@Autowired
private LaboratoryUserMappingService laboratoryUserMappingService;
@PostMapping(value = "/registration")
@ApiOperation("学生端 -- 报名: studentId/学生ID, laboratorySessionId/实验室场次预约ID")
public ResponseVO registration(@RequestBody ApplyDTO applyDTO) {
laboratoryUserMappingService.registration(applyDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/cancelRegistration")
@ApiOperation("学生端 -- 取消报名: studentId/学生ID, laboratorySessionId/实验室场次预约ID")
public ResponseVO cancelRegistration(@RequestBody ApplyDTO applyDTO) {
laboratoryUserMappingService.cancelRegistration(applyDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/getLaboratoryUserPage")
@ApiOperation("查看实验室预约名单:laboratorySessionId/实验室场次预约ID、startDate/预约时间")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getLaboratoryUserPage(@RequestBody LaboratoryUserPageDTO laboratoryUserPageDTO) {
return ResponseData.generateCreatedResponse(0, laboratoryUserMappingService.getLaboratoryUserPage(laboratoryUserPageDTO));
}
@PostMapping(value = "/delete")
@ApiOperation("删除查看实验室预约学生名单:id/学生报名记录ID")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO delete(@RequestBody LaboratoryUserMappingDO laboratoryUserMappingDO) {
laboratoryUserMappingService.removeById(laboratoryUserMappingDO.getId());
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/exportLaboratoryUser")
@ApiOperation("导出名单:laboratorySessionId/实验室场次预约ID、startDate/预约时间")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO exportLaboratoryUser(@RequestBody LaboratoryUserPageDTO laboratoryUserPageDTO) {
laboratoryUserMappingService.exportLaboratoryUser(laboratoryUserPageDTO);
return ResponseData.generateCreatedResponse(0);
}
}
package com.meishu.controller;
import com.meishu.service.PermissionsDictService;
import org.springframework.beans.factory.annotation.Autowired;
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-04-26
*/
@RestController
@Api(tags = "权限表")
@RequestMapping("/permissionsDict")
public class PermissionsDictController {
}
package com.meishu.controller;
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-04-26
*/
@RestController
@Api(tags = "用户角色映射表")
@RequestMapping("/roleAdministerMapping")
public class RoleAdministerMappingController {
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.role.AddPermissionDTO;
import com.meishu.dto.role.DeletePermissionDTO;
import com.meishu.dto.role.GetRoleTeachersDTO;
import com.meishu.dto.role.RoleTeacherDTO;
import com.meishu.mapper.RoleAdministerMappingMapper;
import com.meishu.model.RoleAdministerMappingDO;
import com.meishu.service.RoleDictService;
import com.meishu.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
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-04-26
*/
@RestController
@Api(tags = "角色字典表")
@RequestMapping("/roleDict")
public class RoleDictController {
@Autowired
private RoleDictService roleDictService;
@PostMapping("getAllRoles")
@ApiOperation("获取所有的角色")
// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getAllRoles(){
return ResponseData.generateCreatedResponse(0,roleDictService.getAllRoles());
}
@PostMapping("getRoleTeachers")
@ApiOperation("获取某一角色下的所有老师 {roleId :角色id userName:老师名字 pageSize pageNum}")
// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getRoleTeachers(@RequestBody GetRoleTeachersDTO getRoleTeachersDTO){
return ResponseData.generateCreatedResponse(0,roleDictService.getRoleTeachers(getRoleTeachersDTO));
}
@PostMapping("removeTeacher")
@ApiOperation("移除某一角色下的老师 ids {映射id} roleId :角色id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO removeTeacher(@RequestBody RoleTeacherDTO roleTeacherDTO){
return ResponseData.generateCreatedResponse(0,roleDictService.removeTeacher(roleTeacherDTO));
}
@PostMapping("roleTeacher")
@ApiOperation("添加老师的角色 ids:老师id[] roleId :角色id ")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO roleTeacher(@RequestBody RoleTeacherDTO roleTeacherDTO){
return ResponseData.generateCreatedResponse(0,roleDictService.roleTeacher(roleTeacherDTO));
}
@PostMapping("addPermission")
@ApiOperation("给角色添加权限 {roleId 角色id permissionIds 多个权限}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addPermission(@RequestBody AddPermissionDTO addPermissionDTO){
return ResponseData.generateCreatedResponse(0,roleDictService.addPermission(addPermissionDTO));
}
@PostMapping("deletePermission")
@ApiOperation("给角色删除权限 {roleId 角色id permissionIds 多个权限ids}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deletePermission(@RequestBody DeletePermissionDTO deletePermissionDTO){
return ResponseData.generateCreatedResponse(0,roleDictService.deletePermission(deletePermissionDTO));
}
}
package com.meishu.controller;
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-04-26
*/
@RestController
@Api(tags = "角色权限表")
@RequestMapping("/rolePermissionMapping")
public class RolePermissionMappingController {
}
package com.meishu.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.sessions.SessionsDictPageDTO;
import com.meishu.model.LaboratorySessionMappingDO;
import com.meishu.model.SessionsDictDO;
import com.meishu.service.SessionsDictService;
import com.meishu.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
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 DengMin
* @since 2021-08-17
*/
@RestController
@Api(tags = "场次字典表 - D")
@RequestMapping("/sessionsDict")
public class SessionsDictController {
@Autowired
private SessionsDictService sessionsDictService;
@PostMapping(value = "/getListAll")
@ApiOperation("手机端 -- 查询全部场次")
public ResponseVO getListAll() {
return ResponseData.generateCreatedResponse(0, sessionsDictService.list());
}
@PostMapping(value = "/getListById")
@ApiOperation("根据实验室ID查询场次: laboratoryDictId/实验室ID")
public ResponseVO getListById(@RequestBody LaboratorySessionMappingDO laboratorySessionMappingDO) {
return ResponseData.generateCreatedResponse(0, sessionsDictService.getListById(laboratorySessionMappingDO.getLaboratoryDictId()));
}
@PostMapping(value = "/getSessionsDictPage")
@ApiOperation("分页查询场次:pageNo/当前页数, pageSize/每页显示条数")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getSessionsDictPage(@RequestBody SessionsDictPageDTO sessionsDictPageDTO) {
return ResponseData.generateCreatedResponse(0, sessionsDictService.page(new Page(sessionsDictPageDTO.getPageNo(), sessionsDictPageDTO.getPageSize())));
}
@PostMapping(value = "/add")
@ApiOperation("添加场次:timeSlot/时间段(字符串:08:20 - 08:4)")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO add(@RequestBody SessionsDictDO sessionsDictDO) {
sessionsDictService.save(sessionsDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/update")
@ApiOperation("编辑场次:id/ID, timeSlot/时间段(字符串:08:20 - 08:04)")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO update(@RequestBody SessionsDictDO sessionsDictDO) {
sessionsDictService.updateById(sessionsDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/delete")
@ApiOperation("删除场次:id/ID")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO delete(@RequestBody SessionsDictDO sessionsDictDO) {
sessionsDictService.removeById(sessionsDictDO.getId());
return ResponseData.generateCreatedResponse(0);
}
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.dto.sign.ClassSignInDTO;
import com.meishu.service.SignInRecordService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
/**
* <p>
* 学生签到表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-09-28
*/
@RestController
@Api(tags = "学生签到表")
@RequestMapping("/signInRecord")
public class SignInRecordController {
@Autowired
private SignInRecordService signInRecordService;
@PostMapping("classSignIn")
@ApiOperation("获取某个班级的打卡记录 pageSize pageNum ")
public ResponseVO classSignIn(@RequestBody ClassSignInDTO classSignInDTO){
return ResponseData.generateCreatedResponse(0,signInRecordService.classSignIn(classSignInDTO));
}
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.dto.sms.SendVerifyCodeDTO;
import com.meishu.service.SmsCodeService;
import io.swagger.annotations.ApiOperation;
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;
/**
* <p>
* 短信验证码 前端控制器
* </p>
*
* @author Tuyp
* @since 2021-04-25
*/
@RestController
@RequestMapping("/sms")
public class SmsCodeController {
@Autowired
private SmsCodeService smsCodeService;
@PostMapping(value = "/send")
@ApiOperation("发送短信验证码")
public ResponseVO sendVerifyCode(@RequestBody SendVerifyCodeDTO sendVerifyCodeDTO ) {
smsCodeService.sendVerifyCode(sendVerifyCodeDTO);
return ResponseData.generateCreatedResponse(0);
}
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.campus.BatchUpdateStatusDTO;
import com.meishu.dto.student.*;
import com.meishu.dto.subject.BatchStatusOprDTO;
import com.meishu.model.*;
import com.meishu.service.StudentService;
import com.meishu.util.ConstantUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.java.Log;
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;
/**
* <p>
* 白名单 前端控制器
* </p>
*
* @author Tuyp
* @since 2021-04-25
*/
@RestController
@RequestMapping("/student")
@Api(tags = "学生端")
public class StudentController {
@Autowired
private StudentService studentService;
@PostMapping("sendMsg")
@ApiOperation("小程序---发送短信验证码 {telephone}")
public ResponseVO sendMsg(@RequestBody StudentDO studentDO){
return ResponseData.generateCreatedResponse(0,studentService.sendMsg(studentDO));
}
@PostMapping("login")
@ApiOperation("小程序---验证短信验证码 {telephone code}")
public ResponseVO login(@RequestBody SmsCodeDO smsCodeDO){
return ResponseData.generateCreatedResponse(0,studentService.login(smsCodeDO));
}
@PostMapping("addStudent")
@ApiOperation("添加学生 {telephone,username,parentTelephone,campusId}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addStudent(@RequestBody StudentDO studentDO){
return ResponseData.generateCreatedResponse(0,studentService.addStudent(studentDO));
}
@PostMapping("updateStudent" )
@ApiOperation("修改学生 id,username,parentTelephone,campusId,status 0:禁用 1:启用")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateStudent(@RequestBody StudentDO studentDO){
return ResponseData.generateCreatedResponse(0,studentService.updateStudent(studentDO));
}
@PostMapping("batchUpdateStudent")
@ApiOperation("批量修改学生状态 ids[] status")
public ResponseVO batchUpdateStudent(@RequestBody BatchStatusOprDTO batchStatusOprDTO){
return ResponseData.generateCreatedResponse(0,studentService.batchUpdateStudent(batchStatusOprDTO));
}
@PostMapping("deleteStudent")
@ApiOperation("删除学生 {ids[]}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteStudent(@RequestBody DeleteStudentDTO deleteStudentDTO){
return ResponseData.generateCreatedResponse(0,studentService.deleteStudent(deleteStudentDTO));
}
@PostMapping("queryStudent")
@ApiOperation("查询单个学生 id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO queryStudent(@RequestBody StudentDO studentDO){
return ResponseData.generateCreatedResponse(0,studentService.queryStudent(studentDO));
}
}
package com.meishu.controller;
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-17
*/
@RestController
@Api(tags = "")
@RequestMapping("/stuent-course-mapping-do")
public class StuentCourseMappingController {
}
package com.meishu.controller;
import com.meishu.service.SubjectDictService;
import org.springframework.beans.factory.annotation.Autowired;
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-08-17
*/
@RestController
@Api(tags = "学校科目字典表")
@RequestMapping("/subject")
public class SubjectDictController {
@Autowired
private SubjectDictService subjectDictService;
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.model.SubjectDimensionDictDO;
import com.meishu.model.SubjectTestPublishGradeDO;
import com.meishu.service.SubjectDimensionDictService;
import com.meishu.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
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-06
*/
@RestController
@Api(tags = "测评表")
@RequestMapping("/subjectDimensionDict")
public class SubjectDimensionDictController {
@Autowired
private SubjectDimensionDictService subjectDimensionDictService;
@PostMapping("getAllDimensions")
@ApiOperation("获取所有的维度 {ruleId 规则id}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getAllDimensions(@RequestBody SubjectDimensionDictDO subjectDimensionDictDO){
return ResponseData.generateCreatedResponse(0,subjectDimensionDictService.getAllDimensions(subjectDimensionDictDO));
}
@PostMapping("deleteDimensionById")
@ApiOperation("删除某个维度 {id}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteDimensionById(@RequestBody SubjectDimensionDictDO subjectDimensionDictDO){
return ResponseData.generateCreatedResponse(0,subjectDimensionDictService.deleteDimensionById(subjectDimensionDictDO));
}
@PostMapping("updateDimension")
@ApiOperation("编辑维度 {id dimension:维度名称 }")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateDimension(@RequestBody SubjectDimensionDictDO subjectDimensionDictDO){
return ResponseData.generateCreatedResponse(0,subjectDimensionDictService.updateDimension(subjectDimensionDictDO));
}
@PostMapping("addDimension")
@ApiOperation("新增维度 {id ruleId: }")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addDimension(@RequestBody SubjectDimensionDictDO subjectDimensionDictDO){
return ResponseData.generateCreatedResponse(0,subjectDimensionDictService.addDimension(subjectDimensionDictDO));
}
@PostMapping("getAllDimensionStar")
@ApiOperation("获取某个【规则】下的全部权限星级 publishId 规则id")
public ResponseVO getAllDimensionStar(@RequestBody SubjectTestPublishGradeDO subjectTestPublishGradeDO){
return ResponseData.generateCreatedResponse(0,subjectDimensionDictService.getAllDimensionStar(subjectTestPublishGradeDO));
}
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.dimension.AddStarDTO;
import com.meishu.dto.dimension.DeleteStarByIdDTO;
import com.meishu.model.SubjectDimensionStarDictDO;
import com.meishu.service.SubjectDimensionStarDictService;
import com.meishu.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
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-06
*/
@RestController
@Api(tags = "维度星级字典表")
@RequestMapping("/subjectDimensionStartDict")
public class SubjectDimensionStarDictController {
@Autowired
private SubjectDimensionStarDictService subjectDimensionStartDictService;
@PostMapping("getAllDimensionStars")
@ApiOperation("获取某个维度下所有的星级 {dimensionId:维度id star星级 }")
// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getAllDimensionStars(@RequestBody SubjectDimensionStarDictDO subjectDimensionStartDictDO){
return ResponseData.generateCreatedResponse(0,subjectDimensionStartDictService.getAllDimensionStars(subjectDimensionStartDictDO));
}
@PostMapping("deleteStarById")
@ApiOperation("删除某个星级 ids:id数组")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteStarById(@RequestBody DeleteStarByIdDTO deleteDimensionByIdDTO){
return ResponseData.generateCreatedResponse(0,subjectDimensionStartDictService.deleteStarById(deleteDimensionByIdDTO));
}
@PostMapping("addStar")
@ApiOperation("新建星级 treeIds:多个知识点的数组 dimensionId:维度i1111d star:星级 description:评析")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addStar(@RequestBody AddStarDTO addStarDTO){
return ResponseData.generateCreatedResponse(0,subjectDimensionStartDictService.addStar(addStarDTO));
}
@PostMapping("updateStar")
@ApiOperation("修改星级 id treeIds:多个知识点的数组 dimensionId:维度id star:星级 description:评析")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateStar(@RequestBody AddStarDTO addStarDTO){
return ResponseData.generateCreatedResponse(0,subjectDimensionStartDictService.updateStar(addStarDTO));
}
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.rule.GetAllRulesDTO;
import com.meishu.dto.rule.GetRuleReportDTO;
import com.meishu.model.SubjectRuleDO;
import com.meishu.service.SubjectRuleService;
import com.meishu.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
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-08
*/
@RestController
@Api(tags = "规则字典表")
@RequestMapping("/subjectRule")
public class SubjectRuleController {
@Autowired
private SubjectRuleService subjectRuleService;
@PostMapping("getAllRules")
@ApiOperation("获取所有规则 ")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getAllRules(@RequestBody GetAllRulesDTO getAllRulesDTO){
return ResponseData.generateCreatedResponse(0,subjectRuleService.getAllRules(getAllRulesDTO));
}
@PostMapping("getRules")
@ApiOperation("获取所有规则 ")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getRules(){
return ResponseData.generateCreatedResponse(0,subjectRuleService.getRules());
}
@PostMapping("addRule")
@ApiOperation("新建规则 {subjectId:科目id ruleName规则名称}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addRule(@RequestBody SubjectRuleDO subjectRuleDO){
return ResponseData.generateCreatedResponse(0,subjectRuleService.addRule(subjectRuleDO));
}
@PostMapping("updateRule")
@ApiOperation("更新规则 {id subjectId:科目id ruleName规则名称 status }")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateRule(@RequestBody SubjectRuleDO subjectRuleDO){
return ResponseData.generateCreatedResponse(0,subjectRuleService.updateRule(subjectRuleDO));
}
@PostMapping("deleteRule")
@ApiOperation("删除规则 {id}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteRule(@RequestBody SubjectRuleDO subjectRuleDO){
return ResponseData.generateCreatedResponse(0,subjectRuleService.deleteRule(subjectRuleDO));
}
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.dto.semester.GetSemesterScoreDTO;
import com.meishu.dto.semester.GetStudentDetailDTO;
import com.meishu.dto.semester.GetStudentRecordDTO;
import com.meishu.service.SubjectSemesterService;
import com.meishu.util.excel.ExcelUtil;
import com.meishu.vo.semester.GetSemesterScoreVO;
import com.meishu.vo.semester.GetStudentRecordVO;
import io.swagger.annotations.ApiOperation;
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;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author Tuyp
* @since 2021-08-11
*/
@RestController
@Api(tags = "学期表")
@RequestMapping("/semester")
public class SubjectSemesterController {
@Autowired
private SubjectSemesterService subjectSemesterService;
@PostMapping("getAllStudyingSemester")
@ApiOperation("获取所有在读班级")
public ResponseVO getAllStudyingSemester(){
return ResponseData.generateCreatedResponse(0,subjectSemesterService.getAllStudyingSemester());
}
@PostMapping("getAllPastSemester")
@ApiOperation("获取所有归档班级")
public ResponseVO getAllPastSemester(){
return ResponseData.generateCreatedResponse(0,subjectSemesterService.getAllPastSemester());
}
@PostMapping("getSemesterScore")
@ApiOperation("查看某个学期下的成绩 {pageSize pageNum grade classes session userName semester 上/下 subject 语文/数学....")
public ResponseVO getSemesterScore(@RequestBody GetSemesterScoreDTO getSemesterScoreDTO){
return ResponseData.generateCreatedResponse(0,subjectSemesterService.getSemesterScore(getSemesterScoreDTO));
}
@PostMapping("exportScore")
@ApiOperation("导出筛选后的数据 { grade classes session userName semester 上/下 subject 语文/数学....}")
public void exportScore(@RequestBody GetSemesterScoreDTO getSemesterScoreDTO){
List<GetSemesterScoreVO> getSemesterScoreVOS = subjectSemesterService.exportScore(getSemesterScoreDTO);
ExcelUtil.writeExcel(getSemesterScoreVOS,GetSemesterScoreVO.class);
}
@PostMapping("getStudentDetail")
@ApiOperation("获取学生分数详情 {pageSize pageNum id 学科+学期id userId 学生id}")
public ResponseVO getStudentDetail(@RequestBody GetStudentDetailDTO getStudentDetailDTO){
return ResponseData.generateCreatedResponse(0,subjectSemesterService.getStudentDetail(getStudentDetailDTO));
}
@PostMapping("getStudentRecord")
@ApiOperation("获取学生扣分记录 {startDate endDate}")
public void getStudentRecord(@RequestBody GetStudentRecordDTO getStudentRecordDTO){
List<GetStudentRecordVO> getStudentRecordVOS = subjectSemesterService.getStudentRecord(getStudentRecordDTO);
ExcelUtil.writeExcel(getStudentRecordVOS,GetStudentRecordVO.class);
}
}
package com.meishu.controller;
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-06
*/
@RestController
@Api(tags = "测评-知识点关联表")
@RequestMapping("/subject-star-tree-mapping-do")
public class SubjectStarTreeMappingController {
}
package com.meishu.controller;
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-13
*/
@RestController
@Api(tags = "学生答卷星级表")
@RequestMapping("/subject-student-answer-star-do")
public class SubjectStudentAnswerStarController {
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.test.GetAllTestDTO;
import com.meishu.model.SubjectTestDictDO;
import com.meishu.service.SubjectTestDictService;
import com.meishu.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
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-20
*/
@RestController
@Api(tags = "测评字典表")
@RequestMapping("/subjectTest")
public class SubjectTestDictController {
@Autowired
private SubjectTestDictService subjectTestService;
@PostMapping("getAllTest")
@ApiOperation("获取全部测评字典数据 分页 {ruleId testName pageSize pageNum}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getAllTest(@RequestBody GetAllTestDTO getAllTestDTO){
return ResponseData.generateCreatedResponse(0,subjectTestService.getAllTest(getAllTestDTO));
}
@PostMapping("getTest")
@ApiOperation("获取全不对测评 不分页 {ruleId testName}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getTest(@RequestBody GetAllTestDTO getAllTestDTO){
return ResponseData.generateCreatedResponse(0,subjectTestService.getTest(getAllTestDTO));
}
@PostMapping("insertTest")
@ApiOperation("新增一个测评 {ruleId 规则id testName:测评名称 examination:卷面}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO insertTest(@RequestBody SubjectTestDictDO subjectTestDictDO){
return ResponseData.generateCreatedResponse(0,subjectTestService.insertTest(subjectTestDictDO));
}
@PostMapping("updateTest")
@ApiOperation("修改一个测评 {id ruleId 规则id testName:测评名称 examination:卷面} ")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateTest(@RequestBody SubjectTestDictDO subjectTestDictDO){
return ResponseData.generateCreatedResponse(0,subjectTestService.updateTest(subjectTestDictDO));
}
@PostMapping("deleteByTestId")
@ApiOperation("删除一个测评 {id}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteByTestId(@RequestBody SubjectTestDictDO subjectTestDictDO){
return ResponseData.generateCreatedResponse(0,subjectTestService.deleteByTestId(subjectTestDictDO));
}
}
package com.meishu.controller;
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-06-21
*/
@RestController
@Api(tags = "样卷映射表")
@RequestMapping("/subject-test-grede-example-mapping-do")
public class SubjectTestGradeExampleMappingController {
}
package com.meishu.controller;
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-06-21
*/
@RestController
@Api(tags = "档次星级映射表")
@RequestMapping("/subject-test-grede-star-mapping-do")
public class SubjectTestGradeStarMappingController {
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.grade.AddGradeDTO;
import com.meishu.model.SubjectTestPublishGradeDO;
import com.meishu.service.SubjectTestPublishGradeService;
import com.meishu.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
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-06-21
*/
@RestController
@Api(tags = "档次表")
@RequestMapping("/subjectGrade")
public class SubjectTestPublishGradeController {
@Autowired
private SubjectTestPublishGradeService subjectTestPublishGradeService;
@PostMapping("addGrade")
@ApiOperation("添加一个档次 gradeName档次名称 publishId 发布id content 综合评价 subjectTestGradeExampleMappingDOS [exampleView 样卷地址] subjectTestGradeStarMappingDOS [starId 星级id]")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addGrade(@RequestBody AddGradeDTO addGradeDTO){
return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.addGrade(addGradeDTO));
}
@PostMapping("deleteGrade")
@ApiOperation("删除一个档次 id 档次id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteGrade(@RequestBody SubjectTestPublishGradeDO subjectTestPublishGradeDO){
return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.deleteGrade(subjectTestPublishGradeDO));
}
@PostMapping("queryGrade")
@ApiOperation("查询档次全部档次")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO queryGrade(@RequestBody SubjectTestPublishGradeDO subjectTestPublishGradeDO){
return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.queryGrade(subjectTestPublishGradeDO));
}
@PostMapping("queryOneGrade")
@ApiOperation("查询单个档次 id")
// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO queryOneGrade(@RequestBody SubjectTestPublishGradeDO subjectTestPublishGradeDO){
return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.queryOneGrade(subjectTestPublishGradeDO));
}
@PostMapping("updateGrade")
@ApiOperation("编辑某个档次 id gradeName档次名称 publishId 发布id subjectTestGradeExampleMappingDOS [exampleView 样卷地址] subjectTestGradeStarMappingDOS [starId 星级id] ")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateGrade(@RequestBody AddGradeDTO addGradeDTO){
return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.updateGrade(addGradeDTO));
}
@PostMapping("getRuleIdByPublishId")
@ApiOperation("通过publishId查询ruleId {publishId 发布id}")
public ResponseVO getRuleIdByPublishId(@RequestBody SubjectTestPublishGradeDO subjectTestPublishGradeDO){
return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.getRuleIdByPublishId(subjectTestPublishGradeDO));
}
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.test.*;
import com.meishu.model.SubjectTestDictDO;
import com.meishu.model.SubjectTestPublishHistoryDO;
import com.meishu.service.SubjectTestPublishHistoryService;
import com.meishu.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
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-08
*/
@RestController
@Api(tags = "测评发布记录表")
@RequestMapping("/subjectTestPublishHistory")
public class SubjectTestPublishHistoryController {
@Autowired
private SubjectTestPublishHistoryService subjectTestPublishHistoryService;
@PostMapping("publishTest")
@ApiOperation("发布一条测评 {testId 测评id outline studentIds coverPage 多个学生id testTime 测评时间}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO publishTest(@RequestBody PublishTestDTO publishTestDTO){
return ResponseData.generateCreatedResponse(0,subjectTestPublishHistoryService.publishTest(publishTestDTO));
}
@PostMapping("updatePublish")
@ApiOperation("修改一个测评 {publishId 发布id testId 测评id outline studentIds 多个学生id testTime 测评时间}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updatePublish(@RequestBody PublishTestDTO publishTestDTO){
return ResponseData.generateCreatedResponse(0,subjectTestPublishHistoryService.updatePublish(publishTestDTO));
}
@PostMapping("getPublishHistory")
@ApiOperation("获取所有的测评发布历史 {ruleId 规则id publishName测评名称 pageSize pageNum}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getPublishHistory(@RequestBody GetPublishHistoryDTO getPublishHistoryDTO){
return ResponseData.generateCreatedResponse(0,subjectTestPublishHistoryService.getPublishHistory(getPublishHistoryDTO));
}
@PostMapping("getTestReport")
@ApiOperation("测评报告 {ruleId 规则id publishName测评名称 pageSize pageNum}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getTestReport(@RequestBody GetTestReportDTO getTestReportDTO){
return ResponseData.generateCreatedResponse(0,subjectTestPublishHistoryService.getTestReport(getTestReportDTO));
}
@PostMapping("getOnePublish")
@ApiOperation("查看某个测评的报告 {id 发布的id}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getOnePublish(@RequestBody GetOnePublishDTO getOnePublishDTO){
return ResponseData.generateCreatedResponse(0,subjectTestPublishHistoryService.getOnePublish(getOnePublishDTO));
}
@PostMapping("comment")
@ApiOperation("评析卷子 {studentId 学生id publishId 发布id dimensionId 维度id starId 星级id administerId:评卷人id}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO comment(@RequestBody CommentDTO commentDTO){
return ResponseData.generateCreatedResponse(0,subjectTestPublishHistoryService.comment(commentDTO));
}
@PostMapping("deletePublish")
@ApiOperation("删除一条发布测评 id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deletePublish(@RequestBody SubjectTestPublishHistoryDO subjectTestPublishHistoryDO){
return ResponseData.generateCreatedResponse(0,subjectTestPublishHistoryService.deletePublish(subjectTestPublishHistoryDO));
}
}
package com.meishu.controller;
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-13
*/
@RestController
@Api(tags = "学生月考答卷")
@RequestMapping("/subject-test-student-answer-do")
public class SubjectTestStudentAnswerController {
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.subject.GetSubjectTreeDTO;
import com.meishu.dto.subject.UpdateTreeOrderDTO;
import com.meishu.model.SubjectTreeDO;
import com.meishu.service.SubjectTreeService;
import com.meishu.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
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-04-27
*/
@RestController
@Api(tags = "知识树")
@RequestMapping("/subjectTree")
public class SubjectTreeController {
@Autowired
private SubjectTreeService subjectTreeService;
@PostMapping("updateSubjectTree")
@ApiOperation("更新知识树子节点 id treeName:知识点名称 parentId父节点id treeNode 编号")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateSubjectTree(@RequestBody SubjectTreeDO subjectTreeDO){
return ResponseData.generateCreatedResponse(0,subjectTreeService.updateSubjectTree(subjectTreeDO));
}
@PostMapping("addSubjectTree")
@ApiOperation("添加知识树节点 subjectId 科目id parentId:父节点 treeName:知识点名称 " +
"treeNode 编号 ")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addSubjectTree(@RequestBody SubjectTreeDO subjectTreeDO){
return ResponseData.generateCreatedResponse(0,subjectTreeService.addSubjectTree(subjectTreeDO));
}
@PostMapping("deleteSubjectTree")
@ApiOperation("删除子节点(递归删除) {id}")
//@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteSubjectTree(@RequestBody SubjectTreeDO subjectTreeDO){
return ResponseData.generateCreatedResponse(0,subjectTreeService.deleteSubjectTree(subjectTreeDO));
}
@PostMapping("updateTreeOrder")
@ApiOperation("知识点排序 {ids[]知识树id parentId }")
public ResponseVO updateTreeOrder(@RequestBody UpdateTreeOrderDTO updateTreeOrderDTO){
return ResponseData.generateCreatedResponse(0,subjectTreeService.updateTreeOrder(updateTreeOrderDTO));
}
@PostMapping("getTreesCnt")
@ApiOperation("获取知识树+ 题目视频数 subjectId userId")
public ResponseVO getTreesCnt(@RequestBody GetSubjectTreeDTO getSubjectTreeDTO){
return ResponseData.generateCreatedResponse(0,subjectTreeService.getTreesCnt(getSubjectTreeDTO));
}
@PostMapping("getTreesCheckCnt")
@ApiOperation("获取知识树+ 视频题目审核数 subjectId userId shareStatus 2:待审核 1已审核")
public ResponseVO getTreesCheckCnt(@RequestBody GetSubjectTreeDTO getSubjectTreeDTO){
return ResponseData.generateCreatedResponse(0,subjectTreeService.getTreesCheckCnt(getSubjectTreeDTO));
}
}
package com.meishu.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 作业任务完成状态 前端控制器
* </p>
*
* @author DengMin
* @since 2021-09-16
*/
@RestController
@Api(tags = "作业任务完成状态")
@RequestMapping("/task-completion-status-do")
public class TaskCompletionStatusController {
}
package com.meishu.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 作业内容表(取题目,视频,书面作业) 前端控制器
* </p>
*
* @author DengMin
* @since 2021-09-16
*/
@RestController
@Api(tags = "作业内容表(取题目,视频,书面作业)")
@RequestMapping("/task-content-do")
public class TaskContentController {
}
package com.meishu.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 前端控制器
* </p>
*
* @author DengMin
* @since 2021-09-30
*/
@RestController
@Api(tags = "")
@RequestMapping("/task-content-done-info-do")
public class TaskContentDoneInfoController {
}
package com.meishu.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 前端控制器
* </p>
*
* @author DengMin
* @since 2021-09-16
*/
@RestController
@Api(tags = "")
@RequestMapping("/task-done-history-do")
public class TaskDoneHistoryController {
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.dto.sms.VerifyCodeDTO;
import com.meishu.dto.userrole.AccountLoginDTO;
import com.meishu.dto.userrole.AddStudentsDTO;
import com.meishu.dto.userrole.QueryStudentsDTO;
import com.meishu.model.UserRoleDO;
import com.meishu.service.UserRoleService;
import com.meishu.util.excel.ExcelUtil;
import com.meishu.vo.semester.GetSemesterScoreVO;
import com.meishu.vo.student.QueryStudentVO;
import com.meishu.vo.userrole.QueryStudentsVO;
import io.swagger.annotations.ApiOperation;
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;
import java.util.List;
/**
* <p>
* 学生表 前端控制器
* </p>
*
* @author Tuyp
* @since 2021-08-16
*/
@RestController
@Api(tags = "学生表")
@RequestMapping("/userRole")
public class UserRoleController {
@Autowired
private UserRoleService userRoleService;
@PostMapping(value = "/login")
@ApiOperation("手机端:实验室预约登录:phone/手机号, verifyCode/验证码")
public ResponseVO login(@RequestBody VerifyCodeDTO verifyCodeDTO) {
return ResponseData.generateCreatedResponse(0, userRoleService.login(verifyCodeDTO));
}
@PostMapping(value = "/accountLogin")
@ApiOperation("手机端:实验室预约账户登录:idCard/身份证, password/密码")
public ResponseVO accountLogin(@RequestBody AccountLoginDTO accountLoginDTO) {
return ResponseData.generateCreatedResponse(0, userRoleService.accountLogin(accountLoginDTO));
}
@PostMapping(value = "/userInfo")
@ApiOperation("获取用户信息:id/学生ID")
public ResponseVO userInfo(@RequestBody UserRoleDO userRoleDO) {
return ResponseData.generateCreatedResponse(0, userRoleService.userInfo(userRoleDO.getUserId()));
}
@PostMapping("queryStudents")
@ApiOperation("学生管理--查询所有学生 {pageSize pageNum userName 学生名称 grade 年级 session 入读时间 userStatus 状态 }")
public ResponseVO queryStudents(@RequestBody QueryStudentsDTO queryStudentsDTO){
return ResponseData.generateCreatedResponse(0,userRoleService.queryStudents(queryStudentsDTO));
}
@PostMapping("addStudents")
@ApiOperation("学生管理--添加学生 {userName:学生姓名 studyCode:学籍号 phone:手机号 idCard:身份证号 session:入学年份 gender:性别 email:邮箱 }")
public ResponseVO addStudents(@RequestBody UserRoleDO userRoleDO){
return ResponseData.generateCreatedResponse(0,userRoleService.addStudents(userRoleDO));
}
@PostMapping("updateStudent")
@ApiOperation("学生管理--编辑学生 {id userName:学生姓名 studyCode:学籍号 phone:手机号 idCard:身份证号 session:入学年份 gender:性别 email:邮箱}")
public ResponseVO updateStudent(@RequestBody UserRoleDO userRoleDO){
return ResponseData.generateCreatedResponse(0,userRoleService.updateStudent(userRoleDO));
}
@PostMapping("exportStudents")
@ApiOperation("学生管理--导出 { userName 学生名称 grade 年级 session 入读时间 userStatus 状态 0:归档 1:在读 2:休学}")
public void exportStudents(@RequestBody QueryStudentsDTO queryStudentsDTO){
List<QueryStudentsVO> queryStudentsVOS = userRoleService.exportStudents(queryStudentsDTO);
ExcelUtil.writeExcel(queryStudentsVOS, QueryStudentsVO.class);
}
@PostMapping("studycode")
public void studycode(){
userRoleService.studycode();
}
}
package com.meishu.controller;
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-08-17
*/
@RestController
@Api(tags = "老师-科目映射表")
@RequestMapping("/user-subject-mapping-do")
public class UserSubjectMappingController {
}
package com.meishu.controller;
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-08-18
*/
@RestController
@Api(tags = "平时成绩---老师班级权限")
@RequestMapping("/user-subject-permission-dict-do")
public class UserSubjectPermissionDictController {
}
package com.meishu.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 前端控制器
* </p>
*
* @author DengMin
* @since 2021-09-29
*/
@RestController
@Api(tags = "")
@RequestMapping("/uuid-history-do")
public class UuidHistoryController {
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.voddict.*;
import com.meishu.model.VodDictDO;
import com.meishu.model.VodPlayHistoryDO;
import com.meishu.model.VodSubjectTreeMappingDO;
import com.meishu.service.VodDictService;
import com.meishu.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
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-04-27
*/
@RestController
@Api(tags = "视频字典表")
@RequestMapping("/vodDict")
public class VodDictController {
@Autowired
private VodDictService vodDictService;
@PostMapping("/signature")
@ApiOperation("获取签名")
public ResponseVO signature()throws Exception{
return ResponseData.generateCreatedResponse(0,vodDictService.signature());
}
@PostMapping("getTreeVods")
@ApiOperation("(个人库/公共库)获取某个知识树下的视频 subjectId 科目id vodType:课型 vodName:视频名称 shareStatus 0:个人库 1:公共库 treeId:知识树id userId 用户id pageSize pageNum")
// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getTreeVods (@RequestBody GetTreeVodsDTO getTreeVodsDTO){
return ResponseData.generateCreatedResponse(0,vodDictService.getTreeVods(getTreeVodsDTO));
}
@PostMapping("getCheckTreeVods")
@ApiOperation("(审核)获取某个知识树下的视频 subjectId 科目id vodType:课型 vodName:视频名称 checkStatus 1:已审核 2:待审核 treeId:知识树id userId 用户id pageSize pageNum")
// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getCheckTreeVods (@RequestBody GetTreeVodsDTO getTreeVodsDTO){
return ResponseData.generateCreatedResponse(0,vodDictService.getCheckTreeVods(getTreeVodsDTO));
}
@PostMapping("deleteVod")
@ApiOperation("删除某个视频(从腾讯云中也删除) id ")
// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteVod(@RequestBody VodDictDO vodDictDO){
return ResponseData.generateCreatedResponse(0,vodDictService.deleteVod(vodDictDO));
}
@PostMapping("uploadVods")
@ApiOperation("上传某个视频 {subjectId 科目id vodName视频名称 vodUrl 视频地址 vodType课型" +
"vodIntro 视频介绍 vodLength视频长度 vodCode:腾讯云上视频code administerId 视频提供者" +
"treeIds 多个知识点(数组)}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO uploadVods(@RequestBody UploadVodsDTO uploadVodsDTO){
return ResponseData.generateCreatedResponse(0,vodDictService.uploadVods(uploadVodsDTO));
}
@PostMapping("updateVod")
@ApiOperation("修改某个视频 {id 视频名称 subjectId 科目id vodName视频名称 vodUrl 视频地址 vodType课型" +
" vodIntro 视频介绍 vodLength视频长度 vodCode:腾讯云上视频code administerId 视频提供者" +
"treeIds 多个知识点(数组)}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateVod(@RequestBody UploadVodsDTO uploadVodsDTO){
return ResponseData.generateCreatedResponse(0,vodDictService.updateVod(uploadVodsDTO));
}
@PostMapping("getVodInfo")
@ApiOperation("小程序---获取视频详情 id:视频id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getVodInfo(@RequestBody VodDictDO vodDictDO){
return ResponseData.generateCreatedResponse(0,vodDictService.getVodInfo(vodDictDO));
}
@PostMapping("insertPlayHistory")
@ApiOperation("小程序--记录播放记录 {vodId 视频id treeId知识点 studentId 学生id playLength 观看时长 playRecord 播放位点}")
// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO insertPlayHistory(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){
return ResponseData.generateCreatedResponse(0,vodDictService.insertPlayHistory(vodPlayHistoryDO));
}
@PostMapping("getToCheckVodCounts")
@ApiOperation("获取所有未审核/已审核的视频个数 {subjectId 科目 checkStatus 审核状态 1:已审核 2:待审核}")
// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getToCheckVodCounts(@RequestBody GetToCheckVodCountsDTO getToCheckVodCountsDTO){
return ResponseData.generateCreatedResponse(0,vodDictService.getToCheckVodCounts(getToCheckVodCountsDTO));
}
@PostMapping("compressVodByCode")
@ApiOperation("通过code压缩视频并删除原视频 {id 视频id }")
public ResponseVO compressVodByCode(@RequestBody VodDictDO vodDictDO){
return ResponseData.generateCreatedResponse(0,vodDictService.compressVodByCode(vodDictDO));
}
@PostMapping("deleteOriginVod")
@ApiOperation("删除原视频")
public ResponseVO deleteOriginVod(@RequestBody DeleteOriginVodDTO deleteOriginVodDTO){
return ResponseData.generateCreatedResponse(0,vodDictService.deleteOriginVod(deleteOriginVodDTO));
}
@PostMapping("checkVod")
@ApiOperation("审核视频 {checkId 审核人id id 视频id vodType:课型 vodName:视频名称 treeIds:多个知识点id checkStatus 1:审核通过 3:未通过 reason:原因}")
public ResponseVO checkVod(@RequestBody CheckVodDTO checkVodDTO){
return ResponseData.generateCreatedResponse(0,vodDictService.checkVod(checkVodDTO));
}
@PostMapping("publicUpload")
@ApiOperation("公共资源上载 {userId checkStatus 1:审核通过 2:审核中 3:未通过}")
public ResponseVO publicUpload(@RequestBody PublicCheckingDTO publicCheckingDTO){
return ResponseData.generateCreatedResponse(0,vodDictService.publicUpload(publicCheckingDTO));
}
@PostMapping("withdraw")
@ApiOperation("撤回视频 id 视频id")
public ResponseVO withdraw(@RequestBody VodDictDO vodDictDO){
return ResponseData.generateCreatedResponse(0,vodDictService.withdraw(vodDictDO));
}
@PostMapping("getVodDetail")
@ApiOperation("获取一个视频详情{id}")
public ResponseVO getVodDetail(@RequestBody VodDictDO vodDictDO){
return ResponseData.generateCreatedResponse(0,vodDictService.getVodDetail(vodDictDO));
}
@PostMapping("setRelatedVod")
@ApiOperation("设置关联题目 {vodId 视频id status 1:关联 0:取消关联}")
public ResponseVO setRelatedVod(@RequestBody VodSubjectTreeMappingDO vodSubjectTreeMappingDO){
return ResponseData.generateCreatedResponse(0,vodDictService.setRelatedVod(vodSubjectTreeMappingDO));
}
}
package com.meishu.controller;
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-04-27
*/
@RestController
@Api(tags = "视频播放历史记录表")
@RequestMapping("/vod-play-history-do")
public class VodPlayHistoryController {
}
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.subject.BatchStatusOprDTO;
import com.meishu.dto.subject.GetAllVodsStatusDTO;
import com.meishu.service.VodSubjectTreeMappingService;
import com.meishu.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
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-04-27
*/
@RestController
@Api(tags = "视频知识点映射表")
@RequestMapping("/vodTreeMapping")
public class VodSubjectTreeMappingController {
@Autowired
private VodSubjectTreeMappingService vodSubjectTreeMappingService;
@PostMapping("getAllVodsStatus")
@ApiOperation("获取所有未授权的视频 subjectId status 0:未授权 1:已授权")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getAllVodsStatus(@RequestBody GetAllVodsStatusDTO getAllNoAuthenVodsDTO){
return ResponseData.generateCreatedResponse(0,vodSubjectTreeMappingService.getAllNoAuthenVods(getAllNoAuthenVodsDTO));
}
@PostMapping("batchStatusOpr")
@ApiOperation("批量操作视频审核状态 {ids 多个视频id[] status 1:通过 0:驳回}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO batchStatusOpr(@RequestBody BatchStatusOprDTO batchStatusOprDTO){
return ResponseData.generateCreatedResponse(0,vodSubjectTreeMappingService.batchStatusOpr(batchStatusOprDTO));
}
}
package com.meishu.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.configure.RestTemplateConfig;
import com.meishu.common.configure.WechatConfig;
import com.meishu.dto.wechat.AuthenRequestDTO;
import com.meishu.dto.wechat.JsSdkDTO;
import com.meishu.dto.wechat.SignDTO;
import com.meishu.mapper.AccessTokenMapper;
import com.meishu.mapper.StudentMapper;
import com.meishu.model.AccessTokenDO;
import com.meishu.model.StudentDO;
import com.meishu.util.SecretUtils;
import com.meishu.util.WechatUtil;
import com.meishu.vo.wechat.AuthenTokenVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
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 java.time.LocalDateTime;
import java.util.List;
@RestController
@RequestMapping("/wechat")
@Api(tags = "微信授权")
public class WechatController {
@Autowired
private RestTemplateConfig restTemplateConfig;
@Autowired
private WechatConfig wechatConfig;
@Autowired
private AccessTokenMapper accessTokenMapper;
@Autowired
private StudentMapper studentMapper;
@PostMapping(value = "/getJsapiTicket")
@ApiOperation("通过token请求获得jsapi_ticket {url}")
public ResponseVO getJsapiTicket(@RequestBody SignDTO signVO) {
List<AccessTokenDO> accessTokens = accessTokenMapper.selectList(null);
String accessToken = "";
if (accessTokens.size() == 0) {
accessToken = WechatUtil.getAccessToken().getAccess_token();
AccessTokenDO accessToken1 = new AccessTokenDO();
accessToken1.setAccessToken(accessToken);
accessToken1.setUpdateDate(LocalDateTime.now());
accessTokenMapper.insert(accessToken1);
} else {
AccessTokenDO accessToken1 = accessTokens.get(0);
int diff = LocalDateTime.now().getNano() - accessToken1.getUpdateDate().getNano();
if (diff >= 2 * 60 * 60*1000000000 - 5*1000000000) {
accessToken = WechatUtil.getAccessToken().getAccess_token();
accessToken1.setAccessToken(accessToken);
accessToken1.setUpdateDate(LocalDateTime.now());
accessTokenMapper.updateById(accessToken1);
} else {
accessToken = accessToken1.getAccessToken();
}
}
signVO.setAccess_token(accessToken);
String url1 = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=" + accessToken + "&type=jsapi";
ResponseEntity<JsSdkDTO> response1 = restTemplateConfig.restTemplate()
.exchange(url1, HttpMethod.GET, null, JsSdkDTO.class);
String ticket = response1.getBody().getTicket();
signVO.setJsapi_ticket(ticket);
signVO.setNoncestr("Wm3WZYTPz0wzccnW");
signVO.setTimestamp(String.valueOf(System.currentTimeMillis()));
String signStr = "jsapi_ticket=" + signVO.getJsapi_ticket() + "&noncestr=" + signVO.getNoncestr() + "&timestamp=" + signVO.getTimestamp()
+ "&url=" + signVO.getUrl();
signVO.setSign(SecretUtils.getSHAString(signStr));
signVO.setAppId(wechatConfig.getAppId());
signVO.setAgentId(wechatConfig.getAgentId());
return ResponseData.generateCreatedResponse(0, signVO);
}
@PostMapping("/webAuthen")
@ApiOperation("网页授权 通过code换取身份信息 {code phone 手机号}")
public ResponseVO webAuthen(@RequestBody AuthenRequestDTO authenRequestDTO) {
String url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + wechatConfig.getAppId() + "&secret=" +
wechatConfig.getAppSecret() + "&code=" + authenRequestDTO.getCode() + "&grant_type=authorization_code";
ResponseEntity<AuthenTokenVO> response = restTemplateConfig.restTemplate()
.exchange(url, HttpMethod.GET, null, AuthenTokenVO.class);
AuthenTokenVO authenTokenVO = response.getBody();
//通过openId从库里查询
StudentDO user = studentMapper.selectOne(new QueryWrapper<StudentDO>()
.lambda()
.eq(StudentDO::getOpenid,authenTokenVO.getOpenid()));
if (null==user){
String url1 = "https://api.weixin.qq.com/sns/userinfo?access_token=" + authenTokenVO.getAccess_token() + "&openid=" + authenTokenVO.getOpenid() + "&lang=zh_CN";
ResponseEntity<AuthenTokenVO> response1 = restTemplateConfig.restTemplate()
.exchange(url1, HttpMethod.GET, null, AuthenTokenVO.class);
return ResponseData.generateCreatedResponse(0,response1.getBody());
}else {
// //该openId已存在,查出该用户的角色信息
//
// List<UserInfoVO> userInfoVOS = new ArrayList<>();
// QueryWrapper queryWrapper = new QueryWrapper();
// queryWrapper.eq("user_id",user.getId());
// queryWrapper.eq("role_type","学生");
// List<UserRole> userRoles = userRoleMapper.selectList(queryWrapper);
// for (UserRole userRole : userRoles){
// UserInfoVO userInfoVO = new UserInfoVO();
// BeanUtils.copyProperties(userRole,userInfoVO);
// ClassesDict classesDict = classesDictMapper.selectById(userRole.getClassesId());
// userInfoVO.setSchool(classesDict.getSchool());
// userInfoVO.setGrade(classesDict.getGrade());
// userInfoVO.setClasses(classesDict.getClasses());
// userInfoVO.setSession(classesDict.getSession());
// userInfoVO.setSubjectType(classesDict.getSubjectType());
// userInfoVOS.add(userInfoVO);
// }
return null;
}
}
}
package com.meishu.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 通知/附件作业表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-09-16
*/
@RestController
@Api(tags = "通知/附件作业表")
@RequestMapping("/written-homework-do")
public class WrittenHomeworkController {
}
package com.meishu.dto.administer;
import com.meishu.model.AdministerDO;
import lombok.Data;
import java.util.List;
@Data
public class AddAdministerDTO extends AdministerDO {
private List<Long> campusIds;
private List<Long> departmentIds;
private List<Long> subjectIds;
private List<Long> roleIds;
}
package com.meishu.dto.administer;
import lombok.Data;
import java.util.List;
@Data
public class ChangeStatusDTO {
private List<Long> ids;
private String status;
}
package com.meishu.dto.administer;
import lombok.Data;
/**
* @author: tuyp
* @create: 2020-06-22 18:18
*/
@Data
public class GetClassesRequestVO {
private Integer userId;
private String status;
private String subject;
private String subjectType;
}
package com.meishu.dto.administer;
import lombok.Data;
/**
* @author: tuyp
* @create: 2020-07-21 14:48
*/
@Data
public class PublishExpandingVO {
private String expandingExeIds;
private String expandingStudents;
private String expandingName;
}
package com.meishu.dto.administer;
import lombok.Data;
/**
* @author: tuyp
* @create: 2020-07-21 14:52
*/
@Data
public class PublishHomeworkVO {
private Integer homeworkType;
private String homeworkContent;
private Integer adviceLength;
private String fileSize;
private String fileType;
private String fileName;
}
package com.meishu.dto.administer;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class PublishTasksDTO {
private Integer id;
private String treeName;
private Integer taskType;
private String treeIds;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date taskDate;
private List<String> subjectIds;
private Integer userId;
private String vodIds;
private String relatedIds;
private Integer adviceLength;
private List<PublishExpandingVO> publishExpandingVOS;
private List<PublishHomeworkVO> publishHomeworkVOS;
}
package com.meishu.dto.administer;
import lombok.Data;
@Data
public class PushMsgPO {
private String title;
private String school;
private String teacherName;
private String taskName;
private String DateTime;
private String remark;
private String openId;
}
package com.meishu.dto.administer;
import com.meishu.model.AdministerDO;
import lombok.Data;
import java.util.List;
@Data
public class UpdateAdministerDTO extends AdministerDO {
private List<Long> campusIds;
private List<Long> departmentIds;
private List<Long> subjectIds;
private List<Long> roleIds;
}
package com.meishu.dto.campus;
import lombok.Data;
import java.util.List;
@Data
public class BatchUpdateStatusDTO {
private List<Long> id;
private String status;
}
package com.meishu.dto.campus;
import lombok.Data;
@Data
public class CampusStudentDTO {
private Long campusId;
private String username;
private Integer pageSize;
private Integer pageNum;
}
package com.meishu.dto.chapter;
import lombok.Data;
import java.util.List;
@Data
public class AddTreeToChapterDTO {
private List<Long> ids;
private Long chapterId;
}
package com.meishu.dto.chapter;
import com.meishu.model.CourseTreeDO;
import lombok.Data;
import java.util.List;
@Data
public class ChapterExerciseVO {
private String createTime;
private Integer rightCounts;
private Integer totalCounts;
private String chapter;
private List<CourseTreeDO> courseTreeDOS;
}
package com.meishu.dto.chapter;
import lombok.Data;
@Data
public class ChapterVodsVO {
private Long vodId;
private String vodName;
private String treeName;
private Integer vodLength;
private Integer playRecord;
private String lengthPercent;
private String createTime;
private Integer playCounts;
private Long id;
}
package com.meishu.dto.chapter;
import com.meishu.vo.course.GetExerciseDetailVO;
import lombok.Data;
import java.util.List;
@Data
public class GetChapterCourseDetailVO {
private String chapter;
private String createTime;
private Integer rightCounts;
private Integer totalCounts;
private String avgRightPercent;
private Integer useLength;
private Integer avgLength;
private List<GetExerciseDetailVO> getExerciseDetailVOS;
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!