From 80495f181ecb3bd7e5658513671609efe854c818 Mon Sep 17 00:00:00 2001 From: wuzeyu <1223318623@qq.com> Date: 星期六, 02 十二月 2023 10:40:43 +0800 Subject: [PATCH] 取水口、RTU实体 用户设置默认密码 重置密码 --- pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java | 244 ++++++++++++----- pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaRTU.java | 109 +++++++ pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaUser.java | 15 pipIrr-platform/pom.xml | 92 ++++-- pipIrr-platform/pipIrr-global/pom.xml | 4 pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/pom.xml | 114 +++++++ pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/resources/application.yml | 2 pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java | 112 +++++-- pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaIntake.java | 122 ++++++++ 9 files changed, 668 insertions(+), 146 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/pom.xml b/pipIrr-platform/pipIrr-global/pom.xml index 960b924..1bc1879 100644 --- a/pipIrr-platform/pipIrr-global/pom.xml +++ b/pipIrr-platform/pipIrr-global/pom.xml @@ -118,6 +118,10 @@ <version>1.5.5.Final</version> <scope>compile</scope> </dependency> + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + </dependency> </dependencies> <build> diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaIntake.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaIntake.java new file mode 100644 index 0000000..a7d833b --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaIntake.java @@ -0,0 +1,122 @@ +package com.dy.pipIrrGlobal.pojoBa; + +import com.alibaba.fastjson2.annotation.JSONField; +import com.alibaba.fastjson2.writer.ObjectWriterImplToString; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.dy.common.po.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.*; +import org.hibernate.validator.constraints.Length; + +/** + * 鍙栨按鍙e疄浣� + */ +@TableName(value = "ba_intake", autoResultMap = true) +@Data +@Builder +@ToString +@NoArgsConstructor +@AllArgsConstructor +@Schema(name = "鍙栨按鍙e疄浣�") +public class BaIntake implements BaseEntity { + + public static final long serialVersionUID = 202312010953001L; + + @JSONField(serializeUsing = ObjectWriterImplToString.class) + @TableId(type = IdType.INPUT) + @Schema(description = "瀹炰綋id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Long id; + + /** + * 鍙栨按鍙e悕绉版垨缂栧彿 + */ + @Schema(description = "鍙栨按鍙e悕绉版垨缂栧彿", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "鍙栨按鍙e悕绉版垨缂栧彿涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @Length(message = "鍙栨按鍙e悕绉版垨缂栧彿涓嶅ぇ浜巤max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 25) + public String name; + + /** + * 澶栭敭锛屾寚鍚戠墖鍖� + */ + @JSONField(serializeUsing = ObjectWriterImplToString.class) + @Schema(description = "鎵�鍦ㄧ墖鍖篒D", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�鍦ㄧ墖鍖轰笉鑳戒负绌�") //涓嶈兘涓簄ull + public Long blockId; + + /** + * 澶栭敭锛屾寚鍚戝垎姘村彛 + */ + @JSONField(serializeUsing = ObjectWriterImplToString.class) + @Schema(description = "鎵�鍦ㄥ垎姘村彛ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�鍦ㄥ垎姘村彛涓嶈兘涓虹┖") //涓嶈兘涓簄ull + public Long divideId; + + /** + * 璐熻矗浜� + */ + @Schema(description = "璐熻矗浜�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Length(message = "璐熻矗浜轰笉澶т簬{max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 25) + public String header; + + /** + * 鑱旂郴鐢佃瘽 + */ + @Schema(description = "鑱旂郴鐢佃瘽", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "鑱旂郴鐢佃瘽涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @Length(message = "鑱旂郴鐢佃瘽蹇呴』{max}浣嶆暟鎹�", min = 11, max = 11) + public String phone; + + /** + * 澶栭敭锛屾寚鍚戣鏀垮尯 + */ + @JSONField(serializeUsing = ObjectWriterImplToString.class) + @Schema(description = "鎵�鍦ㄥ幙ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�鍦ㄥ幙涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + public Long countyId; + + /** + * 澶栭敭锛屾寚鍚戣鏀垮尯 + */ + @JSONField(serializeUsing = ObjectWriterImplToString.class) + @Schema(description = "鎵�鍦ㄩ晣ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�鍦ㄩ晣涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + public Long townId; + + /** + * 澶栭敭锛屾寚鍚戣鏀垮尯 + */ + @JSONField(serializeUsing = ObjectWriterImplToString.class) + @Schema(description = "鎵�鍦ㄦ潙ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�鍦ㄦ潙涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + public Long villageId; + + /** + * 缁忓害 + */ + @Schema(description = "缁忓害", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Double lng; + + /** + * 绾害 + */ + @Schema(description = "绾害", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Double lat; + + /** + * 澶囨敞 + */ + @Schema(description = "澶囨敞", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Length(message = "澶囨敞涓嶅ぇ浜巤max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 50) + public String remark; + + /** + * 鍒犻櫎鏍囧織 + */ + @Schema(description = "鍒犻櫎鏍囪瘑锛岃〃鍗曚笉鐢ㄥ~鍐�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Byte deleted; + +} diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaRTU.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaRTU.java new file mode 100644 index 0000000..0f4841a --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaRTU.java @@ -0,0 +1,109 @@ +package com.dy.pipIrrGlobal.pojoBa; + +import com.alibaba.fastjson2.annotation.JSONField; +import com.alibaba.fastjson2.writer.ObjectWriterImplToString; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.dy.common.po.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.*; +import org.hibernate.validator.constraints.Length; + +/** + * 鎺у埗鍣ㄥ疄浣擄紝RTU闃�鎺т竴浣撴満 + */ +@TableName(value = "ba_intake", autoResultMap = true) +@Data +@Builder +@ToString +@NoArgsConstructor +@AllArgsConstructor +@Schema(name = "RTU闃�鎺т竴浣撴満瀹炰綋") +public class BaRTU implements BaseEntity { + + public static final long serialVersionUID = 202312011021001L; + + @JSONField(serializeUsing = ObjectWriterImplToString.class) + @TableId(type = IdType.INPUT) + @Schema(description = "瀹炰綋id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Long id; + + /** + * 鎺у埗鍣ㄧ紪鍙� + */ + @Schema(description = "鎺у埗鍣ㄧ紪鍙�", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "鎺у埗鍣ㄧ紪鍙蜂笉鑳戒负绌�") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @Length(message = "鎺у埗鍣ㄧ紪鍙蜂笉澶т簬{max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 25) + public String num; + + /** + * 澶栭敭锛屾寚鍚戝彇姘村彛 + */ + @JSONField(serializeUsing = ObjectWriterImplToString.class) + @Schema(description = "鎵�鍦ㄥ彇姘村彛ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�鍦ㄥ彇姘村彛涓嶈兘涓虹┖") //涓嶈兘涓簄ull + public Long intakeId; + + /** + * 澶栭敭锛屾寚鍚戝啘鎴凤紙鐢ㄦ按鎴凤級 + */ + @JSONField(serializeUsing = ObjectWriterImplToString.class) + @Schema(description = "鎵�灞炲啘鎴稩D", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�灞炲啘鎴蜂笉鑳戒负绌�") //涓嶈兘涓簄ull + public Long clientId; + + /** + * 璐熻矗浜� + */ + @Schema(description = "璐熻矗浜�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Length(message = "璐熻矗浜轰笉澶т簬{max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 25) + public String header; + + /** + * 鑱旂郴鐢佃瘽 + */ + @Schema(description = "鑱旂郴鐢佃瘽", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "鑱旂郴鐢佃瘽涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @Length(message = "鑱旂郴鐢佃瘽蹇呴』{max}浣嶆暟鎹�", min = 11, max = 11) + public String phone; + + /** + * 寮�鍏抽榾 + */ + @Schema(description = "寮�鍏抽榾", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "0鍏抽榾锛�1寮�闃�") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @Length(message = "鑱旂郴鐢佃瘽蹇呴』{max}浣嶆暟鎹�", min = 1, max = 1) + public Byte isOpen; + + /** + * 鎺у埗鍣ㄥ悕绉� + */ + @Schema(description = "鎺у埗鍣ㄥ悕绉�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @NotEmpty(message = "鎺у埗鍣ㄥ悕绉伴潪蹇呭~") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @Length(message = "鎺у埗鍣ㄥ悕绉颁笉澶т簬{max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 25) + public String name; + + /** + * 鍘傚鍚嶇О + */ + @Schema(description = "鍘傚鍚嶇О", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @NotEmpty(message = "鍘傚鍚嶇О闈炲繀濉�") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @Length(message = "鍘傚鍚嶇О涓嶅ぇ浜巤max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 25) + public String manufacturer; + + /** + * 澶囨敞 + */ + @Schema(description = "澶囨敞", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Length(message = "澶囨敞涓嶅ぇ浜巤max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 50) + public String remark; + + /** + * 鍒犻櫎鏍囧織 + */ + @Schema(description = "鍒犻櫎鏍囪瘑锛岃〃鍗曚笉鐢ㄥ~鍐�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Byte deleted; +} diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaUser.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaUser.java index 561b660..bb7bf2a 100644 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaUser.java +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaUser.java @@ -2,13 +2,14 @@ import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.writer.ObjectWriterImplToString; -import com.baomidou.mybatisplus.annotation.*; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; import com.dy.common.mybatis.envm.Deleted; import com.dy.common.mybatis.envm.Disabled; import com.dy.common.po.BaseEntity; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.Max; -import jakarta.validation.constraints.Min; import jakarta.validation.constraints.NotEmpty; import lombok.*; import org.hibernate.validator.constraints.Length; @@ -94,8 +95,6 @@ * 鏄惁绂佺敤 0:鍚�,1:鏄� */ @Schema(description = "鏄惁绂佺敤", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @Max(message = "鏄惁绂佺敤鍙兘0鎴�1", value = 1) - @Min(message = "鏄惁绂佺敤鍙兘0鎴�1",value = 0) public Disabled disabled; /** @@ -117,4 +116,10 @@ @TableField(exist = false) public List<Integer> privileges; //public transient List<Integer> privileges;//姝ょ鏂瑰紡鍙橀噺涓嶅瓨搴擄紝 涔熶笉鍙備笌搴忓垪鍖栦簡 + + /** + * 鐢ㄦ埛鎵�灞炶鑹睮d + */ + @TableField(exist = false) + public String[] roleIds ; } \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/pom.xml b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/pom.xml index 6131694..7200183 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/pom.xml +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/pom.xml @@ -11,25 +11,125 @@ <packaging>jar</packaging> <artifactId>pipIrr-mw-accept</artifactId> + <version>1.0.0</version> <name>pipIrr-mw-accept</name> <description>閫氫俊涓棿浠�</description> <dependencies> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-web</artifactId> + <exclusions> + <exclusion> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-json</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <!-- 绯荤粺鐩戠 --> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-actuator</artifactId> + </dependency> + + <!-- api鍦ㄧ嚎鏂囨。 https://springdoc.org/#modules--> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> + </dependency> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-api</artifactId> + </dependency> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-security</artifactId> + </dependency> + + <!-- 鍔ㄦ�佸姞杞芥柊缂栬瘧鐨勭被 --> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-devtools</artifactId> + <scope>runtime</scope> + </dependency> + + <!--mysql椹卞姩--> + <dependency> + <groupId>com.mysql</groupId> + <artifactId>mysql-connector-j</artifactId> + <version>8.0.33</version> + </dependency> + <!--druid-spring-boot杩炴帴姹�--> + <dependency> + <groupId>com.alibaba</groupId> + <artifactId>druid-spring-boot-starter</artifactId> + <version>1.2.20</version> + </dependency> + <!--mybatis-plus-spring-boot--> + <dependency> + <groupId>com.baomidou</groupId> + <artifactId>mybatis-plus-boot-starter</artifactId> + <version>3.5.3.2</version> + </dependency> + + <!-- bean鍜宮ap浜掕浆鎹� --> + <dependency> + <groupId>org.apache.dubbo</groupId> + <artifactId>dubbo</artifactId> + <version>3.2.7</version> + <exclusions> + <exclusion> + <groupId>io.netty</groupId> + <artifactId>netty-all</artifactId> + </exclusion> + <exclusion> + <groupId>org.yaml</groupId> + <artifactId>snakeyaml</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + </exclusion> + <exclusion> + <groupId>com.alibaba.spring</groupId> + <artifactId>spring-context-support</artifactId> + </exclusion> + <exclusion> + <groupId>com.alibaba.fastjson2</groupId> + <artifactId>fastjson2</artifactId> + </exclusion> + <exclusion> + <groupId>com.alibaba</groupId> + <artifactId>hessian-lite</artifactId> + </exclusion> + <exclusion> + <groupId>org.javassist</groupId> + <artifactId>javassist</artifactId> + </exclusion> + </exclusions> + </dependency> + <!-- apache mina --> <dependency> <groupId>org.apache.mina</groupId> <artifactId>mina-core</artifactId> - <version>2.2.1</version> - </dependency> - <dependency> - <groupId>org.apache.mina</groupId> - <artifactId>mina-filter-compression</artifactId> - <version>2.2.1</version> + <version>2.2.2</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>2.0.7</version> </dependency> + + <!-- 娴嬭瘯 --> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-test</artifactId> + <scope>test</scope> + </dependency> </dependencies> -</project> +</project> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java index cf8637e..3bfc625 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java @@ -21,6 +21,7 @@ import jakarta.validation.Valid; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.http.MediaType; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; @@ -31,19 +32,23 @@ @Slf4j @Tag(name = "鐢ㄦ埛绠$悊", description = "鐢ㄦ埛澧炲垹鏀规煡绛夋搷浣�") @RestController -@RequestMapping(path="user") +@RequestMapping(path = "user") @SuppressWarnings("unchecked")//java鐗堟湰瓒婇珮锛屽娉涘瀷绾︽潫瓒婁弗锛屾墍浠ラ厤缃甋uppressWarnings("unchecked") public class UserCtrl { - private UserSv sv ; + private UserSv sv; + + @Value("${user.defaultPassword:ABC123}") + private String defaultPassword; @Autowired - private void setSv(UserSv sv){ - this.sv = sv ; + private void setSv(UserSv sv) { + this.sv = sv; } /** * 瀹㈡埛绔姹傚緱鍒版墍鏈夌敤鎴锋暟鎹� + * * @return 鎵�鏈夌敤鎴锋暟鎹� */ @Operation(summary = "鑾峰緱涓�椤电敤鎴�", description = "杩斿洖涓�椤电敤鎴锋暟鎹�") @@ -57,18 +62,19 @@ }) @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE) @SsoAop("-1") - public BaseResponse<QueryResultVo<List<BaUser>>> some(@RequestBody @Parameter(description = "鏌ヨform琛ㄥ崟json鏁版嵁", required = true) @Valid QueryVo vo){ + public BaseResponse<QueryResultVo<List<BaUser>>> some(@RequestBody @Parameter(description = "鏌ヨform琛ㄥ崟json鏁版嵁", required = true) @Valid QueryVo vo) { try { - QueryResultVo<List<BaUser>> res = this.sv.selectSome(vo) ; + QueryResultVo<List<BaUser>> res = this.sv.selectSome(vo); return BaseResponseUtils.buildSuccess(res); } catch (Exception e) { log.error("鏌ヨ鐢ㄦ埛寮傚父", e); - return BaseResponseUtils.buildException(e.getMessage()) ; + return BaseResponseUtils.buildException(e.getMessage()); } } /** * 寰楀埌涓�涓敤鎴锋暟鎹� + * * @return 涓�涓敤鎴锋暟鎹� */ @Operation(summary = "涓�涓敤鎴�", description = "寰楀埌涓�涓敤鎴锋暟鎹�") @@ -82,12 +88,13 @@ }) @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE) @SsoAop("-1") - public BaseResponse<BaUser> one(@Parameter(description = "瀹炰綋id", required = true) String id){ + public BaseResponse<BaUser> one(@Parameter(description = "瀹炰綋id", required = true) String id) { return BaseResponseUtils.buildSuccess(this.sv.selectById(Long.parseLong(id))); } /** * 淇濆瓨鐢ㄦ埛 + * * @param po 淇濆瓨鐢ㄦ埛form琛ㄥ崟瀵硅薄 * @return 鏄惁鎴愬姛 */ @@ -102,37 +109,42 @@ }) @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE) @SsoAop("-1")//@SsoAop(power = "-1") - public BaseResponse<Boolean> save(@RequestBody @Parameter(description = "form琛ㄥ崟json鏁版嵁", required = true) @Valid BaUser po, @Parameter(hidden = true) BindingResult bindingResult){ - if(bindingResult != null && bindingResult.hasErrors()){ + public BaseResponse<Boolean> save(@RequestBody @Parameter(description = "form琛ㄥ崟json鏁版嵁", required = true) @Valid BaUser po, @Parameter(hidden = true) BindingResult bindingResult) { + if (bindingResult != null && bindingResult.hasErrors()) { return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); } - po.id = null ; + po.id = null; int count; + int count1; try { - po.disabled = Disabled.NO ;//榛樿涓嶇鐢� - po.deleted = Deleted.NO ;//榛樿涓嶅垹闄� - po.orgTag = DataSourceContext.get() ;//鏈烘瀯鏍囩 - if(!StringUtils.isNullOrEmpty(po.password)){ + po.disabled = Disabled.NO;//榛樿涓嶇鐢� + po.deleted = Deleted.NO;//榛樿涓嶅垹闄� + po.orgTag = DataSourceContext.get();//鏈烘瀯鏍囩 + if (!StringUtils.isNullOrEmpty(po.password)) { /* 濡傛灉鍓嶇杩涜浜哹ase64鍔犲瘑 po.password = new String(Base64.getDecoder().decode(po.password)) ; */ - po.password = MD5.encrypt(po.password) ;//杩涜鍔犲瘑鐮� + po.password = MD5.encrypt(po.password);//杩涜鍔犲瘑鐮� + } else { + po.password = MD5.encrypt(defaultPassword); } count = this.sv.save(po); + count1 = this.sv.setRoles(String.valueOf(po.id), po.roleIds); } catch (Exception e) { log.error("淇濆瓨鐢ㄦ埛寮傚父", e); - return BaseResponseUtils.buildException(e.getMessage()) ; + return BaseResponseUtils.buildException(e.getMessage()); } - if(count <= 0){ - return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�") ; - }else{ - return BaseResponseUtils.buildSuccess(true) ; + if (count <= 0 || count1 <= 0) { + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�"); + } else { + return BaseResponseUtils.buildSuccess(true); } } /** * 缂栬緫淇敼鐢ㄦ埛 + * * @param po 淇濆瓨鐢ㄦ埛form琛ㄥ崟瀵硅薄 * @return 鏄惁鎴愬姛 */ @@ -147,32 +159,33 @@ }) @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE) @SsoAop("-1")//@SsoAop(power = "-1") - public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form琛ㄥ崟json鏁版嵁", required = true) @Valid BaUser po, @Parameter(hidden = true) BindingResult bindingResult){ - if(bindingResult != null && bindingResult.hasErrors()){ + public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form琛ㄥ崟json鏁版嵁", required = true) @Valid BaUser po, @Parameter(hidden = true) BindingResult bindingResult) { + if (bindingResult != null && bindingResult.hasErrors()) { return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); } - if(po.id == null){ - return BaseResponseUtils.buildFail("鏃犳暟鎹疄浣揑D") ; + if (po.id == null) { + return BaseResponseUtils.buildFail("鏃犳暟鎹疄浣揑D"); } int count; try { - po.deleted = null ;//璁剧疆涓簄ull锛屼笉鍋氭洿鏂� - po.orgTag = null ;//璁剧疆涓簄ull锛屼笉鍋氭洿鏂� + po.deleted = null;//璁剧疆涓簄ull锛屼笉鍋氭洿鏂� + po.orgTag = null;//璁剧疆涓簄ull锛屼笉鍋氭洿鏂� count = this.sv.update(po); } catch (Exception e) { log.error("淇濆瓨鐢ㄦ埛寮傚父", e); - return BaseResponseUtils.buildException(e.getMessage()) ; + return BaseResponseUtils.buildException(e.getMessage()); } - if(count <= 0){ - return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�") ; - }else{ - return BaseResponseUtils.buildSuccess(true) ; + if (count <= 0) { + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�"); + } else { + return BaseResponseUtils.buildSuccess(true); } } /** * 淇敼瀵嗙爜 + * * @param id 鐢ㄦ埛ID * @return 鏄惁鎴愬姛 */ @@ -189,51 +202,137 @@ @SsoAop("-1")//@SsoAop(power = "-1") public BaseResponse<Boolean> changePassword(@Parameter(description = "瀹炰綋id", required = true) String id, @Parameter(description = "鏃у瘑鐮�", required = true) String oldPassword, - @Parameter(description = "鏂板瘑鐮�", required = true) String newPassword) throws Exception{ - if(id == null){ - return BaseResponseUtils.buildFail("id涓嶈兘涓虹┖") ; + @Parameter(description = "鏂板瘑鐮�", required = true) String newPassword) throws Exception { + if (id == null) { + return BaseResponseUtils.buildFail("id涓嶈兘涓虹┖"); } - if(StringUtils.isNullOrEmpty(oldPassword)){ - return BaseResponseUtils.buildFail("鏃у瘑鐮佷笉鑳戒负绌�") ; + if (StringUtils.isNullOrEmpty(oldPassword)) { + return BaseResponseUtils.buildFail("鏃у瘑鐮佷笉鑳戒负绌�"); } - if(StringUtils.isNullOrEmpty(newPassword)){ - return BaseResponseUtils.buildFail("鏂板瘑鐮佷笉鑳戒负绌�") ; + if (StringUtils.isNullOrEmpty(newPassword)) { + return BaseResponseUtils.buildFail("鏂板瘑鐮佷笉鑳戒负绌�"); } /* 濡傛灉鍓嶇杩涜浜哹ase64鍔犲瘑 oldPassword = new String(Base64.getDecoder().decode(oldPassword)) ; newPassword = new String(Base64.getDecoder().decode(newPassword)) ; */ - oldPassword = MD5.encrypt(oldPassword) ;//杩涜鍔犲瘑鐮� - newPassword = MD5.encrypt(newPassword) ;//杩涜鍔犲瘑鐮� + oldPassword = MD5.encrypt(oldPassword);//杩涜鍔犲瘑鐮� + newPassword = MD5.encrypt(newPassword);//杩涜鍔犲瘑鐮� - Long idLg = Long.parseLong(id) ; - int count ; + Long idLg = Long.parseLong(id); + int count; try { BaUser po = this.sv.selectById(idLg); - if(Objects.isNull(po)){ - return BaseResponseUtils.buildFail("鏈緱鍒扮敤鎴凤紝璇锋眰澶辫触") ; - }else{ - if(!po.password.equalsIgnoreCase(oldPassword)){ - return BaseResponseUtils.buildFail("鏃у瘑鐮佷笉姝g‘锛岃姹傚け璐�") ; - }else{ - count = this.sv.changePassword(idLg, newPassword) ; + if (Objects.isNull(po)) { + return BaseResponseUtils.buildFail("鏈緱鍒扮敤鎴凤紝璇锋眰澶辫触"); + } else { + if (!po.password.equalsIgnoreCase(oldPassword)) { + return BaseResponseUtils.buildFail("鏃у瘑鐮佷笉姝g‘锛岃姹傚け璐�"); + } else { + count = this.sv.changePassword(idLg, newPassword); } } } catch (Exception e) { log.error("淇濆瓨鐢ㄦ埛寮傚父", e); - return BaseResponseUtils.buildException(e.getMessage()) ; + return BaseResponseUtils.buildException(e.getMessage()); } - if(count <= 0){ - return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�") ; - }else{ - return BaseResponseUtils.buildSuccess(true) ; + if (count <= 0) { + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�"); + } else { + return BaseResponseUtils.buildSuccess(true); + } + } + + /** + * 閲嶇疆瀵嗙爜涓洪粯璁ゅ�� + * + * @param id 鐢ㄦ埛ID + * @return 鏄惁鎴愬姛 + */ + @Operation(summary = "閲嶇疆瀵嗙爜", description = "鎻愪氦鐢ㄦ埛ID") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = Boolean.class))} + ) + }) + @GetMapping(path = "resetPassword", consumes = MediaType.TEXT_PLAIN_VALUE) + @SsoAop("-1")//@SsoAop(power = "-1") + public BaseResponse<Boolean> resetPassword(@Parameter(description = "瀹炰綋id", required = true) String id) throws Exception { + if (id == null) { + return BaseResponseUtils.buildFail("id涓嶈兘涓虹┖"); + } + String password = MD5.encrypt(defaultPassword);//杩涜鍔犲瘑鐮� + Long idLg = Long.parseLong(id); + int count; + try { + BaUser po = this.sv.selectById(idLg); + if (Objects.isNull(po)) { + return BaseResponseUtils.buildFail("鏈緱鍒扮敤鎴凤紝璇锋眰澶辫触"); + } else { + count = this.sv.changePassword(idLg, password); + } + } catch (Exception e) { + log.error("淇濆瓨鐢ㄦ埛寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + if (count <= 0) { + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�"); + } else { + return BaseResponseUtils.buildSuccess(true); + } + } + + /** + * 閲嶇疆瀵嗙爜涓洪殢鏈烘暟瀛楀姞瀛楁瘝 + * + * @param id 鐢ㄦ埛ID + * @return 鏄惁鎴愬姛 + */ + @Operation(summary = "閲嶇疆瀵嗙爜", description = "鎻愪氦鐢ㄦ埛ID") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = Boolean.class))} + ) + }) + @GetMapping(path = "resetPassword1", consumes = MediaType.TEXT_PLAIN_VALUE) + @SsoAop("-1")//@SsoAop(power = "-1") + public BaseResponse<String> resetPassword1(@Parameter(description = "瀹炰綋id", required = true) String id) throws Exception { + if (id == null) { + return BaseResponseUtils.buildFail("id涓嶈兘涓虹┖"); + } + String randomPassword = this.sv.getStringRandom(6); + String password = MD5.encrypt(randomPassword);//杩涜鍔犲瘑鐮� + Long idLg = Long.parseLong(id); + int count; + try { + BaUser po = this.sv.selectById(idLg); + if (Objects.isNull(po)) { + return BaseResponseUtils.buildFail("鏈緱鍒扮敤鎴凤紝璇锋眰澶辫触"); + } else { + count = this.sv.changePassword(idLg, password); + } + } catch (Exception e) { + log.error("淇濆瓨鐢ㄦ埛寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + if (count <= 0) { + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�"); + } else { + return BaseResponseUtils.buildSuccess(randomPassword); } } /** * 璁剧疆鐢ㄦ埛瑙掕壊 + * * @param id 鐢ㄦ埛ID * @return 鏄惁鎴愬姛 */ @@ -249,27 +348,28 @@ @GetMapping(path = "setRoles", consumes = MediaType.TEXT_PLAIN_VALUE) @SsoAop("-1")//@SsoAop(power = "-1") public BaseResponse<Boolean> setRoles(@Parameter(description = "瀹炰綋id", required = true) String id, - @Parameter(description = "瑙掕壊id鏁扮粍") String[] roleIds){ - Long[] roleId_lg = null ; - if(roleIds != null && roleIds.length > 0){ - roleId_lg = new Long[roleIds.length] ; - int index = 0 ; - for(String roleId : roleIds){ - roleId_lg[index++] = Long.parseLong(roleId) ; + @Parameter(description = "瑙掕壊id鏁扮粍") String[] roleIds) { + Long[] roleId_lg = null; + if (roleIds != null && roleIds.length > 0) { + roleId_lg = new Long[roleIds.length]; + int index = 0; + for (String roleId : roleIds) { + roleId_lg[index++] = Long.parseLong(roleId); } } try { this.sv.setRoles(Long.parseLong(id), roleId_lg); } catch (Exception e) { log.error("淇濆瓨鐢ㄦ埛寮傚父", e); - return BaseResponseUtils.buildException(e.getMessage()) ; + return BaseResponseUtils.buildException(e.getMessage()); } - return BaseResponseUtils.buildSuccess(true) ; + return BaseResponseUtils.buildSuccess(true); } /** * 鍒犻櫎鐢ㄦ埛 + * * @param id 鐢ㄦ埛ID * @return 鏄惁鎴愬姛 */ @@ -284,21 +384,21 @@ }) @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE) @SsoAop("-1")//@SsoAop(power = "-1") - public BaseResponse<Boolean> delete(@Parameter(description = "瀹炰綋id", required = true) String id){ - if(id == null){ - return BaseResponseUtils.buildFail("id涓嶈兘涓虹┖") ; + public BaseResponse<Boolean> delete(@Parameter(description = "瀹炰綋id", required = true) String id) { + if (id == null) { + return BaseResponseUtils.buildFail("id涓嶈兘涓虹┖"); } int count; try { count = this.sv.delete(Long.parseLong(id)); } catch (Exception e) { log.error("淇濆瓨鐢ㄦ埛寮傚父", e); - return BaseResponseUtils.buildException(e.getMessage()) ; + return BaseResponseUtils.buildException(e.getMessage()); } - if(count <= 0){ - return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�") ; - }else{ - return BaseResponseUtils.buildSuccess(true) ; + if (count <= 0) { + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�"); + } else { + return BaseResponseUtils.buildSuccess(true); } } } diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java index eb95297..b226a95 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java @@ -7,14 +7,14 @@ import com.dy.pipIrrGlobal.pojoBa.BaUser; import com.dy.pipIrrGlobal.pojoBa.BaUserRole; import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.common.utils.PojoUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; - -import org.apache.dubbo.common.utils.PojoUtils ; -import org.springframework.transaction.annotation.Transactional; +import java.util.Random; @Slf4j @Service @@ -24,98 +24,146 @@ private BaUserRoleMapper urDao; @Autowired - private void setDao(BaUserMapper dao){ + private void setDao(BaUserMapper dao) { this.dao = dao; } @Autowired - private void setDao(BaUserRoleMapper dao){ + private void setDao(BaUserRoleMapper dao) { this.urDao = dao; } /** * 寰楀埌涓�涓敤鎴� + * * @param id 鐢ㄦ埛ID * @return 鐢ㄦ埛瀹炰綋 */ - public BaUser selectById(Long id){ - return this.dao.selectById(id) ; + public BaUser selectById(Long id) { + return this.dao.selectById(id); } /** * 寰楀埌涓�涓敤鎴� + * * @param vo 鏌ヨ鏉′欢鍊煎璞� * @return 鐢ㄦ埛瀹炰綋 */ @SuppressWarnings("unchecked") - public QueryResultVo<List<BaUser>> selectSome(QueryVo vo){ - Map<String, Object> params = (Map<String, Object>)PojoUtils.generalize(vo) ; - Long itemTotal = this.dao.selectTotal(params) ; + public QueryResultVo<List<BaUser>> selectSome(QueryVo vo) { + Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo); + Long itemTotal = this.dao.selectTotal(params); - QueryResultVo<List<BaUser>> rsVo = new QueryResultVo<>() ; - rsVo.pageSize = vo.pageSize ; - rsVo.pageCurr = vo.pageCurr ; + QueryResultVo<List<BaUser>> rsVo = new QueryResultVo<>(); + rsVo.pageSize = vo.pageSize; + rsVo.pageCurr = vo.pageCurr; rsVo.calculateAndSet(itemTotal, params); - rsVo.obj = this.dao.selectSome(params) ; + rsVo.obj = this.dao.selectSome(params); - return rsVo ; + return rsVo; } /** * 淇濆瓨瀹炰綋 + * * @param po 瀹炰綋 * @return 褰卞搷璁板綍鏁伴噺 */ @Transactional - public int save(BaUser po){ - return this.dao.insert(po) ; + public int save(BaUser po) { + return this.dao.insert(po); } /** * 淇濆瓨淇敼瀹炰綋 + * * @param po 瀹炰綋 * @return 褰卞搷璁板綍鏁伴噺 */ @Transactional - public int update(BaUser po){ - return this.dao.updateByPrimaryKeySelective(po) ; + public int update(BaUser po) { + return this.dao.updateByPrimaryKeySelective(po); } /** * 淇敼瀵嗙爜 - * @param id 鐢ㄦ埛ID + * + * @param id 鐢ㄦ埛ID * @param password 鏂板瘑鐮� * @return 褰卞搷璁板綍鏁伴噺 */ - public int changePassword(Long id, String password){ - return this.dao.changePassword(id, password) ; + public int changePassword(Long id, String password) { + return this.dao.changePassword(id, password); } /** * 璁剧疆鐢ㄦ埛瑙掕壊 - * @param userId 鐢ㄦ埛id + * + * @param userId 鐢ㄦ埛id * @param roleIds 閫夋嫨鐨勮鑹瞚d闆嗗悎 * @return 鎻掑叆鐢ㄦ埛涓庤鑹插叧鑱旇褰曟暟閲� */ - public int setRoles(Long userId, Long[] roleIds){ - this.urDao.deleteByUserId(userId) ; - int count = 0 ; - if(roleIds != null && roleIds.length > 0){ - for(Long roleId : roleIds){ - count += this.urDao.insertSelective(new BaUserRole(userId,roleId)) ; + public int setRoles(Long userId, Long[] roleIds) { + this.urDao.deleteByUserId(userId); + int count = 0; + if (roleIds != null && roleIds.length > 0) { + for (Long roleId : roleIds) { + count += this.urDao.insertSelective(new BaUserRole(userId, roleId)); } } - return count ; + return count; + } + + /** + * 璁剧疆鐢ㄦ埛瑙掕壊 + * + * @param userId 鐢ㄦ埛id + * @param roleIds 閫夋嫨鐨勮鑹瞚d闆嗗悎 + * @return 鎻掑叆鐢ㄦ埛涓庤鑹插叧鑱旇褰曟暟閲� + */ + public int setRoles(String userId, String[] roleIds) { + this.urDao.deleteByUserId(Long.parseLong(userId)); + int count = 0; + if (roleIds != null && roleIds.length > 0) { + for (String roleId : roleIds) { + count += this.urDao.insertSelective(new BaUserRole(Long.parseLong(userId), Long.parseLong(roleId))); + } + } + return count; } /** * 淇濆瓨淇敼瀹炰綋 + * * @param id 瀹炰綋ID * @return 褰卞搷璁板綍鏁伴噺 */ @Transactional - public int delete(Long id){ - return this.dao.deleteLogicById(id) ; + public int delete(Long id) { + return this.dao.deleteLogicById(id); } + + /** + * 鐢熸垚鎸囧畾浣嶆暟闅忔満鏁板瓧瀵嗙爜 + * + * @param length 澶氶暱闅忔満鏁� + * @return 闅忔満鏁� + */ + public String getStringRandom(int length) { + String val = ""; + Random random = new Random(); + for (int i = 0; i < length; i++) { + String charOrNum = random.nextInt(2) % 2 == 0 ? "char" : "num"; + if ("char".equalsIgnoreCase(charOrNum)) { + int temp = random.nextInt(2) % 2 == 0 ? 65 : 97; + val += (char) (random.nextInt(26) + temp); + } else if ("num".equalsIgnoreCase(charOrNum)) { + val += String.valueOf(random.nextInt(10)); + } + } + return val; + } + + } diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/resources/application.yml b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/resources/application.yml index 9639536..2162083 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/resources/application.yml +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/resources/application.yml @@ -1,6 +1,8 @@ spring: profiles: include: global, database, database-ym, database-pj +user: + defaultPassword: "ABC123" #actutor鐨剋eb绔彛 management: diff --git a/pipIrr-platform/pom.xml b/pipIrr-platform/pom.xml index 9479a41..bc6e48a 100644 --- a/pipIrr-platform/pom.xml +++ b/pipIrr-platform/pom.xml @@ -44,8 +44,15 @@ <mapstruct.version>1.5.5.Final</mapstruct.version> <hutool-all.version>5.8.22</hutool-all.version> <org-jdom2.version>2.0.6.1</org-jdom2.version> - <compiler-plugin.version>3.11.0</compiler-plugin.version> - <surefire-plugin.version>3.0.0</surefire-plugin.version> + + <spring-boot-maven-plugin.version>3.2.0</spring-boot-maven-plugin.version> + <maven-jar-plugin-plugin.version>3.3.0</maven-jar-plugin-plugin.version> + <maven-dependency-plugin.version>3.5.0</maven-dependency-plugin.version> + <maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version> + <maven-resources-plugin.version>3.3.1</maven-resources-plugin.version> + <maven-surefire-plugin.version>3.0.0</maven-surefire-plugin.version> + <maven-bundle-plugin.version>5.1.9</maven-bundle-plugin.version> + <encoding>UTF-8</encoding> </properties> @@ -243,14 +250,7 @@ <dependency> <groupId>org.apache.mina</groupId> <artifactId>mina-core</artifactId> - <version>2.2.1</version> - <type>pom</type> - <scope>import</scope> - </dependency> - <dependency> - <groupId>org.apache.mina</groupId> - <artifactId>mina-filter-compression</artifactId> - <version>2.2.1</version> + <version>2.2.2</version> <type>pom</type> <scope>import</scope> </dependency> @@ -297,36 +297,68 @@ <!-- spring boot鎻愪緵鐨刴aven鎵撳寘鎻掍欢 --> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> - <version>3.1.3</version> + <version>${spring-boot-maven-plugin.version}</version> + </plugin> + <plugin> + <!-- 璇ユ彃浠朵笉浼氬皢椤圭洰涓紩鍏ョ殑渚濊禆鎵撹繘鏈�缁堢殑 Jar 鏂囦欢 --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>${maven-jar-plugin-plugin.version}</version> + </plugin> + <plugin> + <!-- 褰撻」鐩腑渚濊禆姣旇緝澶氭椂锛屾垜浠彲浠ュ�熷姪 maven-dependency-plugin 鎻掍欢鑷姩甯垜浠笅杞戒緷璧栫殑 Jar 鏂囦欢锛屾帹鑽愬皢璇ユ彃浠剁粦瀹氬埌package鐢熷懡鍛ㄦ湡涓� --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <version>${maven-dependency-plugin.version}</version> + <executions> + <execution> + <!-- 缁戝畾鐢熷懡鍛ㄦ湡 --> + <phase>package</phase> + <goals> + <goal>copy-dependencies</goal> + </goals> + <!-- 璁剧疆渚濊禆鐨勫瓨鏀捐矾寰� --> + <configuration> + <outputDirectory>${project.build.directory}/lib</outputDirectory> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <!-- 璁剧疆java缂栬瘧鐗堟湰锛岃繍琛岀幆澧冪増鏈� --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>${maven-compiler-plugin.version}</version> + <!-- source锛� 婧愪唬鐮佺紪璇戠増鏈紱target锛� 鐩爣骞冲彴缂栬瘧鐗堟湰锛沞ncoding锛� 瀛楃闆嗙紪鐮併�� --> <configuration> - <excludes> - <exclude> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - </exclude> - </excludes> + <source>${java.version}</source> + <target>${java.version}</target> + <encoding>${encoding}</encoding> + </configuration> + </plugin> + <plugin> + <!-- 瑙e喅璧勬簮鏂囦欢鐨勭紪鐮侀棶棰� --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <version>${maven-resources-plugin.version}</version> + <configuration> + <encoding>${encoding}</encoding> </configuration> </plugin> <plugin> <!-- maven閲屾墽琛屾祴璇曠敤渚嬬殑鎻掍欢 --> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> - <version>3.0.0</version> - <configuration> - <skipTests>true</skipTests> - </configuration> + <version>${maven-surefire-plugin.version}</version> </plugin> <plugin> - <!-- 寮哄埗璁惧畾 java缂栬瘧鐗堟湰锛岃繍琛岀幆澧冪増鏈� --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>${compiler-plugin.version}</version> - <configuration> - <source>20</source> - <target>20</target> - </configuration> + <!-- 涓嬮潰瑙e喅锛氬綋杩涜Maven Lifecycle package鏃舵姤閿欙細Could not find artifact org.apache.mina:mina-core:bundle:2.2.1 in maven (https://repo1.maven.org/maven2/)--> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <version>${maven-bundle-plugin.version}</version> + <extensions>true</extensions> </plugin> </plugins> </pluginManagement> </build> -</project> \ No newline at end of file +</project> -- Gitblit v1.8.0