Git Product home page Git Product logo

Comments (11)

TommyLemon avatar TommyLemon commented on April 29, 2024

Operation里面是后端对非开放请求(GET,HEAD)的操作,其中DISALLOW是不允许请求传的参数,在Request表中配置。

禁止查询 可通过在字段名前加下划线解决,例如 Privacy里的 _password , _payPassword .这样怎么都不会返回了

from apijson.

TommyLemon avatar TommyLemon commented on April 29, 2024

或者在AbstractSQLExecutor.execute里result.put封装字段前拦截掉password等字段,目前里面已经拦截了 _key

from apijson.

exment avatar exment commented on April 29, 2024

1如果字段前加_ 会改动原来的表,不能动。
2如果在AbstractSQLExecutor.execute里result.put修改总觉得不太好,又修改了library,又写死了代码。

from apijson.

TommyLemon avatar TommyLemon commented on April 29, 2024

以后会在AbstractSQLExecutor内提供一个

protected void onPutColumn(String column, String lable, Object value) {
  ...
}

方法,子类DemoSQLExecutor可重写

@Override
protected void onPutColumn(String column, String lable, Object value) {
   if ("password".equals(column)) { //不返回password
      return;
   }
   super.onPutColumn(column, lable, value);
}

这样就不用改library代码了。

不过目前你还是用方法2吧,或者等我明天改下,你用新版。

from apijson.

exment avatar exment commented on April 29, 2024

非常感谢!坐等更新~

from apijson.

exment avatar exment commented on April 29, 2024

假设我有两张表都有password字段(重名字段),一张表能返回,一张表不能返回。。。

from apijson.

TommyLemon avatar TommyLemon commented on April 29, 2024

判断 config.getTable()

from apijson.

exment avatar exment commented on April 29, 2024

OK~

from apijson.

TommyLemon avatar TommyLemon commented on April 29, 2024

好了,下载最新版,在DemoSQLExecutor重写onPutColumn

	@Override
	protected JSONObject onPutColumn(SQLConfig config, ResultSet rs, ResultSetMetaData rsmd, int tablePosition,
			JSONObject table, int columnIndex) throws Exception {
		if ("Moment".equals(config.getTable()) && "content".equals(rsmd.getColumnName(columnIndex))) {
			return table;
		}
		return super.onPutColumn(config, rs, rsmd, tablePosition, table, columnIndex);
	}

from apijson.

TommyLemon avatar TommyLemon commented on April 29, 2024

1.这里设置不返回Moment中的content字段

c0d4fdb9-34f2-4ed6-abda-0b336e6b2910

2.用APIJSONAuto自动化接口回归测试,发现Moment相关的接口都被标记为 [缺少字段/整数变小数]

b3ff0690-1236-4d0d-b754-18e54ab69804

3.用 Beyond Compare 对比从接口
[V2 获取动态及发布者用户 /get]
下载到的
APIJSON自动化回归测试-前.txt
APIJSON自动化回归测试-后.txt
两个文件,发现Moment比改之前少了content字段。

b09d5d26-2aec-4aba-aae7-f3108dd35ccc

from apijson.

exment avatar exment commented on April 29, 2024

非常感谢,好棒~

from apijson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.