Skip to content

Commit f67884e

Browse files
committed
Merge branch 'master' of https://github.com/liaozb/APIJSON.NET
# Conflicts: # APIJSON.NET/APIJSONCommon/ApiJson.Common.csproj 0.0.7 修复not in的缺陷,增加~ 不等于的支持
2 parents dab0e09 + 6e4712b commit f67884e

File tree

5 files changed

+75
-20
lines changed

5 files changed

+75
-20
lines changed

APIJSON.NET/APIJSON.NET/APIJSON.NET.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<ItemGroup>
2222
<PackageReference Include="AspectCore.Extensions.Reflection" Version="1.2.0" />
23-
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.0" />
23+
<PackageReference Include="Microsoft.AspNetCore.App" />
2424
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.2.0" />
2525
<PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.2.0" />
2626
<PackageReference Include="Microsoft.AspNetCore.Rewrite" Version="2.2.0" />

APIJSON.NET/APIJSONCommon/ApiJson.Common.csproj

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
5-
<Version>0.0.6</Version>
6-
<Description>0.0.6 增加ToSql接口,处理sql注入的情况
5+
<Version>0.0.7</Version>
6+
<Description>0.0.7 修复not in的缺陷,增加~ 不等于的支持
7+
0.0.6 增加ToSql接口,处理sql注入的情况
78
通用查询组件</Description>
89
<PackageId>ApiJson.Common.Core</PackageId>
910
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>

APIJSON.NET/APIJSONCommon/Properties/AssemblyInfo.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

54
// 有关程序集的一般信息由以下

APIJSON.NET/APIJSONCommon/SelectTable.cs

+13-4
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ private string ToSql(string subtable, int page, int count, int query, string jso
7575
values.Remove("page");
7676
values.Remove("count");
7777
subtable = _tableMapper.GetTableName(subtable);
78-
var tb = sugarQueryable(subtable, "*", values,null);
79-
var xx= tb.Skip((page - 1) * count).Take(10).ToSql();
78+
var tb = sugarQueryable(subtable, "*", values, null);
79+
var xx = tb.Skip((page - 1) * count).Take(10).ToSql();
8080
return xx.Key;
8181
}
8282
/// <summary>
@@ -249,7 +249,7 @@ public string ToSql(JObject queryObj)
249249

250250
if (key.EndsWith("[]"))
251251
{
252-
return ToSql(item);
252+
return ToSql(item);
253253
}
254254
}
255255
return string.Empty;
@@ -509,6 +509,10 @@ private ISugarQueryable<ExpandoObject> sugarQueryable(string subtable, string se
509509
conModels.Add(new ConditionalModel() { FieldName = vakey.TrimEnd('@'), ConditionalType = ConditionalType.Equal, FieldValue = value });
510510

511511
}
512+
else if (vakey.EndsWith("~"))//不等于
513+
{
514+
conModels.Add(new ConditionalModel() { FieldName = vakey.TrimEnd('~'), ConditionalType = ConditionalType.NoEqual, FieldValue = fieldValue });
515+
}
512516
else if (IsCol(subtable, vakey)) //其他where条件
513517
{
514518
conModels.Add(new ConditionalModel() { FieldName = vakey, ConditionalType = ConditionalType.Equal, FieldValue = fieldValue });
@@ -695,7 +699,12 @@ private void ConditionQuery(string subtable, List<IConditionalModel> conModels,
695699
inValues.Add(cm.ToString());
696700
}
697701

698-
conModels.Add(new ConditionalModel() { FieldName = field, ConditionalType = field.EndsWith("!") ? ConditionalType.NotIn : ConditionalType.In, FieldValue = string.Join(",", inValues) });
702+
conModels.Add(new ConditionalModel()
703+
{
704+
FieldName = field.TrimEnd("!".ToCharArray()),
705+
ConditionalType = field.EndsWith("!") ? ConditionalType.NotIn : ConditionalType.In,
706+
FieldValue = string.Join(",", inValues)
707+
});
699708

700709
}
701710
else

README.md

+57-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# APIJSON.NET
22
这是 APIJSON 的 C# .NET CORE 版后端实现。
33

4+
45
<h1 align="center" style="text-align:center;">
56
APIJSON
67
</h1>
@@ -14,11 +15,12 @@
1415
<a href="https://github.com/TommyLemon/APIJSON/tree/master/MySQL"><img src="https://img.shields.io/badge/TiDB-2.1%2B-brightgreen.svg?style=flat"></a>
1516
</p>
1617
<p align="center" >
17-
<a href="https://github.com/liaozb/APIJSON.NET"><img src="https://img.shields.io/badge/CSharp-2.1%2B-brightgreen.svg?style=flat"></a>
18+
 <a href="https://github.com/liaozb/APIJSON.NET"><img src="https://img.shields.io/badge/CSharp-2.1%2B-brightgreen.svg?style=flat"></a>
1819
<a href="https://github.com/TommyLemon/APIJSON/tree/master/APIJSON-Java-Server"><img src="https://img.shields.io/badge/Java-1.7%2B-brightgreen.svg?style=flat"></a>
19-
<a href="https://github.com/zhangchunlin/uliweb-apijson"><img src="https://img.shields.io/badge/Python-3%2B-brightgreen.svg?style=flat"></a>
2020
 <a href="https://github.com/qq547057827/apijson-php"><img src="https://img.shields.io/badge/PHP-7.0%2B-brightgreen.svg?style=flat"></a>
2121
 <a href="https://github.com/TEsTsLA/apijson"><img src="https://img.shields.io/badge/Node.js-ES6%2B-brightgreen.svg?style=flat"></a>
22+
<a href="https://github.com/crazytaxi824/APIJSON"><img src="https://img.shields.io/badge/Go-1.12.4%2B-brightgreen.svg?style=flat"></a>
23+
<a href="https://github.com/zhangchunlin/uliweb-apijson"><img src="https://img.shields.io/badge/Python-3%2B-brightgreen.svg?style=flat"></a>
2224
</p>
2325
<p align="center" >
2426
<a href="https://github.com/TommyLemon/APIJSON/tree/master/APIJSON-Android"><img src="https://img.shields.io/badge/Android-4.0%2B-brightgreen.svg?style=flat"></a>
@@ -29,7 +31,7 @@
2931
<a href="https://github.com/TommyLemon/APIJSON/blob/master/Document-English.md">English</a>
3032
 <a href="https://github.com/TommyLemon/APIJSON/blob/master/Document.md">通用文档</a>
3133
<a href="http://i.youku.com/apijson">视频教程</a>
32-
<a href="http://apijson.org">在线工具</a>
34+
<a href="http://apijson.org/auto">在线工具</a>
3335
</p>
3436

3537
<p align="center" >
@@ -39,7 +41,7 @@
3941
---
4042

4143

42-
APIJSON是一种为API而生的JSON网络传输协议。<br />
44+
APIJSON是一种专为API而生的 JSON网络传输协议 以及 基于这套协议实现的ORM库。<br />
4345
为 简单的增删改查、复杂的查询、简单的事务操作 提供了完全自动化的API。<br />
4446
能大幅降低开发和沟通成本,简化开发流程,缩短开发周期。<br />
4547
适合中小型前后端分离的项目,尤其是互联网创业项目和企业自用项目。<br />
@@ -57,10 +59,10 @@ APIJSON是一种为API而生的JSON网络传输协议。<br />
5759

5860
#### 在线解析
5961
* 自动生成接口文档,清晰可读永远最新
60-
* 自动生成请求代码,支持Android和iOS
61-
* 自动生成JavaBean文件,一键下载
62+
* 自动校验与格式化,支持高亮和收展
63+
* 自动生成各种语言代码,一键下载
6264
* 自动管理与测试接口用例,一键共享
63-
* 自动校验与格式化JSON,支持高亮和收展
65+
* 自动给请求JSON加注释,一键切换
6466

6567
#### 对于前端
6668
* 不用再向后端催接口、求文档
@@ -108,7 +110,7 @@ APIJSON是一种为API而生的JSON网络传输协议。<br />
108110
<br />
109111

110112
### 为什么要用APIJSON?
111-
[前后端10大痛点解析](https://github.com/TommyLemon/APIJSON/wiki)
113+
[前后端 关于接口的 沟通、文档、联调 等 10 大痛点解析](https://github.com/TommyLemon/APIJSON/wiki)
112114

113115
### 快速上手
114116
https://github.com/liaozb/APIJSON.NET/tree/master/APIJSON.NET
@@ -121,6 +123,22 @@ https://github.com/liaozb/APIJSON.NET/tree/master/APIJSON.NET
121123
测试及自动生成代码工具<br />
122124
[APIJSONTest.apk](http://files.cnblogs.com/files/tommylemon/APIJSONTest.apk)
123125

126+
### 使用登记
127+
<div style="float:left">
128+
<a href="http://www.transsion.com"><img src="http://www.transsion.com/static/images/logo.jpg" height="90"></a>
129+
<a href="http://shebaochina.com"><img src="http://shebaochina.com/static/cn/img/index/logo.png" height="90"></a>
130+
<a href="http://www.xmfish.com"><img src="http://www.xmfish.com/images/chanel/www/f_logo.gif" height="90"></a>
131+
<a href="http://www.xxwolo.com"><img src="http://img.qichacha.com/Product/a917fcca-fbb1-44a2-a079-56985ebf8f9c.jpg" height="90"></a>
132+
<a href="http://www.8soo.com"><img src="http://ww1.sinaimg.cn/large/756dd729gw1f9n5ckuq6vj208902it8v.jpg" height="90"></a>
133+
<a href="http://juting.vip"><img src="http://i.juting.vip/wp-file/2018/12/logo1-1.png" height="90"></a>
134+
<a href="http://www.aipaipai-inc.com"><img src="http://www.aipaipai-inc.com/uploadfile/upload/2019042913403029.png" height="90"></a>
135+
<a href="http://www.hec-bang.com"><img src="http://www.hec-bang.com/assets/images/logo-200x50.png" height="90"></a>
136+
<a href="https://www.shulian8.com"><img src="https://bookstore-prod.oss-cn-hangzhou.aliyuncs.com/%E5%90%8E%E5%8F%B0%E9%A1%B5%E9%9D%A2_03.png" height="90"></a>
137+
</div>
138+
<br />
139+
140+
[您在使用APIJSON吗?](https://github.com/TommyLemon/APIJSON/issues/73)
141+
124142

125143
### 技术交流
126144
如果有什么问题或建议可以 [提ISSUE](https://github.com/liaozb/APIJSON.NET/issues)[加群](https://github.com/TommyLemon/APIJSON#%E6%8A%80%E6%9C%AF%E4%BA%A4%E6%B5%81),交流技术,分享经验。<br >
@@ -129,12 +147,15 @@ https://github.com/liaozb/APIJSON.NET/tree/master/APIJSON.NET
129147
### 贡献者们
130148
<div style="float:left">
131149
<a href="https://github.com/liaozb"><img src="https://avatars3.githubusercontent.com/u/12622501?s=400&v=4" height="90" width="90" ></a>
150+
<a href="https://github.com/liaozb/APIJSON.NET/pull/13"><img src="https://avatars0.githubusercontent.com/u/16282949?s=400&v=4" height="90" width="90" ></a>
132151
<a href="https://github.com/liaozb/APIJSON.NET/pull/8"><img src="https://avatars0.githubusercontent.com/u/16437853?s=460&v=4" height="90" width="90" ></a>
133152
<a href="https://github.com/liaozb/APIJSON.NET/pull/9"><img src="https://avatars1.githubusercontent.com/u/5738175?s=400&u=5b2f372f0c03fae8f249d2d754e38971c2e17b92&v=4" height="90" width="90" ></a>
153+
<a href="https://github.com/liaozb/APIJSON.NET/pull/3"><img src="https://avatars2.githubusercontent.com/u/13326497?s=400&v=4" height="90" width="90" ></a>
134154
</div>
135155
<br />
136156
感谢大家的贡献。
137157

158+
138159
### 相关推荐
139160
[APIJSON, 让接口和文档见鬼去吧!](https://my.oschina.net/tommylemon/blog/805459)
140161

@@ -146,16 +167,40 @@ https://github.com/liaozb/APIJSON.NET/tree/master/APIJSON.NET
146167

147168
[3步创建APIJSON后端新表及配置](https://my.oschina.net/tommylemon/blog/889074)
148169

170+
[APIJSON 自动化接口和文档的快速开发神器 (一)](https://blog.csdn.net/qq_41829492/article/details/88670940)
171+
172+
### 生态项目
173+
[APIAuto](https://github.com/TommyLemon/APIAuto) 自动化接口管理工具,自动生成文档与注释、自动生成代码、自动化回归测试、自动静态检查等
174+
175+
[apijson-doc](https://github.com/vincentCheng/apijson-doc) APIJSON 官方文档,提供排版清晰、搜索方便的文档内容展示,包括设计规范、图文教程等
149176

150-
### 其它项目
151-
[APIJSON](https://github.com/TommyLemon/APIJSON) 码云最有价值项目:后端接口和文档自动化,前端(客户端) 定制返回JSON的数据和结构
177+
[apijson.org](https://github.com/APIJSON/apijson.org) APIJSON 官方网站,提供 APIJSON 的 功能简介、登记用户、作者与贡献者、相关链接 等
152178

153-
[APIJSONAuto](https://github.com/TommyLemon/APIJSONAuto) 自动化接口管理工具,自动生成文档与注释、自动生成代码、自动化回归测试、自动静态检查等
179+
[APIJSON](https://github.com/APIJSON/APIJSON) Java 版 APIJSON ,支持 MySQL, PostgreSQL, Oracle, TiDB
180+
181+
[apijson-php](https://github.com/qq547057827/apijson-php) PHP 版 APIJSON,基于 ThinkPHP,支持 MySQL, PostgreSQL, MS SQL Server, Oracle 等
182+
183+
[apijson](https://github.com/TEsTsLA/apijson) Node.ts 版 APIJSON,支持 MySQL, PostgreSQL, MS SQL Server, Oracle, SQLite, MariaDB, WebSQL
184+
185+
[uliweb-apijson](https://github.com/zhangchunlin/uliweb-apijson) Python 版 APIJSON,支持 MySQL, PostgreSQL, MS SQL Server, Oracle, SQLite 等
186+
187+
[APIJSON](https://github.com/crazytaxi824/APIJSON) Go 版 APIJSON,功能开发中...
188+
189+
[APIJSONKOTLIN](https://github.com/luckyxiaomo/APIJSONKOTLIN) Kotlin 版 APIJSON,基础框架搭建中...
190+
191+
[APIJSONParser](https://github.com/Zerounary/APIJSONParser) 第三方 APIJSON 解析器,将 JSON 动态解析成 SQL
192+
193+
[ApiJsonByJFinal](https://gitee.com/zhiyuexin/ApiJsonByJFinal) 整合 APIJSON 和 JFinal 的 Demo
194+
195+
[SpringServer1.2-APIJSON](https://github.com/Airforce-1/SpringServer1.2-APIJSON) 智慧党建服务器端,提供 上传 和 下载 文件的接口
196+
197+
[AbsGrade](https://github.com/APIJSON/AbsGrade) 抽象列表分级工具,支持微信朋友圈单层评论、QQ空间双层评论、百度网盘多层(无限层)文件夹等
154198

155199
[APIJSON-Android-RxJava](https://github.com/TommyLemon/APIJSON-Android-RxJava) 仿微信朋友圈动态实战项目,ZBLibrary(UI) + APIJSON(HTTP) + RxJava(Data)
156200

157201
[Android-ZBLibrary](https://github.com/TommyLemon/Android-ZBLibrary) Android MVP快速开发框架,Demo全面,注释详细,使用简单,代码严谨
158202

203+
159204
感谢热心的作者们的贡献,点 ⭐Star 支持下他们吧。
160205

161206
### 持续更新
@@ -166,3 +211,4 @@ https://gitee.com/liaozb/APIJSON.NET
166211

167212
### 我要赞赏
168213
如果你喜欢 APIJSON.NET,感觉它帮助到了你,可以点右上角 ⭐Star 支持一下,谢谢 ^_^
214+

0 commit comments

Comments
 (0)