diff --git a/builds/Dockerfile b/builds/Dockerfile new file mode 100644 index 000000000..995db64f9 --- /dev/null +++ b/builds/Dockerfile @@ -0,0 +1,20 @@ +FROM registry.cn-hangzhou.aliyuncs.com/lrh-public/openjdk:8u222-jre-up + +LABEL Author="axzsd" \ + Email="atva725@qq.com" \ + Description="创盈支付服务端" + +ENV SPRING_PROFILES_ACTIVE="dev" +ENV JAVA_OPTIONS "-Xms800m -Xmx800m \ +-XX:+HeapDumpOnOutOfMemoryError \ +-Dfile.encoding=UTF-8 \ +-Djava.awt.headless=true \ +-Dsun.net.client.defaultConnectTimeout=10000 \ +-Dsun.net.client.defaultReadTimeout=30000" + + +WORKDIR /work/projects/yudao-server +COPY yudao-server/target/yudao-server.jar /opt/app.jar + +EXPOSE 48080 +ENTRYPOINT exec java $JAVA_OPTIONS -jar -Dspring.profiles.active=${SPRING_PROFILES_ACTIVE} /opt/app.jar diff --git a/builds/Jenkinsfile b/builds/Jenkinsfile new file mode 100644 index 000000000..9f4a8b3f9 --- /dev/null +++ b/builds/Jenkinsfile @@ -0,0 +1,45 @@ +pipeline { + agent any + + environment { + INTRANET_REGISTRY='192.168.1.124:10083' + PUBLIC_REGISTRY='192.168.1.124:10083' + IMAGE_NAMESPACE='cmx' + IMAGE_NAME='yudao-server-api' + GIT_BRANCH='feature/mall_product' + Dockerfile='builds/Dockerfile' + DockerComposefile='docker-compose-test.yml' + } + + + stages { + stage('Pull Code') { + steps { + checkout([$class: 'GitSCM', branches: [[name: "$GIT_BRANCH"]], extensions: [cloneOption(depth: 1, noTags: true, reference: '', shallow: true)], userRemoteConfigs: [[credentialsId: 'Hx-Deploy-Git', url: 'http://117.33.142.185:3000/zenghuapei/cyywl_server.git']]]) + } + } + + stage('compile & buildImage->push') { + steps { + withMaven(maven: 'M3') { + sh 'mvn clean package -Dmaven.test.skip=true' + } + withCredentials([usernamePassword(credentialsId: 'HxDockerRepo', passwordVariable: 'DOCKER_PASSWORD', usernameVariable: 'DOCKER_USERNAME')]) { + sh 'docker build -f $Dockerfile -t $INTRANET_REGISTRY/$IMAGE_NAMESPACE/$IMAGE_NAME:$BUILD_ID .' + sh 'echo "push start..."' + sh 'docker push $INTRANET_REGISTRY/$IMAGE_NAMESPACE/$IMAGE_NAME:$BUILD_ID' + } + } + } + + stage('SSH Deploy') { + steps { + withCredentials([sshUserPrivateKey(credentialsId: 'halo-test-ssh', keyFileVariable: 'primaryKeyVar', usernameVariable: 'userVar')]) { + sh 'ssh -i ${primaryKeyVar} root@36.41.184.13 "curl -s https://cmx.bskies.cc:8000/shell/deploy/init_work_dir.sh | bash -s /opt/app/${IMAGE_NAME}"' + sh 'scp -i ${primaryKeyVar} builds/${DockerComposefile} root@36.41.184.13:/opt/app/${IMAGE_NAME}' + sh 'ssh -i ${primaryKeyVar} root@36.41.184.13 "curl -s https://cmx.bskies.cc:8000/shell/deploy/docker_deploy.sh | bash -s /opt/app/${IMAGE_NAME} $PUBLIC_REGISTRY/$IMAGE_NAMESPACE/$IMAGE_NAME:$BUILD_ID /opt/app/${IMAGE_NAME}/$DockerComposefile"' + } + } + } + } +} \ No newline at end of file diff --git a/builds/docker-compose-test.yml b/builds/docker-compose-test.yml new file mode 100644 index 000000000..267950ae4 --- /dev/null +++ b/builds/docker-compose-test.yml @@ -0,0 +1,28 @@ +version: "3.9" +services: + yudao-server: + image: ${IMAGE_VERSION} + restart: always + privileged: true + container_name: yudao-server + environment: + TZ: Asia/Shanghai + SPRING_PROFILES_ACTIVE: test +# volumes: +# - /opt/logs/cyywl:/work/projects/yudao-server + ulimits: + nproc: 65535 + nofile: + soft: 20000 + hard: 40000 + ports: + - "48080:48080" + deploy: + resources: + limits: + memory: 800MB + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:48080/cyyywl-api/actuator/health"] + timeout: 30s + interval: 45s + retries: 3 \ No newline at end of file diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/UserTypeEnum.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/UserTypeEnum.java index c950c529d..46d59b1d3 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/UserTypeEnum.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/UserTypeEnum.java @@ -15,7 +15,8 @@ import java.util.Arrays; public enum UserTypeEnum implements IntArrayValuable { MEMBER(1, "会员"), // 面向 c 端,普通用户 - ADMIN(2, "管理员"); // 面向 b 端,管理后台 + ADMIN(2, "管理员"), // 面向 b 端,管理后台 + PROMOTER(3, "推广员"); // 面向 c 端,普通用户 public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(UserTypeEnum::getValue).toArray(); diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppUserInfoRespVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppUserInfoRespVO.java index ef0c3193b..8a11fad60 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppUserInfoRespVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppUserInfoRespVO.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.member.controller.app.user.vo; +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; @@ -19,4 +20,7 @@ public class AppUserInfoRespVO { @Schema(description = "用户手机号", required = true, example = "15601691300") private String mobile; + + @Schema(description = "用户类型", required = true, example = "15601691300") + private UserTypeEnum userType; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantBaseVO.java index b690c4bc0..bc88b3efe 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantBaseVO.java @@ -70,7 +70,6 @@ public class TenantBaseVO { * 销售负责人 */ @Schema(description = "销售负责人", example = "https://www.iocoder.cn") - @NotEmpty(message = "销售负责人不能为空") @Length( max = 10, message = "销售负责人长度为 {max}位") private String saleContactName; @@ -78,7 +77,6 @@ public class TenantBaseVO { * 销售负责人联系电话 */ @Schema(description = "销售负责人联系电话", example = "https://www.iocoder.cn") - @NotEmpty(message = "销售负责人不能为空") @Mobile( message = "销售负责人联系电话不正确") private String saleContactMobile; @@ -90,4 +88,11 @@ public class TenantBaseVO { @Length( max = 300, message = "微信客服地址长度为 {max}位") private String wxKfUrl; + /** + * 通知公告 + */ + @Schema(description = "通知公告", example = "https://www.iocoder.cn") + @Length( max =1000, message = "通知公告长度为 {max}位") + private String notice; + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/tenant/TenantDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/tenant/TenantDO.java index b3cca2d31..2eb6f7e6d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/tenant/TenantDO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/tenant/TenantDO.java @@ -108,6 +108,10 @@ public class TenantDO extends BaseDO { * 微信客服地址 */ private String wxKfUrl; + /** + * 通知公告 + */ + private String notice; diff --git a/yudao-server/src/main/resources/application-dev.yaml b/yudao-server/src/main/resources/application-dev.yaml index 237547c77..cc95bc1ea 100644 --- a/yudao-server/src/main/resources/application-dev.yaml +++ b/yudao-server/src/main/resources/application-dev.yaml @@ -1,5 +1,7 @@ server: port: 48080 + servlet: + context-path: /cyyywl-api --- #################### 数据库相关配置 #################### @@ -156,7 +158,31 @@ wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-sta type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取 key-prefix: wa # Redis Key 的前缀 TODO 芋艿:解决下 Redis key 管理的配置 http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台 - + pay: + one: + enabled: true + app-id: wxb1826c88da21d81e + mch-id: 1641993417 + mch-key: qdn2I7Cmx4JeiKOt2CDjiu6UHgLTsOsM + apiv3-key: cyywl666666cyywl888888cyywl66666 + private-cert-path: classpath:/1/apiclient_cert.pem + private-key-path: classpath:/1/apiclient_key.pem + key-path: classpath:/1/apiclient_cert.p12 + cert-serial-no: 58FDB503F92B6C0E258C9940BB726C2BF6022E56 + notify-url: http://yuxy.perrymake.com/app-api/pay/wxpay/pay_notify + refund-notify-url: http://yuxy.perrymake.com/app-api/pay/wxpay/refund_notify + two: + enabled: true + app-id: wxb1826c88da21d81e + mch-id: 1642042589 + mch-key: qdn2I7Cmx4JeiKOt2CDjiu6UHgLTsOsM + apiv3-key: cyywl666666cyywl888888cyywl66666 + private-cert-path: classpath:/2/apiclient_cert.pem + private-key-path: classpath:/2/apiclient_key.pem + key-path: classpath:/2/apiclient_cert.p12 + cert-serial-no: 47F04D51F958FFEF56A6DFC25BDE83CF89353E19 + notify-url: http://yuxy.perrymake.com/app-api/pay/wxpay/pay_notify + refund-notify-url: http://yuxy.perrymake.com/app-api/pay/wxpay/refund_notify --- #################### 芋道相关配置 #################### # 芋道配置项,设置当前项目所有自定义的配置 diff --git a/yudao-server/src/main/resources/application.yaml b/yudao-server/src/main/resources/application.yaml index de757f06e..32eea5598 100644 --- a/yudao-server/src/main/resources/application.yaml +++ b/yudao-server/src/main/resources/application.yaml @@ -3,7 +3,7 @@ spring: name: yudao-server profiles: - active: dev + active: local main: allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。