更新sql和代码规范修改
This commit is contained in:
@ -5,6 +5,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 项目的启动类
|
||||
*
|
||||
* @author yshop
|
||||
*/
|
||||
@SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${yshop.info.base-package}
|
||||
|
@ -3,12 +3,10 @@ package co.yixiang.yshop.server.controller;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author yshop
|
||||
*/
|
||||
@RestController
|
||||
public class DefaultController {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -156,6 +156,8 @@ wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-sta
|
||||
type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取
|
||||
key-prefix: wa # Redis Key 的前缀 TODO yshop:解决下 Redis key 管理的配置
|
||||
http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
|
||||
order-notice:
|
||||
flag: false
|
||||
|
||||
--- #################### yshop相关配置 ####################
|
||||
|
||||
|
@ -168,6 +168,8 @@ wx:
|
||||
type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取
|
||||
key-prefix: wa # Redis Key 的前缀 TODO yshop:解决下 Redis key 管理的配置
|
||||
http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
|
||||
order-notice:
|
||||
flag: false
|
||||
|
||||
--- #微信支付配置
|
||||
weixin:
|
||||
|
@ -174,6 +174,8 @@ wx:
|
||||
secret: SdVjZvDeDJNJXrEs3aoM2Bf8tfXj3B6lVv2zU0a0Hlw
|
||||
token: wZnpSKA3
|
||||
aesKey: W1T6Zh2reXYGXz7fVaWaPT2QX0akofWpCNYMJjpXL7p
|
||||
order-notice:
|
||||
flag: false
|
||||
|
||||
--- #微信支付配置
|
||||
weixin:
|
||||
|
@ -1,10 +1,11 @@
|
||||
<configuration>
|
||||
<!-- 引用 Spring Boot 的 logback 基础配置 -->
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
|
||||
<!-- 变量 yshop.info.base-package,基础业务包 -->
|
||||
<springProperty scope="context" name="yshop.info.base-package" source="yshop.info.base-package"/>
|
||||
<!-- 格式化输出:%d 表示日期,%X{tid} SkWalking 链路追踪编号,%thread 表示线程名,%-5level:级别从左显示 5 个字符宽度,%msg:日志消息,%n是换行符 -->
|
||||
<property name="PATTERN_DEFAULT" value="%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} | %highlight(${LOG_LEVEL_PATTERN:-%5p} ${PID:- }) | %boldYellow(%thread [%tid]) %boldGreen(%-40.40logger{39}) | %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/>
|
||||
<property name="PATTERN_DEFAULT"
|
||||
value="%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} | %highlight(${LOG_LEVEL_PATTERN:-%5p} ${PID:- }) | %boldYellow(%thread [%tid]) %boldGreen(%-40.40logger{39}) | %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/>
|
||||
|
||||
<!-- 控制台 Appender -->
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
@ -17,7 +18,7 @@
|
||||
|
||||
<!-- 文件 Appender -->
|
||||
<!-- 参考 Spring Boot 的 file-appender.xml 编写 -->
|
||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||
<pattern>${PATTERN_DEFAULT}</pattern>
|
||||
@ -27,7 +28,8 @@
|
||||
<file>${LOG_FILE}</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!-- 滚动后的日志文件名 -->
|
||||
<fileNamePattern>${LOGBACK_ROLLINGPOLICY_FILE_NAME_PATTERN:-${LOG_FILE}.%d{yyyy-MM-dd}.%i.gz}</fileNamePattern>
|
||||
<fileNamePattern>${LOGBACK_ROLLINGPOLICY_FILE_NAME_PATTERN:-${LOG_FILE}.%d{yyyy-MM-dd}.%i.gz}
|
||||
</fileNamePattern>
|
||||
<!-- 启动服务时,是否清理历史日志,一般不建议清理 -->
|
||||
<cleanHistoryOnStart>${LOGBACK_ROLLINGPOLICY_CLEAN_HISTORY_ON_START:-false}</cleanHistoryOnStart>
|
||||
<!-- 日志文件,到达多少容量,进行滚动 -->
|
||||
|
@ -20,13 +20,13 @@
|
||||
let server = 'http://niubi.natapp1.cc';
|
||||
// TODO openid
|
||||
let openid = "ockUAwIZ-0OeMZl9ogcZ4ILrGba0";
|
||||
$(function() {
|
||||
$(function () {
|
||||
// 获得 JsapiTicket
|
||||
// 参考 https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html 文档
|
||||
$.ajax({
|
||||
url: server + "/app-api/wx/mp/create-jsapi-signature?url=" + document.location.href,
|
||||
method: 'POST',
|
||||
success: function( result ) {
|
||||
success: function (result) {
|
||||
if (result.code !== 0) {
|
||||
alert('获取 JsapiTicket 失败,原因:' + result.msg)
|
||||
return;
|
||||
@ -44,7 +44,7 @@
|
||||
$.ajax({
|
||||
url: server + "/app-api/shop/order/create",
|
||||
method: 'POST',
|
||||
success: function( result ) {
|
||||
success: function (result) {
|
||||
if (result.code !== 0) {
|
||||
alert('创建商城订单失败,原因:' + result.msg)
|
||||
return;
|
||||
@ -58,7 +58,7 @@
|
||||
})
|
||||
|
||||
// 微信公众号
|
||||
$( "#wx_pub").on( "click", function() {
|
||||
$("#wx_pub").on("click", function () {
|
||||
if (typeof WeixinJSBridge == "undefined") {
|
||||
// if (document.addEventListener) {
|
||||
// document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
|
||||
@ -89,7 +89,7 @@
|
||||
"openid": openid
|
||||
}
|
||||
}),
|
||||
success: function( result ) {
|
||||
success: function (result) {
|
||||
if (result.code !== 0) {
|
||||
alert('提交支付订单失败,原因:' + result.msg)
|
||||
return;
|
||||
@ -106,7 +106,7 @@
|
||||
success: function (res) {
|
||||
alert(JSON.stringify(res));
|
||||
},
|
||||
error: function(e) {
|
||||
error: function (e) {
|
||||
alert(JSON.stringify(e));
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user