This commit is contained in:
wenyongda 2025-03-19 21:19:20 +08:00
parent 2438f9714c
commit c8f0706eeb
11 changed files with 54 additions and 158 deletions

View File

@ -1,5 +1,8 @@
---
title: CSS
date: 2024-03-23 10:30:31
author: 文永达
top_img: https://gcore.jsdelivr.net/gh/volantis-x/cdn-wallpaper/abstract/67239FBB-E15D-4F4F-8EE8-0F1C9F3C4E7C.jpeg
---
## CSS Text(文本)

View File

@ -1,3 +1,8 @@
---
title: Intellij Platform
date: 2023-11-18 10:30:31
author: 文永达
---
# Intellij IDEA
## Spring Boot DevTools热重载

View File

@ -1,3 +1,8 @@
---
title: JavaScript
date: 2023-11-18 10:30:31
author: 文永达
---
# 异步编程
## await
@ -247,7 +252,7 @@ var arrowFunc = (arg1, arg2) => {
<body>
<input type="text" id="inp">
<script>
// 1.封装防抖函数
function debounce(fn, time) {
// 4.创建一个标记用来存放定时器的返回值
@ -269,8 +274,8 @@ var arrowFunc = (arg1, arg2) => {
function sayHi() {
console.log('防抖成功');
}
// 3.给inp绑定input事件 调用封装的防抖函数 传入要执行的内容与间隔事件
inp.addEventListener('input', debounce(sayHi, 5000));
// 3.给inp绑定input事件 调用封装的防抖函数 传入要执行的内容与间隔事件
inp.addEventListener('input', debounce(sayHi, 5000));
</script>
</body>
@ -319,7 +324,7 @@ search搜索时用户在不断输入值时用防抖来节约请求资源
// 打印当前 document 的宽高
console.log(e.target.innerWidth, e.target.innerHeight);
}
// 2.绑定事件,绑定时就调用节流函数
// 2.绑定事件,绑定时就调用节流函数
// 敲黑板!!! 这里是重点 绑定是就要调用一下封装的节流函数 触发事件是触发封装函数内部的函数
window.addEventListener('resize', throttle(sayHi, 2000));
</script>

View File

@ -1,3 +1,8 @@
---
title: Maven与Gradle
date: 2023-11-18 10:30:31
author: 文永达
---
# Maven
## Maven to Gradle

View File

@ -1,3 +1,9 @@
---
title: Mybatis基本介绍
date: 2022-11-18 10:30:31
author: 文永达
---
# Mybatis
---
@ -54,7 +60,7 @@
<!-- 注册接口 -->
<!--<mapper class="com.wyd.dao.UserMapper2"></mapper>-->
</mappers>
</configuration>
```
## Springboot中 *application.yml*
@ -82,7 +88,7 @@ import com.wyd.mybatis20210702.entity.User;
public interface UserMapper {
User selectUserById(Integer id);
int insertUser(User user);
int updateUser(User user);
@ -107,7 +113,7 @@ public interface UserMapper {
<select id="selectUserById" resultType="user">
SELECT id,username,PASSWORD,birthday FROM USER
</select>
<insert id="insertUser" parameterType="com.crx.entity.User">
insert into user (username,password) values (#{username},#{password})
</insert>
@ -171,7 +177,7 @@ if(username != null && !"".equals(username.trim())){
---
resultType 就是 返回的数据类型有点儿Java方法中的return 不过这是返回的类型而不是变量名
resultType 就是 返回的数据类型有点儿Java方法中的return 不过这是返回的类型而不是变量名
parameterType 就是参数类型,实体类要写包名类名

View File

View File

@ -1,5 +1,5 @@
---
title: tags
title: Visual Studio
date: 2018-09-30 18:23:38
type: "tags"
layout: "tags"

View File

View File

@ -1,3 +1,8 @@
---
title: Vue3
date: 2023-11-18 10:30:31
author: 文永达
---
# 响应式
在Vue 3中响应式是通过`reactive`函数和`ref`函数实现的。`reactive`函数用于创建一个响应式对象,而`ref`函数用于创建一个包装对象,将基本类型的值转换为响应式对象。
@ -454,7 +459,7 @@ export function useFetchSelect(props: FetchSelectProps) {
}, 3000);
});
}
// 将之前用的 options,loading和调用接口的逻辑都抽离到hook中
const selectBind = useFetchSelect({
apiFun: getRemoteData,

View File

@ -247,7 +247,7 @@ namespace XiaodaERP.Services
private readonly SqlServerDbContext _sqlServerDbContext;
private readonly TokenHelper _tokenHelper;
public AccountService(OracleDbContext oracleDbContext, SqlServerDbContext sqlServerDbContext, TokenHelper tokenHelper)
{
{
_oracleDbContext = oracleDbContext;
_sqlServerDbContext = sqlServerDbContext;
_tokenHelper = tokenHelper;
@ -325,7 +325,7 @@ namespace XiaodaERP.Services
{
res = _sqlServerDbContext.Users.Include(user => user.Role).ToList();
}
List<ViewUser> viewUsers = new();
var config = new MapperConfiguration(cfg => cfg.CreateMap<User, ViewUser>()
.ForMember(dest => dest.username, opt => opt.MapFrom(src => src.UserName))
@ -352,11 +352,11 @@ namespace XiaodaERP.Services
.BeforeMap((src, des) => des.CreateUserId = _tokenHelper.GetToken<ViewUser>(TokenHelper.Token).UserId)
.BeforeMap((src, des) => des.CreateUserName = _tokenHelper.GetToken<ViewUser>(TokenHelper.Token).username));
var mapper = config.CreateMapper();
if (res == null)
if (res == null)
{
_sqlServerDbContext.Users.Add(
mapper.Map<User>(viewUser)
);
);
}
else
{
@ -370,21 +370,21 @@ namespace XiaodaERP.Services
return _sqlServerDbContext.SaveChanges() > 0;
}
/// <summary>
/// MD5 加密字符串
/// </summary>
/// <param name="rawPass">源字符串</param>
/// <returns>加密后字符串</returns>
/// <summary>
/// MD5 加密字符串
/// </summary>
/// <param name="rawPass">源字符串</param>
/// <returns>加密后字符串</returns>
public string Md5Encoding(string rawPass)
{
// 创建MD5类的默认实例MD5CryptoServiceProvider
// 创建MD5类的默认实例MD5CryptoServiceProvider
var md5 = MD5.Create();
var bs = Encoding.UTF8.GetBytes(rawPass);
var hs = md5.ComputeHash(bs);
var sb = new StringBuilder();
foreach (var b in hs)
{
// 以十六进制格式格式化
// 以十六进制格式格式化
sb.Append(b.ToString("x2"));
}
return sb.ToString();
@ -507,8 +507,8 @@ namespace XiaodaERP.Services
mapper.Map<ViewUser>(user)
);
}
return new PageResult<ViewUser>
{
return new PageResult<ViewUser>
{
Items = viewUsers,
Total = count
};
@ -569,7 +569,7 @@ namespace XiaodaERP.Controllers
{
return ResultUtil.ok(_accountService.GetAllAccounts(deptId, userName, realName));
}
}
[Authorize]

View File

@ -1,133 +0,0 @@
# Furion
## 脚手架
Furion+SqlSugar WebAPI
![image-20230328091559534](https://markdownhexo.oss-cn-hangzhou.aliyuncs.com/img/image-20230328091559534.png)
从.NET5到.NET8都可以选择
![image-20230328091506895](https://markdownhexo.oss-cn-hangzhou.aliyuncs.com/img/image-20230328091506895.png)
## 项目结构
![image-20230328101328375](https://markdownhexo.oss-cn-hangzhou.aliyuncs.com/img/image-20230328101328375.png)
## 引用
Core -> Application -> Web.Core -> Web.Entry
↓ -> System -> Web.Core -> Web.Entry
依赖在Core中安装
## 依赖安装
![image-20230403130044894](https://markdownhexo.oss-cn-hangzhou.aliyuncs.com/img/image-20230403130044894.png)
# Blog.Core
## 项目结构
### 后端
![image-20230329124950571](https://markdownhexo.oss-cn-hangzhou.aliyuncs.com/img/image-20230329124950571.png)
### 前端
![image-20230403155403966](https://markdownhexo.oss-cn-hangzhou.aliyuncs.com/img/image-20230403155403966.png)
## 引用
Model -> Common -> IServices -> Services -> Entensions -> Api
-> Tasks
## 依赖安装
![image-20230403125509263](https://markdownhexo.oss-cn-hangzhou.aliyuncs.com/img/image-20230403125509263.png)
`AutoMapper` -> **Model**
`AutoMapper.Extensions.Microsoft.DependencyInjection` -> **Model**
`log4net` -> **Common**
`Autofac.Extras.DynamicProxy` -> **Extensions**
`Autofac.Extensions.DependencyInjection` -> **Extensions**
`Newtonsoft.Json` -> **Extensions**
`Quartz` -> **Tasks**
`SqlSugarCore` -> **Model**
`StackExchange.Redis` -> **Common**
`FluentValidation.AspNetCore` -> **Api**
`FluentValidation.DependencyInjectionExtensions` -> **Api**
# ZRAdmin.NET
## 项目结构
### 后端
![image-20230403130320936](https://markdownhexo.oss-cn-hangzhou.aliyuncs.com/img/image-20230403130320936.png)
### 前端
![image-20230403155626904](https://markdownhexo.oss-cn-hangzhou.aliyuncs.com/img/image-20230403155626904.png)
[ZRAdmin.NET在线文档 (izhaorui.cn)](http://www.izhaorui.cn/doc/)
## 引用
common -> Tasks ->
Model -> Repository -> Service -> WebApi
Infrastructure ->
项目结构比较像Java的若依框架
## 依赖安装
![image-20230403132814465](https://markdownhexo.oss-cn-hangzhou.aliyuncs.com/img/image-20230403132814465.png)
# 优缺点对比
| | Furion | Blog.Core | ZRAdmin.NET |
| ------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| 项目结构 | 跟MVC三层架构还是有不少差别可能有DDD的思想在里面只是业务层做了系统和应用层区分和B端的ERP有很大差别 | 比较符合MVC三层架构但是其中的时间总线和路由是项目用不上的如果做拆分会有依赖引用问题 | 比较像Java的若依框架经典三层架构只是Infrastructure 其实可以合并到Common中 |
| 依赖安装 | Furion集成不少依赖虽然开发方便但由于都是集成的后续有升级难度定时任务是框架重写了一套没有用到Quartz.Net | 集成的都是常用的,但是也集成了不少微服务开发和分布式总线上才用到的,会显得比较臃肿 | 集成的有常用的有较新的比如NLogMapster但实际看来是比Log4Net和AutoMapper性能要强Autofac没有集成使用ASP.Net自带的封装注解Redis客户端工具类使用的是CSRedisCore没有用StackExchange.Redis但是据说存在不定时连接超时的问题还有就是没有IdentityServer 4的集成 |
| 文档 | 全 | 较全,但文档日期停留在 2021-08-21 | 全比较像Java的若依框架文档 |
| 近期维护更新 | 常有最近的是2小时前但是仔细看提交记录其实更新主要还是在文档上 | 有最近的是20小时前着重于日志多租户方面的更新 | 有最近的是15天前目前项目总体进入维护状态大的改动没有比较稳定只有针对ISSUE的提交 |
| 其他 | 脚手架方便搭建但是Furion更像是一个工具包集合而不是框架没有Admin等功能所以这部分还需要自己去完成因为这只是个架子 | 有博客端也有Admin端但是仍是使用的Vue2技术栈较久今年年末就会停止维护API没有进行分层都写在一个JS中后期不好维护层叠样式表使用CSS相比较SCSS语法上较为麻烦 | 有Vue2也有Vue3版的管理端可以着重于应用业务上的开发唯一的是前端使用了JavaScript开发如果是TypeScript会更好前端风格跟Java的若依框架前端基本一致功能也是。后端Redis没有默认开启需要手动集成作者很贴心的留了注解ORM用了sqlsugar用了多租户但是配置是在代码中其实自己给移到配置文件里是最好的 |
| 推荐指数 | 3 | 4 | 5 |
# 后端开发环境
`Visual Studio 2022`
**dotnet-sdk-7.0.202-win-x64.exe** [下载 .NET 7.0 SDK (v7.0.202) - Windows x64 Installer (microsoft.com)](https://dotnet.microsoft.com/zh-cn/download/dotnet/thank-you/sdk-7.0.202-windows-x64-installer)
# 前端开发环境
`Visual Studio Code`
安装扩展
`Volar` `i18n Ally`
**node-v16.20.1-x64.msi** [Index of /download/release/v16.20.0/ (nodejs.org)](https://nodejs.org/download/release/v16.20.0/)
https://nodejs.org/download/release/v16.20.0/node-v16.20.0-x64.msi