部署相关修改
parent
6e51bc5606
commit
fd2c19e920
|
@ -1,6 +1,7 @@
|
||||||
package com.jwl.driver.server.controller;
|
package com.jwl.driver.server.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.jwl.driver.server.dto.QuestionQueryDto;
|
import com.jwl.driver.server.dto.QuestionQueryDto;
|
||||||
import com.jwl.driver.server.exception.BusinessException;
|
import com.jwl.driver.server.exception.BusinessException;
|
||||||
import com.jwl.driver.server.response.BaseResponse;
|
import com.jwl.driver.server.response.BaseResponse;
|
||||||
|
@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -64,4 +66,15 @@ public class TdQuestionController {
|
||||||
}
|
}
|
||||||
return BaseResponse.success(tdQuestionService.getTestQuestion(queryDto));
|
return BaseResponse.success(tdQuestionService.getTestQuestion(queryDto));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("题目分类")
|
||||||
|
@PostMapping("/questionCategory")
|
||||||
|
public BaseResponse questionCategory(@RequestBody QuestionQueryDto queryDto) {
|
||||||
|
log.info("分类题目标识======>questionIdList:{}", queryDto.getQuestionIdList());
|
||||||
|
if (CollectionUtil.isEmpty(queryDto.getQuestionIdList())){
|
||||||
|
return BaseResponse.success(Collections.emptyList());
|
||||||
|
}
|
||||||
|
return BaseResponse.success(tdQuestionService.questionCategory(queryDto));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class TdSysUserController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ITdSysUserService userService;
|
private ITdSysUserService userService;
|
||||||
|
|
||||||
@ApiOperation("用户登陆")
|
@ApiOperation("获取验证码")
|
||||||
@GetMapping("/code")
|
@GetMapping("/code")
|
||||||
public BaseResponse code(@RequestParam String phone) {
|
public BaseResponse code(@RequestParam String phone) {
|
||||||
log.info("获取验证码======>phone:{}", phone);
|
log.info("获取验证码======>phone:{}", phone);
|
||||||
|
|
|
@ -24,6 +24,9 @@ public class TokenFilter extends OncePerRequestFilter {
|
||||||
|
|
||||||
|
|
||||||
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
|
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
|
||||||
|
//移除线程变量里的缓存值
|
||||||
|
TokenThreadUtil.remove();
|
||||||
|
|
||||||
String requestTokenHeader = request.getHeader("Authorization");
|
String requestTokenHeader = request.getHeader("Authorization");
|
||||||
if (StrUtil.isBlank(requestTokenHeader)) {
|
if (StrUtil.isBlank(requestTokenHeader)) {
|
||||||
log.warn("Bearer token 为空");
|
log.warn("Bearer token 为空");
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.jwl.driver.server.service;
|
||||||
import com.jwl.driver.server.dto.QuestionQueryDto;
|
import com.jwl.driver.server.dto.QuestionQueryDto;
|
||||||
import com.jwl.driver.server.entity.TdQuestion;
|
import com.jwl.driver.server.entity.TdQuestion;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.jwl.driver.server.vo.QusetionCategoryVo;
|
||||||
import com.jwl.driver.server.vo.QusetionVo;
|
import com.jwl.driver.server.vo.QusetionVo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -45,4 +46,11 @@ public interface ITdQuestionService extends IService<TdQuestion> {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<QusetionVo> getTestQuestion(QuestionQueryDto queryDto);
|
List<QusetionVo> getTestQuestion(QuestionQueryDto queryDto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 题目分类
|
||||||
|
* @param queryDto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<QusetionCategoryVo> questionCategory(QuestionQueryDto queryDto);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import com.jwl.driver.server.mapper.TdQuestionMapper;
|
||||||
import com.jwl.driver.server.service.ITdQuestionService;
|
import com.jwl.driver.server.service.ITdQuestionService;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.jwl.driver.server.service.ITdSysConfigService;
|
import com.jwl.driver.server.service.ITdSysConfigService;
|
||||||
|
import com.jwl.driver.server.vo.QusetionCategoryVo;
|
||||||
import com.jwl.driver.server.vo.QusetionVo;
|
import com.jwl.driver.server.vo.QusetionVo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -78,4 +79,13 @@ public class TdQuestionServiceImpl extends ServiceImpl<TdQuestionMapper, TdQuest
|
||||||
}
|
}
|
||||||
return resultList;
|
return resultList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<QusetionCategoryVo> questionCategory(QuestionQueryDto queryDto) {
|
||||||
|
|
||||||
|
return null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class SmsUtil {
|
||||||
private static String smsFreeSignName = "对嘛科技";
|
private static String smsFreeSignName = "对嘛科技";
|
||||||
|
|
||||||
//用于存储短信验证码
|
//用于存储短信验证码
|
||||||
private static Map<String, String> codeMap = new HashMap<>();
|
// private static Map<String, String> codeMap = new HashMap<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送验证码
|
* 发送验证码
|
||||||
|
@ -62,16 +62,16 @@ public class SmsUtil {
|
||||||
if (code.length() == 5){
|
if (code.length() == 5){
|
||||||
code = "0" + code;
|
code = "0" + code;
|
||||||
}
|
}
|
||||||
codeMap.put(phone, code);
|
// codeMap.put(phone, code);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取6位验证码
|
* 获取6位验证码
|
||||||
*/
|
*/
|
||||||
public static String getCodeByPhone(String phone){
|
// public static String getCodeByPhone(String phone){
|
||||||
return codeMap.get(phone);
|
// return codeMap.get(phone);
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用的发送短信的方法
|
* 通用的发送短信的方法
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.jwl.driver.server.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 曹林
|
||||||
|
* @description 题型分类
|
||||||
|
* @create 2023/8/13 17:13
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ApiModel("题型分类出参")
|
||||||
|
public class QusetionCategoryVo {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分类标识
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("分类标识")
|
||||||
|
private String category;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分类名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("分类名称")
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型数量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("类型数量")
|
||||||
|
private Integer num;
|
||||||
|
|
||||||
|
}
|
|
@ -1,11 +1,11 @@
|
||||||
spring:
|
spring:
|
||||||
# redis 配置
|
# redis 配置
|
||||||
redis:
|
redis:
|
||||||
host: 81.68.139.95
|
host: 118.31.23.45
|
||||||
port: 6793
|
port: 6379
|
||||||
database: 8
|
database: 8
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
password: Rtf70vILtD
|
password: 123456
|
||||||
|
|
||||||
# 数据库 配置
|
# 数据库 配置
|
||||||
datasource:
|
datasource:
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
spring:
|
spring:
|
||||||
# redis 配置
|
# redis 配置
|
||||||
redis:
|
redis:
|
||||||
host: 81.68.139.95
|
host: 118.31.23.45
|
||||||
port: 6793
|
port: 6379
|
||||||
database: 8
|
database: 8
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
password: Rtf70vILtD
|
password: 123456
|
||||||
|
|
||||||
# 数据库 配置
|
# 数据库 配置
|
||||||
datasource:
|
datasource:
|
||||||
|
|
|
@ -7,7 +7,7 @@ spring:
|
||||||
application:
|
application:
|
||||||
name: '@artifactId@'
|
name: '@artifactId@'
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: test
|
||||||
#mybatis
|
#mybatis
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
mapper-locations: classpath*:/mapper/**Mapper.xml
|
mapper-locations: classpath*:/mapper/**Mapper.xml
|
||||||
|
|
|
@ -55,6 +55,9 @@
|
||||||
<if test="queryDto.cid !=null and queryDto.cid !=''">
|
<if test="queryDto.cid !=null and queryDto.cid !=''">
|
||||||
and find_in_set(#{queryDto.cid},tq.CIDS)
|
and find_in_set(#{queryDto.cid},tq.CIDS)
|
||||||
</if>
|
</if>
|
||||||
|
<if test="queryDto.category !=null and queryDto.category !=''">
|
||||||
|
and find_in_set(#{queryDto.category},tq.CATEGORY)
|
||||||
|
</if>
|
||||||
<if test="queryDto.point !=null and queryDto.point !=''">
|
<if test="queryDto.point !=null and queryDto.point !=''">
|
||||||
and tpq.POINT = #{queryDto.point}
|
and tpq.POINT = #{queryDto.point}
|
||||||
</if>
|
</if>
|
||||||
|
|
Loading…
Reference in New Issue