diff --git a/lib/classbeanLib/ecology-dev-lib.jar b/lib/classbeanLib/ecology-dev-lib.jar index 25ba501..c04f622 100644 Binary files a/lib/classbeanLib/ecology-dev-lib.jar and b/lib/classbeanLib/ecology-dev-lib.jar differ diff --git a/src/main/java/aiyh/utils/httpUtil/util/HttpUtils.java b/src/main/java/aiyh/utils/httpUtil/util/HttpUtils.java index b3e5c36..99bd9bb 100644 --- a/src/main/java/aiyh/utils/httpUtil/util/HttpUtils.java +++ b/src/main/java/aiyh/utils/httpUtil/util/HttpUtils.java @@ -1013,7 +1013,7 @@ public class HttpUtils { /** *

上传文件

* - * @param url 上床地址 + * @param url 上传地址 * @param multipartFileList 文件信息 * @param params 其他参数 * @param headers 请求头信息 @@ -1062,7 +1062,7 @@ public class HttpUtils { /** *

上传文件

* - * @param url 上床地址 + * @param url 上传地址 * @param multipartFileList 文件信息 * @param params 其他参数 * @param headers 请求头信息 diff --git a/src/main/java/ebu7common/youhong/ai/bean/Builder.java b/src/main/java/ebu7common/youhong/ai/bean/Builder.java new file mode 100644 index 0000000..788b728 --- /dev/null +++ b/src/main/java/ebu7common/youhong/ai/bean/Builder.java @@ -0,0 +1,68 @@ +package ebu7common.youhong.ai.bean; + +import java.util.ArrayList; +import java.util.List; +import java.util.function.Consumer; +import java.util.function.Supplier; + +/** + *

构造者模式

+ * + *

create: 2022-11-26 16:46

+ * + * @author youHong.ai + */ + +public class Builder { + + private Supplier constructor; + + private List> propertiesInjects = new ArrayList<>(); + + private Builder(Supplier constructor) { + this.constructor = constructor; + } + + + /** + *

获取建造者对象

+ * + * @param constructor 传入需要创造的对象的构造方法 + * @param 需要创造的对象的范型 + * @return 建造者对象 + */ + public static Builder builder(Supplier constructor) { + return new Builder(constructor); + } + + /** + *

设置值方法

+ * + * @param setFun 对象字段的set方法 + * @param value 需要设置的值 + * @param 值的范型 + * @return 当前建造者对象本省 + */ + public Builder with(PropertiesInject setFun, V value) { + Consumer c = instance -> setFun.accept(instance, value); + propertiesInjects.add(c); + return this; + } + + + /** + *

创建出目标对象

+ * + * @return 目标对象 + */ + public T build() { + T instance = this.constructor.get(); + this.propertiesInjects.forEach(inject -> inject.accept(instance)); + return instance; + } + + @FunctionalInterface + public interface PropertiesInject { + void accept(T setFun, V value); + } +} diff --git a/src/main/java/ebu7common/youhong/ai/csv/entity/CsvTable.java b/src/main/java/ebu7common/youhong/ai/csv/entity/CsvTable.java deleted file mode 100644 index 8e760f5..0000000 --- a/src/main/java/ebu7common/youhong/ai/csv/entity/CsvTable.java +++ /dev/null @@ -1,128 +0,0 @@ -package ebu7common.youhong.ai.csv.entity; - - -import lombok.Getter; -import lombok.Setter; -import lombok.ToString; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - *

csv表信息

- * - *

create: 2022-11-23 17:19

- * - * @author youHong.ai - */ - -@Setter -@Getter -@ToString -public class CsvTable { - - private List csvRows = new ArrayList<>(); - - private CsvTableHeard csvTableHeard; - - private int rowSize = 0; - - - public void setCsvTableHeard(CsvTableHeard csvTableHeard) { - this.csvTableHeard = csvTableHeard; - this.rowSize++; - - } - - public void addRow(CsvRow csvRow) { - csvRows.add(csvRow); - rowSize++; - } - - - /** - *

csv列数据

- * - *

create: 2022-11-23 17:21

- * - * @author youHong.ai - */ - - @Setter - @Getter - @ToString - static class CsvColumn { - - - } - - - /** - *

csv表行数据

- * - *

create: 2022-11-23 17:21

- * - * @author youHong.ai - */ - - @Setter - @Getter - @ToString - static class CsvRow { - private List csvColumns = new ArrayList<>(); - private int rowSize = 0; - - public void add(CsvColumn csvColumn) { - csvColumns.add(csvColumn); - rowSize++; - } - - - } - - - /** - *

csv表头数据

- * - *

create: 2022-11-23 17:21

- * - * @author youHong.ai - */ - @ToString - static class CsvTableHeard { - private List heard; - - private Map mapping; - - private int heardSize = 0; - - public void addHeard(String value) { - if (heard == null) { - this.heard = new ArrayList<>(); - this.mapping = new HashMap<>(); - } - mapping.put(value, heardSize++); - heard.add(value); - } - - public int getHeardRow(String value) { - if (mapping != null) { - return mapping.get(value); - } - return -1; - } - - public String getHeard(int columnIndex) { - if (heard != null) { - return this.heard.get(columnIndex); - } - return null; - } - - } - - -} - diff --git a/src/test/java/youhong/ai/pcn/TestOrganization.java b/src/test/java/youhong/ai/pcn/TestOrganization.java index 4d24e3e..6e93f55 100644 --- a/src/test/java/youhong/ai/pcn/TestOrganization.java +++ b/src/test/java/youhong/ai/pcn/TestOrganization.java @@ -2,6 +2,7 @@ package youhong.ai.pcn; import basetest.BaseTest; import com.alibaba.fastjson.JSON; +import ebu7common.youhong.ai.bean.Builder; import ebu7common.youhong.ai.sftp.SftpConnectUtil; import org.junit.Test; import weaver.general.GCONST; @@ -65,6 +66,15 @@ public class TestOrganization extends BaseTest { } + @Test + public void testBuilder() { + Position build = Builder.builder(Position::new) + .with(Position::setCompany_Code, "asdf") + .with(Position::setJOBCODE, "hahsdf") + .build(); + System.out.println(build); + } + @Test public void testReadCsv() { diff --git a/常用信息.md b/常用信息.md index e91f310..dd762ac 100644 --- a/常用信息.md +++ b/常用信息.md @@ -11,14 +11,20 @@ ### 前端 -**获取用户信息** +**1.获取用户信息** > 维护人员:youhong.ai ```javascript const userInfo = JSON.parse(localStorage.getItem("theme-account")) ``` -**获取url参数** +**2.ecode访问上传的resource静态文件** + +```javascript +let src = "/cloudstore/release/${appId}/resources/" +``` + +**3.获取url参数** > 维护人员: youHong.ai ```javascript @@ -37,7 +43,7 @@ getQueryString = (name) => { ``` -**ajax请求** +**4.ajax请求** > 维护人员: youHong.ai ```javascript @@ -68,7 +74,7 @@ getQueryString = (name) => { } ``` -**通过js获取react组件,操作组件内部数据** +**5.通过js获取react组件,操作组件内部数据** ```javascript function FindReact(dom, traverseUp = 0) { @@ -109,6 +115,28 @@ const myComp = FindReact(someElement); myComp.setState({test1: test2}); ``` +**6.ecode集成iconfont** + +```css +/*修改url,字体文件上传到cloudstore/iconfont/xx/下,没有目录自己创建*/ +/*修改font-family,命名为其他名称,防止与系统自带的或与其他iconfont冲突*/ +@font-face { + font-family: "cus_iconfont"; /* Project id 3789451 */ + src: url('/cloudstore/iconfont/pcn/iconfont.woff2?t=1669223019749') format('woff2'), + url('/cloudstore/iconfont/pcn/iconfont.woff?t=1669223019749') format('woff'), + url('/cloudstore/iconfont/pcn/iconfont.ttf?t=1669223019749') format('truetype'); +} + +/*修改iconfont类名为font-family的名称*/ +.cus_iconfont { + font-family: "cus_iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +``` + ### 数据库 **备份mysql数据库**