diff --git a/.idea/encodings.xml b/.idea/encodings.xml index 5cb313d..fd2a54c 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -23,6 +23,7 @@ + diff --git a/common/common-util/src/main/java/com/atguigu/common/utils/JwtHelper.java b/common/common-util/src/main/java/com/atguigu/common/utils/JwtHelper.java new file mode 100644 index 0000000..aab1f90 --- /dev/null +++ b/common/common-util/src/main/java/com/atguigu/common/utils/JwtHelper.java @@ -0,0 +1,52 @@ +package com.atguigu.common.utils; + +import io.jsonwebtoken.*; +import org.springframework.util.StringUtils; + +import java.util.Date; + +public class JwtHelper { + + private static final long tokenExpiration = 365L * 24 * 60 * 60 * 1000; + private static final String tokenSignKey = "ssyx"; + + public static String createToken(Long userId, String userName) { + return Jwts.builder() + .setSubject("ssyx-USER") + .setExpiration(new Date(System.currentTimeMillis() + tokenExpiration)) + .claim("userId", userId) + .claim("userName", userName) + .signWith(SignatureAlgorithm.HS512, tokenSignKey) + .compressWith(CompressionCodecs.GZIP) + .compact(); + } + + public static Long getUserId(String token) { + if (StringUtils.isEmpty(token)) return null; + + Jws claimsJws = Jwts.parser().setSigningKey(tokenSignKey).parseClaimsJws(token); + Claims claims = claimsJws.getBody(); + Integer userId = (Integer) claims.get("userId"); + return userId.longValue(); + // return 1L; + } + + public static String getUserName(String token) { + if (StringUtils.isEmpty(token)) return ""; + + Jws claimsJws = Jwts.parser().setSigningKey(tokenSignKey).parseClaimsJws(token); + Claims claims = claimsJws.getBody(); + return (String) claims.get("userName"); + } + + public static void removeToken(String token) { + // jwttoken无需删除,客户端扔掉即可。 + } + + public static void main(String[] args) { + String token = JwtHelper.createToken(7L, "admin"); + System.out.println(token); + System.out.println(JwtHelper.getUserId(token)); + System.out.println(JwtHelper.getUserName(token)); + } +} \ No newline at end of file diff --git a/common/service-util/src/main/java/com/atguigu/ssyx/common/config/MQProducerAckConfig.java b/common/rabbit-util/src/main/java/com/atguigu/ssyx/mq/config/MQProducerAckConfig.java similarity index 98% rename from common/service-util/src/main/java/com/atguigu/ssyx/common/config/MQProducerAckConfig.java rename to common/rabbit-util/src/main/java/com/atguigu/ssyx/mq/config/MQProducerAckConfig.java index 710ed79..1d86243 100644 --- a/common/service-util/src/main/java/com/atguigu/ssyx/common/config/MQProducerAckConfig.java +++ b/common/rabbit-util/src/main/java/com/atguigu/ssyx/mq/config/MQProducerAckConfig.java @@ -1,4 +1,4 @@ -package com.atguigu.ssyx.common.config; +package com.atguigu.ssyx.mq.config; import org.springframework.amqp.core.Message; import org.springframework.amqp.rabbit.connection.CorrelationData; diff --git a/common/service-util/pom.xml b/common/service-util/pom.xml index 05dde03..8662030 100644 --- a/common/service-util/pom.xml +++ b/common/service-util/pom.xml @@ -23,11 +23,6 @@ common-util 1.0-SNAPSHOT - - com.atguigu - rabbit-util - 1.0-SNAPSHOT - com.atguigu model diff --git a/common/service-util/src/main/java/com/atguigu/ssyx/common/constant/RedisConst.java b/common/service-util/src/main/java/com/atguigu/ssyx/common/constant/RedisConst.java new file mode 100644 index 0000000..6b07341 --- /dev/null +++ b/common/service-util/src/main/java/com/atguigu/ssyx/common/constant/RedisConst.java @@ -0,0 +1,45 @@ +package com.atguigu.ssyx.common.constant; + +/** + * Redis常量配置类 + * set name admin + */ +public class RedisConst { + + public static final String SKUKEY_PREFIX = "sku:"; + public static final String SKUKEY_SUFFIX = ":info"; + // 单位:秒 + public static final long SKUKEY_TIMEOUT = 24 * 60 * 60; + // 定义变量,记录空对象的缓存过期时间 缓存穿透key的过期时间 + public static final long SKUKEY_TEMPORARY_TIMEOUT = 10 * 60; + + // 单位:秒 尝试获取锁的最大等待时间 + public static final long SKULOCK_EXPIRE_PX1 = 1; + // 单位:秒 锁的持有时间 + public static final long SKULOCK_EXPIRE_PX2 = 1; + public static final String SKULOCK_SUFFIX = ":lock"; + + public static final String USER_KEY_PREFIX = "user:"; + public static final String USER_CART_KEY_SUFFIX = ":cart"; + public static final long USER_CART_EXPIRE = 60 * 60 * 24 * 7; + public static final String SROCK_INFO = "stock:info:"; + public static final String ORDER_REPEAT = "order:repeat:"; + + // 用户登录 + public static final String USER_LOGIN_KEY_PREFIX = "user:login:"; + public static final String ADMIN_LOGIN_KEY_PREFIX = "admin:login:"; + // public static final String userinfoKey_suffix = ":info"; + public static final int USERKEY_TIMEOUT = 365; + public static final String ORDER_SKU_MAP = "order:sku:"; + + // 秒杀商品前缀 + public static final String SECKILL_TIME_MAP = "seckill:time:map"; + public static final String SECKILL_SKU_MAP = "seckill:sku:map"; + public static final String SECKILL_SKU_LIST = "seckill:sku:list:"; + public static final String SECKILL_USER_MAP = "seckill:user:map:"; + public static final String SECKILL_ORDERS_USERS = "seckill:orders:users"; + public static final String SECKILL_STOCK_PREFIX = "seckill:stock:"; + public static final String SECKILL_USER = "seckill:user:"; + // 用户锁定时间 单位:秒 + public static final int SECKILL__TIMEOUT = 60 * 60; +} \ No newline at end of file diff --git a/common/service-util/src/main/java/com/atguigu/ssyx/common/properties/WeChatProperties.java b/common/service-util/src/main/java/com/atguigu/ssyx/common/properties/WeChatProperties.java new file mode 100644 index 0000000..6a3376a --- /dev/null +++ b/common/service-util/src/main/java/com/atguigu/ssyx/common/properties/WeChatProperties.java @@ -0,0 +1,21 @@ +package com.atguigu.ssyx.common.properties; + +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +@ConditionalOnProperty(name = "wx.open.appId") +@ConfigurationProperties(prefix = "wx.open") +@Configuration +@Data +@Slf4j +public class WeChatProperties { + private String appId; + private String appSecret; + + WeChatProperties() { + log.info("注册微信配置信息..."); + } +} \ No newline at end of file diff --git a/service/pom.xml b/service/pom.xml index a87cbe4..cc44789 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -18,6 +18,7 @@ service-product service-search service-activity + service-user diff --git a/service/service-search/src/main/resources/application.yml b/service/service-search/src/main/resources/application.yml index ee3868e..d0c5f8d 100644 --- a/service/service-search/src/main/resources/application.yml +++ b/service/service-search/src/main/resources/application.yml @@ -72,7 +72,6 @@ feign: logging: level: - com.atguigu.ssyx.search.mapper: debug com.atguigu.ssyx.search.controller: info com.atguigu.ssyx.search.service: info pattern: diff --git a/service/service-user/Dockerfile b/service/service-user/Dockerfile new file mode 100644 index 0000000..ef109ac --- /dev/null +++ b/service/service-user/Dockerfile @@ -0,0 +1,21 @@ +FROM openjdk:17 +MAINTAINER bunny + +#系统编码 +ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 + +# 设置时区,构建镜像时执行的命令 +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo "Asia/Shanghai" > /etc/timezone + +# 设定工作目录 +WORKDIR /home/bunny + +# 复制jar包 +COPY target/*.jar /home/bunny/app.jar + +#启动容器时的进程 +ENTRYPOINT ["java","-jar","/home/bunny/app.jar"] + +#暴露 8080 端口 +EXPOSE 8080 \ No newline at end of file diff --git a/service/service-user/pom.xml b/service/service-user/pom.xml new file mode 100644 index 0000000..3af923f --- /dev/null +++ b/service/service-user/pom.xml @@ -0,0 +1,27 @@ + + 4.0.0 + + com.atguigu + service + 1.0-SNAPSHOT + + + service-user + jar + + service-user + https://maven.apache.org + + + UTF-8 + + + + + com.atguigu + service-product-client + 1.0-SNAPSHOT + + + diff --git a/service/service-user/src/main/java/com/atguigu/ssyx/user/ServiceUserApplication.java b/service/service-user/src/main/java/com/atguigu/ssyx/user/ServiceUserApplication.java new file mode 100644 index 0000000..47a6622 --- /dev/null +++ b/service/service-user/src/main/java/com/atguigu/ssyx/user/ServiceUserApplication.java @@ -0,0 +1,21 @@ +package com.atguigu.ssyx.user; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +@SpringBootApplication +@ComponentScan(basePackages = { + "com.atguigu.ssyx.common", + "com.atguigu.ssyx.user"}) +@EnableTransactionManagement +@EnableDiscoveryClient +@EnableFeignClients(basePackages = {"com.atguigu.ssyx.client"}) +public class ServiceUserApplication { + public static void main(String[] args) { + SpringApplication.run(ServiceUserApplication.class, args); + } +} \ No newline at end of file diff --git a/service/service-user/src/main/java/com/atguigu/ssyx/user/config/Knife4jConfig.java b/service/service-user/src/main/java/com/atguigu/ssyx/user/config/Knife4jConfig.java new file mode 100644 index 0000000..a4cd436 --- /dev/null +++ b/service/service-user/src/main/java/com/atguigu/ssyx/user/config/Knife4jConfig.java @@ -0,0 +1,56 @@ +package com.atguigu.ssyx.user.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.ParameterBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.schema.ModelRef; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.service.Parameter; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; + +import java.util.ArrayList; +import java.util.List; + +@Configuration +@EnableSwagger2WebMvc +public class Knife4jConfig { + @Bean + public Docket webApiConfig() { + List pars = new ArrayList<>(); + ParameterBuilder tokenPar = new ParameterBuilder(); + tokenPar.name("userId") + .description("用户token") + //.defaultValue(JwtHelper.createToken(1L, "admin")) + .defaultValue("1") + .modelRef(new ModelRef("string")) + .parameterType("header") + .required(false) + .build(); + pars.add(tokenPar.build()); + + return new Docket(DocumentationType.SWAGGER_2) + .groupName("微信用户端API") + .apiInfo(webApiInfo()) + .select() + // 只显示api路径下的页面 + .apis(RequestHandlerSelectors.basePackage("com.atguigu.ssyx.sys")) + .paths(PathSelectors.regex("/admin/.*")) + .build() + .globalOperationParameters(pars); + } + + private ApiInfo webApiInfo() { + return new ApiInfoBuilder() + .title("网站-API文档") + .description("本文档描述了尚上优选网站微服务接口定义") + .version("1.0") + .contact(new Contact("atguigu", "http://atguigu.com", "atguigu")) + .build(); + } +} \ No newline at end of file diff --git a/service/service-user/src/main/java/com/atguigu/ssyx/user/utils/HttpClientUtils.java b/service/service-user/src/main/java/com/atguigu/ssyx/user/utils/HttpClientUtils.java new file mode 100644 index 0000000..3d047ec --- /dev/null +++ b/service/service-user/src/main/java/com/atguigu/ssyx/user/utils/HttpClientUtils.java @@ -0,0 +1,306 @@ +package com.atguigu.ssyx.user.utils; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.http.Consts; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.NameValuePair; +import org.apache.http.client.HttpClient; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.config.RequestConfig.Builder; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.conn.ConnectTimeoutException; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.conn.ssl.SSLContextBuilder; +import org.apache.http.conn.ssl.TrustStrategy; +import org.apache.http.conn.ssl.X509HostnameVerifier; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.apache.http.message.BasicNameValuePair; + +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLSession; +import javax.net.ssl.SSLSocket; +import java.io.IOException; +import java.net.SocketTimeoutException; +import java.security.GeneralSecurityException; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +public class HttpClientUtils { + + public static final int connTimeout = 10000; + public static final int readTimeout = 10000; + public static final String charset = "UTF-8"; + private static HttpClient client = null; + + static { + PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager(); + cm.setMaxTotal(128); + cm.setDefaultMaxPerRoute(128); + client = HttpClients.custom().setConnectionManager(cm).build(); + } + + public static String postParameters(String url, String parameterStr) throws Exception { + return post(url, parameterStr, "application/x-www-form-urlencoded", charset, connTimeout, readTimeout); + } + + public static String postParameters(String url, String parameterStr, String charset, Integer connTimeout, Integer readTimeout) throws Exception { + return post(url, parameterStr, "application/x-www-form-urlencoded", charset, connTimeout, readTimeout); + } + + public static String postParameters(String url, Map params) throws + Exception { + return postForm(url, params, null, connTimeout, readTimeout); + } + + public static String postParameters(String url, Map params, Integer connTimeout, Integer readTimeout) throws + Exception { + return postForm(url, params, null, connTimeout, readTimeout); + } + + public static String get(String url) throws Exception { + return get(url, charset, null, null); + } + + public static String get(String url, String charset) throws Exception { + return get(url, charset, connTimeout, readTimeout); + } + + /** + * 发送一个 Post 请求, 使用指定的字符集编码. + * + * @param url + * @param body RequestBody + * @param mimeType 例如 application/xml "application/x-www-form-urlencoded" a=1&b=2&c=3 + * @param charset 编码 + * @param connTimeout 建立链接超时时间,毫秒. + * @param readTimeout 响应超时时间,毫秒. + * @return ResponseBody, 使用指定的字符集编码. + * @throws ConnectTimeoutException 建立链接超时异常 + * @throws SocketTimeoutException 响应超时 + * @throws Exception + */ + public static String post(String url, String body, String mimeType, String charset, Integer connTimeout, Integer readTimeout) + throws ConnectTimeoutException, SocketTimeoutException, Exception { + HttpClient client = null; + HttpPost post = new HttpPost(url); + String result = ""; + try { + if (StringUtils.isNotBlank(body)) { + HttpEntity entity = new StringEntity(body, ContentType.create(mimeType, charset)); + post.setEntity(entity); + } + // 设置参数 + Builder customReqConf = RequestConfig.custom(); + if (connTimeout != null) { + customReqConf.setConnectTimeout(connTimeout); + } + if (readTimeout != null) { + customReqConf.setSocketTimeout(readTimeout); + } + post.setConfig(customReqConf.build()); + + HttpResponse res; + if (url.startsWith("https")) { + // 执行 Https 请求. + client = createSSLInsecureClient(); + res = client.execute(post); + } else { + // 执行 Http 请求. + client = HttpClientUtils.client; + res = client.execute(post); + } + result = IOUtils.toString(res.getEntity().getContent(), charset); + } finally { + post.releaseConnection(); + if (url.startsWith("https") && client != null && client instanceof CloseableHttpClient) { + ((CloseableHttpClient) client).close(); + } + } + return result; + } + + /** + * 提交form表单 + * + * @param url + * @param params + * @param connTimeout + * @param readTimeout + * @return + * @throws ConnectTimeoutException + * @throws SocketTimeoutException + * @throws Exception + */ + public static String postForm(String url, Map params, Map headers, Integer connTimeout, Integer readTimeout) throws ConnectTimeoutException, + SocketTimeoutException, Exception { + + HttpClient client = null; + HttpPost post = new HttpPost(url); + try { + if (params != null && !params.isEmpty()) { + List formParams = new ArrayList(); + Set> entrySet = params.entrySet(); + for (Entry entry : entrySet) { + formParams.add(new BasicNameValuePair(entry.getKey(), entry.getValue())); + } + UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formParams, Consts.UTF_8); + post.setEntity(entity); + } + + if (headers != null && !headers.isEmpty()) { + for (Entry entry : headers.entrySet()) { + post.addHeader(entry.getKey(), entry.getValue()); + } + } + // 设置参数 + Builder customReqConf = RequestConfig.custom(); + if (connTimeout != null) { + customReqConf.setConnectTimeout(connTimeout); + } + if (readTimeout != null) { + customReqConf.setSocketTimeout(readTimeout); + } + post.setConfig(customReqConf.build()); + HttpResponse res = null; + if (url.startsWith("https")) { + // 执行 Https 请求. + client = createSSLInsecureClient(); + res = client.execute(post); + } else { + // 执行 Http 请求. + client = HttpClientUtils.client; + res = client.execute(post); + } + return IOUtils.toString(res.getEntity().getContent(), "UTF-8"); + } finally { + post.releaseConnection(); + if (url.startsWith("https") && client != null + && client instanceof CloseableHttpClient) { + ((CloseableHttpClient) client).close(); + } + } + } + + /** + * 发送一个 GET 请求 + * + * @param url + * @param charset + * @param connTimeout 建立链接超时时间,毫秒. + * @param readTimeout 响应超时时间,毫秒. + * @return + * @throws ConnectTimeoutException 建立链接超时 + * @throws SocketTimeoutException 响应超时 + * @throws Exception + */ + public static String get(String url, String charset, Integer connTimeout, Integer readTimeout) + throws ConnectTimeoutException, SocketTimeoutException, Exception { + + HttpClient client = null; + HttpGet get = new HttpGet(url); + String result = ""; + try { + // 设置参数 + Builder customReqConf = RequestConfig.custom(); + if (connTimeout != null) { + customReqConf.setConnectTimeout(connTimeout); + } + if (readTimeout != null) { + customReqConf.setSocketTimeout(readTimeout); + } + get.setConfig(customReqConf.build()); + + HttpResponse res = null; + + if (url.startsWith("https")) { + // 执行 Https 请求. + client = createSSLInsecureClient(); + res = client.execute(get); + } else { + // 执行 Http 请求. + client = HttpClientUtils.client; + res = client.execute(get); + } + result = IOUtils.toString(res.getEntity().getContent(), charset); + } finally { + get.releaseConnection(); + if (url.startsWith("https") && client != null && client instanceof CloseableHttpClient) { + ((CloseableHttpClient) client).close(); + } + } + return result; + } + + /** + * 从 response 里获取 charset + * + * @param ressponse + * @return + */ + @SuppressWarnings("unused") + private static String getCharsetFromResponse(HttpResponse ressponse) { + // Content-Type:text/html; charset=GBK + if (ressponse.getEntity() != null && ressponse.getEntity().getContentType() != null && ressponse.getEntity().getContentType().getValue() != null) { + String contentType = ressponse.getEntity().getContentType().getValue(); + if (contentType.contains("charset=")) { + return contentType.substring(contentType.indexOf("charset=") + 8); + } + } + return null; + } + + /** + * 创建 SSL连接 + * + * @return + * @throws GeneralSecurityException + */ + private static CloseableHttpClient createSSLInsecureClient() throws GeneralSecurityException { + try { + SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustStrategy() { + public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException { + return true; + } + }).build(); + SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext, new X509HostnameVerifier() { + + @Override + public boolean verify(String arg0, SSLSession arg1) { + return true; + } + + @Override + public void verify(String host, SSLSocket ssl) + throws IOException { + } + + @Override + public void verify(String host, X509Certificate cert) + throws SSLException { + } + + @Override + public void verify(String host, String[] cns, + String[] subjectAlts) throws SSLException { + } + }); + return HttpClients.custom().setSSLSocketFactory(sslsf).build(); + } catch (GeneralSecurityException e) { + throw e; + } + } +} \ No newline at end of file diff --git a/service/service-user/src/main/resources/application-dev.yml b/service/service-user/src/main/resources/application-dev.yml new file mode 100644 index 0000000..a07d8a8 --- /dev/null +++ b/service/service-user/src/main/resources/application-dev.yml @@ -0,0 +1,21 @@ +server: + port: 8206 + +bunny: + datasource: + host: 106.15.251.123 + port: 3305 + sqlData: shequ-user + username: root + password: "02120212" + + nacos: + server-addr: z-bunny.cn:8848 + discovery: + namespace: ssyx + + redis: + host: 47.120.65.66 + port: 6379 + database: 3 + password: "02120212" \ No newline at end of file diff --git a/service/service-user/src/main/resources/application.yml b/service/service-user/src/main/resources/application.yml new file mode 100644 index 0000000..49607dc --- /dev/null +++ b/service/service-user/src/main/resources/application.yml @@ -0,0 +1,67 @@ +server: + port: 8206 + +spring: + application: + name: service-user + profiles: + active: dev + + datasource: + type: com.zaxxer.hikari.HikariDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://${bunny.datasource.host}:${bunny.datasource.port}/${bunny.datasource.sqlData}?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true + username: ${bunny.datasource.username} + password: ${bunny.datasource.password} + + redis: + host: ${bunny.redis.host} + port: ${bunny.redis.port} + database: ${bunny.redis.database} + password: ${bunny.redis.password} + lettuce: + pool: + max-active: 20 #最大连接数 + max-wait: -1 #最大阻塞等待时间(负数表示没限制) + max-idle: 5 #最大空闲 + min-idle: 0 #最小空闲 + + cloud: + sentinel: + log: + dir: logs/${spring.application.name}/sentinel + nacos: + discovery: + namespace: ${bunny.nacos.discovery.namespace} + server-addr: ${bunny.nacos.server-addr} + + jackson: + date-format: yyyy-MM-dd HH:mm:ss + time-zone: GMT+8 + + +mybatis-plus: + type-enums-package: com.atguigu.ssyx.enums # 加上枚举类型 + type-aliases-package: com.atguigu.ssyx # 配置每个包前缀 + mapper-locations: classpath:mapper/*.xml + configuration: + map-underscore-to-camel-case: true + auto-mapping-behavior: full + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 查看日志 + +logging: + level: + com.atguigu.ssyx.user.mapper: debug + com.atguigu.ssyx.user.controller: info + com.atguigu.ssyx.user.service: info + pattern: + dateformat: HH:mm:ss:SSS + file: + path: "logs/${spring.application.name}" + +wx: + open: + # 小程序微信公众平台appId + appId: wx18e5556d7539757b + # 小程序微信公众平台api秘钥 + appSecret: ac06f1c49f90a2ed69f1a946d4981833 \ No newline at end of file diff --git a/service/service-user/src/main/resources/banner.txt b/service/service-user/src/main/resources/banner.txt new file mode 100644 index 0000000..cc77fc2 --- /dev/null +++ b/service/service-user/src/main/resources/banner.txt @@ -0,0 +1,16 @@ +-----------------▄██-█▄--------- +-----------------███▄██▄-------- +-----------------███████-------- +-----------------▀███████------- +-------------------██████▄▄----- +-------------------█████████▄--- +-------------------██████▄████-- +-------▄███████████████████████- +-----▄███████████████████████▀-- +---▄██████████████████████------ +---███████████████████████------ +---███████████████████████------ +-▄▄██████████████████████▀------ +-█████████████████▀█████-------- +-▀██████████████▀▀-▀█████▄------ +-------▀▀▀▀▀▀▀▀▀------▀▀▀▀------ \ No newline at end of file diff --git a/service/service-user/src/main/resources/favicon.ico b/service/service-user/src/main/resources/favicon.ico new file mode 100644 index 0000000..1ba397c Binary files /dev/null and b/service/service-user/src/main/resources/favicon.ico differ