Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize: simplify the interface of console #4212

Merged
merged 11 commits into from
Dec 25, 2021
Merged

optimize: simplify the interface of console #4212

merged 11 commits into from
Dec 25, 2021

Conversation

lightClouds917
Copy link
Contributor

@lightClouds917 lightClouds917 commented Dec 16, 2021

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

简化控制台接口数量,提高拓展性:
1.控制台接口合并,使用对象作为入参;
2.防止查询条件变更时,要增加接口提供拓展;

老接口:

    PageResult<GlobalLockVO> queryByTable(String tableName);
    PageResult<GlobalLockVO> queryByXid(String xid);

新接口:

    PageResult<GlobalLockVO> query(GlobalLockParam param);
public class GlobalLockParam implements Serializable {

    private static final long serialVersionUID = 615412528070131284L;

    private String xid;

    private String tableName;
}

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-commenter
Copy link

codecov-commenter commented Dec 18, 2021

Codecov Report

Merging #4212 (eb4f301) into develop (758642c) will decrease coverage by 0.05%.
The diff coverage is 0.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #4212      +/-   ##
=============================================
- Coverage      49.03%   48.98%   -0.06%     
+ Complexity      3783     3782       -1     
=============================================
  Files            720      723       +3     
  Lines          24031    24062      +31     
  Branches        2930     2931       +1     
=============================================
+ Hits           11783    11786       +3     
- Misses         11038    11067      +29     
+ Partials        1210     1209       -1     
Impacted Files Coverage Δ
...in/java/io/seata/core/console/param/BaseParam.java 0.00% <0.00%> (ø)
...a/io/seata/core/console/param/GlobalLockParam.java 0.00% <0.00%> (ø)
...o/seata/core/console/param/GlobalSessionParam.java 0.00% <0.00%> (ø)
.../java/io/seata/core/console/result/PageResult.java 0.00% <0.00%> (ø)
...main/java/io/seata/core/console/result/Result.java 0.00% <ø> (ø)
...ava/io/seata/core/console/result/SingleResult.java 0.00% <ø> (ø)
...java/io/seata/core/console/vo/BranchSessionVO.java 0.00% <0.00%> (ø)
...in/java/io/seata/core/console/vo/GlobalLockVO.java 0.00% <0.00%> (ø)
...java/io/seata/core/console/vo/GlobalSessionVO.java 0.00% <0.00%> (ø)
...er/console/controller/BranchSessionController.java 100.00% <ø> (+50.00%) ⬆️
... and 14 more

@lgtm-com
Copy link

lgtm-com bot commented Dec 18, 2021

This pull request fixes 7 alerts when merging 9d7a43b into 8590bbf - view on LGTM.com

fixed alerts:

  • 7 for Query built from user-controlled sources

@lgtm-com
Copy link

lgtm-com bot commented Dec 19, 2021

This pull request fixes 7 alerts when merging 77bb26b into 8590bbf - view on LGTM.com

fixed alerts:

  • 7 for Query built from user-controlled sources

@lightClouds917
Copy link
Contributor Author

lightClouds917 commented Dec 22, 2021

改动点:
1.vo添加tostring;
2.部分类添加序列化;
3.接口合并,globalsession和globallock各暴露一个接口;
4.result类移动位置;
5.分页结果pageResult部分无用方法删除;
6.添加接口入参对象;

@lgtm-com
Copy link

lgtm-com bot commented Dec 22, 2021

This pull request fixes 7 alerts when merging 1414c75 into 24e38be - view on LGTM.com

fixed alerts:

  • 7 for Query built from user-controlled sources

@lgtm-com
Copy link

lgtm-com bot commented Dec 22, 2021

This pull request fixes 7 alerts when merging 970ae90 into 24e38be - view on LGTM.com

fixed alerts:

  • 7 for Query built from user-controlled sources

Copy link
Contributor

@caohdgege caohdgege left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lgtm-com
Copy link

lgtm-com bot commented Dec 22, 2021

This pull request fixes 7 alerts when merging 3b50104 into 14907c2 - view on LGTM.com

fixed alerts:

  • 7 for Query built from user-controlled sources

@lgtm-com
Copy link

lgtm-com bot commented Dec 25, 2021

This pull request fixes 7 alerts when merging dc6a02f into 14907c2 - view on LGTM.com

fixed alerts:

  • 7 for Query built from user-controlled sources

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@funky-eyes funky-eyes changed the title optimize:simplify the interface of console optimize: simplify the interface of console Dec 25, 2021
@funky-eyes funky-eyes added this to the 1.5.0 milestone Dec 25, 2021
@lgtm-com
Copy link

lgtm-com bot commented Dec 25, 2021

This pull request fixes 7 alerts when merging eb4f301 into 758642c - view on LGTM.com

fixed alerts:

  • 7 for Query built from user-controlled sources

@funky-eyes funky-eyes merged commit e84066c into apache:develop Dec 25, 2021
resultSet = ps.executeQuery();
try (Connection conn = dataSource.getConnection();
PreparedStatement ps = conn.prepareStatement(queryAllBranchSessionSQL);
ResultSet resultSet = ps.executeQuery()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rs not close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants