# bygo-common
**Repository Path**: bygo/bygo-common
## Basic Information
- **Project Name**: bygo-common
- **Description**: No description available
- **Primary Language**: Java
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-10-23
- **Last Updated**: 2020-12-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
### 导入依赖
```xml
com.bywlkjs
bygo-common
1.0.0.RELEASE
```
> 请使用 bygo-maven 的setting.xml
>
> ```xml
>
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation
> ="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
>
>
>
>
> bygomaven
> bygo-maven
> http://maven.bywlkjs.com/repository/bygo_group/
> central
>
>
>
>
>
>```
>
### 基本使用
> 使用BYMD生成信息摘要
>
> ```java
> public static void main(String[] args) {
> //使用BYMD生成无法逆运算的信息摘要
> System.out.println("BYMD.create(\"123\") = " + BYMD.create("123"));
> }
>
> //控制台返回的结果
> // >> BYMD.create("123") = Sur#*-$',xG'8s.o`Ui)W>~wc_SR8% ```
> 使用CookieUtil获取和修改cookie
>
> ```java
> //...
> import com.bywlkjs.common.uti.CookieUtil;
> //...
>
> @GetMapping("/cookie_util_demo")
> public String cookieUtilDemo(HttpServletRequest request){
> CookieUtil cookieUtil=new Cookile(request.getCookies());
> cookieUtil.get("name");//获取到cookie中的键为name的值
> cookieUtil.put("name","cookieUtil");//给cookie的name重新赋值
> cookieUtil,put("MP","100");//添加一个键值对
> return "cookieUtilDemo";
> }
> ```
> 发送请求并获取资源
>
> ```java
> //...
> import com.bywlkjs.common.util.WebSentUtil;
> //...
>
> @Test
> void sentGetTest(){
>
> //java对象或者Map类可生成url参数
> User user=new User();
> user.getName("User");
> user.getAge(123);
>
> //向指定Url发送请求,并获取信息
> WebSentUtil.sendGet("http://localhost:8080/test/test01",user);
>
> }
>
> @Test
> void getFileTest(){
> //获取网络资源,参数1是资源地址,参数2是资源保存路径
> WebSentUtil.sendGet("http://localhost:8080/img/test.png","/etc/image");
> }
> ```