发现最近学习效率不高,决定从今天开始写日记,提前为以后防止以后老年痴呆做准备
原有一个MhtEnglish英语学习小程序项目,但是过了一段时间之后觉得代码写的实在是臭,又不规范,所以推翻重来,这次在原有项目的基础上加上一个后台管理系统,为以后业务拓展做准备,原有小程序暂时没有对他进行改动的打算(懒得写前端)
githubgithub仓库
idea连接github
参考链接
同时从idea推送上去的时候会产生一点小问题:
-
第一个问题
git遇到fatal: unable to access ‘https://github.com/xxx/xxx/’:OpenSSL SSL_read: Connection was aborted, errno 10053的问题
原因
Git默认限制推送的大小,运行命令更改限制大小即可
解决方法git config --global http.postBuffer 524288000
参考链接
https://blog.csdn.net/ZJ_____W/article/details/114778696 -
因为github 现在的默认分支是main,去设置里修改默认分支为master(具体百度)
-
我习惯创建仓库的时候勾选readme.md 这时候如果直接push会出错
解决办法:
git checkout master #切换到要提交代码的分支 git pull origin master --allow-unrelated-histories #加上后面这个选项允许不相关历史提交 git push origin master #提交到远程分支后端架构 编写application.yml
#多环境配置
spring:
profiles:
active: dev
###编写application-dev.yml
#开发环境
server:
port: 8080
spring:
application:
name: SpringbootTestApplication
datasource:
url: jdbc:mysql://localhost:3306/mht?useUnicode=true&characterEncoding=utf8&useSSL=false
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
#druid 模块配置(copy别人的)
druid:
#2.连接池配置
#初始化连接池的连接数量 大小,最小,最大
initial-size: 5
min-idle: 5
max-active: 20
#配置获取连接等待超时的时间
max-wait: 60000
#配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
time-between-eviction-runs-millis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
min-evictable-idle-time-millis: 30000
validation-query: SELECt 1 FROM DUAL
test-while-idle: true
test-on-borrow: true
test-on-return: false
# 是否缓存preparedStatement,也就是PSCache 官方建议MySQL下建议关闭 个人建议如果想用SQL防火墙 建议打开
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
filter:
stat:
merge-sql: true
slow-sql-millis: 5000
#3.基础监控配置
web-stat-filter:
enabled: true
url-pattern: *.xml
type-aliases-package: com.lee.mht.*.entity
# configuration:
# map-underscore-to-camel-case: true
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #用于控制台打印sql语句
引入依赖
druid 监控页面com.alibaba druid-spring-boot-starter1.1.10 org.springframework spring-aspects
http:localhost:8080/druid/index.html
账号密码在yml配置中
引入mybatis依赖
直接搜索,过程略
mybatis:
mapper-locations: classpath:/mapper
@Service
public class AdminUserServiceImpl implements AdminUserService {
@Autowired(required = false)
private AdminUserDao adminUserDao;
@Override
public Boolean login(@Param("username") String username,@Param("password") String password) {
return adminUserDao.login(username,password);
}
}
AdminUser.mapper
SELECT count(*) FROM admin_user WHERe username = #{username} and password = #{password}
测试接口:
ps:数据库里的密码目前暂定是加密的,但是还没想好具体的加密方法,所以就直接整了个md5,先凑活这用
apex真坐牢,勾巴前端真烦



