code: private void setBeginAndEnd() {
          Integer totalPage = this.getTotalPage();
          if (totalPage <= this.indexNo) {
              this.begin = 1;
              this.end = totalPage;
              return;
          }
  
          int minus = this.indexNo / 2;
          int add = this.indexNo % 2 == 0 ? minus - 1 : minus;
          if (this.pageCode - minus < 1) {
              this.begin = 1;
              this.end = this.indexNo;
              return;
          }
          if (this.pageCode + add > totalPage) {
              this.begin = totalPage - (this.indexNo - 1);
              this.end = totalPage;
              return;
          }
  
          this.begin = this.pageCode - minus;
          this.end = this.pageCode + add;
      }
docs: 根据其他成员参数设置该成员参数