Re: [PR] [improvement] Optimize PageInfo tool code [dolphinscheduler]

2024-02-23 Thread via GitHub


SbloodyS commented on PR #15620:
URL: 
https://github.com/apache/dolphinscheduler/pull/15620#issuecomment-1960937799

   > @SbloodyS Sorry, I can't use the mvn spotless:apply command. Can you help 
me?
   
   You should run ti locally and push again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [improvement] Optimize PageInfo tool code [dolphinscheduler]

2024-02-23 Thread via GitHub


DaZuiZui commented on PR #15620:
URL: 
https://github.com/apache/dolphinscheduler/pull/15620#issuecomment-1960898809

   @Gallardot @SbloodyS  thank


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [improvement] Optimize PageInfo tool code [dolphinscheduler]

2024-02-23 Thread via GitHub


Gallardot commented on code in PR #15620:
URL: 
https://github.com/apache/dolphinscheduler/pull/15620#discussion_r1500323152


##
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/PageInfo.java:
##
@@ -82,10 +82,8 @@ public Integer getTotalPage() {
 if (pageSize == null || pageSize == 0) {
 pageSize = 7;
 }
-this.totalPage =
-(this.total % this.pageSize) == 0
-? ((this.total / this.pageSize) == 0 ? 1 : (this.total 
/ this.pageSize))
-: (this.total / this.pageSize + 1);
+
+this.totalPage = (int)Math.ceil((double)this.total / 
(double)this.pageSize);

Review Comment:
   ```suggestion
   this.totalPage = (int) Math.ceil((double) this.total / (double) 
this.pageSize);
   ```
   
`mvn spotless:apply`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [improvement] Optimize PageInfo tool code [dolphinscheduler]

2024-02-23 Thread via GitHub


DaZuiZui commented on PR #15620:
URL: 
https://github.com/apache/dolphinscheduler/pull/15620#issuecomment-1960886109

   @SbloodyS Sorry, I can't use the mvn spotless:apply command. Can you help me?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [improvement] Optimize PageInfo tool code [dolphinscheduler]

2024-02-22 Thread via GitHub


Gallardot commented on code in PR #15620:
URL: 
https://github.com/apache/dolphinscheduler/pull/15620#discussion_r1500309458


##
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/PageInfo.java:
##
@@ -82,10 +82,8 @@ public Integer getTotalPage() {
 if (pageSize == null || pageSize == 0) {
 pageSize = 7;
 }
-this.totalPage =
-(this.total % this.pageSize) == 0
-? ((this.total / this.pageSize) == 0 ? 1 : (this.total 
/ this.pageSize))
-: (this.total / this.pageSize + 1);
+
+this.totalPage = Math.ceil(this.total / this.pageSize);

Review Comment:
   ```suggestion
   this.totalPage = (int)Math.ceil((double)this.total / 
(double)this.pageSize);
   ```
   
   need to do some type conversion



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [improvement] Optimize PageInfo tool code [dolphinscheduler]

2024-02-22 Thread via GitHub


SbloodyS commented on PR #15620:
URL: 
https://github.com/apache/dolphinscheduler/pull/15620#issuecomment-1960871928

   Please run `mvn spotless:apply` to format code. @DaZuiZui 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org