题库修改 #3

Merged
zcx merged 1 commits from dev-zcx into master 2023-08-19 00:40:55 +08:00
18 changed files with 266 additions and 3 deletions

View File

@ -145,6 +145,13 @@
</dependency>
<!-- 短信服务 -->
<!-- 微信支付 -->
<dependency>
<groupId>com.github.wechatpay-apiv3</groupId>
<artifactId>wechatpay-java</artifactId>
<version>0.2.11</version>
</dependency>
</dependencies>
<build>

View File

@ -28,7 +28,8 @@ public class CorsConfig implements WebMvcConfigurer {
registry.addInterceptor(authInterceptor).addPathPatterns("/**").excludePathPatterns("/**/login",
"/error",
"/webjars/**",
"/doc.html");
"/doc.html",
"/tdQuestion/duima/*");
}

View File

@ -0,0 +1,21 @@
package com.jwl.driver.server.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@ConfigurationProperties(prefix = "wechatpay")
@Data
@Component
public class WechatPayConfig {
/** 应用ID */
private String appId;
/** 商户ID */
private String mchId;
/** 秘钥 */
private String apiV3Key;
/** 证书序列号 */
private String mchSerialNo;
/** 证书路径 */
private String privateKeyPath;
}

View File

@ -6,6 +6,7 @@ import com.jwl.driver.server.dto.QuestionQueryDto;
import com.jwl.driver.server.exception.BusinessException;
import com.jwl.driver.server.response.BaseResponse;
import com.jwl.driver.server.service.ITdQuestionService;
import com.jwl.driver.server.vo.QusetionVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@ -15,6 +16,8 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
@ -77,4 +80,25 @@ public class TdQuestionController {
return BaseResponse.success(tdQuestionService.questionCategory(queryDto));
}
@ApiOperation("对嘛接口-根据查询条件获取题目")
@GetMapping("/duima/list")
public Map listQuestion( QuestionQueryDto queryDto) {
log.info("获取题型======>queryDto:{}", queryDto);
Map<String, Object> result = new HashMap<>();
result.put("code", 200);
result.put("data", tdQuestionService.queryQuestion(queryDto));
return result;
}
@ApiOperation("对嘛接口-修改题库")
@PutMapping("/duima/update")
public Map updateQuestion(@RequestBody QusetionVo qusetionVo) {
log.info("修改题库======>qusetionVo:{}", qusetionVo);
Map<String, Object> result = new HashMap<>();
result.put("code", 200);
result.put("data", tdQuestionService.updateQuestion(qusetionVo));
return result;
}
}

View File

@ -0,0 +1,31 @@
package com.jwl.driver.server.controller;
import com.jwl.driver.server.dto.WechatPayDto;
import com.jwl.driver.server.response.BaseResponse;
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;
/**
*
*/
@RestController
@RequestMapping("/wechat/pay")
public class WechatPayController {
//生成预支付订单
@PostMapping("/prepay")
public BaseResponse createPrepay(@RequestBody WechatPayDto payDto){
//获取openId
return BaseResponse.success();
}
//支付回调接口
//查询订单接口
//关闭订单接口
}

View File

@ -87,4 +87,10 @@ public class QuestionQueryDto implements Serializable {
@ApiModelProperty("获取题数")
private int Num;
/**
*
*/
@ApiModelProperty("题目")
private String question;
}

View File

@ -0,0 +1,14 @@
package com.jwl.driver.server.dto;
import lombok.Data;
@Data
public class WechatPayDto {
private Double money;//金额
private String code;
}

View File

@ -158,4 +158,20 @@ public class TdQuestion implements Serializable {
private String isActive;
/**
*
*/
@TableField("IS_ERROR")
private Integer isError;
/**
* v
*/
@TableField("IS_NEW")
private Integer isNew;
/**
*
*/
@TableField("EXAM_KEYS")
private String examKeys;
}

View File

@ -31,4 +31,6 @@ public interface TdQuestionMapper extends BaseMapper<TdQuestion> {
* @return
*/
List<QusetionVo> queryQuestionByRandom(@Param("queryDto") QuestionQueryDto queryDto);
int updateQuestion(@Param("qusetionVo") QusetionVo qusetionVo);
}

View File

@ -53,4 +53,11 @@ public interface ITdQuestionService extends IService<TdQuestion> {
* @return
*/
List<QusetionCategoryVo> questionCategory(QuestionQueryDto queryDto);
/**
*
* @param qusetionVo
* @return
*/
int updateQuestion(QusetionVo qusetionVo);
}

View File

@ -125,4 +125,9 @@ public class TdQuestionServiceImpl extends ServiceImpl<TdQuestionMapper, TdQuest
}
return resultList;
}
@Override
public int updateQuestion(QusetionVo qusetionVo) {
return this.getBaseMapper().updateQuestion(qusetionVo);
}
}

View File

@ -61,6 +61,10 @@ public class SmsUtil {
String code = (int)(Math.random()*999999)+ "";
if (code.length() == 5){
code = "0" + code;
} else if(code.length() == 4){
code = "00" + code;
} else if(code.length() == 3){
code = "000" + code;
}
// codeMap.put(phone, code);
return code;

View File

@ -0,0 +1,7 @@
package com.jwl.driver.server.util;
/**
*
*/
public class WechatPayUtil {
}

View File

@ -150,4 +150,25 @@ public class QusetionVo {
*/
@ApiModelProperty("是否生效")
private String isActive;
/**
* vip
*/
@ApiModelProperty("是否VIP")
private Integer isVip;
/**
*
*/
@ApiModelProperty("是否易错")
private Integer isError;
/**
* v
*/
@ApiModelProperty("是否新规")
private Integer isNew;
/**
*
*/
@ApiModelProperty("考点")
private String examKeys;
}

View File

@ -42,6 +42,8 @@ driver:
- /driver-api/swagger-resources
- /driver-api/favicon.ico
- /driver-api/tdSysUser/code
- /tdQuestion/duima/list
- /tdQuestion/duima/update
# 需要权限校验url集合
needAuthEndPoints:
@ -54,3 +56,13 @@ token:
message:
code:
expireTime: 300
wechatpay:
appId: 'wx756a7425037609fb'
mchId: '1650477646'
apiV3Key: 'JingWuLianJiaKao20120813ZhouHong'
mchSerialNo: '52974C99DFCC518EA2E5AD20C3753E38B924868D'
privateKeyPath: 'classpath*:/wechatPay/**Mapper.xml'

View File

@ -25,7 +25,11 @@
tq.TYPE,
tq.SHOW_ORDER,
tq.CAR_TYPE_ID,
tq.IS_ACTIVE
tq.IS_ACTIVE,
tq.IS_VIP,
tq.IS_ERROR,
tq.IS_NEW,
tq.EXAM_KEYS
from td_question tq
left join td_point_question tpq on tq.QUESTION_ID = tpq.QUESTION_ID and tq.CAR_TYPE_ID = tpq.CAR_TYPE_ID and
tpq.IS_ACTIVE = '0'
@ -43,6 +47,9 @@
<if test="queryDto.chapter !=null and queryDto.chapter !=''">
and tq.CHAPTER = #{queryDto.chapter}
</if>
<if test="queryDto.question !=null and queryDto.question !=''">
and tq.QUESTION like concat('%' , #{queryDto.question} , '%')
</if>
<if test="queryDto.subject !=null and queryDto.subject !=''">
and tq.SUBJECT = #{queryDto.subject}
</if>
@ -89,7 +96,11 @@
tq.TYPE,
tq.SHOW_ORDER,
tq.CAR_TYPE_ID,
tq.IS_ACTIVE
tq.IS_ACTIVE,
tq.IS_VIP,
tq.IS_ERROR,
tq.IS_NEW,
tq.EXAM_KEYS
from td_question tq
<where>
tq.IS_ACTIVE = '0'
@ -105,4 +116,25 @@
</where>
order by rand() limit ${queryDto.num};
</select>
<update id="updateQuestion" parameterType="com.jwl.driver.server.vo.QusetionVo">
update td_question
<trim prefix="SET" suffixOverrides=",">
<if test="qusetionVo.isVip !=null">
IS_VIP = #{qusetionVo.isVip},
</if>
<if test="qusetionVo.isError !=null">
IS_ERROR = #{qusetionVo.isError},
</if>
<if test="qusetionVo.isNew !=null">
IS_NEW = #{qusetionVo.isNew},
</if>
<if test="qusetionVo.examKeys !=null">
EXAM_KEYS = #{qusetionVo.examKeys},
</if>
</trim>
where QUESTION_ID = #{qusetionVo.questionId}
</update>
</mapper>

View File

@ -0,0 +1,25 @@
-----BEGIN CERTIFICATE-----
MIIEMTCCAxmgAwIBAgIUUpdMmd/MUY6i5a0gw3U+OLkkho0wDQYJKoZIhvcNAQEL
BQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT
FFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg
Q0EwHhcNMjMwODEzMTQzNDEyWhcNMjgwODExMTQzNDEyWjCBijETMBEGA1UEAwwK
MTY1MDQ3NzY0NjEbMBkGA1UECgwS5b6u5L+h5ZWG5oi357O757ufMTYwNAYDVQQL
DC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