-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from yury-awesome/feature/新增限速支持
Feature/新增限速支持
- Loading branch information
Showing
9 changed files
with
210 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/main/java/com/meituan/lyrebird/client/api/bandwidth/Bandwidth.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.meituan.lyrebird.client.api.bandwidth; | ||
|
||
/** | ||
* 网络带宽枚举 | ||
*/ | ||
public enum Bandwidth { | ||
BANDWIDTH_2G, BANDWIDTH_2_5G, BANDWIDTH_3G, UNLIMITED | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/com/meituan/lyrebird/client/api/bandwidth/BandwidthTemplate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.meituan.lyrebird.client.api.bandwidth; | ||
|
||
public class BandwidthTemplate { | ||
private String templateName; | ||
|
||
public BandwidthTemplate(Bandwidth bandwidth) { | ||
switch (bandwidth) { | ||
case BANDWIDTH_2G: | ||
templateName = "2G"; | ||
break; | ||
case BANDWIDTH_2_5G: | ||
templateName = "2.5G"; | ||
break; | ||
case BANDWIDTH_3G: | ||
templateName = "3G"; | ||
break; | ||
default: | ||
templateName = "UNLIMITED"; | ||
break; | ||
} | ||
} | ||
|
||
public String getTemplateName() { | ||
return templateName; | ||
} | ||
|
||
public void setTemplateName(String templateName) { | ||
this.templateName = templateName; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/meituan/lyrebird/client/api/bandwidth/SpeedLimit.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.meituan.lyrebird.client.api.bandwidth; | ||
|
||
import com.meituan.lyrebird.client.api.BaseResponse; | ||
|
||
public class SpeedLimit extends BaseResponse { | ||
private int bandwidth; | ||
|
||
public int getBandwidth() { | ||
return bandwidth; | ||
} | ||
|
||
public void setBandwidth(int bandwidth) { | ||
this.bandwidth = bandwidth; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters