Commit b8a6f5cc by 邓敏

Merge branch 'websocker' into 'master'

Websocker

See merge request !1
2 parents 03ff6ba5 a3bbd3a0
Showing with 2863 additions and 327 deletions
......@@ -31,6 +31,8 @@
<itext-asian.version>5.2.0</itext-asian.version>
<itextpdf.version>5.4.1</itextpdf.version>
<java-jwt.version>3.10.3</java-jwt.version>
<jedis.version>3.3.0</jedis.version>
<collections.version>3.2.2</collections.version>
</properties>
<dependencies>
......@@ -132,11 +134,11 @@
<version>${swagger2.version}</version>
</dependency>
<dependency>
<groupId>com.amdelamar</groupId>
<artifactId>jhash</artifactId>
<version>${jhash.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.amdelamar</groupId>-->
<!-- <artifactId>jhash</artifactId>-->
<!-- <version>${jhash.version}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.apache.poi</groupId>
......@@ -190,6 +192,40 @@
<artifactId>jlatexmath</artifactId>
<version>1.0.7</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-quartz</artifactId>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>${jedis.version}</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>${collections.version}</version>
</dependency>
<!--webSocket-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-data-mongodb</artifactId>-->
<!-- </dependency>-->
</dependencies>
<build>
......@@ -198,6 +234,7 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.2.6.RELEASE</version>
<configuration>
<excludes>
<exclude>
......
package com.subsidy;
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;
......@@ -21,19 +18,19 @@ public class MeishuApplication {
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;
}
//@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.subsidy.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.subsidy.common;
public class RedisPrefixConstant {
/**
* subsidyAdminister_accountName:AdministerDO 老师账号密码
*/
public static final String SUBSIDY_ADMINISTER_PREFIX = "subsidyAdminister:";
/**
* subsidyMember_companyId_accountName:MemberDO 学员账号密码
*/
public static final String SUBSIDY_COMPANY_MEMBER_PREFIX = "subsidyMember:";
///**
// *subsidy_memberLogin_memberId_userName_companyName_now : 学员端审计记录
// */
//public static final String SUBSIDY_MEMBER_LOGIN_PREFIX = "subsidy:memberLogin:";
/**
* subsidySmsCode_telephone:code 手机验证码
*/
public static final String SUBSIDY_TELEPHONE_PREFIX = "subsidySmsCode:";
/**
* subsidySettings:companyId:ClassHourDictDO 公司操作设置
*/
public static final String SUBSIDY_SETTINGS_PREFIX = "subsidySettings:";
/**
* subsidySignInfo:memberId:1:classId:12:20211223:long,do 学生签到数据
*/
public static final String SUBSIDY_SIGN_INFO_PREFIX = "subsidySignInfo:memberId:";
}
package com.subsidy.common.configure;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Data
@Configuration
@ConfigurationProperties(prefix = "activity")
public class ActivityDetectionConfig {
private Long captchaAppId;
private String appSecretKey;
private Long businessId;
}
package com.subsidy.common.configure;
import org.quartz.spi.TriggerFiredBundle;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.scheduling.quartz.AdaptableJobFactory;
import org.springframework.stereotype.Component;
/**
* <p>
* JobFactory实例
* </p>
*
* @author DengMin
* @since 2020/12/9
*/
@Component
public class JobFactory extends AdaptableJobFactory {
private AutowireCapableBeanFactory factory;
public JobFactory(AutowireCapableBeanFactory factory) {
this.factory = factory;
}
@Override
protected Object createJobInstance(TriggerFiredBundle bundle) throws Exception {
Object job = super.createJobInstance(bundle);
factory.autowireBean(job);
return job;
}
}
package com.subsidy.common.configure;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Data
@Configuration
@ConfigurationProperties(prefix = "qxueyou")
public class QXueYouConfig {
private String appId;
private String securityKey;
private String url;
}
package com.subsidy.common.configure;
import org.quartz.Scheduler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
import javax.sql.DataSource;
/**
* <p>
* Quartz配置
* </p>
*
* @author DengMin
* @since 2020/12/8
*/
@Configuration
public class QuartzConfig {
@Autowired
private JobFactory jobFactory;
@Autowired
private DataSource dataSource;
@Bean
public SchedulerFactoryBean schedulerFactoryBean() {
SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean();
schedulerFactoryBean.setOverwriteExistingJobs(true);
schedulerFactoryBean.setStartupDelay(60);
schedulerFactoryBean.setJobFactory(jobFactory);
schedulerFactoryBean.setOverwriteExistingJobs(true);
schedulerFactoryBean.setStartupDelay(1);
schedulerFactoryBean.setDataSource(dataSource);
schedulerFactoryBean.setConfigLocation(new ClassPathResource("/application-quartz.properties"));
return schedulerFactoryBean;
}
@Bean
public Scheduler scheduler() {
return schedulerFactoryBean().getScheduler();
}
}
package com.subsidy.common.configure;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.ListOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.SetOperations;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.data.redis.core.ZSetOperations;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
@EnableCaching
/**
* <p>
* Redis
* </p>
*
* @author DengMin
* @since 2020/12/14
*/
@Configuration
public class RedisConfig extends CachingConfigurerSupport {
/**
* retemplate相关配置
* @param factory
* @return
*/
@Bean
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) {
RedisTemplate<String, Object> template = new RedisTemplate<>();
// 配置连接工厂
template.setConnectionFactory(factory);
//使用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值(默认使用JDK的序列化方式)
Jackson2JsonRedisSerializer jacksonSeial = new Jackson2JsonRedisSerializer(Object.class);
ObjectMapper om = new ObjectMapper();
// 指定要序列化的域,field,get和set,以及修饰符范围,ANY是都有包括private和public
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
// 指定序列化输入的类型,类必须是非final修饰的,final修饰的类,比如String,Integer等会跑出异常
om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
jacksonSeial.setObjectMapper(om);
// 值采用json序列化
template.setValueSerializer(jacksonSeial);
//使用StringRedisSerializer来序列化和反序列化redis的key值
template.setKeySerializer(new StringRedisSerializer());
// 设置hash key 和value序列化模式
template.setHashKeySerializer(new StringRedisSerializer());
template.setHashValueSerializer(jacksonSeial);
template.afterPropertiesSet();
return template;
}
/**
* 对hash类型的数据操作
*
* @param redisTemplate
* @return
*/
@Bean
public HashOperations<String, String, Object> hashOperations(RedisTemplate<String, Object> redisTemplate) {
return redisTemplate.opsForHash();
}
/**
* 对redis字符串类型数据操作
*
* @param redisTemplate
* @return
*/
@Bean
public ValueOperations<String, Object> valueOperations(RedisTemplate<String, Object> redisTemplate) {
return redisTemplate.opsForValue();
}
/**
* 对链表类型的数据操作
*
* @param redisTemplate
* @return
*/
@Bean
public ListOperations<String, Object> listOperations(RedisTemplate<String, Object> redisTemplate) {
return redisTemplate.opsForList();
}
/**
* 对无序集合类型的数据操作
*
* @param redisTemplate
* @return
*/
@Bean
public SetOperations<String, Object> setOperations(RedisTemplate<String, Object> redisTemplate) {
return redisTemplate.opsForSet();
}
/**
* 对有序集合类型的数据操作
*
* @param redisTemplate
* @return
*/
@Bean
public ZSetOperations<String, Object> zSetOperations(RedisTemplate<String, Object> redisTemplate) {
return redisTemplate.opsForZSet();
}
}
\ No newline at end of file
package com.subsidy.common.configure;
import com.subsidy.common.interceptor.AuthenticationInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
......@@ -59,5 +64,15 @@ public class WebConfig implements WebMvcConfigurer {
.addPathPatterns("/**");
}
@Bean
public CorsFilter corsFilter() {
CorsConfiguration config = new CorsConfiguration();
config.setMaxAge(3600L);
config.addAllowedOrigin("*");
config.addAllowedMethod("*");
config.addAllowedHeader("*");
UrlBasedCorsConfigurationSource configSource = new UrlBasedCorsConfigurationSource();
configSource.registerCorsConfiguration("/**", config);
return new CorsFilter(configSource);
}
}
\ No newline at end of file
......@@ -30,13 +30,13 @@ public class WebLogAspect {
public void logBeforeController(JoinPoint joinPoint) {
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
// RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
//这个RequestContextHolder是Springmvc提供来获得请求的东西
HttpServletRequest request = ((ServletRequestAttributes)requestAttributes).getRequest();
// HttpServletRequest request = ((ServletRequestAttributes)requestAttributes).getRequest();
// 记录下请求内容
logger.info("####requestUrl : " + request.getRequestURL().toString());
logger.info("####requestParam : " + Arrays.toString(joinPoint.getArgs()));
// logger.info("####requestUrl : " + request.getRequestURL().toString());
// logger.info("####requestParam : " + Arrays.toString(joinPoint.getArgs()));
}
......
package com.subsidy.common.configure;
import com.subsidy.common.interceptor.WebSocketInterceptor;
import com.subsidy.util.websocket.WebSocketUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
/**
* <p>
* WebSocket 配置
* </p>
*
* @author DengMin
* @since 2022/7/13
*/
@Configuration
@EnableWebSocket
public class WebSocketConfig implements WebSocketConfigurer {
@Autowired
private WebSocketUtil webSocketUtil;
@Autowired
private WebSocketInterceptor webSocketInterceptor;
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
registry
.addHandler(webSocketUtil, "socket")
.addInterceptors(webSocketInterceptor) // 自定义验证规则
.setAllowedOrigins("*");
}
}
\ No newline at end of file
......@@ -14,11 +14,11 @@ public class WechatConfig {
private String appSecret;
private String msgUrl;
private String templateId;
private String agentId;
//private String msgUrl;
//
//private String templateId;
//
//private String agentId;
}
......@@ -15,7 +15,7 @@ public enum Code {
NOHANDLERFOUND(1008,"找不到相应的视图处理器"),
PARAM_INVALID(1009, "参数不合法"),
TOKEN_EXCEPTION(1010, "无效的令牌"),
TOKEN_EXPIRED(1011, "令牌已过期"),
TOKEN_EXPIRED(1011, "当前账户已在其他设备登录"),
TOKEN_VERIFICATION_FAILED(1013, "令牌验证失败"),
OSS_ERROR(1012, "OSS文件上传异常"),
Network_ERROR(9000, "网络请求失败"),
......
package com.subsidy.common.constant;
public class CourseNotification {
public static final String UNSENT = "待发送";
public static final String SENT = "已发送";
}
package com.subsidy.common.constant;
import lombok.Getter;
@Getter
public enum SmsCode {
SIGN_IN("SMS_234409992", "签到通知"),
TEST("SMS_234414789", "测试通知"),
CLASS_START("SMS_228137810", "开课通知"),
ALL("SMS_228137810", "全部成员"),
NOT_SIGNED_IN("SMS_234409992","未签到成员"),
UNFINISHED("SMS_234414789","未完课成员");
private String type;
private String code;
SmsCode(String code, String type) {
this.code = code;
this.type = type;
}
}
......@@ -111,8 +111,9 @@ public class GlobalExceptionHandler {
@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());
// log.error("path:"+url);
// log.error("---- error message: ---"+e.toString());
e.printStackTrace();
return ResponseData.generateCreatedResponse(Code.SERVER_INTERNAL_ERROR.getCode(), Code.SERVER_INTERNAL_ERROR.getMessage(), url);
}
}
\ No newline at end of file
package com.subsidy.common.interceptor;
import com.alibaba.fastjson.JSON;
import com.auth0.jwt.interfaces.Claim;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.constant.Code;
import com.subsidy.common.exception.HttpException;
import com.subsidy.mapper.AdministerMapper;
import com.subsidy.mapper.MemberMapper;
import com.subsidy.model.AdministerDO;
import com.subsidy.model.MemberDO;
import com.subsidy.util.ConstantUtils;
import com.subsidy.util.JwtUtil;
import com.subsidy.util.Localstorage;
import com.subsidy.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.lang.reflect.Method;
import java.nio.charset.StandardCharsets;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
/**
......@@ -31,7 +46,14 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
@Autowired
private AdministerMapper administerMapper;
@Autowired
private MemberMapper memberMapper;
@Autowired
private RedisUtil redisUtil;
@Override
@CrossOrigin()
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
// 不需要进行拦截
if (!(handler instanceof HandlerMethod)) {
......@@ -40,6 +62,16 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
HandlerMethod handlerMethod = (HandlerMethod) handler;
Method method = handlerMethod.getMethod();
TimeRequired timeRequired = method.getAnnotation(TimeRequired.class);
if (timeRequired !=null){
Calendar calendar = Calendar.getInstance();
int hour = calendar.get(Calendar.HOUR_OF_DAY);
if (hour<6){
throw new HttpException(17001);
}
}
LoginRequired methodAnnotation = method.getAnnotation(LoginRequired.class);
if (methodAnnotation != null) {
String authorization = request.getHeader("Authorization");
......@@ -49,36 +81,47 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
token = authorization.replace("Bearer ", "");
}
/*Token不存在*/
if (token == null || JwtUtil.isExpired(token) || !JwtUtil.verifyToken(token)) {
if (token == null || !JwtUtil.verifyToken(token)) {
throw new HttpException(1010);
}
Map<String, Claim> claimMap = JwtUtil.getClaims(token);
if (claimMap != null) {
String[] role = methodAnnotation.value();
//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 {
if (ConstantUtils.ADMINISTER_TERMINATE.equals(type)) {
AdministerDO administerDO = administerMapper.selectById(claimMap.get("id").asLong());
if (administerDO != null) {
Localstorage.setUser(administerDO);
return true;
}
} else if(ConstantUtils.MOBILE_TERMINATE.equals(type)) {
MemberDO memberDO = memberMapper.selectById(claimMap.get("id").asLong());
if(memberDO != null) {
Localstorage.setUser(memberDO);
return true;
}
/**
* 学生端设置单设备登录
*/
/* String tk = (String) redisUtil.get(ConstantUtils.MOBILE_TERMINATE+"_"+claimMap.get("id").asLong());
if(StringUtils.isNotBlank(tk)) {
if(tk.equals(token)) {
return true;
}
throw new HttpException(1011);
} else {
throw new HttpException(1010);
}*/
} else {
throw new HttpException(1010);
}
}
//return true;
}
throw new HttpException(1010);
}
return true;
}
}
......@@ -16,5 +16,5 @@ import java.lang.annotation.*;
@Inherited
public @interface LoginRequired {
String[] value();
//String[] value();
}
\ No newline at end of file
package com.subsidy.common.interceptor;
import java.lang.annotation.*;
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
public @interface TimeRequired {
}
package com.subsidy.common.interceptor;
import com.subsidy.mapper.MemberMapper;
import com.subsidy.model.MemberDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
import org.springframework.http.server.ServletServerHttpRequest;
import org.springframework.stereotype.Component;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.server.HandshakeInterceptor;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
/**
* <p>
* WebSocket握手拦截器
* </p>
*
* @author DengMin
* @since 2022/7/14
*/
@Component
public class WebSocketInterceptor implements HandshakeInterceptor {
@Autowired
private MemberMapper memberMapper;
/**
* 自定义验证规则, 如果该用户不存在数据表中,拒绝此次连接
* @param request
* @param serverHttpResponse
* @param webSocketHandler
* @param map
* @return
* @throws Exception
*/
@Override
public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse serverHttpResponse, WebSocketHandler webSocketHandler, Map<String, Object> map) throws Exception {
if(request instanceof ServletServerHttpRequest) {
HttpServletRequest httpServletRequest = ((ServletServerHttpRequest) request).getServletRequest();
Long userId = Long.parseLong(httpServletRequest.getParameter("userId"));
MemberDO memberDO = memberMapper.selectById(userId);
if(null != memberDO) {
return true;
}
}
return false;
}
@Override
public void afterHandshake(ServerHttpRequest serverHttpRequest, ServerHttpResponse serverHttpResponse, WebSocketHandler webSocketHandler, Exception e) {
}
}
package com.subsidy.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.configure.RestTemplateConfig;
import com.subsidy.common.configure.WechatConfig;
import com.subsidy.mapper.AccessTokenMapper;
import com.subsidy.model.AccessTokenDO;
import com.subsidy.util.ConstantUtils;
import com.subsidy.util.SecretUtils;
import com.subsidy.vo.wechat.AccessTokenVO;
import com.subsidy.vo.wechat.AuthenRequestVO;
import com.subsidy.vo.wechat.AuthenTokenVO;
import com.subsidy.vo.wechat.JsSdkVO;
import com.subsidy.vo.wechat.SignVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
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.Duration;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author DengMin
* @since 2022-02-18
*/
@RestController
@Api(tags = "微信")
@RequestMapping("/wechat")
public class AccessTokenController {
@Autowired
private RestTemplateConfig restTemplateConfig;
@Autowired
private WechatConfig wechatConfig;
@Autowired
private AccessTokenMapper accessTokenMapper;
@PostMapping("/getJsapiTicket")
@ApiOperation("通过token请求获得jsapi_ticket {url}")
public ResponseVO getJsapiTicket(@RequestBody SignVO signVO) {
List<AccessTokenDO> accessTokens = accessTokenMapper.selectList(null);
String accessToken = "";
if (accessTokens.size()==0){
String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + wechatConfig.getAppId() + "&secret=" + wechatConfig.getAppSecret();
ResponseEntity<AccessTokenVO> response = restTemplateConfig.restTemplate()
.exchange(url, HttpMethod.GET, null, AccessTokenVO.class);
accessToken = response.getBody().getAccess_token();
AccessTokenDO accessToken1 = new AccessTokenDO();
accessToken1.setAccessToken(accessToken);
accessToken1.setUpdateDate(LocalDateTime.now());
accessTokenMapper.insert(accessToken1);
}else {
AccessTokenDO accessToken1 = accessTokens.get(0);
long diff = Duration.between(accessToken1.getUpdateDate(),LocalDateTime.now()).toMillis();
if (diff>=2*60*60*1000-5*1000){
String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + wechatConfig.getAppId() + "&secret=" + wechatConfig.getAppSecret();
ResponseEntity<AccessTokenVO> response = restTemplateConfig.restTemplate()
.exchange(url, HttpMethod.GET, null, AccessTokenVO.class);
accessToken = response.getBody().getAccess_token();
// AccessToken accessToken2= new AccessToken();
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<JsSdkVO> response1 = restTemplateConfig.restTemplate()
.exchange(url1, HttpMethod.GET, null, JsSdkVO.class);
String ticket = response1.getBody().getTicket();
signVO.setJsapi_ticket(ticket);
signVO.setNoncestr("1rtgtafNdHhxADMD");
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));
return ResponseData.generateCreatedResponse(0,signVO);
}
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.TimeRequired;
import com.subsidy.dto.detection.VerifyDTO;
import com.subsidy.model.ActivityDetectionDO;
import com.subsidy.service.ActivityDetectionService;
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 javax.servlet.http.HttpServletRequest;
/**
* <p>
* 活跃度检测表 前端控制器
* </p>
*
* @author DengMin
* @since 2022-07-13
*/
@RestController
@Api(tags = "活跃度检测表")
@RequestMapping("/activityDetection")
public class ActivityDetectionController {
@Autowired
private ActivityDetectionService activityDetectionService;
@PostMapping("verify")
@ApiOperation("验证滑块 ticket randStr memberId classId")
@TimeRequired
public ResponseVO verify(@RequestBody VerifyDTO verifyDTO, HttpServletRequest request){
return ResponseData.generateCreatedResponse(0,activityDetectionService.verify(verifyDTO,request));
}
@PostMapping("getCheckHistory")
@ApiOperation("获取某个人某个课程的活跃度验证详情 memberId classId")
public ResponseVO getCheckHistory(@RequestBody ActivityDetectionDO activityDetectionDO){
return ResponseData.generateCreatedResponse(0,activityDetectionService.getCheckHistory(activityDetectionDO));
}
}
......@@ -3,14 +3,17 @@ package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.dto.GetCourseQuestionDTO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.course.GetCourseQuestionDTO;
import com.subsidy.model.AnsweringQuestionDO;
import com.subsidy.service.AnsweringQuestionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
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>
......@@ -29,29 +32,39 @@ public class AnsweringQuestionController {
private AnsweringQuestionService answeringQuestionService;
@PostMapping("getCourseQuestion")
@ApiOperation("获取某个课程的答疑 {classId pageSize pageNum memberId}")
@ApiOperation(" 获取某个课程的答疑 {classId pageSize pageNum memberId}")
@LoginRequired
public ResponseVO getCourseQuestion(@RequestBody GetCourseQuestionDTO getCourseQuestionDTO){
return ResponseData.generateCreatedResponse(0,answeringQuestionService.getCourseQuestion(getCourseQuestionDTO));
}
@PostMapping("addQuestion")
@ApiOperation("新增答疑 {classId askId title}")
@LoginRequired
public ResponseVO addQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){
return ResponseData.generateCreatedResponse(0,answeringQuestionService.addQuestion(answeringQuestionDO));
}
@PostMapping("deleteQuestion")
@ApiOperation("删除答疑 {id}")
@ApiOperation(" 删除答疑 {id}")
@LoginRequired
public ResponseVO deleteQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){
return ResponseData.generateCreatedResponse(0,answeringQuestionService.deleteQuestion(answeringQuestionDO));
}
@PostMapping("updateQuestion")
@ApiOperation("编辑答疑 {id answerId answer}")
@LoginRequired
public ResponseVO updateQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){
return ResponseData.generateCreatedResponse(0, answeringQuestionService.updateQuestion(answeringQuestionDO));
}
@PostMapping("getNoAnswers")
@ApiOperation("获取某个课程没有回答的答疑个数 classId 课程id")
@LoginRequired
public ResponseVO getNoAnswers(@RequestBody AnsweringQuestionDO answeringQuestionDO){
return ResponseData.generateCreatedResponse(0,answeringQuestionService.getNoAnswers(answeringQuestionDO));
}
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.businessScope.BusinessScopeDTO;
import com.subsidy.model.BusinessScopeDictDO;
import com.subsidy.service.BusinessScopeDictService;
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 2022-07-25
*/
@RestController
@Api(tags = "经营范围表")
@RequestMapping("/businessScopeDict")
public class BusinessScopeDictController {
@Autowired
private BusinessScopeDictService businessScopeDictService;
@PostMapping("addBusinessScope")
@ApiOperation("添加经营范围:businessScopeName/经营范围名称")
@LoginRequired
public ResponseVO addBusinessScope(@RequestBody BusinessScopeDictDO businessScopeDictDO) {
businessScopeDictService.save(businessScopeDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("updateBusinessScope")
@ApiOperation("修改经营范围:id/ID、businessScopeName/经营范围名称")
@LoginRequired
public ResponseVO updateBusinessScope(@RequestBody BusinessScopeDictDO businessScopeDictDO) {
businessScopeDictService.updateById(businessScopeDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("deleteBusinessScope")
@ApiOperation("删除经营范围:id/ID")
@LoginRequired
public ResponseVO deleteBusinessScope(@RequestBody BusinessScopeDictDO businessScopeDictDO) {
businessScopeDictService.removeById(businessScopeDictDO.getId());
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("queryBusinessScopePage")
@ApiOperation("分页查询经营范围:businessScopeName/经营范围名称、pageNum/当前页数、pageSize/每页显示条数")
@LoginRequired
public ResponseVO queryBusinessScopePage(@RequestBody BusinessScopeDTO businessScopeDictDO) {
return ResponseData.generateCreatedResponse(0, businessScopeDictService.queryBusinessScopePage(businessScopeDictDO));
}
}
......@@ -8,14 +8,13 @@ import com.subsidy.dto.category.GetCategoriesDTO;
import com.subsidy.model.CategoryDO;
import com.subsidy.service.CategoryService;
import com.subsidy.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;
import io.swagger.annotations.Api;
/**
* <p>
......@@ -34,38 +33,37 @@ public class CategoryController {
private CategoryService categoryService;
@PostMapping("getCategories")
@ApiOperation("查询类目 ** name 类目名称 companyId pageSize pageNum")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation("查询类目 name 类目名称 companyId pageSize pageNum")
@LoginRequired
public ResponseVO getCategories(@RequestBody GetCategoriesDTO getCategoriesDTO){
return ResponseData.generateCreatedResponse(0,categoryService.getCategories(getCategoriesDTO));
}
@PostMapping("getAll")
@ApiOperation("查询所有类目 **companyId")
@ApiOperation("查询所有类目 companyId")
public ResponseVO getAll(@RequestBody GetCategoriesDTO getCategoriesDTO){
return ResponseData.generateCreatedResponse(0,categoryService.getAll(getCategoriesDTO));
}
@PostMapping("addCategory")
@ApiOperation("新增类目 **name companyId")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation("新增类目 name companyId")
@LoginRequired
public ResponseVO addCategory(@RequestBody CategoryDO categoryDO){
return ResponseData.generateCreatedResponse(0,categoryService.addCategory(categoryDO));
}
@PostMapping("deleteCategory")
@ApiOperation("删除类目 id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@LoginRequired
public ResponseVO deleteCategory(@RequestBody CategoryDO categoryDO){
return ResponseData.generateCreatedResponse(0,categoryService.deleteCategory(categoryDO));
}
@PostMapping("updateCategory")
@ApiOperation("修改类目 ** id name companyId")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation("修改类目 id name companyId")
@LoginRequired
public ResponseVO updateCategory(@RequestBody CategoryDO categoryDO){
return ResponseData.generateCreatedResponse(0,categoryService.updateCategory(categoryDO));
}
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.dto.cert.ChangeCompanyCertsDTO;
import com.subsidy.dto.cert.GetCompanyCertsDTO;
import com.subsidy.dto.cert.GetCompanyCertsWithStatusDTO;
import com.subsidy.service.CertCompanyMappingService;
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 2022-05-11
*/
@RestController
@Api(tags = "证书-公司映射表")
@RequestMapping("/certCompanyMapping")
public class CertCompanyMappingController {
@Autowired
private CertCompanyMappingService certCompanyMappingService;
@PostMapping("getCompanyCertsWithStatus")
@ApiOperation("获取某个公司的项目证书(返回学生报名状态) companyId 公司id typeId 类型id(查全部传空) memberId 学生id")
public ResponseVO getCompanyCertsWithStatus(@RequestBody GetCompanyCertsWithStatusDTO getCompanyCertsDTO){
return ResponseData.generateCreatedResponse(0,certCompanyMappingService.getCompanyCertsWithStatus(getCompanyCertsDTO));
}
@PostMapping("getCompanyCerts")
@ApiOperation("获取某个公司的证书情况 companyId pageSize pageNum")
public ResponseVO getCompanyCerts(@RequestBody GetCompanyCertsDTO getCompanyCertsDTO){
return ResponseData.generateCreatedResponse(0,certCompanyMappingService.getCompanyCerts(getCompanyCertsDTO));
}
@PostMapping("changeCompanyCerts")
@ApiOperation("开启/关闭权限 companyId certId signStatus")
public ResponseVO changeCompanyCerts(@RequestBody ChangeCompanyCertsDTO changeCompanyCertsDTO){
return ResponseData.generateCreatedResponse(0,certCompanyMappingService.changeCompanyCerts(changeCompanyCertsDTO));
}
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.dto.cert.AddCertDTO;
import com.subsidy.dto.cert.GetAllCertsDTO;
import com.subsidy.dto.cert.GetOneCertDTO;
import com.subsidy.model.CertDictDO;
import com.subsidy.service.CertDictService;
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 2022-05-11
*/
@RestController
@Api(tags = "证书字典表")
@RequestMapping("/certDict")
public class CertDictController {
@Autowired
private CertDictService certDictService;
@PostMapping("addCert")
@ApiOperation("添加证书 certName price coverPage title副标题 scribePrice 划线价格 certDesc 证书简介 detail chargeAndSubsidy 学费和补贴 serviceProcess服务流程 refundGuarantee 退费流程 typeIds[] 类型id requirementDesc 条件说明 submitDesc 提交说明")
public ResponseVO addCert(@RequestBody AddCertDTO addCertDTO){
return ResponseData.generateCreatedResponse(0,certDictService.addCert(addCertDTO));
}
@PostMapping("deleteCert")
@ApiOperation("删除证书 id ")
public ResponseVO deleteCert(@RequestBody CertDictDO certDictDO){
return ResponseData.generateCreatedResponse(0,certDictService.deleteCert(certDictDO));
}
@PostMapping("updateCert")
@ApiOperation("编辑证书 id certName price coverPage title副标题 scribePrice 划线价格 划线价格 detail chargeAndSubsidy 学费和补贴 serviceProcess服务流程 refundGuarantee 退费流程 typeId 类型id requirementDesc 条件说明 submitDesc 提交说明")
public ResponseVO updateCert(@RequestBody AddCertDTO addCertDTO){
return ResponseData.generateCreatedResponse(0,certDictService.updateCert(addCertDTO));
}
@PostMapping("getOneCert")
@ApiOperation("获取一个证书 id userId")
public ResponseVO getOneCert(@RequestBody GetOneCertDTO getOneCertDTO){
return ResponseData.generateCreatedResponse(0,certDictService.getOneCert(getOneCertDTO));
}
@PostMapping("getAllCerts")
@ApiOperation("获取全部的证书(包含项目类型) typeId certName pageSize pageNum ")
public ResponseVO getAllCerts(@RequestBody GetAllCertsDTO getAllCertsDTO){
return ResponseData.generateCreatedResponse(0,certDictService.getAllCerts(getAllCertsDTO));
}
@PostMapping("getAllCertsWithoutType")
@ApiOperation("获取所有证书(下拉列表用)")
public ResponseVO getAllCertsWithoutType(){
return ResponseData.generateCreatedResponse(0,certDictService.getAllCertsWithoutType());
}
}
package com.subsidy.controller;
import com.subsidy.service.CertMemberFileMappingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 前端控制器
* </p>
*
* @author DengMin
* @since 2022-05-11
*/
@RestController
@Api(tags = "学生报名材料 映射表")
@RequestMapping("/certMemberFileMapping")
public class CertMemberFileMappingController {
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.TimeRequired;
import com.subsidy.dto.cert.GetListDTO;
import com.subsidy.dto.cert.SignManagementDTO;
import com.subsidy.dto.cert.SignUpDTO;
import com.subsidy.model.CertMemberMappingDO;
import com.subsidy.service.CertMemberMappingService;
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 DengMin
* @since 2022-05-11
*/
@RestController
@Api(tags = "学生报名证书表")
@RequestMapping("/certMemberMapping")
public class CertMemberMappingController {
@Autowired
private CertMemberMappingService certMemberMappingService;
@PostMapping("signUp")
@ApiOperation("报名 certId memberId files[fileName fileUrl requirementId] ")
public ResponseVO signUp(@RequestBody SignUpDTO signUpDTO){
return ResponseData.generateCreatedResponse(0,certMemberMappingService.signUp(signUpDTO));
}
@PostMapping("signManagement")
@ApiOperation("报名管理 typeId 类目id certId 证书id startDate 开始时间 endDate 结束时间 item 搜索字段 pageSize pageNum")
public ResponseVO signManagement(@RequestBody SignManagementDTO signManagementDTO){
return ResponseData.generateCreatedResponse(0,certMemberMappingService.signManagement(signManagementDTO));
}
@PostMapping("changeStatus")
@ApiOperation("编辑订单状态 id status")
public ResponseVO changeStatus(@RequestBody CertMemberMappingDO certMemberMappingDO){
return ResponseData.generateCreatedResponse(0,certMemberMappingService.changeStatus(certMemberMappingDO));
}
@PostMapping("getList")
@ApiOperation("手机端---获取全部订单 memberId status pageSize pageNum")
@TimeRequired
public ResponseVO getList(@RequestBody GetListDTO getListDTO){
return ResponseData.generateCreatedResponse(0,certMemberMappingService.getList(getListDTO));
}
@PostMapping("getSignInfo")
@ApiOperation("获取某人某个证书报名信息 memberId certId ")
public ResponseVO getSignInfo(@RequestBody CertMemberMappingDO certMemberMappingDO){
return ResponseData.generateCreatedResponse(0,certMemberMappingService.getSignInfo(certMemberMappingDO));
}
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.model.CertDictDO;
import com.subsidy.model.CertRequirementDO;
import com.subsidy.service.CertRequirementService;
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 2022-05-12
*/
@RestController
@Api(tags = "报名条件表")
@RequestMapping("/certRequirement")
public class CertRequirementController {
@Autowired
private CertRequirementService certRequirementService;
@PostMapping("getRequirements")
@ApiOperation("获取证书报名条件 certId")
public ResponseVO getRequirements(@RequestBody CertRequirementDO certRequirementDO){
return ResponseData.generateCreatedResponse(0,certRequirementService.getRequirements(certRequirementDO));
}
@PostMapping("deleteRequirement")
@ApiOperation("删除条件 id")
public ResponseVO deleteRequirement(@RequestBody CertRequirementDO certRequirementDO){
return ResponseData.generateCreatedResponse(0,certRequirementService.deleteRequirement(certRequirementDO));
}
@PostMapping("addRequirement")
@ApiOperation("添加条件 certId certRequirement status:true 必填 false 非必填")
public ResponseVO addRequirement(@RequestBody CertRequirementDO certRequirementDO){
return ResponseData.generateCreatedResponse(0,certRequirementService.addRequirement(certRequirementDO));
}
@PostMapping("updateRequirement")
@ApiOperation("编辑条件 id certId certRequirement status:true 必填 false 非必填")
public ResponseVO updateRequirement(@RequestBody CertRequirementDO certRequirementDO){
return ResponseData.generateCreatedResponse(0,certRequirementService.updateRequirement(certRequirementDO));
}
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.dto.cert.GetAllTypeDTO;
import com.subsidy.mapper.CertTypeDictMapper;
import com.subsidy.model.CertCompanyMappingDO;
import com.subsidy.model.CertRequirementDO;
import com.subsidy.model.CertTypeDictDO;
import com.subsidy.service.CertTypeDictService;
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 2022-05-11
*/
@RestController
@Api(tags = "证书类目字典表")
@RequestMapping("/certTypeDict")
public class CertTypeDictController {
@Autowired
private CertTypeDictService certTypeDictService;
@PostMapping("getCompanyCertTypes")
@ApiOperation("(手机端)获取某个公司所有的证书类型 companyId")
public ResponseVO getCompanyCertTypes(@RequestBody CertCompanyMappingDO certCompanyMappingDO){
return ResponseData.generateCreatedResponse(0,certTypeDictService.getCompanyCertTypes(certCompanyMappingDO));
}
@PostMapping("addType")
@ApiOperation("添加类型 typeName ")
public ResponseVO addType(@RequestBody CertTypeDictDO certTypeDictDO){
return ResponseData.generateCreatedResponse(0,certTypeDictService.addType(certTypeDictDO));
}
@PostMapping("deleteType")
@ApiOperation("删除类型 id ")
public ResponseVO deleteType(@RequestBody CertTypeDictDO certTypeDictDO){
return ResponseData.generateCreatedResponse(0,certTypeDictService.deleteType(certTypeDictDO));
}
@PostMapping("updateType")
@ApiOperation("修改类型 id typeName")
public ResponseVO updateType(@RequestBody CertTypeDictDO certTypeDictDO){
return ResponseData.generateCreatedResponse(0,certTypeDictService.updateType(certTypeDictDO));
}
@PostMapping("getAllType")
@ApiOperation("获取所有类型 pageSize pageNum")
public ResponseVO getAllType(@RequestBody GetAllTypeDTO getAllTypeDTO){
return ResponseData.generateCreatedResponse(0,certTypeDictService.getAllType(getAllTypeDTO));
}
}
......@@ -8,15 +8,18 @@ import io.swagger.annotations.Api;
/**
* <p>
* 班级成员映射表 前端控制器
* 证书-类型映射表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-10-12
* @since 2022-05-11
*/
@RestController
@Api(tags = "班级成员映射表")
@RequestMapping("/class-member-mapping-do")
public class ClassMemberMappingController {
@Api(tags = "证书-类型映射表")
@RequestMapping("/certTypeMapping")
public class CertTypeMappingController {
}
......@@ -4,23 +4,22 @@ package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.common.interceptor.TimeRequired;
import com.subsidy.dto.classDict.AddClassDTO;
import com.subsidy.dto.classDict.AddMemberToClassDTO;
import com.subsidy.dto.classDict.GetAllClassesDTO;
import com.subsidy.dto.classDict.GetClassBaseInfoDTO;
import com.subsidy.dto.classDict.GetSpareMembersDTO;
import com.subsidy.model.ClassDictDO;
import com.subsidy.model.ClassMemberMappingDO;
import com.subsidy.model.CourseDictDO;
import com.subsidy.service.ClassDictService;
import com.subsidy.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;
import io.swagger.annotations.Api;
/**
* <p>
......@@ -39,67 +38,73 @@ public class ClassDictController {
private ClassDictService classDictService;
@PostMapping("getAllClasses")
@ApiOperation("获取某老师下的所有课程 ** companyId 所选企业id className 班级名称")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getAllClasses(@RequestBody ClassDictDO classDictDO){
@ApiOperation("获取某公司下的所有班级 companyId 所选企业id className 班级名称 openStatus 开放状态 startDate 开始时间 endDate 结束时间")
@LoginRequired
public ResponseVO getAllClasses(@RequestBody ClassDictDO classDictDO)throws Exception{
return ResponseData.generateCreatedResponse(0,classDictService.getAllClasses(classDictDO));
}
@PostMapping("deleteClasses")
@ApiOperation("删除课程 id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation(" 删除班级 id")
@LoginRequired
public ResponseVO deleteClasses(@RequestBody ClassDictDO classDictDO){
return ResponseData.generateCreatedResponse(0,classDictService.deleteClasses(classDictDO));
}
@PostMapping("addClass")
@ApiOperation("添加课程 ** userId:登录人id companyId courseId className startDate endDate")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation("添加班级 userId:登录人id companyId courseId classTypeId className startDate endDate testRule 是否视频看完再做测试 isOrder 是否按照顺序播放 isFastPlay 是否快进 memberIds [] 班级学员 classNoticeDOS[noticeType noticeTime]")
@LoginRequired
public ResponseVO addClass(@RequestBody AddClassDTO addClassDTO){
return ResponseData.generateCreatedResponse(0,classDictService.addClass(addClassDTO));
}
@PostMapping("updateClass")
@ApiOperation("修改课程 id ** companyId courseId className startDate endDate")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation("修改班级 id companyId className classTypeId startDate endDate")
@LoginRequired
public ResponseVO updateClass(@RequestBody ClassDictDO classDictDO){
return ResponseData.generateCreatedResponse(0,classDictService.updateClass(classDictDO));
}
@PostMapping("classDetail")
@ApiOperation("获取一个班级详情 id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@LoginRequired
public ResponseVO classDetail(@RequestBody ClassDictDO classDictDO){
return ResponseData.generateCreatedResponse(0,classDictService.classDetail(classDictDO));
}
@PostMapping("removeMember")
@ApiOperation("移除班级 classId 班级id memberId人员id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@LoginRequired
public ResponseVO removeMember(@RequestBody ClassMemberMappingDO classMemberMappingDO){
return ResponseData.generateCreatedResponse(0,classDictService.removeMember(classMemberMappingDO));
}
@PostMapping("getSpareMembers")
@ApiOperation("获取不在某班级的某企业里所有成员 ** companyId 企业id classId 班级id")
//@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation("获取不在某班级的某企业里所有成员 companyId 企业id classId 班级id")
@LoginRequired
public ResponseVO getSpareMembers(@RequestBody GetSpareMembersDTO getSpareMembersDTO){
return ResponseData.generateCreatedResponse(0,classDictService.getSpareMembers(getSpareMembersDTO));
}
@PostMapping("addMemberToClass")
@ApiOperation("将个成员加入到某个班级里 classId memberIds []")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation("将个成员加入到某个班级里 classId memberIds []")
@LoginRequired
public ResponseVO addMemberToClass(@RequestBody AddMemberToClassDTO addMemberToClassDTO){
return ResponseData.generateCreatedResponse(0,classDictService.addMemberToClass(addMemberToClassDTO));
}
@PostMapping("batchSms")
@ApiOperation("批量发送班级短信 {id 班级id}")
@ApiOperation(" 批量发送班级短信通知 {id 班级id }")
@LoginRequired
public ResponseVO batchSms(@RequestBody ClassDictDO classDictDO){
return ResponseData.generateCreatedResponse(0,classDictService.batchSms(classDictDO));
}
@PostMapping("getClassBaseInfo")
@ApiOperation("班级详情--获取课程基本信息 id")
@LoginRequired
@TimeRequired
public ResponseVO getClassBaseInfo(@RequestBody GetClassBaseInfoDTO getClassBaseInfoDTO){
return ResponseData.generateCreatedResponse(0,classDictService.getClassBaseInfo(getClassBaseInfoDTO));
}
}
......@@ -4,15 +4,19 @@ package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.common.interceptor.TimeRequired;
import com.subsidy.model.ClassHourDictDO;
import com.subsidy.model.VodPlayHistoryDO;
import com.subsidy.service.ClassHourDictService;
import com.subsidy.util.ConstantUtils;
import com.subsidy.vo.classdict.GetSettingVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
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>
......@@ -32,23 +36,26 @@ public class ClassHourDictController {
@PostMapping("getSetting")
@ApiOperation("查看当天设置的最大学习时长 companyId")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@LoginRequired
public ResponseVO getSetting(@RequestBody ClassHourDictDO classHourDictDO){
return ResponseData.generateCreatedResponse(0,classHourDictService.getSetting(classHourDictDO));
}
@PostMapping("updateSetting")
@ApiOperation("修改当天设置时长 id 主键 classHour status")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateSetting(@RequestBody ClassHourDictDO classHourDictDO){
return ResponseData.generateCreatedResponse(0,classHourDictService.updateSetting(classHourDictDO));
@ApiOperation("修改当天设置时长 companyId 主键 logo classHour status interrupt interruptStatus repeatTime repeatStatus rotationImgDictDOS[companyId rotationImg]")
@LoginRequired
public ResponseVO updateSetting(@RequestBody GetSettingVO getSettingVO){
return ResponseData.generateCreatedResponse(0,classHourDictService.updateSetting(getSettingVO));
}
@PostMapping("pollingGet")
@ApiOperation("轮询查询当前这个人当天有没有超过最长时长 memberId playLength")
@LoginRequired
@TimeRequired
public ResponseVO pollingGet(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){
return ResponseData.generateCreatedResponse(0,classHourDictService.pollingGet(vodPlayHistoryDO));
}
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.classNotice.SendNotificationDTO;
import com.subsidy.model.ClassNoticeDO;
import com.subsidy.service.ClassNoticeService;
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 2022-01-21
*/
@RestController
@Api(tags = "课程通知")
@RequestMapping("/classNotice")
public class ClassNoticeController {
@Autowired
private ClassNoticeService classNoticeService;
@PostMapping("addNotice")
@ApiOperation("新增一个通知 classId noticeType isAuto noticeTime")
@LoginRequired
public ResponseVO addNotice(@RequestBody ClassNoticeDO classNoticeDO){
return ResponseData.generateCreatedResponse(0,classNoticeService.addNotice(classNoticeDO));
}
@PostMapping("updateNotice")
@ApiOperation("修改一个通知 id noticeType isAuto noticeTime")
@LoginRequired
public ResponseVO updateNotice(@RequestBody ClassNoticeDO classNoticeDO){
return ResponseData.generateCreatedResponse(0,classNoticeService.updateNotice(classNoticeDO));
}
@PostMapping("deleteNotice")
@ApiOperation("删除一个通知 id")
@LoginRequired
public ResponseVO deleteNotice(@RequestBody ClassNoticeDO classNoticeDO){
return ResponseData.generateCreatedResponse(0,classNoticeService.deleteNotice(classNoticeDO));
}
@PostMapping("queryClassNotices")
@ApiOperation("查看某个课程的通知提醒 classId 课程id status 状态(待发送/已发送)")
@LoginRequired
public ResponseVO queryClassNotices(@RequestBody ClassNoticeDO classNoticeDO){
return ResponseData.generateCreatedResponse(0,classNoticeService.queryClassNotices(classNoticeDO));
}
@PostMapping("sendClassNotices")
@ApiOperation("发送通知:classId/课程Id sendType/发送类型(全部成员/未签到成员/未完课成员)")
@LoginRequired
public ResponseVO sendClassNotices(@RequestBody SendNotificationDTO sendNotificationDTO) {
classNoticeService.sendNotification(sendNotificationDTO);
return ResponseData.generateCreatedResponse(0);
}
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.classDict.ClassTypeDTO;
import com.subsidy.model.ClassTypeDictDO;
import com.subsidy.service.ClassTypeDictService;
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 2022-01-21
*/
@RestController
@Api(tags = "班级类型字典表")
@RequestMapping("/classType")
public class ClassTypeDictController {
@Autowired
private ClassTypeDictService classTypeDictService;
@PostMapping("addClassType")
@ApiOperation("添加课程类型 companyId 运营者公司id不传 classType")
@LoginRequired
public ResponseVO addClassType(@RequestBody ClassTypeDictDO classTypeDictDO){
return ResponseData.generateCreatedResponse(0,classTypeDictService.addClassType(classTypeDictDO));
}
@PostMapping("updateClassType")
@ApiOperation("修改课程类型 id companyId classType")
@LoginRequired
public ResponseVO updateClassType(@RequestBody ClassTypeDictDO classTypeDictDO){
return ResponseData.generateCreatedResponse(0,classTypeDictService.updateClassType(classTypeDictDO));
}
@PostMapping("deleteClassType")
@ApiOperation("删除课程类型 id")
@LoginRequired
public ResponseVO deleteClassType(@RequestBody ClassTypeDictDO classTypeDictDO){
return ResponseData.generateCreatedResponse(0,classTypeDictService.deleteClassType(classTypeDictDO));
}
@PostMapping("queryClassTypes")
@ApiOperation("查询某个公司的班级类型 userId 登录人id companyId")
@LoginRequired
public ResponseVO queryClassTypes(@RequestBody ClassTypeDTO classTypeDTO){
return ResponseData.generateCreatedResponse(0,classTypeDictService.queryClassTypes(classTypeDTO));
}
}
......@@ -6,18 +6,18 @@ import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.administer.OperatorsDTO;
import com.subsidy.dto.company.AddCompanyDTO;
import com.subsidy.model.AdministerDO;
import com.subsidy.dto.company.GetCompanyMembersDTO;
import com.subsidy.model.CompanyDictDO;
import com.subsidy.model.MemberDO;
import com.subsidy.service.CompanyDictService;
import com.subsidy.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;
import io.swagger.annotations.Api;
/**
* <p>
......@@ -36,31 +36,45 @@ public class CompanyDictController {
private CompanyDictService companyDictService;
@PostMapping("/administers")
@ApiOperation("查询所有企业 {id companyName pageNum pageSize }")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation("查询所有企业 {id companyName fieldId 行业id superviseName 监管第三方名称 pageNum pageSize }")
@LoginRequired
public ResponseVO operators(@RequestBody OperatorsDTO operatorsDTO){
return ResponseData.generateCreatedResponse(0,companyDictService.operators(operatorsDTO));
}
@PostMapping("addCompany")
@ApiOperation("添加企业 {accountName:账号 companyName:企业名称 shortName 简称 banner:标语 field:领域 role 1:超级管理员 2:普通成员}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation("添加企业 {accountName:账号 superviseName 第三方监管名称 companyName:企业名称 address 企业所在地 shortName 简称 banner:标语 field[]:领域 role 1:超级管理员 2:普通成员}")
@LoginRequired
public ResponseVO addOperator(@RequestBody AddCompanyDTO addCompanyDTO){
return ResponseData.generateCreatedResponse(0,companyDictService.addOperator(addCompanyDTO));
}
@PostMapping("deleteCompany")
@ApiOperation("删除企业 id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@LoginRequired
public ResponseVO deleteAdminister(@RequestBody CompanyDictDO companyDictDO){
return ResponseData.generateCreatedResponse(0,companyDictService.deleteAdminister(companyDictDO));
}
@PostMapping("updateCompany")
@ApiOperation("修改企业 id accountName:账号 companyName:企业名称 shortName 简称 banner:标语 field:领域 role 1:超级管理员 2:普通成员")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation("修改企业 id superviseName 第三方监管名称 accountName:账号 logo companyName:企业名称 address 企业所在地 shortName 简称 banner:标语 field[]:领域 role 1:超级管理员 2:普通成员")
@LoginRequired
public ResponseVO updateAdminister(@RequestBody AddCompanyDTO addCompanyDTO){
return ResponseData.generateCreatedResponse(0,companyDictService.updateAdminister(addCompanyDTO));
}
@PostMapping("getAllCompany")
@ApiOperation("获取全部企业 {companyName}")
@LoginRequired
public ResponseVO getAllCompany(@RequestBody CompanyDictDO companyDictDO){
return ResponseData.generateCreatedResponse(0,companyDictService.getAllCompany(companyDictDO));
}
@PostMapping("getCompanyMembers")
@ApiOperation("获取公司里的成员 pageNum pageSize companyId 公司id userName 成员名称")
@LoginRequired
public ResponseVO getCompanyMembers(@RequestBody GetCompanyMembersDTO getCompanyMembersDTO){
return ResponseData.generateCreatedResponse(0,companyDictService.getCompanyMembers(getCompanyMembersDTO));
}
}
......@@ -12,11 +12,11 @@ import io.swagger.annotations.Api;
* </p>
*
* @author DengMin
* @since 2021-10-11
* @since 2022-02-11
*/
@RestController
@Api(tags = "")
@RequestMapping("/role-administer-mapping-do")
public class RoleAdministerMappingController {
@RequestMapping("/company-field-mapping-do")
public class CompanyFieldMappingController {
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.content.GetContendVodsDTO;
import com.subsidy.dto.contentVod.AddContentVod;
import com.subsidy.dto.contentVod.ContentVodDTO;
import com.subsidy.dto.vod.ChangeOrdersDTO;
import com.subsidy.service.ContentVodMappingService;
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 2022-07-19
*/
@RestController
@Api(tags = "目录视频关系表")
@RequestMapping("/contentVodMapping")
public class ContentVodMappingController {
@Autowired
private ContentVodMappingService contentVodMappingService;
@PostMapping("getContendVods")
@ApiOperation("获取课程内容下的视频 {contentId vodName}")
@LoginRequired
public ResponseVO getContendVods(@RequestBody GetContendVodsDTO getContendVodsDTO) {
return ResponseData.generateCreatedResponse(0, contentVodMappingService.getContendVods(getContendVodsDTO));
}
@PostMapping("changeContentVodOrders")
@ApiOperation("课程内容视频排序 contentId/内容ID vodIds [] 视频的id")
public ResponseVO changeContentVodOrders(@RequestBody ChangeOrdersDTO changeOrdersDTO ){
contentVodMappingService.changeContentVodOrders(changeOrdersDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("addContentVod")
@ApiOperation("添加课程内容视频:contentId/内容ID、vodIds [] /视频ID")
@LoginRequired
public ResponseVO addContentVod(@RequestBody AddContentVod addContentVod) {
contentVodMappingService.addContentVod(addContentVod);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("deleteContentVod")
@ApiOperation("删除课程内容下的视频: contentId/内容ID 、 vodId/视频ID")
@LoginRequired
public ResponseVO deleteContentVod(@RequestBody ContentVodDTO contentVodDTO) {
contentVodMappingService.deleteContentVod(contentVodDTO);
return ResponseData.generateCreatedResponse(0);
}
}
......@@ -8,15 +8,15 @@ import io.swagger.annotations.Api;
/**
* <p>
* 老师部门映射表 前端控制器
* 课程类目映射 前端控制器
* </p>
*
* @author DengMin
* @since 2021-11-01
* @since 2022-02-14
*/
@RestController
@Api(tags = "老师部门映射表")
@RequestMapping("/member-department-mapping-do")
public class MemberDepartmentMappingController {
@Api(tags = "课程类目映射")
@RequestMapping("/course-category-mapping-do")
public class CourseCategoryMappingController {
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.content.GetContendVodsDTO;
import com.subsidy.dto.vod.ChangeOrdersDTO;
import com.subsidy.model.CourseContentDO;
import com.subsidy.model.VodDictDO;
import com.subsidy.service.CourseContentService;
import com.subsidy.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;
import io.swagger.annotations.Api;
/**
* <p>
......@@ -35,31 +34,29 @@ public class CourseContentController {
@PostMapping("getContents")
@ApiOperation("获取课程目录 {courseId}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@LoginRequired
public ResponseVO getContents(@RequestBody CourseContentDO courseContentDO){
return ResponseData.generateCreatedResponse(0,courseContentService.getContents(courseContentDO));
}
@PostMapping("deleteContent")
@ApiOperation("删除一个目录 {id} ")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@LoginRequired
public ResponseVO deleteContent(@RequestBody CourseContentDO courseContentDO){
return ResponseData.generateCreatedResponse(0,courseContentService.deleteContent(courseContentDO));
}
@PostMapping("addContent")
@ApiOperation("添加一个目录 {courseId content}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@LoginRequired
public ResponseVO addContent(@RequestBody CourseContentDO courseContentDO){
return ResponseData.generateCreatedResponse(0,courseContentService.addContent(courseContentDO));
}
@PostMapping("updateContent")
@ApiOperation("更新一个目录 {id courseId content}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@LoginRequired
public ResponseVO updateContent(@RequestBody CourseContentDO courseContentDO){
return ResponseData.generateCreatedResponse(0,courseContentService.updateContent(courseContentDO));
}
}
......@@ -4,15 +4,19 @@ package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.course.AddCourseDTO;
import com.subsidy.dto.course.QueryCoursesDTO;
import com.subsidy.dto.course.UpdateCoursesDTO;
import com.subsidy.model.CourseDictDO;
import com.subsidy.service.CourseDictService;
import com.subsidy.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.*;
import io.swagger.annotations.Api;
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>
......@@ -31,38 +35,46 @@ public class CourseDictController {
private CourseDictService courseDictService;
@PostMapping("addCourse")
@ApiOperation("添加课程 **companyId courseName categoryId courseType courseSource")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addCourse(@RequestBody CourseDictDO courseDictDO){
return ResponseData.generateCreatedResponse(0,courseDictService.addCourse(courseDictDO));
@ApiOperation("添加课程 companyId courseName courseType coverPage openStatus remark fieldDictDOS[] categoryDOS[] jobDictDOS[] rankDictDOS[]")
@LoginRequired
public ResponseVO addCourse(@RequestBody AddCourseDTO addCourseDTO){
return ResponseData.generateCreatedResponse(0,courseDictService.addCourse(addCourseDTO));
}
@PostMapping("deleteCourse")
@ApiOperation("删除课程 id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@LoginRequired
public ResponseVO deleteCourse(@RequestBody CourseDictDO courseDictDO){
return ResponseData.generateCreatedResponse(0,courseDictService.deleteCourse(courseDictDO));
}
@PostMapping("queryCourses")
@ApiOperation("平台运营者--查询课程 pageSize pageNum administerId companyId courseName categoryId courseType courseSource")
//@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation("平台运营者--查询课程 pageSize pageNum courseName fieldId categoryId jobId rankId courseType openStatus")
@LoginRequired
public ResponseVO queryCourses(@RequestBody QueryCoursesDTO queryCoursesDTO){
return ResponseData.generateCreatedResponse(0,courseDictService.queryCourses(queryCoursesDTO));
}
@PostMapping("updateCourses")
@ApiOperation("编辑课程 id ** companyId courseName categoryId courseType courseSource")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateCourses(@RequestBody CourseDictDO courseDictDO){
return ResponseData.generateCreatedResponse(0,courseDictService.updateCourses(courseDictDO));
@ApiOperation("编辑课程 id courseName courseType coverPage openStatus fieldDictDOS[] categoryDOS[] jobDictDOS[] rankDictDOS[]")
@LoginRequired
public ResponseVO updateCourses(@RequestBody UpdateCoursesDTO updateCoursesDTO){
return ResponseData.generateCreatedResponse(0,courseDictService.updateCourses(updateCoursesDTO));
}
@PostMapping("queryCompanyCourse")
@ApiOperation("企业内容管理-- { ** companyId 所选企业id}")
@ApiOperation("企业内容管理-- { companyId 所选企业id pageSize pageNum courseName categoryId jobId rankId openStatus}")
@LoginRequired
public ResponseVO queryCompanyCourse(@RequestBody QueryCoursesDTO queryCoursesDTO){
return ResponseData.generateCreatedResponse(0,courseDictService.queryCompanyCourse(queryCoursesDTO));
}
@PostMapping("updateOpenStatus")
@ApiOperation("修改课程开放状态 id openStatus")
@LoginRequired
public ResponseVO updateOpenStatus(@RequestBody CourseDictDO courseDictDO){
return ResponseData.generateCreatedResponse(0,courseDictService.updateOpenStatus(courseDictDO));
}
}
......@@ -8,15 +8,15 @@ import io.swagger.annotations.Api;
/**
* <p>
* 权限表 前端控制器
* 前端控制器
* </p>
*
* @author DengMin
* @since 2021-10-11
* @since 2022-01-20
*/
@RestController
@Api(tags = "权限表")
@RequestMapping("/permissions-dict-do")
public class PermissionsDictController {
@Api(tags = "")
@RequestMapping("/courseField")
public class CourseFieldMappingController {
}
......@@ -8,15 +8,15 @@ import io.swagger.annotations.Api;
/**
* <p>
* 角色表 前端控制器
* 课程-岗位映射表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-10-11
* @since 2022-02-14
*/
@RestController
@Api(tags = "角色表")
@RequestMapping("/role-dict-do")
public class RoleDictController {
@Api(tags = "课程-岗位映射表")
@RequestMapping("/course-job-mapping-do")
public class CourseJobMappingController {
}
......@@ -8,15 +8,15 @@ import io.swagger.annotations.Api;
/**
* <p>
* 系统用户角色表 前端控制器
* 课程职级映射表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-10-11
* @since 2022-02-14
*/
@RestController
@Api(tags = "系统用户角色表")
@RequestMapping("/role-permission-mapping-do")
public class RolePermissionMappingController {
@Api(tags = "课程职级映射表")
@RequestMapping("/course-rank-mapping-do")
public class CourseRankMappingController {
}
......@@ -4,17 +4,18 @@ package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.department.GetDepartmentMembersDTO;
import com.subsidy.model.DepartmentDictDO;
import com.subsidy.service.DepartmentDictService;
import com.subsidy.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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
......@@ -34,32 +35,47 @@ public class DepartmentDictController {
@PostMapping("getDepartments")
@ApiOperation("获取所有部门 companyId 企业id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@LoginRequired
public ResponseVO getDepartments(@RequestBody DepartmentDictDO departmentDictDO){
return ResponseData.generateCreatedResponse(0,departmentDictService.getDepartments(departmentDictDO));
}
@PostMapping("addDepartment")
@ApiOperation("添加部门 ** companyId departmentName leaderName parentId 父节点")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation("添加部门 companyId departmentName leaderName parentId 父节点")
@LoginRequired
public ResponseVO addDepartment(@RequestBody DepartmentDictDO departmentDictDO){
return ResponseData.generateCreatedResponse(0,departmentDictService.addDepartment(departmentDictDO));
}
@PostMapping("deleteDepartment")
@ApiOperation("删除部门 id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@LoginRequired
public ResponseVO deleteDepartment(@RequestBody DepartmentDictDO departmentDictDO){
return ResponseData.generateCreatedResponse(0,departmentDictService.deleteDepartment(departmentDictDO));
}
@PostMapping("updateDepartment")
@ApiOperation("编辑部门 id ** companyId departmentName leaderName parentId")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation("编辑部门 id companyId departmentName leaderName parentId")
@LoginRequired
public ResponseVO updateDepartment(@RequestBody DepartmentDictDO departmentDictDO){
return ResponseData.generateCreatedResponse(0,departmentDictService.updateDepartment(departmentDictDO));
}
@PostMapping("getDepartmentMembers")
@ApiOperation("获取部门成员 companyId 公司id departmentId 部门id userName startDate endDate")
@LoginRequired
public ResponseVO getDepartmentMembers(@RequestBody GetDepartmentMembersDTO getDepartmentMembersDTO){
return ResponseData.generateCreatedResponse(0,departmentDictService.getDepartmentMembers(getDepartmentMembersDTO));
}
@PostMapping("getMembers")
@ApiOperation("获取成员(树) companyId 公司id startDate endDate ")
@LoginRequired
public ResponseVO getMembers(@RequestBody GetDepartmentMembersDTO getDepartmentMembersDTO){
return ResponseData.generateCreatedResponse(0,departmentDictService.getMembers(getDepartmentMembersDTO));
}
}
......@@ -4,17 +4,21 @@ package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.common.interceptor.TimeRequired;
import com.subsidy.dto.exercise.GetAllExercisesDTO;
import com.subsidy.dto.exercise.GetPaperExerciseDTO;
import com.subsidy.dto.exercise.SubmitDTO;
import com.subsidy.model.CourseDictDO;
import com.subsidy.model.ExerciseDictDO;
import com.subsidy.service.ExerciseDictService;
import com.subsidy.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.*;
import io.swagger.annotations.Api;
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>
......@@ -32,45 +36,40 @@ public class ExerciseDictController {
@Autowired
private ExerciseDictService exerciseDictService;
@PostMapping("getAllExercises")
@ApiOperation("查询所有题目 {courseId 课程id exerciseType 题目类型 difficulty 难度 title 题目 pageSize pageNum}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getAllExercises(@RequestBody GetAllExercisesDTO getAllExercisesDTO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.getAllExercises(getAllExercisesDTO));
}
@PostMapping("addExercise")
@ApiOperation("添加题目 {courseId 课程id exerciseType 题目类型 difficulty 难度 title题目 items 选项 rightAnswer 正确答案 }")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation("添加题目 {paperId 试卷id courseId 课程id exerciseType 题目类型 difficulty 难度 title题目 items 选项 rightAnswer 正确答案 }")
@LoginRequired
public ResponseVO addExercise(@RequestBody ExerciseDictDO exerciseDictDO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.addExercise(exerciseDictDO));
}
@PostMapping("deleteExercise")
@ApiOperation("删除题目 id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@LoginRequired
public ResponseVO deleteExercise(@RequestBody ExerciseDictDO exerciseDictDO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.deleteExercise(exerciseDictDO));
}
@PostMapping("updateExercise")
@ApiOperation("修改题目 id exerciseType 题目类型 difficulty 难度 title题目 items 选项 rightAnswer 正确答案")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@LoginRequired
public ResponseVO updateExercise(@RequestBody ExerciseDictDO exerciseDictDO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.updateExercise(exerciseDictDO));
}
@PostMapping("getCourseExercises")
@ApiOperation("获取课程的习题 id 课程id")
public ResponseVO getCourseExercises(@RequestBody CourseDictDO courseDictDO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.getCourseExercises(courseDictDO));
}
@PostMapping("submit")
@ApiOperation("提交答案 {memberId 成员id classId课程 courseId 课程id memberExerciseVOS [ id selectAnswer ]} ")
@ApiOperation("提交答案 {paperId 卷子id memberId 成员id classId课程 courseId 课程id memberExerciseVOS [ id selectAnswer ] length:做题时长} ")
@LoginRequired
@TimeRequired
public ResponseVO submit(@RequestBody SubmitDTO submitDTO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.submit(submitDTO));
}
@PostMapping("getPaperExercise")
@ApiOperation("获取某个卷子的所有题目 pageSize pageNum paperId 卷子id exerciseType 类型 difficulty难度 title题目名称")
@LoginRequired
public ResponseVO getPaperExercise(@RequestBody GetPaperExerciseDTO getPaperExerciseDTO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.getPaperExercise(getPaperExerciseDTO));
}
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.service.ExerciseDoneHistoryService;
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 DengMin
* @since 2021-12-03
*/
@RestController
@Api(tags = "做题历史记录表")
@RequestMapping("/exerciseDoneHistory")
public class ExerciseDoneHistoryController {
@Autowired
private ExerciseDoneHistoryService exerciseDoneHistoryService;
@PostMapping("getDoneHistoryDetail")
@ApiOperation("获取某一个试卷每个题目的做题详情 id 提交后返回的id memberId 成员id ")
@LoginRequired
public ResponseVO getDoneHistoryDetail(@RequestBody ExerciseDoneResultDO exerciseDoneResultDO){
return ResponseData.generateCreatedResponse(0,exerciseDoneHistoryService.getDoneHistoryDetail(exerciseDoneResultDO));
}
}
package com.subsidy.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.common.interceptor.TimeRequired;
import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.service.ExerciseDoneResultService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
/**
* <p>
......@@ -19,4 +26,21 @@ import io.swagger.annotations.Api;
@RequestMapping("/exerciseDoneResult")
public class ExerciseDoneResultController {
@Autowired
private ExerciseDoneResultService exerciseDoneResultService;
@PostMapping("getDoneDetail")
@ApiOperation("提交后获取做题结果 id 提交后返回的id")
@LoginRequired
@TimeRequired
public ResponseVO getDoneDetail(@RequestBody ExerciseDoneResultDO exerciseDoneResultDO){
return ResponseData.generateCreatedResponse(0,exerciseDoneResultService.getDoneDetail(exerciseDoneResultDO));
}
@PostMapping("importData")
public ResponseVO makeData(@RequestParam("file") MultipartFile file){
exerciseDoneResultService.importData(file);
return null;
}
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.field.QueryFieldsDTO;
import com.subsidy.model.FieldDictDO;
import com.subsidy.service.FieldDictService;
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 2022-01-20
*/
@RestController
@Api(tags = "行业字典表")
@RequestMapping("/fieldDict")
public class FieldDictController {
@Autowired
private FieldDictService fieldDictService;
@PostMapping("addField")
@ApiOperation("添加行业 fieldName 行业名称")
@LoginRequired
public ResponseVO addField(@RequestBody FieldDictDO fieldDictDO){
return ResponseData.generateCreatedResponse(0,fieldDictService.addField(fieldDictDO));
}
@PostMapping("updateField")
@ApiOperation("修改行业 id fieldName 行业名称")
@LoginRequired
public ResponseVO updateField(@RequestBody FieldDictDO fieldDictDO){
return ResponseData.generateCreatedResponse(0,fieldDictService.updateField(fieldDictDO));
}
@PostMapping("deleteField")
@ApiOperation("删除行业 id")
@LoginRequired
public ResponseVO deleteField(@RequestBody FieldDictDO fieldDictDO){
return ResponseData.generateCreatedResponse(0,fieldDictService.deleteField(fieldDictDO));
}
@PostMapping("queryFields")
@ApiOperation("查询行业 pageSize pageNum fieldName")
@LoginRequired
public ResponseVO queryFields(@RequestBody QueryFieldsDTO queryFieldsDTO){
return ResponseData.generateCreatedResponse(0,fieldDictService.queryFields(queryFieldsDTO));
}
}
......@@ -5,17 +5,15 @@ import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.model.FileDictDO;
import com.subsidy.model.VodDictDO;
import com.subsidy.service.FileDictService;
import com.subsidy.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;
import io.swagger.annotations.Api;
/**
* <p>
......@@ -35,28 +33,28 @@ public class FileDictController {
@PostMapping("getContendFiles")
@ApiOperation("获取目录下的视频 {contentId fileName}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@LoginRequired
public ResponseVO getContendFiles(@RequestBody FileDictDO fileDictDO){
return ResponseData.generateCreatedResponse(0,fileDictService.getContendFiles(fileDictDO));
}
@PostMapping("deleteFile")
@ApiOperation("删除视频 id ")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation("** 删除视频 id ")
@LoginRequired
public ResponseVO deleteFile(@RequestBody FileDictDO fileDictDO){
return ResponseData.generateCreatedResponse(0,fileDictService.deleteFile(fileDictDO));
}
@PostMapping("addFile")
@ApiOperation("新增视频 contentId fileName fileSize fileType fileUrl")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation("** 新增视频 contentId fileName fileSize fileType fileUrl")
@LoginRequired
public ResponseVO addFile(@RequestBody FileDictDO fileDictDO){
return ResponseData.generateCreatedResponse(0,fileDictService.addFile(fileDictDO));
}
@PostMapping("updateFile")
@ApiOperation("新增视频 id contentId fileName fileSize fileType fileUrl")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation("** 新增视频 id contentId fileName fileSize fileType fileUrl")
@LoginRequired
public ResponseVO updateFile(@RequestBody FileDictDO fileDictDO){
return ResponseData.generateCreatedResponse(0,fileDictService.updateFile(fileDictDO));
}
......
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.model.ImageCheckRecordDO;
import com.subsidy.service.ImageCheckRecordService;
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 2022-07-14
*/
@RestController
@Api(tags = "实名验证记录表")
@RequestMapping("/imageCheckRecord")
public class ImageCheckRecordController {
@Autowired
private ImageCheckRecordService imageCheckRecordService;
@PostMapping("getImageCheckHistory")
@ApiOperation("获取某人某个班级的验证历史 memberId classId ")
@LoginRequired
public ResponseVO getImageCheckHistory(@RequestBody ImageCheckRecordDO imageCheckRecordDO){
return ResponseData.generateCreatedResponse(0,imageCheckRecordService.getImageCheckHistory(imageCheckRecordDO));
}
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.model.JobDictDO;
import com.subsidy.service.JobDictService;
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 2022-02-10
*/
@RestController
@Api(tags = "岗位表")
@RequestMapping("/jobDict")
//TODO: 字段类型不全
public class JobDictController {
@Autowired
private JobDictService jobDictService;
@PostMapping("queryJobs")
@ApiOperation("查询某公司的岗位 companyId")
@LoginRequired
public ResponseVO queryJobs(@RequestBody JobDictDO jobDictDO){
return ResponseData.generateCreatedResponse(0,jobDictService.queryJobs(jobDictDO));
}
@PostMapping("deleteJob")
@ApiOperation("删除某个岗位 id")
@LoginRequired
public ResponseVO deleteJob(@RequestBody JobDictDO jobDictDO){
return ResponseData.generateCreatedResponse(0,jobDictService.deleteJob(jobDictDO));
}
@PostMapping("addJob")
@ApiOperation("添加岗位 companyId jobName")
@LoginRequired
public ResponseVO addJob(@RequestBody JobDictDO jobDictDO){
return ResponseData.generateCreatedResponse(0,jobDictService.addJob(jobDictDO));
}
@PostMapping("updateJob")
@ApiOperation("更新岗位 id jobName")
@LoginRequired
public ResponseVO updateJob(@RequestBody JobDictDO jobDictDO){
return ResponseData.generateCreatedResponse(0,jobDictService.updateJob(jobDictDO));
}
}
package com.subsidy.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 2022-02-10
*/
@RestController
@Api(tags = "岗位人员表")
@RequestMapping("/jobMemberMapping")
public class JobMemberMappingController {
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.common.interceptor.TimeRequired;
import com.subsidy.dto.administer.VerifyCodeDTO;
import com.subsidy.dto.member.AddMemberDTO;
import com.subsidy.dto.member.ContentMemberDTO;
import com.subsidy.dto.member.GetAllDTO;
import com.subsidy.dto.member.StudyHistoryDTO;
import com.subsidy.dto.member.*;
import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.model.MemberDO;
import com.subsidy.service.MemberService;
import com.subsidy.util.ConstantUtils;
import com.subsidy.vo.member.ContentVodVO;
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;
import io.swagger.annotations.Api;
/**
* <p>
......@@ -39,29 +34,29 @@ public class MemberController {
private MemberService memberService;
@PostMapping("getAll")
@ApiOperation("查询某部门成员 pageNum pageSize departmentId userName status")
//@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation("查询某部门成员 pageNum pageSize departmentId userName status startDate endDate")
@LoginRequired
public ResponseVO getAll(@RequestBody GetAllDTO getAllDTO){
return ResponseData.generateCreatedResponse(0,memberService.getAll(getAllDTO));
}
@PostMapping("deleteMember")
@ApiOperation("删除成员 id ")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@LoginRequired
public ResponseVO deleteMember(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.deleteMember(memberDO));
}
@PostMapping("addMember")
@ApiOperation("新增成员 departmentId userName accountName telephone gender image idCard")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation("新增成员 companyId userName accountName accountNameEn telephone gender image idCard departmentIds jobIds workNo inductionDate email")
@LoginRequired
public ResponseVO addMember(@RequestBody AddMemberDTO addMemberDTO){
return ResponseData.generateCreatedResponse(0,memberService.addMember(addMemberDTO));
}
@PostMapping("updateMember")
@ApiOperation("编辑成员 {id departmentId userName accountName telephone gender image idCard status}")
//@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation("编辑成员 {id companyId userName accountName accountNameEn telephone gender image idCard status departmentIds jobIds}")
@LoginRequired
public ResponseVO updateMember(@RequestBody AddMemberDTO addMemberDTO){
return ResponseData.generateCreatedResponse(0,memberService.updateMember(addMemberDTO));
}
......@@ -73,52 +68,134 @@ public class MemberController {
}
@PostMapping("passwordLogin")
@ApiOperation("手机端:密码登录 {accountName password}")
public ResponseVO passwordLogin(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.passwordLogin(memberDO));
@ApiOperation("手机端:密码登录 { companyId accountName password}")
public ResponseVO passwordLogin(@RequestBody PasswordLoginDTO passwordLoginDTO){
return ResponseData.generateCreatedResponse(0,memberService.passwordLogin(passwordLoginDTO));
}
@PostMapping("qingxuetangLogin")
@ApiOperation("轻学堂登录 手机号mobile")
@TimeRequired
public ResponseVO qingxuetangLogin(@RequestBody QingxuetangLoginDTO qingxuetangLoginDTO){
return ResponseData.generateCreatedResponse(0,memberService.qingxuetangLogin(qingxuetangLoginDTO));
}
@PostMapping("kunchiLogin")
@ApiOperation("鲲驰登陆 authCorpName 手机号mobile nickname timestamp sign")
@TimeRequired
public ResponseVO kunchiLogin(@RequestBody QingxuetangLoginDTO qingxuetangLoginDTO){
return ResponseData.generateCreatedResponse(0,memberService.kunchiLogin(qingxuetangLoginDTO));
}
@PostMapping("checkStatus")
@ApiOperation("实名制验证状态 memberId")
@TimeRequired
public ResponseVO checkStatus(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.checkStatus(memberDO));
}
@PostMapping("updatePassword")
@ApiOperation("修改密码 {id password}")
@LoginRequired
@TimeRequired
public ResponseVO updatePassword(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.updatePassword(memberDO));
}
@PostMapping("studyPage")
@ApiOperation("手机端:学习主页 id 学员id")
public ResponseVO studyPage(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.studyPage(memberDO));
@PostMapping("updateCheckImage")
@ApiOperation("上传采集照片 id checkImage")
@TimeRequired
public ResponseVO updateCheckImage(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.updateCheckImage(memberDO));
}
@PostMapping("removeCheckImage")
@ApiOperation("清除采集照片 id ")
public ResponseVO removeCheckImage(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.removeCheckImage(memberDO));
}
@PostMapping("myCourses")
@ApiOperation("手机端:我的学习--课程 memberId 学员id status 状态 0:全部 1:进行中 2:待开始 3:已完成 ")
// @LoginRequired
@TimeRequired
public ResponseVO myCourses(@RequestBody MyCoursesDTO myCoursesDTO){
return ResponseData.generateCreatedResponse(0,memberService.myCourses(myCoursesDTO));
}
@PostMapping("contentVod")
@ApiOperation("手机端:目录+视频 courseId 课程 memberId 学员id")
@ApiOperation("手机端:目录+视频 classId 班级id courseId 课程 memberId 学员id")
// @LoginRequired
@TimeRequired
public ResponseVO contentVod(@RequestBody ContentMemberDTO contentVodDTO){
return ResponseData.generateCreatedResponse(0,memberService.contentVod(contentVodDTO));
}
@PostMapping("contentFiles")
@ApiOperation("手机端:目录+课件 courseId 课程 memberId 学员id")
@LoginRequired
@TimeRequired
public ResponseVO contentFiles(@RequestBody ContentMemberDTO contentMemberDTO){
return ResponseData.generateCreatedResponse(0,memberService.contentFiles(contentMemberDTO));
}
@PostMapping("studyHistory")
@ApiOperation("学习记录 id 成员id pageSize pageNum")
@ApiOperation("学习记录 memberId 成员id pageSize pageNum")
@LoginRequired
@TimeRequired
public ResponseVO studyHistory(@RequestBody StudyHistoryDTO studyHistoryDTO){
return ResponseData.generateCreatedResponse(0,memberService.studyHistory(studyHistoryDTO));
}
@PostMapping("getCourseTest")
@ApiOperation("获取课程下的测试情况 {memberId 成员id courseId 课程id classId}")
@ApiOperation("获取课程下的测试情况 {memberId 成员id 班级id classId courseId 课程id }")
@LoginRequired
@TimeRequired
public ResponseVO getCourseTest(@RequestBody ContentMemberDTO contentMemberDTO){
return ResponseData.generateCreatedResponse(0,memberService.getCourseTest(contentMemberDTO));
}
@PostMapping("getTestDoneDetail")
@ApiOperation("获取某个测评学生的完成情况 paperId memberId")
@LoginRequired
public ResponseVO getPaperDoneDetail(@RequestBody ExerciseDoneResultDO exerciseDoneResultDO){
return ResponseData.generateCreatedResponse(0,memberService.getPaperDoneDetail(exerciseDoneResultDO));
}
@PostMapping("getStudyInfo")
@ApiOperation("获取学生完成课程情况 id 学员id")
@LoginRequired
@TimeRequired
public ResponseVO getStudyInfo(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.getStudyInfo(memberDO));
}
@PostMapping("checkTimes")
@ApiOperation("检测是否超过次数 memberId paperId classId")
@LoginRequired
public ResponseVO checkTimes(@RequestBody ExerciseDoneResultDO exerciseDoneResultDO){
return ResponseData.generateCreatedResponse(0,memberService.checkTimes(exerciseDoneResultDO));
}
@PostMapping("importRedis")
@ApiOperation("导入学生账号到redis")
@LoginRequired
public void importRedis(){
memberService.importRedis();
}
@PostMapping("changeDepartments")
@ApiOperation("修改部门 desDepId[] 目的部门 memberIds[] 成员id")
@LoginRequired
public ResponseVO changeDepartments(@RequestBody ChangeDepartmentsDTO changeDepartmentsDTO){
return ResponseData.generateCreatedResponse(0,memberService.changeDepartments(changeDepartmentsDTO));
}
@PostMapping("qxy")
@ApiOperation("Q学友授权 telephone 手机号")
@TimeRequired
public ResponseVO qxy(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.qxy(memberDO));
}
}
package com.subsidy.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 2022-01-28
*/
@RestController
@Api(tags = "")
@RequestMapping("/member-study-length-do")
public class MemberStudyLengthController {
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.opr.GetHistoryDTO;
import com.subsidy.service.OprAdmDictService;
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 DengMin
* @since 2021-12-13
*/
@RestController
@Api(tags = "后台审计表")
@RequestMapping("/oprAdm")
public class OprAdmDictController {
@Autowired
private OprAdmDictService oprAdmDictService;
@PostMapping("getHistory")
@ApiOperation("获取后台用户审计 {pageSize pageNum userName startDate endDate}")
@LoginRequired
public ResponseVO getHistory(@RequestBody GetHistoryDTO getHistoryDTO){
return ResponseData.generateCreatedResponse(0,oprAdmDictService.getHistory(getHistoryDTO));
}
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.opr.GetHistoryDTO;
import com.subsidy.service.OprMemDictService;
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 DengMin
* @since 2021-12-13
*/
@RestController
@Api(tags = "学员审计表")
@RequestMapping("/oprMem")
public class OprMemDictController {
@Autowired
private OprMemDictService oprMemDictService;
@PostMapping("getHistory")
@ApiOperation("获取学员审计 {pageSize pageNum userName startDate endDate}")
@LoginRequired
public ResponseVO getHistory(@RequestBody GetHistoryDTO getHistoryDTO){
return ResponseData.generateCreatedResponse(0,oprMemDictService.getHistory(getHistoryDTO));
}
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.model.PaperDictDO;
import com.subsidy.service.PaperDictService;
import com.subsidy.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 DengMin
* @since 2021-12-03
*/
@RestController
@Api(tags = "试卷字典表")
@RequestMapping("/paper")
public class PaperDictController {
@Autowired
private PaperDictService paperDictService;
@PostMapping("queryPapers")
@ApiOperation("查看课程下的测试 {courseId paperName}")
@LoginRequired
public ResponseVO queryPapers(@RequestBody PaperDictDO paperDictDO) {
return ResponseData.generateCreatedResponse(0, paperDictService.queryPapers(paperDictDO));
}
@PostMapping("deletePaper")
@ApiOperation("删除卷子 {id}")
@LoginRequired
public ResponseVO deletePaper(@RequestBody PaperDictDO paperDictDO) {
return ResponseData.generateCreatedResponse(0, paperDictService.deletePaper(paperDictDO));
}
@PostMapping("update")
@ApiOperation("启用/禁用 {id paperStatus}")
@LoginRequired
public ResponseVO updateStatus(@RequestBody PaperDictDO paperDictDO) {
return ResponseData.generateCreatedResponse(0, paperDictService.updateStatus(paperDictDO));
}
@PostMapping("addPaper")
@ApiOperation("添加卷子 {courseId paperName}")
@LoginRequired
public ResponseVO addPaper(@RequestBody PaperDictDO paperDictDO) {
return ResponseData.generateCreatedResponse(0, paperDictService.addPaper(paperDictDO));
}
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.mapper.RankDictMapper;
import com.subsidy.model.RankDictDO;
import com.subsidy.service.RankDictService;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 职级字典表 前端控制器
* </p>
*
* @author DengMin
* @since 2022-02-14
*/
@RestController
@Api(tags = "职级字典表")
@RequestMapping("/rankDict")
public class RankDictController {
@Autowired
private RankDictService rankDictService;
@PostMapping("addRank")
@ApiOperation("添加职级 companyId rank")
@LoginRequired
public ResponseVO addRank(@RequestBody RankDictDO rankDictDO){
return ResponseData.generateCreatedResponse(0,rankDictService.addRank(rankDictDO));
}
@PostMapping("deleteRank")
@ApiOperation("删除职级 id")
@LoginRequired
public ResponseVO deleteById(@RequestBody RankDictDO rankDictDO){
return ResponseData.generateCreatedResponse(0,rankDictService.deleteRank(rankDictDO));
}
@PostMapping("updateRank")
@ApiOperation("添加职级 id rank")
@LoginRequired
public ResponseVO updateRank(@RequestBody RankDictDO rankDictDO){
return ResponseData.generateCreatedResponse(0,rankDictService.updateRank(rankDictDO));
}
@PostMapping("queryRanks")
@ApiOperation("查看职级 companyId")
@LoginRequired
public ResponseVO queryRanks(@RequestBody RankDictDO rankDictDO){
return ResponseData.generateCreatedResponse(0,rankDictService.queryRanks(rankDictDO));
}
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.model.RotationImgDictDO;
import com.subsidy.service.RotationImgDictService;
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 2022-02-23
*/
@RestController
@Api(tags = "轮播图")
@RequestMapping("/rotationImgDict")
public class RotationImgDictController {
@Autowired
private RotationImgDictService rotationImgDictService;
@PostMapping("addRotation")
@ApiOperation("添加轮播图 {companyId 公司id rotationImg 轮播图地址}")
@LoginRequired
public ResponseVO addRotation(@RequestBody RotationImgDictDO rotationImgDictDO){
return ResponseData.generateCreatedResponse(0,rotationImgDictService.addRotation(rotationImgDictDO));
}
@PostMapping("deleteRotation")
@ApiOperation("删除轮播图 {id}")
@LoginRequired
public ResponseVO deleteRotation(@RequestBody RotationImgDictDO rotationImgDictDO){
return ResponseData.generateCreatedResponse(0,rotationImgDictService.deleteRotation(rotationImgDictDO));
}
@PostMapping("updateRotation")
@ApiOperation("编辑轮播图 id")
@LoginRequired
public ResponseVO updateRotation(@RequestBody RotationImgDictDO rotationImgDictDO){
return ResponseData.generateCreatedResponse(0,rotationImgDictService.updateRotation(rotationImgDictDO));
}
@PostMapping("getAllRotations")
@ApiOperation("获取某企业的轮播图 companyId")
@LoginRequired
public ResponseVO getAllRotations(@RequestBody RotationImgDictDO rotationImgDictDO){
return ResponseData.generateCreatedResponse(0,rotationImgDictService.getAllRotations(rotationImgDictDO));
}
}
......@@ -4,21 +4,19 @@ package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.common.interceptor.TimeRequired;
import com.subsidy.dto.member.GetMemberSignInfoDTO;
import com.subsidy.dto.sign.ClassSignInfoDTO;
import com.subsidy.dto.sign.SignInDTO;
import com.subsidy.model.MemberDO;
import com.subsidy.dto.sign.DataViewDTO;
import com.subsidy.model.SignInRecordDO;
import com.subsidy.service.SignInRecordService;
import com.subsidy.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;
import io.swagger.annotations.Api;
/**
* <p>
......@@ -38,27 +36,37 @@ public class SignInRecordController {
@PostMapping("getMemberSignInfo")
@ApiOperation("获取某个成员的签到记录 id 成员id pageSize pageNum")
public ResponseVO getMemberSignInfo(@RequestBody GetMemberSignInfoDTO getMemberSignInfoDTO){
return ResponseData.generateCreatedResponse(0,signInRecordService.getMemberSignInfo(getMemberSignInfoDTO));
@LoginRequired
public ResponseVO getMemberSignInfo(@RequestBody GetMemberSignInfoDTO getMemberSignInfoDTO) {
return ResponseData.generateCreatedResponse(0, signInRecordService.getMemberSignInfo(getMemberSignInfoDTO));
}
@PostMapping("signIn")
@ApiOperation("签到 memberId")
public ResponseVO signIn(@RequestBody SignInRecordDO signInRecordDO){
return ResponseData.generateCreatedResponse(0,signInRecordService.signIn(signInRecordDO));
@LoginRequired
@TimeRequired
public ResponseVO signIn(@RequestBody SignInRecordDO signInRecordDO) {
return ResponseData.generateCreatedResponse(0, signInRecordService.signIn(signInRecordDO));
}
@PostMapping("classStudyHistory")
@ApiOperation("校区学习记录 id 校区id className courseName pageSize pageNum")
//@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO classSignInfo(@RequestBody ClassSignInfoDTO classSignInfoDTO){
return ResponseData.generateCreatedResponse(0,signInRecordService.classSignInfo(classSignInfoDTO));
@PostMapping("dataView")
@ApiOperation("数据概览 id 校区id className pageSize pageNum")
@LoginRequired
public ResponseVO dataView(@RequestBody DataViewDTO classSignInfoDTO) {
return ResponseData.generateCreatedResponse(0, signInRecordService.dataView(classSignInfoDTO));
}
@PostMapping("signInStatus")
@ApiOperation("判断学生当天有没有打卡 {memberId 学生id}")
public ResponseVO signInStatus(@RequestBody SignInRecordDO signInRecordDO){
return ResponseData.generateCreatedResponse(0,signInRecordService.signInStatus(signInRecordDO));
@LoginRequired
@TimeRequired
public ResponseVO signInStatus(@RequestBody SignInRecordDO signInRecordDO) {
return ResponseData.generateCreatedResponse(0, signInRecordService.signInStatus(signInRecordDO));
}
@PostMapping("getRedisData")
public void test() {
signInRecordService.test();
}
}
......@@ -3,16 +3,16 @@ package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.TimeRequired;
import com.subsidy.dto.sms.SendVerifyCodeDTO;
import com.subsidy.service.SmsVerifyCodeService;
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;
import io.swagger.annotations.Api;
/**
* <p>
......@@ -32,6 +32,7 @@ public class SmsVerifyCodeController {
@PostMapping(value = "/send")
@ApiOperation("发送短信验证码 {telephone} ")
@TimeRequired
public ResponseVO sendVerifyCode(@RequestBody SendVerifyCodeDTO sendVerifyCodeDTO ) {
smsVerifyCodeService.sendVerifyCode(sendVerifyCodeDTO);
return ResponseData.generateCreatedResponse(0);
......
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.content.GetContendVodsDTO;
import com.subsidy.dto.vod.ChangeOrdersDTO;
import com.subsidy.model.VodDictDO;
import com.subsidy.service.VodDictService;
import com.subsidy.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;
import io.swagger.annotations.Api;
/**
* <p>
......@@ -35,38 +33,39 @@ public class VodDictController {
@PostMapping("/signature")
@ApiOperation("获取签名")
public ResponseVO signature()throws Exception{
return ResponseData.generateCreatedResponse(0,vodDictService.signature());
}
@PostMapping("getContendVods")
@ApiOperation("获取目录下的视频 {contentId vodName}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getContendVods(@RequestBody GetContendVodsDTO getContendVodsDTO){
return ResponseData.generateCreatedResponse(0,vodDictService.getContendVods(getContendVodsDTO));
public ResponseVO signature() throws Exception {
return ResponseData.generateCreatedResponse(0, vodDictService.signature());
}
@PostMapping("deleteVod")
@ApiOperation("删除视频 id ")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteVod(@RequestBody VodDictDO vodDictDO){
return ResponseData.generateCreatedResponse(0,vodDictService.deleteVod(vodDictDO));
@LoginRequired
public ResponseVO deleteVod(@RequestBody VodDictDO vodDictDO) {
vodDictService.deleteVod(vodDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("addVod")
@ApiOperation("新增视频 contentId vodName vodLength vodType vodSize vodUrl vodCode")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addVod(@RequestBody VodDictDO vodDictDO){
return ResponseData.generateCreatedResponse(0,vodDictService.addVod(vodDictDO));
@ApiOperation("新增视频 labelId vodName vodLength vodType vodSize vodUrl vodCode")
@LoginRequired
public ResponseVO addVod(@RequestBody VodDictDO vodDictDO) {
vodDictService.addVod(vodDictDO);
return ResponseData.generateCreatedResponse(0, ConstantUtils.ADD_SUCCESS);
}
@PostMapping("updateVod")
@ApiOperation("新增视频 id contentId vodName vodLength vodType vodSize vodUrl vodCode")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateVod(@RequestBody VodDictDO vodDictDO){
return ResponseData.generateCreatedResponse(0,vodDictService.updateVod(vodDictDO));
@ApiOperation("新增视频 id labelId vodName vodLength vodType vodSize vodUrl vodCode")
@LoginRequired
public ResponseVO updateVod(@RequestBody VodDictDO vodDictDO) {
vodDictService.updateVod(vodDictDO);
return ResponseData.generateCreatedResponse(0, ConstantUtils.SET_SUCCESS);
}
@PostMapping("changeOrders")
@ApiOperation("排序 vodIds [] 视频的id")
public ResponseVO changeOrders(@RequestBody ChangeOrdersDTO changeOrdersDTO ){
vodDictService.changeOrders(changeOrdersDTO);
return ResponseData.generateCreatedResponse(0,ConstantUtils.SET_SUCCESS);
}
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.label.VodLabelPageDTO;
import com.subsidy.model.VodLabelDictDO;
import com.subsidy.service.VodLableDictService;
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 2022-07-19
*/
@RestController
@Api(tags = "视频库类目表")
@RequestMapping("/vodLabelDict")
public class VodLabelDictController {
@Autowired
private VodLableDictService vodLableDictService;
@PostMapping(value = "addVodLabel")
@ApiOperation("添加视频类目: labelName/类目名称")
@LoginRequired
public ResponseVO addVodLabel(@RequestBody VodLabelDictDO vodLabelDictDO) {
vodLableDictService.save(vodLabelDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "updateVodLabel")
@ApiOperation("添加视频类目: id/类目ID、labelName/类目名称")
@LoginRequired
public ResponseVO updateVodLabel(@RequestBody VodLabelDictDO vodLabelDictDO) {
vodLableDictService.updateById(vodLabelDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "deleteVodLabel")
@ApiOperation("添加视频类目: id/类目ID")
@LoginRequired
public ResponseVO deleteVodLabel(@RequestBody VodLabelDictDO vodLabelDictDO) {
vodLableDictService.removeById(vodLabelDictDO.getId());
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "queryVodLabelPage")
@ApiOperation("分页查询视频类目: labelName/名称、pageNum/但前页数、pageSize/每页显示条数")
@LoginRequired
public ResponseVO queryVodLabelPage(@RequestBody VodLabelPageDTO vodLabelPageDTO) {
return ResponseData.generateCreatedResponse(0, vodLableDictService.queryVodLabelPage(vodLabelPageDTO));
}
@PostMapping(value = "queryVodLabel")
@ApiOperation("查询全部视频类目")
@LoginRequired
public ResponseVO queryVodLabel() {
return ResponseData.generateCreatedResponse(0, vodLableDictService.list());
}
}
......@@ -4,16 +4,20 @@ package com.subsidy.controller;
import com.alibaba.fastjson.JSON;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.common.interceptor.TimeRequired;
import com.subsidy.dto.vod.InsertHistoryNewDTO;
import com.subsidy.dto.vod.RemainSecondsDTO;
import com.subsidy.dto.vod.SignDatePlaysDTO;
import com.subsidy.model.VodPlayHistoryDO;
import com.subsidy.service.VodPlayHistoryService;
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;
import io.swagger.annotations.Api;
/**
* <p>
......@@ -33,14 +37,54 @@ public class VodPlayHistoryController {
@PostMapping("insertHistory")
@ApiOperation("记录学生看视频位置 ajax请求 classId班级id vodId 视频id memberId 成员id playLength 播放时长 playRecord 位点")
@LoginRequired
@TimeRequired
public ResponseVO insertHistory(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){
return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.insertHistory(vodPlayHistoryDO));
}
@RequestMapping("insertHistoryNew")
@ApiOperation("记录学生看视频位置 classId班级id vodId 视频id memberId 成员id playLength 播放时长 playRecord 位点")
// @LoginRequired
@TimeRequired
public ResponseVO insertHistoryNew(@RequestBody String param){
VodPlayHistoryDO vodPlayHistoryDO = JSON.parseObject(param,VodPlayHistoryDO.class);
return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.insertHistoryNew(vodPlayHistoryDO));
InsertHistoryNewDTO insertHistoryNewDTO = JSON.parseObject(param, InsertHistoryNewDTO.class);
return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.insertHistoryNew(insertHistoryNewDTO));
}
@PostMapping("dataFix")
@ApiOperation("每个视频都看一次")
// @LoginRequired
public void dadaFix(@RequestBody SignDatePlaysDTO dataFixDTO){
vodPlayHistoryService.dataFix(dataFixDTO);
}
@PostMapping("signDatePlays")
@ApiOperation("每天接着看几个视频 接dataFix的")
// @LoginRequired
public void signDatePlays(@RequestBody SignDatePlaysDTO signDatePlaysDTO ){
vodPlayHistoryService.signDatePlays(signDatePlaysDTO);
}
@PostMapping("remainSeconds")
@ApiOperation("每个视频先看一下,然后剩余时长分配到每天里 classId memberId")
// @LoginRequired
public void remainSeconds(@RequestBody RemainSecondsDTO remainSecondsDTO){
vodPlayHistoryService.remainSeconds(remainSecondsDTO);
}
@PostMapping("playLengthFix")
@ApiOperation("按照时长去跑脚本 {classId memberId}")
// @LoginRequired
public void playLengthFix(@RequestBody RemainSecondsDTO remainSecondsDTO){
vodPlayHistoryService.playLengthFix(remainSecondsDTO);
}
@PostMapping("testPlays")
@ApiOperation("解决有交叉时间的数据")
public ResponseVO testPlays(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){
return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.testPlays(vodPlayHistoryDO));
}
}
package com.subsidy.dto.administer;
import lombok.Data;
@Data
public class ClassDailyInfoDTO {
private Long classId;
private String userName;
private Long courseId;
private String startDate;
private String endDate;
private Integer pageSize;
private Integer pageNum;
}
......@@ -15,4 +15,6 @@ public class ClassDetailDTO {
Boolean flag;
private Long paperId;
}
package com.subsidy.dto.administer;
import lombok.Data;
@Data
public class ClassVodDailyInfoDTO {
private Integer pageSize;
private Integer pageNum;
private Long classId;
private String userName;
}
package com.subsidy.dto.administer;
import lombok.Data;
@Data
public class ClassVodInfoDTO {
private Long classId;
private String vodName;
private Long courseId;
}
package com.subsidy.dto.administer;
import lombok.Data;
@Data
public class ManageMemberDTO {
private Integer pageSize;
private Integer pageNum;
private String userName;
}
package com.subsidy.dto.administer;
import lombok.Data;
@Data
public class MemberStudyLogDTO {
private Long memberId;
private Long classId;
private Integer pageSize;
private Integer pageNum;
}
......@@ -11,10 +11,14 @@ public class OperatorsDTO {
private Integer role;
private Long fieldId;
private String companyName;
private String userName;
private Integer id;
private Long id;
private String superviseName;
}
package com.subsidy.dto.businessScope;
import lombok.Data;
@Data
public class BusinessScopeDTO {
private String businessScopeName;
private Integer pageNum;
private Integer pageSize;
}
package com.subsidy.dto.cert;
import com.subsidy.model.CertDictDO;
import lombok.Data;
import java.util.List;
@Data
public class AddCertDTO extends CertDictDO {
private List<Long> typeIds;
}
package com.subsidy.dto.cert;
import lombok.Data;
@Data
public class ChangeCompanyCertsDTO {
private Long companyId;
private Long certId;
private Boolean signStatus;
}
package com.subsidy.dto.cert;
import lombok.Data;
@Data
public class GetAllCertsDTO {
private Integer pageSize;
private Integer pageNum;
private Long typeId;
private String certName;
}
package com.subsidy.dto.cert;
import lombok.Data;
@Data
public class GetAllTypeDTO {
private Integer pageSize;
private Integer pageNum;
}
package com.subsidy.dto.cert;
import lombok.Data;
@Data
public class GetCompanyCertsDTO {
private Long companyId;
private Integer pageSize;
private Integer pageNum;
}
package com.subsidy.dto.cert;
import lombok.Data;
@Data
public class GetCompanyCertsWithStatusDTO {
private Long companyId;
private Long typeId;
private Long memberId;
}
package com.subsidy.dto.cert;
import lombok.Data;
@Data
public class GetListDTO {
private Integer pageSize;
private Integer pageNum;
private String status;
private Long memberId;
}
package com.subsidy.dto.cert;
import lombok.Data;
@Data
public class GetOneCertDTO {
private Integer id;
private Long userId;
}
package com.subsidy.dto.cert;
import lombok.Data;
@Data
public class SignManagementDTO {
private Integer pageSize;
private Integer pageNum;
private Long typeId;
private Long certId;
private String startDate;
private String endDate;
private String item;
private String status;
}
package com.subsidy.dto.cert;
import com.subsidy.model.CertMemberFileMappingDO;
import lombok.Data;
import java.util.List;
@Data
public class SignUpDTO {
private Long certId;
private Long memberId;
private List<CertMemberFileMappingDO> files;
}
package com.subsidy.dto.classDict;
import com.subsidy.model.ClassDictDO;
import com.subsidy.model.ClassNoticeDO;
import lombok.Data;
import java.util.List;
@Data
public class AddClassDTO extends ClassDictDO {
private Long userId;
private List<Long> memberIds;
private List<ClassNoticeDO> classNoticeDOS;
}
package com.subsidy.dto.classDict;
import lombok.Data;
@Data
public class ClassTypeDTO {
private Long userId;
private Long companyId;
}
package com.subsidy.dto.classDict;
import lombok.Data;
@Data
public class GetClassBaseInfoDTO {
private Long userId;
private Long id;
}
package com.subsidy.dto.classNotice;
import lombok.Data;
@Data
public class SendNotificationDTO {
private Long classId;
private String sendType;
}
......@@ -3,6 +3,8 @@ package com.subsidy.dto.company;
import com.subsidy.model.CompanyDictDO;
import lombok.Data;
import java.util.List;
@Data
public class AddCompanyDTO extends CompanyDictDO {
......@@ -14,4 +16,6 @@ public class AddCompanyDTO extends CompanyDictDO {
private Integer role;
private List<Long> field;
}
package com.subsidy.dto.company;
import lombok.Data;
@Data
public class GetCompanyMembersDTO {
private Integer pageSize;
private Integer pageNum;
private Long companyId;
private String userName;
}
package com.subsidy.dto.contentVod;
import lombok.Data;
import java.util.List;
@Data
public class AddContentVod {
private List<Long> vodIds;
private Long contentId;
}
package com.subsidy.dto.contentVod;
import lombok.Data;
@Data
public class ContentVodDTO {
private Long contentId;
private Long vodId;
}
package com.subsidy.dto.course;
import lombok.Data;
import java.util.List;
@Data
public class AddCourseDTO {
/**
* 企业id
*/
private Long companyId;
/**
* 课程名称
*/
private String courseName;
/**
* 课程类型
*/
private String courseType;
/**
* 课程来源
*/
private String courseSource;
/**
* 封面
*/
private String coverPage;
/**
* 备注
*/
private String remark;
/**
* 开放状态
*/
private Integer openStatus;
/**
* 行业范围
*/
private List<Long> fieldDictDOS;
/**
* 课程类目
*/
private List<Long> categoryDOS;
/**
* 适用岗位
*/
private List<Long> jobDictDOS;
/**
* 适用职级
*/
private List<Long> rankDictDOS;
}
......@@ -2,8 +2,6 @@ package com.subsidy.dto.course;
import lombok.Data;
import java.util.List;
@Data
public class QueryCoursesDTO {
......@@ -17,12 +15,14 @@ public class QueryCoursesDTO {
private String courseType;
private String courseSource;
private Long fieldId;
private Long rankId;
private Long administerId;
private Long jobId;
private Long companyId;
private List<Long> teacherIds;
private Integer openStatus;
}
package com.subsidy.dto.course;
import lombok.Data;
import java.util.List;
@Data
public class UpdateCoursesDTO {
private Long id;
/**
*
*/
private Long companyId;
/**
* 课程名称
*/
private String courseName;
/**
* 封面
*/
private String coverPage;
/**
* 课程类型
*/
private String courseType;
/**
* 备注
*/
private String remark;
/**
* 行业范围
*/
private List<Long> fieldDictDOS;
/**
* 课程类目
*/
private List<Long> categoryDOS;
/**
* 适用岗位
*/
private List<Long> jobDictDOS;
/**
* 适用职级
*/
private List<Long> rankDictDOS;
}
package com.subsidy.dto.department;
import lombok.Data;
@Data
public class GetDepartmentMembersDTO {
private Integer pageSize;
private Integer pageNum;
private Long departmentId;
private Long companyId;
private String userName;
private String startDate;
private String endDate;
}
package com.subsidy.dto.detection;
import lombok.Data;
@Data
public class VerifyDTO {
private String ticket;
private String userIp;
private String randStr;
private Long memberId;
private Long classId;
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!