diff --git a/.drone.yml b/.drone.yml index bb56727..b6718ec 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,31 +1,31 @@ kind: pipeline # 定义对象类型,还有secret和signature两种类型 - + type: docker # 定义流水线类型,还有kubernetes、exec、ssh等类型 - + name: filesystem-drone # 定义流水线名称 - + clone: disable: true steps: # 定义流水线执行步骤,这些步骤将顺序执行 - name: package-and-push-image - + image: appleboy/drone-ssh # SSH工具镜像 - + settings: - + host: 101.43.112.107 # 远程连接地址 - + username: root # 远程连接账号 - - password: - + + password: + from_secret: ssh_password # 从Secret中读取SSH密码 - + port: 22 # 远程连接端口 - + command_timeout: 5m # 远程执行命令超时时间 - + script: - cd /root/allLikeMall - git fetch origin @@ -36,34 +36,34 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行 - chmod +x push.sh - ./push.sh - scp run.sh root@1.14.205.126:/zymail/build -# - ls -# - scp -r /zymail/maven/build root@1.14.205.126:/zymail -# - ssh root@1.14.205.126 -# - ls - -# - chmod +x run.sh # 更改为可执行脚本 - -# - ./run.sh # 运行脚本打包应用镜像并运行 + # - ls + # - scp -r /zymail/maven/build root@1.14.205.126:/zymail + # - ssh root@1.14.205.126 + # - ls + + # - chmod +x run.sh # 更改为可执行脚本 + + # - ./run.sh # 运行脚本打包应用镜像并运行 - name: build-start - + image: appleboy/drone-ssh # SSH工具镜像 - + settings: - + host: 1.14.205.126 # 远程连接地址 - + username: root # 远程连接账号 - - password: - + + password: + from_secret: ssh_password # 从Secret中读取SSH密码 - + port: 22 # 远程连接端口 - + command_timeout: 5m # 远程执行命令超时时间 - + script: -# - ls + # - ls - cd /zymail/build - chmod +x run.sh # 更改为可执行脚本 - ./run.sh # 运行脚本打包应用镜像并运行 diff --git a/script/docker/docker-compose.yml b/script/docker/docker-compose.yml index e440d96..b7b13ad 100644 --- a/script/docker/docker-compose.yml +++ b/script/docker/docker-compose.yml @@ -39,9 +39,9 @@ services: SPRING_PROFILES_ACTIVE: local JAVA_OPTS: ${JAVA_OPTS:- - -Xms512m - -Xmx512m - -Djava.security.egd=file:/dev/./urandom + -Xms512m + -Xmx512m + -Djava.security.egd=file:/dev/./urandom } ARGS: --spring.datasource.dynamic.datasource.master.url=${MASTER_DATASOURCE_URL:-jdbc:mysql://yudao-mysql:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true} diff --git a/script/idea/http-client.env.json b/script/idea/http-client.env.json index 4a4cb52..c964820 100644 --- a/script/idea/http-client.env.json +++ b/script/idea/http-client.env.json @@ -3,7 +3,6 @@ "baseUrl": "http://127.0.0.1:48080/admin-api", "token": "test1", "adminTenentId": "1", - "appApi": "http://127.0.0.1:48080/app-api", "appToken": "test247", "appTenentId": "1" @@ -12,7 +11,6 @@ "baseUrl": "http://127.0.0.1:8888/admin-api", "token": "test1", "adminTenentId": "1", - "appApi": "http://127.0.0.1:8888/app-api", "appToken": "test1", "appTenantId": "1" diff --git a/script/jenkins/Jenkinsfile b/script/jenkins/Jenkinsfile index 91842b3..43761aa 100644 --- a/script/jenkins/Jenkinsfile +++ b/script/jenkins/Jenkinsfile @@ -50,7 +50,7 @@ pipeline { stage('部署') { steps { sh 'cp -f ' + ' bin/deploy.sh ' + "${env.APP_DEPLOY_BASE_DIR}" + "${env.APP_NAME}" - sh 'cp -f ' + "${env.APP_NAME}" + '/target/*.jar ' + "${env.APP_DEPLOY_BASE_DIR}" + "${env.APP_NAME}" +'/build/' + sh 'cp -f ' + "${env.APP_NAME}" + '/target/*.jar ' + "${env.APP_DEPLOY_BASE_DIR}" + "${env.APP_NAME}" + '/build/' archiveArtifacts "${env.APP_NAME}" + '/target/*.jar' sh 'chmod +x ' + "${env.APP_DEPLOY_BASE_DIR}" + "${env.APP_NAME}" + '/deploy.sh' sh 'bash ' + "${env.APP_DEPLOY_BASE_DIR}" + "${env.APP_NAME}" + '/deploy.sh' diff --git a/sql/dm/flowable-patch/src/main/java/liquibase/database/core/DmDatabase.java b/sql/dm/flowable-patch/src/main/java/liquibase/database/core/DmDatabase.java index fbc4c6b..495aa32 100644 --- a/sql/dm/flowable-patch/src/main/java/liquibase/database/core/DmDatabase.java +++ b/sql/dm/flowable-patch/src/main/java/liquibase/database/core/DmDatabase.java @@ -15,6 +15,7 @@ import java.util.Properties; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; + import liquibase.CatalogAndSchema; import liquibase.Scope; import liquibase.database.AbstractJdbcDatabase; @@ -63,7 +64,7 @@ public class DmDatabase extends AbstractJdbcDatabase { */ @Override public String getDefaultDriver(String url) { - if(url.startsWith("jdbc:dm")) { + if (url.startsWith("jdbc:dm")) { return "dm.jdbc.driver.DmDriver"; } @@ -435,10 +436,10 @@ public class DmDatabase extends AbstractJdbcDatabase { "USLOG$", "SYS_FBA")); - for (int i = 0;i * If true (default), the {@link AbstractEngineConfiguration#getDatabaseSchemaUpdate()} value will be used to determine what needs to happen wrt the database schema. - * + *

* If false, no validation or schema creation will be done. That means that the database schema must have been created 'manually' before but the engine does not validate whether the schema is * correct. The {@link AbstractEngineConfiguration#getDatabaseSchemaUpdate()} value will not be used. */ @@ -287,7 +289,7 @@ public abstract class AbstractEngineConfiguration { /** * Escape character for doing wildcard searches. - * + *

* This will be added at then end of queries that include for example a LIKE clause. For example: SELECT * FROM table WHERE column LIKE '%\%%' ESCAPE '\'; */ protected String databaseWildcardEscapeCharacter; @@ -624,7 +626,7 @@ public abstract class AbstractEngineConfiguration { if (commandContextFactory != null) { String engineCfgKey = getEngineCfgKey(); CommandContextInterceptor commandContextInterceptor = new CommandContextInterceptor(commandContextFactory, - classLoader, useClassForNameClassLoading, clock, objectMapper); + classLoader, useClassForNameClassLoading, clock, objectMapper); engineConfigurations.put(engineCfgKey, this); commandContextInterceptor.setEngineCfgKey(engineCfgKey); commandContextInterceptor.setEngineConfigurations(engineConfigurations); @@ -956,8 +958,8 @@ public abstract class AbstractEngineConfiguration { } public void initCustomMybatisInterceptors(Configuration configuration) { - if (customMybatisInterceptors!=null){ - for (Interceptor interceptor :customMybatisInterceptors){ + if (customMybatisInterceptors != null) { + for (Interceptor interceptor : customMybatisInterceptors) { configuration.addInterceptor(interceptor); } } @@ -1594,7 +1596,7 @@ public abstract class AbstractEngineConfiguration { public AbstractEngineConfiguration setCustomMybatisInterceptors(List customMybatisInterceptors) { this.customMybatisInterceptors = customMybatisInterceptors; - return this; + return this; } public List getCustomMybatisInterceptors() { diff --git a/sql/tools/docker-compose.yaml b/sql/tools/docker-compose.yaml index d6f615d..ece9577 100644 --- a/sql/tools/docker-compose.yaml +++ b/sql/tools/docker-compose.yaml @@ -1,126 +1,126 @@ name: ruoyi-vue-pro volumes: - mysql: { } - postgres: { } - sqlserver: { } - dm8: { } - kingbase: { } - opengauss: { } + mysql: { } + postgres: { } + sqlserver: { } + dm8: { } + kingbase: { } + opengauss: { } services: - mysql: - image: mysql:8.0.33 - restart: unless-stopped - environment: - TZ: Asia/Shanghai - MYSQL_ROOT_PASSWORD: 123456 - MYSQL_DATABASE: ruoyi-vue-pro - ports: - - "3306:3306" - volumes: - - mysql:/var/lib/mysql/ - # 注入初始化脚本 - - ./mysql/ruoyi-vue-pro.sql:/docker-entrypoint-initdb.d/init.sql:ro - command: - --default-authentication-plugin=mysql_native_password - --character-set-server=utf8mb4 - --collation-server=utf8mb4_general_ci - --explicit_defaults_for_timestamp=true - --lower_case_table_names=1 + mysql: + image: mysql:8.0.33 + restart: unless-stopped + environment: + TZ: Asia/Shanghai + MYSQL_ROOT_PASSWORD: 123456 + MYSQL_DATABASE: ruoyi-vue-pro + ports: + - "3306:3306" + volumes: + - mysql:/var/lib/mysql/ + # 注入初始化脚本 + - ./mysql/ruoyi-vue-pro.sql:/docker-entrypoint-initdb.d/init.sql:ro + command: + --default-authentication-plugin=mysql_native_password + --character-set-server=utf8mb4 + --collation-server=utf8mb4_general_ci + --explicit_defaults_for_timestamp=true + --lower_case_table_names=1 - postgres: - image: postgres:14.2 - restart: unless-stopped - environment: - POSTGRES_USER: root - POSTGRES_PASSWORD: 123456 - POSTGRES_DB: ruoyi-vue-pro - ports: - - "5432:5432" - volumes: - - postgres:/var/lib/postgresql/data - # 注入初始化脚本 - - ../postgresql/quartz.sql:/docker-entrypoint-initdb.d/quartz.sql:ro - - ../postgresql/ruoyi-vue-pro.sql:/docker-entrypoint-initdb.d/ruoyi-vue-pro.sql:ro + postgres: + image: postgres:14.2 + restart: unless-stopped + environment: + POSTGRES_USER: root + POSTGRES_PASSWORD: 123456 + POSTGRES_DB: ruoyi-vue-pro + ports: + - "5432:5432" + volumes: + - postgres:/var/lib/postgresql/data + # 注入初始化脚本 + - ../postgresql/quartz.sql:/docker-entrypoint-initdb.d/quartz.sql:ro + - ../postgresql/ruoyi-vue-pro.sql:/docker-entrypoint-initdb.d/ruoyi-vue-pro.sql:ro - oracle: - image: gvenzl/oracle-xe:18-slim-faststart - restart: unless-stopped - environment: - ## 登录信息 SID: XE user: system password: oracle - ORACLE_PASSWORD: oracle - ports: - - "1521:1521" - volumes: - - ../oracle/ruoyi-vue-pro.sql:/tmp/schema.sql:ro - # 创建app用户: ROOT/123456@//localhost/XEPDB1 - - ./oracle/1_create_user.sql:/docker-entrypoint-initdb.d/1_create_user.sql:ro - - ./oracle/2_create_schema.sh:/docker-entrypoint-initdb.d/2_create_schema.sh:ro + oracle: + image: gvenzl/oracle-xe:18-slim-faststart + restart: unless-stopped + environment: + ## 登录信息 SID: XE user: system password: oracle + ORACLE_PASSWORD: oracle + ports: + - "1521:1521" + volumes: + - ../oracle/ruoyi-vue-pro.sql:/tmp/schema.sql:ro + # 创建app用户: ROOT/123456@//localhost/XEPDB1 + - ./oracle/1_create_user.sql:/docker-entrypoint-initdb.d/1_create_user.sql:ro + - ./oracle/2_create_schema.sh:/docker-entrypoint-initdb.d/2_create_schema.sh:ro - sqlserver: - image: mcr.microsoft.com/mssql/server:2017-latest - restart: unless-stopped - environment: - TZ: Asia/Shanghai - ACCEPT_EULA: "Y" - SA_PASSWORD: "Yudao@2024" - ports: - - "1433:1433" - volumes: - - sqlserver:/var/opt/mssql - - ../sqlserver/ruoyi-vue-pro.sql:/tmp/schema.sql:ro - # docker compose exec sqlserver bash /tmp/create_schema.sh - - ./sqlserver/create_schema.sh:/tmp/create_schema.sh:ro + sqlserver: + image: mcr.microsoft.com/mssql/server:2017-latest + restart: unless-stopped + environment: + TZ: Asia/Shanghai + ACCEPT_EULA: "Y" + SA_PASSWORD: "Yudao@2024" + ports: + - "1433:1433" + volumes: + - sqlserver:/var/opt/mssql + - ../sqlserver/ruoyi-vue-pro.sql:/tmp/schema.sql:ro + # docker compose exec sqlserver bash /tmp/create_schema.sh + - ./sqlserver/create_schema.sh:/tmp/create_schema.sh:ro - dm8: - # wget https://download.dameng.com/eco/dm8/dm8_20230808_rev197096_x86_rh6_64_single.tar - # docker load -i dm8_20230808_rev197096_x86_rh6_64_single.tar - image: dm8_single:dm8_20230808_rev197096_x86_rh6_64 - restart: unless-stopped - environment: - PAGE_SIZE: 16 - LD_LIBRARY_PATH: /opt/dmdbms/bin - EXTENT_SIZE: 32 - BLANK_PAD_MODE: 1 - LOG_SIZE: 1024 - UNICODE_FLAG: 1 - LENGTH_IN_CHAR: 1 - INSTANCE_NAME: dm8_test - ports: - - "5236:5236" - volumes: - - dm8:/opt/dmdbms/data - - ../dm/ruoyi-vue-pro-dm8.sql:/tmp/schema.sql:ro - # docker compose exec dm8 bash -c '/opt/dmdbms/bin/disql SYSDBA/SYSDBA001 \`/tmp/schema.sql' + dm8: + # wget https://download.dameng.com/eco/dm8/dm8_20230808_rev197096_x86_rh6_64_single.tar + # docker load -i dm8_20230808_rev197096_x86_rh6_64_single.tar + image: dm8_single:dm8_20230808_rev197096_x86_rh6_64 + restart: unless-stopped + environment: + PAGE_SIZE: 16 + LD_LIBRARY_PATH: /opt/dmdbms/bin + EXTENT_SIZE: 32 + BLANK_PAD_MODE: 1 + LOG_SIZE: 1024 + UNICODE_FLAG: 1 + LENGTH_IN_CHAR: 1 + INSTANCE_NAME: dm8_test + ports: + - "5236:5236" + volumes: + - dm8:/opt/dmdbms/data + - ../dm/ruoyi-vue-pro-dm8.sql:/tmp/schema.sql:ro + # docker compose exec dm8 bash -c '/opt/dmdbms/bin/disql SYSDBA/SYSDBA001 \`/tmp/schema.sql' - kingbase: - # x86_64: https://kingbase.oss-cn-beijing.aliyuncs.com/KESV8R3/V009R001C001B0025-安装包-docker/x86_64/kdb_x86_64_V009R001C001B0025.tar - # aarch64: https://kingbase.oss-cn-beijing.aliyuncs.com/KESV8R3/V009R001C001B0025-安装包-docker/aarch64/kdb_aarch64_V009R001C001B0025.tar - # docker load -i kdb_x86_64_V009R001C001B0025.tar - image: kingbase_v009r001c001b0025_single_x86:v1 - restart: unless-stopped - environment: - DB_USER: root - DB_PASSWORD: 123456 - ports: - - "54321:54321" - volumes: - - kingbase:/home/kingbase/userdata - - ../kingbase/ruoyi-vue-pro.sql:/tmp/schema.sql:ro - # docker compose exec kingbase bash -c 'ksql -U $DB_USER -d test -f /tmp/schema.sql' + kingbase: + # x86_64: https://kingbase.oss-cn-beijing.aliyuncs.com/KESV8R3/V009R001C001B0025-安装包-docker/x86_64/kdb_x86_64_V009R001C001B0025.tar + # aarch64: https://kingbase.oss-cn-beijing.aliyuncs.com/KESV8R3/V009R001C001B0025-安装包-docker/aarch64/kdb_aarch64_V009R001C001B0025.tar + # docker load -i kdb_x86_64_V009R001C001B0025.tar + image: kingbase_v009r001c001b0025_single_x86:v1 + restart: unless-stopped + environment: + DB_USER: root + DB_PASSWORD: 123456 + ports: + - "54321:54321" + volumes: + - kingbase:/home/kingbase/userdata + - ../kingbase/ruoyi-vue-pro.sql:/tmp/schema.sql:ro + # docker compose exec kingbase bash -c 'ksql -U $DB_USER -d test -f /tmp/schema.sql' - opengauss: - image: opengauss/opengauss:5.0.0 - restart: unless-stopped - environment: - GS_USERNAME: root - GS_PASSWORD: Yudao@2024 - LD_LIBRARY_PATH: /usr/local/opengauss/lib:/usr/lib - ports: - - "5432:5432" - volumes: - - opengauss:/var/lib/opengauss - - ../opengauss/ruoyi-vue-pro.sql:/tmp/schema.sql:ro - # docker compose exec opengauss bash -c '/usr/local/opengauss/bin/gsql -U $GS_USERNAME -W $GS_PASSWORD -d postgres -f /tmp/schema.sql' \ No newline at end of file + opengauss: + image: opengauss/opengauss:5.0.0 + restart: unless-stopped + environment: + GS_USERNAME: root + GS_PASSWORD: Yudao@2024 + LD_LIBRARY_PATH: /usr/local/opengauss/lib:/usr/lib + ports: + - "5432:5432" + volumes: + - opengauss:/var/lib/opengauss + - ../opengauss/ruoyi-vue-pro.sql:/tmp/schema.sql:ro + # docker compose exec opengauss bash -c '/usr/local/opengauss/bin/gsql -U $GS_USERNAME -W $GS_PASSWORD -d postgres -f /tmp/schema.sql' \ No newline at end of file diff --git a/yudao-admin-vue3/src/api/ai/chat/conversation/index.ts b/yudao-admin-vue3/src/api/ai/chat/conversation/index.ts index 6ce4482..1ba91e4 100644 --- a/yudao-admin-vue3/src/api/ai/chat/conversation/index.ts +++ b/yudao-admin-vue3/src/api/ai/chat/conversation/index.ts @@ -25,41 +25,41 @@ export interface ChatConversationVO { export const ChatConversationApi = { // 获得【我的】聊天对话 getChatConversationMy: async (id: number) => { - return await request.get({ url: `/ai/chat/conversation/get-my?id=${id}` }) + return await request.get({url: `/ai/chat/conversation/get-my?id=${id}`}) }, // 新增【我的】聊天对话 createChatConversationMy: async (data?: ChatConversationVO) => { - return await request.post({ url: `/ai/chat/conversation/create-my`, data }) + return await request.post({url: `/ai/chat/conversation/create-my`, data}) }, // 更新【我的】聊天对话 updateChatConversationMy: async (data: ChatConversationVO) => { - return await request.put({ url: `/ai/chat/conversation/update-my`, data }) + return await request.put({url: `/ai/chat/conversation/update-my`, data}) }, // 删除【我的】聊天对话 deleteChatConversationMy: async (id: string) => { - return await request.delete({ url: `/ai/chat/conversation/delete-my?id=${id}` }) + return await request.delete({url: `/ai/chat/conversation/delete-my?id=${id}`}) }, // 删除【我的】所有对话,置顶除外 deleteChatConversationMyByUnpinned: async () => { - return await request.delete({ url: `/ai/chat/conversation/delete-by-unpinned` }) + return await request.delete({url: `/ai/chat/conversation/delete-by-unpinned`}) }, // 获得【我的】聊天对话列表 getChatConversationMyList: async () => { - return await request.get({ url: `/ai/chat/conversation/my-list` }) + return await request.get({url: `/ai/chat/conversation/my-list`}) }, // 获得对话分页 getChatConversationPage: async (params: any) => { - return await request.get({ url: `/ai/chat/conversation/page`, params }) + return await request.get({url: `/ai/chat/conversation/page`, params}) }, // 管理员删除消息 deleteChatConversationByAdmin: async (id: number) => { - return await request.delete({ url: `/ai/chat/conversation/delete-by-admin?id=${id}` }) + return await request.delete({url: `/ai/chat/conversation/delete-by-admin?id=${id}`}) } } diff --git a/yudao-admin-vue3/src/api/ai/chat/message/index.ts b/yudao-admin-vue3/src/api/ai/chat/message/index.ts index ef1196a..959f515 100644 --- a/yudao-admin-vue3/src/api/ai/chat/message/index.ts +++ b/yudao-admin-vue3/src/api/ai/chat/message/index.ts @@ -1,7 +1,7 @@ import request from '@/config/axios' -import { fetchEventSource } from '@microsoft/fetch-event-source' -import { getAccessToken } from '@/utils/auth' -import { config } from '@/config/axios/config' +import {fetchEventSource} from '@microsoft/fetch-event-source' +import {getAccessToken} from '@/utils/auth' +import {config} from '@/config/axios/config' // 聊天VO export interface ChatMessageVO { @@ -61,7 +61,7 @@ export const ChatMessageApi = { // 删除消息 deleteChatMessage: async (id: string) => { - return await request.delete({ url: `/ai/chat/message/delete?id=${id}` }) + return await request.delete({url: `/ai/chat/message/delete?id=${id}`}) }, // 删除指定对话的消息 @@ -73,11 +73,11 @@ export const ChatMessageApi = { // 获得消息分页 getChatMessagePage: async (params: any) => { - return await request.get({ url: '/ai/chat/message/page', params }) + return await request.get({url: '/ai/chat/message/page', params}) }, // 管理员删除消息 deleteChatMessageByAdmin: async (id: number) => { - return await request.delete({ url: `/ai/chat/message/delete-by-admin?id=${id}` }) + return await request.delete({url: `/ai/chat/message/delete-by-admin?id=${id}`}) } } diff --git a/yudao-admin-vue3/src/api/ai/image/index.ts b/yudao-admin-vue3/src/api/ai/image/index.ts index f1905ca..dc6ceeb 100644 --- a/yudao-admin-vue3/src/api/ai/image/index.ts +++ b/yudao-admin-vue3/src/api/ai/image/index.ts @@ -54,54 +54,54 @@ export interface ImageMidjourneyButtonsVO { export const ImageApi = { // 获取【我的】绘图分页 getImagePageMy: async (params: PageParam) => { - return await request.get({ url: `/ai/image/my-page`, params }) + return await request.get({url: `/ai/image/my-page`, params}) }, // 获取公开的绘图记录 getImagePagePublic: async (params) => { - return await request.get({ url: `/ai/image/public-page`, params }) + return await request.get({url: `/ai/image/public-page`, params}) }, // 获取【我的】绘图记录 getImageMy: async (id: number) => { - return await request.get({ url: `/ai/image/get-my?id=${id}` }) + return await request.get({url: `/ai/image/get-my?id=${id}`}) }, // 获取【我的】绘图记录列表 getImageListMyByIds: async (ids: number[]) => { - return await request.get({ url: `/ai/image/my-list-by-ids`, params: { ids: ids.join(',') } }) + return await request.get({url: `/ai/image/my-list-by-ids`, params: {ids: ids.join(',')}}) }, // 生成图片 drawImage: async (data: ImageDrawReqVO) => { - return await request.post({ url: `/ai/image/draw`, data }) + return await request.post({url: `/ai/image/draw`, data}) }, // 删除【我的】绘画记录 deleteImageMy: async (id: number) => { - return await request.delete({ url: `/ai/image/delete-my?id=${id}` }) + return await request.delete({url: `/ai/image/delete-my?id=${id}`}) }, // ================ midjourney 专属 ================ // 【Midjourney】生成图片 midjourneyImagine: async (data: ImageMidjourneyImagineReqVO) => { - return await request.post({ url: `/ai/image/midjourney/imagine`, data }) + return await request.post({url: `/ai/image/midjourney/imagine`, data}) }, // 【Midjourney】Action 操作(二次生成图片) midjourneyAction: async (data: ImageMidjourneyActionVO) => { - return await request.post({ url: `/ai/image/midjourney/action`, data }) + return await request.post({url: `/ai/image/midjourney/action`, data}) }, // ================ 绘图管理 ================ // 查询绘画分页 getImagePage: async (params: any) => { - return await request.get({ url: `/ai/image/page`, params }) + return await request.get({url: `/ai/image/page`, params}) }, // 更新绘画发布状态 updateImage: async (data: any) => { - return await request.put({ url: '/ai/image/update-public-status', data }) + return await request.put({url: '/ai/image/update-public-status', data}) }, // 删除绘画 deleteImage: async (id: number) => { - return await request.delete({ url: `/ai/image/delete?id=` + id }) + return await request.delete({url: `/ai/image/delete?id=` + id}) } } diff --git a/yudao-admin-vue3/src/api/ai/model/apiKey/index.ts b/yudao-admin-vue3/src/api/ai/model/apiKey/index.ts index ed94836..1d94c16 100644 --- a/yudao-admin-vue3/src/api/ai/model/apiKey/index.ts +++ b/yudao-admin-vue3/src/api/ai/model/apiKey/index.ts @@ -14,31 +14,31 @@ export interface ApiKeyVO { export const ApiKeyApi = { // 查询 API 密钥分页 getApiKeyPage: async (params: any) => { - return await request.get({ url: `/ai/api-key/page`, params }) + return await request.get({url: `/ai/api-key/page`, params}) }, // 获得 API 密钥列表 getApiKeySimpleList: async () => { - return await request.get({ url: `/ai/api-key/simple-list` }) + return await request.get({url: `/ai/api-key/simple-list`}) }, // 查询 API 密钥详情 getApiKey: async (id: number) => { - return await request.get({ url: `/ai/api-key/get?id=` + id }) + return await request.get({url: `/ai/api-key/get?id=` + id}) }, // 新增 API 密钥 createApiKey: async (data: ApiKeyVO) => { - return await request.post({ url: `/ai/api-key/create`, data }) + return await request.post({url: `/ai/api-key/create`, data}) }, // 修改 API 密钥 updateApiKey: async (data: ApiKeyVO) => { - return await request.put({ url: `/ai/api-key/update`, data }) + return await request.put({url: `/ai/api-key/update`, data}) }, // 删除 API 密钥 deleteApiKey: async (id: number) => { - return await request.delete({ url: `/ai/api-key/delete?id=` + id }) + return await request.delete({url: `/ai/api-key/delete?id=` + id}) } } diff --git a/yudao-admin-vue3/src/api/ai/model/chatModel/index.ts b/yudao-admin-vue3/src/api/ai/model/chatModel/index.ts index c2ef4c8..34402e1 100644 --- a/yudao-admin-vue3/src/api/ai/model/chatModel/index.ts +++ b/yudao-admin-vue3/src/api/ai/model/chatModel/index.ts @@ -18,7 +18,7 @@ export interface ChatModelVO { export const ChatModelApi = { // 查询聊天模型分页 getChatModelPage: async (params: any) => { - return await request.get({ url: `/ai/chat-model/page`, params }) + return await request.get({url: `/ai/chat-model/page`, params}) }, // 获得聊天模型列表 @@ -33,21 +33,21 @@ export const ChatModelApi = { // 查询聊天模型详情 getChatModel: async (id: number) => { - return await request.get({ url: `/ai/chat-model/get?id=` + id }) + return await request.get({url: `/ai/chat-model/get?id=` + id}) }, // 新增聊天模型 createChatModel: async (data: ChatModelVO) => { - return await request.post({ url: `/ai/chat-model/create`, data }) + return await request.post({url: `/ai/chat-model/create`, data}) }, // 修改聊天模型 updateChatModel: async (data: ChatModelVO) => { - return await request.put({ url: `/ai/chat-model/update`, data }) + return await request.put({url: `/ai/chat-model/update`, data}) }, // 删除聊天模型 deleteChatModel: async (id: number) => { - return await request.delete({ url: `/ai/chat-model/delete?id=` + id }) + return await request.delete({url: `/ai/chat-model/delete?id=` + id}) } } diff --git a/yudao-admin-vue3/src/api/ai/model/chatRole/index.ts b/yudao-admin-vue3/src/api/ai/model/chatRole/index.ts index a9fce13..2add69b 100644 --- a/yudao-admin-vue3/src/api/ai/model/chatRole/index.ts +++ b/yudao-admin-vue3/src/api/ai/model/chatRole/index.ts @@ -28,53 +28,53 @@ export interface ChatRolePageReqVO { export const ChatRoleApi = { // 查询聊天角色分页 getChatRolePage: async (params: any) => { - return await request.get({ url: `/ai/chat-role/page`, params }) + return await request.get({url: `/ai/chat-role/page`, params}) }, // 查询聊天角色详情 getChatRole: async (id: number) => { - return await request.get({ url: `/ai/chat-role/get?id=` + id }) + return await request.get({url: `/ai/chat-role/get?id=` + id}) }, // 新增聊天角色 createChatRole: async (data: ChatRoleVO) => { - return await request.post({ url: `/ai/chat-role/create`, data }) + return await request.post({url: `/ai/chat-role/create`, data}) }, // 修改聊天角色 updateChatRole: async (data: ChatRoleVO) => { - return await request.put({ url: `/ai/chat-role/update`, data }) + return await request.put({url: `/ai/chat-role/update`, data}) }, // 删除聊天角色 deleteChatRole: async (id: number) => { - return await request.delete({ url: `/ai/chat-role/delete?id=` + id }) + return await request.delete({url: `/ai/chat-role/delete?id=` + id}) }, // ======= chat 聊天 // 获取 my role getMyPage: async (params: ChatRolePageReqVO) => { - return await request.get({ url: `/ai/chat-role/my-page`, params}) + return await request.get({url: `/ai/chat-role/my-page`, params}) }, // 获取角色分类 getCategoryList: async () => { - return await request.get({ url: `/ai/chat-role/category-list`}) + return await request.get({url: `/ai/chat-role/category-list`}) }, // 创建角色 createMy: async (data: ChatRoleVO) => { - return await request.post({ url: `/ai/chat-role/create-my`, data}) + return await request.post({url: `/ai/chat-role/create-my`, data}) }, // 更新角色 updateMy: async (data: ChatRoleVO) => { - return await request.put({ url: `/ai/chat-role/update-my`, data}) + return await request.put({url: `/ai/chat-role/update-my`, data}) }, // 删除角色 my deleteMy: async (id: number) => { - return await request.delete({ url: `/ai/chat-role/delete-my?id=` + id }) + return await request.delete({url: `/ai/chat-role/delete-my?id=` + id}) }, } diff --git a/yudao-admin-vue3/src/api/ai/music/index.ts b/yudao-admin-vue3/src/api/ai/music/index.ts index 74b8526..59bc58f 100644 --- a/yudao-admin-vue3/src/api/ai/music/index.ts +++ b/yudao-admin-vue3/src/api/ai/music/index.ts @@ -26,16 +26,16 @@ export interface MusicVO { export const MusicApi = { // 查询音乐分页 getMusicPage: async (params: any) => { - return await request.get({ url: `/ai/music/page`, params }) + return await request.get({url: `/ai/music/page`, params}) }, // 更新音乐 updateMusic: async (data: any) => { - return await request.put({ url: '/ai/music/update', data }) + return await request.put({url: '/ai/music/update', data}) }, // 删除音乐 deleteMusic: async (id: number) => { - return await request.delete({ url: `/ai/music/delete?id=` + id }) + return await request.delete({url: `/ai/music/delete?id=` + id}) } } diff --git a/yudao-admin-vue3/src/api/ai/write/index.ts b/yudao-admin-vue3/src/api/ai/write/index.ts index 013f998..289b4cb 100644 --- a/yudao-admin-vue3/src/api/ai/write/index.ts +++ b/yudao-admin-vue3/src/api/ai/write/index.ts @@ -1,8 +1,8 @@ -import { fetchEventSource } from '@microsoft/fetch-event-source' +import {fetchEventSource} from '@microsoft/fetch-event-source' -import { getAccessToken } from '@/utils/auth' -import { config } from '@/config/axios/config' -import { AiWriteTypeEnum } from '@/views/ai/utils/constants' +import {getAccessToken} from '@/utils/auth' +import {config} from '@/config/axios/config' +import {AiWriteTypeEnum} from '@/views/ai/utils/constants' import request from '@/config/axios' export interface WriteVO { @@ -47,12 +47,12 @@ export interface AiWriteRespVo { export const WriteApi = { writeStream: ({ - data, - onClose, - onMessage, - onError, - ctrl - }: { + data, + onClose, + onMessage, + onError, + ctrl + }: { data: WriteVO onMessage?: (res: any) => void onError?: (...args: any[]) => void @@ -76,10 +76,10 @@ export const WriteApi = { }, // 获取写作列表 getWritePage: (params: AiWritePageReqVO) => { - return request.get>({ url: `/ai/write/page`, params }) + return request.get>({url: `/ai/write/page`, params}) }, // 删除写作 deleteWrite(id: number) { - return request.delete({ url: `/ai/write/delete`, params: { id } }) + return request.delete({url: `/ai/write/delete`, params: {id}}) } } diff --git a/yudao-admin-vue3/src/api/bpm/category/index.ts b/yudao-admin-vue3/src/api/bpm/category/index.ts index d1e109c..9a986c0 100644 --- a/yudao-admin-vue3/src/api/bpm/category/index.ts +++ b/yudao-admin-vue3/src/api/bpm/category/index.ts @@ -13,31 +13,31 @@ export interface CategoryVO { export const CategoryApi = { // 查询流程分类分页 getCategoryPage: async (params: any) => { - return await request.get({ url: `/bpm/category/page`, params }) + return await request.get({url: `/bpm/category/page`, params}) }, // 查询流程分类列表 getCategorySimpleList: async () => { - return await request.get({ url: `/bpm/category/simple-list` }) + return await request.get({url: `/bpm/category/simple-list`}) }, // 查询流程分类详情 getCategory: async (id: number) => { - return await request.get({ url: `/bpm/category/get?id=` + id }) + return await request.get({url: `/bpm/category/get?id=` + id}) }, // 新增流程分类 createCategory: async (data: CategoryVO) => { - return await request.post({ url: `/bpm/category/create`, data }) + return await request.post({url: `/bpm/category/create`, data}) }, // 修改流程分类 updateCategory: async (data: CategoryVO) => { - return await request.put({ url: `/bpm/category/update`, data }) + return await request.put({url: `/bpm/category/update`, data}) }, // 删除流程分类 deleteCategory: async (id: number) => { - return await request.delete({ url: `/bpm/category/delete?id=` + id }) + return await request.delete({url: `/bpm/category/delete?id=` + id}) } } diff --git a/yudao-admin-vue3/src/api/bpm/definition/index.ts b/yudao-admin-vue3/src/api/bpm/definition/index.ts index caedba1..5fa386c 100644 --- a/yudao-admin-vue3/src/api/bpm/definition/index.ts +++ b/yudao-admin-vue3/src/api/bpm/definition/index.ts @@ -3,7 +3,7 @@ import request from '@/config/axios' export const getProcessDefinition = async (id?: string, key?: string) => { return await request.get({ url: '/bpm/process-definition/get', - params: { id, key } + params: {id, key} }) } diff --git a/yudao-admin-vue3/src/api/bpm/leave/index.ts b/yudao-admin-vue3/src/api/bpm/leave/index.ts index 4f374b2..e12ce95 100644 --- a/yudao-admin-vue3/src/api/bpm/leave/index.ts +++ b/yudao-admin-vue3/src/api/bpm/leave/index.ts @@ -13,15 +13,15 @@ export type LeaveVO = { // 创建请假申请 export const createLeave = async (data: LeaveVO) => { - return await request.post({ url: '/bpm/oa/leave/create', data: data }) + return await request.post({url: '/bpm/oa/leave/create', data: data}) } // 获得请假申请 export const getLeave = async (id: number) => { - return await request.get({ url: '/bpm/oa/leave/get?id=' + id }) + return await request.get({url: '/bpm/oa/leave/get?id=' + id}) } // 获得请假申请分页 export const getLeavePage = async (params: PageParam) => { - return await request.get({ url: '/bpm/oa/leave/page', params }) + return await request.get({url: '/bpm/oa/leave/page', params}) } diff --git a/yudao-admin-vue3/src/api/bpm/model/index.ts b/yudao-admin-vue3/src/api/bpm/model/index.ts index 2b484a6..b3806f9 100644 --- a/yudao-admin-vue3/src/api/bpm/model/index.ts +++ b/yudao-admin-vue3/src/api/bpm/model/index.ts @@ -27,15 +27,15 @@ export type ModelVO = { } export const getModelPage = async (params) => { - return await request.get({ url: '/bpm/model/page', params }) + return await request.get({url: '/bpm/model/page', params}) } export const getModel = async (id: number) => { - return await request.get({ url: '/bpm/model/get?id=' + id }) + return await request.get({url: '/bpm/model/get?id=' + id}) } export const updateModel = async (data: ModelVO) => { - return await request.put({ url: '/bpm/model/update', data: data }) + return await request.put({url: '/bpm/model/update', data: data}) } // 任务状态修改 @@ -44,17 +44,17 @@ export const updateModelState = async (id: number, state: number) => { id: id, state: state } - return await request.put({ url: '/bpm/model/update-state', data: data }) + return await request.put({url: '/bpm/model/update-state', data: data}) } export const createModel = async (data: ModelVO) => { - return await request.post({ url: '/bpm/model/create', data: data }) + return await request.post({url: '/bpm/model/create', data: data}) } export const deleteModel = async (id: number) => { - return await request.delete({ url: '/bpm/model/delete?id=' + id }) + return await request.delete({url: '/bpm/model/delete?id=' + id}) } export const deployModel = async (id: number) => { - return await request.post({ url: '/bpm/model/deploy?id=' + id }) + return await request.post({url: '/bpm/model/deploy?id=' + id}) } diff --git a/yudao-admin-vue3/src/api/bpm/processExpression/index.ts b/yudao-admin-vue3/src/api/bpm/processExpression/index.ts index af6a737..8dc18da 100644 --- a/yudao-admin-vue3/src/api/bpm/processExpression/index.ts +++ b/yudao-admin-vue3/src/api/bpm/processExpression/index.ts @@ -12,31 +12,31 @@ export interface ProcessExpressionVO { export const ProcessExpressionApi = { // 查询BPM 流程表达式分页 getProcessExpressionPage: async (params: any) => { - return await request.get({ url: `/bpm/process-expression/page`, params }) + return await request.get({url: `/bpm/process-expression/page`, params}) }, // 查询BPM 流程表达式详情 getProcessExpression: async (id: number) => { - return await request.get({ url: `/bpm/process-expression/get?id=` + id }) + return await request.get({url: `/bpm/process-expression/get?id=` + id}) }, // 新增BPM 流程表达式 createProcessExpression: async (data: ProcessExpressionVO) => { - return await request.post({ url: `/bpm/process-expression/create`, data }) + return await request.post({url: `/bpm/process-expression/create`, data}) }, // 修改BPM 流程表达式 updateProcessExpression: async (data: ProcessExpressionVO) => { - return await request.put({ url: `/bpm/process-expression/update`, data }) + return await request.put({url: `/bpm/process-expression/update`, data}) }, // 删除BPM 流程表达式 deleteProcessExpression: async (id: number) => { - return await request.delete({ url: `/bpm/process-expression/delete?id=` + id }) + return await request.delete({url: `/bpm/process-expression/delete?id=` + id}) }, // 导出BPM 流程表达式 Excel exportProcessExpression: async (params) => { - return await request.download({ url: `/bpm/process-expression/export-excel`, params }) + return await request.download({url: `/bpm/process-expression/export-excel`, params}) } -} \ No newline at end of file +} diff --git a/yudao-admin-vue3/src/api/bpm/processInstance/index.ts b/yudao-admin-vue3/src/api/bpm/processInstance/index.ts index 9122b2b..e22a61b 100644 --- a/yudao-admin-vue3/src/api/bpm/processInstance/index.ts +++ b/yudao-admin-vue3/src/api/bpm/processInstance/index.ts @@ -1,5 +1,5 @@ import request from '@/config/axios' -import { ProcessDefinitionVO } from '@/api/bpm/model' +import {ProcessDefinitionVO} from '@/api/bpm/model' export type Task = { id: string @@ -23,15 +23,15 @@ export type ProcessInstanceVO = { } export const getProcessInstanceMyPage = async (params: any) => { - return await request.get({ url: '/bpm/process-instance/my-page', params }) + return await request.get({url: '/bpm/process-instance/my-page', params}) } export const getProcessInstanceManagerPage = async (params: any) => { - return await request.get({ url: '/bpm/process-instance/manager-page', params }) + return await request.get({url: '/bpm/process-instance/manager-page', params}) } export const createProcessInstance = async (data) => { - return await request.post({ url: '/bpm/process-instance/create', data: data }) + return await request.post({url: '/bpm/process-instance/create', data: data}) } export const cancelProcessInstanceByStartUser = async (id: number, reason: string) => { @@ -39,7 +39,7 @@ export const cancelProcessInstanceByStartUser = async (id: number, reason: strin id: id, reason: reason } - return await request.delete({ url: '/bpm/process-instance/cancel-by-start-user', data: data }) + return await request.delete({url: '/bpm/process-instance/cancel-by-start-user', data: data}) } export const cancelProcessInstanceByAdmin = async (id: number, reason: string) => { @@ -47,13 +47,13 @@ export const cancelProcessInstanceByAdmin = async (id: number, reason: string) = id: id, reason: reason } - return await request.delete({ url: '/bpm/process-instance/cancel-by-admin', data: data }) + return await request.delete({url: '/bpm/process-instance/cancel-by-admin', data: data}) } export const getProcessInstance = async (id: string) => { - return await request.get({ url: '/bpm/process-instance/get?id=' + id }) + return await request.get({url: '/bpm/process-instance/get?id=' + id}) } export const getProcessInstanceCopyPage = async (params: any) => { - return await request.get({ url: '/bpm/process-instance/copy/page', params }) + return await request.get({url: '/bpm/process-instance/copy/page', params}) } diff --git a/yudao-admin-vue3/src/api/bpm/processListener/index.ts b/yudao-admin-vue3/src/api/bpm/processListener/index.ts index dabaa47..c92a76a 100644 --- a/yudao-admin-vue3/src/api/bpm/processListener/index.ts +++ b/yudao-admin-vue3/src/api/bpm/processListener/index.ts @@ -15,26 +15,26 @@ export interface ProcessListenerVO { export const ProcessListenerApi = { // 查询流程监听器分页 getProcessListenerPage: async (params: any) => { - return await request.get({ url: `/bpm/process-listener/page`, params }) + return await request.get({url: `/bpm/process-listener/page`, params}) }, // 查询流程监听器详情 getProcessListener: async (id: number) => { - return await request.get({ url: `/bpm/process-listener/get?id=` + id }) + return await request.get({url: `/bpm/process-listener/get?id=` + id}) }, // 新增流程监听器 createProcessListener: async (data: ProcessListenerVO) => { - return await request.post({ url: `/bpm/process-listener/create`, data }) + return await request.post({url: `/bpm/process-listener/create`, data}) }, // 修改流程监听器 updateProcessListener: async (data: ProcessListenerVO) => { - return await request.put({ url: `/bpm/process-listener/update`, data }) + return await request.put({url: `/bpm/process-listener/update`, data}) }, // 删除流程监听器 deleteProcessListener: async (id: number) => { - return await request.delete({ url: `/bpm/process-listener/delete?id=` + id }) + return await request.delete({url: `/bpm/process-listener/delete?id=` + id}) } } diff --git a/yudao-admin-vue3/src/api/bpm/task/index.ts b/yudao-admin-vue3/src/api/bpm/task/index.ts index f3cda9f..5392617 100644 --- a/yudao-admin-vue3/src/api/bpm/task/index.ts +++ b/yudao-admin-vue3/src/api/bpm/task/index.ts @@ -5,23 +5,23 @@ export type TaskVO = { } export const getTaskTodoPage = async (params: any) => { - return await request.get({ url: '/bpm/task/todo-page', params }) + return await request.get({url: '/bpm/task/todo-page', params}) } export const getTaskDonePage = async (params: any) => { - return await request.get({ url: '/bpm/task/done-page', params }) + return await request.get({url: '/bpm/task/done-page', params}) } export const getTaskManagerPage = async (params: any) => { - return await request.get({ url: '/bpm/task/manager-page', params }) + return await request.get({url: '/bpm/task/manager-page', params}) } export const approveTask = async (data: any) => { - return await request.put({ url: '/bpm/task/approve', data }) + return await request.put({url: '/bpm/task/approve', data}) } export const rejectTask = async (data: any) => { - return await request.put({ url: '/bpm/task/reject', data }) + return await request.put({url: '/bpm/task/reject', data}) } export const getTaskListByProcessInstanceId = async (processInstanceId: string) => { @@ -32,35 +32,35 @@ export const getTaskListByProcessInstanceId = async (processInstanceId: string) // 获取所有可回退的节点 export const getTaskListByReturn = async (id: string) => { - return await request.get({ url: '/bpm/task/list-by-return', params: { id } }) + return await request.get({url: '/bpm/task/list-by-return', params: {id}}) } // 回退 export const returnTask = async (data: any) => { - return await request.put({ url: '/bpm/task/return', data }) + return await request.put({url: '/bpm/task/return', data}) } // 委派 export const delegateTask = async (data: any) => { - return await request.put({ url: '/bpm/task/delegate', data }) + return await request.put({url: '/bpm/task/delegate', data}) } // 转派 export const transferTask = async (data: any) => { - return await request.put({ url: '/bpm/task/transfer', data }) + return await request.put({url: '/bpm/task/transfer', data}) } // 加签 export const signCreateTask = async (data: any) => { - return await request.put({ url: '/bpm/task/create-sign', data }) + return await request.put({url: '/bpm/task/create-sign', data}) } // 减签 export const signDeleteTask = async (data: any) => { - return await request.delete({ url: '/bpm/task/delete-sign', data }) + return await request.delete({url: '/bpm/task/delete-sign', data}) } // 获取减签任务列表 export const getChildrenTaskList = async (id: string) => { - return await request.get({ url: '/bpm/task/list-by-parent-task-id?parentTaskId=' + id }) + return await request.get({url: '/bpm/task/list-by-parent-task-id?parentTaskId=' + id}) } diff --git a/yudao-admin-vue3/src/api/bpm/userGroup/index.ts b/yudao-admin-vue3/src/api/bpm/userGroup/index.ts index 7d12755..c2b6d3e 100644 --- a/yudao-admin-vue3/src/api/bpm/userGroup/index.ts +++ b/yudao-admin-vue3/src/api/bpm/userGroup/index.ts @@ -28,20 +28,20 @@ export const updateUserGroup = async (data: UserGroupVO) => { // 删除用户组 export const deleteUserGroup = async (id: number) => { - return await request.delete({ url: '/bpm/user-group/delete?id=' + id }) + return await request.delete({url: '/bpm/user-group/delete?id=' + id}) } // 获得用户组 export const getUserGroup = async (id: number) => { - return await request.get({ url: '/bpm/user-group/get?id=' + id }) + return await request.get({url: '/bpm/user-group/get?id=' + id}) } // 获得用户组分页 export const getUserGroupPage = async (params) => { - return await request.get({ url: '/bpm/user-group/page', params }) + return await request.get({url: '/bpm/user-group/page', params}) } // 获取用户组精简信息列表 export const getUserGroupSimpleList = async (): Promise => { - return await request.get({ url: '/bpm/user-group/simple-list' }) + return await request.get({url: '/bpm/user-group/simple-list'}) } diff --git a/yudao-admin-vue3/src/api/crm/business/index.ts b/yudao-admin-vue3/src/api/crm/business/index.ts index 2420425..544d132 100644 --- a/yudao-admin-vue3/src/api/crm/business/index.ts +++ b/yudao-admin-vue3/src/api/crm/business/index.ts @@ -1,5 +1,5 @@ import request from '@/config/axios' -import { TransferReqVO } from '@/api/crm/permission' +import {TransferReqVO} from '@/api/crm/permission' export interface BusinessVO { id: number @@ -44,55 +44,55 @@ export interface BusinessVO { // 查询 CRM 商机列表 export const getBusinessPage = async (params) => { - return await request.get({ url: `/crm/business/page`, params }) + return await request.get({url: `/crm/business/page`, params}) } // 查询 CRM 商机列表,基于指定客户 export const getBusinessPageByCustomer = async (params) => { - return await request.get({ url: `/crm/business/page-by-customer`, params }) + return await request.get({url: `/crm/business/page-by-customer`, params}) } // 查询 CRM 商机详情 export const getBusiness = async (id: number) => { - return await request.get({ url: `/crm/business/get?id=` + id }) + return await request.get({url: `/crm/business/get?id=` + id}) } // 获得 CRM 商机列表(精简) export const getSimpleBusinessList = async () => { - return await request.get({ url: `/crm/business/simple-all-list` }) + return await request.get({url: `/crm/business/simple-all-list`}) } // 新增 CRM 商机 export const createBusiness = async (data: BusinessVO) => { - return await request.post({ url: `/crm/business/create`, data }) + return await request.post({url: `/crm/business/create`, data}) } // 修改 CRM 商机 export const updateBusiness = async (data: BusinessVO) => { - return await request.put({ url: `/crm/business/update`, data }) + return await request.put({url: `/crm/business/update`, data}) } // 修改 CRM 商机状态 export const updateBusinessStatus = async (data: BusinessVO) => { - return await request.put({ url: `/crm/business/update-status`, data }) + return await request.put({url: `/crm/business/update-status`, data}) } // 删除 CRM 商机 export const deleteBusiness = async (id: number) => { - return await request.delete({ url: `/crm/business/delete?id=` + id }) + return await request.delete({url: `/crm/business/delete?id=` + id}) } // 导出 CRM 商机 Excel export const exportBusiness = async (params) => { - return await request.download({ url: `/crm/business/export-excel`, params }) + return await request.download({url: `/crm/business/export-excel`, params}) } // 联系人关联商机列表 export const getBusinessPageByContact = async (params) => { - return await request.get({ url: `/crm/business/page-by-contact`, params }) + return await request.get({url: `/crm/business/page-by-contact`, params}) } // 商机转移 export const transferBusiness = async (data: TransferReqVO) => { - return await request.put({ url: '/crm/business/transfer', data }) + return await request.put({url: '/crm/business/transfer', data}) } diff --git a/yudao-admin-vue3/src/api/crm/business/status/index.ts b/yudao-admin-vue3/src/api/crm/business/status/index.ts index cddaa5a..0b1790d 100644 --- a/yudao-admin-vue3/src/api/crm/business/status/index.ts +++ b/yudao-admin-vue3/src/api/crm/business/status/index.ts @@ -34,35 +34,35 @@ export const DEFAULT_STATUSES = [ // 查询商机状态组列表 export const getBusinessStatusPage = async (params: any) => { - return await request.get({ url: `/crm/business-status/page`, params }) + return await request.get({url: `/crm/business-status/page`, params}) } // 新增商机状态组 export const createBusinessStatus = async (data: BusinessStatusTypeVO) => { - return await request.post({ url: `/crm/business-status/create`, data }) + return await request.post({url: `/crm/business-status/create`, data}) } // 修改商机状态组 export const updateBusinessStatus = async (data: BusinessStatusTypeVO) => { - return await request.put({ url: `/crm/business-status/update`, data }) + return await request.put({url: `/crm/business-status/update`, data}) } // 查询商机状态类型详情 export const getBusinessStatus = async (id: number) => { - return await request.get({ url: `/crm/business-status/get?id=` + id }) + return await request.get({url: `/crm/business-status/get?id=` + id}) } // 删除商机状态 export const deleteBusinessStatus = async (id: number) => { - return await request.delete({ url: `/crm/business-status/delete?id=` + id }) + return await request.delete({url: `/crm/business-status/delete?id=` + id}) } // 获得商机状态组列表 export const getBusinessStatusTypeSimpleList = async () => { - return await request.get({ url: `/crm/business-status/type-simple-list` }) + return await request.get({url: `/crm/business-status/type-simple-list`}) } // 获得商机阶段列表 export const getBusinessStatusSimpleList = async (typeId: number) => { - return await request.get({ url: `/crm/business-status/status-simple-list`, params: { typeId } }) + return await request.get({url: `/crm/business-status/status-simple-list`, params: {typeId}}) } diff --git a/yudao-admin-vue3/src/api/crm/clue/index.ts b/yudao-admin-vue3/src/api/crm/clue/index.ts index 9736514..061385b 100644 --- a/yudao-admin-vue3/src/api/crm/clue/index.ts +++ b/yudao-admin-vue3/src/api/crm/clue/index.ts @@ -1,5 +1,5 @@ import request from '@/config/axios' -import { TransferReqVO } from '@/api/crm/permission' +import {TransferReqVO} from '@/api/crm/permission' export interface ClueVO { id: number // 编号 @@ -34,45 +34,45 @@ export interface ClueVO { // 查询线索列表 export const getCluePage = async (params: any) => { - return await request.get({ url: `/crm/clue/page`, params }) + return await request.get({url: `/crm/clue/page`, params}) } // 查询线索详情 export const getClue = async (id: number) => { - return await request.get({ url: `/crm/clue/get?id=` + id }) + return await request.get({url: `/crm/clue/get?id=` + id}) } // 新增线索 export const createClue = async (data: ClueVO) => { - return await request.post({ url: `/crm/clue/create`, data }) + return await request.post({url: `/crm/clue/create`, data}) } // 修改线索 export const updateClue = async (data: ClueVO) => { - return await request.put({ url: `/crm/clue/update`, data }) + return await request.put({url: `/crm/clue/update`, data}) } // 删除线索 export const deleteClue = async (id: number) => { - return await request.delete({ url: `/crm/clue/delete?id=` + id }) + return await request.delete({url: `/crm/clue/delete?id=` + id}) } // 导出线索 Excel export const exportClue = async (params) => { - return await request.download({ url: `/crm/clue/export-excel`, params }) + return await request.download({url: `/crm/clue/export-excel`, params}) } // 线索转移 export const transferClue = async (data: TransferReqVO) => { - return await request.put({ url: '/crm/clue/transfer', data }) + return await request.put({url: '/crm/clue/transfer', data}) } // 线索转化为客户 export const transformClue = async (id: number) => { - return await request.put({ url: '/crm/clue/transform', params: { id } }) + return await request.put({url: '/crm/clue/transform', params: {id}}) } // 获得分配给我的、待跟进的线索数量 export const getFollowClueCount = async () => { - return await request.get({ url: '/crm/clue/follow-count' }) + return await request.get({url: '/crm/clue/follow-count'}) } diff --git a/yudao-admin-vue3/src/api/crm/contact/index.ts b/yudao-admin-vue3/src/api/crm/contact/index.ts index 7c24dfa..b60773d 100644 --- a/yudao-admin-vue3/src/api/crm/contact/index.ts +++ b/yudao-admin-vue3/src/api/crm/contact/index.ts @@ -1,5 +1,5 @@ import request from '@/config/axios' -import { TransferReqVO } from '@/api/crm/permission' +import {TransferReqVO} from '@/api/crm/permission' export interface ContactVO { id: number // 编号 @@ -44,70 +44,70 @@ export interface ContactBusiness2ReqVO { // 查询 CRM 联系人列表 export const getContactPage = async (params) => { - return await request.get({ url: `/crm/contact/page`, params }) + return await request.get({url: `/crm/contact/page`, params}) } // 查询 CRM 联系人列表,基于指定客户 export const getContactPageByCustomer = async (params: any) => { - return await request.get({ url: `/crm/contact/page-by-customer`, params }) + return await request.get({url: `/crm/contact/page-by-customer`, params}) } // 查询 CRM 联系人列表,基于指定商机 export const getContactPageByBusiness = async (params: any) => { - return await request.get({ url: `/crm/contact/page-by-business`, params }) + return await request.get({url: `/crm/contact/page-by-business`, params}) } // 查询 CRM 联系人详情 export const getContact = async (id: number) => { - return await request.get({ url: `/crm/contact/get?id=` + id }) + return await request.get({url: `/crm/contact/get?id=` + id}) } // 新增 CRM 联系人 export const createContact = async (data: ContactVO) => { - return await request.post({ url: `/crm/contact/create`, data }) + return await request.post({url: `/crm/contact/create`, data}) } // 修改 CRM 联系人 export const updateContact = async (data: ContactVO) => { - return await request.put({ url: `/crm/contact/update`, data }) + return await request.put({url: `/crm/contact/update`, data}) } // 删除 CRM 联系人 export const deleteContact = async (id: number) => { - return await request.delete({ url: `/crm/contact/delete?id=` + id }) + return await request.delete({url: `/crm/contact/delete?id=` + id}) } // 导出 CRM 联系人 Excel export const exportContact = async (params) => { - return await request.download({ url: `/crm/contact/export-excel`, params }) + return await request.download({url: `/crm/contact/export-excel`, params}) } // 获得 CRM 联系人列表(精简) export const getSimpleContactList = async () => { - return await request.get({ url: `/crm/contact/simple-all-list` }) + return await request.get({url: `/crm/contact/simple-all-list`}) } // 批量新增联系人商机关联 export const createContactBusinessList = async (data: ContactBusinessReqVO) => { - return await request.post({ url: `/crm/contact/create-business-list`, data }) + return await request.post({url: `/crm/contact/create-business-list`, data}) } // 批量新增联系人商机关联 export const createContactBusinessList2 = async (data: ContactBusiness2ReqVO) => { - return await request.post({ url: `/crm/contact/create-business-list2`, data }) + return await request.post({url: `/crm/contact/create-business-list2`, data}) } // 解除联系人商机关联 export const deleteContactBusinessList = async (data: ContactBusinessReqVO) => { - return await request.delete({ url: `/crm/contact/delete-business-list`, data }) + return await request.delete({url: `/crm/contact/delete-business-list`, data}) } // 解除联系人商机关联 export const deleteContactBusinessList2 = async (data: ContactBusiness2ReqVO) => { - return await request.delete({ url: `/crm/contact/delete-business-list2`, data }) + return await request.delete({url: `/crm/contact/delete-business-list2`, data}) } // 联系人转移 export const transferContact = async (data: TransferReqVO) => { - return await request.put({ url: '/crm/contact/transfer', data }) + return await request.put({url: '/crm/contact/transfer', data}) } diff --git a/yudao-admin-vue3/src/api/crm/contract/config/index.ts b/yudao-admin-vue3/src/api/crm/contract/config/index.ts index 0c7ad20..714d6cf 100644 --- a/yudao-admin-vue3/src/api/crm/contract/config/index.ts +++ b/yudao-admin-vue3/src/api/crm/contract/config/index.ts @@ -7,10 +7,10 @@ export interface ContractConfigVO { // 获取合同配置 export const getContractConfig = async () => { - return await request.get({ url: `/crm/contract-config/get` }) + return await request.get({url: `/crm/contract-config/get`}) } // 更新合同配置 export const saveContractConfig = async (data: ContractConfigVO) => { - return await request.put({ url: `/crm/contract-config/save`, data }) + return await request.put({url: `/crm/contract-config/save`, data}) } diff --git a/yudao-admin-vue3/src/api/crm/contract/index.ts b/yudao-admin-vue3/src/api/crm/contract/index.ts index 7028b77..894c043 100644 --- a/yudao-admin-vue3/src/api/crm/contract/index.ts +++ b/yudao-admin-vue3/src/api/crm/contract/index.ts @@ -1,5 +1,5 @@ import request from '@/config/axios' -import { TransferReqVO } from '@/api/crm/permission' +import {TransferReqVO} from '@/api/crm/permission' export interface ContractVO { id: number @@ -48,22 +48,22 @@ export interface ContractVO { // 查询 CRM 合同列表 export const getContractPage = async (params) => { - return await request.get({ url: `/crm/contract/page`, params }) + return await request.get({url: `/crm/contract/page`, params}) } // 查询 CRM 联系人列表,基于指定客户 export const getContractPageByCustomer = async (params: any) => { - return await request.get({ url: `/crm/contract/page-by-customer`, params }) + return await request.get({url: `/crm/contract/page-by-customer`, params}) } // 查询 CRM 联系人列表,基于指定商机 export const getContractPageByBusiness = async (params: any) => { - return await request.get({ url: `/crm/contract/page-by-business`, params }) + return await request.get({url: `/crm/contract/page-by-business`, params}) } // 查询 CRM 合同详情 export const getContract = async (id: number) => { - return await request.get({ url: `/crm/contract/get?id=` + id }) + return await request.get({url: `/crm/contract/get?id=` + id}) } // 查询 CRM 合同下拉列表 @@ -75,40 +75,40 @@ export const getContractSimpleList = async (customerId: number) => { // 新增 CRM 合同 export const createContract = async (data: ContractVO) => { - return await request.post({ url: `/crm/contract/create`, data }) + return await request.post({url: `/crm/contract/create`, data}) } // 修改 CRM 合同 export const updateContract = async (data: ContractVO) => { - return await request.put({ url: `/crm/contract/update`, data }) + return await request.put({url: `/crm/contract/update`, data}) } // 删除 CRM 合同 export const deleteContract = async (id: number) => { - return await request.delete({ url: `/crm/contract/delete?id=` + id }) + return await request.delete({url: `/crm/contract/delete?id=` + id}) } // 导出 CRM 合同 Excel export const exportContract = async (params) => { - return await request.download({ url: `/crm/contract/export-excel`, params }) + return await request.download({url: `/crm/contract/export-excel`, params}) } // 提交审核 export const submitContract = async (id: number) => { - return await request.put({ url: `/crm/contract/submit?id=${id}` }) + return await request.put({url: `/crm/contract/submit?id=${id}`}) } // 合同转移 export const transferContract = async (data: TransferReqVO) => { - return await request.put({ url: '/crm/contract/transfer', data }) + return await request.put({url: '/crm/contract/transfer', data}) } // 获得待审核合同数量 export const getAuditContractCount = async () => { - return await request.get({ url: '/crm/contract/audit-count' }) + return await request.get({url: '/crm/contract/audit-count'}) } // 获得即将到期(提醒)的合同数量 export const getRemindContractCount = async () => { - return await request.get({ url: '/crm/contract/remind-count' }) + return await request.get({url: '/crm/contract/remind-count'}) } diff --git a/yudao-admin-vue3/src/api/crm/customer/index.ts b/yudao-admin-vue3/src/api/crm/customer/index.ts index d149d4e..eac995e 100644 --- a/yudao-admin-vue3/src/api/crm/customer/index.ts +++ b/yudao-admin-vue3/src/api/crm/customer/index.ts @@ -1,5 +1,5 @@ import request from '@/config/axios' -import { TransferReqVO } from '@/api/crm/permission' +import {TransferReqVO} from '@/api/crm/permission' export interface CustomerVO { id: number // 编号 @@ -33,100 +33,100 @@ export interface CustomerVO { // 查询客户列表 export const getCustomerPage = async (params) => { - return await request.get({ url: `/crm/customer/page`, params }) + return await request.get({url: `/crm/customer/page`, params}) } // 进入公海客户提醒的客户列表 export const getPutPoolRemindCustomerPage = async (params) => { - return await request.get({ url: `/crm/customer/put-pool-remind-page`, params }) + return await request.get({url: `/crm/customer/put-pool-remind-page`, params}) } // 获得待进入公海客户数量 export const getPutPoolRemindCustomerCount = async () => { - return await request.get({ url: `/crm/customer/put-pool-remind-count` }) + return await request.get({url: `/crm/customer/put-pool-remind-count`}) } // 获得今日需联系客户数量 export const getTodayContactCustomerCount = async () => { - return await request.get({ url: `/crm/customer/today-contact-count` }) + return await request.get({url: `/crm/customer/today-contact-count`}) } // 获得分配给我、待跟进的线索数量的客户数量 export const getFollowCustomerCount = async () => { - return await request.get({ url: `/crm/customer/follow-count` }) + return await request.get({url: `/crm/customer/follow-count`}) } // 查询客户详情 export const getCustomer = async (id: number) => { - return await request.get({ url: `/crm/customer/get?id=` + id }) + return await request.get({url: `/crm/customer/get?id=` + id}) } // 新增客户 export const createCustomer = async (data: CustomerVO) => { - return await request.post({ url: `/crm/customer/create`, data }) + return await request.post({url: `/crm/customer/create`, data}) } // 修改客户 export const updateCustomer = async (data: CustomerVO) => { - return await request.put({ url: `/crm/customer/update`, data }) + return await request.put({url: `/crm/customer/update`, data}) } // 更新客户的成交状态 export const updateCustomerDealStatus = async (id: number, dealStatus: boolean) => { - return await request.put({ url: `/crm/customer/update-deal-status`, params: { id, dealStatus } }) + return await request.put({url: `/crm/customer/update-deal-status`, params: {id, dealStatus}}) } // 删除客户 export const deleteCustomer = async (id: number) => { - return await request.delete({ url: `/crm/customer/delete?id=` + id }) + return await request.delete({url: `/crm/customer/delete?id=` + id}) } // 导出客户 Excel export const exportCustomer = async (params: any) => { - return await request.download({ url: `/crm/customer/export-excel`, params }) + return await request.download({url: `/crm/customer/export-excel`, params}) } // 下载客户导入模板 export const importCustomerTemplate = () => { - return request.download({ url: '/crm/customer/get-import-template' }) + return request.download({url: '/crm/customer/get-import-template'}) } // 导入客户 export const handleImport = async (formData) => { - return await request.upload({ url: `/crm/customer/import`, data: formData }) + return await request.upload({url: `/crm/customer/import`, data: formData}) } // 客户列表 export const getCustomerSimpleList = async () => { - return await request.get({ url: `/crm/customer/simple-list` }) + return await request.get({url: `/crm/customer/simple-list`}) } // ======================= 业务操作 ======================= // 客户转移 export const transferCustomer = async (data: TransferReqVO) => { - return await request.put({ url: '/crm/customer/transfer', data }) + return await request.put({url: '/crm/customer/transfer', data}) } // 锁定/解锁客户 export const lockCustomer = async (id: number, lockStatus: boolean) => { - return await request.put({ url: `/crm/customer/lock`, data: { id, lockStatus } }) + return await request.put({url: `/crm/customer/lock`, data: {id, lockStatus}}) } // 领取公海客户 export const receiveCustomer = async (ids: any[]) => { - return await request.put({ url: '/crm/customer/receive', params: { ids: ids.join(',') } }) + return await request.put({url: '/crm/customer/receive', params: {ids: ids.join(',')}}) } // 分配公海给对应负责人 export const distributeCustomer = async (ids: any[], ownerUserId: number) => { return await request.put({ url: '/crm/customer/distribute', - data: { ids: ids, ownerUserId } + data: {ids: ids, ownerUserId} }) } // 客户放入公海 export const putCustomerPool = async (id: number) => { - return await request.put({ url: `/crm/customer/put-pool?id=${id}` }) + return await request.put({url: `/crm/customer/put-pool?id=${id}`}) } diff --git a/yudao-admin-vue3/src/api/crm/customer/limitConfig/index.ts b/yudao-admin-vue3/src/api/crm/customer/limitConfig/index.ts index 8677632..a0d93dd 100644 --- a/yudao-admin-vue3/src/api/crm/customer/limitConfig/index.ts +++ b/yudao-admin-vue3/src/api/crm/customer/limitConfig/index.ts @@ -25,25 +25,25 @@ export enum LimitConfType { // 查询客户限制配置列表 export const getCustomerLimitConfigPage = async (params) => { - return await request.get({ url: `/crm/customer-limit-config/page`, params }) + return await request.get({url: `/crm/customer-limit-config/page`, params}) } // 查询客户限制配置详情 export const getCustomerLimitConfig = async (id: number) => { - return await request.get({ url: `/crm/customer-limit-config/get?id=` + id }) + return await request.get({url: `/crm/customer-limit-config/get?id=` + id}) } // 新增客户限制配置 export const createCustomerLimitConfig = async (data: CustomerLimitConfigVO) => { - return await request.post({ url: `/crm/customer-limit-config/create`, data }) + return await request.post({url: `/crm/customer-limit-config/create`, data}) } // 修改客户限制配置 export const updateCustomerLimitConfig = async (data: CustomerLimitConfigVO) => { - return await request.put({ url: `/crm/customer-limit-config/update`, data }) + return await request.put({url: `/crm/customer-limit-config/update`, data}) } // 删除客户限制配置 export const deleteCustomerLimitConfig = async (id: number) => { - return await request.delete({ url: `/crm/customer-limit-config/delete?id=` + id }) + return await request.delete({url: `/crm/customer-limit-config/delete?id=` + id}) } diff --git a/yudao-admin-vue3/src/api/crm/customer/poolConfig/index.ts b/yudao-admin-vue3/src/api/crm/customer/poolConfig/index.ts index b96e61f..5206bf5 100644 --- a/yudao-admin-vue3/src/api/crm/customer/poolConfig/index.ts +++ b/yudao-admin-vue3/src/api/crm/customer/poolConfig/index.ts @@ -10,10 +10,10 @@ export interface CustomerPoolConfigVO { // 获取客户公海规则设置 export const getCustomerPoolConfig = async () => { - return await request.get({ url: `/crm/customer-pool-config/get` }) + return await request.get({url: `/crm/customer-pool-config/get`}) } // 更新客户公海规则设置 export const saveCustomerPoolConfig = async (data: CustomerPoolConfigVO) => { - return await request.put({ url: `/crm/customer-pool-config/save`, data }) + return await request.put({url: `/crm/customer-pool-config/save`, data}) } diff --git a/yudao-admin-vue3/src/api/crm/followup/index.ts b/yudao-admin-vue3/src/api/crm/followup/index.ts index 414f3f7..1cb3975 100644 --- a/yudao-admin-vue3/src/api/crm/followup/index.ts +++ b/yudao-admin-vue3/src/api/crm/followup/index.ts @@ -28,16 +28,16 @@ export interface FollowUpRecordVO { export const FollowUpRecordApi = { // 查询跟进记录分页 getFollowUpRecordPage: async (params: any) => { - return await request.get({ url: `/crm/follow-up-record/page`, params }) + return await request.get({url: `/crm/follow-up-record/page`, params}) }, // 新增跟进记录 createFollowUpRecord: async (data: FollowUpRecordVO) => { - return await request.post({ url: `/crm/follow-up-record/create`, data }) + return await request.post({url: `/crm/follow-up-record/create`, data}) }, // 删除跟进记录 deleteFollowUpRecord: async (id: number) => { - return await request.delete({ url: `/crm/follow-up-record/delete?id=` + id }) + return await request.delete({url: `/crm/follow-up-record/delete?id=` + id}) } } diff --git a/yudao-admin-vue3/src/api/crm/intelligent.ts b/yudao-admin-vue3/src/api/crm/intelligent.ts index e1e0883..249bb61 100644 --- a/yudao-admin-vue3/src/api/crm/intelligent.ts +++ b/yudao-admin-vue3/src/api/crm/intelligent.ts @@ -4,20 +4,20 @@ import request from '@/config/axios' export const FollowUpRecordApi = { // 查询表单列表 selectDynamicData: async () => { - return await request.get({ url: `/intelligentForm/selectDynamicData`}) + return await request.get({url: `/intelligentForm/selectDynamicData`}) }, //添加智能表单 saveDynamicData: async (data) => { - return await request.post({ url: `/intelligentForm/saveDynamicData`, data }) + return await request.post({url: `/intelligentForm/saveDynamicData`, data}) }, //查询对应表单的采集数据列表 - collectDataList: async(query) => { + collectDataList: async (query) => { return await request.get({ url: '/intelligentForm/collectDataList', method: 'get', - params: {id:query} + params: {id: query} }) } } diff --git a/yudao-admin-vue3/src/api/crm/operateLog/index.ts b/yudao-admin-vue3/src/api/crm/operateLog/index.ts index d0f25b6..6db04af 100644 --- a/yudao-admin-vue3/src/api/crm/operateLog/index.ts +++ b/yudao-admin-vue3/src/api/crm/operateLog/index.ts @@ -7,5 +7,5 @@ export interface OperateLogVO extends PageParam { // 获得操作日志 export const getOperateLogPage = async (params: OperateLogVO) => { - return await request.get({ url: `/crm/operate-log/page`, params }) + return await request.get({url: `/crm/operate-log/page`, params}) } diff --git a/yudao-admin-vue3/src/api/crm/permission/index.ts b/yudao-admin-vue3/src/api/crm/permission/index.ts index 4f88b14..3bce763 100644 --- a/yudao-admin-vue3/src/api/crm/permission/index.ts +++ b/yudao-admin-vue3/src/api/crm/permission/index.ts @@ -48,25 +48,25 @@ export enum PermissionLevelEnum { // 获得数据权限列表(查询团队成员列表) export const getPermissionList = async (params) => { - return await request.get({ url: `/crm/permission/list`, params }) + return await request.get({url: `/crm/permission/list`, params}) } // 创建数据权限(新增团队成员) export const createPermission = async (data: PermissionVO) => { - return await request.post({ url: `/crm/permission/create`, data }) + return await request.post({url: `/crm/permission/create`, data}) } // 编辑数据权限(修改团队成员权限级别) export const updatePermission = async (data) => { - return await request.put({ url: `/crm/permission/update`, data }) + return await request.put({url: `/crm/permission/update`, data}) } // 删除数据权限(删除团队成员) export const deletePermissionBatch = async (val: number[]) => { - return await request.delete({ url: '/crm/permission/delete?ids=' + val.join(',') }) + return await request.delete({url: '/crm/permission/delete?ids=' + val.join(',')}) } // 删除自己的数据权限(退出团队) export const deleteSelfPermission = async (id: number) => { - return await request.delete({ url: '/crm/permission/delete-self?id=' + id }) + return await request.delete({url: '/crm/permission/delete-self?id=' + id}) } diff --git a/yudao-admin-vue3/src/api/crm/product/category/index.ts b/yudao-admin-vue3/src/api/crm/product/category/index.ts index 6341d1b..417be6d 100644 --- a/yudao-admin-vue3/src/api/crm/product/category/index.ts +++ b/yudao-admin-vue3/src/api/crm/product/category/index.ts @@ -9,25 +9,25 @@ export interface ProductCategoryVO { // 查询产品分类详情 export const getProductCategory = async (id: number) => { - return await request.get({ url: `/crm/product-category/get?id=` + id }) + return await request.get({url: `/crm/product-category/get?id=` + id}) } // 新增产品分类 export const createProductCategory = async (data: ProductCategoryVO) => { - return await request.post({ url: `/crm/product-category/create`, data }) + return await request.post({url: `/crm/product-category/create`, data}) } // 修改产品分类 export const updateProductCategory = async (data: ProductCategoryVO) => { - return await request.put({ url: `/crm/product-category/update`, data }) + return await request.put({url: `/crm/product-category/update`, data}) } // 删除产品分类 export const deleteProductCategory = async (id: number) => { - return await request.delete({ url: `/crm/product-category/delete?id=` + id }) + return await request.delete({url: `/crm/product-category/delete?id=` + id}) } // 产品分类列表 export const getProductCategoryList = async (params) => { - return await request.get({ url: `/crm/product-category/list`, params }) + return await request.get({url: `/crm/product-category/list`, params}) } diff --git a/yudao-admin-vue3/src/api/crm/product/index.ts b/yudao-admin-vue3/src/api/crm/product/index.ts index f0c2328..36af53c 100644 --- a/yudao-admin-vue3/src/api/crm/product/index.ts +++ b/yudao-admin-vue3/src/api/crm/product/index.ts @@ -15,35 +15,35 @@ export interface ProductVO { // 查询产品列表 export const getProductPage = async (params) => { - return await request.get({ url: `/crm/product/page`, params }) + return await request.get({url: `/crm/product/page`, params}) } // 获得产品精简列表 export const getProductSimpleList = async () => { - return await request.get({ url: `/crm/product/simple-list` }) + return await request.get({url: `/crm/product/simple-list`}) } // 查询产品详情 export const getProduct = async (id: number) => { - return await request.get({ url: `/crm/product/get?id=` + id }) + return await request.get({url: `/crm/product/get?id=` + id}) } // 新增产品 export const createProduct = async (data: ProductVO) => { - return await request.post({ url: `/crm/product/create`, data }) + return await request.post({url: `/crm/product/create`, data}) } // 修改产品 export const updateProduct = async (data: ProductVO) => { - return await request.put({ url: `/crm/product/update`, data }) + return await request.put({url: `/crm/product/update`, data}) } // 删除产品 export const deleteProduct = async (id: number) => { - return await request.delete({ url: `/crm/product/delete?id=` + id }) + return await request.delete({url: `/crm/product/delete?id=` + id}) } // 导出产品 Excel export const exportProduct = async (params) => { - return await request.download({ url: `/crm/product/export-excel`, params }) + return await request.download({url: `/crm/product/export-excel`, params}) } diff --git a/yudao-admin-vue3/src/api/crm/receivable/index.ts b/yudao-admin-vue3/src/api/crm/receivable/index.ts index 32ecd25..af467ad 100644 --- a/yudao-admin-vue3/src/api/crm/receivable/index.ts +++ b/yudao-admin-vue3/src/api/crm/receivable/index.ts @@ -29,45 +29,45 @@ export interface ReceivableVO { // 查询回款列表 export const getReceivablePage = async (params) => { - return await request.get({ url: `/crm/receivable/page`, params }) + return await request.get({url: `/crm/receivable/page`, params}) } // 查询回款列表 export const getReceivablePageByCustomer = async (params) => { - return await request.get({ url: `/crm/receivable/page-by-customer`, params }) + return await request.get({url: `/crm/receivable/page-by-customer`, params}) } // 查询回款详情 export const getReceivable = async (id: number) => { - return await request.get({ url: `/crm/receivable/get?id=` + id }) + return await request.get({url: `/crm/receivable/get?id=` + id}) } // 新增回款 export const createReceivable = async (data: ReceivableVO) => { - return await request.post({ url: `/crm/receivable/create`, data }) + return await request.post({url: `/crm/receivable/create`, data}) } // 修改回款 export const updateReceivable = async (data: ReceivableVO) => { - return await request.put({ url: `/crm/receivable/update`, data }) + return await request.put({url: `/crm/receivable/update`, data}) } // 删除回款 export const deleteReceivable = async (id: number) => { - return await request.delete({ url: `/crm/receivable/delete?id=` + id }) + return await request.delete({url: `/crm/receivable/delete?id=` + id}) } // 导出回款 Excel export const exportReceivable = async (params) => { - return await request.download({ url: `/crm/receivable/export-excel`, params }) + return await request.download({url: `/crm/receivable/export-excel`, params}) } // 提交审核 export const submitReceivable = async (id: number) => { - return await request.put({ url: `/crm/receivable/submit?id=${id}` }) + return await request.put({url: `/crm/receivable/submit?id=${id}`}) } // 获得待审核回款数量 export const getAuditReceivableCount = async () => { - return await request.get({ url: '/crm/receivable/audit-count' }) + return await request.get({url: '/crm/receivable/audit-count'}) } diff --git a/yudao-admin-vue3/src/api/crm/receivable/plan/index.ts b/yudao-admin-vue3/src/api/crm/receivable/plan/index.ts index 770b347..5553772 100644 --- a/yudao-admin-vue3/src/api/crm/receivable/plan/index.ts +++ b/yudao-admin-vue3/src/api/crm/receivable/plan/index.ts @@ -28,17 +28,17 @@ export interface ReceivablePlanVO { // 查询回款计划列表 export const getReceivablePlanPage = async (params) => { - return await request.get({ url: `/crm/receivable-plan/page`, params }) + return await request.get({url: `/crm/receivable-plan/page`, params}) } // 查询回款计划列表 export const getReceivablePlanPageByCustomer = async (params) => { - return await request.get({ url: `/crm/receivable-plan/page-by-customer`, params }) + return await request.get({url: `/crm/receivable-plan/page-by-customer`, params}) } // 查询回款计划详情 export const getReceivablePlan = async (id: number) => { - return await request.get({ url: `/crm/receivable-plan/get?id=` + id }) + return await request.get({url: `/crm/receivable-plan/get?id=` + id}) } // 查询回款计划下拉数据 @@ -50,25 +50,25 @@ export const getReceivablePlanSimpleList = async (customerId: number, contractId // 新增回款计划 export const createReceivablePlan = async (data: ReceivablePlanVO) => { - return await request.post({ url: `/crm/receivable-plan/create`, data }) + return await request.post({url: `/crm/receivable-plan/create`, data}) } // 修改回款计划 export const updateReceivablePlan = async (data: ReceivablePlanVO) => { - return await request.put({ url: `/crm/receivable-plan/update`, data }) + return await request.put({url: `/crm/receivable-plan/update`, data}) } // 删除回款计划 export const deleteReceivablePlan = async (id: number) => { - return await request.delete({ url: `/crm/receivable-plan/delete?id=` + id }) + return await request.delete({url: `/crm/receivable-plan/delete?id=` + id}) } // 导出回款计划 Excel export const exportReceivablePlan = async (params) => { - return await request.download({ url: `/crm/receivable-plan/export-excel`, params }) + return await request.download({url: `/crm/receivable-plan/export-excel`, params}) } // 获得待回款提醒数量 export const getReceivablePlanRemindCount = async () => { - return await request.get({ url: '/crm/receivable-plan/remind-count' }) + return await request.get({url: '/crm/receivable-plan/remind-count'}) } diff --git a/yudao-admin-vue3/src/api/erp/finance/account/index.ts b/yudao-admin-vue3/src/api/erp/finance/account/index.ts index a62b180..484923e 100644 --- a/yudao-admin-vue3/src/api/erp/finance/account/index.ts +++ b/yudao-admin-vue3/src/api/erp/finance/account/index.ts @@ -15,27 +15,27 @@ export interface AccountVO { export const AccountApi = { // 查询结算账户分页 getAccountPage: async (params: any) => { - return await request.get({ url: `/erp/account/page`, params }) + return await request.get({url: `/erp/account/page`, params}) }, // 查询结算账户精简列表 getAccountSimpleList: async () => { - return await request.get({ url: `/erp/account/simple-list` }) + return await request.get({url: `/erp/account/simple-list`}) }, // 查询结算账户详情 getAccount: async (id: number) => { - return await request.get({ url: `/erp/account/get?id=` + id }) + return await request.get({url: `/erp/account/get?id=` + id}) }, // 新增结算账户 createAccount: async (data: AccountVO) => { - return await request.post({ url: `/erp/account/create`, data }) + return await request.post({url: `/erp/account/create`, data}) }, // 修改结算账户 updateAccount: async (data: AccountVO) => { - return await request.put({ url: `/erp/account/update`, data }) + return await request.put({url: `/erp/account/update`, data}) }, // 修改结算账户默认状态 @@ -51,11 +51,11 @@ export const AccountApi = { // 删除结算账户 deleteAccount: async (id: number) => { - return await request.delete({ url: `/erp/account/delete?id=` + id }) + return await request.delete({url: `/erp/account/delete?id=` + id}) }, // 导出结算账户 Excel exportAccount: async (params: any) => { - return await request.download({ url: `/erp/account/export-excel`, params }) + return await request.download({url: `/erp/account/export-excel`, params}) } } diff --git a/yudao-admin-vue3/src/api/erp/finance/payment/index.ts b/yudao-admin-vue3/src/api/erp/finance/payment/index.ts index c6749db..6cf9b4e 100644 --- a/yudao-admin-vue3/src/api/erp/finance/payment/index.ts +++ b/yudao-admin-vue3/src/api/erp/finance/payment/index.ts @@ -15,22 +15,22 @@ export interface FinancePaymentVO { export const FinancePaymentApi = { // 查询付款单分页 getFinancePaymentPage: async (params: any) => { - return await request.get({ url: `/erp/finance-payment/page`, params }) + return await request.get({url: `/erp/finance-payment/page`, params}) }, // 查询付款单详情 getFinancePayment: async (id: number) => { - return await request.get({ url: `/erp/finance-payment/get?id=` + id }) + return await request.get({url: `/erp/finance-payment/get?id=` + id}) }, // 新增付款单 createFinancePayment: async (data: FinancePaymentVO) => { - return await request.post({ url: `/erp/finance-payment/create`, data }) + return await request.post({url: `/erp/finance-payment/create`, data}) }, // 修改付款单 updateFinancePayment: async (data: FinancePaymentVO) => { - return await request.put({ url: `/erp/finance-payment/update`, data }) + return await request.put({url: `/erp/finance-payment/update`, data}) }, // 更新付款单的状态 @@ -56,6 +56,6 @@ export const FinancePaymentApi = { // 导出付款单 Excel exportFinancePayment: async (params: any) => { - return await request.download({ url: `/erp/finance-payment/export-excel`, params }) + return await request.download({url: `/erp/finance-payment/export-excel`, params}) } } diff --git a/yudao-admin-vue3/src/api/erp/finance/receipt/index.ts b/yudao-admin-vue3/src/api/erp/finance/receipt/index.ts index 4de28ca..2850fe7 100644 --- a/yudao-admin-vue3/src/api/erp/finance/receipt/index.ts +++ b/yudao-admin-vue3/src/api/erp/finance/receipt/index.ts @@ -15,22 +15,22 @@ export interface FinanceReceiptVO { export const FinanceReceiptApi = { // 查询收款单分页 getFinanceReceiptPage: async (params: any) => { - return await request.get({ url: `/erp/finance-receipt/page`, params }) + return await request.get({url: `/erp/finance-receipt/page`, params}) }, // 查询收款单详情 getFinanceReceipt: async (id: number) => { - return await request.get({ url: `/erp/finance-receipt/get?id=` + id }) + return await request.get({url: `/erp/finance-receipt/get?id=` + id}) }, // 新增收款单 createFinanceReceipt: async (data: FinanceReceiptVO) => { - return await request.post({ url: `/erp/finance-receipt/create`, data }) + return await request.post({url: `/erp/finance-receipt/create`, data}) }, // 修改收款单 updateFinanceReceipt: async (data: FinanceReceiptVO) => { - return await request.put({ url: `/erp/finance-receipt/update`, data }) + return await request.put({url: `/erp/finance-receipt/update`, data}) }, // 更新收款单的状态 @@ -56,6 +56,6 @@ export const FinanceReceiptApi = { // 导出收款单 Excel exportFinanceReceipt: async (params: any) => { - return await request.download({ url: `/erp/finance-receipt/export-excel`, params }) + return await request.download({url: `/erp/finance-receipt/export-excel`, params}) } } diff --git a/yudao-admin-vue3/src/api/erp/product/category/index.ts b/yudao-admin-vue3/src/api/erp/product/category/index.ts index d67ccff..a470771 100644 --- a/yudao-admin-vue3/src/api/erp/product/category/index.ts +++ b/yudao-admin-vue3/src/api/erp/product/category/index.ts @@ -14,36 +14,36 @@ export interface ProductCategoryVO { export const ProductCategoryApi = { // 查询产品分类列表 getProductCategoryList: async () => { - return await request.get({ url: `/erp/product-category/list` }) + return await request.get({url: `/erp/product-category/list`}) }, // 查询产品分类精简列表 getProductCategorySimpleList: async () => { - return await request.get({ url: `/erp/product-category/simple-list` }) + return await request.get({url: `/erp/product-category/simple-list`}) }, // 查询产品分类详情 getProductCategory: async (id: number) => { - return await request.get({ url: `/erp/product-category/get?id=` + id }) + return await request.get({url: `/erp/product-category/get?id=` + id}) }, // 新增产品分类 createProductCategory: async (data: ProductCategoryVO) => { - return await request.post({ url: `/erp/product-category/create`, data }) + return await request.post({url: `/erp/product-category/create`, data}) }, // 修改产品分类 updateProductCategory: async (data: ProductCategoryVO) => { - return await request.put({ url: `/erp/product-category/update`, data }) + return await request.put({url: `/erp/product-category/update`, data}) }, // 删除产品分类 deleteProductCategory: async (id: number) => { - return await request.delete({ url: `/erp/product-category/delete?id=` + id }) + return await request.delete({url: `/erp/product-category/delete?id=` + id}) }, // 导出产品分类 Excel exportProductCategory: async (params) => { - return await request.download({ url: `/erp/product-category/export-excel`, params }) + return await request.download({url: `/erp/product-category/export-excel`, params}) } } diff --git a/yudao-admin-vue3/src/api/erp/product/product/index.ts b/yudao-admin-vue3/src/api/erp/product/product/index.ts index 1136282..db1a444 100644 --- a/yudao-admin-vue3/src/api/erp/product/product/index.ts +++ b/yudao-admin-vue3/src/api/erp/product/product/index.ts @@ -22,36 +22,36 @@ export interface ProductVO { export const ProductApi = { // 查询产品分页 getProductPage: async (params: any) => { - return await request.get({ url: `/erp/product/page`, params }) + return await request.get({url: `/erp/product/page`, params}) }, // 查询产品精简列表 getProductSimpleList: async () => { - return await request.get({ url: `/erp/product/simple-list` }) + return await request.get({url: `/erp/product/simple-list`}) }, // 查询产品详情 getProduct: async (id: number) => { - return await request.get({ url: `/erp/product/get?id=` + id }) + return await request.get({url: `/erp/product/get?id=` + id}) }, // 新增产品 createProduct: async (data: ProductVO) => { - return await request.post({ url: `/erp/product/create`, data }) + return await request.post({url: `/erp/product/create`, data}) }, // 修改产品 updateProduct: async (data: ProductVO) => { - return await request.put({ url: `/erp/product/update`, data }) + return await request.put({url: `/erp/product/update`, data}) }, // 删除产品 deleteProduct: async (id: number) => { - return await request.delete({ url: `/erp/product/delete?id=` + id }) + return await request.delete({url: `/erp/product/delete?id=` + id}) }, // 导出产品 Excel exportProduct: async (params) => { - return await request.download({ url: `/erp/product/export-excel`, params }) + return await request.download({url: `/erp/product/export-excel`, params}) } } diff --git a/yudao-admin-vue3/src/api/erp/product/unit/index.ts b/yudao-admin-vue3/src/api/erp/product/unit/index.ts index 1e1c8ac..42c7633 100644 --- a/yudao-admin-vue3/src/api/erp/product/unit/index.ts +++ b/yudao-admin-vue3/src/api/erp/product/unit/index.ts @@ -11,36 +11,36 @@ export interface ProductUnitVO { export const ProductUnitApi = { // 查询产品单位分页 getProductUnitPage: async (params: any) => { - return await request.get({ url: `/erp/product-unit/page`, params }) + return await request.get({url: `/erp/product-unit/page`, params}) }, // 查询产品单位精简列表 getProductUnitSimpleList: async () => { - return await request.get({ url: `/erp/product-unit/simple-list` }) + return await request.get({url: `/erp/product-unit/simple-list`}) }, // 查询产品单位详情 getProductUnit: async (id: number) => { - return await request.get({ url: `/erp/product-unit/get?id=` + id }) + return await request.get({url: `/erp/product-unit/get?id=` + id}) }, // 新增产品单位 createProductUnit: async (data: ProductUnitVO) => { - return await request.post({ url: `/erp/product-unit/create`, data }) + return await request.post({url: `/erp/product-unit/create`, data}) }, // 修改产品单位 updateProductUnit: async (data: ProductUnitVO) => { - return await request.put({ url: `/erp/product-unit/update`, data }) + return await request.put({url: `/erp/product-unit/update`, data}) }, // 删除产品单位 deleteProductUnit: async (id: number) => { - return await request.delete({ url: `/erp/product-unit/delete?id=` + id }) + return await request.delete({url: `/erp/product-unit/delete?id=` + id}) }, // 导出产品单位 Excel exportProductUnit: async (params) => { - return await request.download({ url: `/erp/product-unit/export-excel`, params }) + return await request.download({url: `/erp/product-unit/export-excel`, params}) } } diff --git a/yudao-admin-vue3/src/api/erp/purchase/in/index.ts b/yudao-admin-vue3/src/api/erp/purchase/in/index.ts index f94708d..7d7e902 100644 --- a/yudao-admin-vue3/src/api/erp/purchase/in/index.ts +++ b/yudao-admin-vue3/src/api/erp/purchase/in/index.ts @@ -18,22 +18,22 @@ export interface PurchaseInVO { export const PurchaseInApi = { // 查询采购入库分页 getPurchaseInPage: async (params: any) => { - return await request.get({ url: `/erp/purchase-in/page`, params }) + return await request.get({url: `/erp/purchase-in/page`, params}) }, // 查询采购入库详情 getPurchaseIn: async (id: number) => { - return await request.get({ url: `/erp/purchase-in/get?id=` + id }) + return await request.get({url: `/erp/purchase-in/get?id=` + id}) }, // 新增采购入库 createPurchaseIn: async (data: PurchaseInVO) => { - return await request.post({ url: `/erp/purchase-in/create`, data }) + return await request.post({url: `/erp/purchase-in/create`, data}) }, // 修改采购入库 updatePurchaseIn: async (data: PurchaseInVO) => { - return await request.put({ url: `/erp/purchase-in/update`, data }) + return await request.put({url: `/erp/purchase-in/update`, data}) }, // 更新采购入库的状态 @@ -59,6 +59,6 @@ export const PurchaseInApi = { // 导出采购入库 Excel exportPurchaseIn: async (params: any) => { - return await request.download({ url: `/erp/purchase-in/export-excel`, params }) + return await request.download({url: `/erp/purchase-in/export-excel`, params}) } } diff --git a/yudao-admin-vue3/src/api/erp/purchase/order/index.ts b/yudao-admin-vue3/src/api/erp/purchase/order/index.ts index ad3222f..6f98d6b 100644 --- a/yudao-admin-vue3/src/api/erp/purchase/order/index.ts +++ b/yudao-admin-vue3/src/api/erp/purchase/order/index.ts @@ -18,22 +18,22 @@ export interface PurchaseOrderVO { export const PurchaseOrderApi = { // 查询采购订单分页 getPurchaseOrderPage: async (params: any) => { - return await request.get({ url: `/erp/purchase-order/page`, params }) + return await request.get({url: `/erp/purchase-order/page`, params}) }, // 查询采购订单详情 getPurchaseOrder: async (id: number) => { - return await request.get({ url: `/erp/purchase-order/get?id=` + id }) + return await request.get({url: `/erp/purchase-order/get?id=` + id}) }, // 新增采购订单 createPurchaseOrder: async (data: PurchaseOrderVO) => { - return await request.post({ url: `/erp/purchase-order/create`, data }) + return await request.post({url: `/erp/purchase-order/create`, data}) }, // 修改采购订单 updatePurchaseOrder: async (data: PurchaseOrderVO) => { - return await request.put({ url: `/erp/purchase-order/update`, data }) + return await request.put({url: `/erp/purchase-order/update`, data}) }, // 更新采购订单的状态 @@ -59,6 +59,6 @@ export const PurchaseOrderApi = { // 导出采购订单 Excel exportPurchaseOrder: async (params: any) => { - return await request.download({ url: `/erp/purchase-order/export-excel`, params }) + return await request.download({url: `/erp/purchase-order/export-excel`, params}) } } diff --git a/yudao-admin-vue3/src/api/erp/purchase/return/index.ts b/yudao-admin-vue3/src/api/erp/purchase/return/index.ts index 182e04e..8501891 100644 --- a/yudao-admin-vue3/src/api/erp/purchase/return/index.ts +++ b/yudao-admin-vue3/src/api/erp/purchase/return/index.ts @@ -16,22 +16,22 @@ export interface PurchaseReturnVO { export const PurchaseReturnApi = { // 查询采购退货分页 getPurchaseReturnPage: async (params: any) => { - return await request.get({ url: `/erp/purchase-return/page`, params }) + return await request.get({url: `/erp/purchase-return/page`, params}) }, // 查询采购退货详情 getPurchaseReturn: async (id: number) => { - return await request.get({ url: `/erp/purchase-return/get?id=` + id }) + return await request.get({url: `/erp/purchase-return/get?id=` + id}) }, // 新增采购退货 createPurchaseReturn: async (data: PurchaseReturnVO) => { - return await request.post({ url: `/erp/purchase-return/create`, data }) + return await request.post({url: `/erp/purchase-return/create`, data}) }, // 修改采购退货 updatePurchaseReturn: async (data: PurchaseReturnVO) => { - return await request.put({ url: `/erp/purchase-return/update`, data }) + return await request.put({url: `/erp/purchase-return/update`, data}) }, // 更新采购退货的状态 @@ -57,6 +57,6 @@ export const PurchaseReturnApi = { // 导出采购退货 Excel exportPurchaseReturn: async (params: any) => { - return await request.download({ url: `/erp/purchase-return/export-excel`, params }) + return await request.download({url: `/erp/purchase-return/export-excel`, params}) } } diff --git a/yudao-admin-vue3/src/api/erp/purchase/supplier/index.ts b/yudao-admin-vue3/src/api/erp/purchase/supplier/index.ts index 34729a5..660a9d8 100644 --- a/yudao-admin-vue3/src/api/erp/purchase/supplier/index.ts +++ b/yudao-admin-vue3/src/api/erp/purchase/supplier/index.ts @@ -23,36 +23,36 @@ export interface SupplierVO { export const SupplierApi = { // 查询供应商分页 getSupplierPage: async (params: any) => { - return await request.get({ url: `/erp/supplier/page`, params }) + return await request.get({url: `/erp/supplier/page`, params}) }, // 获得供应商精简列表 getSupplierSimpleList: async () => { - return await request.get({ url: `/erp/supplier/simple-list` }) + return await request.get({url: `/erp/supplier/simple-list`}) }, // 查询供应商详情 getSupplier: async (id: number) => { - return await request.get({ url: `/erp/supplier/get?id=` + id }) + return await request.get({url: `/erp/supplier/get?id=` + id}) }, // 新增供应商 createSupplier: async (data: SupplierVO) => { - return await request.post({ url: `/erp/supplier/create`, data }) + return await request.post({url: `/erp/supplier/create`, data}) }, // 修改供应商 updateSupplier: async (data: SupplierVO) => { - return await request.put({ url: `/erp/supplier/update`, data }) + return await request.put({url: `/erp/supplier/update`, data}) }, // 删除供应商 deleteSupplier: async (id: number) => { - return await request.delete({ url: `/erp/supplier/delete?id=` + id }) + return await request.delete({url: `/erp/supplier/delete?id=` + id}) }, // 导出供应商 Excel exportSupplier: async (params) => { - return await request.download({ url: `/erp/supplier/export-excel`, params }) + return await request.download({url: `/erp/supplier/export-excel`, params}) } } diff --git a/yudao-admin-vue3/src/api/erp/sale/customer/index.ts b/yudao-admin-vue3/src/api/erp/sale/customer/index.ts index 3aaefb5..cd8fefb 100644 --- a/yudao-admin-vue3/src/api/erp/sale/customer/index.ts +++ b/yudao-admin-vue3/src/api/erp/sale/customer/index.ts @@ -23,36 +23,36 @@ export interface CustomerVO { export const CustomerApi = { // 查询客户分页 getCustomerPage: async (params: any) => { - return await request.get({ url: `/erp/customer/page`, params }) + return await request.get({url: `/erp/customer/page`, params}) }, // 查询客户精简列表 getCustomerSimpleList: async () => { - return await request.get({ url: `/erp/customer/simple-list` }) + return await request.get({url: `/erp/customer/simple-list`}) }, // 查询客户详情 getCustomer: async (id: number) => { - return await request.get({ url: `/erp/customer/get?id=` + id }) + return await request.get({url: `/erp/customer/get?id=` + id}) }, // 新增客户 createCustomer: async (data: CustomerVO) => { - return await request.post({ url: `/erp/customer/create`, data }) + return await request.post({url: `/erp/customer/create`, data}) }, // 修改客户 updateCustomer: async (data: CustomerVO) => { - return await request.put({ url: `/erp/customer/update`, data }) + return await request.put({url: `/erp/customer/update`, data}) }, // 删除客户 deleteCustomer: async (id: number) => { - return await request.delete({ url: `/erp/customer/delete?id=` + id }) + return await request.delete({url: `/erp/customer/delete?id=` + id}) }, // 导出客户 Excel exportCustomer: async (params) => { - return await request.download({ url: `/erp/customer/export-excel`, params }) + return await request.download({url: `/erp/customer/export-excel`, params}) } } diff --git a/yudao-admin-vue3/src/api/erp/sale/order/index.ts b/yudao-admin-vue3/src/api/erp/sale/order/index.ts index 2d2ac53..588aac1 100644 --- a/yudao-admin-vue3/src/api/erp/sale/order/index.ts +++ b/yudao-admin-vue3/src/api/erp/sale/order/index.ts @@ -18,22 +18,22 @@ export interface SaleOrderVO { export const SaleOrderApi = { // 查询销售订单分页 getSaleOrderPage: async (params: any) => { - return await request.get({ url: `/erp/sale-order/page`, params }) + return await request.get({url: `/erp/sale-order/page`, params}) }, // 查询销售订单详情 getSaleOrder: async (id: number) => { - return await request.get({ url: `/erp/sale-order/get?id=` + id }) + return await request.get({url: `/erp/sale-order/get?id=` + id}) }, // 新增销售订单 createSaleOrder: async (data: SaleOrderVO) => { - return await request.post({ url: `/erp/sale-order/create`, data }) + return await request.post({url: `/erp/sale-order/create`, data}) }, // 修改销售订单 updateSaleOrder: async (data: SaleOrderVO) => { - return await request.put({ url: `/erp/sale-order/update`, data }) + return await request.put({url: `/erp/sale-order/update`, data}) }, // 更新销售订单的状态 @@ -59,6 +59,6 @@ export const SaleOrderApi = { // 导出销售订单 Excel exportSaleOrder: async (params: any) => { - return await request.download({ url: `/erp/sale-order/export-excel`, params }) + return await request.download({url: `/erp/sale-order/export-excel`, params}) } } diff --git a/yudao-admin-vue3/src/api/erp/sale/out/index.ts b/yudao-admin-vue3/src/api/erp/sale/out/index.ts index cbc605e..7268b08 100644 --- a/yudao-admin-vue3/src/api/erp/sale/out/index.ts +++ b/yudao-admin-vue3/src/api/erp/sale/out/index.ts @@ -16,22 +16,22 @@ export interface SaleOutVO { export const SaleOutApi = { // 查询销售出库分页 getSaleOutPage: async (params: any) => { - return await request.get({ url: `/erp/sale-out/page`, params }) + return await request.get({url: `/erp/sale-out/page`, params}) }, // 查询销售出库详情 getSaleOut: async (id: number) => { - return await request.get({ url: `/erp/sale-out/get?id=` + id }) + return await request.get({url: `/erp/sale-out/get?id=` + id}) }, // 新增销售出库 createSaleOut: async (data: SaleOutVO) => { - return await request.post({ url: `/erp/sale-out/create`, data }) + return await request.post({url: `/erp/sale-out/create`, data}) }, // 修改销售出库 updateSaleOut: async (data: SaleOutVO) => { - return await request.put({ url: `/erp/sale-out/update`, data }) + return await request.put({url: `/erp/sale-out/update`, data}) }, // 更新销售出库的状态 @@ -57,6 +57,6 @@ export const SaleOutApi = { // 导出销售出库 Excel exportSaleOut: async (params: any) => { - return await request.download({ url: `/erp/sale-out/export-excel`, params }) + return await request.download({url: `/erp/sale-out/export-excel`, params}) } } diff --git a/yudao-admin-vue3/src/api/erp/sale/return/index.ts b/yudao-admin-vue3/src/api/erp/sale/return/index.ts index 160ac01..e0e3c8f 100644 --- a/yudao-admin-vue3/src/api/erp/sale/return/index.ts +++ b/yudao-admin-vue3/src/api/erp/sale/return/index.ts @@ -16,22 +16,22 @@ export interface SaleReturnVO { export const SaleReturnApi = { // 查询销售退货分页 getSaleReturnPage: async (params: any) => { - return await request.get({ url: `/erp/sale-return/page`, params }) + return await request.get({url: `/erp/sale-return/page`, params}) }, // 查询销售退货详情 getSaleReturn: async (id: number) => { - return await request.get({ url: `/erp/sale-return/get?id=` + id }) + return await request.get({url: `/erp/sale-return/get?id=` + id}) }, // 新增销售退货 createSaleReturn: async (data: SaleReturnVO) => { - return await request.post({ url: `/erp/sale-return/create`, data }) + return await request.post({url: `/erp/sale-return/create`, data}) }, // 修改销售退货 updateSaleReturn: async (data: SaleReturnVO) => { - return await request.put({ url: `/erp/sale-return/update`, data }) + return await request.put({url: `/erp/sale-return/update`, data}) }, // 更新销售退货的状态 @@ -57,6 +57,6 @@ export const SaleReturnApi = { // 导出销售退货 Excel exportSaleReturn: async (params: any) => { - return await request.download({ url: `/erp/sale-return/export-excel`, params }) + return await request.download({url: `/erp/sale-return/export-excel`, params}) } } diff --git a/yudao-admin-vue3/src/api/erp/statistics/purchase/index.ts b/yudao-admin-vue3/src/api/erp/statistics/purchase/index.ts index 80d907a..cada1ed 100644 --- a/yudao-admin-vue3/src/api/erp/statistics/purchase/index.ts +++ b/yudao-admin-vue3/src/api/erp/statistics/purchase/index.ts @@ -18,11 +18,11 @@ export interface ErpPurchaseTimeSummaryRespVO { export const PurchaseStatisticsApi = { // 获得采购统计 getPurchaseSummary: async (): Promise => { - return await request.get({ url: `/erp/purchase-statistics/summary` }) + return await request.get({url: `/erp/purchase-statistics/summary`}) }, // 获得采购时间段统计 getPurchaseTimeSummary: async (): Promise => { - return await request.get({ url: `/erp/purchase-statistics/time-summary` }) + return await request.get({url: `/erp/purchase-statistics/time-summary`}) } } diff --git a/yudao-admin-vue3/src/api/erp/statistics/sale/index.ts b/yudao-admin-vue3/src/api/erp/statistics/sale/index.ts index 09d8500..e4af3d4 100644 --- a/yudao-admin-vue3/src/api/erp/statistics/sale/index.ts +++ b/yudao-admin-vue3/src/api/erp/statistics/sale/index.ts @@ -18,11 +18,11 @@ export interface ErpSaleTimeSummaryRespVO { export const SaleStatisticsApi = { // 获得销售统计 getSaleSummary: async (): Promise => { - return await request.get({ url: `/erp/sale-statistics/summary` }) + return await request.get({url: `/erp/sale-statistics/summary`}) }, // 获得销售时间段统计 getSaleTimeSummary: async (): Promise => { - return await request.get({ url: `/erp/sale-statistics/time-summary` }) + return await request.get({url: `/erp/sale-statistics/time-summary`}) } } diff --git a/yudao-admin-vue3/src/api/erp/stock/check/index.ts b/yudao-admin-vue3/src/api/erp/stock/check/index.ts index 4a3e653..8ba6e25 100644 --- a/yudao-admin-vue3/src/api/erp/stock/check/index.ts +++ b/yudao-admin-vue3/src/api/erp/stock/check/index.ts @@ -15,22 +15,22 @@ export interface StockCheckVO { export const StockCheckApi = { // 查询库存盘点单分页 getStockCheckPage: async (params: any) => { - return await request.get({ url: `/erp/stock-check/page`, params }) + return await request.get({url: `/erp/stock-check/page`, params}) }, // 查询库存盘点单详情 getStockCheck: async (id: number) => { - return await request.get({ url: `/erp/stock-check/get?id=` + id }) + return await request.get({url: `/erp/stock-check/get?id=` + id}) }, // 新增库存盘点单 createStockCheck: async (data: StockCheckVO) => { - return await request.post({ url: `/erp/stock-check/create`, data }) + return await request.post({url: `/erp/stock-check/create`, data}) }, // 修改库存盘点单 updateStockCheck: async (data: StockCheckVO) => { - return await request.put({ url: `/erp/stock-check/update`, data }) + return await request.put({url: `/erp/stock-check/update`, data}) }, // 更新库存盘点单的状态 @@ -56,6 +56,6 @@ export const StockCheckApi = { // 导出库存盘点单 Excel exportStockCheck: async (params) => { - return await request.download({ url: `/erp/stock-check/export-excel`, params }) + return await request.download({url: `/erp/stock-check/export-excel`, params}) } } diff --git a/yudao-admin-vue3/src/api/erp/stock/in/index.ts b/yudao-admin-vue3/src/api/erp/stock/in/index.ts index 148b64f..dd4dadf 100644 --- a/yudao-admin-vue3/src/api/erp/stock/in/index.ts +++ b/yudao-admin-vue3/src/api/erp/stock/in/index.ts @@ -16,22 +16,22 @@ export interface StockInVO { export const StockInApi = { // 查询其它入库单分页 getStockInPage: async (params: any) => { - return await request.get({ url: `/erp/stock-in/page`, params }) + return await request.get({url: `/erp/stock-in/page`, params}) }, // 查询其它入库单详情 getStockIn: async (id: number) => { - return await request.get({ url: `/erp/stock-in/get?id=` + id }) + return await request.get({url: `/erp/stock-in/get?id=` + id}) }, // 新增其它入库单 createStockIn: async (data: StockInVO) => { - return await request.post({ url: `/erp/stock-in/create`, data }) + return await request.post({url: `/erp/stock-in/create`, data}) }, // 修改其它入库单 updateStockIn: async (data: StockInVO) => { - return await request.put({ url: `/erp/stock-in/update`, data }) + return await request.put({url: `/erp/stock-in/update`, data}) }, // 更新其它入库单的状态 @@ -57,6 +57,6 @@ export const StockInApi = { // 导出其它入库单 Excel exportStockIn: async (params) => { - return await request.download({ url: `/erp/stock-in/export-excel`, params }) + return await request.download({url: `/erp/stock-in/export-excel`, params}) } } diff --git a/yudao-admin-vue3/src/api/erp/stock/move/index.ts b/yudao-admin-vue3/src/api/erp/stock/move/index.ts index 398568e..75ae390 100644 --- a/yudao-admin-vue3/src/api/erp/stock/move/index.ts +++ b/yudao-admin-vue3/src/api/erp/stock/move/index.ts @@ -15,22 +15,22 @@ export interface StockMoveVO { export const StockMoveApi = { // 查询库存调度单分页 getStockMovePage: async (params: any) => { - return await request.get({ url: `/erp/stock-move/page`, params }) + return await request.get({url: `/erp/stock-move/page`, params}) }, // 查询库存调度单详情 getStockMove: async (id: number) => { - return await request.get({ url: `/erp/stock-move/get?id=` + id }) + return await request.get({url: `/erp/stock-move/get?id=` + id}) }, // 新增库存调度单 createStockMove: async (data: StockMoveVO) => { - return await request.post({ url: `/erp/stock-move/create`, data }) + return await request.post({url: `/erp/stock-move/create`, data}) }, // 修改库存调度单 updateStockMove: async (data: StockMoveVO) => { - return await request.put({ url: `/erp/stock-move/update`, data }) + return await request.put({url: `/erp/stock-move/update`, data}) }, // 更新库存调度单的状态 @@ -56,6 +56,6 @@ export const StockMoveApi = { // 导出库存调度单 Excel exportStockMove: async (params) => { - return await request.download({ url: `/erp/stock-move/export-excel`, params }) + return await request.download({url: `/erp/stock-move/export-excel`, params}) } } diff --git a/yudao-admin-vue3/src/api/erp/stock/out/index.ts b/yudao-admin-vue3/src/api/erp/stock/out/index.ts index f0f40d3..43419a3 100644 --- a/yudao-admin-vue3/src/api/erp/stock/out/index.ts +++ b/yudao-admin-vue3/src/api/erp/stock/out/index.ts @@ -16,22 +16,22 @@ export interface StockOutVO { export const StockOutApi = { // 查询其它出库单分页 getStockOutPage: async (params: any) => { - return await request.get({ url: `/erp/stock-out/page`, params }) + return await request.get({url: `/erp/stock-out/page`, params}) }, // 查询其它出库单详情 getStockOut: async (id: number) => { - return await request.get({ url: `/erp/stock-out/get?id=` + id }) + return await request.get({url: `/erp/stock-out/get?id=` + id}) }, // 新增其它出库单 createStockOut: async (data: StockOutVO) => { - return await request.post({ url: `/erp/stock-out/create`, data }) + return await request.post({url: `/erp/stock-out/create`, data}) }, // 修改其它出库单 updateStockOut: async (data: StockOutVO) => { - return await request.put({ url: `/erp/stock-out/update`, data }) + return await request.put({url: `/erp/stock-out/update`, data}) }, // 更新其它出库单的状态 @@ -57,6 +57,6 @@ export const StockOutApi = { // 导出其它出库单 Excel exportStockOut: async (params) => { - return await request.download({ url: `/erp/stock-out/export-excel`, params }) + return await request.download({url: `/erp/stock-out/export-excel`, params}) } } diff --git a/yudao-admin-vue3/src/api/erp/stock/record/index.ts b/yudao-admin-vue3/src/api/erp/stock/record/index.ts index a758eb4..08ae830 100644 --- a/yudao-admin-vue3/src/api/erp/stock/record/index.ts +++ b/yudao-admin-vue3/src/api/erp/stock/record/index.ts @@ -17,16 +17,16 @@ export interface StockRecordVO { export const StockRecordApi = { // 查询产品库存明细分页 getStockRecordPage: async (params: any) => { - return await request.get({ url: `/erp/stock-record/page`, params }) + return await request.get({url: `/erp/stock-record/page`, params}) }, // 查询产品库存明细详情 getStockRecord: async (id: number) => { - return await request.get({ url: `/erp/stock-record/get?id=` + id }) + return await request.get({url: `/erp/stock-record/get?id=` + id}) }, // 导出产品库存明细 Excel exportStockRecord: async (params) => { - return await request.download({ url: `/erp/stock-record/export-excel`, params }) + return await request.download({url: `/erp/stock-record/export-excel`, params}) } } diff --git a/yudao-admin-vue3/src/api/erp/stock/stock/index.ts b/yudao-admin-vue3/src/api/erp/stock/stock/index.ts index 4de86fb..d26900d 100644 --- a/yudao-admin-vue3/src/api/erp/stock/stock/index.ts +++ b/yudao-admin-vue3/src/api/erp/stock/stock/index.ts @@ -16,26 +16,26 @@ export interface StockVO { export const StockApi = { // 查询产品库存分页 getStockPage: async (params: any) => { - return await request.get({ url: `/erp/stock/page`, params }) + return await request.get({url: `/erp/stock/page`, params}) }, // 查询产品库存详情 getStock: async (id: number) => { - return await request.get({ url: `/erp/stock/get?id=` + id }) + return await request.get({url: `/erp/stock/get?id=` + id}) }, // 查询产品库存详情 getStock2: async (productId: number, warehouseId: number) => { - return await request.get({ url: `/erp/stock/get`, params: { productId, warehouseId } }) + return await request.get({url: `/erp/stock/get`, params: {productId, warehouseId}}) }, // 获得产品库存数量 getStockCount: async (productId: number) => { - return await request.get({ url: `/erp/stock/get-count`, params: { productId } }) + return await request.get({url: `/erp/stock/get-count`, params: {productId}}) }, // 导出产品库存 Excel exportStock: async (params) => { - return await request.download({ url: `/erp/stock/export-excel`, params }) + return await request.download({url: `/erp/stock/export-excel`, params}) } } diff --git a/yudao-admin-vue3/src/api/erp/stock/warehouse/index.ts b/yudao-admin-vue3/src/api/erp/stock/warehouse/index.ts index 598824b..e24f237 100644 --- a/yudao-admin-vue3/src/api/erp/stock/warehouse/index.ts +++ b/yudao-admin-vue3/src/api/erp/stock/warehouse/index.ts @@ -18,27 +18,27 @@ export interface WarehouseVO { export const WarehouseApi = { // 查询仓库分页 getWarehousePage: async (params: any) => { - return await request.get({ url: `/erp/warehouse/page`, params }) + return await request.get({url: `/erp/warehouse/page`, params}) }, // 查询仓库精简列表 getWarehouseSimpleList: async () => { - return await request.get({ url: `/erp/warehouse/simple-list` }) + return await request.get({url: `/erp/warehouse/simple-list`}) }, // 查询仓库详情 getWarehouse: async (id: number) => { - return await request.get({ url: `/erp/warehouse/get?id=` + id }) + return await request.get({url: `/erp/warehouse/get?id=` + id}) }, // 新增仓库 createWarehouse: async (data: WarehouseVO) => { - return await request.post({ url: `/erp/warehouse/create`, data }) + return await request.post({url: `/erp/warehouse/create`, data}) }, // 修改仓库 updateWarehouse: async (data: WarehouseVO) => { - return await request.put({ url: `/erp/warehouse/update`, data }) + return await request.put({url: `/erp/warehouse/update`, data}) }, // 修改仓库默认状态 @@ -54,11 +54,11 @@ export const WarehouseApi = { // 删除仓库 deleteWarehouse: async (id: number) => { - return await request.delete({ url: `/erp/warehouse/delete?id=` + id }) + return await request.delete({url: `/erp/warehouse/delete?id=` + id}) }, // 导出仓库 Excel exportWarehouse: async (params) => { - return await request.download({ url: `/erp/warehouse/export-excel`, params }) + return await request.download({url: `/erp/warehouse/export-excel`, params}) } } diff --git a/yudao-admin-vue3/src/api/infra/apiAccessLog/index.ts b/yudao-admin-vue3/src/api/infra/apiAccessLog/index.ts index 4fa50e1..54fe4a0 100644 --- a/yudao-admin-vue3/src/api/infra/apiAccessLog/index.ts +++ b/yudao-admin-vue3/src/api/infra/apiAccessLog/index.ts @@ -25,10 +25,10 @@ export interface ApiAccessLogVO { // 查询列表API 访问日志 export const getApiAccessLogPage = (params: PageParam) => { - return request.get({ url: '/infra/api-access-log/page', params }) + return request.get({url: '/infra/api-access-log/page', params}) } // 导出API 访问日志 export const exportApiAccessLog = (params) => { - return request.download({ url: '/infra/api-access-log/export-excel', params }) + return request.download({url: '/infra/api-access-log/export-excel', params}) } diff --git a/yudao-admin-vue3/src/api/infra/apiErrorLog/index.ts b/yudao-admin-vue3/src/api/infra/apiErrorLog/index.ts index 59ee214..41ae0ea 100644 --- a/yudao-admin-vue3/src/api/infra/apiErrorLog/index.ts +++ b/yudao-admin-vue3/src/api/infra/apiErrorLog/index.ts @@ -29,7 +29,7 @@ export interface ApiErrorLogVO { // 查询列表API 访问日志 export const getApiErrorLogPage = (params: PageParam) => { - return request.get({ url: '/infra/api-error-log/page', params }) + return request.get({url: '/infra/api-error-log/page', params}) } // 更新 API 错误日志的处理状态 diff --git a/yudao-admin-vue3/src/api/infra/codegen/index.ts b/yudao-admin-vue3/src/api/infra/codegen/index.ts index 441ca83..593ee8f 100644 --- a/yudao-admin-vue3/src/api/infra/codegen/index.ts +++ b/yudao-admin-vue3/src/api/infra/codegen/index.ts @@ -68,55 +68,55 @@ export type CodegenCreateListReqVO = { // 查询列表代码生成表定义 export const getCodegenTableList = (dataSourceConfigId: number) => { - return request.get({ url: '/infra/codegen/table/list?dataSourceConfigId=' + dataSourceConfigId }) + return request.get({url: '/infra/codegen/table/list?dataSourceConfigId=' + dataSourceConfigId}) } // 查询列表代码生成表定义 export const getCodegenTablePage = (params: PageParam) => { - return request.get({ url: '/infra/codegen/table/page', params }) + return request.get({url: '/infra/codegen/table/page', params}) } // 查询详情代码生成表定义 export const getCodegenTable = (id: number) => { - return request.get({ url: '/infra/codegen/detail?tableId=' + id }) + return request.get({url: '/infra/codegen/detail?tableId=' + id}) } // 新增代码生成表定义 export const createCodegenTable = (data: CodegenCreateListReqVO) => { - return request.post({ url: '/infra/codegen/create', data }) + return request.post({url: '/infra/codegen/create', data}) } // 修改代码生成表定义 export const updateCodegenTable = (data: CodegenUpdateReqVO) => { - return request.put({ url: '/infra/codegen/update', data }) + return request.put({url: '/infra/codegen/update', data}) } // 基于数据库的表结构,同步数据库的表和字段定义 export const syncCodegenFromDB = (id: number) => { - return request.put({ url: '/infra/codegen/sync-from-db?tableId=' + id }) + return request.put({url: '/infra/codegen/sync-from-db?tableId=' + id}) } // 预览生成代码 export const previewCodegen = (id: number) => { - return request.get({ url: '/infra/codegen/preview?tableId=' + id }) + return request.get({url: '/infra/codegen/preview?tableId=' + id}) } // 下载生成代码 export const downloadCodegen = (id: number) => { - return request.download({ url: '/infra/codegen/download?tableId=' + id }) + return request.download({url: '/infra/codegen/download?tableId=' + id}) } // 获得表定义 export const getSchemaTableList = (params) => { - return request.get({ url: '/infra/codegen/db/table/list', params }) + return request.get({url: '/infra/codegen/db/table/list', params}) } // 基于数据库的表结构,创建代码生成器的表定义 export const createCodegenList = (data) => { - return request.post({ url: '/infra/codegen/create-list', data }) + return request.post({url: '/infra/codegen/create-list', data}) } // 删除代码生成表定义 export const deleteCodegenTable = (id: number) => { - return request.delete({ url: '/infra/codegen/delete?tableId=' + id }) + return request.delete({url: '/infra/codegen/delete?tableId=' + id}) } diff --git a/yudao-admin-vue3/src/api/infra/config/index.ts b/yudao-admin-vue3/src/api/infra/config/index.ts index 5ef59f3..2ad8bd0 100644 --- a/yudao-admin-vue3/src/api/infra/config/index.ts +++ b/yudao-admin-vue3/src/api/infra/config/index.ts @@ -14,35 +14,35 @@ export interface ConfigVO { // 查询参数列表 export const getConfigPage = (params: PageParam) => { - return request.get({ url: '/infra/config/page', params }) + return request.get({url: '/infra/config/page', params}) } // 查询参数详情 export const getConfig = (id: number) => { - return request.get({ url: '/infra/config/get?id=' + id }) + return request.get({url: '/infra/config/get?id=' + id}) } // 根据参数键名查询参数值 export const getConfigKey = (configKey: string) => { - return request.get({ url: '/infra/config/get-value-by-key?key=' + configKey }) + return request.get({url: '/infra/config/get-value-by-key?key=' + configKey}) } // 新增参数 export const createConfig = (data: ConfigVO) => { - return request.post({ url: '/infra/config/create', data }) + return request.post({url: '/infra/config/create', data}) } // 修改参数 export const updateConfig = (data: ConfigVO) => { - return request.put({ url: '/infra/config/update', data }) + return request.put({url: '/infra/config/update', data}) } // 删除参数 export const deleteConfig = (id: number) => { - return request.delete({ url: '/infra/config/delete?id=' + id }) + return request.delete({url: '/infra/config/delete?id=' + id}) } // 导出参数 export const exportConfig = (params) => { - return request.download({ url: '/infra/config/export', params }) + return request.download({url: '/infra/config/export', params}) } diff --git a/yudao-admin-vue3/src/api/infra/dataSourceConfig/index.ts b/yudao-admin-vue3/src/api/infra/dataSourceConfig/index.ts index b413f34..3d70269 100644 --- a/yudao-admin-vue3/src/api/infra/dataSourceConfig/index.ts +++ b/yudao-admin-vue3/src/api/infra/dataSourceConfig/index.ts @@ -11,25 +11,25 @@ export interface DataSourceConfigVO { // 新增数据源配置 export const createDataSourceConfig = (data: DataSourceConfigVO) => { - return request.post({ url: '/infra/data-source-config/create', data }) + return request.post({url: '/infra/data-source-config/create', data}) } // 修改数据源配置 export const updateDataSourceConfig = (data: DataSourceConfigVO) => { - return request.put({ url: '/infra/data-source-config/update', data }) + return request.put({url: '/infra/data-source-config/update', data}) } // 删除数据源配置 export const deleteDataSourceConfig = (id: number) => { - return request.delete({ url: '/infra/data-source-config/delete?id=' + id }) + return request.delete({url: '/infra/data-source-config/delete?id=' + id}) } // 查询数据源配置详情 export const getDataSourceConfig = (id: number) => { - return request.get({ url: '/infra/data-source-config/get?id=' + id }) + return request.get({url: '/infra/data-source-config/get?id=' + id}) } // 查询数据源配置列表 export const getDataSourceConfigList = () => { - return request.get({ url: '/infra/data-source-config/list' }) + return request.get({url: '/infra/data-source-config/list'}) } diff --git a/yudao-admin-vue3/src/api/infra/demo/demo01/index.ts b/yudao-admin-vue3/src/api/infra/demo/demo01/index.ts index e34a05d..72230d1 100644 --- a/yudao-admin-vue3/src/api/infra/demo/demo01/index.ts +++ b/yudao-admin-vue3/src/api/infra/demo/demo01/index.ts @@ -11,30 +11,30 @@ export interface Demo01ContactVO { // 查询示例联系人分页 export const getDemo01ContactPage = async (params) => { - return await request.get({ url: `/infra/demo01-contact/page`, params }) + return await request.get({url: `/infra/demo01-contact/page`, params}) } // 查询示例联系人详情 export const getDemo01Contact = async (id: number) => { - return await request.get({ url: `/infra/demo01-contact/get?id=` + id }) + return await request.get({url: `/infra/demo01-contact/get?id=` + id}) } // 新增示例联系人 export const createDemo01Contact = async (data: Demo01ContactVO) => { - return await request.post({ url: `/infra/demo01-contact/create`, data }) + return await request.post({url: `/infra/demo01-contact/create`, data}) } // 修改示例联系人 export const updateDemo01Contact = async (data: Demo01ContactVO) => { - return await request.put({ url: `/infra/demo01-contact/update`, data }) + return await request.put({url: `/infra/demo01-contact/update`, data}) } // 删除示例联系人 export const deleteDemo01Contact = async (id: number) => { - return await request.delete({ url: `/infra/demo01-contact/delete?id=` + id }) + return await request.delete({url: `/infra/demo01-contact/delete?id=` + id}) } // 导出示例联系人 Excel export const exportDemo01Contact = async (params) => { - return await request.download({ url: `/infra/demo01-contact/export-excel`, params }) + return await request.download({url: `/infra/demo01-contact/export-excel`, params}) } diff --git a/yudao-admin-vue3/src/api/infra/demo/demo02/index.ts b/yudao-admin-vue3/src/api/infra/demo/demo02/index.ts index 736a123..0c88425 100644 --- a/yudao-admin-vue3/src/api/infra/demo/demo02/index.ts +++ b/yudao-admin-vue3/src/api/infra/demo/demo02/index.ts @@ -8,30 +8,30 @@ export interface Demo02CategoryVO { // 查询示例分类列表 export const getDemo02CategoryList = async () => { - return await request.get({ url: `/infra/demo02-category/list` }) + return await request.get({url: `/infra/demo02-category/list`}) } // 查询示例分类详情 export const getDemo02Category = async (id: number) => { - return await request.get({ url: `/infra/demo02-category/get?id=` + id }) + return await request.get({url: `/infra/demo02-category/get?id=` + id}) } // 新增示例分类 export const createDemo02Category = async (data: Demo02CategoryVO) => { - return await request.post({ url: `/infra/demo02-category/create`, data }) + return await request.post({url: `/infra/demo02-category/create`, data}) } // 修改示例分类 export const updateDemo02Category = async (data: Demo02CategoryVO) => { - return await request.put({ url: `/infra/demo02-category/update`, data }) + return await request.put({url: `/infra/demo02-category/update`, data}) } // 删除示例分类 export const deleteDemo02Category = async (id: number) => { - return await request.delete({ url: `/infra/demo02-category/delete?id=` + id }) + return await request.delete({url: `/infra/demo02-category/delete?id=` + id}) } // 导出示例分类 Excel export const exportDemo02Category = async (params) => { - return await request.download({ url: `/infra/demo02-category/export-excel`, params }) + return await request.download({url: `/infra/demo02-category/export-excel`, params}) } diff --git a/yudao-admin-vue3/src/api/infra/demo/demo03/erp/index.ts b/yudao-admin-vue3/src/api/infra/demo/demo03/erp/index.ts index a2ab539..de2ad0a 100644 --- a/yudao-admin-vue3/src/api/infra/demo/demo03/erp/index.ts +++ b/yudao-admin-vue3/src/api/infra/demo/demo03/erp/index.ts @@ -10,82 +10,82 @@ export interface Demo03StudentVO { // 查询学生分页 export const getDemo03StudentPage = async (params) => { - return await request.get({ url: `/infra/demo03-student/page`, params }) + return await request.get({url: `/infra/demo03-student/page`, params}) } // 查询学生详情 export const getDemo03Student = async (id: number) => { - return await request.get({ url: `/infra/demo03-student/get?id=` + id }) + return await request.get({url: `/infra/demo03-student/get?id=` + id}) } // 新增学生 export const createDemo03Student = async (data: Demo03StudentVO) => { - return await request.post({ url: `/infra/demo03-student/create`, data }) + return await request.post({url: `/infra/demo03-student/create`, data}) } // 修改学生 export const updateDemo03Student = async (data: Demo03StudentVO) => { - return await request.put({ url: `/infra/demo03-student/update`, data }) + return await request.put({url: `/infra/demo03-student/update`, data}) } // 删除学生 export const deleteDemo03Student = async (id: number) => { - return await request.delete({ url: `/infra/demo03-student/delete?id=` + id }) + return await request.delete({url: `/infra/demo03-student/delete?id=` + id}) } // 导出学生 Excel export const exportDemo03Student = async (params) => { - return await request.download({ url: `/infra/demo03-student/export-excel`, params }) + return await request.download({url: `/infra/demo03-student/export-excel`, params}) } // ==================== 子表(学生课程) ==================== // 获得学生课程分页 export const getDemo03CoursePage = async (params) => { - return await request.get({ url: `/infra/demo03-student/demo03-course/page`, params }) + return await request.get({url: `/infra/demo03-student/demo03-course/page`, params}) } // 新增学生课程 export const createDemo03Course = async (data) => { - return await request.post({ url: `/infra/demo03-student/demo03-course/create`, data }) + return await request.post({url: `/infra/demo03-student/demo03-course/create`, data}) } // 修改学生课程 export const updateDemo03Course = async (data) => { - return await request.put({ url: `/infra/demo03-student/demo03-course/update`, data }) + return await request.put({url: `/infra/demo03-student/demo03-course/update`, data}) } // 删除学生课程 export const deleteDemo03Course = async (id: number) => { - return await request.delete({ url: `/infra/demo03-student/demo03-course/delete?id=` + id }) + return await request.delete({url: `/infra/demo03-student/demo03-course/delete?id=` + id}) } // 获得学生课程 export const getDemo03Course = async (id: number) => { - return await request.get({ url: `/infra/demo03-student/demo03-course/get?id=` + id }) + return await request.get({url: `/infra/demo03-student/demo03-course/get?id=` + id}) } // ==================== 子表(学生班级) ==================== // 获得学生班级分页 export const getDemo03GradePage = async (params) => { - return await request.get({ url: `/infra/demo03-student/demo03-grade/page`, params }) + return await request.get({url: `/infra/demo03-student/demo03-grade/page`, params}) } // 新增学生班级 export const createDemo03Grade = async (data) => { - return await request.post({ url: `/infra/demo03-student/demo03-grade/create`, data }) + return await request.post({url: `/infra/demo03-student/demo03-grade/create`, data}) } // 修改学生班级 export const updateDemo03Grade = async (data) => { - return await request.put({ url: `/infra/demo03-student/demo03-grade/update`, data }) + return await request.put({url: `/infra/demo03-student/demo03-grade/update`, data}) } // 删除学生班级 export const deleteDemo03Grade = async (id: number) => { - return await request.delete({ url: `/infra/demo03-student/demo03-grade/delete?id=` + id }) + return await request.delete({url: `/infra/demo03-student/demo03-grade/delete?id=` + id}) } // 获得学生班级 export const getDemo03Grade = async (id: number) => { - return await request.get({ url: `/infra/demo03-student/demo03-grade/get?id=` + id }) + return await request.get({url: `/infra/demo03-student/demo03-grade/get?id=` + id}) } diff --git a/yudao-admin-vue3/src/api/infra/demo/demo03/inner/index.ts b/yudao-admin-vue3/src/api/infra/demo/demo03/inner/index.ts index e366307..dc93b09 100644 --- a/yudao-admin-vue3/src/api/infra/demo/demo03/inner/index.ts +++ b/yudao-admin-vue3/src/api/infra/demo/demo03/inner/index.ts @@ -10,32 +10,32 @@ export interface Demo03StudentVO { // 查询学生分页 export const getDemo03StudentPage = async (params) => { - return await request.get({ url: `/infra/demo03-student/page`, params }) + return await request.get({url: `/infra/demo03-student/page`, params}) } // 查询学生详情 export const getDemo03Student = async (id: number) => { - return await request.get({ url: `/infra/demo03-student/get?id=` + id }) + return await request.get({url: `/infra/demo03-student/get?id=` + id}) } // 新增学生 export const createDemo03Student = async (data: Demo03StudentVO) => { - return await request.post({ url: `/infra/demo03-student/create`, data }) + return await request.post({url: `/infra/demo03-student/create`, data}) } // 修改学生 export const updateDemo03Student = async (data: Demo03StudentVO) => { - return await request.put({ url: `/infra/demo03-student/update`, data }) + return await request.put({url: `/infra/demo03-student/update`, data}) } // 删除学生 export const deleteDemo03Student = async (id: number) => { - return await request.delete({ url: `/infra/demo03-student/delete?id=` + id }) + return await request.delete({url: `/infra/demo03-student/delete?id=` + id}) } // 导出学生 Excel export const exportDemo03Student = async (params) => { - return await request.download({ url: `/infra/demo03-student/export-excel`, params }) + return await request.download({url: `/infra/demo03-student/export-excel`, params}) } // ==================== 子表(学生课程) ==================== diff --git a/yudao-admin-vue3/src/api/infra/demo/demo03/normal/index.ts b/yudao-admin-vue3/src/api/infra/demo/demo03/normal/index.ts index e366307..dc93b09 100644 --- a/yudao-admin-vue3/src/api/infra/demo/demo03/normal/index.ts +++ b/yudao-admin-vue3/src/api/infra/demo/demo03/normal/index.ts @@ -10,32 +10,32 @@ export interface Demo03StudentVO { // 查询学生分页 export const getDemo03StudentPage = async (params) => { - return await request.get({ url: `/infra/demo03-student/page`, params }) + return await request.get({url: `/infra/demo03-student/page`, params}) } // 查询学生详情 export const getDemo03Student = async (id: number) => { - return await request.get({ url: `/infra/demo03-student/get?id=` + id }) + return await request.get({url: `/infra/demo03-student/get?id=` + id}) } // 新增学生 export const createDemo03Student = async (data: Demo03StudentVO) => { - return await request.post({ url: `/infra/demo03-student/create`, data }) + return await request.post({url: `/infra/demo03-student/create`, data}) } // 修改学生 export const updateDemo03Student = async (data: Demo03StudentVO) => { - return await request.put({ url: `/infra/demo03-student/update`, data }) + return await request.put({url: `/infra/demo03-student/update`, data}) } // 删除学生 export const deleteDemo03Student = async (id: number) => { - return await request.delete({ url: `/infra/demo03-student/delete?id=` + id }) + return await request.delete({url: `/infra/demo03-student/delete?id=` + id}) } // 导出学生 Excel export const exportDemo03Student = async (params) => { - return await request.download({ url: `/infra/demo03-student/export-excel`, params }) + return await request.download({url: `/infra/demo03-student/export-excel`, params}) } // ==================== 子表(学生课程) ==================== diff --git a/yudao-admin-vue3/src/api/infra/file/index.ts b/yudao-admin-vue3/src/api/infra/file/index.ts index 0e1b2e7..f8eb044 100644 --- a/yudao-admin-vue3/src/api/infra/file/index.ts +++ b/yudao-admin-vue3/src/api/infra/file/index.ts @@ -18,28 +18,28 @@ export interface FilePresignedUrlRespVO { // 查询文件列表 export const getFilePage = (params: FilePageReqVO) => { - return request.get({ url: '/infra/file/page', params }) + return request.get({url: '/infra/file/page', params}) } // 删除文件 export const deleteFile = (id: number) => { - return request.delete({ url: '/infra/file/delete?id=' + id }) + return request.delete({url: '/infra/file/delete?id=' + id}) } // 获取文件预签名地址 export const getFilePresignedUrl = (path: string) => { return request.get({ url: '/infra/file/presigned-url', - params: { path } + params: {path} }) } // 创建文件 export const createFile = (data: any) => { - return request.post({ url: '/infra/file/create', data }) + return request.post({url: '/infra/file/create', data}) } // 上传文件 export const updateFile = (data: any) => { - return request.upload({ url: '/infra/file/upload', data }) + return request.upload({url: '/infra/file/upload', data}) } diff --git a/yudao-admin-vue3/src/api/infra/fileConfig/index.ts b/yudao-admin-vue3/src/api/infra/fileConfig/index.ts index ba40054..e458dd9 100644 --- a/yudao-admin-vue3/src/api/infra/fileConfig/index.ts +++ b/yudao-admin-vue3/src/api/infra/fileConfig/index.ts @@ -27,35 +27,35 @@ export interface FileConfigVO { // 查询文件配置列表 export const getFileConfigPage = (params: PageParam) => { - return request.get({ url: '/infra/file-config/page', params }) + return request.get({url: '/infra/file-config/page', params}) } // 查询文件配置详情 export const getFileConfig = (id: number) => { - return request.get({ url: '/infra/file-config/get?id=' + id }) + return request.get({url: '/infra/file-config/get?id=' + id}) } // 更新文件配置为主配置 export const updateFileConfigMaster = (id: number) => { - return request.put({ url: '/infra/file-config/update-master?id=' + id }) + return request.put({url: '/infra/file-config/update-master?id=' + id}) } // 新增文件配置 export const createFileConfig = (data: FileConfigVO) => { - return request.post({ url: '/infra/file-config/create', data }) + return request.post({url: '/infra/file-config/create', data}) } // 修改文件配置 export const updateFileConfig = (data: FileConfigVO) => { - return request.put({ url: '/infra/file-config/update', data }) + return request.put({url: '/infra/file-config/update', data}) } // 删除文件配置 export const deleteFileConfig = (id: number) => { - return request.delete({ url: '/infra/file-config/delete?id=' + id }) + return request.delete({url: '/infra/file-config/delete?id=' + id}) } // 测试文件配置 export const testFileConfig = (id: number) => { - return request.get({ url: '/infra/file-config/test?id=' + id }) + return request.get({url: '/infra/file-config/test?id=' + id}) } diff --git a/yudao-admin-vue3/src/api/infra/job/index.ts b/yudao-admin-vue3/src/api/infra/job/index.ts index 033b2cb..5961821 100644 --- a/yudao-admin-vue3/src/api/infra/job/index.ts +++ b/yudao-admin-vue3/src/api/infra/job/index.ts @@ -15,32 +15,32 @@ export interface JobVO { // 任务列表 export const getJobPage = (params: PageParam) => { - return request.get({ url: '/infra/job/page', params }) + return request.get({url: '/infra/job/page', params}) } // 任务详情 export const getJob = (id: number) => { - return request.get({ url: '/infra/job/get?id=' + id }) + return request.get({url: '/infra/job/get?id=' + id}) } // 新增任务 export const createJob = (data: JobVO) => { - return request.post({ url: '/infra/job/create', data }) + return request.post({url: '/infra/job/create', data}) } // 修改定时任务调度 export const updateJob = (data: JobVO) => { - return request.put({ url: '/infra/job/update', data }) + return request.put({url: '/infra/job/update', data}) } // 删除定时任务调度 export const deleteJob = (id: number) => { - return request.delete({ url: '/infra/job/delete?id=' + id }) + return request.delete({url: '/infra/job/delete?id=' + id}) } // 导出定时任务调度 export const exportJob = (params) => { - return request.download({ url: '/infra/job/export-excel', params }) + return request.download({url: '/infra/job/export-excel', params}) } // 任务状态修改 @@ -49,15 +49,15 @@ export const updateJobStatus = (id: number, status: number) => { id, status } - return request.put({ url: '/infra/job/update-status', params }) + return request.put({url: '/infra/job/update-status', params}) } // 定时任务立即执行一次 export const runJob = (id: number) => { - return request.put({ url: '/infra/job/trigger?id=' + id }) + return request.put({url: '/infra/job/trigger?id=' + id}) } // 获得定时任务的下 n 次执行时间 export const getJobNextTimes = (id: number) => { - return request.get({ url: '/infra/job/get_next_times?id=' + id }) + return request.get({url: '/infra/job/get_next_times?id=' + id}) } diff --git a/yudao-admin-vue3/src/api/infra/jobLog/index.ts b/yudao-admin-vue3/src/api/infra/jobLog/index.ts index ed54761..6c00151 100644 --- a/yudao-admin-vue3/src/api/infra/jobLog/index.ts +++ b/yudao-admin-vue3/src/api/infra/jobLog/index.ts @@ -17,12 +17,12 @@ export interface JobLogVO { // 任务日志列表 export const getJobLogPage = (params: PageParam) => { - return request.get({ url: '/infra/job-log/page', params }) + return request.get({url: '/infra/job-log/page', params}) } // 任务日志详情 export const getJobLog = (id: number) => { - return request.get({ url: '/infra/job-log/get?id=' + id }) + return request.get({url: '/infra/job-log/get?id=' + id}) } // 导出定时任务日志 diff --git a/yudao-admin-vue3/src/api/infra/redis/index.ts b/yudao-admin-vue3/src/api/infra/redis/index.ts index f27be77..c049758 100644 --- a/yudao-admin-vue3/src/api/infra/redis/index.ts +++ b/yudao-admin-vue3/src/api/infra/redis/index.ts @@ -4,5 +4,5 @@ import request from '@/config/axios' * 获取redis 监控信息 */ export const getCache = () => { - return request.get({ url: '/infra/redis/get-monitor-info' }) + return request.get({url: '/infra/redis/get-monitor-info'}) } diff --git a/yudao-admin-vue3/src/api/login/index.ts b/yudao-admin-vue3/src/api/login/index.ts index ef86563..93ddc42 100644 --- a/yudao-admin-vue3/src/api/login/index.ts +++ b/yudao-admin-vue3/src/api/login/index.ts @@ -1,6 +1,6 @@ import request from '@/config/axios' -import { getRefreshToken } from '@/utils/auth' -import type { UserLoginVO } from './types' +import {getRefreshToken} from '@/utils/auth' +import type {UserLoginVO} from './types' export interface SmsCodeVO { mobile: string @@ -14,42 +14,42 @@ export interface SmsLoginVO { // 登录 export const login = (data: UserLoginVO) => { - return request.post({ url: '/system/auth/login', data }) + return request.post({url: '/system/auth/login', data}) } // 刷新访问令牌 export const refreshToken = () => { - return request.post({ url: '/system/auth/refresh-token?refreshToken=' + getRefreshToken() }) + return request.post({url: '/system/auth/refresh-token?refreshToken=' + getRefreshToken()}) } // 使用租户名,获得租户编号 export const getTenantIdByName = (name: string) => { - return request.get({ url: '/system/tenant/get-id-by-name?name=' + name }) + return request.get({url: '/system/tenant/get-id-by-name?name=' + name}) } // 使用租户域名,获得租户信息 export const getTenantByWebsite = (website: string) => { - return request.get({ url: '/system/tenant/get-by-website?website=' + website }) + return request.get({url: '/system/tenant/get-by-website?website=' + website}) } // 登出 export const loginOut = () => { - return request.post({ url: '/system/auth/logout' }) + return request.post({url: '/system/auth/logout'}) } // 获取用户权限信息 export const getInfo = () => { - return request.get({ url: '/system/auth/get-permission-info' }) + return request.get({url: '/system/auth/get-permission-info'}) } //获取登录验证码 export const sendSmsCode = (data: SmsCodeVO) => { - return request.post({ url: '/system/auth/send-sms-code', data }) + return request.post({url: '/system/auth/send-sms-code', data}) } // 短信验证码登录 export const smsLogin = (data: SmsLoginVO) => { - return request.post({ url: '/system/auth/sms-login', data }) + return request.post({url: '/system/auth/sms-login', data}) } // 社交快捷登录,使用 code 授权码 @@ -72,10 +72,10 @@ export const socialAuthRedirect = (type: number, redirectUri: string) => { } // 获取验证图片以及 token export const getCode = (data) => { - return request.postOriginal({ url: 'system/captcha/get', data }) + return request.postOriginal({url: 'system/captcha/get', data}) } // 滑动或者点选验证 export const reqCheck = (data) => { - return request.postOriginal({ url: 'system/captcha/check', data }) + return request.postOriginal({url: 'system/captcha/check', data}) } diff --git a/yudao-admin-vue3/src/api/login/oauth2/index.ts b/yudao-admin-vue3/src/api/login/oauth2/index.ts index aef1820..75dda52 100644 --- a/yudao-admin-vue3/src/api/login/oauth2/index.ts +++ b/yudao-admin-vue3/src/api/login/oauth2/index.ts @@ -2,7 +2,7 @@ import request from '@/config/axios' // 获得授权信息 export const getAuthorize = (clientId: string) => { - return request.get({ url: '/system/oauth2/authorize?clientId=' + clientId }) + return request.get({url: '/system/oauth2/authorize?clientId=' + clientId}) } // 发起授权 diff --git a/yudao-admin-vue3/src/api/mall/market/banner/index.ts b/yudao-admin-vue3/src/api/mall/market/banner/index.ts index ee65024..b913a8a 100644 --- a/yudao-admin-vue3/src/api/mall/market/banner/index.ts +++ b/yudao-admin-vue3/src/api/mall/market/banner/index.ts @@ -13,25 +13,25 @@ export interface BannerVO { // 查询Banner管理列表 export const getBannerPage = async (params) => { - return await request.get({ url: `/promotion/banner/page`, params }) + return await request.get({url: `/promotion/banner/page`, params}) } // 查询Banner管理详情 export const getBanner = async (id: number) => { - return await request.get({ url: `/promotion/banner/get?id=` + id }) + return await request.get({url: `/promotion/banner/get?id=` + id}) } // 新增Banner管理 export const createBanner = async (data: BannerVO) => { - return await request.post({ url: `/promotion/banner/create`, data }) + return await request.post({url: `/promotion/banner/create`, data}) } // 修改Banner管理 export const updateBanner = async (data: BannerVO) => { - return await request.put({ url: `/promotion/banner/update`, data }) + return await request.put({url: `/promotion/banner/update`, data}) } // 删除Banner管理 export const deleteBanner = async (id: number) => { - return await request.delete({ url: `/promotion/banner/delete?id=` + id }) + return await request.delete({url: `/promotion/banner/delete?id=` + id}) } diff --git a/yudao-admin-vue3/src/api/mall/product/brand.ts b/yudao-admin-vue3/src/api/mall/product/brand.ts index 94d5370..2743e80 100644 --- a/yudao-admin-vue3/src/api/mall/product/brand.ts +++ b/yudao-admin-vue3/src/api/mall/product/brand.ts @@ -32,30 +32,30 @@ export interface BrandVO { // 创建商品品牌 export const createBrand = (data: BrandVO) => { - return request.post({ url: '/product/brand/create', data }) + return request.post({url: '/product/brand/create', data}) } // 更新商品品牌 export const updateBrand = (data: BrandVO) => { - return request.put({ url: '/product/brand/update', data }) + return request.put({url: '/product/brand/update', data}) } // 删除商品品牌 export const deleteBrand = (id: number) => { - return request.delete({ url: `/product/brand/delete?id=${id}` }) + return request.delete({url: `/product/brand/delete?id=${id}`}) } // 获得商品品牌 export const getBrand = (id: number) => { - return request.get({ url: `/product/brand/get?id=${id}` }) + return request.get({url: `/product/brand/get?id=${id}`}) } // 获得商品品牌列表 export const getBrandParam = (params: PageParam) => { - return request.get({ url: '/product/brand/page', params }) + return request.get({url: '/product/brand/page', params}) } // 获得商品品牌精简信息列表 export const getSimpleBrandList = () => { - return request.get({ url: '/product/brand/list-all-simple' }) + return request.get({url: '/product/brand/list-all-simple'}) } diff --git a/yudao-admin-vue3/src/api/mall/product/category.ts b/yudao-admin-vue3/src/api/mall/product/category.ts index 7e80b76..ee58699 100644 --- a/yudao-admin-vue3/src/api/mall/product/category.ts +++ b/yudao-admin-vue3/src/api/mall/product/category.ts @@ -32,25 +32,25 @@ export interface CategoryVO { // 创建商品分类 export const createCategory = (data: CategoryVO) => { - return request.post({ url: '/product/category/create', data }) + return request.post({url: '/product/category/create', data}) } // 更新商品分类 export const updateCategory = (data: CategoryVO) => { - return request.put({ url: '/product/category/update', data }) + return request.put({url: '/product/category/update', data}) } // 删除商品分类 export const deleteCategory = (id: number) => { - return request.delete({ url: `/product/category/delete?id=${id}` }) + return request.delete({url: `/product/category/delete?id=${id}`}) } // 获得商品分类 export const getCategory = (id: number) => { - return request.get({ url: `/product/category/get?id=${id}` }) + return request.get({url: `/product/category/get?id=${id}`}) } // 获得商品分类列表 export const getCategoryList = (params: any) => { - return request.get({ url: '/product/category/list', params }) + return request.get({url: '/product/category/list', params}) } diff --git a/yudao-admin-vue3/src/api/mall/product/comment.ts b/yudao-admin-vue3/src/api/mall/product/comment.ts index defdbb9..c989584 100644 --- a/yudao-admin-vue3/src/api/mall/product/comment.ts +++ b/yudao-admin-vue3/src/api/mall/product/comment.ts @@ -25,25 +25,25 @@ export interface CommentVO { // 查询商品评论列表 export const getCommentPage = async (params) => { - return await request.get({ url: `/product/comment/page`, params }) + return await request.get({url: `/product/comment/page`, params}) } // 查询商品评论详情 export const getComment = async (id: number) => { - return await request.get({ url: `/product/comment/get?id=` + id }) + return await request.get({url: `/product/comment/get?id=` + id}) } // 添加自评 export const createComment = async (data: CommentVO) => { - return await request.post({ url: `/product/comment/create`, data }) + return await request.post({url: `/product/comment/create`, data}) } // 显示 / 隐藏评论 export const updateCommentVisible = async (data: any) => { - return await request.put({ url: `/product/comment/update-visible`, data }) + return await request.put({url: `/product/comment/update-visible`, data}) } // 商家回复 export const replyComment = async (data: any) => { - return await request.put({ url: `/product/comment/reply`, data }) + return await request.put({url: `/product/comment/reply`, data}) } diff --git a/yudao-admin-vue3/src/api/mall/product/favorite.ts b/yudao-admin-vue3/src/api/mall/product/favorite.ts index 3834eed..c93dad6 100644 --- a/yudao-admin-vue3/src/api/mall/product/favorite.ts +++ b/yudao-admin-vue3/src/api/mall/product/favorite.ts @@ -8,5 +8,5 @@ export interface Favorite { // 获得 ProductFavorite 列表 export const getFavoritePage = (params: PageParam) => { - return request.get({ url: '/product/favorite/page', params }) + return request.get({url: '/product/favorite/page', params}) } diff --git a/yudao-admin-vue3/src/api/mall/product/history.ts b/yudao-admin-vue3/src/api/mall/product/history.ts index 0aa45bd..0afb676 100644 --- a/yudao-admin-vue3/src/api/mall/product/history.ts +++ b/yudao-admin-vue3/src/api/mall/product/history.ts @@ -6,5 +6,5 @@ import request from '@/config/axios' * @param params 请求参数 */ export const getBrowseHistoryPage = (params: any) => { - return request.get({ url: '/product/browse-history/page', params }) + return request.get({url: '/product/browse-history/page', params}) } diff --git a/yudao-admin-vue3/src/api/mall/product/property.ts b/yudao-admin-vue3/src/api/mall/product/property.ts index 44dc663..1ab3f0b 100644 --- a/yudao-admin-vue3/src/api/mall/product/property.ts +++ b/yudao-admin-vue3/src/api/mall/product/property.ts @@ -42,52 +42,52 @@ export interface PropertyValueDetailVO { // 创建属性项 export const createProperty = (data: PropertyVO) => { - return request.post({ url: '/product/property/create', data }) + return request.post({url: '/product/property/create', data}) } // 更新属性项 export const updateProperty = (data: PropertyVO) => { - return request.put({ url: '/product/property/update', data }) + return request.put({url: '/product/property/update', data}) } // 删除属性项 export const deleteProperty = (id: number) => { - return request.delete({ url: `/product/property/delete?id=${id}` }) + return request.delete({url: `/product/property/delete?id=${id}`}) } // 获得属性项 export const getProperty = (id: number): Promise => { - return request.get({ url: `/product/property/get?id=${id}` }) + return request.get({url: `/product/property/get?id=${id}`}) } // 获得属性项分页 export const getPropertyPage = (params: PageParam) => { - return request.get({ url: '/product/property/page', params }) + return request.get({url: '/product/property/page', params}) } // ------------------------ 属性值 ------------------- // 获得属性值分页 export const getPropertyValuePage = (params: PageParam & any) => { - return request.get({ url: '/product/property/value/page', params }) + return request.get({url: '/product/property/value/page', params}) } // 获得属性值 export const getPropertyValue = (id: number): Promise => { - return request.get({ url: `/product/property/value/get?id=${id}` }) + return request.get({url: `/product/property/value/get?id=${id}`}) } // 创建属性值 export const createPropertyValue = (data: PropertyValueVO) => { - return request.post({ url: '/product/property/value/create', data }) + return request.post({url: '/product/property/value/create', data}) } // 更新属性值 export const updatePropertyValue = (data: PropertyValueVO) => { - return request.put({ url: '/product/property/value/update', data }) + return request.put({url: '/product/property/value/update', data}) } // 删除属性值 export const deletePropertyValue = (id: number) => { - return request.delete({ url: `/product/property/value/delete?id=${id}` }) + return request.delete({url: `/product/property/value/delete?id=${id}`}) } diff --git a/yudao-admin-vue3/src/api/mall/product/spu.ts b/yudao-admin-vue3/src/api/mall/product/spu.ts index e3a2162..3adb59d 100644 --- a/yudao-admin-vue3/src/api/mall/product/spu.ts +++ b/yudao-admin-vue3/src/api/mall/product/spu.ts @@ -62,50 +62,50 @@ export interface Spu { // 获得 Spu 列表 export const getSpuPage = (params: PageParam) => { - return request.get({ url: '/product/spu/page', params }) + return request.get({url: '/product/spu/page', params}) } // 获得 Spu 列表 tabsCount export const getTabsCount = () => { - return request.get({ url: '/product/spu/get-count' }) + return request.get({url: '/product/spu/get-count'}) } // 创建商品 Spu export const createSpu = (data: Spu) => { - return request.post({ url: '/product/spu/create', data }) + return request.post({url: '/product/spu/create', data}) } // 更新商品 Spu export const updateSpu = (data: Spu) => { - return request.put({ url: '/product/spu/update', data }) + return request.put({url: '/product/spu/update', data}) } // 更新商品 Spu status export const updateStatus = (data: { id: number; status: number }) => { - return request.put({ url: '/product/spu/update-status', data }) + return request.put({url: '/product/spu/update-status', data}) } // 获得商品 Spu export const getSpu = (id: number) => { - return request.get({ url: `/product/spu/get-detail?id=${id}` }) + return request.get({url: `/product/spu/get-detail?id=${id}`}) } // 获得商品 Spu 详情列表 export const getSpuDetailList = (ids: number[]) => { - return request.get({ url: `/product/spu/list?spuIds=${ids}` }) + return request.get({url: `/product/spu/list?spuIds=${ids}`}) } // 删除商品 Spu export const deleteSpu = (id: number) => { - return request.delete({ url: `/product/spu/delete?id=${id}` }) + return request.delete({url: `/product/spu/delete?id=${id}`}) } // 导出商品 Spu Excel export const exportSpu = async (params) => { - return await request.download({ url: '/product/spu/export', params }) + return await request.download({url: '/product/spu/export', params}) } // 获得商品 SPU 精简列表 export const getSpuSimpleList = async () => { - return request.get({ url: '/product/spu/list-all-simple' }) + return request.get({url: '/product/spu/list-all-simple'}) } diff --git a/yudao-admin-vue3/src/api/mall/promotion/article/index.ts b/yudao-admin-vue3/src/api/mall/promotion/article/index.ts index 9184c7a..ae30d7c 100644 --- a/yudao-admin-vue3/src/api/mall/promotion/article/index.ts +++ b/yudao-admin-vue3/src/api/mall/promotion/article/index.ts @@ -18,25 +18,25 @@ export interface ArticleVO { // 查询文章管理列表 export const getArticlePage = async (params: any) => { - return await request.get({ url: `/promotion/article/page`, params }) + return await request.get({url: `/promotion/article/page`, params}) } // 查询文章管理详情 export const getArticle = async (id: number) => { - return await request.get({ url: `/promotion/article/get?id=` + id }) + return await request.get({url: `/promotion/article/get?id=` + id}) } // 新增文章管理 export const createArticle = async (data: ArticleVO) => { - return await request.post({ url: `/promotion/article/create`, data }) + return await request.post({url: `/promotion/article/create`, data}) } // 修改文章管理 export const updateArticle = async (data: ArticleVO) => { - return await request.put({ url: `/promotion/article/update`, data }) + return await request.put({url: `/promotion/article/update`, data}) } // 删除文章管理 export const deleteArticle = async (id: number) => { - return await request.delete({ url: `/promotion/article/delete?id=` + id }) + return await request.delete({url: `/promotion/article/delete?id=` + id}) } diff --git a/yudao-admin-vue3/src/api/mall/promotion/articleCategory/index.ts b/yudao-admin-vue3/src/api/mall/promotion/articleCategory/index.ts index 47f5e93..890f05f 100644 --- a/yudao-admin-vue3/src/api/mall/promotion/articleCategory/index.ts +++ b/yudao-admin-vue3/src/api/mall/promotion/articleCategory/index.ts @@ -10,30 +10,30 @@ export interface ArticleCategoryVO { // 查询文章分类列表 export const getArticleCategoryPage = async (params) => { - return await request.get({ url: `/promotion/article-category/page`, params }) + return await request.get({url: `/promotion/article-category/page`, params}) } // 查询文章分类精简信息列表 export const getSimpleArticleCategoryList = async () => { - return await request.get({ url: `/promotion/article-category/list-all-simple` }) + return await request.get({url: `/promotion/article-category/list-all-simple`}) } // 查询文章分类详情 export const getArticleCategory = async (id: number) => { - return await request.get({ url: `/promotion/article-category/get?id=` + id }) + return await request.get({url: `/promotion/article-category/get?id=` + id}) } // 新增文章分类 export const createArticleCategory = async (data: ArticleCategoryVO) => { - return await request.post({ url: `/promotion/article-category/create`, data }) + return await request.post({url: `/promotion/article-category/create`, data}) } // 修改文章分类 export const updateArticleCategory = async (data: ArticleCategoryVO) => { - return await request.put({ url: `/promotion/article-category/update`, data }) + return await request.put({url: `/promotion/article-category/update`, data}) } // 删除文章分类 export const deleteArticleCategory = async (id: number) => { - return await request.delete({ url: `/promotion/article-category/delete?id=` + id }) + return await request.delete({url: `/promotion/article-category/delete?id=` + id}) } diff --git a/yudao-admin-vue3/src/api/mall/promotion/bargain/bargainActivity.ts b/yudao-admin-vue3/src/api/mall/promotion/bargain/bargainActivity.ts index 9ad219a..43386e8 100644 --- a/yudao-admin-vue3/src/api/mall/promotion/bargain/bargainActivity.ts +++ b/yudao-admin-vue3/src/api/mall/promotion/bargain/bargainActivity.ts @@ -1,5 +1,5 @@ import request from '@/config/axios' -import { Sku, Spu } from '@/api/mall/product/spu' +import {Sku, Spu} from '@/api/mall/product/spu' export interface BargainActivityVO { id?: number @@ -39,30 +39,30 @@ export interface SpuExtension extends Spu { // 查询砍价活动列表 export const getBargainActivityPage = async (params: any) => { - return await request.get({ url: '/promotion/bargain-activity/page', params }) + return await request.get({url: '/promotion/bargain-activity/page', params}) } // 查询砍价活动详情 export const getBargainActivity = async (id: number) => { - return await request.get({ url: '/promotion/bargain-activity/get?id=' + id }) + return await request.get({url: '/promotion/bargain-activity/get?id=' + id}) } // 新增砍价活动 export const createBargainActivity = async (data: BargainActivityVO) => { - return await request.post({ url: '/promotion/bargain-activity/create', data }) + return await request.post({url: '/promotion/bargain-activity/create', data}) } // 修改砍价活动 export const updateBargainActivity = async (data: BargainActivityVO) => { - return await request.put({ url: '/promotion/bargain-activity/update', data }) + return await request.put({url: '/promotion/bargain-activity/update', data}) } // 关闭砍价活动 export const closeBargainActivity = async (id: number) => { - return await request.put({ url: '/promotion/bargain-activity/close?id=' + id }) + return await request.put({url: '/promotion/bargain-activity/close?id=' + id}) } // 删除砍价活动 export const deleteBargainActivity = async (id: number) => { - return await request.delete({ url: '/promotion/bargain-activity/delete?id=' + id }) + return await request.delete({url: '/promotion/bargain-activity/delete?id=' + id}) } diff --git a/yudao-admin-vue3/src/api/mall/promotion/bargain/bargainHelp.ts b/yudao-admin-vue3/src/api/mall/promotion/bargain/bargainHelp.ts index 4308ae6..468591d 100644 --- a/yudao-admin-vue3/src/api/mall/promotion/bargain/bargainHelp.ts +++ b/yudao-admin-vue3/src/api/mall/promotion/bargain/bargainHelp.ts @@ -10,5 +10,5 @@ export interface BargainHelpVO { // 查询砍价记录列表 export const getBargainHelpPage = async (params) => { - return await request.get({ url: `/promotion/bargain-help/page`, params }) + return await request.get({url: `/promotion/bargain-help/page`, params}) } diff --git a/yudao-admin-vue3/src/api/mall/promotion/bargain/bargainRecord.ts b/yudao-admin-vue3/src/api/mall/promotion/bargain/bargainRecord.ts index f90b784..5f4a56d 100644 --- a/yudao-admin-vue3/src/api/mall/promotion/bargain/bargainRecord.ts +++ b/yudao-admin-vue3/src/api/mall/promotion/bargain/bargainRecord.ts @@ -15,5 +15,5 @@ export interface BargainRecordVO { // 查询砍价记录列表 export const getBargainRecordPage = async (params) => { - return await request.get({ url: `/promotion/bargain-record/page`, params }) + return await request.get({url: `/promotion/bargain-record/page`, params}) } diff --git a/yudao-admin-vue3/src/api/mall/promotion/circle/index.ts b/yudao-admin-vue3/src/api/mall/promotion/circle/index.ts index 63106f4..400e26d 100644 --- a/yudao-admin-vue3/src/api/mall/promotion/circle/index.ts +++ b/yudao-admin-vue3/src/api/mall/promotion/circle/index.ts @@ -16,31 +16,31 @@ export interface CircleVO { export const CircleApi = { // 查询商城动态分页 getCirclePage: async (params: any) => { - return await request.get({ url: `/promotion/circle/page`, params }) + return await request.get({url: `/promotion/circle/page`, params}) }, // 查询商城动态详情 getCircle: async (id: number) => { - return await request.get({ url: `/promotion/circle/get?id=` + id }) + return await request.get({url: `/promotion/circle/get?id=` + id}) }, // 新增商城动态 createCircle: async (data: CircleVO) => { - return await request.post({ url: `/promotion/circle/create`, data }) + return await request.post({url: `/promotion/circle/create`, data}) }, // 修改商城动态 updateCircle: async (data: CircleVO) => { - return await request.put({ url: `/promotion/circle/update`, data }) + return await request.put({url: `/promotion/circle/update`, data}) }, // 删除商城动态 deleteCircle: async (id: number) => { - return await request.delete({ url: `/promotion/circle/delete?id=` + id }) + return await request.delete({url: `/promotion/circle/delete?id=` + id}) }, // 导出商城动态 Excel exportCircle: async (params) => { - return await request.download({ url: `/promotion/circle/export-excel`, params }) + return await request.download({url: `/promotion/circle/export-excel`, params}) } -} \ No newline at end of file +} diff --git a/yudao-admin-vue3/src/api/mall/promotion/circlereview/index.ts b/yudao-admin-vue3/src/api/mall/promotion/circlereview/index.ts index 1a9329d..0434003 100644 --- a/yudao-admin-vue3/src/api/mall/promotion/circlereview/index.ts +++ b/yudao-admin-vue3/src/api/mall/promotion/circlereview/index.ts @@ -18,31 +18,31 @@ export interface CircleReviewVO { export const CircleReviewApi = { // 查询动态的评论分页 getCircleReviewPage: async (params: any) => { - return await request.get({ url: `/promotion/circle-review/page`, params }) + return await request.get({url: `/promotion/circle-review/page`, params}) }, // 查询动态的评论详情 getCircleReview: async (id: number) => { - return await request.get({ url: `/promotion/circle-review/get?id=` + id }) + return await request.get({url: `/promotion/circle-review/get?id=` + id}) }, // 新增动态的评论 createCircleReview: async (data: CircleReviewVO) => { - return await request.post({ url: `/promotion/circle-review/create`, data }) + return await request.post({url: `/promotion/circle-review/create`, data}) }, // 修改动态的评论 updateCircleReview: async (data: CircleReviewVO) => { - return await request.put({ url: `/promotion/circle-review/update`, data }) + return await request.put({url: `/promotion/circle-review/update`, data}) }, // 删除动态的评论 deleteCircleReview: async (id: number) => { - return await request.delete({ url: `/promotion/circle-review/delete?id=` + id }) + return await request.delete({url: `/promotion/circle-review/delete?id=` + id}) }, // 导出动态的评论 Excel exportCircleReview: async (params) => { - return await request.download({ url: `/promotion/circle-review/export-excel`, params }) + return await request.download({url: `/promotion/circle-review/export-excel`, params}) } -} \ No newline at end of file +} diff --git a/yudao-admin-vue3/src/api/mall/promotion/combination/combinationActivity.ts b/yudao-admin-vue3/src/api/mall/promotion/combination/combinationActivity.ts index 062db5c..987903c 100644 --- a/yudao-admin-vue3/src/api/mall/promotion/combination/combinationActivity.ts +++ b/yudao-admin-vue3/src/api/mall/promotion/combination/combinationActivity.ts @@ -1,5 +1,5 @@ import request from '@/config/axios' -import { Sku, Spu } from '@/api/mall/product/spu' +import {Sku, Spu} from '@/api/mall/product/spu' export interface CombinationActivityVO { id?: number @@ -37,30 +37,30 @@ export interface SpuExtension extends Spu { // 查询拼团活动列表 export const getCombinationActivityPage = async (params) => { - return await request.get({ url: '/promotion/combination-activity/page', params }) + return await request.get({url: '/promotion/combination-activity/page', params}) } // 查询拼团活动详情 export const getCombinationActivity = async (id: number) => { - return await request.get({ url: '/promotion/combination-activity/get?id=' + id }) + return await request.get({url: '/promotion/combination-activity/get?id=' + id}) } // 新增拼团活动 export const createCombinationActivity = async (data: CombinationActivityVO) => { - return await request.post({ url: '/promotion/combination-activity/create', data }) + return await request.post({url: '/promotion/combination-activity/create', data}) } // 修改拼团活动 export const updateCombinationActivity = async (data: CombinationActivityVO) => { - return await request.put({ url: '/promotion/combination-activity/update', data }) + return await request.put({url: '/promotion/combination-activity/update', data}) } // 关闭拼团活动 export const closeCombinationActivity = async (id: number) => { - return await request.put({ url: '/promotion/combination-activity/close?id=' + id }) + return await request.put({url: '/promotion/combination-activity/close?id=' + id}) } // 删除拼团活动 export const deleteCombinationActivity = async (id: number) => { - return await request.delete({ url: '/promotion/combination-activity/delete?id=' + id }) + return await request.delete({url: '/promotion/combination-activity/delete?id=' + id}) } diff --git a/yudao-admin-vue3/src/api/mall/promotion/combination/combinationRecord.ts b/yudao-admin-vue3/src/api/mall/promotion/combination/combinationRecord.ts index b2b7d75..8a23fb7 100644 --- a/yudao-admin-vue3/src/api/mall/promotion/combination/combinationRecord.ts +++ b/yudao-admin-vue3/src/api/mall/promotion/combination/combinationRecord.ts @@ -19,10 +19,10 @@ export interface CombinationRecordVO { // 查询拼团记录列表 export const getCombinationRecordPage = async (params: any) => { - return await request.get({ url: '/promotion/combination-record/page', params }) + return await request.get({url: '/promotion/combination-record/page', params}) } // 获得拼团记录的概要信息 export const getCombinationRecordSummary = async () => { - return await request.get({ url: '/promotion/combination-record/get-summary' }) + return await request.get({url: '/promotion/combination-record/get-summary'}) } diff --git a/yudao-admin-vue3/src/api/mall/promotion/discount/discountActivity.ts b/yudao-admin-vue3/src/api/mall/promotion/discount/discountActivity.ts index e755c1b..f5f6836 100644 --- a/yudao-admin-vue3/src/api/mall/promotion/discount/discountActivity.ts +++ b/yudao-admin-vue3/src/api/mall/promotion/discount/discountActivity.ts @@ -1,5 +1,5 @@ import request from '@/config/axios' -import { Sku, Spu } from '@/api/mall/product/spu' +import {Sku, Spu} from '@/api/mall/product/spu' export interface DiscountActivityVO { id?: number @@ -11,6 +11,7 @@ export interface DiscountActivityVO { endTime?: Date products?: DiscountProductVO[] } + // 限时折扣相关 属性 export interface DiscountProductVO { spuId: number @@ -31,30 +32,30 @@ export interface SpuExtension extends Spu { // 查询限时折扣活动列表 export const getDiscountActivityPage = async (params) => { - return await request.get({ url: '/promotion/discount-activity/page', params }) + return await request.get({url: '/promotion/discount-activity/page', params}) } // 查询限时折扣活动详情 export const getDiscountActivity = async (id: number) => { - return await request.get({ url: '/promotion/discount-activity/get?id=' + id }) + return await request.get({url: '/promotion/discount-activity/get?id=' + id}) } // 新增限时折扣活动 export const createDiscountActivity = async (data: DiscountActivityVO) => { - return await request.post({ url: '/promotion/discount-activity/create', data }) + return await request.post({url: '/promotion/discount-activity/create', data}) } // 修改限时折扣活动 export const updateDiscountActivity = async (data: DiscountActivityVO) => { - return await request.put({ url: '/promotion/discount-activity/update', data }) + return await request.put({url: '/promotion/discount-activity/update', data}) } // 关闭限时折扣活动 export const closeDiscountActivity = async (id: number) => { - return await request.put({ url: '/promotion/discount-activity/close?id=' + id }) + return await request.put({url: '/promotion/discount-activity/close?id=' + id}) } // 删除限时折扣活动 export const deleteDiscountActivity = async (id: number) => { - return await request.delete({ url: '/promotion/discount-activity/delete?id=' + id }) + return await request.delete({url: '/promotion/discount-activity/delete?id=' + id}) } diff --git a/yudao-admin-vue3/src/api/mall/promotion/diy/page.ts b/yudao-admin-vue3/src/api/mall/promotion/diy/page.ts index a834b24..c30a9ec 100644 --- a/yudao-admin-vue3/src/api/mall/promotion/diy/page.ts +++ b/yudao-admin-vue3/src/api/mall/promotion/diy/page.ts @@ -11,35 +11,35 @@ export interface DiyPageVO { // 查询装修页面列表 export const getDiyPagePage = async (params: any) => { - return await request.get({ url: `/promotion/diy-page/page`, params }) + return await request.get({url: `/promotion/diy-page/page`, params}) } // 查询装修页面详情 export const getDiyPage = async (id: number) => { - return await request.get({ url: `/promotion/diy-page/get?id=` + id }) + return await request.get({url: `/promotion/diy-page/get?id=` + id}) } // 新增装修页面 export const createDiyPage = async (data: DiyPageVO) => { - return await request.post({ url: `/promotion/diy-page/create`, data }) + return await request.post({url: `/promotion/diy-page/create`, data}) } // 修改装修页面 export const updateDiyPage = async (data: DiyPageVO) => { - return await request.put({ url: `/promotion/diy-page/update`, data }) + return await request.put({url: `/promotion/diy-page/update`, data}) } // 删除装修页面 export const deleteDiyPage = async (id: number) => { - return await request.delete({ url: `/promotion/diy-page/delete?id=` + id }) + return await request.delete({url: `/promotion/diy-page/delete?id=` + id}) } // 获得装修页面属性 export const getDiyPageProperty = async (id: number) => { - return await request.get({ url: `/promotion/diy-page/get-property?id=` + id }) + return await request.get({url: `/promotion/diy-page/get-property?id=` + id}) } // 更新装修页面属性 export const updateDiyPageProperty = async (data: DiyPageVO) => { - return await request.put({ url: `/promotion/diy-page/update-property`, data }) + return await request.put({url: `/promotion/diy-page/update-property`, data}) } diff --git a/yudao-admin-vue3/src/api/mall/promotion/diy/template.ts b/yudao-admin-vue3/src/api/mall/promotion/diy/template.ts index 87134c9..0ea0f7d 100644 --- a/yudao-admin-vue3/src/api/mall/promotion/diy/template.ts +++ b/yudao-admin-vue3/src/api/mall/promotion/diy/template.ts @@ -1,5 +1,5 @@ import request from '@/config/axios' -import { DiyPageVO } from '@/api/mall/promotion/diy/page' +import {DiyPageVO} from '@/api/mall/promotion/diy/page' export interface DiyTemplateVO { id?: number @@ -17,32 +17,32 @@ export interface DiyTemplatePropertyVO extends DiyTemplateVO { // 查询装修模板列表 export const getDiyTemplatePage = async (params: any) => { - return await request.get({ url: `/promotion/diy-template/page`, params }) + return await request.get({url: `/promotion/diy-template/page`, params}) } // 查询装修模板详情 export const getDiyTemplate = async (id: number) => { - return await request.get({ url: `/promotion/diy-template/get?id=` + id }) + return await request.get({url: `/promotion/diy-template/get?id=` + id}) } // 新增装修模板 export const createDiyTemplate = async (data: DiyTemplateVO) => { - return await request.post({ url: `/promotion/diy-template/create`, data }) + return await request.post({url: `/promotion/diy-template/create`, data}) } // 修改装修模板 export const updateDiyTemplate = async (data: DiyTemplateVO) => { - return await request.put({ url: `/promotion/diy-template/update`, data }) + return await request.put({url: `/promotion/diy-template/update`, data}) } // 删除装修模板 export const deleteDiyTemplate = async (id: number) => { - return await request.delete({ url: `/promotion/diy-template/delete?id=` + id }) + return await request.delete({url: `/promotion/diy-template/delete?id=` + id}) } // 使用装修模板 export const useDiyTemplate = async (id: number) => { - return await request.put({ url: `/promotion/diy-template/use?id=` + id }) + return await request.put({url: `/promotion/diy-template/use?id=` + id}) } // 获得装修模板属性 @@ -54,5 +54,5 @@ export const getDiyTemplateProperty = async (id: number) => { // 更新装修模板属性 export const updateDiyTemplateProperty = async (data: DiyTemplateVO) => { - return await request.put({ url: `/promotion/diy-template/update-property`, data }) + return await request.put({url: `/promotion/diy-template/update-property`, data}) } diff --git a/yudao-admin-vue3/src/api/mall/promotion/intelligent/index.ts b/yudao-admin-vue3/src/api/mall/promotion/intelligent/index.ts index 4287328..f940408 100644 --- a/yudao-admin-vue3/src/api/mall/promotion/intelligent/index.ts +++ b/yudao-admin-vue3/src/api/mall/promotion/intelligent/index.ts @@ -11,7 +11,7 @@ export interface ArticleVO { // 查询文章管理列表 export const selectDynamicData = async () => { - return await request.get({ url: `/intelligentForm/selectDynamicData` }) + return await request.get({url: `/intelligentForm/selectDynamicData`}) } // // 查询文章管理详情 @@ -21,12 +21,12 @@ export const selectDynamicData = async () => { // 新增文章管理 export const saveDynamicData = async (data: ArticleVO) => { - return await request.post({ url: `/intelligentForm/saveDynamicData`, data }) + return await request.post({url: `/intelligentForm/saveDynamicData`, data}) } // 查询文章管理列表 export const collectDataList = async (query: any) => { - return await request.get({ url: `/intelligentForm/collectDataList`, query }) + return await request.get({url: `/intelligentForm/collectDataList`, query}) } // // 修改文章管理 diff --git a/yudao-admin-vue3/src/api/mall/promotion/kefu/conversation/index.ts b/yudao-admin-vue3/src/api/mall/promotion/kefu/conversation/index.ts index 2dbf331..3cbafc7 100644 --- a/yudao-admin-vue3/src/api/mall/promotion/kefu/conversation/index.ts +++ b/yudao-admin-vue3/src/api/mall/promotion/kefu/conversation/index.ts @@ -19,7 +19,7 @@ export interface KeFuConversationRespVO { export const KeFuConversationApi = { // 获得客服会话列表 getConversationList: async () => { - return await request.get({ url: '/promotion/kefu-conversation/list' }) + return await request.get({url: '/promotion/kefu-conversation/list'}) }, // 客服会话置顶 updateConversationPinned: async (data: any) => { @@ -30,6 +30,6 @@ export const KeFuConversationApi = { }, // 删除客服会话 deleteConversation: async (id: number) => { - return await request.get({ url: '/promotion/kefu-conversation/delete?id' + id }) + return await request.get({url: '/promotion/kefu-conversation/delete?id' + id}) } } diff --git a/yudao-admin-vue3/src/api/mall/promotion/kefu/message/index.ts b/yudao-admin-vue3/src/api/mall/promotion/kefu/message/index.ts index a12167f..5f16de6 100644 --- a/yudao-admin-vue3/src/api/mall/promotion/kefu/message/index.ts +++ b/yudao-admin-vue3/src/api/mall/promotion/kefu/message/index.ts @@ -31,6 +31,6 @@ export const KeFuMessageApi = { }, // 获得消息分页数据 getKeFuMessagePage: async (params: any) => { - return await request.get({ url: '/promotion/kefu-message/page', params }) + return await request.get({url: '/promotion/kefu-message/page', params}) } } diff --git a/yudao-admin-vue3/src/api/mall/promotion/reward/rewardActivity.ts b/yudao-admin-vue3/src/api/mall/promotion/reward/rewardActivity.ts index 691db47..11b7f00 100644 --- a/yudao-admin-vue3/src/api/mall/promotion/reward/rewardActivity.ts +++ b/yudao-admin-vue3/src/api/mall/promotion/reward/rewardActivity.ts @@ -24,25 +24,25 @@ export interface DiscountProductVO { // 新增满减送活动 export const createRewardActivity = async (data: DiscountActivityVO) => { - return await request.post({ url: '/promotion/reward-activity/create', data }) + return await request.post({url: '/promotion/reward-activity/create', data}) } // 更新满减送活动 export const updateRewardActivity = async (data: DiscountActivityVO) => { - return await request.put({ url: '/promotion/reward-activity/update', data }) + return await request.put({url: '/promotion/reward-activity/update', data}) } // 查询满减送活动列表 export const getRewardActivityPage = async (params) => { - return await request.get({ url: '/promotion/reward-activity/page', params }) + return await request.get({url: '/promotion/reward-activity/page', params}) } // 查询满减送活动详情 export const getReward = async (id: number) => { - return await request.get({ url: '/promotion/reward-activity/get?id=' + id }) + return await request.get({url: '/promotion/reward-activity/get?id=' + id}) } // 删除限时折扣活动 export const deleteRewardActivity = async (id: number) => { - return await request.delete({ url: '/promotion/reward-activity/delete?id=' + id }) + return await request.delete({url: '/promotion/reward-activity/delete?id=' + id}) } diff --git a/yudao-admin-vue3/src/api/mall/promotion/seckill/seckillActivity.ts b/yudao-admin-vue3/src/api/mall/promotion/seckill/seckillActivity.ts index e834641..6a4960a 100644 --- a/yudao-admin-vue3/src/api/mall/promotion/seckill/seckillActivity.ts +++ b/yudao-admin-vue3/src/api/mall/promotion/seckill/seckillActivity.ts @@ -1,5 +1,5 @@ import request from '@/config/axios' -import { Sku, Spu } from '@/api/mall/product/spu' +import {Sku, Spu} from '@/api/mall/product/spu' export interface SeckillActivityVO { id?: number @@ -39,30 +39,30 @@ export interface SpuExtension extends Spu { // 查询秒杀活动列表 export const getSeckillActivityPage = async (params) => { - return await request.get({ url: '/promotion/seckill-activity/page', params }) + return await request.get({url: '/promotion/seckill-activity/page', params}) } // 查询秒杀活动详情 export const getSeckillActivity = async (id: number) => { - return await request.get({ url: '/promotion/seckill-activity/get?id=' + id }) + return await request.get({url: '/promotion/seckill-activity/get?id=' + id}) } // 新增秒杀活动 export const createSeckillActivity = async (data: SeckillActivityVO) => { - return await request.post({ url: '/promotion/seckill-activity/create', data }) + return await request.post({url: '/promotion/seckill-activity/create', data}) } // 修改秒杀活动 export const updateSeckillActivity = async (data: SeckillActivityVO) => { - return await request.put({ url: '/promotion/seckill-activity/update', data }) + return await request.put({url: '/promotion/seckill-activity/update', data}) } // 关闭秒杀活动 export const closeSeckillActivity = async (id: number) => { - return await request.put({ url: '/promotion/seckill-activity/close?id=' + id }) + return await request.put({url: '/promotion/seckill-activity/close?id=' + id}) } // 删除秒杀活动 export const deleteSeckillActivity = async (id: number) => { - return await request.delete({ url: '/promotion/seckill-activity/delete?id=' + id }) + return await request.delete({url: '/promotion/seckill-activity/delete?id=' + id}) } diff --git a/yudao-admin-vue3/src/api/mall/promotion/seckill/seckillConfig.ts b/yudao-admin-vue3/src/api/mall/promotion/seckill/seckillConfig.ts index 37d9b54..7bbb87c 100644 --- a/yudao-admin-vue3/src/api/mall/promotion/seckill/seckillConfig.ts +++ b/yudao-admin-vue3/src/api/mall/promotion/seckill/seckillConfig.ts @@ -14,32 +14,32 @@ export interface SeckillConfigVO { export const SeckillConfigApi = { // 查询秒杀时段分页 getSeckillConfigPage: async (params: any) => { - return await request.get({ url: `/promotion/seckill-config/page`, params }) + return await request.get({url: `/promotion/seckill-config/page`, params}) }, // 查询秒杀时段列表 getSimpleSeckillConfigList: async () => { - return await request.get({ url: `/promotion/seckill-config/list` }) + return await request.get({url: `/promotion/seckill-config/list`}) }, // 查询秒杀时段详情 getSeckillConfig: async (id: number) => { - return await request.get({ url: `/promotion/seckill-config/get?id=` + id }) + return await request.get({url: `/promotion/seckill-config/get?id=` + id}) }, // 新增秒杀时段 createSeckillConfig: async (data: SeckillConfigVO) => { - return await request.post({ url: `/promotion/seckill-config/create`, data }) + return await request.post({url: `/promotion/seckill-config/create`, data}) }, // 修改秒杀时段 updateSeckillConfig: async (data: SeckillConfigVO) => { - return await request.put({ url: `/promotion/seckill-config/update`, data }) + return await request.put({url: `/promotion/seckill-config/update`, data}) }, // 删除秒杀时段 deleteSeckillConfig: async (id: number) => { - return await request.delete({ url: `/promotion/seckill-config/delete?id=` + id }) + return await request.delete({url: `/promotion/seckill-config/delete?id=` + id}) }, // 修改时段配置状态 @@ -48,6 +48,6 @@ export const SeckillConfigApi = { id, status } - return request.put({ url: '/promotion/seckill-config/update-status', data: data }) + return request.put({url: '/promotion/seckill-config/update-status', data: data}) } } diff --git a/yudao-admin-vue3/src/api/mall/statistics/member.ts b/yudao-admin-vue3/src/api/mall/statistics/member.ts index d9accf9..7816116 100644 --- a/yudao-admin-vue3/src/api/mall/statistics/member.ts +++ b/yudao-admin-vue3/src/api/mall/statistics/member.ts @@ -1,7 +1,7 @@ import request from '@/config/axios' import dayjs from 'dayjs' -import { DataComparisonRespVO } from '@/api/mall/statistics/common' -import { formatDate } from '@/utils/formatTime' +import {DataComparisonRespVO} from '@/api/mall/statistics/common' +import {formatDate} from '@/utils/formatTime' /** 会员分析 Request VO */ export interface MemberAnalyseReqVO { @@ -79,7 +79,7 @@ export const getMemberSummary = () => { export const getMemberAnalyse = (params: MemberAnalyseReqVO) => { return request.get({ url: '/statistics/member/analyse', - params: { times: [formatDate(params.times[0]), formatDate(params.times[1])] } + params: {times: [formatDate(params.times[0]), formatDate(params.times[1])]} }) } @@ -118,6 +118,6 @@ export const getMemberRegisterCountList = ( ) => { return request.get({ url: '/statistics/member/register-count-list', - params: { times: [formatDate(beginTime), formatDate(endTime)] } + params: {times: [formatDate(beginTime), formatDate(endTime)]} }) } diff --git a/yudao-admin-vue3/src/api/mall/statistics/pay.ts b/yudao-admin-vue3/src/api/mall/statistics/pay.ts index f5d14c9..88870c8 100644 --- a/yudao-admin-vue3/src/api/mall/statistics/pay.ts +++ b/yudao-admin-vue3/src/api/mall/statistics/pay.ts @@ -8,5 +8,5 @@ export interface PaySummaryRespVO { /** 获取钱包充值金额 */ export const getWalletRechargePrice = async () => { - return await request.get({ url: `/statistics/pay/summary` }) + return await request.get({url: `/statistics/pay/summary`}) } diff --git a/yudao-admin-vue3/src/api/mall/statistics/product.ts b/yudao-admin-vue3/src/api/mall/statistics/product.ts index 798a2fa..027a07a 100644 --- a/yudao-admin-vue3/src/api/mall/statistics/product.ts +++ b/yudao-admin-vue3/src/api/mall/statistics/product.ts @@ -1,5 +1,5 @@ import request from '@/config/axios' -import { DataComparisonRespVO } from '@/api/mall/statistics/common' +import {DataComparisonRespVO} from '@/api/mall/statistics/common' export interface ProductStatisticsVO { id: number diff --git a/yudao-admin-vue3/src/api/mall/statistics/trade.ts b/yudao-admin-vue3/src/api/mall/statistics/trade.ts index e59952a..1f33b5a 100644 --- a/yudao-admin-vue3/src/api/mall/statistics/trade.ts +++ b/yudao-admin-vue3/src/api/mall/statistics/trade.ts @@ -1,7 +1,7 @@ import request from '@/config/axios' import dayjs from 'dayjs' -import { formatDate } from '@/utils/formatTime' -import { DataComparisonRespVO } from '@/api/mall/statistics/common' +import {formatDate} from '@/utils/formatTime' +import {DataComparisonRespVO} from '@/api/mall/statistics/common' /** 交易统计 Response VO */ export interface TradeSummaryRespVO { @@ -91,7 +91,7 @@ export const exportTradeStatisticsExcel = (params: TradeTrendReqVO) => { // 获得交易订单数量 export const getOrderCount = async () => { - return await request.get({ url: `/statistics/trade/order-count` }) + return await request.get({url: `/statistics/trade/order-count`}) } // 获得交易订单数量对照 @@ -109,11 +109,11 @@ export const getOrderCountTrendComparison = ( ) => { return request.get[]>({ url: '/statistics/trade/order-count-trend', - params: { type, beginTime: formatDate(beginTime), endTime: formatDate(endTime) } + params: {type, beginTime: formatDate(beginTime), endTime: formatDate(endTime)} }) } /** 时间参数需要格式化, 确保接口能识别 */ const formatDateParam = (params: TradeTrendReqVO) => { - return { times: [formatDate(params.times[0]), formatDate(params.times[1])] } as TradeTrendReqVO + return {times: [formatDate(params.times[0]), formatDate(params.times[1])]} as TradeTrendReqVO } diff --git a/yudao-admin-vue3/src/api/mall/trade/afterSale/index.ts b/yudao-admin-vue3/src/api/mall/trade/afterSale/index.ts index a109ee6..30db908 100644 --- a/yudao-admin-vue3/src/api/mall/trade/afterSale/index.ts +++ b/yudao-admin-vue3/src/api/mall/trade/afterSale/index.ts @@ -41,35 +41,35 @@ export interface ProductPropertiesVO { // 获得交易售后分页 export const getAfterSalePage = async (params) => { - return await request.get({ url: `/trade/after-sale/page`, params }) + return await request.get({url: `/trade/after-sale/page`, params}) } // 获得交易售后详情 export const getAfterSale = async (id: any) => { - return await request.get({ url: `/trade/after-sale/get-detail?id=${id}` }) + return await request.get({url: `/trade/after-sale/get-detail?id=${id}`}) } // 同意售后 export const agree = async (id: any) => { - return await request.put({ url: `/trade/after-sale/agree?id=${id}` }) + return await request.put({url: `/trade/after-sale/agree?id=${id}`}) } // 拒绝售后 export const disagree = async (data: any) => { - return await request.put({ url: `/trade/after-sale/disagree`, data }) + return await request.put({url: `/trade/after-sale/disagree`, data}) } // 确认收货 export const receive = async (id: any) => { - return await request.put({ url: `/trade/after-sale/receive?id=${id}` }) + return await request.put({url: `/trade/after-sale/receive?id=${id}`}) } // 拒绝收货 export const refuse = async (id: any) => { - return await request.put({ url: `/trade/after-sale/refuse?id=${id}` }) + return await request.put({url: `/trade/after-sale/refuse?id=${id}`}) } // 确认退款 export const refund = async (id: any) => { - return await request.put({ url: `/trade/after-sale/refund?id=${id}` }) + return await request.put({url: `/trade/after-sale/refund?id=${id}`}) } diff --git a/yudao-admin-vue3/src/api/mall/trade/brokerage/record/index.ts b/yudao-admin-vue3/src/api/mall/trade/brokerage/record/index.ts index 7df9a22..866d336 100644 --- a/yudao-admin-vue3/src/api/mall/trade/brokerage/record/index.ts +++ b/yudao-admin-vue3/src/api/mall/trade/brokerage/record/index.ts @@ -2,10 +2,10 @@ import request from '@/config/axios' // 查询佣金记录列表 export const getBrokerageRecordPage = async (params: any) => { - return await request.get({ url: `/trade/brokerage-record/page`, params }) + return await request.get({url: `/trade/brokerage-record/page`, params}) } // 查询佣金记录详情 export const getBrokerageRecord = async (id: number) => { - return await request.get({ url: `/trade/brokerage-record/get?id=` + id }) + return await request.get({url: `/trade/brokerage-record/get?id=` + id}) } diff --git a/yudao-admin-vue3/src/api/mall/trade/brokerage/user/index.ts b/yudao-admin-vue3/src/api/mall/trade/brokerage/user/index.ts index 1fed3bf..9b78392 100644 --- a/yudao-admin-vue3/src/api/mall/trade/brokerage/user/index.ts +++ b/yudao-admin-vue3/src/api/mall/trade/brokerage/user/index.ts @@ -15,25 +15,25 @@ export interface BrokerageUserVO { // 查询分销用户列表 export const getBrokerageUserPage = async (params: any) => { - return await request.get({ url: `/trade/brokerage-user/page`, params }) + return await request.get({url: `/trade/brokerage-user/page`, params}) } // 查询分销用户详情 export const getBrokerageUser = async (id: number) => { - return await request.get({ url: `/trade/brokerage-user/get?id=` + id }) + return await request.get({url: `/trade/brokerage-user/get?id=` + id}) } // 修改推广员 export const updateBindUser = async (data: any) => { - return await request.put({ url: `/trade/brokerage-user/update-bind-user`, data }) + return await request.put({url: `/trade/brokerage-user/update-bind-user`, data}) } // 清除推广员 export const clearBindUser = async (data: any) => { - return await request.put({ url: `/trade/brokerage-user/clear-bind-user`, data }) + return await request.put({url: `/trade/brokerage-user/clear-bind-user`, data}) } // 修改推广资格 export const updateBrokerageEnabled = async (data: any) => { - return await request.put({ url: `/trade/brokerage-user/update-brokerage-enable`, data }) + return await request.put({url: `/trade/brokerage-user/update-brokerage-enable`, data}) } diff --git a/yudao-admin-vue3/src/api/mall/trade/brokerage/withdraw/index.ts b/yudao-admin-vue3/src/api/mall/trade/brokerage/withdraw/index.ts index c93286a..de9db4f 100644 --- a/yudao-admin-vue3/src/api/mall/trade/brokerage/withdraw/index.ts +++ b/yudao-admin-vue3/src/api/mall/trade/brokerage/withdraw/index.ts @@ -20,20 +20,20 @@ export interface BrokerageWithdrawVO { // 查询佣金提现列表 export const getBrokerageWithdrawPage = async (params: any) => { - return await request.get({ url: `/trade/brokerage-withdraw/page`, params }) + return await request.get({url: `/trade/brokerage-withdraw/page`, params}) } // 查询佣金提现详情 export const getBrokerageWithdraw = async (id: number) => { - return await request.get({ url: `/trade/brokerage-withdraw/get?id=` + id }) + return await request.get({url: `/trade/brokerage-withdraw/get?id=` + id}) } // 佣金提现 - 通过申请 export const approveBrokerageWithdraw = async (id: number) => { - return await request.put({ url: `/trade/brokerage-withdraw/approve?id=` + id }) + return await request.put({url: `/trade/brokerage-withdraw/approve?id=` + id}) } // 审核佣金提现 - 驳回申请 export const rejectBrokerageWithdraw = async (data: BrokerageWithdrawVO) => { - return await request.put({ url: `/trade/brokerage-withdraw/reject`, data }) + return await request.put({url: `/trade/brokerage-withdraw/reject`, data}) } diff --git a/yudao-admin-vue3/src/api/mall/trade/config/index.ts b/yudao-admin-vue3/src/api/mall/trade/config/index.ts index 43fdbdf..6a59f59 100644 --- a/yudao-admin-vue3/src/api/mall/trade/config/index.ts +++ b/yudao-admin-vue3/src/api/mall/trade/config/index.ts @@ -14,10 +14,10 @@ export interface ConfigVO { // 查询交易中心配置详情 export const getTradeConfig = async () => { - return await request.get({ url: `/trade/config/get` }) + return await request.get({url: `/trade/config/get`}) } // 保存交易中心配置 export const saveTradeConfig = async (data: ConfigVO) => { - return await request.put({ url: `/trade/config/save`, data }) + return await request.put({url: `/trade/config/save`, data}) } diff --git a/yudao-admin-vue3/src/api/mall/trade/delivery/express/index.ts b/yudao-admin-vue3/src/api/mall/trade/delivery/express/index.ts index 0070bcd..e647acf 100644 --- a/yudao-admin-vue3/src/api/mall/trade/delivery/express/index.ts +++ b/yudao-admin-vue3/src/api/mall/trade/delivery/express/index.ts @@ -11,35 +11,35 @@ export interface DeliveryExpressVO { // 查询快递公司列表 export const getDeliveryExpressPage = async (params: PageParam) => { - return await request.get({ url: '/trade/delivery/express/page', params }) + return await request.get({url: '/trade/delivery/express/page', params}) } // 查询快递公司详情 export const getDeliveryExpress = async (id: number) => { - return await request.get({ url: '/trade/delivery/express/get?id=' + id }) + return await request.get({url: '/trade/delivery/express/get?id=' + id}) } // 获得快递公司精简信息列表 export const getSimpleDeliveryExpressList = () => { - return request.get({ url: '/trade/delivery/express/list-all-simple' }) + return request.get({url: '/trade/delivery/express/list-all-simple'}) } // 新增快递公司 export const createDeliveryExpress = async (data: DeliveryExpressVO) => { - return await request.post({ url: '/trade/delivery/express/create', data }) + return await request.post({url: '/trade/delivery/express/create', data}) } // 修改快递公司 export const updateDeliveryExpress = async (data: DeliveryExpressVO) => { - return await request.put({ url: '/trade/delivery/express/update', data }) + return await request.put({url: '/trade/delivery/express/update', data}) } // 删除快递公司 export const deleteDeliveryExpress = async (id: number) => { - return await request.delete({ url: '/trade/delivery/express/delete?id=' + id }) + return await request.delete({url: '/trade/delivery/express/delete?id=' + id}) } // 导出快递公司 Excel export const exportDeliveryExpressApi = async (params) => { - return await request.download({ url: '/trade/delivery/express/export-excel', params }) + return await request.download({url: '/trade/delivery/express/export-excel', params}) } diff --git a/yudao-admin-vue3/src/api/mall/trade/delivery/expressTemplate/index.ts b/yudao-admin-vue3/src/api/mall/trade/delivery/expressTemplate/index.ts index 9ed23bc..725f771 100644 --- a/yudao-admin-vue3/src/api/mall/trade/delivery/expressTemplate/index.ts +++ b/yudao-admin-vue3/src/api/mall/trade/delivery/expressTemplate/index.ts @@ -25,30 +25,30 @@ export declare type ExpressTemplateFreeVO = { // 查询快递运费模板列表 export const getDeliveryExpressTemplatePage = async (params: PageParam) => { - return await request.get({ url: '/trade/delivery/express-template/page', params }) + return await request.get({url: '/trade/delivery/express-template/page', params}) } // 查询快递运费模板详情 export const getDeliveryExpressTemplate = async (id: number) => { - return await request.get({ url: '/trade/delivery/express-template/get?id=' + id }) + return await request.get({url: '/trade/delivery/express-template/get?id=' + id}) } // 查询快递运费模板详情 export const getSimpleTemplateList = async () => { - return await request.get({ url: '/trade/delivery/express-template/list-all-simple' }) + return await request.get({url: '/trade/delivery/express-template/list-all-simple'}) } // 新增快递运费模板 export const createDeliveryExpressTemplate = async (data: DeliveryExpressTemplateVO) => { - return await request.post({ url: '/trade/delivery/express-template/create', data }) + return await request.post({url: '/trade/delivery/express-template/create', data}) } // 修改快递运费模板 export const updateDeliveryExpressTemplate = async (data: DeliveryExpressTemplateVO) => { - return await request.put({ url: '/trade/delivery/express-template/update', data }) + return await request.put({url: '/trade/delivery/express-template/update', data}) } // 删除快递运费模板 export const deleteDeliveryExpressTemplate = async (id: number) => { - return await request.delete({ url: '/trade/delivery/express-template/delete?id=' + id }) + return await request.delete({url: '/trade/delivery/express-template/delete?id=' + id}) } diff --git a/yudao-admin-vue3/src/api/mall/trade/delivery/pickUpStore/index.ts b/yudao-admin-vue3/src/api/mall/trade/delivery/pickUpStore/index.ts index c317502..92579bc 100644 --- a/yudao-admin-vue3/src/api/mall/trade/delivery/pickUpStore/index.ts +++ b/yudao-admin-vue3/src/api/mall/trade/delivery/pickUpStore/index.ts @@ -17,30 +17,30 @@ export interface DeliveryPickUpStoreVO { // 查询自提门店列表 export const getDeliveryPickUpStorePage = async (params) => { - return await request.get({ url: '/trade/delivery/pick-up-store/page', params }) + return await request.get({url: '/trade/delivery/pick-up-store/page', params}) } // 查询自提门店详情 export const getDeliveryPickUpStore = async (id: number) => { - return await request.get({ url: '/trade/delivery/pick-up-store/get?id=' + id }) + return await request.get({url: '/trade/delivery/pick-up-store/get?id=' + id}) } // 查询自提门店精简列表 export const getListAllSimple = async (): Promise => { - return await request.get({ url: '/trade/delivery/pick-up-store/list-all-simple' }) + return await request.get({url: '/trade/delivery/pick-up-store/list-all-simple'}) } // 新增自提门店 export const createDeliveryPickUpStore = async (data: DeliveryPickUpStoreVO) => { - return await request.post({ url: '/trade/delivery/pick-up-store/create', data }) + return await request.post({url: '/trade/delivery/pick-up-store/create', data}) } // 修改自提门店 export const updateDeliveryPickUpStore = async (data: DeliveryPickUpStoreVO) => { - return await request.put({ url: '/trade/delivery/pick-up-store/update', data }) + return await request.put({url: '/trade/delivery/pick-up-store/update', data}) } // 删除自提门店 export const deleteDeliveryPickUpStore = async (id: number) => { - return await request.delete({ url: '/trade/delivery/pick-up-store/delete?id=' + id }) + return await request.delete({url: '/trade/delivery/pick-up-store/delete?id=' + id}) } diff --git a/yudao-admin-vue3/src/api/mall/trade/order/index.ts b/yudao-admin-vue3/src/api/mall/trade/order/index.ts index 37fee8c..cce101f 100644 --- a/yudao-admin-vue3/src/api/mall/trade/order/index.ts +++ b/yudao-admin-vue3/src/api/mall/trade/order/index.ts @@ -122,22 +122,22 @@ export interface TradeOrderSummaryRespVO { // 查询交易订单列表 export const getOrderPage = async (params: any) => { - return await request.get({ url: `/trade/order/page`, params }) + return await request.get({url: `/trade/order/page`, params}) } // 查询交易订单统计 export const getOrderSummary = async (params: any) => { - return await request.get({ url: `/trade/order/summary`, params }) + return await request.get({url: `/trade/order/summary`, params}) } // 查询交易订单详情 export const getOrder = async (id: number | null) => { - return await request.get({ url: `/trade/order/get-detail?id=` + id }) + return await request.get({url: `/trade/order/get-detail?id=` + id}) } // 查询交易订单物流详情 export const getExpressTrackList = async (id: number | null) => { - return await request.get({ url: `/trade/order/get-express-track-list?id=` + id }) + return await request.get({url: `/trade/order/get-express-track-list?id=` + id}) } export interface DeliveryVO { @@ -148,34 +148,34 @@ export interface DeliveryVO { // 订单发货 export const deliveryOrder = async (data: DeliveryVO) => { - return await request.put({ url: `/trade/order/delivery`, data }) + return await request.put({url: `/trade/order/delivery`, data}) } // 订单备注 export const updateOrderRemark = async (data: any) => { - return await request.put({ url: `/trade/order/update-remark`, data }) + return await request.put({url: `/trade/order/update-remark`, data}) } // 订单调价 export const updateOrderPrice = async (data: any) => { - return await request.put({ url: `/trade/order/update-price`, data }) + return await request.put({url: `/trade/order/update-price`, data}) } // 修改订单地址 export const updateOrderAddress = async (data: any) => { - return await request.put({ url: `/trade/order/update-address`, data }) + return await request.put({url: `/trade/order/update-address`, data}) } // 订单核销 export const pickUpOrder = async (id: number) => { - return await request.put({ url: `/trade/order/pick-up-by-id?id=${id}` }) + return await request.put({url: `/trade/order/pick-up-by-id?id=${id}`}) } // 订单核销 export const pickUpOrderByVerifyCode = async (pickUpVerifyCode: string) => { return await request.put({ url: `/trade/order/pick-up-by-verify-code`, - params: { pickUpVerifyCode } + params: {pickUpVerifyCode} }) } @@ -183,6 +183,6 @@ export const pickUpOrderByVerifyCode = async (pickUpVerifyCode: string) => { export const getOrderByPickUpVerifyCode = async (pickUpVerifyCode: string) => { return await request.get({ url: `/trade/order/get-by-pick-up-verify-code`, - params: { pickUpVerifyCode } + params: {pickUpVerifyCode} }) } diff --git a/yudao-admin-vue3/src/api/member/address/index.ts b/yudao-admin-vue3/src/api/member/address/index.ts index a914f97..e6a6722 100644 --- a/yudao-admin-vue3/src/api/member/address/index.ts +++ b/yudao-admin-vue3/src/api/member/address/index.ts @@ -11,5 +11,5 @@ export interface AddressVO { // 查询用户收件地址列表 export const getAddressList = async (params) => { - return await request.get({ url: `/member/address/list`, params }) + return await request.get({url: `/member/address/list`, params}) } diff --git a/yudao-admin-vue3/src/api/member/config/index.ts b/yudao-admin-vue3/src/api/member/config/index.ts index 7ddca16..50bf914 100644 --- a/yudao-admin-vue3/src/api/member/config/index.ts +++ b/yudao-admin-vue3/src/api/member/config/index.ts @@ -10,10 +10,10 @@ export interface ConfigVO { // 查询积分设置详情 export const getConfig = async () => { - return await request.get({ url: `/member/config/get` }) + return await request.get({url: `/member/config/get`}) } // 新增修改积分设置 export const saveConfig = async (data: ConfigVO) => { - return await request.put({ url: `/member/config/save`, data }) + return await request.put({url: `/member/config/save`, data}) } diff --git a/yudao-admin-vue3/src/api/member/experience-record/index.ts b/yudao-admin-vue3/src/api/member/experience-record/index.ts index 6d40a48..ceff5e7 100644 --- a/yudao-admin-vue3/src/api/member/experience-record/index.ts +++ b/yudao-admin-vue3/src/api/member/experience-record/index.ts @@ -13,10 +13,10 @@ export interface ExperienceRecordVO { // 查询会员经验记录列表 export const getExperienceRecordPage = async (params) => { - return await request.get({ url: `/member/experience-record/page`, params }) + return await request.get({url: `/member/experience-record/page`, params}) } // 查询会员经验记录详情 export const getExperienceRecord = async (id: number) => { - return await request.get({ url: `/member/experience-record/get?id=` + id }) + return await request.get({url: `/member/experience-record/get?id=` + id}) } diff --git a/yudao-admin-vue3/src/api/member/group/index.ts b/yudao-admin-vue3/src/api/member/group/index.ts index df3054e..c96fff1 100644 --- a/yudao-admin-vue3/src/api/member/group/index.ts +++ b/yudao-admin-vue3/src/api/member/group/index.ts @@ -9,30 +9,30 @@ export interface GroupVO { // 查询用户分组列表 export const getGroupPage = async (params: any) => { - return await request.get({ url: `/member/group/page`, params }) + return await request.get({url: `/member/group/page`, params}) } // 查询用户分组详情 export const getGroup = async (id: number) => { - return await request.get({ url: `/member/group/get?id=` + id }) + return await request.get({url: `/member/group/get?id=` + id}) } // 新增用户分组 export const createGroup = async (data: GroupVO) => { - return await request.post({ url: `/member/group/create`, data }) + return await request.post({url: `/member/group/create`, data}) } // 查询用户分组 - 精简信息列表 export const getSimpleGroupList = async () => { - return await request.get({ url: `/member/group/list-all-simple` }) + return await request.get({url: `/member/group/list-all-simple`}) } // 修改用户分组 export const updateGroup = async (data: GroupVO) => { - return await request.put({ url: `/member/group/update`, data }) + return await request.put({url: `/member/group/update`, data}) } // 删除用户分组 export const deleteGroup = async (id: number) => { - return await request.delete({ url: `/member/group/delete?id=` + id }) + return await request.delete({url: `/member/group/delete?id=` + id}) } diff --git a/yudao-admin-vue3/src/api/member/level/index.ts b/yudao-admin-vue3/src/api/member/level/index.ts index 0ded493..4ef26be 100644 --- a/yudao-admin-vue3/src/api/member/level/index.ts +++ b/yudao-admin-vue3/src/api/member/level/index.ts @@ -13,30 +13,30 @@ export interface LevelVO { // 查询会员等级列表 export const getLevelList = async (params) => { - return await request.get({ url: `/member/level/list`, params }) + return await request.get({url: `/member/level/list`, params}) } // 查询会员等级详情 export const getLevel = async (id: number) => { - return await request.get({ url: `/member/level/get?id=` + id }) + return await request.get({url: `/member/level/get?id=` + id}) } // 查询会员等级 - 精简信息列表 export const getSimpleLevelList = async () => { - return await request.get({ url: `/member/level/list-all-simple` }) + return await request.get({url: `/member/level/list-all-simple`}) } // 新增会员等级 export const createLevel = async (data: LevelVO) => { - return await request.post({ url: `/member/level/create`, data }) + return await request.post({url: `/member/level/create`, data}) } // 修改会员等级 export const updateLevel = async (data: LevelVO) => { - return await request.put({ url: `/member/level/update`, data }) + return await request.put({url: `/member/level/update`, data}) } // 删除会员等级 export const deleteLevel = async (id: number) => { - return await request.delete({ url: `/member/level/delete?id=` + id }) + return await request.delete({url: `/member/level/delete?id=` + id}) } diff --git a/yudao-admin-vue3/src/api/member/point/record/index.ts b/yudao-admin-vue3/src/api/member/point/record/index.ts index f47ae46..c988374 100644 --- a/yudao-admin-vue3/src/api/member/point/record/index.ts +++ b/yudao-admin-vue3/src/api/member/point/record/index.ts @@ -14,5 +14,5 @@ export interface RecordVO { // 查询用户积分记录列表 export const getRecordPage = async (params) => { - return await request.get({ url: `/member/point/record/page`, params }) + return await request.get({url: `/member/point/record/page`, params}) } diff --git a/yudao-admin-vue3/src/api/member/signin/config/index.ts b/yudao-admin-vue3/src/api/member/signin/config/index.ts index 50a7d63..d71b2b8 100644 --- a/yudao-admin-vue3/src/api/member/signin/config/index.ts +++ b/yudao-admin-vue3/src/api/member/signin/config/index.ts @@ -10,25 +10,25 @@ export interface SignInConfigVO { // 查询积分签到规则列表 export const getSignInConfigList = async () => { - return await request.get({ url: `/member/sign-in/config/list` }) + return await request.get({url: `/member/sign-in/config/list`}) } // 查询积分签到规则详情 export const getSignInConfig = async (id: number) => { - return await request.get({ url: `/member/sign-in/config/get?id=` + id }) + return await request.get({url: `/member/sign-in/config/get?id=` + id}) } // 新增积分签到规则 export const createSignInConfig = async (data: SignInConfigVO) => { - return await request.post({ url: `/member/sign-in/config/create`, data }) + return await request.post({url: `/member/sign-in/config/create`, data}) } // 修改积分签到规则 export const updateSignInConfig = async (data: SignInConfigVO) => { - return await request.put({ url: `/member/sign-in/config/update`, data }) + return await request.put({url: `/member/sign-in/config/update`, data}) } // 删除积分签到规则 export const deleteSignInConfig = async (id: number) => { - return await request.delete({ url: `/member/sign-in/config/delete?id=` + id }) + return await request.delete({url: `/member/sign-in/config/delete?id=` + id}) } diff --git a/yudao-admin-vue3/src/api/member/signin/record/index.ts b/yudao-admin-vue3/src/api/member/signin/record/index.ts index 7d13702..f82d4bd 100644 --- a/yudao-admin-vue3/src/api/member/signin/record/index.ts +++ b/yudao-admin-vue3/src/api/member/signin/record/index.ts @@ -9,5 +9,5 @@ export interface SignInRecordVO { // 查询用户签到积分列表 export const getSignInRecordPage = async (params) => { - return await request.get({ url: `/member/sign-in/record/page`, params }) + return await request.get({url: `/member/sign-in/record/page`, params}) } diff --git a/yudao-admin-vue3/src/api/member/tag/index.ts b/yudao-admin-vue3/src/api/member/tag/index.ts index 7ff6e9b..40957dc 100644 --- a/yudao-admin-vue3/src/api/member/tag/index.ts +++ b/yudao-admin-vue3/src/api/member/tag/index.ts @@ -7,30 +7,30 @@ export interface TagVO { // 查询会员标签列表 export const getMemberTagPage = async (params: any) => { - return await request.get({ url: `/member/tag/page`, params }) + return await request.get({url: `/member/tag/page`, params}) } // 查询会员标签详情 export const getMemberTag = async (id: number) => { - return await request.get({ url: `/member/tag/get?id=` + id }) + return await request.get({url: `/member/tag/get?id=` + id}) } // 查询会员标签 - 精简信息列表 export const getSimpleTagList = async () => { - return await request.get({ url: `/member/tag/list-all-simple` }) + return await request.get({url: `/member/tag/list-all-simple`}) } // 新增会员标签 export const createMemberTag = async (data: TagVO) => { - return await request.post({ url: `/member/tag/create`, data }) + return await request.post({url: `/member/tag/create`, data}) } // 修改会员标签 export const updateMemberTag = async (data: TagVO) => { - return await request.put({ url: `/member/tag/update`, data }) + return await request.put({url: `/member/tag/update`, data}) } // 删除会员标签 export const deleteMemberTag = async (id: number) => { - return await request.delete({ url: `/member/tag/delete?id=` + id }) + return await request.delete({url: `/member/tag/delete?id=` + id}) } diff --git a/yudao-admin-vue3/src/api/member/user/index.ts b/yudao-admin-vue3/src/api/member/user/index.ts index e38206a..02fa257 100644 --- a/yudao-admin-vue3/src/api/member/user/index.ts +++ b/yudao-admin-vue3/src/api/member/user/index.ts @@ -24,30 +24,30 @@ export interface UserVO { // 查询会员用户列表 export const getUserPage = async (params) => { - return await request.get({ url: `/member/user/page`, params }) + return await request.get({url: `/member/user/page`, params}) } // 查询会员用户详情 export const getUser = async (id: number) => { - return await request.get({ url: `/member/user/get?id=` + id }) + return await request.get({url: `/member/user/get?id=` + id}) } // 修改会员用户 export const updateUser = async (data: UserVO) => { - return await request.put({ url: `/member/user/update`, data }) + return await request.put({url: `/member/user/update`, data}) } // 修改会员用户等级 export const updateUserLevel = async (data: any) => { - return await request.put({ url: `/member/user/update-level`, data }) + return await request.put({url: `/member/user/update-level`, data}) } // 修改会员用户积分 export const updateUserPoint = async (data: any) => { - return await request.put({ url: `/member/user/update-point`, data }) + return await request.put({url: `/member/user/update-point`, data}) } // 修改会员用户余额 export const updateUserBalance = async (data: any) => { - return await request.put({ url: `/member/user/update-balance`, data }) + return await request.put({url: `/member/user/update-balance`, data}) } diff --git a/yudao-admin-vue3/src/api/mp/account/index.ts b/yudao-admin-vue3/src/api/mp/account/index.ts index e973cda..f5050c6 100644 --- a/yudao-admin-vue3/src/api/mp/account/index.ts +++ b/yudao-admin-vue3/src/api/mp/account/index.ts @@ -7,40 +7,40 @@ export interface AccountVO { // 创建公众号账号 export const createAccount = async (data) => { - return await request.post({ url: '/mp/account/create', data }) + return await request.post({url: '/mp/account/create', data}) } // 更新公众号账号 export const updateAccount = async (data) => { - return request.put({ url: '/mp/account/update', data: data }) + return request.put({url: '/mp/account/update', data: data}) } // 删除公众号账号 export const deleteAccount = async (id) => { - return request.delete({ url: '/mp/account/delete?id=' + id, method: 'delete' }) + return request.delete({url: '/mp/account/delete?id=' + id, method: 'delete'}) } // 获得公众号账号 export const getAccount = async (id) => { - return request.get({ url: '/mp/account/get?id=' + id }) + return request.get({url: '/mp/account/get?id=' + id}) } // 获得公众号账号分页 export const getAccountPage = async (query) => { - return request.get({ url: '/mp/account/page', params: query }) + return request.get({url: '/mp/account/page', params: query}) } // 获取公众号账号精简信息列表 export const getSimpleAccountList = async () => { - return request.get({ url: '/mp/account/list-all-simple' }) + return request.get({url: '/mp/account/list-all-simple'}) } // 生成公众号二维码 export const generateAccountQrCode = async (id) => { - return request.put({ url: '/mp/account/generate-qr-code?id=' + id }) + return request.put({url: '/mp/account/generate-qr-code?id=' + id}) } // 清空公众号 API 配额 export const clearAccountQuota = async (id) => { - return request.put({ url: '/mp/account/clear-quota?id=' + id }) + return request.put({url: '/mp/account/clear-quota?id=' + id}) } diff --git a/yudao-admin-vue3/src/api/pay/app/index.ts b/yudao-admin-vue3/src/api/pay/app/index.ts index 4bb06b3..e023712 100644 --- a/yudao-admin-vue3/src/api/pay/app/index.ts +++ b/yudao-admin-vue3/src/api/pay/app/index.ts @@ -29,32 +29,32 @@ export interface AppUpdateStatusReqVO { // 查询列表支付应用 export const getAppPage = (params: AppPageReqVO) => { - return request.get({ url: '/pay/app/page', params }) + return request.get({url: '/pay/app/page', params}) } // 查询详情支付应用 export const getApp = (id: number) => { - return request.get({ url: '/pay/app/get?id=' + id }) + return request.get({url: '/pay/app/get?id=' + id}) } // 新增支付应用 export const createApp = (data: AppVO) => { - return request.post({ url: '/pay/app/create', data }) + return request.post({url: '/pay/app/create', data}) } // 修改支付应用 export const updateApp = (data: AppVO) => { - return request.put({ url: '/pay/app/update', data }) + return request.put({url: '/pay/app/update', data}) } // 支付应用信息状态修改 export const changeAppStatus = (data: AppUpdateStatusReqVO) => { - return request.put({ url: '/pay/app/update-status', data: data }) + return request.put({url: '/pay/app/update-status', data: data}) } // 删除支付应用 export const deleteApp = (id: number) => { - return request.delete({ url: '/pay/app/delete?id=' + id }) + return request.delete({url: '/pay/app/delete?id=' + id}) } // 获得支付应用列表 diff --git a/yudao-admin-vue3/src/api/pay/channel/index.ts b/yudao-admin-vue3/src/api/pay/channel/index.ts index 0f4ff42..52c37c6 100644 --- a/yudao-admin-vue3/src/api/pay/channel/index.ts +++ b/yudao-admin-vue3/src/api/pay/channel/index.ts @@ -13,7 +13,7 @@ export interface ChannelVO { // 查询列表支付渠道 export const getChannelPage = (params: PageParam) => { - return request.get({ url: '/pay/channel/page', params }) + return request.get({url: '/pay/channel/page', params}) } // 查询详情支付渠道 @@ -22,25 +22,25 @@ export const getChannel = (appId: string, code: string) => { appId: appId, code: code } - return request.get({ url: '/pay/channel/get', params: params }) + return request.get({url: '/pay/channel/get', params: params}) } // 新增支付渠道 export const createChannel = (data: ChannelVO) => { - return request.post({ url: '/pay/channel/create', data }) + return request.post({url: '/pay/channel/create', data}) } // 修改支付渠道 export const updateChannel = (data: ChannelVO) => { - return request.put({ url: '/pay/channel/update', data }) + return request.put({url: '/pay/channel/update', data}) } // 删除支付渠道 export const deleteChannel = (id: number) => { - return request.delete({ url: '/pay/channel/delete?id=' + id }) + return request.delete({url: '/pay/channel/delete?id=' + id}) } // 导出支付渠道 export const exportChannel = (params) => { - return request.download({ url: '/pay/channel/export-excel', params }) + return request.download({url: '/pay/channel/export-excel', params}) } diff --git a/yudao-admin-vue3/src/api/pay/order/index.ts b/yudao-admin-vue3/src/api/pay/order/index.ts index 71960a8..3b73aa4 100644 --- a/yudao-admin-vue3/src/api/pay/order/index.ts +++ b/yudao-admin-vue3/src/api/pay/order/index.ts @@ -80,25 +80,25 @@ export interface OrderExportReqVO { // 查询列表支付订单 export const getOrderPage = async (params: OrderPageReqVO) => { - return await request.get({ url: '/pay/order/page', params }) + return await request.get({url: '/pay/order/page', params}) } // 查询详情支付订单 export const getOrder = async (id: number) => { - return await request.get({ url: '/pay/order/get?id=' + id }) + return await request.get({url: '/pay/order/get?id=' + id}) } // 获得支付订单的明细 export const getOrderDetail = async (id: number) => { - return await request.get({ url: '/pay/order/get-detail?id=' + id }) + return await request.get({url: '/pay/order/get-detail?id=' + id}) } // 提交支付订单 export const submitOrder = async (data: any) => { - return await request.post({ url: '/pay/order/submit', data }) + return await request.post({url: '/pay/order/submit', data}) } // 导出支付订单 export const exportOrder = async (params: OrderExportReqVO) => { - return await request.download({ url: '/pay/order/export-excel', params }) + return await request.download({url: '/pay/order/export-excel', params}) } diff --git a/yudao-admin-vue3/src/api/pay/refund/index.ts b/yudao-admin-vue3/src/api/pay/refund/index.ts index 4b587f2..479870d 100644 --- a/yudao-admin-vue3/src/api/pay/refund/index.ts +++ b/yudao-admin-vue3/src/api/pay/refund/index.ts @@ -87,30 +87,30 @@ export interface PayRefundExportReqVO { // 查询列表退款订单 export const getRefundPage = (params: RefundPageReqVO) => { - return request.get({ url: '/pay/refund/page', params }) + return request.get({url: '/pay/refund/page', params}) } // 查询详情退款订单 export const getRefund = (id: number) => { - return request.get({ url: '/pay/refund/get?id=' + id }) + return request.get({url: '/pay/refund/get?id=' + id}) } // 新增退款订单 export const createRefund = (data: RefundVO) => { - return request.post({ url: '/pay/refund/create', data }) + return request.post({url: '/pay/refund/create', data}) } // 修改退款订单 export const updateRefund = (data: RefundVO) => { - return request.put({ url: '/pay/refund/update', data }) + return request.put({url: '/pay/refund/update', data}) } // 删除退款订单 export const deleteRefund = (id: number) => { - return request.delete({ url: '/pay/refund/delete?id=' + id }) + return request.delete({url: '/pay/refund/delete?id=' + id}) } // 导出退款订单 export const exportRefund = (params: PayRefundExportReqVO) => { - return request.download({ url: '/pay/refund/export-excel', params }) + return request.download({url: '/pay/refund/export-excel', params}) } diff --git a/yudao-admin-vue3/src/api/pay/transfer/index.ts b/yudao-admin-vue3/src/api/pay/transfer/index.ts index 7a58abf..44a1773 100644 --- a/yudao-admin-vue3/src/api/pay/transfer/index.ts +++ b/yudao-admin-vue3/src/api/pay/transfer/index.ts @@ -14,14 +14,14 @@ export interface TransferVO { // 新增转账单 export const createTransfer = async (data: TransferVO) => { - return await request.post({ url: `/pay/transfer/create`, data }) + return await request.post({url: `/pay/transfer/create`, data}) } // 查询转账单列表 export const getTransferPage = async (params) => { - return await request.get({ url: `/pay/transfer/page`, params }) + return await request.get({url: `/pay/transfer/page`, params}) } export const getTransfer = async (id: number) => { - return await request.get({ url: '/pay/transfer/get?id=' + id }) + return await request.get({url: '/pay/transfer/get?id=' + id}) } diff --git a/yudao-admin-vue3/src/api/pay/wallet/balance/index.ts b/yudao-admin-vue3/src/api/pay/wallet/balance/index.ts index a3ba07f..e163d89 100644 --- a/yudao-admin-vue3/src/api/pay/wallet/balance/index.ts +++ b/yudao-admin-vue3/src/api/pay/wallet/balance/index.ts @@ -4,6 +4,7 @@ import request from '@/config/axios' export interface PayWalletUserReqVO { userId: number } + /** 钱包 VO */ export interface WalletVO { id: number @@ -17,15 +18,15 @@ export interface WalletVO { /** 查询用户钱包详情 */ export const getWallet = async (params: PayWalletUserReqVO) => { - return await request.get({ url: `/pay/wallet/get`, params }) + return await request.get({url: `/pay/wallet/get`, params}) } // 查询会员钱包列表 export const getWalletPage = async (params) => { - return await request.get({ url: `/pay/wallet/page`, params }) + return await request.get({url: `/pay/wallet/page`, params}) } // 修改会员钱包余额 export const updateWalletBalance = async (data: any) => { - return await request.post({ url: `/pay/wallet/update`, data }) + return await request.post({url: `/pay/wallet/update`, data}) } diff --git a/yudao-admin-vue3/src/api/pay/wallet/rechargePackage/index.ts b/yudao-admin-vue3/src/api/pay/wallet/rechargePackage/index.ts index c8e4cc9..9ffba34 100644 --- a/yudao-admin-vue3/src/api/pay/wallet/rechargePackage/index.ts +++ b/yudao-admin-vue3/src/api/pay/wallet/rechargePackage/index.ts @@ -10,25 +10,25 @@ export interface WalletRechargePackageVO { // 查询套餐充值列表 export const getWalletRechargePackagePage = async (params) => { - return await request.get({ url: '/pay/wallet-recharge-package/page', params }) + return await request.get({url: '/pay/wallet-recharge-package/page', params}) } // 查询套餐充值详情 export const getWalletRechargePackage = async (id: number) => { - return await request.get({ url: '/pay/wallet-recharge-package/get?id=' + id }) + return await request.get({url: '/pay/wallet-recharge-package/get?id=' + id}) } // 新增套餐充值 export const createWalletRechargePackage = async (data: WalletRechargePackageVO) => { - return await request.post({ url: '/pay/wallet-recharge-package/create', data }) + return await request.post({url: '/pay/wallet-recharge-package/create', data}) } // 修改套餐充值 export const updateWalletRechargePackage = async (data: WalletRechargePackageVO) => { - return await request.put({ url: '/pay/wallet-recharge-package/update', data }) + return await request.put({url: '/pay/wallet-recharge-package/update', data}) } // 删除套餐充值 export const deleteWalletRechargePackage = async (id: number) => { - return await request.delete({ url: '/pay/wallet-recharge-package/delete?id=' + id }) + return await request.delete({url: '/pay/wallet-recharge-package/delete?id=' + id}) } diff --git a/yudao-admin-vue3/src/api/pay/wallet/transaction/index.ts b/yudao-admin-vue3/src/api/pay/wallet/transaction/index.ts index 3377ffa..f246abe 100644 --- a/yudao-admin-vue3/src/api/pay/wallet/transaction/index.ts +++ b/yudao-admin-vue3/src/api/pay/wallet/transaction/index.ts @@ -10,5 +10,5 @@ export interface WalletTransactionVO { // 查询会员钱包流水列表 export const getWalletTransactionPage = async (params) => { - return await request.get({ url: `/pay/wallet-transaction/page`, params }) + return await request.get({url: `/pay/wallet-transaction/page`, params}) } diff --git a/yudao-admin-vue3/src/api/system/area/index.ts b/yudao-admin-vue3/src/api/system/area/index.ts index e91a499..4037025 100644 --- a/yudao-admin-vue3/src/api/system/area/index.ts +++ b/yudao-admin-vue3/src/api/system/area/index.ts @@ -2,10 +2,10 @@ import request from '@/config/axios' // 获得地区树 export const getAreaTree = async () => { - return await request.get({ url: '/system/area/tree' }) + return await request.get({url: '/system/area/tree'}) } // 获得 IP 对应的地区名 export const getAreaByIp = async (ip: string) => { - return await request.get({ url: '/system/area/get-by-ip?ip=' + ip }) + return await request.get({url: '/system/area/get-by-ip?ip=' + ip}) } diff --git a/yudao-admin-vue3/src/api/system/dept/index.ts b/yudao-admin-vue3/src/api/system/dept/index.ts index 04d5c88..d0054c9 100644 --- a/yudao-admin-vue3/src/api/system/dept/index.ts +++ b/yudao-admin-vue3/src/api/system/dept/index.ts @@ -14,30 +14,30 @@ export interface DeptVO { // 查询部门(精简)列表 export const getSimpleDeptList = async (): Promise => { - return await request.get({ url: '/system/dept/simple-list' }) + return await request.get({url: '/system/dept/simple-list'}) } // 查询部门列表 export const getDeptPage = async (params: PageParam) => { - return await request.get({ url: '/system/dept/list', params }) + return await request.get({url: '/system/dept/list', params}) } // 查询部门详情 export const getDept = async (id: number) => { - return await request.get({ url: '/system/dept/get?id=' + id }) + return await request.get({url: '/system/dept/get?id=' + id}) } // 新增部门 export const createDept = async (data: DeptVO) => { - return await request.post({ url: '/system/dept/create', data: data }) + return await request.post({url: '/system/dept/create', data: data}) } // 修改部门 export const updateDept = async (params: DeptVO) => { - return await request.put({ url: '/system/dept/update', data: params }) + return await request.put({url: '/system/dept/update', data: params}) } // 删除部门 export const deleteDept = async (id: number) => { - return await request.delete({ url: '/system/dept/delete?id=' + id }) + return await request.delete({url: '/system/dept/delete?id=' + id}) } diff --git a/yudao-admin-vue3/src/api/system/dict/dict.data.ts b/yudao-admin-vue3/src/api/system/dict/dict.data.ts index f428648..b8c3bc6 100644 --- a/yudao-admin-vue3/src/api/system/dict/dict.data.ts +++ b/yudao-admin-vue3/src/api/system/dict/dict.data.ts @@ -15,35 +15,35 @@ export type DictDataVO = { // 查询字典数据(精简)列表 export const getSimpleDictDataList = () => { - return request.get({ url: '/system/dict-data/simple-list' }) + return request.get({url: '/system/dict-data/simple-list'}) } // 查询字典数据列表 export const getDictDataPage = (params: PageParam) => { - return request.get({ url: '/system/dict-data/page', params }) + return request.get({url: '/system/dict-data/page', params}) } // 查询字典数据详情 export const getDictData = (id: number) => { - return request.get({ url: '/system/dict-data/get?id=' + id }) + return request.get({url: '/system/dict-data/get?id=' + id}) } // 新增字典数据 export const createDictData = (data: DictDataVO) => { - return request.post({ url: '/system/dict-data/create', data }) + return request.post({url: '/system/dict-data/create', data}) } // 修改字典数据 export const updateDictData = (data: DictDataVO) => { - return request.put({ url: '/system/dict-data/update', data }) + return request.put({url: '/system/dict-data/update', data}) } // 删除字典数据 export const deleteDictData = (id: number) => { - return request.delete({ url: '/system/dict-data/delete?id=' + id }) + return request.delete({url: '/system/dict-data/delete?id=' + id}) } // 导出字典类型数据 export const exportDictData = (params) => { - return request.download({ url: '/system/dict-data/export', params }) + return request.download({url: '/system/dict-data/export', params}) } diff --git a/yudao-admin-vue3/src/api/system/dict/dict.type.ts b/yudao-admin-vue3/src/api/system/dict/dict.type.ts index eaa5fb6..098264c 100644 --- a/yudao-admin-vue3/src/api/system/dict/dict.type.ts +++ b/yudao-admin-vue3/src/api/system/dict/dict.type.ts @@ -11,34 +11,34 @@ export type DictTypeVO = { // 查询字典(精简)列表 export const getSimpleDictTypeList = () => { - return request.get({ url: '/system/dict-type/list-all-simple' }) + return request.get({url: '/system/dict-type/list-all-simple'}) } // 查询字典列表 export const getDictTypePage = (params: PageParam) => { - return request.get({ url: '/system/dict-type/page', params }) + return request.get({url: '/system/dict-type/page', params}) } // 查询字典详情 export const getDictType = (id: number) => { - return request.get({ url: '/system/dict-type/get?id=' + id }) + return request.get({url: '/system/dict-type/get?id=' + id}) } // 新增字典 export const createDictType = (data: DictTypeVO) => { - return request.post({ url: '/system/dict-type/create', data }) + return request.post({url: '/system/dict-type/create', data}) } // 修改字典 export const updateDictType = (data: DictTypeVO) => { - return request.put({ url: '/system/dict-type/update', data }) + return request.put({url: '/system/dict-type/update', data}) } // 删除字典 export const deleteDictType = (id: number) => { - return request.delete({ url: '/system/dict-type/delete?id=' + id }) + return request.delete({url: '/system/dict-type/delete?id=' + id}) } // 导出字典类型 export const exportDictType = (params) => { - return request.download({ url: '/system/dict-type/export', params }) + return request.download({url: '/system/dict-type/export', params}) } diff --git a/yudao-admin-vue3/src/api/system/loginLog/index.ts b/yudao-admin-vue3/src/api/system/loginLog/index.ts index 7296f25..15a4cce 100644 --- a/yudao-admin-vue3/src/api/system/loginLog/index.ts +++ b/yudao-admin-vue3/src/api/system/loginLog/index.ts @@ -16,10 +16,10 @@ export interface LoginLogVO { // 查询登录日志列表 export const getLoginLogPage = (params: PageParam) => { - return request.get({ url: '/system/login-log/page', params }) + return request.get({url: '/system/login-log/page', params}) } // 导出登录日志 export const exportLoginLog = (params) => { - return request.download({ url: '/system/login-log/export', params }) + return request.download({url: '/system/login-log/export', params}) } diff --git a/yudao-admin-vue3/src/api/system/mail/account/index.ts b/yudao-admin-vue3/src/api/system/mail/account/index.ts index 15e0391..20e465f 100644 --- a/yudao-admin-vue3/src/api/system/mail/account/index.ts +++ b/yudao-admin-vue3/src/api/system/mail/account/index.ts @@ -13,30 +13,30 @@ export interface MailAccountVO { // 查询邮箱账号列表 export const getMailAccountPage = async (params: PageParam) => { - return await request.get({ url: '/system/mail-account/page', params }) + return await request.get({url: '/system/mail-account/page', params}) } // 查询邮箱账号详情 export const getMailAccount = async (id: number) => { - return await request.get({ url: '/system/mail-account/get?id=' + id }) + return await request.get({url: '/system/mail-account/get?id=' + id}) } // 新增邮箱账号 export const createMailAccount = async (data: MailAccountVO) => { - return await request.post({ url: '/system/mail-account/create', data }) + return await request.post({url: '/system/mail-account/create', data}) } // 修改邮箱账号 export const updateMailAccount = async (data: MailAccountVO) => { - return await request.put({ url: '/system/mail-account/update', data }) + return await request.put({url: '/system/mail-account/update', data}) } // 删除邮箱账号 export const deleteMailAccount = async (id: number) => { - return await request.delete({ url: '/system/mail-account/delete?id=' + id }) + return await request.delete({url: '/system/mail-account/delete?id=' + id}) } // 获得邮箱账号精简列表 export const getSimpleMailAccountList = async () => { - return request.get({ url: '/system/mail-account/simple-list' }) + return request.get({url: '/system/mail-account/simple-list'}) } diff --git a/yudao-admin-vue3/src/api/system/mail/log/index.ts b/yudao-admin-vue3/src/api/system/mail/log/index.ts index 13172a7..ad23c6b 100644 --- a/yudao-admin-vue3/src/api/system/mail/log/index.ts +++ b/yudao-admin-vue3/src/api/system/mail/log/index.ts @@ -21,10 +21,10 @@ export interface MailLogVO { // 查询邮件日志列表 export const getMailLogPage = async (params: PageParam) => { - return await request.get({ url: '/system/mail-log/page', params }) + return await request.get({url: '/system/mail-log/page', params}) } // 查询邮件日志详情 export const getMailLog = async (id: number) => { - return await request.get({ url: '/system/mail-log/get?id=' + id }) + return await request.get({url: '/system/mail-log/get?id=' + id}) } diff --git a/yudao-admin-vue3/src/api/system/mail/template/index.ts b/yudao-admin-vue3/src/api/system/mail/template/index.ts index fb7ce5e..65d0c21 100644 --- a/yudao-admin-vue3/src/api/system/mail/template/index.ts +++ b/yudao-admin-vue3/src/api/system/mail/template/index.ts @@ -21,30 +21,30 @@ export interface MailSendReqVO { // 查询邮件模版列表 export const getMailTemplatePage = async (params: PageParam) => { - return await request.get({ url: '/system/mail-template/page', params }) + return await request.get({url: '/system/mail-template/page', params}) } // 查询邮件模版详情 export const getMailTemplate = async (id: number) => { - return await request.get({ url: '/system/mail-template/get?id=' + id }) + return await request.get({url: '/system/mail-template/get?id=' + id}) } // 新增邮件模版 export const createMailTemplate = async (data: MailTemplateVO) => { - return await request.post({ url: '/system/mail-template/create', data }) + return await request.post({url: '/system/mail-template/create', data}) } // 修改邮件模版 export const updateMailTemplate = async (data: MailTemplateVO) => { - return await request.put({ url: '/system/mail-template/update', data }) + return await request.put({url: '/system/mail-template/update', data}) } // 删除邮件模版 export const deleteMailTemplate = async (id: number) => { - return await request.delete({ url: '/system/mail-template/delete?id=' + id }) + return await request.delete({url: '/system/mail-template/delete?id=' + id}) } // 发送邮件 export const sendMail = (data: MailSendReqVO) => { - return request.post({ url: '/system/mail-template/send-mail', data }) + return request.post({url: '/system/mail-template/send-mail', data}) } diff --git a/yudao-admin-vue3/src/api/system/menu/index.ts b/yudao-admin-vue3/src/api/system/menu/index.ts index 5a80668..f7d1070 100644 --- a/yudao-admin-vue3/src/api/system/menu/index.ts +++ b/yudao-admin-vue3/src/api/system/menu/index.ts @@ -20,30 +20,30 @@ export interface MenuVO { // 查询菜单(精简)列表 export const getSimpleMenusList = () => { - return request.get({ url: '/system/menu/simple-list' }) + return request.get({url: '/system/menu/simple-list'}) } // 查询菜单列表 export const getMenuList = (params) => { - return request.get({ url: '/system/menu/list', params }) + return request.get({url: '/system/menu/list', params}) } // 获取菜单详情 export const getMenu = (id: number) => { - return request.get({ url: '/system/menu/get?id=' + id }) + return request.get({url: '/system/menu/get?id=' + id}) } // 新增菜单 export const createMenu = (data: MenuVO) => { - return request.post({ url: '/system/menu/create', data }) + return request.post({url: '/system/menu/create', data}) } // 修改菜单 export const updateMenu = (data: MenuVO) => { - return request.put({ url: '/system/menu/update', data }) + return request.put({url: '/system/menu/update', data}) } // 删除菜单 export const deleteMenu = (id: number) => { - return request.delete({ url: '/system/menu/delete?id=' + id }) + return request.delete({url: '/system/menu/delete?id=' + id}) } diff --git a/yudao-admin-vue3/src/api/system/notice/index.ts b/yudao-admin-vue3/src/api/system/notice/index.ts index f643469..b178f73 100644 --- a/yudao-admin-vue3/src/api/system/notice/index.ts +++ b/yudao-admin-vue3/src/api/system/notice/index.ts @@ -13,30 +13,30 @@ export interface NoticeVO { // 查询公告列表 export const getNoticePage = (params: PageParam) => { - return request.get({ url: '/system/notice/page', params }) + return request.get({url: '/system/notice/page', params}) } // 查询公告详情 export const getNotice = (id: number) => { - return request.get({ url: '/system/notice/get?id=' + id }) + return request.get({url: '/system/notice/get?id=' + id}) } // 新增公告 export const createNotice = (data: NoticeVO) => { - return request.post({ url: '/system/notice/create', data }) + return request.post({url: '/system/notice/create', data}) } // 修改公告 export const updateNotice = (data: NoticeVO) => { - return request.put({ url: '/system/notice/update', data }) + return request.put({url: '/system/notice/update', data}) } // 删除公告 export const deleteNotice = (id: number) => { - return request.delete({ url: '/system/notice/delete?id=' + id }) + return request.delete({url: '/system/notice/delete?id=' + id}) } // 推送公告 export const pushNotice = (id: number) => { - return request.post({ url: '/system/notice/push?id=' + id }) + return request.post({url: '/system/notice/push?id=' + id}) } diff --git a/yudao-admin-vue3/src/api/system/notify/message/index.ts b/yudao-admin-vue3/src/api/system/notify/message/index.ts index e407c77..b12c3ed 100644 --- a/yudao-admin-vue3/src/api/system/notify/message/index.ts +++ b/yudao-admin-vue3/src/api/system/notify/message/index.ts @@ -18,32 +18,32 @@ export interface NotifyMessageVO { // 查询站内信消息列表 export const getNotifyMessagePage = async (params: PageParam) => { - return await request.get({ url: '/system/notify-message/page', params }) + return await request.get({url: '/system/notify-message/page', params}) } // 获得我的站内信分页 export const getMyNotifyMessagePage = async (params: PageParam) => { - return await request.get({ url: '/system/notify-message/my-page', params }) + return await request.get({url: '/system/notify-message/my-page', params}) } // 批量标记已读 export const updateNotifyMessageRead = async (ids) => { return await request.put({ - url: '/system/notify-message/update-read?' + qs.stringify({ ids: ids }, { indices: false }) + url: '/system/notify-message/update-read?' + qs.stringify({ids: ids}, {indices: false}) }) } // 标记所有站内信为已读 export const updateAllNotifyMessageRead = async () => { - return await request.put({ url: '/system/notify-message/update-all-read' }) + return await request.put({url: '/system/notify-message/update-all-read'}) } // 获取当前用户的最新站内信列表 export const getUnreadNotifyMessageList = async () => { - return await request.get({ url: '/system/notify-message/get-unread-list' }) + return await request.get({url: '/system/notify-message/get-unread-list'}) } // 获得当前用户的未读站内信数量 export const getUnreadNotifyMessageCount = async () => { - return await request.get({ url: '/system/notify-message/get-unread-count' }) + return await request.get({url: '/system/notify-message/get-unread-count'}) } diff --git a/yudao-admin-vue3/src/api/system/notify/template/index.ts b/yudao-admin-vue3/src/api/system/notify/template/index.ts index 44355df..5e93f22 100644 --- a/yudao-admin-vue3/src/api/system/notify/template/index.ts +++ b/yudao-admin-vue3/src/api/system/notify/template/index.ts @@ -20,30 +20,30 @@ export interface NotifySendReqVO { // 查询站内信模板列表 export const getNotifyTemplatePage = async (params: PageParam) => { - return await request.get({ url: '/system/notify-template/page', params }) + return await request.get({url: '/system/notify-template/page', params}) } // 查询站内信模板详情 export const getNotifyTemplate = async (id: number) => { - return await request.get({ url: '/system/notify-template/get?id=' + id }) + return await request.get({url: '/system/notify-template/get?id=' + id}) } // 新增站内信模板 export const createNotifyTemplate = async (data: NotifyTemplateVO) => { - return await request.post({ url: '/system/notify-template/create', data }) + return await request.post({url: '/system/notify-template/create', data}) } // 修改站内信模板 export const updateNotifyTemplate = async (data: NotifyTemplateVO) => { - return await request.put({ url: '/system/notify-template/update', data }) + return await request.put({url: '/system/notify-template/update', data}) } // 删除站内信模板 export const deleteNotifyTemplate = async (id: number) => { - return await request.delete({ url: '/system/notify-template/delete?id=' + id }) + return await request.delete({url: '/system/notify-template/delete?id=' + id}) } // 发送站内信 export const sendNotify = (data: NotifySendReqVO) => { - return request.post({ url: '/system/notify-template/send-notify', data }) + return request.post({url: '/system/notify-template/send-notify', data}) } diff --git a/yudao-admin-vue3/src/api/system/oauth2/client.ts b/yudao-admin-vue3/src/api/system/oauth2/client.ts index 6f71aca..7d8423c 100644 --- a/yudao-admin-vue3/src/api/system/oauth2/client.ts +++ b/yudao-admin-vue3/src/api/system/oauth2/client.ts @@ -23,25 +23,25 @@ export interface OAuth2ClientVO { // 查询 OAuth2 客户端的列表 export const getOAuth2ClientPage = (params: PageParam) => { - return request.get({ url: '/system/oauth2-client/page', params }) + return request.get({url: '/system/oauth2-client/page', params}) } // 查询 OAuth2 客户端的详情 export const getOAuth2Client = (id: number) => { - return request.get({ url: '/system/oauth2-client/get?id=' + id }) + return request.get({url: '/system/oauth2-client/get?id=' + id}) } // 新增 OAuth2 客户端 export const createOAuth2Client = (data: OAuth2ClientVO) => { - return request.post({ url: '/system/oauth2-client/create', data }) + return request.post({url: '/system/oauth2-client/create', data}) } // 修改 OAuth2 客户端 export const updateOAuth2Client = (data: OAuth2ClientVO) => { - return request.put({ url: '/system/oauth2-client/update', data }) + return request.put({url: '/system/oauth2-client/update', data}) } // 删除 OAuth2 export const deleteOAuth2Client = (id: number) => { - return request.delete({ url: '/system/oauth2-client/delete?id=' + id }) + return request.delete({url: '/system/oauth2-client/delete?id=' + id}) } diff --git a/yudao-admin-vue3/src/api/system/oauth2/token.ts b/yudao-admin-vue3/src/api/system/oauth2/token.ts index ac89ae8..f80b32b 100644 --- a/yudao-admin-vue3/src/api/system/oauth2/token.ts +++ b/yudao-admin-vue3/src/api/system/oauth2/token.ts @@ -13,10 +13,10 @@ export interface OAuth2TokenVO { // 查询 token列表 export const getAccessTokenPage = (params: PageParam) => { - return request.get({ url: '/system/oauth2-token/page', params }) + return request.get({url: '/system/oauth2-token/page', params}) } // 删除 token export const deleteAccessToken = (accessToken: string) => { - return request.delete({ url: '/system/oauth2-token/delete?accessToken=' + accessToken }) + return request.delete({url: '/system/oauth2-token/delete?accessToken=' + accessToken}) } diff --git a/yudao-admin-vue3/src/api/system/operatelog/index.ts b/yudao-admin-vue3/src/api/system/operatelog/index.ts index cdb713e..e79ca30 100644 --- a/yudao-admin-vue3/src/api/system/operatelog/index.ts +++ b/yudao-admin-vue3/src/api/system/operatelog/index.ts @@ -22,9 +22,9 @@ export type OperateLogVO = { // 查询操作日志列表 export const getOperateLogPage = (params: PageParam) => { - return request.get({ url: '/system/operate-log/page', params }) + return request.get({url: '/system/operate-log/page', params}) } // 导出操作日志 export const exportOperateLog = (params: any) => { - return request.download({ url: '/system/operate-log/export', params }) + return request.download({url: '/system/operate-log/export', params}) } diff --git a/yudao-admin-vue3/src/api/system/operatewarning/index.ts b/yudao-admin-vue3/src/api/system/operatewarning/index.ts index 41b2532..0e83e8d 100644 --- a/yudao-admin-vue3/src/api/system/operatewarning/index.ts +++ b/yudao-admin-vue3/src/api/system/operatewarning/index.ts @@ -17,31 +17,31 @@ export interface OperateWarningVO { export const OperateWarningApi = { // 查询告警记录分页 getOperateWarningPage: async (params: any) => { - return await request.get({ url: `/system/operate-warning/page`, params }) + return await request.get({url: `/system/operate-warning/page`, params}) }, // 查询告警记录详情 getOperateWarning: async (id: number) => { - return await request.get({ url: `/system/operate-warning/get?id=` + id }) + return await request.get({url: `/system/operate-warning/get?id=` + id}) }, // 新增告警记录 createOperateWarning: async (data: OperateWarningVO) => { - return await request.post({ url: `/system/operate-warning/create`, data }) + return await request.post({url: `/system/operate-warning/create`, data}) }, // 修改告警记录 updateOperateWarning: async (data: OperateWarningVO) => { - return await request.put({ url: `/system/operate-warning/update`, data }) + return await request.put({url: `/system/operate-warning/update`, data}) }, // 删除告警记录 deleteOperateWarning: async (id: number) => { - return await request.delete({ url: `/system/operate-warning/delete?id=` + id }) + return await request.delete({url: `/system/operate-warning/delete?id=` + id}) }, // 导出告警记录 Excel exportOperateWarning: async (params) => { - return await request.download({ url: `/system/operate-warning/export-excel`, params }) + return await request.download({url: `/system/operate-warning/export-excel`, params}) } -} \ No newline at end of file +} diff --git a/yudao-admin-vue3/src/api/system/permission/index.ts b/yudao-admin-vue3/src/api/system/permission/index.ts index b3c7696..18a88f9 100644 --- a/yudao-admin-vue3/src/api/system/permission/index.ts +++ b/yudao-admin-vue3/src/api/system/permission/index.ts @@ -18,25 +18,25 @@ export interface PermissionAssignRoleDataScopeReqVO { // 查询角色拥有的菜单权限 export const getRoleMenuList = async (roleId: number) => { - return await request.get({ url: '/system/permission/list-role-menus?roleId=' + roleId }) + return await request.get({url: '/system/permission/list-role-menus?roleId=' + roleId}) } // 赋予角色菜单权限 export const assignRoleMenu = async (data: PermissionAssignRoleMenuReqVO) => { - return await request.post({ url: '/system/permission/assign-role-menu', data }) + return await request.post({url: '/system/permission/assign-role-menu', data}) } // 赋予角色数据权限 export const assignRoleDataScope = async (data: PermissionAssignRoleDataScopeReqVO) => { - return await request.post({ url: '/system/permission/assign-role-data-scope', data }) + return await request.post({url: '/system/permission/assign-role-data-scope', data}) } // 查询用户拥有的角色数组 export const getUserRoleList = async (userId: number) => { - return await request.get({ url: '/system/permission/list-user-roles?userId=' + userId }) + return await request.get({url: '/system/permission/list-user-roles?userId=' + userId}) } // 赋予用户角色 export const assignUserRole = async (data: PermissionAssignUserRoleReqVO) => { - return await request.post({ url: '/system/permission/assign-user-role', data }) + return await request.post({url: '/system/permission/assign-user-role', data}) } diff --git a/yudao-admin-vue3/src/api/system/post/index.ts b/yudao-admin-vue3/src/api/system/post/index.ts index 0e6f2ca..3d264df 100644 --- a/yudao-admin-vue3/src/api/system/post/index.ts +++ b/yudao-admin-vue3/src/api/system/post/index.ts @@ -12,35 +12,35 @@ export interface PostVO { // 查询岗位列表 export const getPostPage = async (params: PageParam) => { - return await request.get({ url: '/system/post/page', params }) + return await request.get({url: '/system/post/page', params}) } // 获取岗位精简信息列表 export const getSimplePostList = async (): Promise => { - return await request.get({ url: '/system/post/simple-list' }) + return await request.get({url: '/system/post/simple-list'}) } // 查询岗位详情 export const getPost = async (id: number) => { - return await request.get({ url: '/system/post/get?id=' + id }) + return await request.get({url: '/system/post/get?id=' + id}) } // 新增岗位 export const createPost = async (data: PostVO) => { - return await request.post({ url: '/system/post/create', data }) + return await request.post({url: '/system/post/create', data}) } // 修改岗位 export const updatePost = async (data: PostVO) => { - return await request.put({ url: '/system/post/update', data }) + return await request.put({url: '/system/post/update', data}) } // 删除岗位 export const deletePost = async (id: number) => { - return await request.delete({ url: '/system/post/delete?id=' + id }) + return await request.delete({url: '/system/post/delete?id=' + id}) } // 导出岗位 export const exportPost = async (params) => { - return await request.download({ url: '/system/post/export', params }) + return await request.download({url: '/system/post/export', params}) } diff --git a/yudao-admin-vue3/src/api/system/role/index.ts b/yudao-admin-vue3/src/api/system/role/index.ts index 3325dde..e3fc4cb 100644 --- a/yudao-admin-vue3/src/api/system/role/index.ts +++ b/yudao-admin-vue3/src/api/system/role/index.ts @@ -19,37 +19,37 @@ export interface UpdateStatusReqVO { // 查询角色列表 export const getRolePage = async (params: PageParam) => { - return await request.get({ url: '/system/role/page', params }) + return await request.get({url: '/system/role/page', params}) } // 查询角色(精简)列表 export const getSimpleRoleList = async (): Promise => { - return await request.get({ url: '/system/role/simple-list' }) + return await request.get({url: '/system/role/simple-list'}) } // 查询角色详情 export const getRole = async (id: number) => { - return await request.get({ url: '/system/role/get?id=' + id }) + return await request.get({url: '/system/role/get?id=' + id}) } // 新增角色 export const createRole = async (data: RoleVO) => { - return await request.post({ url: '/system/role/create', data }) + return await request.post({url: '/system/role/create', data}) } // 修改角色 export const updateRole = async (data: RoleVO) => { - return await request.put({ url: '/system/role/update', data }) + return await request.put({url: '/system/role/update', data}) } // 修改角色状态 export const updateRoleStatus = async (data: UpdateStatusReqVO) => { - return await request.put({ url: '/system/role/update-status', data }) + return await request.put({url: '/system/role/update-status', data}) } // 删除角色 export const deleteRole = async (id: number) => { - return await request.delete({ url: '/system/role/delete?id=' + id }) + return await request.delete({url: '/system/role/delete?id=' + id}) } // 导出角色 diff --git a/yudao-admin-vue3/src/api/system/sms/smsChannel/index.ts b/yudao-admin-vue3/src/api/system/sms/smsChannel/index.ts index bcdaa7f..e7f0400 100644 --- a/yudao-admin-vue3/src/api/system/sms/smsChannel/index.ts +++ b/yudao-admin-vue3/src/api/system/sms/smsChannel/index.ts @@ -14,30 +14,30 @@ export interface SmsChannelVO { // 查询短信渠道列表 export const getSmsChannelPage = (params: PageParam) => { - return request.get({ url: '/system/sms-channel/page', params }) + return request.get({url: '/system/sms-channel/page', params}) } // 获得短信渠道精简列表 export function getSimpleSmsChannelList() { - return request.get({ url: '/system/sms-channel/simple-list' }) + return request.get({url: '/system/sms-channel/simple-list'}) } // 查询短信渠道详情 export const getSmsChannel = (id: number) => { - return request.get({ url: '/system/sms-channel/get?id=' + id }) + return request.get({url: '/system/sms-channel/get?id=' + id}) } // 新增短信渠道 export const createSmsChannel = (data: SmsChannelVO) => { - return request.post({ url: '/system/sms-channel/create', data }) + return request.post({url: '/system/sms-channel/create', data}) } // 修改短信渠道 export const updateSmsChannel = (data: SmsChannelVO) => { - return request.put({ url: '/system/sms-channel/update', data }) + return request.put({url: '/system/sms-channel/update', data}) } // 删除短信渠道 export const deleteSmsChannel = (id: number) => { - return request.delete({ url: '/system/sms-channel/delete?id=' + id }) + return request.delete({url: '/system/sms-channel/delete?id=' + id}) } diff --git a/yudao-admin-vue3/src/api/system/sms/smsLog/index.ts b/yudao-admin-vue3/src/api/system/sms/smsLog/index.ts index f989171..ec36e76 100644 --- a/yudao-admin-vue3/src/api/system/sms/smsLog/index.ts +++ b/yudao-admin-vue3/src/api/system/sms/smsLog/index.ts @@ -28,10 +28,10 @@ export interface SmsLogVO { // 查询短信日志列表 export const getSmsLogPage = (params: PageParam) => { - return request.get({ url: '/system/sms-log/page', params }) + return request.get({url: '/system/sms-log/page', params}) } // 导出短信日志 export const exportSmsLog = (params) => { - return request.download({ url: '/system/sms-log/export-excel', params }) + return request.download({url: '/system/sms-log/export-excel', params}) } diff --git a/yudao-admin-vue3/src/api/system/sms/smsTemplate/index.ts b/yudao-admin-vue3/src/api/system/sms/smsTemplate/index.ts index 868ddd4..bb7de72 100644 --- a/yudao-admin-vue3/src/api/system/sms/smsTemplate/index.ts +++ b/yudao-admin-vue3/src/api/system/sms/smsTemplate/index.ts @@ -23,27 +23,27 @@ export interface SendSmsReqVO { // 查询短信模板列表 export const getSmsTemplatePage = (params: PageParam) => { - return request.get({ url: '/system/sms-template/page', params }) + return request.get({url: '/system/sms-template/page', params}) } // 查询短信模板详情 export const getSmsTemplate = (id: number) => { - return request.get({ url: '/system/sms-template/get?id=' + id }) + return request.get({url: '/system/sms-template/get?id=' + id}) } // 新增短信模板 export const createSmsTemplate = (data: SmsTemplateVO) => { - return request.post({ url: '/system/sms-template/create', data }) + return request.post({url: '/system/sms-template/create', data}) } // 修改短信模板 export const updateSmsTemplate = (data: SmsTemplateVO) => { - return request.put({ url: '/system/sms-template/update', data }) + return request.put({url: '/system/sms-template/update', data}) } // 删除短信模板 export const deleteSmsTemplate = (id: number) => { - return request.delete({ url: '/system/sms-template/delete?id=' + id }) + return request.delete({url: '/system/sms-template/delete?id=' + id}) } // 导出短信模板 @@ -56,5 +56,5 @@ export const exportSmsTemplate = (params) => { // 发送短信 export const sendSms = (data: SendSmsReqVO) => { - return request.post({ url: '/system/sms-template/send-sms', data }) + return request.post({url: '/system/sms-template/send-sms', data}) } diff --git a/yudao-admin-vue3/src/api/system/social/client/index.ts b/yudao-admin-vue3/src/api/system/social/client/index.ts index bf13ab4..cd2a0bd 100644 --- a/yudao-admin-vue3/src/api/system/social/client/index.ts +++ b/yudao-admin-vue3/src/api/system/social/client/index.ts @@ -13,25 +13,25 @@ export interface SocialClientVO { // 查询社交客户端列表 export const getSocialClientPage = async (params) => { - return await request.get({ url: `/system/social-client/page`, params }) + return await request.get({url: `/system/social-client/page`, params}) } // 查询社交客户端详情 export const getSocialClient = async (id: number) => { - return await request.get({ url: `/system/social-client/get?id=` + id }) + return await request.get({url: `/system/social-client/get?id=` + id}) } // 新增社交客户端 export const createSocialClient = async (data: SocialClientVO) => { - return await request.post({ url: `/system/social-client/create`, data }) + return await request.post({url: `/system/social-client/create`, data}) } // 修改社交客户端 export const updateSocialClient = async (data: SocialClientVO) => { - return await request.put({ url: `/system/social-client/update`, data }) + return await request.put({url: `/system/social-client/update`, data}) } // 删除社交客户端 export const deleteSocialClient = async (id: number) => { - return await request.delete({ url: `/system/social-client/delete?id=` + id }) + return await request.delete({url: `/system/social-client/delete?id=` + id}) } diff --git a/yudao-admin-vue3/src/api/system/social/user/index.ts b/yudao-admin-vue3/src/api/system/social/user/index.ts index f11231b..9c3849f 100644 --- a/yudao-admin-vue3/src/api/system/social/user/index.ts +++ b/yudao-admin-vue3/src/api/system/social/user/index.ts @@ -15,10 +15,10 @@ export interface SocialUserVO { // 查询社交用户列表 export const getSocialUserPage = async (params) => { - return await request.get({ url: `/system/social-user/page`, params }) + return await request.get({url: `/system/social-user/page`, params}) } // 查询社交用户详情 export const getSocialUser = async (id: number) => { - return await request.get({ url: `/system/social-user/get?id=` + id }) + return await request.get({url: `/system/social-user/get?id=` + id}) } diff --git a/yudao-admin-vue3/src/api/system/tenant/index.ts b/yudao-admin-vue3/src/api/system/tenant/index.ts index 176c375..baced4c 100644 --- a/yudao-admin-vue3/src/api/system/tenant/index.ts +++ b/yudao-admin-vue3/src/api/system/tenant/index.ts @@ -33,30 +33,30 @@ export interface TenantExportReqVO { // 查询租户列表 export const getTenantPage = (params: TenantPageReqVO) => { - return request.get({ url: '/system/tenant/page', params }) + return request.get({url: '/system/tenant/page', params}) } // 查询租户详情 export const getTenant = (id: number) => { - return request.get({ url: '/system/tenant/get?id=' + id }) + return request.get({url: '/system/tenant/get?id=' + id}) } // 新增租户 export const createTenant = (data: TenantVO) => { - return request.post({ url: '/system/tenant/create', data }) + return request.post({url: '/system/tenant/create', data}) } // 修改租户 export const updateTenant = (data: TenantVO) => { - return request.put({ url: '/system/tenant/update', data }) + return request.put({url: '/system/tenant/update', data}) } // 删除租户 export const deleteTenant = (id: number) => { - return request.delete({ url: '/system/tenant/delete?id=' + id }) + return request.delete({url: '/system/tenant/delete?id=' + id}) } // 导出租户 export const exportTenant = (params: TenantExportReqVO) => { - return request.download({ url: '/system/tenant/export-excel', params }) + return request.download({url: '/system/tenant/export-excel', params}) } diff --git a/yudao-admin-vue3/src/api/system/tenantPackage/index.ts b/yudao-admin-vue3/src/api/system/tenantPackage/index.ts index e01375a..8913a96 100644 --- a/yudao-admin-vue3/src/api/system/tenantPackage/index.ts +++ b/yudao-admin-vue3/src/api/system/tenantPackage/index.ts @@ -14,29 +14,29 @@ export interface TenantPackageVO { // 查询租户套餐列表 export const getTenantPackagePage = (params: PageParam) => { - return request.get({ url: '/system/tenant-package/page', params }) + return request.get({url: '/system/tenant-package/page', params}) } // 获得租户 export const getTenantPackage = (id: number) => { - return request.get({ url: '/system/tenant-package/get?id=' + id }) + return request.get({url: '/system/tenant-package/get?id=' + id}) } // 新增租户套餐 export const createTenantPackage = (data: TenantPackageVO) => { - return request.post({ url: '/system/tenant-package/create', data }) + return request.post({url: '/system/tenant-package/create', data}) } // 修改租户套餐 export const updateTenantPackage = (data: TenantPackageVO) => { - return request.put({ url: '/system/tenant-package/update', data }) + return request.put({url: '/system/tenant-package/update', data}) } // 删除租户套餐 export const deleteTenantPackage = (id: number) => { - return request.delete({ url: '/system/tenant-package/delete?id=' + id }) + return request.delete({url: '/system/tenant-package/delete?id=' + id}) } // 获取租户套餐精简信息列表 export const getTenantPackageList = () => { - return request.get({ url: '/system/tenant-package/simple-list' }) + return request.get({url: '/system/tenant-package/simple-list'}) } diff --git a/yudao-admin-vue3/src/api/system/user/index.ts b/yudao-admin-vue3/src/api/system/user/index.ts index beb6e51..449dddc 100644 --- a/yudao-admin-vue3/src/api/system/user/index.ts +++ b/yudao-admin-vue3/src/api/system/user/index.ts @@ -19,42 +19,42 @@ export interface UserVO { // 查询用户管理列表 export const getUserPage = (params: PageParam) => { - return request.get({ url: '/system/user/page', params }) + return request.get({url: '/system/user/page', params}) } // 查询所有用户列表 export const getAllUser = () => { - return request.get({ url: '/system/user/all' }) + return request.get({url: '/system/user/all'}) } // 查询用户详情 export const getUser = (id: number) => { - return request.get({ url: '/system/user/get?id=' + id }) + return request.get({url: '/system/user/get?id=' + id}) } // 新增用户 export const createUser = (data: UserVO) => { - return request.post({ url: '/system/user/create', data }) + return request.post({url: '/system/user/create', data}) } // 修改用户 export const updateUser = (data: UserVO) => { - return request.put({ url: '/system/user/update', data }) + return request.put({url: '/system/user/update', data}) } // 删除用户 export const deleteUser = (id: number) => { - return request.delete({ url: '/system/user/delete?id=' + id }) + return request.delete({url: '/system/user/delete?id=' + id}) } // 导出用户 export const exportUser = (params) => { - return request.download({ url: '/system/user/export', params }) + return request.download({url: '/system/user/export', params}) } // 下载用户导入模板 export const importUserTemplate = () => { - return request.download({ url: '/system/user/get-import-template' }) + return request.download({url: '/system/user/get-import-template'}) } // 用户密码重置 @@ -63,7 +63,7 @@ export const resetUserPwd = (id: number, password: string) => { id, password } - return request.put({ url: '/system/user/update-password', data: data }) + return request.put({url: '/system/user/update-password', data: data}) } // 用户状态修改 @@ -72,10 +72,10 @@ export const updateUserStatus = (id: number, status: number) => { id, status } - return request.put({ url: '/system/user/update-status', data: data }) + return request.put({url: '/system/user/update-status', data: data}) } // 获取用户精简信息列表 export const getSimpleUserList = (): Promise => { - return request.get({ url: '/system/user/simple-list' }) + return request.get({url: '/system/user/simple-list'}) } diff --git a/yudao-admin-vue3/src/api/system/user/profile.ts b/yudao-admin-vue3/src/api/system/user/profile.ts index 1e80e85..3f50a8a 100644 --- a/yudao-admin-vue3/src/api/system/user/profile.ts +++ b/yudao-admin-vue3/src/api/system/user/profile.ts @@ -40,12 +40,12 @@ export interface UserProfileUpdateReqVO { // 查询用户个人信息 export const getUserProfile = () => { - return request.get({ url: '/system/user/profile/get' }) + return request.get({url: '/system/user/profile/get'}) } // 修改用户个人信息 export const updateUserProfile = (data: UserProfileUpdateReqVO) => { - return request.put({ url: '/system/user/profile/update', data }) + return request.put({url: '/system/user/profile/update', data}) } // 用户密码重置 @@ -61,5 +61,5 @@ export const updateUserPassword = (oldPassword: string, newPassword: string) => // 用户头像上传 export const uploadAvatar = (data) => { - return request.upload({ url: '/system/user/profile/update-avatar', data: data }) + return request.upload({url: '/system/user/profile/update-avatar', data: data}) } diff --git a/yudao-admin-vue3/src/hooks/event/useScrollTo.ts b/yudao-admin-vue3/src/hooks/event/useScrollTo.ts index 92aec87..076e8be 100644 --- a/yudao-admin-vue3/src/hooks/event/useScrollTo.ts +++ b/yudao-admin-vue3/src/hooks/event/useScrollTo.ts @@ -19,12 +19,12 @@ const move = (el: HTMLElement, position: string, amount: number) => { } export function useScrollTo({ - el, - position = 'scrollLeft', - to, - duration = 500, - callback -}: ScrollToParams) { + el, + position = 'scrollLeft', + to, + duration = 500, + callback + }: ScrollToParams) { const isActiveRef = ref(false) const start = el[position] const change = to - start @@ -56,5 +56,5 @@ export function useScrollTo({ isActiveRef.value = false } - return { start: run, stop } + return {start: run, stop} } diff --git a/yudao-admin-vue3/src/hooks/web/useCache.ts b/yudao-admin-vue3/src/hooks/web/useCache.ts index 4f39f30..3ad947f 100644 --- a/yudao-admin-vue3/src/hooks/web/useCache.ts +++ b/yudao-admin-vue3/src/hooks/web/useCache.ts @@ -32,7 +32,7 @@ export const useCache = (type: CacheType = 'localStorage') => { } export const deleteUserCache = () => { - const { wsCache } = useCache() + const {wsCache} = useCache() wsCache.delete(CACHE_KEY.USER) wsCache.delete(CACHE_KEY.ROLE_ROUTERS) // 注意,不要清理 LoginForm 登录表单 diff --git a/yudao-admin-vue3/src/hooks/web/useConfigGlobal.ts b/yudao-admin-vue3/src/hooks/web/useConfigGlobal.ts index afb3db3..7274d02 100644 --- a/yudao-admin-vue3/src/hooks/web/useConfigGlobal.ts +++ b/yudao-admin-vue3/src/hooks/web/useConfigGlobal.ts @@ -1,4 +1,4 @@ -import { ConfigGlobalTypes } from '@/types/configGlobal' +import {ConfigGlobalTypes} from '@/types/configGlobal' export const useConfigGlobal = () => { const configGlobal = inject('configGlobal', {}) as ConfigGlobalTypes diff --git a/yudao-admin-vue3/src/hooks/web/useCrudSchemas.ts b/yudao-admin-vue3/src/hooks/web/useCrudSchemas.ts index 458b57e..df1f178 100644 --- a/yudao-admin-vue3/src/hooks/web/useCrudSchemas.ts +++ b/yudao-admin-vue3/src/hooks/web/useCrudSchemas.ts @@ -1,15 +1,15 @@ -import { reactive } from 'vue' -import { AxiosPromise } from 'axios' -import { findIndex } from '@/utils' -import { eachTree, filter, treeMap } from '@/utils/tree' -import { getBoolDictOptions, getDictOptions, getIntDictOptions } from '@/utils/dict' +import {reactive} from 'vue' +import {AxiosPromise} from 'axios' +import {findIndex} from '@/utils' +import {eachTree, filter, treeMap} from '@/utils/tree' +import {getBoolDictOptions, getDictOptions, getIntDictOptions} from '@/utils/dict' -import { FormSchema } from '@/types/form' -import { TableColumn } from '@/types/table' -import { DescriptionsSchema } from '@/types/descriptions' -import { ComponentOptions, ComponentProps } from '@/types/components' -import { DictTag } from '@/components/DictTag' -import { cloneDeep, merge } from 'lodash-es' +import {FormSchema} from '@/types/form' +import {TableColumn} from '@/types/table' +import {DescriptionsSchema} from '@/types/descriptions' +import {ComponentOptions, ComponentProps} from '@/types/components' +import {DictTag} from '@/components/DictTag' +import {cloneDeep, merge} from 'lodash-es' export type CrudSchema = Omit & { isSearch?: boolean // 是否在查询显示 @@ -61,7 +61,7 @@ interface AllSchemas { detailSchema: DescriptionsSchema[] } -const { t } = useI18n() +const {t} = useI18n() // 过滤所有结构 export const useCrudSchemas = ( @@ -107,7 +107,7 @@ const filterSearchSchema = (crudSchema: CrudSchema[], allSchemas: AllSchemas): F const options: ComponentOptions[] = [] let comonentProps: ComponentProps = {} if (schemaItem.dictType) { - const allOptions: ComponentOptions = { label: '全部', value: '' } + const allOptions: ComponentOptions = {label: '全部', value: ''} options.push(allOptions) getDictOptions(schemaItem.dictType).forEach((dict) => { options.push(dict) @@ -127,7 +127,7 @@ const filterSearchSchema = (crudSchema: CrudSchema[], allSchemas: AllSchemas): F field: schemaItem.field, label: schemaItem.search?.label || schemaItem.label }, - { componentProps: comonentProps } + {componentProps: comonentProps} ) if (searchSchemaItem.api) { searchRequestTask.push(async () => { @@ -239,7 +239,7 @@ const filterFormSchema = (crudSchema: CrudSchema[], allSchemas: AllSchemas): For field: schemaItem.field, label: schemaItem.form?.label || schemaItem.label }, - { componentProps: comonentProps } + {componentProps: comonentProps} ) if (formSchemaItem.api) { diff --git a/yudao-admin-vue3/src/hooks/web/useForm.ts b/yudao-admin-vue3/src/hooks/web/useForm.ts index 53a8a94..9c83fa6 100644 --- a/yudao-admin-vue3/src/hooks/web/useForm.ts +++ b/yudao-admin-vue3/src/hooks/web/useForm.ts @@ -1,7 +1,7 @@ -import type { Form, FormExpose } from '@/components/Form' -import type { ElForm } from 'element-plus' -import type { FormProps } from '@/components/Form/src/types' -import { FormSchema, FormSetPropsType } from '@/types/form' +import type {Form, FormExpose} from '@/components/Form' +import type {ElForm} from 'element-plus' +import type {FormProps} from '@/components/Form/src/types' +import {FormSchema, FormSetPropsType} from '@/types/form' export const useForm = (props?: FormProps) => { // From实例 diff --git a/yudao-admin-vue3/src/hooks/web/useGuide.ts b/yudao-admin-vue3/src/hooks/web/useGuide.ts index 7fd2fb0..e19c04d 100644 --- a/yudao-admin-vue3/src/hooks/web/useGuide.ts +++ b/yudao-admin-vue3/src/hooks/web/useGuide.ts @@ -1,11 +1,11 @@ -import { Config, driver } from 'driver.js' +import {Config, driver} from 'driver.js' import 'driver.js/dist/driver.css' -import { useDesign } from '@/hooks/web/useDesign' -import { useI18n } from '@/hooks/web/useI18n' +import {useDesign} from '@/hooks/web/useDesign' +import {useI18n} from '@/hooks/web/useI18n' -const { t } = useI18n() +const {t} = useI18n() -const { variables } = useDesign() +const {variables} = useDesign() export const useGuide = (options?: Config) => { const driverObj = driver( diff --git a/yudao-admin-vue3/src/hooks/web/useI18n.ts b/yudao-admin-vue3/src/hooks/web/useI18n.ts index d1ab70f..6e73e50 100644 --- a/yudao-admin-vue3/src/hooks/web/useI18n.ts +++ b/yudao-admin-vue3/src/hooks/web/useI18n.ts @@ -1,4 +1,4 @@ -import { i18n } from '@/plugins/vueI18n' +import {i18n} from '@/plugins/vueI18n' type I18nGlobalTranslation = { (key: string): string @@ -36,7 +36,7 @@ export const useI18n = ( return normalFn } - const { t, ...methods } = i18n.global + const {t, ...methods} = i18n.global const tFn: I18nGlobalTranslation = (key: string, ...arg: any[]) => { if (!key) return '' diff --git a/yudao-admin-vue3/src/hooks/web/useIcon.ts b/yudao-admin-vue3/src/hooks/web/useIcon.ts index 3500204..8e27b34 100644 --- a/yudao-admin-vue3/src/hooks/web/useIcon.ts +++ b/yudao-admin-vue3/src/hooks/web/useIcon.ts @@ -1,7 +1,7 @@ -import { h } from 'vue' -import type { VNode } from 'vue' -import { Icon } from '@/components/Icon' -import { IconTypes } from '@/types/icon' +import {h} from 'vue' +import type {VNode} from 'vue' +import {Icon} from '@/components/Icon' +import {IconTypes} from '@/types/icon' export const useIcon = (props: IconTypes): VNode => { return h(Icon, props) diff --git a/yudao-admin-vue3/src/hooks/web/useLocale.ts b/yudao-admin-vue3/src/hooks/web/useLocale.ts index c65070e..a26112e 100644 --- a/yudao-admin-vue3/src/hooks/web/useLocale.ts +++ b/yudao-admin-vue3/src/hooks/web/useLocale.ts @@ -1,6 +1,6 @@ -import { i18n } from '@/plugins/vueI18n' -import { useLocaleStoreWithOut } from '@/store/modules/locale' -import { setHtmlPageLang } from '@/plugins/vueI18n/helper' +import {i18n} from '@/plugins/vueI18n' +import {useLocaleStoreWithOut} from '@/store/modules/locale' +import {setHtmlPageLang} from '@/plugins/vueI18n/helper' const setI18nLanguage = (locale: LocaleType) => { const localeStore = useLocaleStoreWithOut() diff --git a/yudao-admin-vue3/src/hooks/web/useMessage.ts b/yudao-admin-vue3/src/hooks/web/useMessage.ts index ac2b552..3b2f08a 100644 --- a/yudao-admin-vue3/src/hooks/web/useMessage.ts +++ b/yudao-admin-vue3/src/hooks/web/useMessage.ts @@ -1,7 +1,8 @@ -import { ElMessage, ElMessageBox, ElNotification } from 'element-plus' -import { useI18n } from './useI18n' +import {ElMessage, ElMessageBox, ElNotification} from 'element-plus' +import {useI18n} from './useI18n' + export const useMessage = () => { - const { t } = useI18n() + const {t} = useI18n() return { // 消息提示 info(content: string) { @@ -25,15 +26,15 @@ export const useMessage = () => { }, // 错误提示 alertError(content: string) { - ElMessageBox.alert(content, t('common.confirmTitle'), { type: 'error' }) + ElMessageBox.alert(content, t('common.confirmTitle'), {type: 'error'}) }, // 成功提示 alertSuccess(content: string) { - ElMessageBox.alert(content, t('common.confirmTitle'), { type: 'success' }) + ElMessageBox.alert(content, t('common.confirmTitle'), {type: 'success'}) }, // 警告提示 alertWarning(content: string) { - ElMessageBox.alert(content, t('common.confirmTitle'), { type: 'warning' }) + ElMessageBox.alert(content, t('common.confirmTitle'), {type: 'warning'}) }, // 通知提示 notify(content: string) { diff --git a/yudao-admin-vue3/src/hooks/web/useNProgress.ts b/yudao-admin-vue3/src/hooks/web/useNProgress.ts index 6d8c0b9..4e12043 100644 --- a/yudao-admin-vue3/src/hooks/web/useNProgress.ts +++ b/yudao-admin-vue3/src/hooks/web/useNProgress.ts @@ -1,12 +1,12 @@ -import { useCssVar } from '@vueuse/core' -import type { NProgressOptions } from 'nprogress' +import {useCssVar} from '@vueuse/core' +import type {NProgressOptions} from 'nprogress' import NProgress from 'nprogress' import 'nprogress/nprogress.css' const primaryColor = useCssVar('--el-color-primary', document.documentElement) export const useNProgress = () => { - NProgress.configure({ showSpinner: false } as NProgressOptions) + NProgress.configure({showSpinner: false} as NProgressOptions) const initColor = async () => { await nextTick() diff --git a/yudao-admin-vue3/src/hooks/web/useNetwork.ts b/yudao-admin-vue3/src/hooks/web/useNetwork.ts index 66fa446..ea19c08 100644 --- a/yudao-admin-vue3/src/hooks/web/useNetwork.ts +++ b/yudao-admin-vue3/src/hooks/web/useNetwork.ts @@ -1,4 +1,4 @@ -import { ref, onBeforeUnmount } from 'vue' +import {ref, onBeforeUnmount} from 'vue' const useNetwork = () => { const online = ref(true) @@ -15,7 +15,7 @@ const useNetwork = () => { window.removeEventListener('offline', updateNetwork) }) - return { online } + return {online} } -export { useNetwork } +export {useNetwork} diff --git a/yudao-admin-vue3/src/hooks/web/useNow.ts b/yudao-admin-vue3/src/hooks/web/useNow.ts index 09d3176..762b8ac 100644 --- a/yudao-admin-vue3/src/hooks/web/useNow.ts +++ b/yudao-admin-vue3/src/hooks/web/useNow.ts @@ -1,6 +1,6 @@ -import { dateUtil } from '@/utils/dateUtil' -import { reactive, toRefs } from 'vue' -import { tryOnMounted, tryOnUnmounted } from '@vueuse/core' +import {dateUtil} from '@/utils/dateUtil' +import {reactive, toRefs} from 'vue' +import {tryOnMounted, tryOnUnmounted} from '@vueuse/core' export const useNow = (immediate = true) => { let timer: IntervalHandle diff --git a/yudao-admin-vue3/src/hooks/web/usePageLoading.ts b/yudao-admin-vue3/src/hooks/web/usePageLoading.ts index bb89457..505a207 100644 --- a/yudao-admin-vue3/src/hooks/web/usePageLoading.ts +++ b/yudao-admin-vue3/src/hooks/web/usePageLoading.ts @@ -1,4 +1,4 @@ -import { useAppStoreWithOut } from '@/store/modules/app' +import {useAppStoreWithOut} from '@/store/modules/app' const appStore = useAppStoreWithOut() diff --git a/yudao-admin-vue3/src/hooks/web/useTable.ts b/yudao-admin-vue3/src/hooks/web/useTable.ts index 361dd67..f6a0365 100644 --- a/yudao-admin-vue3/src/hooks/web/useTable.ts +++ b/yudao-admin-vue3/src/hooks/web/useTable.ts @@ -1,12 +1,13 @@ import download from '@/utils/download' -import { Table, TableExpose } from '@/components/Table' -import { ElMessage, ElMessageBox, ElTable } from 'element-plus' -import { computed, nextTick, reactive, ref, unref, watch } from 'vue' -import type { TableProps } from '@/components/Table/src/types' +import {Table, TableExpose} from '@/components/Table' +import {ElMessage, ElMessageBox, ElTable} from 'element-plus' +import {computed, nextTick, reactive, ref, unref, watch} from 'vue' +import type {TableProps} from '@/components/Table/src/types' -import { TableSetPropsType } from '@/types/table' +import {TableSetPropsType} from '@/types/table' + +const {t} = useI18n() -const { t } = useI18n() interface ResponseType { list: T[] total?: number @@ -122,8 +123,8 @@ export const useTable = (config?: UseTableConfig) => { tableObject.currentPage = tableObject.total % tableObject.pageSize === idsLength || tableObject.pageSize === 1 ? tableObject.currentPage > 1 - ? tableObject.currentPage - 1 - : tableObject.currentPage + ? tableObject.currentPage - 1 + : tableObject.currentPage : tableObject.currentPage await methods.getList() } diff --git a/yudao-admin-vue3/src/hooks/web/useTagsView.ts b/yudao-admin-vue3/src/hooks/web/useTagsView.ts index 31eadb0..c8e39b1 100644 --- a/yudao-admin-vue3/src/hooks/web/useTagsView.ts +++ b/yudao-admin-vue3/src/hooks/web/useTagsView.ts @@ -1,11 +1,11 @@ -import { useTagsViewStoreWithOut } from '@/store/modules/tagsView' -import { RouteLocationNormalizedLoaded, useRouter } from 'vue-router' -import { computed, nextTick, unref } from 'vue' +import {useTagsViewStoreWithOut} from '@/store/modules/tagsView' +import {RouteLocationNormalizedLoaded, useRouter} from 'vue-router' +import {computed, nextTick, unref} from 'vue' export const useTagsView = () => { const tagsViewStore = useTagsViewStoreWithOut() - const { replace, currentRoute } = useRouter() + const {replace, currentRoute} = useRouter() const selectedTag = computed(() => tagsViewStore.getSelectedTag) @@ -38,7 +38,7 @@ export const useTagsView = () => { const refreshPage = async (view?: RouteLocationNormalizedLoaded, callback?: Fn) => { tagsViewStore.delCachedView() - const { path, query } = view || unref(currentRoute) + const {path, query} = view || unref(currentRoute) await nextTick() replace({ path: '/redirect' + path, diff --git a/yudao-admin-vue3/src/hooks/web/useTimeAgo.ts b/yudao-admin-vue3/src/hooks/web/useTimeAgo.ts index a6da281..19176f5 100644 --- a/yudao-admin-vue3/src/hooks/web/useTimeAgo.ts +++ b/yudao-admin-vue3/src/hooks/web/useTimeAgo.ts @@ -1,5 +1,5 @@ -import { useTimeAgo as useTimeAgoCore, UseTimeAgoMessages } from '@vueuse/core' -import { useLocaleStoreWithOut } from '@/store/modules/locale' +import {useTimeAgo as useTimeAgoCore, UseTimeAgoMessages} from '@vueuse/core' +import {useLocaleStoreWithOut} from '@/store/modules/locale' const TIME_AGO_MESSAGE_MAP: { 'zh-CN': UseTimeAgoMessages diff --git a/yudao-admin-vue3/src/hooks/web/useTitle.ts b/yudao-admin-vue3/src/hooks/web/useTitle.ts index 020a9b7..48ca481 100644 --- a/yudao-admin-vue3/src/hooks/web/useTitle.ts +++ b/yudao-admin-vue3/src/hooks/web/useTitle.ts @@ -1,11 +1,11 @@ -import { watch, ref } from 'vue' -import { isString } from '@/utils/is' -import { useAppStoreWithOut } from '@/store/modules/app' +import {watch, ref} from 'vue' +import {isString} from '@/utils/is' +import {useAppStoreWithOut} from '@/store/modules/app' const appStore = useAppStoreWithOut() export const useTitle = (newTitle?: string) => { - const { t } = useI18n() + const {t} = useI18n() const title = ref( newTitle ? `${appStore.getTitle} - ${t(newTitle as string)}` : appStore.getTitle ) @@ -17,7 +17,7 @@ export const useTitle = (newTitle?: string) => { document.title = n } }, - { immediate: true } + {immediate: true} ) return title diff --git a/yudao-admin-vue3/src/hooks/web/useValidator.ts b/yudao-admin-vue3/src/hooks/web/useValidator.ts index 151e35b..67ac7fb 100644 --- a/yudao-admin-vue3/src/hooks/web/useValidator.ts +++ b/yudao-admin-vue3/src/hooks/web/useValidator.ts @@ -1,7 +1,7 @@ -import { useI18n } from '@/hooks/web/useI18n' -import { FormItemRule } from 'element-plus' +import {useI18n} from '@/hooks/web/useI18n' +import {FormItemRule} from 'element-plus' -const { t } = useI18n() +const {t} = useI18n() interface LengthRange { min: number @@ -18,12 +18,12 @@ export const useValidator = () => { } const lengthRange = (options: LengthRange): FormItemRule => { - const { min, max, message } = options + const {min, max, message} = options return { min, max, - message: message || t('common.lengthRange', { min, max }) + message: message || t('common.lengthRange', {min, max}) } } diff --git a/yudao-admin-vue3/src/hooks/web/useWatermark.ts b/yudao-admin-vue3/src/hooks/web/useWatermark.ts index 4a31359..08f67b7 100644 --- a/yudao-admin-vue3/src/hooks/web/useWatermark.ts +++ b/yudao-admin-vue3/src/hooks/web/useWatermark.ts @@ -1,7 +1,8 @@ const domSymbol = Symbol('watermark-dom') export function useWatermark(appendEl: HTMLElement | null = document.body) { - let func: Fn = () => {} + let func: Fn = () => { + } const id = domSymbol.toString() const clear = () => { const domId = document.getElementById(id) @@ -51,5 +52,5 @@ export function useWatermark(appendEl: HTMLElement | null = document.body) { window.addEventListener('resize', func) } - return { setWatermark, clear } + return {setWatermark, clear} } diff --git a/yudao-admin-vue3/src/store/index.ts b/yudao-admin-vue3/src/store/index.ts index 63f0045..56c99ce 100644 --- a/yudao-admin-vue3/src/store/index.ts +++ b/yudao-admin-vue3/src/store/index.ts @@ -1,5 +1,5 @@ -import type { App } from 'vue' -import { createPinia } from 'pinia' +import type {App} from 'vue' +import {createPinia} from 'pinia' import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' const store = createPinia() @@ -9,4 +9,4 @@ export const setupStore = (app: App) => { app.use(store) } -export { store } +export {store} diff --git a/yudao-admin-vue3/src/store/modules/app.ts b/yudao-admin-vue3/src/store/modules/app.ts index 8733618..9497502 100644 --- a/yudao-admin-vue3/src/store/modules/app.ts +++ b/yudao-admin-vue3/src/store/modules/app.ts @@ -1,13 +1,13 @@ -import { defineStore } from 'pinia' -import { store } from '../index' -import { setCssVar, humpToUnderline } from '@/utils' -import { ElMessage } from 'element-plus' -import { CACHE_KEY, useCache } from '@/hooks/web/useCache' -import { ElementPlusSize } from '@/types/elementPlus' -import { LayoutType } from '@/types/layout' -import { ThemeTypes } from '@/types/theme' +import {defineStore} from 'pinia' +import {store} from '../index' +import {setCssVar, humpToUnderline} from '@/utils' +import {ElMessage} from 'element-plus' +import {CACHE_KEY, useCache} from '@/hooks/web/useCache' +import {ElementPlusSize} from '@/types/elementPlus' +import {LayoutType} from '@/types/layout' +import {ThemeTypes} from '@/types/theme' -const { wsCache } = useCache() +const {wsCache} = useCache() interface AppState { breadcrumb: boolean diff --git a/yudao-admin-vue3/src/store/modules/dict.ts b/yudao-admin-vue3/src/store/modules/dict.ts index e239fb0..b34b9d3 100644 --- a/yudao-admin-vue3/src/store/modules/dict.ts +++ b/yudao-admin-vue3/src/store/modules/dict.ts @@ -1,10 +1,11 @@ -import { defineStore } from 'pinia' -import { store } from '../index' +import {defineStore} from 'pinia' +import {store} from '../index' // @ts-ignore -import { DictDataVO } from '@/api/system/dict/types' -import { CACHE_KEY, useCache } from '@/hooks/web/useCache' -const { wsCache } = useCache('sessionStorage') -import { getSimpleDictDataList } from '@/api/system/dict/dict.data' +import {DictDataVO} from '@/api/system/dict/types' +import {CACHE_KEY, useCache} from '@/hooks/web/useCache' + +const {wsCache} = useCache('sessionStorage') +import {getSimpleDictDataList} from '@/api/system/dict/dict.data' export interface DictValueType { value: any @@ -12,10 +13,12 @@ export interface DictValueType { clorType?: string cssClass?: string } + export interface DictTypeType { dictType: string dictValue: DictValueType[] } + export interface DictState { dictMap: Map isSetDict: boolean @@ -64,7 +67,7 @@ export const useDictStore = defineStore('dict', { }) this.dictMap = dictDataMap this.isSetDict = true - wsCache.set(CACHE_KEY.DICT_CACHE, dictDataMap, { exp: 60 }) // 60 秒 过期 + wsCache.set(CACHE_KEY.DICT_CACHE, dictDataMap, {exp: 60}) // 60 秒 过期 } }, getDictByType(type: string) { @@ -94,7 +97,7 @@ export const useDictStore = defineStore('dict', { }) this.dictMap = dictDataMap this.isSetDict = true - wsCache.set(CACHE_KEY.DICT_CACHE, dictDataMap, { exp: 60 }) // 60 秒 过期 + wsCache.set(CACHE_KEY.DICT_CACHE, dictDataMap, {exp: 60}) // 60 秒 过期 } } }) diff --git a/yudao-admin-vue3/src/store/modules/locale.ts b/yudao-admin-vue3/src/store/modules/locale.ts index 1fc772a..3341ee1 100644 --- a/yudao-admin-vue3/src/store/modules/locale.ts +++ b/yudao-admin-vue3/src/store/modules/locale.ts @@ -1,16 +1,17 @@ -import { defineStore } from 'pinia' -import { store } from '../index' +import {defineStore} from 'pinia' +import {store} from '../index' import zhCn from 'element-plus/es/locale/lang/zh-cn' import en from 'element-plus/es/locale/lang/en' -import { CACHE_KEY, useCache } from '@/hooks/web/useCache' -import { LocaleDropdownType } from '@/types/localeDropdown' +import {CACHE_KEY, useCache} from '@/hooks/web/useCache' +import {LocaleDropdownType} from '@/types/localeDropdown' -const { wsCache } = useCache() +const {wsCache} = useCache() const elLocaleMap = { 'zh-CN': zhCn, en: en } + interface LocaleState { currentLocale: LocaleDropdownType localeMap: LocaleDropdownType[] diff --git a/yudao-admin-vue3/src/store/modules/lock.ts b/yudao-admin-vue3/src/store/modules/lock.ts index 68ae1d7..b1d5f94 100644 --- a/yudao-admin-vue3/src/store/modules/lock.ts +++ b/yudao-admin-vue3/src/store/modules/lock.ts @@ -1,5 +1,5 @@ -import { defineStore } from 'pinia' -import { store } from '@/store' +import {defineStore} from 'pinia' +import {store} from '@/store' interface lockInfo { isLock?: boolean diff --git a/yudao-admin-vue3/src/store/modules/permission.ts b/yudao-admin-vue3/src/store/modules/permission.ts index 5e3287a..5bd21b5 100644 --- a/yudao-admin-vue3/src/store/modules/permission.ts +++ b/yudao-admin-vue3/src/store/modules/permission.ts @@ -1,11 +1,11 @@ -import { defineStore } from 'pinia' -import { store } from '@/store' -import { cloneDeep } from 'lodash-es' +import {defineStore} from 'pinia' +import {store} from '@/store' +import {cloneDeep} from 'lodash-es' import remainingRouter from '@/router/modules/remaining' -import { flatMultiLevelRoutes, generateRoute } from '@/utils/routerHelper' -import { CACHE_KEY, useCache } from '@/hooks/web/useCache' +import {flatMultiLevelRoutes, generateRoute} from '@/utils/routerHelper' +import {CACHE_KEY, useCache} from '@/hooks/web/useCache' -const { wsCache } = useCache() +const {wsCache} = useCache() export interface PermissionState { routers: AppRouteRecordRaw[] diff --git a/yudao-admin-vue3/src/store/modules/simpleWorkflow.ts b/yudao-admin-vue3/src/store/modules/simpleWorkflow.ts index cf98538..f5ad028 100644 --- a/yudao-admin-vue3/src/store/modules/simpleWorkflow.ts +++ b/yudao-admin-vue3/src/store/modules/simpleWorkflow.ts @@ -1,5 +1,5 @@ -import { store } from '../index' -import { defineStore } from 'pinia' +import {store} from '../index' +import {defineStore} from 'pinia' export const useWorkFlowStore = defineStore('simpleWorkflow', { state: () => ({ diff --git a/yudao-admin-vue3/src/store/modules/tagsView.ts b/yudao-admin-vue3/src/store/modules/tagsView.ts index 25a3a1f..c65fb93 100644 --- a/yudao-admin-vue3/src/store/modules/tagsView.ts +++ b/yudao-admin-vue3/src/store/modules/tagsView.ts @@ -1,9 +1,9 @@ import router from '@/router' -import type { RouteLocationNormalizedLoaded } from 'vue-router' -import { getRawRoute } from '@/utils/routerHelper' -import { defineStore } from 'pinia' -import { store } from '../index' -import { findIndex } from '@/utils' +import type {RouteLocationNormalizedLoaded} from 'vue-router' +import {getRawRoute} from '@/utils/routerHelper' +import {defineStore} from 'pinia' +import {store} from '../index' +import {findIndex} from '@/utils' export interface TagsViewState { visitedViews: RouteLocationNormalizedLoaded[] diff --git a/yudao-admin-vue3/src/store/modules/user.ts b/yudao-admin-vue3/src/store/modules/user.ts index b386180..de69871 100644 --- a/yudao-admin-vue3/src/store/modules/user.ts +++ b/yudao-admin-vue3/src/store/modules/user.ts @@ -1,10 +1,10 @@ -import { store } from '@/store' -import { defineStore } from 'pinia' -import { getAccessToken, removeToken } from '@/utils/auth' -import { CACHE_KEY, useCache, deleteUserCache } from '@/hooks/web/useCache' -import { getInfo, loginOut } from '@/api/login' +import {store} from '@/store' +import {defineStore} from 'pinia' +import {getAccessToken, removeToken} from '@/utils/auth' +import {CACHE_KEY, useCache, deleteUserCache} from '@/hooks/web/useCache' +import {getInfo, loginOut} from '@/api/login' -const { wsCache } = useCache() +const {wsCache} = useCache() interface UserVO { id: number diff --git a/yudao-admin-vue3/src/types/configGlobal.d.ts b/yudao-admin-vue3/src/types/configGlobal.d.ts index f6d7b3c..7358047 100644 --- a/yudao-admin-vue3/src/types/configGlobal.d.ts +++ b/yudao-admin-vue3/src/types/configGlobal.d.ts @@ -1,4 +1,5 @@ -import { ElementPlusSize } from './elementPlus' +import {ElementPlusSize} from './elementPlus' + export interface ConfigGlobalTypes { size?: ElementPlusSize } diff --git a/yudao-admin-vue3/src/types/form.d.ts b/yudao-admin-vue3/src/types/form.d.ts index 980c8cc..2786b47 100644 --- a/yudao-admin-vue3/src/types/form.d.ts +++ b/yudao-admin-vue3/src/types/form.d.ts @@ -1,6 +1,6 @@ -import type { CSSProperties } from 'vue' -import { ColProps, ComponentProps, ComponentName } from '@/types/components' -import type { AxiosPromise } from 'axios' +import type {CSSProperties} from 'vue' +import {ColProps, ComponentProps, ComponentName} from '@/types/components' +import type {AxiosPromise} from 'axios' export type FormSetPropsType = { field: string diff --git a/yudao-admin-vue3/src/utils/Logger.ts b/yudao-admin-vue3/src/utils/Logger.ts index ca58df2..7473dec 100644 --- a/yudao-admin-vue3/src/utils/Logger.ts +++ b/yudao-admin-vue3/src/utils/Logger.ts @@ -2,7 +2,8 @@ const isArray = function (obj: any): boolean { return Object.prototype.toString.call(obj) === '[object Array]' } -const Logger = () => {} +const Logger = () => { +} Logger.typeColor = function (type: string) { let color = '' diff --git a/yudao-admin-vue3/src/utils/auth.ts b/yudao-admin-vue3/src/utils/auth.ts index c68a67a..b4138f6 100644 --- a/yudao-admin-vue3/src/utils/auth.ts +++ b/yudao-admin-vue3/src/utils/auth.ts @@ -1,8 +1,8 @@ -import { useCache, CACHE_KEY } from '@/hooks/web/useCache' -import { TokenType } from '@/api/login/types' -import { decrypt, encrypt } from '@/utils/jsencrypt' +import {useCache, CACHE_KEY} from '@/hooks/web/useCache' +import {TokenType} from '@/api/login/types' +import {decrypt, encrypt} from '@/utils/jsencrypt' -const { wsCache } = useCache() +const {wsCache} = useCache() const AccessTokenKey = 'ACCESS_TOKEN' const RefreshTokenKey = 'REFRESH_TOKEN' @@ -53,7 +53,7 @@ export const getLoginForm = () => { export const setLoginForm = (loginForm: LoginFormType) => { loginForm.password = encrypt(loginForm.password) as string - wsCache.set(CACHE_KEY.LoginForm, loginForm, { exp: 30 * 24 * 60 * 60 }) + wsCache.set(CACHE_KEY.LoginForm, loginForm, {exp: 30 * 24 * 60 * 60}) } export const removeLoginForm = () => { diff --git a/yudao-admin-vue3/src/utils/domUtils.ts b/yudao-admin-vue3/src/utils/domUtils.ts index dbc1989..4ef03eb 100644 --- a/yudao-admin-vue3/src/utils/domUtils.ts +++ b/yudao-admin-vue3/src/utils/domUtils.ts @@ -1,4 +1,5 @@ -import { isServer } from './is' +import {isServer} from './is' + const ieVersion = isServer ? 0 : Number((document as any).documentMode) const SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g const MOZ_HACK_REGEXP = /^moz([A-Z])/ @@ -112,7 +113,7 @@ export function getViewportOffset(element: Element): ViewportOffsetResult { const box = getBoundingClientRect(element) - const { left: retLeft, top: rectTop, width: rectWidth, height: rectHeight } = box as DOMRect + const {left: retLeft, top: rectTop, width: rectWidth, height: rectHeight} = box as DOMRect const scrollLeft = (pageXOffset || docScrollLeft) - (docClientLeft || 0) const scrollTop = (pageYOffset || docScrollTop) - (docClientTop || 0) @@ -172,43 +173,43 @@ export const once = function (el: HTMLElement, event: string, fn: EventListener) export const getStyle = ieVersion < 9 ? function (element: Element | any, styleName: string) { - if (isServer) return - if (!element || !styleName) return null - styleName = camelCase(styleName) - if (styleName === 'float') { - styleName = 'styleFloat' - } - try { - switch (styleName) { - case 'opacity': - try { - return element.filters.item('alpha').opacity / 100 - } catch (e) { - return 1.0 - } - default: - return element.style[styleName] || element.currentStyle - ? element.currentStyle[styleName] - : null - } - } catch (e) { - return element.style[styleName] - } + if (isServer) return + if (!element || !styleName) return null + styleName = camelCase(styleName) + if (styleName === 'float') { + styleName = 'styleFloat' } + try { + switch (styleName) { + case 'opacity': + try { + return element.filters.item('alpha').opacity / 100 + } catch (e) { + return 1.0 + } + default: + return element.style[styleName] || element.currentStyle + ? element.currentStyle[styleName] + : null + } + } catch (e) { + return element.style[styleName] + } + } : function (element: Element | any, styleName: string) { - if (isServer) return - if (!element || !styleName) return null - styleName = camelCase(styleName) - if (styleName === 'float') { - styleName = 'cssFloat' - } - try { - const computed = (document as any).defaultView.getComputedStyle(element, '') - return element.style[styleName] || computed ? computed[styleName] : null - } catch (e) { - return element.style[styleName] - } + if (isServer) return + if (!element || !styleName) return null + styleName = camelCase(styleName) + if (styleName === 'float') { + styleName = 'cssFloat' } + try { + const computed = (document as any).defaultView.getComputedStyle(element, '') + return element.style[styleName] || computed ? computed[styleName] : null + } catch (e) { + return element.style[styleName] + } + } /* istanbul ignore next */ export function setStyle(element: Element | any, styleName: any, value: any) { diff --git a/yudao-admin-vue3/src/utils/download.ts b/yudao-admin-vue3/src/utils/download.ts index 1d07484..999485f 100644 --- a/yudao-admin-vue3/src/utils/download.ts +++ b/yudao-admin-vue3/src/utils/download.ts @@ -1,6 +1,6 @@ const download0 = (data: Blob, fileName: string, mineType: string) => { // 创建 blob - const blob = new Blob([data], { type: mineType }) + const blob = new Blob([data], {type: mineType}) // 创建 href 超链接,点击进行下载 window.URL = window.URL || window.webkitURL const href = URL.createObjectURL(blob) diff --git a/yudao-admin-vue3/src/utils/filt.ts b/yudao-admin-vue3/src/utils/filt.ts index b1a7b2c..26019cb 100644 --- a/yudao-admin-vue3/src/utils/filt.ts +++ b/yudao-admin-vue3/src/utils/filt.ts @@ -6,7 +6,7 @@ export const openWindow = ( noreferrer?: boolean } ) => { - const { target = '__blank', noopener = true, noreferrer = true } = opt || {} + const {target = '__blank', noopener = true, noreferrer = true} = opt || {} const feature: string[] = [] noopener && feature.push('noopener=yes') @@ -28,7 +28,7 @@ export const dataURLtoBlob = (base64Buf: string): Blob => { while (n--) { u8arr[n] = bstr.charCodeAt(n) } - return new Blob([u8arr], { type: mime }) + return new Blob([u8arr], {type: mime}) } /** @@ -96,7 +96,7 @@ export const downloadByBase64 = (buf: string, filename: string, mime?: string, b */ export const downloadByData = (data: BlobPart, filename: string, mime?: string, bom?: BlobPart) => { const blobData = typeof bom !== 'undefined' ? [bom, data] : [data] - const blob = new Blob(blobData, { type: mime || 'application/octet-stream' }) + const blob = new Blob(blobData, {type: mime || 'application/octet-stream'}) const blobURL = window.URL.createObjectURL(blob) const tempLink = document.createElement('a') @@ -117,10 +117,10 @@ export const downloadByData = (data: BlobPart, filename: string, mime?: string, * @param {*} sUrl */ export const downloadByUrl = ({ - url, - target = '_blank', - fileName -}: { + url, + target = '_blank', + fileName + }: { url: string target?: '_self' | '_blank' fileName?: string @@ -152,6 +152,6 @@ export const downloadByUrl = ({ url += '?download' } - openWindow(url, { target }) + openWindow(url, {target}) return true } diff --git a/yudao-admin-vue3/src/utils/formRules.ts b/yudao-admin-vue3/src/utils/formRules.ts index 2989867..3352b91 100644 --- a/yudao-admin-vue3/src/utils/formRules.ts +++ b/yudao-admin-vue3/src/utils/formRules.ts @@ -1,4 +1,4 @@ -const { t } = useI18n() +const {t} = useI18n() // 必填项 export const required = { diff --git a/yudao-admin-vue3/src/utils/formatTime.ts b/yudao-admin-vue3/src/utils/formatTime.ts index 134a986..463320c 100644 --- a/yudao-admin-vue3/src/utils/formatTime.ts +++ b/yudao-admin-vue3/src/utils/formatTime.ts @@ -1,5 +1,5 @@ import dayjs from 'dayjs' -import type { TableColumnCtx } from 'element-plus' +import type {TableColumnCtx} from 'element-plus' /** * 日期快捷选项适用于 el-date-picker diff --git a/yudao-admin-vue3/src/utils/formatter.ts b/yudao-admin-vue3/src/utils/formatter.ts index 8777f32..e93d7fc 100644 --- a/yudao-admin-vue3/src/utils/formatter.ts +++ b/yudao-admin-vue3/src/utils/formatter.ts @@ -1,4 +1,4 @@ -import { floatToFixed2 } from '@/utils' +import {floatToFixed2} from '@/utils' // 格式化金额【分转元】 // @ts-ignore diff --git a/yudao-admin-vue3/src/utils/index.ts b/yudao-admin-vue3/src/utils/index.ts index 2c2fbbd..244861e 100644 --- a/yudao-admin-vue3/src/utils/index.ts +++ b/yudao-admin-vue3/src/utils/index.ts @@ -1,4 +1,4 @@ -import { toNumber } from 'lodash-es' +import {toNumber} from 'lodash-es' /** * @@ -215,8 +215,8 @@ export const getUrlNumberValue = (key: string, urlStr: string = location.href): * @param prop 字段名称 * @param order 顺序 */ -export const buildSortingField = ({ prop, order }) => { - return { field: prop, order: order === 'ascending' ? 'asc' : 'desc' } +export const buildSortingField = ({prop, order}) => { + return {field: prop, order: order === 'ascending' ? 'asc' : 'desc'} } // ========== NumberUtils 数字方法 ========== diff --git a/yudao-admin-vue3/src/utils/jsencrypt.ts b/yudao-admin-vue3/src/utils/jsencrypt.ts index 374d5f6..a295d28 100644 --- a/yudao-admin-vue3/src/utils/jsencrypt.ts +++ b/yudao-admin-vue3/src/utils/jsencrypt.ts @@ -1,4 +1,4 @@ -import { JSEncrypt } from 'jsencrypt' +import {JSEncrypt} from 'jsencrypt' // 密钥对生成 http://web.chacuo.net/netrsakeypair diff --git a/yudao-admin-vue3/src/utils/permission.ts b/yudao-admin-vue3/src/utils/permission.ts index a63ee62..07a926f 100644 --- a/yudao-admin-vue3/src/utils/permission.ts +++ b/yudao-admin-vue3/src/utils/permission.ts @@ -1,6 +1,6 @@ -import { CACHE_KEY, useCache } from '@/hooks/web/useCache' +import {CACHE_KEY, useCache} from '@/hooks/web/useCache' -const { t } = useI18n() // 国际化 +const {t} = useI18n() // 国际化 /** * 字符权限校验 @@ -9,7 +9,7 @@ const { t } = useI18n() // 国际化 */ export function checkPermi(value: string[]) { if (value && value instanceof Array && value.length > 0) { - const { wsCache } = useCache() + const {wsCache} = useCache() const permissionDatas = value const all_permission = '*:*:*' const permissions = wsCache.get(CACHE_KEY.USER).permissions @@ -30,7 +30,7 @@ export function checkPermi(value: string[]) { */ export function checkRole(value: string[]) { if (value && value instanceof Array && value.length > 0) { - const { wsCache } = useCache() + const {wsCache} = useCache() const permissionRoles = value const super_admin = 'admin' const roles = wsCache.get(CACHE_KEY.USER).roles diff --git a/yudao-admin-vue3/src/utils/propTypes.ts b/yudao-admin-vue3/src/utils/propTypes.ts index 863f55c..2663ba6 100644 --- a/yudao-admin-vue3/src/utils/propTypes.ts +++ b/yudao-admin-vue3/src/utils/propTypes.ts @@ -1,5 +1,5 @@ -import { VueTypeValidableDef, VueTypesInterface, createTypes, toValidableType } from 'vue-types' -import { CSSProperties } from 'vue' +import {VueTypeValidableDef, VueTypesInterface, createTypes, toValidableType} from 'vue-types' +import {CSSProperties} from 'vue' type PropTypes = VueTypesInterface & { readonly style: VueTypeValidableDef @@ -21,4 +21,4 @@ class propTypes extends newPropTypes { } } -export { propTypes } +export {propTypes} diff --git a/yudao-admin-vue3/src/utils/routerHelper.ts b/yudao-admin-vue3/src/utils/routerHelper.ts index f292751..798cd14 100644 --- a/yudao-admin-vue3/src/utils/routerHelper.ts +++ b/yudao-admin-vue3/src/utils/routerHelper.ts @@ -1,7 +1,7 @@ -import type { RouteLocationNormalized, Router, RouteRecordNormalized } from 'vue-router' -import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router' -import { isUrl } from '@/utils/is' -import { cloneDeep, omit } from 'lodash-es' +import type {RouteLocationNormalized, Router, RouteRecordNormalized} from 'vue-router' +import {createRouter, createWebHashHistory, RouteRecordRaw} from 'vue-router' +import {isUrl} from '@/utils/is' +import {cloneDeep, omit} from 'lodash-es' import qs from 'qs' const modules = import.meta.glob('../views/**/*.{vue,tsx}') @@ -47,15 +47,15 @@ export const ascending = (arr: any[]) => { export const getRawRoute = (route: RouteLocationNormalized): RouteLocationNormalized => { if (!route) return route - const { matched, ...opt } = route + const {matched, ...opt} = route return { ...opt, matched: (matched ? matched.map((item) => ({ - meta: item.meta, - name: item.name, - path: item.path - })) + meta: item.meta, + name: item.name, + path: item.path + })) : undefined) as RouteRecordNormalized[] } } diff --git a/yudao-admin-vue3/src/utils/tree.ts b/yudao-admin-vue3/src/utils/tree.ts index 91059ef..34f4674 100644 --- a/yudao-admin-vue3/src/utils/tree.ts +++ b/yudao-admin-vue3/src/utils/tree.ts @@ -24,7 +24,7 @@ export const listToTree = (list: any[], config: Partial(list: any[], config: Partial(tree: any, config: Partial = {}): T => { config = getConfig(config) - const { children } = config + const {children} = config const result: any = [...tree] for (let i = 0; i < result.length; i++) { if (!result[i][children!]) continue @@ -54,7 +54,7 @@ export const findNode = ( config: Partial = {} ): T | null => { config = getConfig(config) - const { children } = config + const {children} = config const list = [...tree] for (const node of list) { if (func(node)) return node @@ -69,7 +69,7 @@ export const findNodeAll = ( config: Partial = {} ): T[] => { config = getConfig(config) - const { children } = config + const {children} = config const list = [...tree] const result: T[] = [] for (const node of list) { @@ -88,7 +88,7 @@ export const findPath = ( const path: T[] = [] const list = [...tree] const visitedSet = new Set() - const { children } = config + const {children} = config while (list.length) { const node = list[0] if (visitedSet.has(node)) { @@ -112,7 +112,7 @@ export const findPathAll = (tree: any, func: Fn, config: Partial( function listFilter(list: T[]) { return list - .map((node: any) => ({ ...node })) + .map((node: any) => ({...node})) .filter((node) => { node[children] = node[children] && listFilter(node[children]) return func(node) || (node[children] && node[children].length) @@ -155,7 +155,7 @@ export const forEach = ( ): void => { config = getConfig(config) const list: any[] = [...tree] - const { children } = config + const {children} = config for (let i = 0; i < list.length; i++) { // func 返回true就终止遍历,避免大量节点场景下无意义循环,引起浏览器卡顿 if (func(list[i])) { @@ -180,7 +180,7 @@ export const treeMap = ( */ export const treeMapEach = ( data: any, - { children = 'children', conversion }: { children?: string; conversion: Fn } + {children = 'children', conversion}: { children?: string; conversion: Fn } ) => { const haveChildren = Array.isArray(data[children]) && data[children].length > 0 const conversionData = conversion(data) || {} diff --git a/yudao-admin-vue3/src/utils/tsxHelper.ts b/yudao-admin-vue3/src/utils/tsxHelper.ts index 6087fa3..17426ec 100644 --- a/yudao-admin-vue3/src/utils/tsxHelper.ts +++ b/yudao-admin-vue3/src/utils/tsxHelper.ts @@ -1,5 +1,5 @@ -import { Slots } from 'vue' -import { isFunction } from '@/utils/is' +import {Slots} from 'vue' +import {isFunction} from '@/utils/is' export const getSlot = (slots: Slots, slot = 'default', data?: Recordable) => { // Reflect.has 判断一个对象是否存在某个属性 diff --git a/yudao-admin-vue3/src/views/ai/chat/index/components/conversation/ConversationList.vue b/yudao-admin-vue3/src/views/ai/chat/index/components/conversation/ConversationList.vue index 54940f8..8d3e6fb 100644 --- a/yudao-admin-vue3/src/views/ai/chat/index/components/conversation/ConversationList.vue +++ b/yudao-admin-vue3/src/views/ai/chat/index/components/conversation/ConversationList.vue @@ -4,7 +4,7 @@

- + 新建对话 @@ -17,14 +17,14 @@ @keyup="searchConversation" >
- +
- + {{ conversation.title }}
- - + + + + + + - + - +
@@ -77,396 +81,398 @@
- + 角色仓库
- + 清空未置顶对话
- + diff --git a/yudao-admin-vue3/src/views/ai/chat/index/components/conversation/ConversationUpdateForm.vue b/yudao-admin-vue3/src/views/ai/chat/index/components/conversation/ConversationUpdateForm.vue index bff094f..17576f4 100644 --- a/yudao-admin-vue3/src/views/ai/chat/index/components/conversation/ConversationUpdateForm.vue +++ b/yudao-admin-vue3/src/views/ai/chat/index/components/conversation/ConversationUpdateForm.vue @@ -58,88 +58,88 @@ diff --git a/yudao-admin-vue3/src/views/ai/chat/index/components/message/MessageList.vue b/yudao-admin-vue3/src/views/ai/chat/index/components/message/MessageList.vue index 2cc8407..01ff5e2 100644 --- a/yudao-admin-vue3/src/views/ai/chat/index/components/message/MessageList.vue +++ b/yudao-admin-vue3/src/views/ai/chat/index/components/message/MessageList.vue @@ -4,21 +4,21 @@
- +
{{ formatDate(item.createTime) }}
- +
- + - +
@@ -26,7 +26,7 @@
- +
@@ -37,16 +37,20 @@
- + - + - + + + - + + +
@@ -55,228 +59,229 @@
- +
diff --git a/yudao-admin-vue3/src/views/ai/chat/index/components/message/MessageListEmpty.vue b/yudao-admin-vue3/src/views/ai/chat/index/components/message/MessageListEmpty.vue index b042fd6..8e3de0a 100644 --- a/yudao-admin-vue3/src/views/ai/chat/index/components/message/MessageListEmpty.vue +++ b/yudao-admin-vue3/src/views/ai/chat/index/components/message/MessageListEmpty.vue @@ -18,66 +18,66 @@
diff --git a/yudao-admin-vue3/src/views/ai/chat/index/components/message/MessageLoading.vue b/yudao-admin-vue3/src/views/ai/chat/index/components/message/MessageLoading.vue index f3198cb..23133a0 100644 --- a/yudao-admin-vue3/src/views/ai/chat/index/components/message/MessageLoading.vue +++ b/yudao-admin-vue3/src/views/ai/chat/index/components/message/MessageLoading.vue @@ -1,7 +1,7 @@ @@ -9,7 +9,7 @@ diff --git a/yudao-admin-vue3/src/views/ai/chat/index/components/message/MessageNewConversation.vue b/yudao-admin-vue3/src/views/ai/chat/index/components/message/MessageNewConversation.vue index 40c3107..25c45a4 100644 --- a/yudao-admin-vue3/src/views/ai/chat/index/components/message/MessageNewConversation.vue +++ b/yudao-admin-vue3/src/views/ai/chat/index/components/message/MessageNewConversation.vue @@ -10,37 +10,37 @@
diff --git a/yudao-admin-vue3/src/views/ai/chat/index/components/role/RoleCategoryList.vue b/yudao-admin-vue3/src/views/ai/chat/index/components/role/RoleCategoryList.vue index c02126d..2298e67 100644 --- a/yudao-admin-vue3/src/views/ai/chat/index/components/role/RoleCategoryList.vue +++ b/yudao-admin-vue3/src/views/ai/chat/index/components/role/RoleCategoryList.vue @@ -14,40 +14,40 @@
diff --git a/yudao-admin-vue3/src/views/ai/chat/index/components/role/RoleHeader.vue b/yudao-admin-vue3/src/views/ai/chat/index/components/role/RoleHeader.vue index 17b1693..4688284 100644 --- a/yudao-admin-vue3/src/views/ai/chat/index/components/role/RoleHeader.vue +++ b/yudao-admin-vue3/src/views/ai/chat/index/components/role/RoleHeader.vue @@ -11,38 +11,38 @@ diff --git a/yudao-admin-vue3/src/views/ai/chat/index/components/role/RoleList.vue b/yudao-admin-vue3/src/views/ai/chat/index/components/role/RoleList.vue index b148b22..f6416bc 100644 --- a/yudao-admin-vue3/src/views/ai/chat/index/components/role/RoleList.vue +++ b/yudao-admin-vue3/src/views/ai/chat/index/components/role/RoleList.vue @@ -7,16 +7,18 @@ - + @@ -24,7 +26,7 @@
- +
@@ -41,134 +43,134 @@ diff --git a/yudao-admin-vue3/src/views/ai/chat/index/components/role/RoleRepository.vue b/yudao-admin-vue3/src/views/ai/chat/index/components/role/RoleRepository.vue index 246dcb4..ceb685b 100644 --- a/yudao-admin-vue3/src/views/ai/chat/index/components/role/RoleRepository.vue +++ b/yudao-admin-vue3/src/views/ai/chat/index/components/role/RoleRepository.vue @@ -1,9 +1,9 @@ diff --git a/yudao-admin-vue3/src/views/ai/chat/index/index.vue b/yudao-admin-vue3/src/views/ai/chat/index/index.vue index 229b895..5297f77 100644 --- a/yudao-admin-vue3/src/views/ai/chat/index/index.vue +++ b/yudao-admin-vue3/src/views/ai/chat/index/index.vue @@ -19,16 +19,16 @@
- + - + - + - - + +
@@ -38,7 +38,7 @@
- +
- + 上下文
diff --git a/yudao-admin-vue3/src/views/ai/chat/manager/ChatConversationList.vue b/yudao-admin-vue3/src/views/ai/chat/manager/ChatConversationList.vue index 23933f0..8c78bab 100644 --- a/yudao-admin-vue3/src/views/ai/chat/manager/ChatConversationList.vue +++ b/yudao-admin-vue3/src/views/ai/chat/manager/ChatConversationList.vue @@ -44,8 +44,14 @@ /> - 搜索 - 重置 + + + 搜索 + + + + 重置 + @@ -53,16 +59,16 @@ - - + + - - - + + + - - - + + + - - - - + + + + - + @@ -107,69 +113,70 @@ diff --git a/yudao-admin-vue3/src/views/ai/chat/manager/index.vue b/yudao-admin-vue3/src/views/ai/chat/manager/index.vue index ca2d092..a2c6f61 100644 --- a/yudao-admin-vue3/src/views/ai/chat/manager/index.vue +++ b/yudao-admin-vue3/src/views/ai/chat/manager/index.vue @@ -2,19 +2,19 @@ - + - + diff --git a/yudao-admin-vue3/src/views/ai/image/index/components/ImageCard.vue b/yudao-admin-vue3/src/views/ai/image/index/components/ImageCard.vue index 4ba78ca..b171626 100644 --- a/yudao-admin-vue3/src/views/ai/image/index/components/ImageCard.vue +++ b/yudao-admin-vue3/src/views/ai/image/index/components/ImageCard.vue @@ -26,8 +26,8 @@ :icon="RefreshRight" @click="handleButtonClick('regeneration', detail)" /> - - + +
@@ -56,107 +56,107 @@ diff --git a/yudao-admin-vue3/src/views/ai/image/index/components/ImageDetail.vue b/yudao-admin-vue3/src/views/ai/image/index/components/ImageDetail.vue index ad15aa8..e305cd7 100644 --- a/yudao-admin-vue3/src/views/ai/image/index/components/ImageDetail.vue +++ b/yudao-admin-vue3/src/views/ai/image/index/components/ImageDetail.vue @@ -27,7 +27,7 @@
模型
-
{{ detail.model }}({{ detail.height }}x{{ detail.width }})
+
{{ detail.model }}({{ detail.height }}x{{ detail.width }})
@@ -51,9 +51,9 @@
采样方法
{{ - StableDiffusionSamplers.find( - (item: ImageModelVO) => item.key === detail?.options?.sampler - )?.name + StableDiffusionSamplers.find( + (item: ImageModelVO) => item.key === detail?.options?.sampler + )?.name }}
@@ -66,9 +66,9 @@
CLIP
{{ - StableDiffusionClipGuidancePresets.find( - (item: ImageModelVO) => item.key === detail?.options?.clipGuidancePreset - )?.name + StableDiffusionClipGuidancePresets.find( + (item: ImageModelVO) => item.key === detail?.options?.clipGuidancePreset + )?.name }}
@@ -79,9 +79,9 @@
风格
{{ - StableDiffusionStylePresets.find( - (item: ImageModelVO) => item.key === detail?.options?.stylePreset - )?.name + StableDiffusionStylePresets.find( + (item: ImageModelVO) => item.key === detail?.options?.stylePreset + )?.name }}
@@ -135,90 +135,90 @@ >
参考图
- +
diff --git a/yudao-admin-vue3/src/views/ai/image/index/components/ImageList.vue b/yudao-admin-vue3/src/views/ai/image/index/components/ImageList.vue index cdd1e20..a14ed6b 100644 --- a/yudao-admin-vue3/src/views/ai/image/index/components/ImageList.vue +++ b/yudao-admin-vue3/src/views/ai/image/index/components/ImageList.vue @@ -29,205 +29,207 @@ /> diff --git a/yudao-admin-vue3/src/views/ai/image/index/components/dall3/index.vue b/yudao-admin-vue3/src/views/ai/image/index/components/dall3/index.vue index 5c891ab..97720f5 100644 --- a/yudao-admin-vue3/src/views/ai/image/index/components/dall3/index.vue +++ b/yudao-admin-vue3/src/views/ai/image/index/components/dall3/index.vue @@ -41,7 +41,7 @@ v-for="model in Dall3Models" :key="model.key" > - +
{{ model.name }}
@@ -56,7 +56,7 @@ v-for="imageStyle in Dall3StyleList" :key="imageStyle.key" > - +
{{ imageStyle.name }}
@@ -88,233 +88,233 @@ diff --git a/yudao-admin-vue3/src/views/ai/image/index/components/midjourney/index.vue b/yudao-admin-vue3/src/views/ai/image/index/components/midjourney/index.vue index 1d7fda1..dbf7c61 100644 --- a/yudao-admin-vue3/src/views/ai/image/index/components/midjourney/index.vue +++ b/yudao-admin-vue3/src/views/ai/image/index/components/midjourney/index.vue @@ -61,7 +61,7 @@ v-for="model in MidjourneyModels" :key="model.key" > - +
{{ model.name }}
@@ -91,7 +91,7 @@ 参考图 - +
@@ -101,226 +101,226 @@
diff --git a/yudao-admin-vue3/src/views/ai/image/index/components/other/index.vue b/yudao-admin-vue3/src/views/ai/image/index/components/other/index.vue index a688be1..384ff06 100644 --- a/yudao-admin-vue3/src/views/ai/image/index/components/other/index.vue +++ b/yudao-admin-vue3/src/views/ai/image/index/components/other/index.vue @@ -58,7 +58,7 @@ - + @@ -67,8 +67,8 @@ 图片尺寸 - - + +
@@ -78,139 +78,139 @@
- diff --git a/yudao-admin-vue3/src/views/ai/image/index/components/stableDiffusion/index.vue b/yudao-admin-vue3/src/views/ai/image/index/components/stableDiffusion/index.vue index 169938f..4a67b56 100644 --- a/yudao-admin-vue3/src/views/ai/image/index/components/stableDiffusion/index.vue +++ b/yudao-admin-vue3/src/views/ai/image/index/components/stableDiffusion/index.vue @@ -81,8 +81,8 @@ 图片尺寸 - - + +
@@ -134,139 +134,139 @@
- diff --git a/yudao-admin-vue3/src/views/ai/image/index/index.vue b/yudao-admin-vue3/src/views/ai/image/index/index.vue index 1217e79..2c95a1b 100644 --- a/yudao-admin-vue3/src/views/ai/image/index/index.vue +++ b/yudao-admin-vue3/src/views/ai/image/index/index.vue @@ -3,7 +3,7 @@
- +
- +
diff --git a/yudao-admin-vue3/src/views/ai/image/manager/index.vue b/yudao-admin-vue3/src/views/ai/image/manager/index.vue index 84403f3..dc8e3a6 100644 --- a/yudao-admin-vue3/src/views/ai/image/manager/index.vue +++ b/yudao-admin-vue3/src/views/ai/image/manager/index.vue @@ -75,8 +75,14 @@ /> - 搜索 - 重置 + + + 搜索 + + + + 重置 + @@ -84,7 +90,7 @@ - + - + - - - - + + + + diff --git a/yudao-admin-vue3/src/views/ai/model/apiKey/ApiKeyForm.vue b/yudao-admin-vue3/src/views/ai/model/apiKey/ApiKeyForm.vue index a8fc012..e28d412 100644 --- a/yudao-admin-vue3/src/views/ai/model/apiKey/ApiKeyForm.vue +++ b/yudao-admin-vue3/src/views/ai/model/apiKey/ApiKeyForm.vue @@ -18,13 +18,13 @@ - + - + - + @@ -45,88 +45,88 @@ diff --git a/yudao-admin-vue3/src/views/ai/model/apiKey/index.vue b/yudao-admin-vue3/src/views/ai/model/apiKey/index.vue index 6daf6a7..657ce6c 100644 --- a/yudao-admin-vue3/src/views/ai/model/apiKey/index.vue +++ b/yudao-admin-vue3/src/views/ai/model/apiKey/index.vue @@ -43,15 +43,22 @@ - 搜索 - 重置 + + + 搜索 + + + + 重置 + - 新增 + + 新增 @@ -62,15 +69,15 @@ - - - + + + @@ -104,77 +111,78 @@ - + diff --git a/yudao-admin-vue3/src/views/ai/model/chatModel/ChatModelForm.vue b/yudao-admin-vue3/src/views/ai/model/chatModel/ChatModelForm.vue index e3f785c..7a0bfe1 100644 --- a/yudao-admin-vue3/src/views/ai/model/chatModel/ChatModelForm.vue +++ b/yudao-admin-vue3/src/views/ai/model/chatModel/ChatModelForm.vue @@ -28,13 +28,13 @@ - + - + - + @@ -80,91 +80,22 @@ diff --git a/yudao-admin-vue3/src/views/ai/model/chatModel/index.vue b/yudao-admin-vue3/src/views/ai/model/chatModel/index.vue index c550674..f508545 100644 --- a/yudao-admin-vue3/src/views/ai/model/chatModel/index.vue +++ b/yudao-admin-vue3/src/views/ai/model/chatModel/index.vue @@ -36,15 +36,22 @@ /> - 搜索 - 重置 + + + 搜索 + + + + 重置 + - 新增 + + 新增 @@ -55,25 +62,25 @@ - - + + - + - - - + + + diff --git a/yudao-admin-vue3/src/views/ai/model/chatRole/ChatRoleForm.vue b/yudao-admin-vue3/src/views/ai/model/chatRole/ChatRoleForm.vue index 3c49e8e..16aaa83 100644 --- a/yudao-admin-vue3/src/views/ai/model/chatRole/ChatRoleForm.vue +++ b/yudao-admin-vue3/src/views/ai/model/chatRole/ChatRoleForm.vue @@ -8,10 +8,10 @@ v-loading="formLoading" > - + - + @@ -24,13 +24,13 @@ - + - + - + @@ -44,7 +44,7 @@ - + @@ -65,108 +65,23 @@ diff --git a/yudao-admin-vue3/src/views/ai/model/chatRole/index.vue b/yudao-admin-vue3/src/views/ai/model/chatRole/index.vue index e870a55..30a7d58 100644 --- a/yudao-admin-vue3/src/views/ai/model/chatRole/index.vue +++ b/yudao-admin-vue3/src/views/ai/model/chatRole/index.vue @@ -42,15 +42,22 @@ - 搜索 - 重置 + + + 搜索 + + + + 重置 + - 新增 + + 新增 @@ -59,27 +66,27 @@ - - + + - - - + + + - + diff --git a/yudao-admin-vue3/src/views/ai/music/components/index.vue b/yudao-admin-vue3/src/views/ai/music/components/index.vue index 413792a..44408dd 100644 --- a/yudao-admin-vue3/src/views/ai/music/components/index.vue +++ b/yudao-admin-vue3/src/views/ai/music/components/index.vue @@ -1,5 +1,5 @@ diff --git a/yudao-admin-vue3/src/views/ai/music/components/list/audioBar/index.vue b/yudao-admin-vue3/src/views/ai/music/components/list/audioBar/index.vue index db7f767..bf12aff 100644 --- a/yudao-admin-vue3/src/views/ai/music/components/list/audioBar/index.vue +++ b/yudao-admin-vue3/src/views/ai/music/components/list/audioBar/index.vue @@ -1,18 +1,21 @@ diff --git a/yudao-admin-vue3/src/views/ai/music/components/list/index.vue b/yudao-admin-vue3/src/views/ai/music/components/list/index.vue index 6c33f56..2243d7d 100644 --- a/yudao-admin-vue3/src/views/ai/music/components/list/index.vue +++ b/yudao-admin-vue3/src/views/ai/music/components/list/index.vue @@ -30,43 +30,43 @@ diff --git a/yudao-admin-vue3/src/views/ai/music/components/list/songCard/index.vue b/yudao-admin-vue3/src/views/ai/music/components/list/songCard/index.vue index 0534251..0c94c3a 100644 --- a/yudao-admin-vue3/src/views/ai/music/components/list/songCard/index.vue +++ b/yudao-admin-vue3/src/views/ai/music/components/list/songCard/index.vue @@ -2,8 +2,11 @@
-
- +
+
@@ -17,20 +20,20 @@ diff --git a/yudao-admin-vue3/src/views/ai/music/components/list/songInfo/index.vue b/yudao-admin-vue3/src/views/ai/music/components/list/songInfo/index.vue index 8d67c4d..6f1a47c 100644 --- a/yudao-admin-vue3/src/views/ai/music/components/list/songInfo/index.vue +++ b/yudao-admin-vue3/src/views/ai/music/components/list/songInfo/index.vue @@ -15,8 +15,8 @@ diff --git a/yudao-admin-vue3/src/views/ai/music/components/mode/desc.vue b/yudao-admin-vue3/src/views/ai/music/components/mode/desc.vue index 4488461..1216d16 100644 --- a/yudao-admin-vue3/src/views/ai/music/components/mode/desc.vue +++ b/yudao-admin-vue3/src/views/ai/music/components/mode/desc.vue @@ -38,18 +38,18 @@ diff --git a/yudao-admin-vue3/src/views/ai/music/components/mode/index.vue b/yudao-admin-vue3/src/views/ai/music/components/mode/index.vue index 85ef893..217ec06 100644 --- a/yudao-admin-vue3/src/views/ai/music/components/mode/index.vue +++ b/yudao-admin-vue3/src/views/ai/music/components/mode/index.vue @@ -19,23 +19,23 @@ diff --git a/yudao-admin-vue3/src/views/ai/music/components/mode/lyric.vue b/yudao-admin-vue3/src/views/ai/music/components/mode/lyric.vue index f774003..8e2b712 100644 --- a/yudao-admin-vue3/src/views/ai/music/components/mode/lyric.vue +++ b/yudao-admin-vue3/src/views/ai/music/components/mode/lyric.vue @@ -18,9 +18,9 @@ 自定义风格 @@ -63,21 +63,22 @@ diff --git a/yudao-admin-vue3/src/views/ai/music/components/title/index.vue b/yudao-admin-vue3/src/views/ai/music/components/title/index.vue index a065802..99170a1 100644 --- a/yudao-admin-vue3/src/views/ai/music/components/title/index.vue +++ b/yudao-admin-vue3/src/views/ai/music/components/title/index.vue @@ -12,14 +12,14 @@ diff --git a/yudao-admin-vue3/src/views/ai/music/manager/index.vue b/yudao-admin-vue3/src/views/ai/music/manager/index.vue index 462a88d..e37f256 100644 --- a/yudao-admin-vue3/src/views/ai/music/manager/index.vue +++ b/yudao-admin-vue3/src/views/ai/music/manager/index.vue @@ -89,8 +89,14 @@ - 搜索 - 重置 + + + 搜索 + + + + 重置 + @@ -98,8 +104,8 @@ - - + + - - + + diff --git a/yudao-admin-vue3/src/views/mall/promotion/kefu/components/tools/emoji.ts b/yudao-admin-vue3/src/views/mall/promotion/kefu/components/tools/emoji.ts index 7e3f19b..5527ad0 100644 --- a/yudao-admin-vue3/src/views/mall/promotion/kefu/components/tools/emoji.ts +++ b/yudao-admin-vue3/src/views/mall/promotion/kefu/components/tools/emoji.ts @@ -1,6 +1,7 @@ import { isEmpty } from '@/utils/is' const emojiList = [ + { name: '[狗子]', file: 'gouzi.png' }, { name: '[笑掉牙]', file: 'xiaodiaoya.png' }, { name: '[可爱]', file: 'keai.png' }, { name: '[冷酷]', file: 'lengku.png' }, diff --git a/yudao-framework/pom.xml b/yudao-framework/pom.xml index 76e6740..5ab31c4 100644 --- a/yudao-framework/pom.xml +++ b/yudao-framework/pom.xml @@ -33,12 +33,12 @@ yudao-framework 该包是技术组件,每个子包,代表一个组件。每个组件包括两部分: - 1. core 包:是该组件的核心封装 - 2. config 包:是该组件基于 Spring 的配置 + 1. core 包:是该组件的核心封装 + 2. config 包:是该组件基于 Spring 的配置 技术组件,也分成两类: - 1. 框架组件:和我们熟悉的 MyBatis、Redis 等等的拓展 - 2. 业务组件:和业务相关的组件的封装,例如说数据字典、操作日志等等。 + 1. 框架组件:和我们熟悉的 MyBatis、Redis 等等的拓展 + 2. 业务组件:和业务相关的组件的封装,例如说数据字典、操作日志等等。 如果是业务组件,Maven 名字会包含 biz https://github.com/YunaiV/ruoyi-vue-pro diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/DateIntervalEnum.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/DateIntervalEnum.java index 498b671..d0c7198 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/DateIntervalEnum.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/DateIntervalEnum.java @@ -20,8 +20,7 @@ public enum DateIntervalEnum implements IntArrayValuable { WEEK(2, "周"), MONTH(3, "月"), QUARTER(4, "季度"), - YEAR(5, "年") - ; + YEAR(5, "年"); public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(DateIntervalEnum::getInterval).toArray(); diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/WebFilterOrderEnum.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/WebFilterOrderEnum.java index 11a5ee0..da22f57 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/WebFilterOrderEnum.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/WebFilterOrderEnum.java @@ -2,8 +2,8 @@ package cn.iocoder.yudao.framework.common.enums; /** * Web 过滤器顺序的枚举类,保证过滤器按照符合我们的预期 - * - * 考虑到每个 starter 都需要用到该工具类,所以放到 common 模块下的 enums 包下 + *

+ * 考虑到每个 starter 都需要用到该工具类,所以放到 common 模块下的 enums 包下 * * @author 芋道源码 */ @@ -17,7 +17,7 @@ public interface WebFilterOrderEnum { // OrderedRequestContextFilter 默认为 -105,用于国际化上下文等等 - int TENANT_CONTEXT_FILTER = - 104; // 需要保证在 ApiAccessLogFilter 前面 + int TENANT_CONTEXT_FILTER = -104; // 需要保证在 ApiAccessLogFilter 前面 int API_ACCESS_LOG_FILTER = -103; // 需要保证在 RequestBodyCacheFilter 后面 diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/ErrorCode.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/ErrorCode.java index 45feaec..2c200d7 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/ErrorCode.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/ErrorCode.java @@ -6,10 +6,10 @@ import lombok.Data; /** * 错误码对象 - * + *

* 全局错误码,占用 [0, 999], 参见 {@link GlobalErrorCodeConstants} * 业务异常错误码,占用 [1 000 000 000, +∞),参见 {@link ServiceErrorCodeRange} - * + *

* TODO 错误码设计成对象的原因,为未来的 i18 国际化做准备 */ @Data diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/enums/GlobalErrorCodeConstants.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/enums/GlobalErrorCodeConstants.java index edf31f2..a561556 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/enums/GlobalErrorCodeConstants.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/enums/GlobalErrorCodeConstants.java @@ -5,7 +5,7 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode; /** * 全局错误码枚举 * 0-999 系统异常编码保留 - * + *

* 一般情况下,使用 HTTP 响应状态码 https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Status * 虽然说,HTTP 响应状态码作为业务使用表达能力偏弱,但是使用在系统层面还是非常不错的 * 比较特殊的是,因为之前一直使用 0 作为成功,就不使用 200 啦。 diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/enums/ServiceErrorCodeRange.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/enums/ServiceErrorCodeRange.java index 950ab25..448a4a2 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/enums/ServiceErrorCodeRange.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/enums/ServiceErrorCodeRange.java @@ -2,28 +2,28 @@ package cn.iocoder.yudao.framework.common.exception.enums; /** * 业务异常的错误码区间,解决:解决各模块错误码定义,避免重复,在此只声明不做实际使用 - * + *

* 一共 10 位,分成四段 - * + *

* 第一段,1 位,类型 - * 1 - 业务级别异常 - * x - 预留 + * 1 - 业务级别异常 + * x - 预留 * 第二段,3 位,系统类型 - * 001 - 用户系统 - * 002 - 商品系统 - * 003 - 订单系统 - * 004 - 支付系统 - * 005 - 优惠劵系统 - * ... - ... + * 001 - 用户系统 + * 002 - 商品系统 + * 003 - 订单系统 + * 004 - 支付系统 + * 005 - 优惠劵系统 + * ... - ... * 第三段,3 位,模块 - * 不限制规则。 - * 一般建议,每个系统里面,可能有多个模块,可以再去做分段。以用户系统为例子: - * 001 - OAuth2 模块 - * 002 - User 模块 - * 003 - MobileCode 模块 + * 不限制规则。 + * 一般建议,每个系统里面,可能有多个模块,可以再去做分段。以用户系统为例子: + * 001 - OAuth2 模块 + * 002 - User 模块 + * 003 - MobileCode 模块 * 第四段,3 位,错误码 - * 不限制规则。 - * 一般建议,每个模块自增。 + * 不限制规则。 + * 一般建议,每个模块自增。 * * @author 芋道源码 */ diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/util/ServiceExceptionUtil.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/util/ServiceExceptionUtil.java index 03c0859..9b9a15b 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/util/ServiceExceptionUtil.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/util/ServiceExceptionUtil.java @@ -8,10 +8,9 @@ import lombok.extern.slf4j.Slf4j; /** * {@link ServiceException} 工具类 - * + *

* 目的在于,格式化异常信息提示。 * 考虑到 String.format 在参数不正确时会报错,因此使用 {} 作为占位符,并使用 {@link #doFormat(int, String, Object...)} 方法来格式化 - * */ @Slf4j public class ServiceExceptionUtil { diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/package-info.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/package-info.java index f3f2574..c9d8b65 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/package-info.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/package-info.java @@ -1,6 +1,6 @@ /** * 基础的通用类,和框架无关 - * + *

* 例如说,CommonResult 为通用返回 */ package cn.iocoder.yudao.framework.common; diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/CommonResult.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/CommonResult.java index e29292d..87607d8 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/CommonResult.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/CommonResult.java @@ -37,7 +37,7 @@ public class CommonResult implements Serializable { /** * 将传入的 result 对象,转换成另外一个泛型结果的对象 - * + *

* 因为 A 方法返回的 CommonResult 对象,不满足调用其的 B 方法的返回,所以需要进行转换。 * * @param result 传入的 result 对象 diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageParam.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageParam.java index 97819f9..0c5b495 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageParam.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageParam.java @@ -8,7 +8,7 @@ import javax.validation.constraints.Max; import javax.validation.constraints.NotNull; import java.io.Serializable; -@Schema(description="分页参数") +@Schema(description = "分页参数") @Data public class PageParam implements Serializable { @@ -17,12 +17,12 @@ public class PageParam implements Serializable { /** * 每页条数 - 不分页 - * + *

* 例如说,导出接口,可以设置 {@link #pageSize} 为 -1 不分页,查询所有数据。 */ public static final Integer PAGE_SIZE_NONE = -1; - @Schema(description = "页码,从 1 开始", requiredMode = Schema.RequiredMode.REQUIRED,example = "1") + @Schema(description = "页码,从 1 开始", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "页码不能为空") @Min(value = 1, message = "页码最小值为 1") private Integer pageNo = PAGE_NO; diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/SortingField.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/SortingField.java index 07a68b0..d37888e 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/SortingField.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/SortingField.java @@ -8,7 +8,7 @@ import java.io.Serializable; /** * 排序字段 DTO - * + *

* 类名加了 ing 的原因是,避免和 ES SortField 重名。 */ @Data diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/cache/CacheUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/cache/CacheUtils.java index 12a6e17..b1c3427 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/cache/CacheUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/cache/CacheUtils.java @@ -16,15 +16,15 @@ public class CacheUtils { /** * 构建异步刷新的 LoadingCache 对象 - * + *

* 注意:如果你的缓存和 ThreadLocal 有关系,要么自己处理 ThreadLocal 的传递,要么使用 {@link #buildCache(Duration, CacheLoader)} 方法 - * + *

* 或者简单理解: * 1、和“人”相关的,使用 {@link #buildCache(Duration, CacheLoader)} 方法 * 2、和“全局”、“系统”相关的,使用当前缓存方法 * * @param duration 过期时间 - * @param loader CacheLoader 对象 + * @param loader CacheLoader 对象 * @return LoadingCache 对象 */ public static LoadingCache buildAsyncReloadingCache(Duration duration, CacheLoader loader) { @@ -39,7 +39,7 @@ public class CacheUtils { * 构建同步刷新的 LoadingCache 对象 * * @param duration 过期时间 - * @param loader CacheLoader 对象 + * @param loader CacheLoader 对象 * @return LoadingCache 对象 */ public static LoadingCache buildCache(Duration duration, CacheLoader loader) { diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/collection/ArrayUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/collection/ArrayUtils.java index 4285b8f..29df568 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/collection/ArrayUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/collection/ArrayUtils.java @@ -20,9 +20,9 @@ public class ArrayUtils { /** * 将 object 和 newElements 合并成一个数组 * - * @param object 对象 + * @param object 对象 * @param newElements 数组 - * @param 泛型 + * @param 泛型 * @return 结果数组 */ @SafeVarargs diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/collection/MapUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/collection/MapUtils.java index a59b53f..afa46f8 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/collection/MapUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/collection/MapUtils.java @@ -24,7 +24,7 @@ public class MapUtils { * 从哈希表表中,获得 keys 对应的所有 value 数组 * * @param multimap 哈希表 - * @param keys keys + * @param keys keys * @return value 数组 */ public static List getList(Multimap multimap, Collection keys) { @@ -44,8 +44,8 @@ public class MapUtils { * key 为 null 时, 不处理 * 注意,如果查找到的 value 为 null 时,不进行处理 * - * @param map 哈希表 - * @param key key + * @param map 哈希表 + * @param key key * @param consumer 进一步处理的逻辑 */ public static void findAndThen(Map map, K key, Consumer consumer) { diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/LocalDateTimeUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/LocalDateTimeUtils.java index c3b3b53..adfcb70 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/LocalDateTimeUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/LocalDateTimeUtils.java @@ -28,7 +28,7 @@ public class LocalDateTimeUtils { /** * 解析时间 - * + *

* 相比 {@link LocalDateTimeUtil#parse(CharSequence)} 方法来说,会尽量去解析,直到成功 * * @param time 时间 @@ -79,8 +79,8 @@ public class LocalDateTimeUtils { * 判指定断时间,是否在该时间范围内 * * @param startTime 开始时间 - * @param endTime 结束时间 - * @param time 指定时间 + * @param endTime 结束时间 + * @param time 指定时间 * @return 是否 */ public static boolean isBetween(LocalDateTime startTime, LocalDateTime endTime, String time) { diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/http/HttpUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/http/HttpUtils.java index d36b2c3..972f075 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/http/HttpUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/http/HttpUtils.java @@ -39,12 +39,12 @@ public class HttpUtils { /** * 拼接 URL - * + *

* copy from Spring Security OAuth2 的 AuthorizationEndpoint 类的 append 方法 * - * @param base 基础 URL - * @param query 查询参数 - * @param keys query 的 key,对应的原本的 key 的映射。例如说 query 里有个 key 是 xx,实际它的 key 是 extra_xx,则通过 keys 里添加这个映射 + * @param base 基础 URL + * @param query 查询参数 + * @param keys query 的 key,对应的原本的 key 的映射。例如说 query 里有个 key 是 xx,实际它的 key 是 extra_xx,则通过 keys 里添加这个映射 * @param fragment URL 的 fragment,即拼接到 # 中 * @return 拼接后的 URL */ @@ -109,7 +109,7 @@ public class HttpUtils { authorization = Base64.decodeStr(authorization); clientId = StrUtil.subBefore(authorization, ":", false); clientSecret = StrUtil.subAfter(authorization, ":", false); - // 再从 Param 中获取 + // 再从 Param 中获取 } else { clientId = request.getParameter("client_id"); clientSecret = request.getParameter("client_secret"); diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/io/IoUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/io/IoUtils.java index 4a19f47..55f7682 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/io/IoUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/io/IoUtils.java @@ -16,7 +16,7 @@ public class IoUtils { /** * 从流中读取 UTF8 编码的内容 * - * @param in 输入流 + * @param in 输入流 * @param isClose 是否关闭 * @return 内容 * @throws IORuntimeException IO 异常 diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/json/JsonUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/json/JsonUtils.java index 2cbe93c..7da8fd0 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/json/JsonUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/json/JsonUtils.java @@ -104,7 +104,7 @@ public class JsonUtils { * 使用 {@link #parseObject(String, Class)} 时,在@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS) 的场景下, * 如果 text 没有 class 属性,则会报错。此时,使用这个方法,可以解决。 * - * @param text 字符串 + * @param text 字符串 * @param clazz 类型 * @return 对象 */ @@ -139,7 +139,7 @@ public class JsonUtils { /** * 解析 JSON 字符串成指定类型的对象,如果解析失败,则返回 null * - * @param text 字符串 + * @param text 字符串 * @param typeReference 类型引用 * @return 指定类型的对象 */ diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/json/databind/NumberSerializer.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/json/databind/NumberSerializer.java index 35fc9f7..de66f81 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/json/databind/NumberSerializer.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/json/databind/NumberSerializer.java @@ -8,7 +8,7 @@ import java.io.IOException; /** * Long 序列化规则 - * + *

* 会将超长 long 值转换为 string,解决前端 JavaScript 最大安全整数是 2^53-1 的问题 * * @author 星语 diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/monitor/TracerUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/monitor/TracerUtils.java index 81092b6..4fc7c23 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/monitor/TracerUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/monitor/TracerUtils.java @@ -4,7 +4,7 @@ import org.apache.skywalking.apm.toolkit.trace.TraceContext; /** * 链路追踪工具类 - * + *

* 考虑到每个 starter 都需要用到该工具类,所以放到 common 模块下的 util 包下 * * @author 芋道源码 diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/number/MoneyUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/number/MoneyUtils.java index 90888d7..c1648a6 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/number/MoneyUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/number/MoneyUtils.java @@ -86,7 +86,7 @@ public class MoneyUtils { /** * 分转元(字符串) - * + *

* 例如说 fen 为 1 时,则结果为 0.01 * * @param fen 分 @@ -98,7 +98,7 @@ public class MoneyUtils { /** * 金额相乘,默认进行四舍五入 - * + *

* 位数:{@link #PRICE_SCALE} * * @param price 金额 @@ -114,10 +114,10 @@ public class MoneyUtils { /** * 金额相乘(百分比),默认进行四舍五入 - * + *

* 位数:{@link #PRICE_SCALE} * - * @param price 金额 + * @param price 金额 * @param percent 百分比 * @return 金额相乘结果 */ diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/number/NumberUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/number/NumberUtils.java index c928e2f..f24a15e 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/number/NumberUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/number/NumberUtils.java @@ -22,7 +22,7 @@ public class NumberUtils { /** * 通过经纬度获取地球上两点之间的距离 - * + *

* 参考 <DistanceUtil> 实现,目前它已经被 hutool 删除 * * @param lat1 经度1 @@ -46,7 +46,7 @@ public class NumberUtils { /** * 提供精确的乘法运算 - * + *

* 和 hutool {@link NumberUtil#mul(BigDecimal...)} 的差别是,如果存在 null,则返回 null * * @param values 多个被乘值 diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/object/BeanUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/object/BeanUtils.java index 720b565..5b2d5e8 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/object/BeanUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/object/BeanUtils.java @@ -9,7 +9,7 @@ import java.util.function.Consumer; /** * Bean 工具类 - * + *

* 1. 默认使用 {@link cn.hutool.core.bean.BeanUtil} 作为实现类,虽然不同 bean 工具的性能有差别,但是对绝大多数同学的项目,不用在意这点性能 * 2. 针对复杂的对象转换,可以搜参考 AuthConvert 实现,通过 mapstruct + default 配合实现 * diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/object/ObjectUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/object/ObjectUtils.java index c08316d..b084b87 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/object/ObjectUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/object/ObjectUtils.java @@ -17,7 +17,7 @@ public class ObjectUtils { /** * 复制对象,并忽略 Id 编号 * - * @param object 被复制对象 + * @param object 被复制对象 * @param consumer 消费者,可以二次编辑被复制对象 * @return 复制后的对象 */ diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/package-info.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/package-info.java index cd8ae6b..6b48c48 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/package-info.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/package-info.java @@ -1,7 +1,7 @@ /** * 对于工具类的选择,优先查找 Hutool 中有没对应的方法 * 如果没有,则自己封装对应的工具类,以 Utils 结尾,用于区分 - * + *

* ps:如果担心 Hutool 存在坑的问题,可以阅读 Hutool 的实现源码,以确保可靠性。并且,可以补充相关的单元测试。 */ package cn.iocoder.yudao.framework.common.util; diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/string/StrUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/string/StrUtils.java index d236d18..9c0b215 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/string/StrUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/string/StrUtils.java @@ -64,7 +64,7 @@ public class StrUtils { /** * 移除字符串中,包含指定字符串的行 * - * @param content 字符串 + * @param content 字符串 * @param sequence 包含的字符串 * @return 移除后的字符串 */ diff --git a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/aop/DataPermissionContextHolder.java b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/aop/DataPermissionContextHolder.java index 9705d88..f27445c 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/aop/DataPermissionContextHolder.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/aop/DataPermissionContextHolder.java @@ -62,7 +62,7 @@ public class DataPermissionContextHolder { /** * 清空上下文 - * + *

* 目前仅仅用于单测 */ public static void clear() { diff --git a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionRuleHandler.java b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionRuleHandler.java index a277873..b47efd0 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionRuleHandler.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionRuleHandler.java @@ -14,7 +14,7 @@ import java.util.List; /** * 基于 {@link DataPermissionRule} 的数据权限处理器 - * + *

* 它的底层,是基于 MyBatis Plus 的 数据权限插件 * 核心原理:它会在 SQL 执行前拦截 SQL 语句,并根据用户权限动态添加权限相关的 SQL 片段。这样,只有用户有权限访问的数据才会被查询出来 * diff --git a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/rule/DataPermissionRule.java b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/rule/DataPermissionRule.java index 2bccde8..8a20826 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/rule/DataPermissionRule.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/rule/DataPermissionRule.java @@ -17,7 +17,7 @@ public interface DataPermissionRule { /** * 返回需要生效的表名数组 * 为什么需要该方法?Data Permission 数组基于 SQL 重写,通过 Where 返回只有权限的数据 - * + *

* 如果需要基于实体名获得表名,可调用 {@link TableInfoHelper#getTableInfo(Class)} 获得 * * @return 表名数组 @@ -27,7 +27,7 @@ public interface DataPermissionRule { /** * 根据表名和别名,生成对应的 WHERE / OR 过滤条件 * - * @param tableName 表名 + * @param tableName 表名 * @param tableAlias 别名,可能为空 * @return 过滤条件 Expression 表达式 */ diff --git a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/rule/dept/DeptDataPermissionRule.java b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/rule/dept/DeptDataPermissionRule.java index a8ee34c..d498129 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/rule/dept/DeptDataPermissionRule.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/rule/dept/DeptDataPermissionRule.java @@ -29,18 +29,18 @@ import java.util.Set; /** * 基于部门的 {@link DataPermissionRule} 数据权限规则实现 - * + *

* 注意,使用 DeptDataPermissionRule 时,需要保证表中有 dept_id 部门编号的字段,可自定义。 - * + *

* 实际业务场景下,会存在一个经典的问题?当用户修改部门时,冗余的 dept_id 是否需要修改? * 1. 一般情况下,dept_id 不进行修改,则会导致用户看不到之前的数据。【yudao-server 采用该方案】 * 2. 部分情况下,希望该用户还是能看到之前的数据,则有两种方式解决:【需要你改造该 DeptDataPermissionRule 的实现代码】 - * 1)编写洗数据的脚本,将 dept_id 修改成新部门的编号;【建议】 - * 最终过滤条件是 WHERE dept_id = ? - * 2)洗数据的话,可能涉及的数据量较大,也可以采用 user_id 进行过滤的方式,此时需要获取到 dept_id 对应的所有 user_id 用户编号; - * 最终过滤条件是 WHERE user_id IN (?, ?, ? ...) - * 3)想要保证原 dept_id 和 user_id 都可以看的到,此时使用 dept_id 和 user_id 一起过滤; - * 最终过滤条件是 WHERE dept_id = ? OR user_id IN (?, ?, ? ...) + * 1)编写洗数据的脚本,将 dept_id 修改成新部门的编号;【建议】 + * 最终过滤条件是 WHERE dept_id = ? + * 2)洗数据的话,可能涉及的数据量较大,也可以采用 user_id 进行过滤的方式,此时需要获取到 dept_id 对应的所有 user_id 用户编号; + * 最终过滤条件是 WHERE user_id IN (?, ?, ? ...) + * 3)想要保证原 dept_id 和 user_id 都可以看的到,此时使用 dept_id 和 user_id 一起过滤; + * 最终过滤条件是 WHERE dept_id = ? OR user_id IN (?, ?, ? ...) * * @author 芋道源码 */ @@ -63,7 +63,7 @@ public class DeptDataPermissionRule implements DataPermissionRule { /** * 基于部门的表字段配置 * 一般情况下,每个表的部门编号字段是 dept_id,通过该配置自定义。 - * + *

* key:表名 * value:字段名 */ @@ -71,7 +71,7 @@ public class DeptDataPermissionRule implements DataPermissionRule { /** * 基于用户的表字段配置 * 一般情况下,每个表的部门编号字段是 dept_id,通过该配置自定义。 - * + *

* key:表名 * value:字段名 */ @@ -119,12 +119,12 @@ public class DeptDataPermissionRule implements DataPermissionRule { // 情况二,即不能查看部门,又不能查看自己,则说明 100% 无权限 if (CollUtil.isEmpty(deptDataPermission.getDeptIds()) - && Boolean.FALSE.equals(deptDataPermission.getSelf())) { + && Boolean.FALSE.equals(deptDataPermission.getSelf())) { return new EqualsTo(null, null); // WHERE null = null,可以保证返回的数据为空 } // 情况三,拼接 Dept 和 User 的条件,最后组合 - Expression deptExpression = buildDeptExpression(tableName,tableAlias, deptDataPermission.getDeptIds()); + Expression deptExpression = buildDeptExpression(tableName, tableAlias, deptDataPermission.getDeptIds()); Expression userExpression = buildUserExpression(tableName, tableAlias, deptDataPermission.getSelf(), loginUser.getId()); if (deptExpression == null && userExpression == null) { // TODO 芋艿:获得不到条件的时候,暂时不抛出异常,而是不返回数据 @@ -181,7 +181,7 @@ public class DeptDataPermissionRule implements DataPermissionRule { public void addDeptColumn(Class entityClass, String columnName) { String tableName = TableInfoHelper.getTableInfo(entityClass).getTableName(); - addDeptColumn(tableName, columnName); + addDeptColumn(tableName, columnName); } public void addDeptColumn(String tableName, String columnName) { diff --git a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionRuleHandlerTest.java b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionRuleHandlerTest.java index 0b4ba79..646d84c 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionRuleHandlerTest.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionRuleHandlerTest.java @@ -532,9 +532,9 @@ public class DataPermissionRuleHandlerTest extends BaseMockitoUnitTest { // 没有 On 的 inner join assertSql("SELECT * FROM entity,entity1 " + - "WHERE entity.id = entity1.id", - "SELECT * FROM entity, entity1 " + - "WHERE entity.id = entity1.id AND entity.tenant_id = 1 AND entity1.tenant_id = 1"); + "WHERE entity.id = entity1.id", + "SELECT * FROM entity, entity1 " + + "WHERE entity.id = entity1.id AND entity.tenant_id = 1 AND entity1.tenant_id = 1"); } } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/rule/DataPermissionRuleFactoryImplTest.java b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/rule/DataPermissionRuleFactoryImplTest.java index 17dddc9..a50f330 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/rule/DataPermissionRuleFactoryImplTest.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/rule/DataPermissionRuleFactoryImplTest.java @@ -103,16 +103,20 @@ class DataPermissionRuleFactoryImplTest extends BaseMockitoUnitTest { } @DataPermission(enable = false) - static class TestClass03 {} + static class TestClass03 { + } @DataPermission(includeRules = DataPermissionRule01.class) - static class TestClass04 {} + static class TestClass04 { + } @DataPermission(excludeRules = DataPermissionRule01.class) - static class TestClass05 {} + static class TestClass05 { + } @DataPermission - static class TestClass06 {} + static class TestClass06 { + } static class DataPermissionRule01 implements DataPermissionRule { diff --git a/yudao-framework/yudao-spring-boot-starter-biz-ip/pom.xml b/yudao-framework/yudao-spring-boot-starter-biz-ip/pom.xml index bc800c8..164d443 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-ip/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-biz-ip/pom.xml @@ -14,9 +14,9 @@ ${project.artifactId} IP 拓展,支持如下功能: 1. IP 功能:查询 IP 对应的城市信息 - 基于 https://gitee.com/lionsoul/ip2region 实现 + 基于 https://gitee.com/lionsoul/ip2region 实现 2. 城市功能:查询城市编码对应的城市信息 - 基于 https://github.com/modood/Administrative-divisions-of-China 实现 + 基于 https://github.com/modood/Administrative-divisions-of-China 实现 https://github.com/YunaiV/ruoyi-vue-pro diff --git a/yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/Area.java b/yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/Area.java index dcc9442..2dfe345 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/Area.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/Area.java @@ -9,7 +9,7 @@ import java.util.List; /** * 区域节点,包括国家、省份、城市、地区等信息 - * + *

* 数据可见 resources/area.csv 文件 * * @author 芋道源码 @@ -38,7 +38,7 @@ public class Area { private String name; /** * 类型 - * + *

* 枚举 {@link AreaTypeEnum} */ private Integer type; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/utils/AreaUtils.java b/yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/utils/AreaUtils.java index 8e27a31..395055d 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/utils/AreaUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/utils/AreaUtils.java @@ -138,7 +138,7 @@ public class AreaUtils { /** * 格式化区域 - * + *

* 例如说: * 1. id = “静安区”时:上海 上海市 静安区 * 2. id = “上海市”时:上海 上海市 diff --git a/yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/utils/IPUtils.java b/yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/utils/IPUtils.java index f74f848..4b2c09b 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/utils/IPUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/utils/IPUtils.java @@ -10,7 +10,7 @@ import java.io.IOException; /** * IP 工具类 - * + *

* IP 数据源来自 ip2region.xdb 精简版,基于 项目 * * @author wanglhup diff --git a/yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/package-info.java b/yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/package-info.java index 9d422f5..78f0e7d 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/package-info.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/package-info.java @@ -1,10 +1,10 @@ /** * IP 拓展,支持如下功能: - * + *

* 1. IP 功能:查询 IP 对应的城市信息 - * 基于 https://gitee.com/lionsoul/ip2region 实现 + * 基于 https://gitee.com/lionsoul/ip2region 实现 * 2. 城市功能:查询城市编码对应的城市信息 - * 基于 https://github.com/modood/Administrative-divisions-of-China 实现 + * 基于 https://github.com/modood/Administrative-divisions-of-China 实现 * * @author 芋道源码 */ diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/config/TenantProperties.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/config/TenantProperties.java index 7cb813c..315271f 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/config/TenantProperties.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/config/TenantProperties.java @@ -27,14 +27,14 @@ public class TenantProperties { /** * 需要忽略多租户的请求 - * + *

* 默认情况下,每个请求需要带上 tenant-id 的请求头。但是,部分请求是无需带上的,例如说短信回调、支付回调等 Open API! */ private Set ignoreUrls = Collections.emptySet(); /** * 需要忽略多租户的表 - * + *

* 即默认所有表都开启多租户的功能,所以记得添加对应的 tenant_id 字段哟 */ private Set ignoreTables = Collections.emptySet(); diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/config/YudaoTenantAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/config/YudaoTenantAutoConfiguration.java index c3dd35c..6b70032 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/config/YudaoTenantAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/config/YudaoTenantAutoConfiguration.java @@ -36,7 +36,8 @@ import org.springframework.data.redis.core.RedisTemplate; import java.util.Objects; @AutoConfiguration -@ConditionalOnProperty(prefix = "yudao.tenant", value = "enable", matchIfMissing = true) // 允许使用 yudao.tenant.enable=false 禁用多租户 +@ConditionalOnProperty(prefix = "yudao.tenant", value = "enable", matchIfMissing = true) +// 允许使用 yudao.tenant.enable=false 禁用多租户 @EnableConfigurationProperties(TenantProperties.class) public class YudaoTenantAutoConfiguration { diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/aop/TenantIgnore.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/aop/TenantIgnore.java index f2fec50..d60fe71 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/aop/TenantIgnore.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/aop/TenantIgnore.java @@ -4,7 +4,7 @@ import java.lang.annotation.*; /** * 忽略租户,标记指定方法不进行租户的自动过滤 - * + *

* 注意,只有 DB 的场景会过滤,其它场景暂时不过滤: * 1、Redis 场景:因为是基于 Key 实现多租户的能力,所以忽略没有意义,不像 DB 是一个 column 实现的 * 2、MQ 场景:有点难以抉择,目前可以通过 Consumer 手动在消费的方法上,添加 @TenantIgnore 进行忽略 diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/aop/TenantIgnoreAspect.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/aop/TenantIgnoreAspect.java index b7d0fa3..edd9edc 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/aop/TenantIgnoreAspect.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/aop/TenantIgnoreAspect.java @@ -11,7 +11,7 @@ import org.aspectj.lang.annotation.Aspect; * 忽略多租户的 Aspect,基于 {@link TenantIgnore} 注解实现,用于一些全局的逻辑。 * 例如说,一个定时任务,读取所有数据,进行处理。 * 又例如说,读取所有数据,进行缓存。 - * + *

* 整体逻辑的实现,和 {@link TenantUtils#executeIgnore(Runnable)} 需要保持一致 * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/db/TenantDatabaseInterceptor.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/db/TenantDatabaseInterceptor.java index 8ea1a96..9bf78da 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/db/TenantDatabaseInterceptor.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/db/TenantDatabaseInterceptor.java @@ -37,7 +37,7 @@ public class TenantDatabaseInterceptor implements TenantLineHandler { @Override public boolean ignoreTable(String tableName) { return TenantContextHolder.isIgnore() // 情况一,全局忽略多租户 - || CollUtil.contains(ignoreTables, tableName); // 情况二,忽略多租户的表 + || CollUtil.contains(ignoreTables, tableName); // 情况二,忽略多租户的表 } } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/job/TenantJobAspect.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/job/TenantJobAspect.java index 732a073..f277a13 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/job/TenantJobAspect.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/job/TenantJobAspect.java @@ -18,7 +18,7 @@ import java.util.concurrent.ConcurrentHashMap; /** * 多租户 JobHandler AOP * 任务执行时,会按照租户逐个执行 Job 的逻辑 - * + *

* 注意,需要保证 JobHandler 的幂等性。因为 Job 因为某个租户执行失败重试时,之前执行成功的租户也会再次执行。 * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/kafka/TenantKafkaEnvironmentPostProcessor.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/kafka/TenantKafkaEnvironmentPostProcessor.java index 8bf7cc1..dd79053 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/kafka/TenantKafkaEnvironmentPostProcessor.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/kafka/TenantKafkaEnvironmentPostProcessor.java @@ -8,7 +8,7 @@ import org.springframework.core.env.ConfigurableEnvironment; /** * 多租户的 Kafka 的 {@link EnvironmentPostProcessor} 实现类 - * + *

* Kafka Producer 发送消息时,增加 {@link TenantKafkaProducerInterceptor} 拦截器 * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/kafka/TenantKafkaProducerInterceptor.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/kafka/TenantKafkaProducerInterceptor.java index 8ded801..dbf169f 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/kafka/TenantKafkaProducerInterceptor.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/kafka/TenantKafkaProducerInterceptor.java @@ -14,7 +14,7 @@ import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.HEADER_ /** * Kafka 消息队列的多租户 {@link ProducerInterceptor} 实现类 - * + *

* 1. Producer 发送消息时,将 {@link TenantContextHolder} 租户编号,添加到消息的 Header 中 * 2. Consumer 消费消息时,将消息的 Header 的租户编号,添加到 {@link TenantContextHolder} 中,通过 {@link InvocableHandlerMethod} 实现 * diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/rabbitmq/TenantRabbitMQMessagePostProcessor.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/rabbitmq/TenantRabbitMQMessagePostProcessor.java index 3e6969c..22d9784 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/rabbitmq/TenantRabbitMQMessagePostProcessor.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/rabbitmq/TenantRabbitMQMessagePostProcessor.java @@ -11,7 +11,7 @@ import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.HEADER_ /** * RabbitMQ 消息队列的多租户 {@link ProducerInterceptor} 实现类 - * + *

* 1. Producer 发送消息时,将 {@link TenantContextHolder} 租户编号,添加到消息的 Header 中 * 2. Consumer 消费消息时,将消息的 Header 的租户编号,添加到 {@link TenantContextHolder} 中,通过 {@link InvocableHandlerMethod} 实现 * diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/redis/TenantRedisMessageInterceptor.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/redis/TenantRedisMessageInterceptor.java index f6b7747..d6f23e0 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/redis/TenantRedisMessageInterceptor.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/redis/TenantRedisMessageInterceptor.java @@ -9,7 +9,7 @@ import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.HEADER_ /** * 多租户 {@link AbstractRedisMessage} 拦截器 - * + *

* 1. Producer 发送消息时,将 {@link TenantContextHolder} 租户编号,添加到消息的 Header 中 * 2. Consumer 消费消息时,将消息的 Header 的租户编号,添加到 {@link TenantContextHolder} 中 * diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/rocketmq/TenantRocketMQConsumeMessageHook.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/rocketmq/TenantRocketMQConsumeMessageHook.java index d9d7334..9c70869 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/rocketmq/TenantRocketMQConsumeMessageHook.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/rocketmq/TenantRocketMQConsumeMessageHook.java @@ -14,7 +14,7 @@ import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.HEADER_ /** * RocketMQ 消息队列的多租户 {@link ConsumeMessageHook} 实现类 - * + *

* Consumer 消费消息时,将消息的 Header 的租户编号,添加到 {@link TenantContextHolder} 中,通过 {@link InvocableHandlerMethod} 实现 * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/rocketmq/TenantRocketMQSendMessageHook.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/rocketmq/TenantRocketMQSendMessageHook.java index 4f03074..bc65dbe 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/rocketmq/TenantRocketMQSendMessageHook.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/mq/rocketmq/TenantRocketMQSendMessageHook.java @@ -8,7 +8,7 @@ import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.HEADER_ /** * RocketMQ 消息队列的多租户 {@link SendMessageHook} 实现类 - * + *

* Producer 发送消息时,将 {@link TenantContextHolder} 租户编号,添加到消息的 Header 中 * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/redis/TenantRedisCacheManager.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/redis/TenantRedisCacheManager.java index 240b920..b1c3f6f 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/redis/TenantRedisCacheManager.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/redis/TenantRedisCacheManager.java @@ -10,7 +10,7 @@ import org.springframework.data.redis.cache.RedisCacheWriter; /** * 多租户的 {@link RedisCacheManager} 实现类 - * + *

* 操作指定 name 的 {@link Cache} 时,自动拼接租户后缀,格式为 name + ":" + tenantId + 后缀 * * @author airhead @@ -27,7 +27,7 @@ public class TenantRedisCacheManager extends TimeoutRedisCacheManager { public Cache getCache(String name) { // 如果开启多租户,则 name 拼接租户后缀 if (!TenantContextHolder.isIgnore() - && TenantContextHolder.getTenantId() != null) { + && TenantContextHolder.getTenantId() != null) { name = name + ":" + TenantContextHolder.getTenantId(); } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/security/TenantSecurityWebFilter.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/security/TenantSecurityWebFilter.java index 41ffef0..498b88f 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/security/TenantSecurityWebFilter.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/security/TenantSecurityWebFilter.java @@ -62,7 +62,7 @@ public class TenantSecurityWebFilter extends ApiRequestFilter { if (tenantId == null) { tenantId = user.getTenantId(); TenantContextHolder.setTenantId(tenantId); - // 如果传递了租户编号,则进行比对租户编号,避免越权问题 + // 如果传递了租户编号,则进行比对租户编号,避免越权问题 } else if (!Objects.equals(user.getTenantId(), TenantContextHolder.getTenantId())) { log.error("[doFilterInternal][租户({}) User({}/{}) 越权访问租户({}) URL({}/{})]", user.getTenantId(), user.getId(), user.getUserType(), diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/util/TenantUtils.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/util/TenantUtils.java index 7ec9c69..344110d 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/util/TenantUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/util/TenantUtils.java @@ -16,7 +16,7 @@ public class TenantUtils { /** * 使用指定租户,执行对应的逻辑 - * + *

* 注意,如果当前是忽略租户的情况下,会被强制设置成不忽略租户 * 当然,执行完成后,还是会恢复回去 * @@ -39,7 +39,7 @@ public class TenantUtils { /** * 使用指定租户,执行对应的逻辑 - * + *

* 注意,如果当前是忽略租户的情况下,会被强制设置成不忽略租户 * 当然,执行完成后,还是会恢复回去 * @@ -81,7 +81,7 @@ public class TenantUtils { /** * 将多租户编号,添加到 header 中 * - * @param headers HTTP 请求 headers + * @param headers HTTP 请求 headers * @param tenantId 租户编号 */ public static void addTenantHeader(Map headers, Long tenantId) { diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/package-info.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/package-info.java index aa22cdb..73b883b 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/package-info.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/package-info.java @@ -7,11 +7,10 @@ * 5. Job:在 JobHandler 执行任务时,会按照每个租户,都独立并行执行一次。 * 6. MQ:在 Producer 发送消息时,Header 带上 tenant-id 租户编号;在 Consumer 消费消息时,将 Header 的 tenant-id 租户编号,添加到租户上下文。 * 7. Async:异步需要保证 ThreadLocal 的传递性,通过使用阿里开源的 TransmittableThreadLocal 实现。相关的改造点,可见: - * 1)Spring Async: - * {@link cn.iocoder.yudao.framework.quartz.config.YudaoAsyncAutoConfiguration#threadPoolTaskExecutorBeanPostProcessor()} - * 2)Spring Security: - * TransmittableThreadLocalSecurityContextHolderStrategy - * 和 YudaoSecurityAutoConfiguration#securityContextHolderMethodInvokingFactoryBean() 方法 - * + * 1)Spring Async: + * {@link cn.iocoder.yudao.framework.quartz.config.YudaoAsyncAutoConfiguration#threadPoolTaskExecutorBeanPostProcessor()} + * 2)Spring Security: + * TransmittableThreadLocalSecurityContextHolderStrategy + * 和 YudaoSecurityAutoConfiguration#securityContextHolderMethodInvokingFactoryBean() 方法 */ package cn.iocoder.yudao.framework.tenant; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/org/springframework/messaging/handler/invocation/InvocableHandlerMethod.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/org/springframework/messaging/handler/invocation/InvocableHandlerMethod.java index 059d8f9..87239a8 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/org/springframework/messaging/handler/invocation/InvocableHandlerMethod.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/org/springframework/messaging/handler/invocation/InvocableHandlerMethod.java @@ -38,7 +38,7 @@ import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.HEADER_ * Extension of {@link HandlerMethod} that invokes the underlying method with * argument values resolved from the current HTTP request through a list of * {@link HandlerMethodArgumentResolver}. - * + *

* 针对 rabbitmq-spring 和 kafka-spring,不存在合适的拓展点,可以实现 Consumer 消费前,读取 Header 中的 tenant-id 设置到 {@link TenantContextHolder} 中 * TODO 芋艿:持续跟进,看看有没新的拓展点 * @@ -70,8 +70,9 @@ public class InvocableHandlerMethod extends HandlerMethod { /** * Construct a new handler method with the given bean instance, method name and parameters. - * @param bean the object bean - * @param methodName the method name + * + * @param bean the object bean + * @param methodName the method name * @param parameterTypes the method parameter types * @throws NoSuchMethodException when the method cannot be found */ @@ -105,11 +106,12 @@ public class InvocableHandlerMethod extends HandlerMethod { * i.e. without argument resolution. *

Delegates to {@link #getMethodArgumentValues} and calls {@link #doInvoke} with the * resolved arguments. - * @param message the current message being processed + * + * @param message the current message being processed * @param providedArgs "given" arguments matched by type, not resolved * @return the raw value returned by the invoked method * @throws Exception raised if no suitable argument resolver can be found, - * or if the method raised an exception + * or if the method raised an exception * @see #getMethodArgumentValues * @see #doInvoke */ @@ -121,7 +123,7 @@ public class InvocableHandlerMethod extends HandlerMethod { } // 注意:如下是本类的改动点!!! // 情况一:无租户编号的情况 - Long tenantId= parseTenantId(message); + Long tenantId = parseTenantId(message); if (tenantId == null) { return doInvoke(args); } @@ -153,6 +155,7 @@ public class InvocableHandlerMethod extends HandlerMethod { * Get the method argument values for the current message, checking the provided * argument values and falling back to the configured argument resolvers. *

The resulting array will be passed into {@link #doInvoke}. + * * @since 5.1.2 */ protected Object[] getMethodArgumentValues(Message message, Object... providedArgs) throws Exception { @@ -175,8 +178,7 @@ public class InvocableHandlerMethod extends HandlerMethod { } try { args[i] = this.resolvers.resolveArgument(parameter, message); - } - catch (Exception ex) { + } catch (Exception ex) { // Leave stack trace for later, exception may actually be resolved and handled... if (logger.isDebugEnabled()) { String exMsg = ex.getMessage(); @@ -197,25 +199,20 @@ public class InvocableHandlerMethod extends HandlerMethod { protected Object doInvoke(Object... args) throws Exception { try { return getBridgedMethod().invoke(getBean(), args); - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { assertTargetBean(getBridgedMethod(), getBean(), args); String text = (ex.getMessage() != null ? ex.getMessage() : "Illegal argument"); throw new IllegalStateException(formatInvokeError(text, args), ex); - } - catch (InvocationTargetException ex) { + } catch (InvocationTargetException ex) { // Unwrap for HandlerExceptionResolvers ... Throwable targetException = ex.getTargetException(); if (targetException instanceof RuntimeException) { throw (RuntimeException) targetException; - } - else if (targetException instanceof Error) { + } else if (targetException instanceof Error) { throw (Error) targetException; - } - else if (targetException instanceof Exception) { + } else if (targetException instanceof Exception) { throw (Exception) targetException; - } - else { + } else { throw new IllegalStateException(formatInvokeError("Invocation failure", args), targetException); } } diff --git a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/package-info.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/package-info.java index fd87fda..d40b429 100644 --- a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/package-info.java +++ b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/package-info.java @@ -1,6 +1,6 @@ /** * 字典数据模块,提供 {@link cn.iocoder.yudao.framework.dict.core.DictFrameworkUtils} 工具类 - * + *

* 通过将字典缓存在内存中,保证性能 */ package cn.iocoder.yudao.framework.dict; diff --git a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/annotations/DictFormat.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/annotations/DictFormat.java index 0d898b4..b9c6c5e 100644 --- a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/annotations/DictFormat.java +++ b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/annotations/DictFormat.java @@ -4,7 +4,7 @@ import java.lang.annotation.*; /** * 字典格式化 - * + *

* 实现将字典数据的值,格式化成字典数据的标签 */ @Target({ElementType.FIELD}) diff --git a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/annotations/ExcelColumnSelect.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/annotations/ExcelColumnSelect.java index b4ff140..2d39664 100644 --- a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/annotations/ExcelColumnSelect.java +++ b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/annotations/ExcelColumnSelect.java @@ -4,7 +4,7 @@ import java.lang.annotation.*; /** * 给 Excel 列添加下拉选择数据 - * + *

* 其中 {@link #dictType()} 和 {@link #functionName()} 二选一 * * @author HUIHUI diff --git a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/MoneyConvert.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/MoneyConvert.java index ee66fe7..0ba993e 100644 --- a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/MoneyConvert.java +++ b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/MoneyConvert.java @@ -11,7 +11,7 @@ import java.math.RoundingMode; /** * 金额转换器 - * + *

* 金额单位:分 * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/function/ExcelColumnSelectFunction.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/function/ExcelColumnSelectFunction.java index 51953c4..d12ee36 100644 --- a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/function/ExcelColumnSelectFunction.java +++ b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/function/ExcelColumnSelectFunction.java @@ -4,9 +4,9 @@ import java.util.List; /** * Excel 列下拉数据源获取接口 - * + *

* 为什么不直接解析字典还搞个接口?考虑到有的下拉数据不是从字典中获取的所有需要做一个兼容 - + * * @author HUIHUI */ public interface ExcelColumnSelectFunction { diff --git a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/handler/SelectSheetWriteHandler.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/handler/SelectSheetWriteHandler.java index ef1eb65..484308c 100644 --- a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/handler/SelectSheetWriteHandler.java +++ b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/handler/SelectSheetWriteHandler.java @@ -37,7 +37,7 @@ public class SelectSheetWriteHandler implements SheetWriteHandler { /** * 数据起始行从 0 开始 - * + *

* 约定:本项目第一行有标题所以从 1 开始如果您的 Excel 有多行标题请自行更改 */ public static final int FIRST_ROW = 1; diff --git a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/handler/JobHandlerInvoker.java b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/handler/JobHandlerInvoker.java index 736126f..08adf05 100644 --- a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/handler/JobHandlerInvoker.java +++ b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/handler/JobHandlerInvoker.java @@ -41,7 +41,7 @@ public class JobHandlerInvoker extends QuartzJobBean { Long jobId = executionContext.getMergedJobDataMap().getLong(JobDataKeyEnum.JOB_ID.name()); String jobHandlerName = executionContext.getMergedJobDataMap().getString(JobDataKeyEnum.JOB_HANDLER_NAME.name()); String jobHandlerParam = executionContext.getMergedJobDataMap().getString(JobDataKeyEnum.JOB_HANDLER_PARAM.name()); - int refireCount = executionContext.getRefireCount(); + int refireCount = executionContext.getRefireCount(); int retryCount = (Integer) executionContext.getMergedJobDataMap().getOrDefault(JobDataKeyEnum.JOB_RETRY_COUNT.name(), 0); int retryInterval = (Integer) executionContext.getMergedJobDataMap().getOrDefault(JobDataKeyEnum.JOB_RETRY_INTERVAL.name(), 0); diff --git a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/scheduler/SchedulerManager.java b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/scheduler/SchedulerManager.java index d56682e..8b10f1b 100644 --- a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/scheduler/SchedulerManager.java +++ b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/scheduler/SchedulerManager.java @@ -9,11 +9,11 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU /** * {@link org.quartz.Scheduler} 的管理器,负责创建任务 - * + *

* 考虑到实现的简洁性,我们使用 jobHandlerName 作为唯一标识,即: * 1. Job 的 {@link JobDetail#getKey()} * 2. Trigger 的 {@link Trigger#getKey()} - * + *

* 另外,jobHandlerName 对应到 Spring Bean 的名字,直接调用 * * @author 芋道源码 @@ -29,12 +29,12 @@ public class SchedulerManager { /** * 添加 Job 到 Quartz 中 * - * @param jobId 任务编号 - * @param jobHandlerName 任务处理器的名字 + * @param jobId 任务编号 + * @param jobHandlerName 任务处理器的名字 * @param jobHandlerParam 任务处理器的参数 - * @param cronExpression CRON 表达式 - * @param retryCount 重试次数 - * @param retryInterval 重试间隔 + * @param cronExpression CRON 表达式 + * @param retryCount 重试次数 + * @param retryInterval 重试间隔 * @throws SchedulerException 添加异常 */ public void addJob(Long jobId, String jobHandlerName, String jobHandlerParam, String cronExpression, @@ -55,11 +55,11 @@ public class SchedulerManager { /** * 更新 Job 到 Quartz * - * @param jobHandlerName 任务处理器的名字 + * @param jobHandlerName 任务处理器的名字 * @param jobHandlerParam 任务处理器的参数 - * @param cronExpression CRON 表达式 - * @param retryCount 重试次数 - * @param retryInterval 重试间隔 + * @param cronExpression CRON 表达式 + * @param retryCount 重试次数 + * @param retryInterval 重试间隔 * @throws SchedulerException 更新异常 */ public void updateJob(String jobHandlerName, String jobHandlerParam, String cronExpression, @@ -113,8 +113,8 @@ public class SchedulerManager { /** * 立即触发一次 Quartz 中的 Job * - * @param jobId 任务编号 - * @param jobHandlerName 任务处理器的名字 + * @param jobId 任务编号 + * @param jobHandlerName 任务处理器的名字 * @param jobHandlerParam 任务处理器的参数 * @throws SchedulerException 触发异常 */ diff --git a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/util/CronUtils.java b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/util/CronUtils.java index 5658fa3..b090584 100644 --- a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/util/CronUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/util/CronUtils.java @@ -30,7 +30,7 @@ public class CronUtils { * 基于 CRON 表达式,获得下 n 个满足执行的时间 * * @param cronExpression CRON 表达式 - * @param n 数量 + * @param n 数量 * @return 满足条件的执行时间 */ public static List getNextTimes(String cronExpression, int n) { diff --git a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/package-info.java b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/package-info.java index cfd237b..86e776d 100644 --- a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/package-info.java +++ b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/package-info.java @@ -1,7 +1,7 @@ /** * 1. 定时任务,采用 Quartz 实现进程内的任务执行。 * 考虑到高可用,使用 Quartz 自带的 MySQL 集群方案。 - * + *

* 2. 异步任务,采用 Spring Async 异步执行。 */ package cn.iocoder.yudao.framework.quartz; diff --git a/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/YudaoMetricsAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/YudaoMetricsAutoConfiguration.java index cc2a0df..0be8131 100644 --- a/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/YudaoMetricsAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/YudaoMetricsAutoConfiguration.java @@ -15,7 +15,8 @@ import org.springframework.context.annotation.Bean; */ @AutoConfiguration @ConditionalOnClass({MeterRegistryCustomizer.class}) -@ConditionalOnProperty(prefix = "yudao.metrics", value = "enable", matchIfMissing = true) // 允许使用 yudao.metrics.enable=false 禁用 Metrics +@ConditionalOnProperty(prefix = "yudao.metrics", value = "enable", matchIfMissing = true) +// 允许使用 yudao.metrics.enable=false 禁用 Metrics public class YudaoMetricsAutoConfiguration { @Bean diff --git a/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/annotation/BizTrace.java b/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/annotation/BizTrace.java index 8b12140..a2a8f53 100644 --- a/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/annotation/BizTrace.java +++ b/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/annotation/BizTrace.java @@ -4,7 +4,7 @@ import java.lang.annotation.*; /** * 打印业务编号 / 业务类型注解 - * + *

* 使用时,需要设置 SkyWalking OAP Server 的 application.yaml 配置文件,修改 SW_SEARCHABLE_TAG_KEYS 配置项, * 增加 biz.type 和 biz.id 两值,然后重启 SkyWalking OAP Server 服务器。 * diff --git a/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/util/TracerFrameworkUtils.java b/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/util/TracerFrameworkUtils.java index 51323e7..e142b56 100644 --- a/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/util/TracerFrameworkUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/util/TracerFrameworkUtils.java @@ -19,7 +19,7 @@ public class TracerFrameworkUtils { * 将异常记录到 Span 中,参考自 com.aliyuncs.utils.TraceUtils * * @param throwable 异常 - * @param span Span + * @param span Span */ public static void onError(Throwable throwable, Span span) { Tags.ERROR.set(span, Boolean.TRUE); diff --git a/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/redis/config/YudaoRedisMQConsumerAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/redis/config/YudaoRedisMQConsumerAutoConfiguration.java index d02e84b..3fb8ae9 100644 --- a/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/redis/config/YudaoRedisMQConsumerAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/redis/config/YudaoRedisMQConsumerAutoConfiguration.java @@ -44,7 +44,8 @@ public class YudaoRedisMQConsumerAutoConfiguration { * 创建 Redis Pub/Sub 广播消费的容器 */ @Bean - @ConditionalOnBean(AbstractRedisChannelMessageListener.class) // 只有 AbstractChannelMessageListener 存在的时候,才需要注册 Redis pubsub 监听 + @ConditionalOnBean(AbstractRedisChannelMessageListener.class) + // 只有 AbstractChannelMessageListener 存在的时候,才需要注册 Redis pubsub 监听 public RedisMessageListenerContainer redisMessageListenerContainer( RedisMQTemplate redisMQTemplate, List> listeners) { // 创建 RedisMessageListenerContainer 对象 @@ -65,7 +66,8 @@ public class YudaoRedisMQConsumerAutoConfiguration { * 创建 Redis Stream 重新消费的任务 */ @Bean - @ConditionalOnBean(AbstractRedisStreamMessageListener.class) // 只有 AbstractStreamMessageListener 存在的时候,才需要注册 Redis pubsub 监听 + @ConditionalOnBean(AbstractRedisStreamMessageListener.class) + // 只有 AbstractStreamMessageListener 存在的时候,才需要注册 Redis pubsub 监听 public RedisPendingMessageResendJob redisPendingMessageResendJob(List> listeners, RedisMQTemplate redisTemplate, @Value("${spring.application.name}") String groupName, @@ -75,11 +77,12 @@ public class YudaoRedisMQConsumerAutoConfiguration { /** * 创建 Redis Stream 集群消费的容器 - * + *

* 基础知识:Redis Stream 的 xreadgroup 命令 */ @Bean(initMethod = "start", destroyMethod = "stop") - @ConditionalOnBean(AbstractRedisStreamMessageListener.class) // 只有 AbstractStreamMessageListener 存在的时候,才需要注册 Redis pubsub 监听 + @ConditionalOnBean(AbstractRedisStreamMessageListener.class) + // 只有 AbstractStreamMessageListener 存在的时候,才需要注册 Redis pubsub 监听 public StreamMessageListenerContainer> redisStreamMessageListenerContainer( RedisMQTemplate redisMQTemplate, List> listeners) { RedisTemplate redisTemplate = redisMQTemplate.getRedisTemplate(); diff --git a/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/redis/core/job/RedisPendingMessageResendJob.java b/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/redis/core/job/RedisPendingMessageResendJob.java index b84f17c..b75131f 100644 --- a/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/redis/core/job/RedisPendingMessageResendJob.java +++ b/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/redis/core/job/RedisPendingMessageResendJob.java @@ -27,7 +27,7 @@ public class RedisPendingMessageResendJob { /** * 消息超时时间,默认 5 分钟 - * + *

* 1. 超时的消息才会被重新投递 * 2. 由于定时任务 1 分钟一次,消息超时后不会被立即重投,极端情况下消息5分钟过期后,再等 1 分钟才会被扫瞄到 */ @@ -77,7 +77,7 @@ public class RedisPendingMessageResendJob { pendingMessages.forEach(pendingMessage -> { // 获取消息上一次传递到 consumer 的时间, long lastDelivery = pendingMessage.getElapsedTimeSinceLastDelivery().getSeconds(); - if (lastDelivery < EXPIRE_TIME){ + if (lastDelivery < EXPIRE_TIME) { return; } // 获取指定 id 的消息体 diff --git a/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/redis/core/pubsub/AbstractRedisChannelMessageListener.java b/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/redis/core/pubsub/AbstractRedisChannelMessageListener.java index fd7c910..f37972d 100644 --- a/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/redis/core/pubsub/AbstractRedisChannelMessageListener.java +++ b/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/redis/core/pubsub/AbstractRedisChannelMessageListener.java @@ -17,7 +17,6 @@ import java.util.List; * Redis Pub/Sub 监听器抽象类,用于实现广播消费 * * @param 消息类型。一定要填写噢,不然会报错 - * * @author 芋道源码 */ public abstract class AbstractRedisChannelMessageListener implements MessageListener { diff --git a/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/redis/core/stream/AbstractRedisStreamMessageListener.java b/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/redis/core/stream/AbstractRedisStreamMessageListener.java index 3e656af..16aec8a 100644 --- a/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/redis/core/stream/AbstractRedisStreamMessageListener.java +++ b/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/redis/core/stream/AbstractRedisStreamMessageListener.java @@ -19,7 +19,6 @@ import java.util.List; * Redis Stream 监听器抽象类,用于实现集群消费 * * @param 消息类型。一定要填写噢,不然会报错 - * * @author 芋道源码 */ public abstract class AbstractRedisStreamMessageListener diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/datasource/core/enums/DataSourceEnum.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/datasource/core/enums/DataSourceEnum.java index c99a256..08e7623 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/datasource/core/enums/DataSourceEnum.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/datasource/core/enums/DataSourceEnum.java @@ -2,10 +2,10 @@ package cn.iocoder.yudao.framework.datasource.core.enums; /** * 对应于多数据源中不同数据源配置 - * + *

* 通过在方法上,使用 {@link com.baomidou.dynamic.datasource.annotation.DS} 注解,设置使用的数据源。 * 注意,默认是 {@link #MASTER} 数据源 - * + *

* 对应官方文档为 http://dynamic-datasource.com/guide/customize/Annotation.html */ public interface DataSourceEnum { diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/config/YudaoMybatisAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/config/YudaoMybatisAutoConfiguration.java index d685fd8..49a0d28 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/config/YudaoMybatisAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/config/YudaoMybatisAutoConfiguration.java @@ -21,7 +21,8 @@ import org.springframework.core.env.ConfigurableEnvironment; * * @author 芋道源码 */ -@AutoConfiguration(before = MybatisPlusAutoConfiguration.class) // 目的:先于 MyBatis Plus 自动配置,避免 @MapperScan 可能扫描不到 Mapper 打印 warn 日志 +@AutoConfiguration(before = MybatisPlusAutoConfiguration.class) +// 目的:先于 MyBatis Plus 自动配置,避免 @MapperScan 可能扫描不到 Mapper 打印 warn 日志 @MapperScan(value = "${yudao.info.base-package}", annotationClass = Mapper.class, lazyInitialization = "${mybatis.lazy-initialization:false}") // Mapper 懒加载,目前仅用于单元测试 public class YudaoMybatisAutoConfiguration { @@ -34,7 +35,7 @@ public class YudaoMybatisAutoConfiguration { } @Bean - public MetaObjectHandler defaultMetaObjectHandler(){ + public MetaObjectHandler defaultMetaObjectHandler() { return new DefaultDBFieldHandler(); // 自动填充参数类 } diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/dataobject/BaseDO.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/dataobject/BaseDO.java index fc5f0a3..746dd7d 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/dataobject/BaseDO.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/dataobject/BaseDO.java @@ -13,7 +13,7 @@ import java.time.LocalDateTime; /** * 基础实体对象 - * + *

* 为什么实现 {@link TransPojo} 接口? * 因为使用 Easy-Trans TransType.SIMPLE 模式,集成 MyBatis Plus 查询 * @@ -35,14 +35,14 @@ public abstract class BaseDO implements Serializable, TransPojo { private LocalDateTime updateTime; /** * 创建者,目前使用 SysUser 的 id 编号 - * + *

* 使用 String 类型的原因是,未来可能会存在非数值的情况,留好拓展性。 */ @TableField(fill = FieldFill.INSERT, jdbcType = JdbcType.VARCHAR) private String creator; /** * 更新者,目前使用 SysUser 的 id 编号 - * + *

* 使用 String 类型的原因是,未来可能会存在非数值的情况,留好拓展性。 */ @TableField(fill = FieldFill.INSERT_UPDATE, jdbcType = JdbcType.VARCHAR) diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/enums/DbTypeEnum.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/enums/DbTypeEnum.java index 974986f..31f85d8 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/enums/DbTypeEnum.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/enums/DbTypeEnum.java @@ -21,7 +21,7 @@ public enum DbTypeEnum { /** * MySQL */ - MY_SQL( DbType.MYSQL, "MySQL", "FIND_IN_SET('#{value}', #{column}) <> 0"), + MY_SQL(DbType.MYSQL, "MySQL", "FIND_IN_SET('#{value}', #{column}) <> 0"), /** * Oracle @@ -30,10 +30,10 @@ public enum DbTypeEnum { /** * PostgreSQL - * + *

* 华为 openGauss 使用 ProductName 与 PostgreSQL 相同 */ - POSTGRE_SQL(DbType.POSTGRE_SQL,"PostgreSQL", "POSITION('#{value}' IN #{column}) <> 0"), + POSTGRE_SQL(DbType.POSTGRE_SQL, "PostgreSQL", "POSITION('#{value}' IN #{column}) <> 0"), /** * SQL Server diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/handler/DefaultDBFieldHandler.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/handler/DefaultDBFieldHandler.java index 94dada1..4ab4e62 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/handler/DefaultDBFieldHandler.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/handler/DefaultDBFieldHandler.java @@ -10,7 +10,7 @@ import java.util.Objects; /** * 通用参数填充实现类 - * + *

* 如果没有显式的对通用参数进行赋值,这里会对通用参数进行填充、赋值 * * @author hexiaowu diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/mapper/BaseMapperX.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/mapper/BaseMapperX.java index 8dca318..f71e3a6 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/mapper/BaseMapperX.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/mapper/BaseMapperX.java @@ -26,7 +26,7 @@ import java.util.Objects; /** * 在 MyBatis Plus 的 BaseMapper 的基础上拓展,提供更多的能力 - * + *

* 1. {@link BaseMapper} 为 MyBatis Plus 的基础接口,提供基础的 CRUD 能力 * 2. {@link MPJBaseMapper} 为 MyBatis Plus Join 的基础接口,提供连表 Join 能力 */ diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/QueryWrapperX.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/QueryWrapperX.java index eec4172..c110d79 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/QueryWrapperX.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/QueryWrapperX.java @@ -11,7 +11,7 @@ import java.util.Collection; /** * 拓展 MyBatis Plus QueryWrapper 类,主要增加如下功能: - * + *

* 1. 拼接条件的方法,增加 xxxIfPresent 方法,用于判断值不存在的时候,不要拼接到条件中。 * * @param 数据类型 @@ -95,13 +95,13 @@ public class QueryWrapperX extends QueryWrapper { } public QueryWrapperX betweenIfPresent(String column, Object[] values) { - if (values!= null && values.length != 0 && values[0] != null && values[1] != null) { + if (values != null && values.length != 0 && values[0] != null && values[1] != null) { return (QueryWrapperX) super.between(column, values[0], values[1]); } - if (values!= null && values.length != 0 && values[0] != null) { + if (values != null && values.length != 0 && values[0] != null) { return (QueryWrapperX) ge(column, values[0]); } - if (values!= null && values.length != 0 && values[1] != null) { + if (values != null && values.length != 0 && values[1] != null) { return (QueryWrapperX) le(column, values[1]); } return this; @@ -141,7 +141,7 @@ public class QueryWrapperX extends QueryWrapper { /** * 设置只返回最后一条 - * + *

* TODO 芋艿:不是完美解,需要在思考下。如果使用多数据源,并且数据源是多种类型时,可能会存在问题:实现之返回一条的语法不同 * * @return this diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/util/MyBatisUtils.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/util/MyBatisUtils.java index 611b715..367236a 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/util/MyBatisUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/util/MyBatisUtils.java @@ -37,7 +37,7 @@ public class MyBatisUtils { // 排序字段 if (!CollectionUtil.isEmpty(sortingFields)) { page.addOrder(sortingFields.stream().map(sortingField -> SortingField.ORDER_ASC.equals(sortingField.getOrder()) ? - OrderItem.asc(sortingField.getField()) : OrderItem.desc(sortingField.getField())) + OrderItem.asc(sortingField.getField()) : OrderItem.desc(sortingField.getField())) .collect(Collectors.toList())); } return page; diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/translate/core/TranslateUtils.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/translate/core/TranslateUtils.java index 2974b0c..a1a4200 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/translate/core/TranslateUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/translate/core/TranslateUtils.java @@ -21,7 +21,7 @@ public class TranslateUtils { /** * 数据翻译 - * + *

* 使用场景:无法使用 @TransMethodResult 注解的场景,只能通过手动触发翻译 * * @param data 数据 diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/annotation/Idempotent.java b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/annotation/Idempotent.java index cd6add8..1ada170 100644 --- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/annotation/Idempotent.java +++ b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/annotation/Idempotent.java @@ -22,10 +22,11 @@ public @interface Idempotent { /** * 幂等的超时时间,默认为 1 秒 - * + *

* 注意,如果执行时间超过它,请求还是会进来 */ int timeout() default 1; + /** * 时间单位,默认为 SECONDS 秒 */ @@ -44,6 +45,7 @@ public @interface Idempotent { * @see ExpressionIdempotentKeyResolver 自定义表达式,通过 {@link #keyArg()} 计算 */ Class keyResolver() default DefaultIdempotentKeyResolver.class; + /** * 使用的 Key 参数 */ @@ -51,10 +53,10 @@ public @interface Idempotent { /** * 删除 Key,当发生异常时候 - * + *

* 问题:为什么发生异常时,需要删除 Key 呢? * 回答:发生异常时,说明业务发生错误,此时需要删除 Key,避免下次请求无法正常执行。 - * + *

* 问题:为什么不搞 deleteWhenSuccess 执行成功时,需要删除 Key 呢? * 回答:这种情况下,本质上是分布式锁,推荐使用 @Lock4j 注解 */ diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/keyresolver/impl/DefaultIdempotentKeyResolver.java b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/keyresolver/impl/DefaultIdempotentKeyResolver.java index 7b5e145..a6e754b 100644 --- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/keyresolver/impl/DefaultIdempotentKeyResolver.java +++ b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/keyresolver/impl/DefaultIdempotentKeyResolver.java @@ -8,7 +8,7 @@ import org.aspectj.lang.JoinPoint; /** * 默认(全局级别)幂等 Key 解析器,使用方法名 + 方法参数,组装成一个 Key - * + *

* 为了避免 Key 过长,使用 MD5 进行“压缩” * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/keyresolver/impl/UserIdempotentKeyResolver.java b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/keyresolver/impl/UserIdempotentKeyResolver.java index 2fa91ff..950d3de 100644 --- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/keyresolver/impl/UserIdempotentKeyResolver.java +++ b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/keyresolver/impl/UserIdempotentKeyResolver.java @@ -9,7 +9,7 @@ import org.aspectj.lang.JoinPoint; /** * 用户级别的幂等 Key 解析器,使用方法名 + 方法参数 + userId + userType,组装成一个 Key - * + *

* 为了避免 Key 过长,使用 MD5 进行“压缩” * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/redis/IdempotentRedisDAO.java b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/redis/IdempotentRedisDAO.java index a8d981d..370a6bd 100644 --- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/redis/IdempotentRedisDAO.java +++ b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/redis/IdempotentRedisDAO.java @@ -15,7 +15,7 @@ public class IdempotentRedisDAO { /** * 幂等操作 - * + *

* KEY 格式:idempotent:%s // 参数为 uuid * VALUE 格式:String * 过期时间:不固定 diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/package-info.java b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/package-info.java index 8cad5fc..ce279d2 100644 --- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/package-info.java +++ b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/package-info.java @@ -1,12 +1,12 @@ /** * 幂等组件,参考 https://github.com/it4alla/idempotent 项目实现 * 实现原理是,相同参数的方法,一段时间内,有且仅能执行一次。通过这样的方式,保证幂等性。 - * + *

* 使用场景:例如说,用户快速的双击了某个按钮,前端没有禁用该按钮,导致发送了两次重复的请求。 - * + *

* 和 it4alla/idempotent 组件的差异点,主要体现在两点: - * 1. 我们去掉了 @Idempotent 注解的 delKey 属性。原因是,本质上 delKey 为 true 时,实现的是分布式锁的能力 + * 1. 我们去掉了 @Idempotent 注解的 delKey 属性。原因是,本质上 delKey 为 true 时,实现的是分布式锁的能力 * 此时,我们偏向使用 Lock4j 组件。原则上,一个组件只提供一种单一的能力。 - * 2. 考虑到组件的通用性,我们并未像 it4alla/idempotent 组件一样使用 Redisson RMap 结构,而是直接使用 Redis 的 String 数据格式。 + * 2. 考虑到组件的通用性,我们并未像 it4alla/idempotent 组件一样使用 Redisson RMap 结构,而是直接使用 Redis 的 String 数据格式。 */ package cn.iocoder.yudao.framework.idempotent; diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/lock4j/core/Lock4jRedisKeyConstants.java b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/lock4j/core/Lock4jRedisKeyConstants.java index 693d052..dd54917 100644 --- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/lock4j/core/Lock4jRedisKeyConstants.java +++ b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/lock4j/core/Lock4jRedisKeyConstants.java @@ -9,7 +9,7 @@ public interface Lock4jRedisKeyConstants { /** * 分布式锁 - * + *

* KEY 格式:lock4j:%s // 参数来自 DefaultLockKeyBuilder 类 * VALUE 数据格式:HASH // RLock.class:Redisson 的 Lock 锁,使用 Hash 数据结构 * 过期时间:不固定 diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/annotation/RateLimiter.java b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/annotation/RateLimiter.java index 417c4d6..71cd533 100644 --- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/annotation/RateLimiter.java +++ b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/annotation/RateLimiter.java @@ -27,6 +27,7 @@ public @interface RateLimiter { * 限流的时间,默认为 1 秒 */ int time() default 1; + /** * 时间单位,默认为 SECONDS 秒 */ @@ -54,6 +55,7 @@ public @interface RateLimiter { * @see ExpressionIdempotentKeyResolver 自定义表达式,通过 {@link #keyArg()} 计算 */ Class keyResolver() default DefaultRateLimiterKeyResolver.class; + /** * 使用的 Key 参数 */ diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/keyresolver/RateLimiterKeyResolver.java b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/keyresolver/RateLimiterKeyResolver.java index 44d7bdf..8d56dc4 100644 --- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/keyresolver/RateLimiterKeyResolver.java +++ b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/keyresolver/RateLimiterKeyResolver.java @@ -14,7 +14,7 @@ public interface RateLimiterKeyResolver { * 解析一个 Key * * @param rateLimiter 限流注解 - * @param joinPoint AOP 切面 + * @param joinPoint AOP 切面 * @return Key */ String resolver(JoinPoint joinPoint, RateLimiter rateLimiter); diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/keyresolver/impl/ClientIpRateLimiterKeyResolver.java b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/keyresolver/impl/ClientIpRateLimiterKeyResolver.java index 8d6253c..02ec78c 100644 --- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/keyresolver/impl/ClientIpRateLimiterKeyResolver.java +++ b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/keyresolver/impl/ClientIpRateLimiterKeyResolver.java @@ -9,7 +9,7 @@ import org.aspectj.lang.JoinPoint; /** * IP 级别的限流 Key 解析器,使用方法名 + 方法参数 + IP,组装成一个 Key - * + *

* 为了避免 Key 过长,使用 MD5 进行“压缩” * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/keyresolver/impl/DefaultRateLimiterKeyResolver.java b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/keyresolver/impl/DefaultRateLimiterKeyResolver.java index 236ea45..f4a0768 100644 --- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/keyresolver/impl/DefaultRateLimiterKeyResolver.java +++ b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/keyresolver/impl/DefaultRateLimiterKeyResolver.java @@ -8,7 +8,7 @@ import org.aspectj.lang.JoinPoint; /** * 默认(全局级别)限流 Key 解析器,使用方法名 + 方法参数,组装成一个 Key - * + *

* 为了避免 Key 过长,使用 MD5 进行“压缩” * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/keyresolver/impl/ServerNodeRateLimiterKeyResolver.java b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/keyresolver/impl/ServerNodeRateLimiterKeyResolver.java index 300a4d2..caaded8 100644 --- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/keyresolver/impl/ServerNodeRateLimiterKeyResolver.java +++ b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/keyresolver/impl/ServerNodeRateLimiterKeyResolver.java @@ -9,7 +9,7 @@ import org.aspectj.lang.JoinPoint; /** * Server 节点级别的限流 Key 解析器,使用方法名 + 方法参数 + IP,组装成一个 Key - * + *

* 为了避免 Key 过长,使用 MD5 进行“压缩” * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/keyresolver/impl/UserRateLimiterKeyResolver.java b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/keyresolver/impl/UserRateLimiterKeyResolver.java index a8d1c3a..0607890 100644 --- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/keyresolver/impl/UserRateLimiterKeyResolver.java +++ b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/keyresolver/impl/UserRateLimiterKeyResolver.java @@ -9,7 +9,7 @@ import org.aspectj.lang.JoinPoint; /** * 用户级别的限流 Key 解析器,使用方法名 + 方法参数 + userId + userType,组装成一个 Key - * + *

* 为了避免 Key 过长,使用 MD5 进行“压缩” * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/redis/RateLimiterRedisDAO.java b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/redis/RateLimiterRedisDAO.java index fc1378f..77f79ad 100644 --- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/redis/RateLimiterRedisDAO.java +++ b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/redis/RateLimiterRedisDAO.java @@ -16,7 +16,7 @@ public class RateLimiterRedisDAO { /** * 限流操作 - * + *

* KEY 格式:rate_limiter:%s // 参数为 uuid * VALUE 格式:String * 过期时间:不固定 diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/signature/core/aop/ApiSignatureAspect.java b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/signature/core/aop/ApiSignatureAspect.java index fec3c74..26a875f 100644 --- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/signature/core/aop/ApiSignatureAspect.java +++ b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/signature/core/aop/ApiSignatureAspect.java @@ -75,7 +75,7 @@ public class ApiSignatureAspect { /** * 校验请求头加签参数 - * + *

* 1. appId 是否为空 * 2. timestamp 是否为空,请求是否已经超时,默认 10 分钟 * 3. nonce 是否为空,随机数是否 10 位以上,是否在规定时间内已经访问过了 @@ -118,7 +118,7 @@ public class ApiSignatureAspect { /** * 构建签名字符串 - * + *

* 格式为 = 请求参数 + 请求体 + 请求头 + 密钥 * * @param signature signature @@ -139,7 +139,7 @@ public class ApiSignatureAspect { /** * 获取请求头加签参数 Map * - * @param request 请求 + * @param request 请求 * @param signature 签名注解 * @return signature params */ diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/signature/core/redis/ApiSignatureRedisDAO.java b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/signature/core/redis/ApiSignatureRedisDAO.java index f4aa849..7631f17 100644 --- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/signature/core/redis/ApiSignatureRedisDAO.java +++ b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/signature/core/redis/ApiSignatureRedisDAO.java @@ -17,7 +17,7 @@ public class ApiSignatureRedisDAO { /** * 验签随机数 - * + *

* KEY 格式:signature_nonce:%s // 参数为 随机数 * VALUE 格式:String * 过期时间:不固定 @@ -26,7 +26,7 @@ public class ApiSignatureRedisDAO { /** * 签名密钥 - * + *

* HASH 结构 * KEY 格式:%s // 参数为 appid * VALUE 格式:String diff --git a/yudao-framework/yudao-spring-boot-starter-redis/src/main/java/cn/iocoder/yudao/framework/redis/core/TimeoutRedisCacheManager.java b/yudao-framework/yudao-spring-boot-starter-redis/src/main/java/cn/iocoder/yudao/framework/redis/core/TimeoutRedisCacheManager.java index a835835..9aae173 100644 --- a/yudao-framework/yudao-spring-boot-starter-redis/src/main/java/cn/iocoder/yudao/framework/redis/core/TimeoutRedisCacheManager.java +++ b/yudao-framework/yudao-spring-boot-starter-redis/src/main/java/cn/iocoder/yudao/framework/redis/core/TimeoutRedisCacheManager.java @@ -12,7 +12,7 @@ import java.time.Duration; /** * 支持自定义过期时间的 {@link RedisCacheManager} 实现类 - * + *

* 在 {@link Cacheable#cacheNames()} 格式为 "key#ttl" 时,# 后面的 ttl 为过期时间。 * 单位为最后一个字母(支持的单位有:d 天,h 小时,m 分钟,s 秒),默认单位为 s 秒 * diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/operatelog/core/service/LogRecordServiceImpl.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/operatelog/core/service/LogRecordServiceImpl.java index 765857e..f5f3c14 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/operatelog/core/service/LogRecordServiceImpl.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/operatelog/core/service/LogRecordServiceImpl.java @@ -16,7 +16,7 @@ import java.util.List; /** * 操作日志 ILogRecordService 实现类 - * + *

* 基于 {@link OperateLogApi} 实现,记录操作日志 * * @author HUIHUI diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/SecurityProperties.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/SecurityProperties.java index 3d19f32..46ff072 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/SecurityProperties.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/SecurityProperties.java @@ -21,7 +21,7 @@ public class SecurityProperties { private String tokenHeader = "Authorization"; /** * HTTP 请求时,访问令牌的请求参数 - * + *

* 初始目的:解决 WebSocket 无法通过 header 传参,只能通过 token 参数拼接 */ @NotEmpty(message = "Token Parameter 不能为空") diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoSecurityAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoSecurityAutoConfiguration.java index 432b2ac..e0200af 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoSecurityAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoSecurityAutoConfiguration.java @@ -25,7 +25,7 @@ import javax.annotation.Resource; /** * Spring Security 自动配置类,主要用于相关组件的配置 - * + *

* 注意,不能和 {@link YudaoWebSecurityConfigurerAdapter} 用一个,原因是会导致初始化报错。 * 参见 https://stackoverflow.com/questions/53847050/spring-boot-delegatebuilder-cannot-be-null-on-autowiring-authenticationmanager 文档。 * diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java index 3b9f500..f5c0967 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java @@ -90,7 +90,7 @@ public class YudaoWebSecurityConfigurerAdapter { /** * 配置 URL 的安全配置 - * + *

* anyRequest | 匹配所有请求路径 * access | SpringEl表达式结果为true时可以访问 * anonymous | 匿名可以访问 @@ -128,7 +128,7 @@ public class YudaoWebSecurityConfigurerAdapter { // ①:全局共享规则 .authorizeRequests() // 1.1 静态资源,可匿名访问 - .antMatchers(HttpMethod.GET, "/*.html", "/**/*.html", "/**/*.css", "/**/*.js","/intelligentForm/selectDynamicDataById","/intelligentForm/selectDynamicDataById").permitAll() + .antMatchers(HttpMethod.GET, "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/intelligentForm/selectDynamicDataById", "/intelligentForm/selectDynamicDataById").permitAll() // 1.2 设置 @PermitAll 无需认证 .antMatchers(HttpMethod.GET, permitAllUrls.get(HttpMethod.GET).toArray(new String[0])).permitAll() .antMatchers(HttpMethod.POST, permitAllUrls.get(HttpMethod.POST).toArray(new String[0])).permitAll() @@ -142,7 +142,7 @@ public class YudaoWebSecurityConfigurerAdapter { .antMatchers("/captcha/get", "/captcha/check").permitAll() // ②:每个项目的自定义规则 .and().authorizeRequests(registry -> // 下面,循环设置自定义规则 - authorizeRequestsCustomizers.forEach(customizer -> customizer.customize(registry))) + authorizeRequestsCustomizers.forEach(customizer -> customizer.customize(registry))) // ③:兜底规则,必须认证 .authorizeRequests() .anyRequest().authenticated(); diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/LoginUser.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/LoginUser.java index e23c3a7..c377a05 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/LoginUser.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/LoginUser.java @@ -27,7 +27,7 @@ public class LoginUser { private Long id; /** * 用户类型 - * + *

* 关联 {@link UserTypeEnum} */ private Integer userType; @@ -51,7 +51,7 @@ public class LoginUser { // ========== 上下文 ========== /** * 上下文字段,不进行持久化 - * + *

* 1. 用于基于 LoginUser 维度的临时缓存 */ @JsonIgnore diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/annotations/PreAuthenticated.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/annotations/PreAuthenticated.java index efc85c6..33ffc42 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/annotations/PreAuthenticated.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/annotations/PreAuthenticated.java @@ -4,7 +4,7 @@ import java.lang.annotation.*; /** * 声明用户需要登录 - * + *

* 为什么不使用 {@link org.springframework.security.access.prepost.PreAuthorize} 注解,原因是不通过时,抛出的是认证不通过,而不是未登录 * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/filter/TokenAuthenticationFilter.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/filter/TokenAuthenticationFilter.java index 62ca225..90f808c 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/filter/TokenAuthenticationFilter.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/filter/TokenAuthenticationFilter.java @@ -94,11 +94,11 @@ public class TokenAuthenticationFilter extends OncePerRequestFilter { /** * 模拟登录用户,方便日常开发调试 - * + *

* 注意,在线上环境下,一定要关闭该功能!!! * - * @param request 请求 - * @param token 模拟的 token,格式为 {@link SecurityProperties#getMockSecret()} + 用户编号 + * @param request 请求 + * @param token 模拟的 token,格式为 {@link SecurityProperties#getMockSecret()} + 用户编号 * @param userType 用户类型 * @return 模拟的 LoginUser */ diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/AccessDeniedHandlerImpl.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/AccessDeniedHandlerImpl.java index 33f3f14..e3b6c94 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/AccessDeniedHandlerImpl.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/AccessDeniedHandlerImpl.java @@ -21,7 +21,7 @@ import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeC /** * 访问一个需要认证的 URL 资源,已经认证(登录)但是没有权限的情况下,返回 {@link GlobalErrorCodeConstants#FORBIDDEN} 错误码。 - * + *

* 补充:Spring Security 通过 {@link ExceptionTranslationFilter#handleAccessDeniedException(HttpServletRequest, HttpServletResponse, FilterChain, AccessDeniedException)} 方法,调用当前类 * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/AuthenticationEntryPointImpl.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/AuthenticationEntryPointImpl.java index 0a451e0..7360cb2 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/AuthenticationEntryPointImpl.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/AuthenticationEntryPointImpl.java @@ -16,7 +16,7 @@ import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeC /** * 访问一个需要认证的 URL 资源,但是此时自己尚未认证(登录)的情况下,返回 {@link GlobalErrorCodeConstants#UNAUTHORIZED} 错误码,从而使前端重定向到登录页 - * + *

* 补充:Spring Security 通过 {@link ExceptionTranslationFilter#sendStartAuthentication(HttpServletRequest, HttpServletResponse, FilterChain, AuthenticationException)} 方法,调用当前类 * * @author ruoyi diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/service/SecurityFrameworkService.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/service/SecurityFrameworkService.java index bf2f7f3..06b2d9a 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/service/SecurityFrameworkService.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/service/SecurityFrameworkService.java @@ -25,7 +25,7 @@ public interface SecurityFrameworkService { /** * 判断是否有角色 - * + *

* 注意,角色使用的是 SysRoleDO 的 code 标识 * * @param role 角色 diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/util/SecurityFrameworkUtils.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/util/SecurityFrameworkUtils.java index f85d77c..c61cdb7 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/util/SecurityFrameworkUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/util/SecurityFrameworkUtils.java @@ -27,13 +27,14 @@ public class SecurityFrameworkUtils { */ public static final String AUTHORIZATION_BEARER = "Bearer"; - private SecurityFrameworkUtils() {} + private SecurityFrameworkUtils() { + } /** * 从请求中,获得认证 Token * - * @param request 请求 - * @param headerName 认证 Token 对应的 Header 名字 + * @param request 请求 + * @param headerName 认证 Token 对应的 Header 名字 * @param parameterName 认证 Token 对应的 Parameter 名字 * @return 认证 Token */ @@ -116,7 +117,7 @@ public class SecurityFrameworkUtils { * 设置当前用户 * * @param loginUser 登录用户 - * @param request 请求 + * @param request 请求 */ public static void setLoginUser(LoginUser loginUser, HttpServletRequest request) { // 创建 Authentication,并设置到上下文 diff --git a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/config/RedisTestConfiguration.java b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/config/RedisTestConfiguration.java index 4622291..901fb3c 100644 --- a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/config/RedisTestConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/config/RedisTestConfiguration.java @@ -28,7 +28,8 @@ public class RedisTestConfiguration { // 一次执行多个单元测试时,貌似创建多个 spring 容器,导致不进行 stop。这样,就导致端口被占用,无法启动。。。 try { redisServer.start(); - } catch (Exception ignore) {} + } catch (Exception ignore) { + } return redisServer; } diff --git a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/config/SqlInitializationTestConfiguration.java b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/config/SqlInitializationTestConfiguration.java index abaec9d..f68903d 100644 --- a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/config/SqlInitializationTestConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/config/SqlInitializationTestConfiguration.java @@ -16,7 +16,7 @@ import javax.sql.DataSource; /** * SQL 初始化的测试 Configuration - * + *

* 为什么不使用 org.springframework.boot.autoconfigure.sql.init.DataSourceInitializationConfiguration 呢? * 因为我们在单元测试会使用 spring.main.lazy-initialization 为 true,开启延迟加载。此时,会导致 DataSourceInitializationConfiguration 初始化 * 不过呢,当前类的实现代码,基本是复制 DataSourceInitializationConfiguration 的哈! @@ -31,22 +31,22 @@ import javax.sql.DataSource; @EnableConfigurationProperties(SqlInitializationProperties.class) public class SqlInitializationTestConfiguration { - @Bean - public DataSourceScriptDatabaseInitializer dataSourceScriptDatabaseInitializer(DataSource dataSource, - SqlInitializationProperties initializationProperties) { - DatabaseInitializationSettings settings = createFrom(initializationProperties); - return new DataSourceScriptDatabaseInitializer(dataSource, settings); - } + @Bean + public DataSourceScriptDatabaseInitializer dataSourceScriptDatabaseInitializer(DataSource dataSource, + SqlInitializationProperties initializationProperties) { + DatabaseInitializationSettings settings = createFrom(initializationProperties); + return new DataSourceScriptDatabaseInitializer(dataSource, settings); + } - static DatabaseInitializationSettings createFrom(SqlInitializationProperties properties) { - DatabaseInitializationSettings settings = new DatabaseInitializationSettings(); - settings.setSchemaLocations(properties.getSchemaLocations()); - settings.setDataLocations(properties.getDataLocations()); - settings.setContinueOnError(properties.isContinueOnError()); - settings.setSeparator(properties.getSeparator()); - settings.setEncoding(properties.getEncoding()); - settings.setMode(properties.getMode()); - return settings; - } + static DatabaseInitializationSettings createFrom(SqlInitializationProperties properties) { + DatabaseInitializationSettings settings = new DatabaseInitializationSettings(); + settings.setSchemaLocations(properties.getSchemaLocations()); + settings.setDataLocations(properties.getDataLocations()); + settings.setContinueOnError(properties.isContinueOnError()); + settings.setSeparator(properties.getSeparator()); + settings.setEncoding(properties.getEncoding()); + settings.setMode(properties.getMode()); + return settings; + } } diff --git a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseDbAndRedisUnitTest.java b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseDbAndRedisUnitTest.java index c4c0157..20d38f1 100644 --- a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseDbAndRedisUnitTest.java +++ b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseDbAndRedisUnitTest.java @@ -18,7 +18,7 @@ import org.springframework.test.context.jdbc.Sql; /** * 依赖内存 DB + Redis 的单元测试 - * + *

* 相比 {@link BaseDbUnitTest} 来说,额外增加了内存 Redis * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseDbUnitTest.java b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseDbUnitTest.java index 316c4d5..504acba 100644 --- a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseDbUnitTest.java +++ b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseDbUnitTest.java @@ -15,7 +15,7 @@ import org.springframework.test.context.jdbc.Sql; /** * 依赖内存 DB 的单元测试 - * + *

* 注意,Service 层同样适用。对于 Service 层的单元测试,我们针对自己模块的 Mapper 走的是 H2 内存数据库,针对别的模块的 Service 走的是 Mock 方法 * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseRedisUnitTest.java b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseRedisUnitTest.java index 7b84003..75ca6f8 100644 --- a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseRedisUnitTest.java +++ b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseRedisUnitTest.java @@ -10,7 +10,7 @@ import org.springframework.test.context.ActiveProfiles; /** * 依赖内存 Redis 的单元测试 - * + *

* 相比 {@link BaseDbUnitTest} 来说,从内存 DB 改成了内存 Redis * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/AssertUtils.java b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/AssertUtils.java index e98f498..85ec113 100644 --- a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/AssertUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/AssertUtils.java @@ -23,11 +23,11 @@ public class AssertUtils { /** * 比对两个对象的属性是否一致 - * + *

* 注意,如果 expected 存在的属性,actual 不存在的时候,会进行忽略 * - * @param expected 期望对象 - * @param actual 实际对象 + * @param expected 期望对象 + * @param actual 实际对象 * @param ignoreFields 忽略的属性数组 */ public static void assertPojoEquals(Object expected, Object actual, String... ignoreFields) { @@ -57,11 +57,11 @@ public class AssertUtils { /** * 比对两个对象的属性是否一致 - * + *

* 注意,如果 expected 存在的属性,actual 不存在的时候,会进行忽略 * - * @param expected 期望对象 - * @param actual 实际对象 + * @param expected 期望对象 + * @param actual 实际对象 * @param ignoreFields 忽略的属性数组 * @return 是否一致 */ @@ -85,8 +85,8 @@ public class AssertUtils { /** * 执行方法,校验抛出的 Service 是否符合条件 * - * @param executable 业务异常 - * @param errorCode 错误码对象 + * @param executable 业务异常 + * @param errorCode 错误码对象 * @param messageParams 消息参数 */ public static void assertServiceException(Executable executable, ErrorCode errorCode, Object... messageParams) { diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/config/YudaoApiLogAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/config/YudaoApiLogAutoConfiguration.java index 2a0d8d8..c6c1421 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/config/YudaoApiLogAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/config/YudaoApiLogAutoConfiguration.java @@ -40,7 +40,8 @@ public class YudaoApiLogAutoConfiguration implements WebMvcConfigurer { * 创建 ApiAccessLogFilter Bean,记录 API 请求日志 */ @Bean - @ConditionalOnProperty(prefix = "yudao.access-log", value = "enable", matchIfMissing = true) // 允许使用 yudao.access-log.enable=false 禁用访问日志 + @ConditionalOnProperty(prefix = "yudao.access-log", value = "enable", matchIfMissing = true) + // 允许使用 yudao.access-log.enable=false 禁用访问日志 public FilterRegistrationBean apiAccessLogFilter(WebProperties webProperties, @Value("${spring.application.name}") String applicationName, ApiAccessLogFrameworkService apiAccessLogFrameworkService) { diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/annotation/ApiAccessLog.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/annotation/ApiAccessLog.java index fe93ef6..c706c6c 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/annotation/ApiAccessLog.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/annotation/ApiAccessLog.java @@ -22,21 +22,24 @@ public @interface ApiAccessLog { * 是否记录访问日志 */ boolean enable() default true; + /** * 是否记录请求参数 - * + *

* 默认记录,主要考虑请求数据一般不大。可手动设置为 false 进行关闭 */ boolean requestEnable() default true; + /** * 是否记录响应结果 - * + *

* 默认不记录,主要考虑响应数据可能比较大。可手动设置为 true 进行打开 */ boolean responseEnable() default false; + /** * 敏感参数数组 - * + *

* 添加后,请求参数、响应结果不会记录该参数 */ String[] sanitizeKeys() default {}; @@ -45,19 +48,21 @@ public @interface ApiAccessLog { /** * 操作模块 - * + *

* 为空时,会尝试读取 {@link io.swagger.v3.oas.annotations.tags.Tag#name()} 属性 */ String operateModule() default ""; + /** * 操作名 - * + *

* 为空时,会尝试读取 {@link io.swagger.v3.oas.annotations.Operation#summary()} 属性 */ String operateName() default ""; + /** * 操作分类 - * + *

* 实际并不是数组,因为枚举不能设置 null 作为默认值 */ OperateTypeEnum[] operateType() default {}; diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/enums/OperateTypeEnum.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/enums/OperateTypeEnum.java index a7f0055..5a408e4 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/enums/OperateTypeEnum.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/enums/OperateTypeEnum.java @@ -38,7 +38,7 @@ public enum OperateTypeEnum { IMPORT(6), /** * 其它 - * + *

* 在无法归类时,可以选择使用其它。因为还有操作名可以进一步标识 */ OTHER(0); diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/filter/ApiAccessLogFilter.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/filter/ApiAccessLogFilter.java index 1474d08..4747571 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/filter/ApiAccessLogFilter.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/filter/ApiAccessLogFilter.java @@ -41,7 +41,7 @@ import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString /** * API 访问日志 Filter - * + *

* 目的:记录 API 访问日志到数据库中 * * @author 芋道源码 @@ -240,7 +240,7 @@ public class ApiAccessLogFilter extends ApiRequestFilter { while (iterator.hasNext()) { Map.Entry entry = iterator.next(); if (ArrayUtil.contains(sanitizeKeys, entry.getKey()) - || ArrayUtil.contains(SANITIZE_KEYS, entry.getKey())) { + || ArrayUtil.contains(SANITIZE_KEYS, entry.getKey())) { iterator.remove(); continue; } diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/interceptor/ApiAccessLogInterceptor.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/interceptor/ApiAccessLogInterceptor.java index ef6ed5f..a375484 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/interceptor/ApiAccessLogInterceptor.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/interceptor/ApiAccessLogInterceptor.java @@ -15,7 +15,7 @@ import java.util.Map; /** * API 访问日志 Interceptor - * + *

* 目的:在非 prod 环境时,打印 request 和 response 两条日志到日志文件(控制台)中。 * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiAccessLogFrameworkServiceImpl.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiAccessLogFrameworkServiceImpl.java index 934f814..aa84934 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiAccessLogFrameworkServiceImpl.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiAccessLogFrameworkServiceImpl.java @@ -8,7 +8,7 @@ import org.springframework.scheduling.annotation.Async; /** * API 访问日志 Framework Service 实现类 - * + *

* 基于 {@link ApiAccessLogApi} 服务,记录访问日志 * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiErrorLogFrameworkServiceImpl.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiErrorLogFrameworkServiceImpl.java index e4e19fb..5bd8497 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiErrorLogFrameworkServiceImpl.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiErrorLogFrameworkServiceImpl.java @@ -8,7 +8,7 @@ import org.springframework.scheduling.annotation.Async; /** * API 错误日志 Framework Service 实现类 - * + *

* 基于 {@link ApiErrorLogApi} 服务,记录错误日志 * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/base/serializer/StringDesensitizeSerializer.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/base/serializer/StringDesensitizeSerializer.java index 2c15a74..cd04965 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/base/serializer/StringDesensitizeSerializer.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/base/serializer/StringDesensitizeSerializer.java @@ -22,7 +22,7 @@ import java.lang.reflect.Field; /** * 脱敏序列化器 - * + *

* 实现 JSON 返回数据时,使用 {@link DesensitizationHandler} 对声明脱敏注解的字段,进行脱敏处理。 * * @author gaibu diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/annotation/EmailDesensitize.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/annotation/EmailDesensitize.java index 227f254..64e1c6a 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/annotation/EmailDesensitize.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/annotation/EmailDesensitize.java @@ -29,7 +29,7 @@ public @interface EmailDesensitize { /** * 替换规则,邮箱; - * + *

* 比如:example@gmail.com 脱敏之后为 e****@gmail.com */ String replacer() default "$1****$2"; diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/annotation/RegexDesensitize.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/annotation/RegexDesensitize.java index 4ab7c74..bef8a9e 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/annotation/RegexDesensitize.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/annotation/RegexDesensitize.java @@ -29,7 +29,7 @@ public @interface RegexDesensitize { /** * 替换规则,会将匹配到的字符串全部替换成 replacer - * + *

* 例如:regex=123; replacer=****** * 原始字符串 123456789 * 脱敏后字符串 ******456789 diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/PasswordDesensitize.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/PasswordDesensitize.java index 6a3b269..3c3e74d 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/PasswordDesensitize.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/PasswordDesensitize.java @@ -34,7 +34,7 @@ public @interface PasswordDesensitize { /** * 替换规则,密码; - * + *

* 比如:123456 脱敏之后为 ****** */ String replacer() default "*"; diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/SliderDesensitize.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/SliderDesensitize.java index ec79635..d023e72 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/SliderDesensitize.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/SliderDesensitize.java @@ -29,7 +29,7 @@ public @interface SliderDesensitize { /** * 替换规则,会将前缀后缀保留后,全部替换成 replacer - * + *

* 例如:prefixKeep = 1; suffixKeep = 2; replacer = "*"; * 原始字符串 123456 * 脱敏后 1***56 diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java index a131d1f..9d3dc54 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java @@ -31,7 +31,7 @@ import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.HEADER_ /** * Swagger 自动配置类,基于 OpenAPI + Springdoc 实现。 - * + *

* 友情提示: * 1. Springdoc 文档地址:仓库 * 2. Swagger 规范,于 2015 更名为 OpenAPI 规范,本质是一个东西 @@ -41,7 +41,8 @@ import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.HEADER_ @AutoConfiguration @ConditionalOnClass({OpenAPI.class}) @EnableConfigurationProperties(SwaggerProperties.class) -@ConditionalOnProperty(prefix = "springdoc.api-docs", name = "enabled", havingValue = "true", matchIfMissing = true) // 设置为 false 时,禁用 +@ConditionalOnProperty(prefix = "springdoc.api-docs", name = "enabled", havingValue = "true", matchIfMissing = true) +// 设置为 false 时,禁用 public class YudaoSwaggerAutoConfiguration { // ========== 全局 OpenAPI 配置 ========== @@ -139,7 +140,7 @@ public class YudaoSwaggerAutoConfiguration { /** * 构建 Authorization 认证请求头参数 - * + *

* 解决 Knife4j Authorize 未生效,请求header里未包含参数 * * @return 认证参数 diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/WebProperties.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/WebProperties.java index 03f4d70..c62e832 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/WebProperties.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/WebProperties.java @@ -32,10 +32,10 @@ public class WebProperties { /** * API 前缀,实现所有 Controller 提供的 RESTFul API 的统一前缀 - * - * + *

+ *

* 意义:通过该前缀,避免 Swagger、Actuator 意外通过 Nginx 暴露出来给外部,带来安全性问题 - * 这样,Nginx 只需要配置转发到 /api/* 的所有接口即可。 + * 这样,Nginx 只需要配置转发到 /api/* 的所有接口即可。 * * @see YudaoWebAutoConfiguration#configurePathMatch(PathMatchConfigurer) */ @@ -44,7 +44,7 @@ public class WebProperties { /** * Controller 所在包的 Ant 路径规则 - * + *

* 主要目的是,给该 Controller 设置指定的 {@link #prefix} */ @NotEmpty(message = "Controller 所在包不能为空") diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/filter/CacheRequestBodyWrapper.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/filter/CacheRequestBodyWrapper.java index 616a340..a257dec 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/filter/CacheRequestBodyWrapper.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/filter/CacheRequestBodyWrapper.java @@ -12,7 +12,7 @@ import java.io.IOException; import java.io.InputStreamReader; /** - * Request Body 缓存 Wrapper + * Request Body 缓存 Wrapper * * @author 芋道源码 */ @@ -55,7 +55,8 @@ public class CacheRequestBodyWrapper extends HttpServletRequestWrapper { } @Override - public void setReadListener(ReadListener readListener) {} + public void setReadListener(ReadListener readListener) { + } @Override public int available() { diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java index b999e87..9a94509 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java @@ -62,7 +62,7 @@ public class GlobalExceptionHandler { * 因为 Filter 不走 SpringMVC 的流程,但是我们又需要兜底处理异常,所以这里提供一个全量的异常处理过程,保持逻辑统一。 * * @param request 请求 - * @param ex 异常 + * @param ex 异常 * @return 通用返回 */ public CommonResult allExceptionHandler(HttpServletRequest request, Throwable ex) { @@ -101,7 +101,7 @@ public class GlobalExceptionHandler { /** * 处理 SpringMVC 请求参数缺失 - * + *

* 例如说,接口上设置了 @RequestParam("xx") 参数,结果并未传递 xx 参数 */ @ExceptionHandler(value = MissingServletRequestParameterException.class) @@ -112,7 +112,7 @@ public class GlobalExceptionHandler { /** * 处理 SpringMVC 请求参数类型错误 - * + *

* 例如说,接口上设置了 @RequestParam("xx") 参数为 Integer,结果传递 xx 参数类型为 String */ @ExceptionHandler(MethodArgumentTypeMismatchException.class) @@ -165,7 +165,7 @@ public class GlobalExceptionHandler { /** * 处理 SpringMVC 请求地址不存在 - * + *

* 注意,它需要设置如下两个配置项: * 1. spring.mvc.throw-exception-if-no-handler-found 为 true * 2. spring.mvc.static-path-pattern 为 /statics/** @@ -178,7 +178,7 @@ public class GlobalExceptionHandler { /** * 处理 SpringMVC 请求方法不正确 - * + *

* 例如说,A 接口的方法为 GET 方式,结果请求方法为 POST 方式,导致不匹配 */ @ExceptionHandler(HttpRequestMethodNotSupportedException.class) @@ -189,7 +189,7 @@ public class GlobalExceptionHandler { /** * 处理 Spring Security 权限不足的异常 - * + *

* 来源是,使用 @PreAuthorize 注解,AOP 进行权限拦截 */ @ExceptionHandler(value = AccessDeniedException.class) @@ -201,7 +201,7 @@ public class GlobalExceptionHandler { /** * 处理业务异常 ServiceException - * + *

* 例如说,商品库存不足,用户手机号已存在。 */ @ExceptionHandler(value = ServiceException.class) @@ -243,7 +243,7 @@ public class GlobalExceptionHandler { // 执行插入 errorLog apiErrorLogFrameworkService.createApiErrorLog(errorLog); } catch (Throwable th) { - log.error("[createExceptionLog][url({}) log({}) 发生异常]", req.getRequestURI(), JsonUtils.toJsonString(errorLog), th); + log.error("[createExceptionLog][url({}) log({}) 发生异常]", req.getRequestURI(), JsonUtils.toJsonString(errorLog), th); } } diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalResponseBodyHandler.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalResponseBodyHandler.java index 90da742..43dc6f1 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalResponseBodyHandler.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalResponseBodyHandler.java @@ -12,11 +12,11 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; /** * 全局响应结果(ResponseBody)处理器 - * + *

* 不同于在网上看到的很多文章,会选择自动将 Controller 返回结果包上 {@link CommonResult}, * 在 onemall 中,是 Controller 在返回时,主动自己包上 {@link CommonResult}。 * 原因是,GlobalResponseBodyHandler 本质上是 AOP,它不应该改变 Controller 返回的数据结构 - * + *

* 目前,GlobalResponseBodyHandler 的主要作用是,记录 Controller 的返回结果, * 方便 {@link cn.iocoder.yudao.framework.apilog.core.filter.ApiAccessLogFilter} 记录访问日志 */ diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/util/WebFrameworkUtils.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/util/WebFrameworkUtils.java index b5a52c0..d0b5894 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/util/WebFrameworkUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/util/WebFrameworkUtils.java @@ -60,7 +60,7 @@ public class WebFrameworkUtils { /** * 设置用户类型 * - * @param request 请求 + * @param request 请求 * @param userType 用户类型 */ public static void setLoginUserType(ServletRequest request, Integer userType) { diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/xss/config/YudaoXssAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/xss/config/YudaoXssAutoConfiguration.java index 99b6a44..ca40349 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/xss/config/YudaoXssAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/xss/config/YudaoXssAutoConfiguration.java @@ -21,7 +21,8 @@ import static cn.iocoder.yudao.framework.web.config.YudaoWebAutoConfiguration.cr @AutoConfiguration @EnableConfigurationProperties(XssProperties.class) -@ConditionalOnProperty(prefix = "yudao.xss", name = "enable", havingValue = "true", matchIfMissing = true) // 设置为 false 时,禁用 +@ConditionalOnProperty(prefix = "yudao.xss", name = "enable", havingValue = "true", matchIfMissing = true) +// 设置为 false 时,禁用 public class YudaoXssAutoConfiguration implements WebMvcConfigurer { /** diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/xss/package-info.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/xss/package-info.java index c6e46f0..a42a494 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/xss/package-info.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/xss/package-info.java @@ -1,6 +1,6 @@ /** * 针对 XSS 的基础封装 - * + *

* XSS 说明:https://tech.meituan.com/2018/09/27/fe-security.html */ package cn.iocoder.yudao.framework.xss; diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/test/java/cn/iocoder/yudao/framework/desensitize/core/annotation/Address.java b/yudao-framework/yudao-spring-boot-starter-web/src/test/java/cn/iocoder/yudao/framework/desensitize/core/annotation/Address.java index 1301209..b967472 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/test/java/cn/iocoder/yudao/framework/desensitize/core/annotation/Address.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/test/java/cn/iocoder/yudao/framework/desensitize/core/annotation/Address.java @@ -13,7 +13,7 @@ import java.lang.annotation.Target; /** * 地址 - * + *

* 用于 {@link DesensitizeTest} 测试使用 * * @author gaibu diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/test/java/cn/iocoder/yudao/framework/desensitize/core/handler/AddressHandler.java b/yudao-framework/yudao-spring-boot-starter-web/src/test/java/cn/iocoder/yudao/framework/desensitize/core/handler/AddressHandler.java index 7a8455f..d4ce7a8 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/test/java/cn/iocoder/yudao/framework/desensitize/core/handler/AddressHandler.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/test/java/cn/iocoder/yudao/framework/desensitize/core/handler/AddressHandler.java @@ -6,7 +6,7 @@ import cn.iocoder.yudao.framework.desensitize.core.annotation.Address; /** * {@link Address} 的脱敏处理器 - * + *

* 用于 {@link DesensitizeTest} 测试使用 */ public class AddressHandler implements DesensitizationHandler

{ diff --git a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/config/WebSocketProperties.java b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/config/WebSocketProperties.java index aa618fb..5cf0bd3 100644 --- a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/config/WebSocketProperties.java +++ b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/config/WebSocketProperties.java @@ -25,7 +25,7 @@ public class WebSocketProperties { /** * 消息发送器的类型 - * + *

* 可选值:local、redis、rocketmq、kafka、rabbitmq */ @NotNull(message = "WebSocket 的消息发送者不能为空") diff --git a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/config/YudaoWebSocketAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/config/YudaoWebSocketAutoConfiguration.java index 0f08b7c..8af0383 100644 --- a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/config/YudaoWebSocketAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/config/YudaoWebSocketAutoConfiguration.java @@ -39,9 +39,11 @@ import java.util.List; * * @author xingyu4j */ -@AutoConfiguration(before = YudaoRedisMQConsumerAutoConfiguration.class) // before YudaoRedisMQConsumerAutoConfiguration 的原因是,需要保证 RedisWebSocketMessageConsumer 先创建,才能创建 RedisMessageListenerContainer +@AutoConfiguration(before = YudaoRedisMQConsumerAutoConfiguration.class) +// before YudaoRedisMQConsumerAutoConfiguration 的原因是,需要保证 RedisWebSocketMessageConsumer 先创建,才能创建 RedisMessageListenerContainer @EnableWebSocket // 开启 websocket -@ConditionalOnProperty(prefix = "yudao.websocket", value = "enable", matchIfMissing = true) // 允许使用 yudao.websocket.enable=false 禁用 websocket +@ConditionalOnProperty(prefix = "yudao.websocket", value = "enable", matchIfMissing = true) +// 允许使用 yudao.websocket.enable=false 禁用 websocket @EnableConfigurationProperties(WebSocketProperties.class) public class YudaoWebSocketAutoConfiguration { diff --git a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/handler/JsonWebSocketMessageHandler.java b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/handler/JsonWebSocketMessageHandler.java index 120f529..25176e7 100644 --- a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/handler/JsonWebSocketMessageHandler.java +++ b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/handler/JsonWebSocketMessageHandler.java @@ -22,7 +22,7 @@ import java.util.function.Consumer; /** * JSON 格式 {@link WebSocketHandler} 实现类 - * + *

* 基于 {@link JsonWebSocketMessage#getType()} 消息类型,调度到对应的 {@link WebSocketMessageListener} 监听器。 * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/listener/WebSocketMessageListener.java b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/listener/WebSocketMessageListener.java index f3a62cc..07d10f1 100644 --- a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/listener/WebSocketMessageListener.java +++ b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/listener/WebSocketMessageListener.java @@ -5,7 +5,7 @@ import org.springframework.web.socket.WebSocketSession; /** * WebSocket 消息监听器接口 - * + *

* 目的:前端发送消息给后端后,处理对应 {@link #getType()} 类型的消息 * * @param 泛型,消息类型 @@ -23,8 +23,8 @@ public interface WebSocketMessageListener { /** * 获得消息类型 * - * @see JsonWebSocketMessage#getType() * @return 消息类型 + * @see JsonWebSocketMessage#getType() */ String getType(); diff --git a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/message/JsonWebSocketMessage.java b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/message/JsonWebSocketMessage.java index 0a55cd6..00a2f21 100644 --- a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/message/JsonWebSocketMessage.java +++ b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/message/JsonWebSocketMessage.java @@ -15,13 +15,13 @@ public class JsonWebSocketMessage implements Serializable { /** * 消息类型 - * + *

* 目的:用于分发到对应的 {@link WebSocketMessageListener} 实现类 */ private String type; /** * 消息内容 - * + *

* 要求 JSON 对象 */ private String content; diff --git a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/security/LoginUserHandshakeInterceptor.java b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/security/LoginUserHandshakeInterceptor.java index 3a31825..d634b2f 100644 --- a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/security/LoginUserHandshakeInterceptor.java +++ b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/security/LoginUserHandshakeInterceptor.java @@ -14,7 +14,7 @@ import java.util.Map; /** * 登录用户的 {@link HandshakeInterceptor} 实现类 - * + *

* 流程如下: * 1. 前端连接 websocket 时,会通过拼接 ?token={token} 到 ws:// 连接后,这样它可以被 {@link TokenAuthenticationFilter} 所认证通过 * 2. {@link LoginUserHandshakeInterceptor} 负责把 {@link LoginUser} 添加到 {@link WebSocketSession} 中 diff --git a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/AbstractWebSocketMessageSender.java b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/AbstractWebSocketMessageSender.java index 4e0db44..604d55a 100644 --- a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/AbstractWebSocketMessageSender.java +++ b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/AbstractWebSocketMessageSender.java @@ -44,10 +44,10 @@ public abstract class AbstractWebSocketMessageSender implements WebSocketMessage /** * 发送消息 * - * @param sessionId Session 编号 - * @param userType 用户类型 - * @param userId 用户编号 - * @param messageType 消息类型 + * @param sessionId Session 编号 + * @param userType 用户类型 + * @param userId 用户编号 + * @param messageType 消息类型 * @param messageContent 消息内容 */ public void send(String sessionId, Integer userType, Long userId, String messageType, String messageContent) { @@ -74,8 +74,8 @@ public abstract class AbstractWebSocketMessageSender implements WebSocketMessage /** * 发送消息的具体实现 * - * @param sessions Session 列表 - * @param messageType 消息类型 + * @param sessions Session 列表 + * @param messageType 消息类型 * @param messageContent 消息内容 */ public void doSend(Collection sessions, String messageType, String messageContent) { diff --git a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/WebSocketMessageSender.java b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/WebSocketMessageSender.java index 9f75ad5..581daa8 100644 --- a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/WebSocketMessageSender.java +++ b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/WebSocketMessageSender.java @@ -12,9 +12,9 @@ public interface WebSocketMessageSender { /** * 发送消息给指定用户 * - * @param userType 用户类型 - * @param userId 用户编号 - * @param messageType 消息类型 + * @param userType 用户类型 + * @param userId 用户编号 + * @param messageType 消息类型 * @param messageContent 消息内容,JSON 格式 */ void send(Integer userType, Long userId, String messageType, String messageContent); @@ -22,8 +22,8 @@ public interface WebSocketMessageSender { /** * 发送消息给指定用户类型 * - * @param userType 用户类型 - * @param messageType 消息类型 + * @param userType 用户类型 + * @param messageType 消息类型 * @param messageContent 消息内容,JSON 格式 */ void send(Integer userType, String messageType, String messageContent); @@ -31,8 +31,8 @@ public interface WebSocketMessageSender { /** * 发送消息给指定 Session * - * @param sessionId Session 编号 - * @param messageType 消息类型 + * @param sessionId Session 编号 + * @param messageType 消息类型 * @param messageContent 消息内容,JSON 格式 */ void send(String sessionId, String messageType, String messageContent); diff --git a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/kafka/KafkaWebSocketMessageSender.java b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/kafka/KafkaWebSocketMessageSender.java index 47bb598..ae8b042 100644 --- a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/kafka/KafkaWebSocketMessageSender.java +++ b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/kafka/KafkaWebSocketMessageSender.java @@ -46,10 +46,10 @@ public class KafkaWebSocketMessageSender extends AbstractWebSocketMessageSender /** * 通过 Kafka 广播消息 * - * @param sessionId Session 编号 - * @param userId 用户编号 - * @param userType 用户类型 - * @param messageType 消息类型 + * @param sessionId Session 编号 + * @param userId 用户编号 + * @param userType 用户类型 + * @param messageType 消息类型 * @param messageContent 消息内容 */ private void sendKafkaMessage(String sessionId, Long userId, Integer userType, diff --git a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/local/LocalWebSocketMessageSender.java b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/local/LocalWebSocketMessageSender.java index 66640ef..1065ba7 100644 --- a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/local/LocalWebSocketMessageSender.java +++ b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/local/LocalWebSocketMessageSender.java @@ -6,7 +6,7 @@ import cn.iocoder.yudao.framework.websocket.core.session.WebSocketSessionManager /** * 本地的 {@link WebSocketMessageSender} 实现类 - * + *

* 注意:仅仅适合单机场景!!! * * @author 芋道源码 diff --git a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/rabbitmq/RabbitMQWebSocketMessageSender.java b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/rabbitmq/RabbitMQWebSocketMessageSender.java index 065a5d6..a03e842 100644 --- a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/rabbitmq/RabbitMQWebSocketMessageSender.java +++ b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/rabbitmq/RabbitMQWebSocketMessageSender.java @@ -45,10 +45,10 @@ public class RabbitMQWebSocketMessageSender extends AbstractWebSocketMessageSend /** * 通过 RabbitMQ 广播消息 * - * @param sessionId Session 编号 - * @param userId 用户编号 - * @param userType 用户类型 - * @param messageType 消息类型 + * @param sessionId Session 编号 + * @param userId 用户编号 + * @param userType 用户类型 + * @param messageType 消息类型 * @param messageContent 消息内容 */ private void sendRabbitMQMessage(String sessionId, Long userId, Integer userType, diff --git a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/redis/RedisWebSocketMessageSender.java b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/redis/RedisWebSocketMessageSender.java index d6004ac..c4d6ffa 100644 --- a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/redis/RedisWebSocketMessageSender.java +++ b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/redis/RedisWebSocketMessageSender.java @@ -40,10 +40,10 @@ public class RedisWebSocketMessageSender extends AbstractWebSocketMessageSender /** * 通过 Redis 广播消息 * - * @param sessionId Session 编号 - * @param userId 用户编号 - * @param userType 用户类型 - * @param messageType 消息类型 + * @param sessionId Session 编号 + * @param userId 用户编号 + * @param userType 用户类型 + * @param messageType 消息类型 * @param messageContent 消息内容 */ private void sendRedisMessage(String sessionId, Long userId, Integer userType, diff --git a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/rocketmq/RocketMQWebSocketMessageSender.java b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/rocketmq/RocketMQWebSocketMessageSender.java index ed059ba..b62c903 100644 --- a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/rocketmq/RocketMQWebSocketMessageSender.java +++ b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/sender/rocketmq/RocketMQWebSocketMessageSender.java @@ -44,10 +44,10 @@ public class RocketMQWebSocketMessageSender extends AbstractWebSocketMessageSend /** * 通过 RocketMQ 广播消息 * - * @param sessionId Session 编号 - * @param userId 用户编号 - * @param userType 用户类型 - * @param messageType 消息类型 + * @param sessionId Session 编号 + * @param userId 用户编号 + * @param userType 用户类型 + * @param messageType 消息类型 * @param messageContent 消息内容 */ private void sendRocketMQMessage(String sessionId, Long userId, Integer userType, diff --git a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/session/WebSocketSessionHandlerDecorator.java b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/session/WebSocketSessionHandlerDecorator.java index 600a4dd..b508c63 100644 --- a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/session/WebSocketSessionHandlerDecorator.java +++ b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/session/WebSocketSessionHandlerDecorator.java @@ -8,7 +8,7 @@ import org.springframework.web.socket.handler.WebSocketHandlerDecorator; /** * {@link WebSocketHandler} 的装饰类,实现了以下功能: - * + *

* 1. {@link WebSocketSession} 连接或关闭时,使用 {@link #sessionManager} 进行管理 * 2. 封装 {@link WebSocketSession} 支持并发操作 * diff --git a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/session/WebSocketSessionManager.java b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/session/WebSocketSessionManager.java index ad1de23..e1dfe33 100644 --- a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/session/WebSocketSessionManager.java +++ b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/session/WebSocketSessionManager.java @@ -45,7 +45,7 @@ public interface WebSocketSessionManager { * 获得指定用户编号的 Session 列表 * * @param userType 用户类型 - * @param userId 用户编号 + * @param userId 用户编号 * @return Session 列表 */ Collection getSessionList(Integer userType, Long userId); diff --git a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/session/WebSocketSessionManagerImpl.java b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/session/WebSocketSessionManagerImpl.java index 6dba898..d1d6768 100644 --- a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/session/WebSocketSessionManagerImpl.java +++ b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/session/WebSocketSessionManagerImpl.java @@ -23,14 +23,14 @@ public class WebSocketSessionManagerImpl implements WebSocketSessionManager { /** * id 与 WebSocketSession 映射 - * + *

* key:Session 编号 */ private final ConcurrentMap idSessions = new ConcurrentHashMap<>(); /** * user 与 WebSocketSession 映射 - * + *

* key1:用户类型 * key2:用户编号 */ diff --git a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/util/WebSocketFrameworkUtils.java b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/util/WebSocketFrameworkUtils.java index 58cdedc..8947e68 100644 --- a/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/util/WebSocketFrameworkUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-websocket/src/main/java/cn/iocoder/yudao/framework/websocket/core/util/WebSocketFrameworkUtils.java @@ -17,7 +17,7 @@ public class WebSocketFrameworkUtils { /** * 设置当前用户 * - * @param loginUser 登录用户 + * @param loginUser 登录用户 * @param attributes Session */ public static void setLoginUser(LoginUser loginUser, Map attributes) { diff --git a/yudao-module-ai/pom.xml b/yudao-module-ai/pom.xml index 7135100..e9242fc 100644 --- a/yudao-module-ai/pom.xml +++ b/yudao-module-ai/pom.xml @@ -20,8 +20,8 @@ ai 模块下,接入 LLM 大模型,支持聊天、绘图、音乐、写作、思维脑图等功能。 目前已接入各种模型,不限于: - 国内:通义千问、文心一言、讯飞星火、智谱 GLM、DeepSeek - 国外:OpenAI、Ollama、Midjourney、StableDiffusion、Suno + 国内:通义千问、文心一言、讯飞星火、智谱 GLM、DeepSeek + 国外:OpenAI、Ollama、Midjourney、StableDiffusion、Suno \ No newline at end of file diff --git a/yudao-module-ai/yudao-module-ai-api/src/main/java/cn/iocoder/yudao/module/ai/enums/ErrorCodeConstants.java b/yudao-module-ai/yudao-module-ai-api/src/main/java/cn/iocoder/yudao/module/ai/enums/ErrorCodeConstants.java index ddfb489..a1c4caa 100644 --- a/yudao-module-ai/yudao-module-ai-api/src/main/java/cn/iocoder/yudao/module/ai/enums/ErrorCodeConstants.java +++ b/yudao-module-ai/yudao-module-ai-api/src/main/java/cn/iocoder/yudao/module/ai/enums/ErrorCodeConstants.java @@ -4,7 +4,7 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode; /** * AI 错误码枚举类 - * + *

* ai 系统,使用 1-040-000-000 段 */ public interface ErrorCodeConstants { diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/image/vo/AiImageDrawReqVO.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/image/vo/AiImageDrawReqVO.java index a38935e..63dc6a8 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/image/vo/AiImageDrawReqVO.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/image/vo/AiImageDrawReqVO.java @@ -42,7 +42,7 @@ public class AiImageDrawReqVO { /** * 绘制参数,不同 platform 的不同参数 - * + *

* 1. {@link OpenAiImageOptions} * 2. {@link StabilityAiImageOptions} */ diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/model/AiChatRoleController.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/model/AiChatRoleController.java index 02f698b..5714c5f 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/model/AiChatRoleController.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/model/AiChatRoleController.java @@ -75,7 +75,7 @@ public class AiChatRoleController { @GetMapping("/category-list") @Operation(summary = "获得聊天角色的分类列表") public CommonResult> getChatRoleCategoryList() { - return success(chatRoleService.getChatRoleCategoryList()); + return success(chatRoleService.getChatRoleCategoryList()); } // ========== 角色管理 ========== diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/model/vo/apikey/AiApiKeyPageReqVO.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/model/vo/apikey/AiApiKeyPageReqVO.java index 0636962..92e44de 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/model/vo/apikey/AiApiKeyPageReqVO.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/model/vo/apikey/AiApiKeyPageReqVO.java @@ -1,10 +1,13 @@ package cn.iocoder.yudao.module.ai.controller.admin.model.vo.apikey; import lombok.*; + import java.util.*; + import io.swagger.v3.oas.annotations.media.Schema; import cn.iocoder.yudao.framework.common.pojo.PageParam; import org.springframework.format.annotation.DateTimeFormat; + import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/model/vo/apikey/AiApiKeySaveReqVO.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/model/vo/apikey/AiApiKeySaveReqVO.java index 8fbc8fd..362b78e 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/model/vo/apikey/AiApiKeySaveReqVO.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/model/vo/apikey/AiApiKeySaveReqVO.java @@ -2,7 +2,9 @@ package cn.iocoder.yudao.module.ai.controller.admin.model.vo.apikey; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; + import java.util.*; + import jakarta.validation.constraints.*; @Schema(description = "管理后台 - AI API 密钥新增/修改 Request VO") diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/music/AiMusicController.http b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/music/AiMusicController.http index ae68c82..0a39bf2 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/music/AiMusicController.http +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/music/AiMusicController.http @@ -8,7 +8,9 @@ Authorization: {{token}} "generateMode": 2, "prompt": "创作一首带有轻松吉他旋律的流行歌曲,[verse] 描述夏日海滩的宁静,[chorus] 节奏加快,表达对自由的向往。", "model": "chirp-v3.5", - "tags": ["Happy"], + "tags": [ + "Happy" + ], "title": "Happy Song" } diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/chat/AiChatConversationDO.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/chat/AiChatConversationDO.java index 0b7eb02..074662e 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/chat/AiChatConversationDO.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/chat/AiChatConversationDO.java @@ -12,7 +12,7 @@ import java.time.LocalDateTime; /** * AI Chat 对话 DO - * + *

* 用户每次发起 Chat 聊天时,会创建一个 {@link AiChatConversationDO} 对象,将它的消息关联在一起 * * @author fansili @@ -37,14 +37,14 @@ public class AiChatConversationDO extends BaseDO { /** * 用户编号 - * + *

* 关联 AdminUserDO 的 userId 字段 */ private Long userId; /** * 对话标题 - * + *

* 默认由系统自动生成,可用户手动修改 */ private String title; @@ -59,14 +59,14 @@ public class AiChatConversationDO extends BaseDO { /** * 角色编号 - * + *

* 关联 {@link AiChatRoleDO#getId()} */ private Long roleId; /** * 模型编号 - * + *

* 关联 {@link AiChatModelDO#getId()} 字段 */ private Long modelId; @@ -83,7 +83,7 @@ public class AiChatConversationDO extends BaseDO { private String systemMessage; /** * 温度参数 - * + *

* 用于调整生成回复的随机性和多样性程度:较低的温度值会使输出更收敛于高频词汇,较高的则增加多样性 */ private Double temperature; diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/chat/AiChatMessageDO.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/chat/AiChatMessageDO.java index 973c593..6929ba5 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/chat/AiChatMessageDO.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/chat/AiChatMessageDO.java @@ -32,36 +32,36 @@ public class AiChatMessageDO extends BaseDO { /** * 对话编号 - * + *

* 关联 {@link AiChatConversationDO#getId()} 字段 */ private Long conversationId; /** * 回复消息编号 - * + *

* 关联 {@link #id} 字段 - * + *

* 大模型回复的消息编号,用于“问答”的关联 */ private Long replyId; /** * 消息类型 - * + *

* 也等价于 OpenAPI 的 role 字段 - * + *

* 枚举 {@link MessageType} */ private String type; /** * 用户编号 - * + *

* 关联 AdminUserDO 的 userId 字段 */ private Long userId; /** * 角色编号 - * + *

* 关联 {@link AiChatRoleDO#getId()} 字段 */ private Long roleId; @@ -72,7 +72,7 @@ public class AiChatMessageDO extends BaseDO { private String model; /** * 模型编号 - * + *

* 关联 {@link AiChatModelDO#getId()} 字段 */ private Long modelId; diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/image/AiImageDO.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/image/AiImageDO.java index a894cae..c8937cf 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/image/AiImageDO.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/image/AiImageDO.java @@ -35,7 +35,7 @@ public class AiImageDO extends BaseDO { /** * 用户编号 - * + *

* 关联 {@link AdminUserRespDTO#getId()} */ private Long userId; @@ -47,13 +47,13 @@ public class AiImageDO extends BaseDO { /** * 平台 - * + *

* 枚举 {@link cn.iocoder.yudao.framework.ai.core.enums.AiPlatformEnum} */ private String platform; /** * 模型 - * + *

* 冗余 {@link AiChatModelDO#getModel()} */ private String model; @@ -69,7 +69,7 @@ public class AiImageDO extends BaseDO { /** * 生成状态 - * + *

* 枚举 {@link AiImageStatusEnum} */ private Integer status; @@ -95,7 +95,7 @@ public class AiImageDO extends BaseDO { /** * 绘制参数,不同 platform 的不同参数 - * + *

* 1. {@link OpenAiImageOptions} * 2. {@link StabilityAiImageOptions} */ @@ -110,7 +110,7 @@ public class AiImageDO extends BaseDO { /** * 任务编号 - * + *

* 1. midjourney proxy:关联的 task id */ private String taskId; diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/model/AiApiKeyDO.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/model/AiApiKeyDO.java index e251d55..8f1d0e0 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/model/AiApiKeyDO.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/model/AiApiKeyDO.java @@ -37,7 +37,7 @@ public class AiApiKeyDO extends BaseDO { private String apiKey; /** * 平台 - * + *

* 枚举 {@link AiPlatformEnum} */ private String platform; @@ -47,7 +47,7 @@ public class AiApiKeyDO extends BaseDO { private String url; /** * 状态 - * + *

* 枚举 {@link CommonStatusEnum} */ private Integer status; diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/model/AiChatModelDO.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/model/AiChatModelDO.java index 7197f8b..103aa42 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/model/AiChatModelDO.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/model/AiChatModelDO.java @@ -10,7 +10,7 @@ import lombok.*; /** * AI 聊天模型 DO - * + *

* 默认聊天模型:{@link #status} 为开启,并且 {@link #sort} 排序第一 * * @author fansili @@ -32,7 +32,7 @@ public class AiChatModelDO extends BaseDO { private Long id; /** * API 秘钥编号 - * + *

* 关联 {@link AiApiKeyDO#getId()} */ private Long keyId; @@ -46,7 +46,7 @@ public class AiChatModelDO extends BaseDO { private String model; /** * 平台 - * + *

* 枚举 {@link AiPlatformEnum} */ private String platform; @@ -57,7 +57,7 @@ public class AiChatModelDO extends BaseDO { private Integer sort; /** * 状态 - * + *

* 枚举 {@link CommonStatusEnum} */ private Integer status; @@ -66,7 +66,7 @@ public class AiChatModelDO extends BaseDO { /** * 温度参数 - * + *

* 用于调整生成回复的随机性和多样性程度:较低的温度值会使输出更收敛于高频词汇,较高的则增加多样性 */ private Double temperature; diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/model/AiChatRoleDO.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/model/AiChatRoleDO.java index 28f6cda..37d10d2 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/model/AiChatRoleDO.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/model/AiChatRoleDO.java @@ -48,21 +48,21 @@ public class AiChatRoleDO extends BaseDO { /** * 用户编号 - * + *

* 关联 AdminUserDO 的 userId 字段 */ private Long userId; /** * 模型编号 - * + *

* 关联 {@link AiChatModelDO#getId()} 字段 */ private Long modelId; /** * 是否公开 - * + *

* 1. true - 公开;由管理员在【角色管理】所创建 * 2. false - 私有;由个人在【我的角色】所创建 */ @@ -74,7 +74,7 @@ public class AiChatRoleDO extends BaseDO { private Integer sort; /** * 状态 - * + *

* 枚举 {@link CommonStatusEnum} */ private Integer status; diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/write/AiWriteDO.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/write/AiWriteDO.java index 752876f..34c495d 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/write/AiWriteDO.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/write/AiWriteDO.java @@ -25,7 +25,7 @@ public class AiWriteDO extends BaseDO { /** * 用户编号 - * + *

* 关联 AdminUserDO 的 userId 字段 */ private Long userId; @@ -39,7 +39,7 @@ public class AiWriteDO extends BaseDO { /** * 平台 - * + *

* 枚举 {@link AiPlatformEnum} */ private String platform; @@ -64,25 +64,25 @@ public class AiWriteDO extends BaseDO { /** * 长度提示词 - * + *

* 字典:{@link cn.iocoder.yudao.module.ai.enums.DictTypeConstants#AI_WRITE_LENGTH} */ private Integer length; /** * 格式提示词 - * + *

* 字典:{@link cn.iocoder.yudao.module.ai.enums.DictTypeConstants#AI_WRITE_FORMAT} */ private Integer format; /** * 语气提示词 - * + *

* 字典:{@link cn.iocoder.yudao.module.ai.enums.DictTypeConstants#AI_WRITE_TONE} */ private Integer tone; /** * 语言提示词 - * + *

* 字典:{@link cn.iocoder.yudao.module.ai.enums.DictTypeConstants#AI_WRITE_LANGUAGE} */ private Integer language; diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/mysql/chat/AiChatMessageMapper.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/mysql/chat/AiChatMessageMapper.java index 5020f39..1e1e8c1 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/mysql/chat/AiChatMessageMapper.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/mysql/chat/AiChatMessageMapper.java @@ -44,7 +44,7 @@ public interface AiChatMessageMapper extends BaseMapperX { // 转换数据 return CollectionUtils.convertMap(result, record -> MapUtil.getLong(record, "conversationId"), - record -> MapUtil.getInt(record, "count" )); + record -> MapUtil.getInt(record, "count")); } default PageResult selectPage(AiChatMessagePageReqVO pageReqVO) { diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/mysql/music/AiMusicMapper.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/mysql/music/AiMusicMapper.java index 025f5e0..c248305 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/mysql/music/AiMusicMapper.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/mysql/music/AiMusicMapper.java @@ -40,5 +40,5 @@ public interface AiMusicMapper extends BaseMapperX { .eq(Boolean.FALSE.equals(reqVO.getPublicStatus()), AiMusicDO::getUserId, userId) .orderByAsc(AiMusicDO::getId)); } - + } diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/chat/AiChatConversationService.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/chat/AiChatConversationService.java index bce6d43..fa28ed3 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/chat/AiChatConversationService.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/chat/AiChatConversationService.java @@ -20,7 +20,7 @@ public interface AiChatConversationService { * 创建【我的】聊天对话 * * @param createReqVO 创建信息 - * @param userId 用户编号 + * @param userId 用户编号 * @return 编号 */ Long createChatConversationMy(AiChatConversationCreateMyReqVO createReqVO, Long userId); @@ -29,7 +29,7 @@ public interface AiChatConversationService { * 更新【我的】聊天对话 * * @param updateReqVO 更新信息 - * @param userId 用户编号 + * @param userId 用户编号 */ void updateChatConversationMy(AiChatConversationUpdateMyReqVO updateReqVO, Long userId); @@ -52,7 +52,7 @@ public interface AiChatConversationService { /** * 删除【我的】聊天对话 * - * @param id 编号 + * @param id 编号 * @param userId 用户编号 */ void deleteChatConversationMy(Long id, Long userId); diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/chat/AiChatMessageService.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/chat/AiChatMessageService.java index f572bdd..0d8a70f 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/chat/AiChatMessageService.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/chat/AiChatMessageService.java @@ -23,7 +23,7 @@ public interface AiChatMessageService { * 发送消息 * * @param sendReqVO 发送信息 - * @param userId 用户编号 + * @param userId 用户编号 * @return 发送结果 */ AiChatMessageSendRespVO sendMessage(AiChatMessageSendReqVO sendReqVO, Long userId); @@ -32,7 +32,7 @@ public interface AiChatMessageService { * 发送消息 * * @param sendReqVO 发送信息 - * @param userId 用户编号 + * @param userId 用户编号 * @return 发送结果 */ Flux> sendChatMessageStream(AiChatMessageSendReqVO sendReqVO, Long userId); @@ -48,7 +48,7 @@ public interface AiChatMessageService { /** * 删除消息 * - * @param id 消息编号 + * @param id 消息编号 * @param userId 用户编号 */ void deleteChatMessage(Long id, Long userId); @@ -57,7 +57,7 @@ public interface AiChatMessageService { * 删除指定对话的消息 * * @param conversationId 对话编号 - * @param userId 用户编号 + * @param userId 用户编号 */ void deleteChatMessageByConversationId(Long conversationId, Long userId); diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/chat/AiChatMessageServiceImpl.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/chat/AiChatMessageServiceImpl.java index 72fa06a..b8a62c3 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/chat/AiChatMessageServiceImpl.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/chat/AiChatMessageServiceImpl.java @@ -160,12 +160,12 @@ public class AiChatMessageServiceImpl implements AiChatMessageService { /** * 从历史消息中,获得倒序的 n 组消息作为消息上下文 - * + *

* n 组:指的是 user + assistant 形成一组 * - * @param messages 消息列表 + * @param messages 消息列表 * @param conversation 对话 - * @param sendReqVO 发送请求 + * @param sendReqVO 发送请求 * @return 消息上下文 */ private List filterContextMessages(List messages, @@ -182,7 +182,7 @@ public class AiChatMessageServiceImpl implements AiChatMessageService { } AiChatMessageDO userMessage = CollUtil.get(messages, i - 1); if (userMessage == null || ObjUtil.notEqual(assistantMessage.getReplyId(), userMessage.getId()) - || StrUtil.isEmpty(assistantMessage.getContent())) { + || StrUtil.isEmpty(assistantMessage.getContent())) { continue; } // 由于后续要 reverse 反转,所以先添加 assistantMessage diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/image/AiImageService.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/image/AiImageService.java index 716c7ea..2931762 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/image/AiImageService.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/image/AiImageService.java @@ -23,7 +23,7 @@ public interface AiImageService { /** * 获取【我的】绘图分页 * - * @param userId 用户编号 + * @param userId 用户编号 * @param pageReqVO 分页条件 * @return 绘图分页 */ @@ -48,7 +48,7 @@ public interface AiImageService { /** * 绘制图片 * - * @param userId 用户编号 + * @param userId 用户编号 * @param drawReqVO 绘制请求 * @return 绘画编号 */ @@ -57,7 +57,7 @@ public interface AiImageService { /** * 删除【我的】绘画记录 * - * @param id 绘画编号 + * @param id 绘画编号 * @param userId 用户编号 */ void deleteImageMy(Long id, Long userId); @@ -90,7 +90,7 @@ public interface AiImageService { * 【Midjourney】生成图片 * * @param userId 用户编号 - * @param reqVO 绘制请求 + * @param reqVO 绘制请求 * @return 绘画编号 */ Long midjourneyImagine(Long userId, AiMidjourneyImagineReqVO reqVO); @@ -113,7 +113,7 @@ public interface AiImageService { * 【Midjourney】Action 操作(放大、缩小、U1、U2...) * * @param userId 用户编号 - * @param reqVO 绘制请求 + * @param reqVO 绘制请求 * @return 绘画编号 */ Long midjourneyAction(Long userId, AiMidjourneyActionReqVO reqVO); diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/image/AiImageServiceImpl.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/image/AiImageServiceImpl.java index 3a8ff83..fef248d 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/image/AiImageServiceImpl.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/image/AiImageServiceImpl.java @@ -215,7 +215,7 @@ public class AiImageServiceImpl implements AiImageService { List base64Array = StrUtil.isBlank(reqVO.getReferImageUrl()) ? null : Collections.singletonList("data:image/jpeg;base64,".concat(Base64.encode(HttpUtil.downloadBytes(reqVO.getReferImageUrl())))); MidjourneyApi.ImagineRequest imagineRequest = new MidjourneyApi.ImagineRequest( - base64Array, reqVO.getPrompt(),null, + base64Array, reqVO.getPrompt(), null, MidjourneyApi.ImagineRequest.buildState(reqVO.getWidth(), reqVO.getHeight(), reqVO.getVersion(), reqVO.getModel())); MidjourneyApi.SubmitResponse imagineResponse = midjourneyApi.imagine(imagineRequest); diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/model/AiApiKeyService.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/model/AiApiKeyService.java index fe8fdd1..d5d84e1 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/model/AiApiKeyService.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/model/AiApiKeyService.java @@ -85,7 +85,7 @@ public interface AiApiKeyService { /** * 获得 ImageModel 对象 - * + *

* TODO 可优化点:目前默认获取 platform 对应的第一个开启的配置用于绘画;后续可以支持配置选择 * * @param platform 平台 @@ -95,7 +95,7 @@ public interface AiApiKeyService { /** * 获得 MidjourneyApi 对象 - * + *

* TODO 可优化点:目前默认获取 Midjourney 对应的第一个开启的配置用于绘画;后续可以支持配置选择 * * @return MidjourneyApi 对象 @@ -104,7 +104,7 @@ public interface AiApiKeyService { /** * 获得 SunoApi 对象 - * + *

* TODO 可优化点:目前默认获取 Suno 对应的第一个开启的配置用于音乐;后续可以支持配置选择 * * @return SunoApi 对象 diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/model/AiChatModelService.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/model/AiChatModelService.java index f83ac73..840ad9e 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/model/AiChatModelService.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/model/AiChatModelService.java @@ -51,7 +51,7 @@ public interface AiChatModelService { /** * 获得默认的聊天模型 - * + *

* 如果获取不到,则抛出 {@link cn.iocoder.yudao.framework.common.exception.ServiceException} 业务异常 * * @return 聊天模型 diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/model/AiChatRoleService.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/model/AiChatRoleService.java index 81c8d25..e7fecf6 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/model/AiChatRoleService.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/model/AiChatRoleService.java @@ -32,7 +32,7 @@ public interface AiChatRoleService { * 创建【我的】聊天角色 * * @param createReqVO 创建信息 - * @param userId 用户编号 + * @param userId 用户编号 * @return 编号 */ Long createChatRoleMy(AiChatRoleSaveMyReqVO createReqVO, Long userId); @@ -48,7 +48,7 @@ public interface AiChatRoleService { * 创建【我的】聊天角色 * * @param updateReqVO 更新信息 - * @param userId 用户编号 + * @param userId 用户编号 */ void updateChatRoleMy(AiChatRoleSaveMyReqVO updateReqVO, Long userId); @@ -62,7 +62,7 @@ public interface AiChatRoleService { /** * 删除【我的】聊天角色 * - * @param id 编号 + * @param id 编号 * @param userId 用户编号 */ void deleteChatRoleMy(Long id, Long userId); @@ -106,7 +106,7 @@ public interface AiChatRoleService { * 获得【我的】聊天角色分页 * * @param pageReqVO 分页查询 - * @param userId 用户编号 + * @param userId 用户编号 * @return 聊天角色分页 */ PageResult getChatRoleMyPage(AiChatRolePageReqVO pageReqVO, Long userId); diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/factory/AiModelFactory.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/factory/AiModelFactory.java index b6d7b3d..d91d447 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/factory/AiModelFactory.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/factory/AiModelFactory.java @@ -15,19 +15,19 @@ public interface AiModelFactory { /** * 基于指定配置,获得 ChatModel 对象 - * + *

* 如果不存在,则进行创建 * * @param platform 平台 - * @param apiKey API KEY - * @param url API URL + * @param apiKey API KEY + * @param url API URL * @return ChatModel 对象 */ ChatModel getOrCreateChatModel(AiPlatformEnum platform, String apiKey, String url); /** * 基于默认配置,获得 ChatModel 对象 - * + *

* 默认配置,指的是在 application.yaml 配置文件中的 spring.ai 相关的配置 * * @param platform 平台 @@ -37,7 +37,7 @@ public interface AiModelFactory { /** * 基于默认配置,获得 ImageModel 对象 - * + *

* 默认配置,指的是在 application.yaml 配置文件中的 spring.ai 相关的配置 * * @param platform 平台 @@ -47,34 +47,34 @@ public interface AiModelFactory { /** * 基于指定配置,获得 ImageModel 对象 - * + *

* 如果不存在,则进行创建 * * @param platform 平台 - * @param apiKey API KEY - * @param url API URL + * @param apiKey API KEY + * @param url API URL * @return ImageModel 对象 */ ImageModel getOrCreateImageModel(AiPlatformEnum platform, String apiKey, String url); /** * 基于指定配置,获得 MidjourneyApi 对象 - * + *

* 如果不存在,则进行创建 * * @param apiKey API KEY - * @param url API URL + * @param url API URL * @return MidjourneyApi 对象 */ MidjourneyApi getOrCreateMidjourneyApi(String apiKey, String url); /** * 基于指定配置,获得 SunoApi 对象 - * + *

* 如果不存在,则进行创建 * * @param apiKey API KEY - * @param url API URL + * @param url API URL * @return SunoApi 对象 */ SunoApi getOrCreateSunoApi(String apiKey, String url); diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/factory/AiModelFactoryImpl.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/factory/AiModelFactoryImpl.java index a5df282..7721e95 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/factory/AiModelFactoryImpl.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/factory/AiModelFactoryImpl.java @@ -230,7 +230,7 @@ public class AiModelFactoryImpl implements AiModelFactory { /** * 可参考 {@link ZhiPuAiAutoConfiguration#zhiPuAiChatModel( - * ZhiPuAiConnectionProperties, ZhiPuAiChatProperties, RestClient.Builder, List, FunctionCallbackContext, RetryTemplate, ResponseErrorHandler)} + *ZhiPuAiConnectionProperties, ZhiPuAiChatProperties, RestClient.Builder, List, FunctionCallbackContext, RetryTemplate, ResponseErrorHandler)} */ private ZhiPuAiChatModel buildZhiPuChatModel(String apiKey, String url) { url = StrUtil.blankToDefault(url, ZhiPuAiConnectionProperties.DEFAULT_BASE_URL); @@ -240,7 +240,7 @@ public class AiModelFactoryImpl implements AiModelFactory { /** * 可参考 {@link ZhiPuAiAutoConfiguration#zhiPuAiImageModel( - * ZhiPuAiConnectionProperties, ZhiPuAiImageProperties, RestClient.Builder, RetryTemplate, ResponseErrorHandler)} + *ZhiPuAiConnectionProperties, ZhiPuAiImageProperties, RestClient.Builder, RetryTemplate, ResponseErrorHandler)} */ private ZhiPuAiImageModel buildZhiPuAiImageModel(String apiKey, String url) { url = StrUtil.blankToDefault(url, ZhiPuAiConnectionProperties.DEFAULT_BASE_URL); diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/deepseek/DeepSeekChatModel.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/deepseek/DeepSeekChatModel.java index 1437404..e1d6881 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/deepseek/DeepSeekChatModel.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/deepseek/DeepSeekChatModel.java @@ -38,7 +38,7 @@ public class DeepSeekChatModel implements ChatModel { /** * DeepSeek 兼容 OpenAI 的 HTTP 接口,所以复用它的实现,简化接入成本 - * + *

* 不过要注意,DeepSeek 没有完全兼容,所以不能使用 {@link org.springframework.ai.openai.OpenAiChatModel} 调用,但是实现会参考它 */ private final OpenAiApi openAiApi; @@ -48,7 +48,7 @@ public class DeepSeekChatModel implements ChatModel { } public DeepSeekChatModel(String apiKey, DeepSeekChatOptions options) { - this(apiKey, options, RetryUtils.DEFAULT_RETRY_TEMPLATE); + this(apiKey, options, RetryUtils.DEFAULT_RETRY_TEMPLATE); } public DeepSeekChatModel(String apiKey, DeepSeekChatOptions options, RetryTemplate retryTemplate) { @@ -141,11 +141,11 @@ public class DeepSeekChatModel implements ChatModel { // 2.1 补充 prompt 内置的 options if (prompt.getOptions() != null) { - if (prompt.getOptions() instanceof ChatOptions runtimeOptions) { + if (prompt.getOptions() instanceof ChatOptions runtimeOptions){ OpenAiChatOptions updatedRuntimeOptions = ModelOptionsUtils.copyToTarget(runtimeOptions, ChatOptions.class, OpenAiChatOptions.class); request = ModelOptionsUtils.merge(updatedRuntimeOptions, request, OpenAiApi.ChatCompletionRequest.class); - } else { + } else{ throw new IllegalArgumentException("Prompt options are not of type ChatOptions: " + prompt.getOptions().getClass().getSimpleName()); } @@ -159,7 +159,7 @@ public class DeepSeekChatModel implements ChatModel { @Override public ChatOptions getDefaultOptions() { - return DeepSeekChatOptions.fromOptions(defaultOptions); + return DeepSeekChatOptions.fromOptions(defaultOptions); } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/deepseek/DeepSeekChatOptions.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/deepseek/DeepSeekChatOptions.java index e07e3f0..93cbc15 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/deepseek/DeepSeekChatOptions.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/deepseek/DeepSeekChatOptions.java @@ -8,7 +8,7 @@ import org.springframework.ai.chat.prompt.ChatOptions; /** * DeepSeek {@link ChatOptions} 实现类 - * + *

* 参考文档:快速开始 * * @author fansili diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/midjourney/api/MidjourneyApi.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/midjourney/api/MidjourneyApi.java index 55091c7..1a7e7fc 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/midjourney/api/MidjourneyApi.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/midjourney/api/MidjourneyApi.java @@ -172,10 +172,10 @@ public class MidjourneyApi { /** * Submit 统一返回 * - * @param code 状态码: 1(提交成功), 21(已存在), 22(排队中), other(错误) + * @param code 状态码: 1(提交成功), 21(已存在), 22(排队中), other(错误) * @param description 描述 - * @param properties 扩展字段 - * @param result 任务ID + * @param properties 扩展字段 + * @param result 任务ID */ public record SubmitResponse(String code, String description, @@ -186,20 +186,20 @@ public class MidjourneyApi { /** * 通知 request * - * @param id job id - * @param action 任务类型 {@link TaskActionEnum} - * @param status 任务状态 {@link TaskStatusEnum} - * @param prompt 提示词 - * @param promptEn 提示词-英文 + * @param id job id + * @param action 任务类型 {@link TaskActionEnum} + * @param status 任务状态 {@link TaskStatusEnum} + * @param prompt 提示词 + * @param promptEn 提示词-英文 * @param description 任务描述 - * @param state 自定义参数 - * @param submitTime 提交时间 - * @param startTime 开始执行时间 - * @param finishTime 结束时间 - * @param imageUrl 图片url - * @param progress 任务进度 - * @param failReason 失败原因 - * @param buttons 任务完成后的可执行按钮 + * @param state 自定义参数 + * @param submitTime 提交时间 + * @param startTime 开始执行时间 + * @param finishTime 结束时间 + * @param imageUrl 图片url + * @param progress 任务进度 + * @param failReason 失败原因 + * @param buttons 任务完成后的可执行按钮 */ public record Notify(String id, String action, @@ -226,10 +226,10 @@ public class MidjourneyApi { * button * * @param customId MJ::JOB::upsample::1::85a4b4c1-8835-46c5-a15c-aea34fad1862 动作标识 - * @param emoji 图标 emoji - * @param label Make Variations 文本 - * @param type 类型,系统内部使用 - * @param style 样式: 2(Primary)、3(Green) + * @param emoji 图标 emoji + * @param label Make Variations 文本 + * @param type 类型,系统内部使用 + * @param style 样式: 2(Primary)、3(Green) */ public record Button(String customId, String emoji, diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/suno/api/SunoApi.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/suno/api/SunoApi.java index 81cc654..158a07f 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/suno/api/SunoApi.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/suno/api/SunoApi.java @@ -125,7 +125,7 @@ public class SunoApi { this(prompt, null, null, null, false, false); } - public MusicGenerateRequest(String prompt, String model, boolean makeInstrumental) { + public MusicGenerateRequest(String prompt, String model, boolean makeInstrumental){ this(prompt, null, null, model, false, makeInstrumental); } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/xinghuo/XingHuoChatModel.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/xinghuo/XingHuoChatModel.java index 60284bf..d056ed3 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/xinghuo/XingHuoChatModel.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/xinghuo/XingHuoChatModel.java @@ -38,7 +38,7 @@ public class XingHuoChatModel implements ChatModel { /** * 星火兼容 OpenAI 的 HTTP 接口,所以复用它的实现,简化接入成本 - * + *

* 不过要注意,星火没有完全兼容,所以不能使用 {@link org.springframework.ai.openai.OpenAiChatModel} 调用,但是实现会参考它 */ private final OpenAiApi openAiApi; @@ -49,7 +49,7 @@ public class XingHuoChatModel implements ChatModel { } public XingHuoChatModel(String apiKey, String secretKey, XingHuoChatOptions options) { - this(apiKey, secretKey, options, RetryUtils.DEFAULT_RETRY_TEMPLATE); + this(apiKey, secretKey, options, RetryUtils.DEFAULT_RETRY_TEMPLATE); } public XingHuoChatModel(String apiKey, String secretKey, XingHuoChatOptions options, RetryTemplate retryTemplate) { @@ -138,11 +138,11 @@ public class XingHuoChatModel implements ChatModel { // 2.1 补充 prompt 内置的 options if (prompt.getOptions() != null) { - if (prompt.getOptions() instanceof ChatOptions runtimeOptions) { + if (prompt.getOptions() instanceof ChatOptions runtimeOptions){ OpenAiChatOptions updatedRuntimeOptions = ModelOptionsUtils.copyToTarget(runtimeOptions, ChatOptions.class, OpenAiChatOptions.class); request = ModelOptionsUtils.merge(updatedRuntimeOptions, request, OpenAiApi.ChatCompletionRequest.class); - } else { + } else{ throw new IllegalArgumentException("Prompt options are not of type ChatOptions: " + prompt.getOptions().getClass().getSimpleName()); } @@ -156,7 +156,7 @@ public class XingHuoChatModel implements ChatModel { @Override public ChatOptions getDefaultOptions() { - return XingHuoChatOptions.fromOptions(defaultOptions); + return XingHuoChatOptions.fromOptions(defaultOptions); } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/xinghuo/XingHuoChatOptions.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/xinghuo/XingHuoChatOptions.java index e3287b6..7e3abe5 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/xinghuo/XingHuoChatOptions.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/xinghuo/XingHuoChatOptions.java @@ -8,7 +8,7 @@ import org.springframework.ai.chat.prompt.ChatOptions; /** * 讯飞星火 {@link ChatOptions} 实现类 - * + *

* 参考文档:HTTP 调用 * * @author fansili diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/package-info.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/package-info.java index b02d1b3..94d069c 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/package-info.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/package-info.java @@ -1,10 +1,10 @@ /** * AI 大模型组件,基于 Spring AI 拓展 - * + *

* models 包路径: - * 1. xinghuo 包:【讯飞】星火,自己实现 - * 2. deepseek 包:【深度求索】DeepSeek,自己实现 - * 3. midjourney 包:Midjourney API,对接 https://github.com/novicezk/midjourney-proxy 实现 - * 4. suno 包:Suno API,对接 https://github.com/gcui-art/suno-api 实现 + * 1. xinghuo 包:【讯飞】星火,自己实现 + * 2. deepseek 包:【深度求索】DeepSeek,自己实现 + * 3. midjourney 包:Midjourney API,对接 https://github.com/novicezk/midjourney-proxy 实现 + * 4. suno 包:Suno API,对接 https://github.com/gcui-art/suno-api 实现 */ package cn.iocoder.yudao.framework.ai; \ No newline at end of file diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/TongYiAutoConfiguration.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/TongYiAutoConfiguration.java index 1add717..5ead7e9 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/TongYiAutoConfiguration.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/TongYiAutoConfiguration.java @@ -57,197 +57,196 @@ import java.util.Objects; @AutoConfiguration @ConditionalOnClass({ - MessageManager.class, - TongYiChatModel.class, - TongYiImagesModel.class, - TongYiAudioSpeechModel.class, - TongYiTextEmbeddingModel.class, - TongYiAudioTranscriptionModel.class + MessageManager.class, + TongYiChatModel.class, + TongYiImagesModel.class, + TongYiAudioSpeechModel.class, + TongYiTextEmbeddingModel.class, + TongYiAudioTranscriptionModel.class }) @EnableConfigurationProperties({ - TongYiChatProperties.class, - TongYiImagesProperties.class, - TongYiAudioSpeechProperties.class, - TongYiConnectionProperties.class, - TongYiTextEmbeddingProperties.class, - TongYiAudioTranscriptionProperties.class + TongYiChatProperties.class, + TongYiImagesProperties.class, + TongYiAudioSpeechProperties.class, + TongYiConnectionProperties.class, + TongYiTextEmbeddingProperties.class, + TongYiAudioTranscriptionProperties.class }) public class TongYiAutoConfiguration { - @Bean - @Scope("prototype") - @ConditionalOnMissingBean - public Generation generation() { + @Bean + @Scope("prototype") + @ConditionalOnMissingBean + public Generation generation() { - return new Generation(); - } + return new Generation(); + } - @Bean - @Scope("prototype") - @ConditionalOnMissingBean - public MessageManager msgManager() { + @Bean + @Scope("prototype") + @ConditionalOnMissingBean + public MessageManager msgManager() { - return new MessageManager(10); - } + return new MessageManager(10); + } - @Bean - @Scope("prototype") - @ConditionalOnMissingBean - public ImageSynthesis imageSynthesis() { + @Bean + @Scope("prototype") + @ConditionalOnMissingBean + public ImageSynthesis imageSynthesis() { - return new ImageSynthesis(); - } + return new ImageSynthesis(); + } - @Bean - @Scope("prototype") - @ConditionalOnMissingBean - public SpeechSynthesizer speechSynthesizer() { + @Bean + @Scope("prototype") + @ConditionalOnMissingBean + public SpeechSynthesizer speechSynthesizer() { - return new SpeechSynthesizer(); - } + return new SpeechSynthesizer(); + } - @Bean - @ConditionalOnMissingBean - public Transcription transcription() { + @Bean + @ConditionalOnMissingBean + public Transcription transcription() { - return new Transcription(); - } + return new Transcription(); + } - @Bean - @ConditionalOnMissingBean - public TextEmbedding textEmbedding() { + @Bean + @ConditionalOnMissingBean + public TextEmbedding textEmbedding() { - return new TextEmbedding(); - } + return new TextEmbedding(); + } - @Bean - @ConditionalOnMissingBean - public FunctionCallbackContext springAiFunctionManager(ApplicationContext context) { + @Bean + @ConditionalOnMissingBean + public FunctionCallbackContext springAiFunctionManager(ApplicationContext context) { - FunctionCallbackContext manager = new FunctionCallbackContext(); - manager.setApplicationContext(context); + FunctionCallbackContext manager = new FunctionCallbackContext(); + manager.setApplicationContext(context); - return manager; - } + return manager; + } - @Bean - @ConditionalOnProperty( - prefix = TongYiChatProperties.CONFIG_PREFIX, - name = "enabled", - havingValue = "true", - matchIfMissing = true - ) - public TongYiChatModel tongYiChatClient(Generation generation, - TongYiChatProperties chatOptions, - TongYiConnectionProperties connectionProperties - ) { + @Bean + @ConditionalOnProperty( + prefix = TongYiChatProperties.CONFIG_PREFIX, + name = "enabled", + havingValue = "true", + matchIfMissing = true + ) + public TongYiChatModel tongYiChatClient(Generation generation, + TongYiChatProperties chatOptions, + TongYiConnectionProperties connectionProperties + ) { - settingApiKey(connectionProperties); + settingApiKey(connectionProperties); - return new TongYiChatModel(generation, chatOptions.getOptions()); - } + return new TongYiChatModel(generation, chatOptions.getOptions()); + } - @Bean - @ConditionalOnProperty( - prefix = TongYiImagesProperties.CONFIG_PREFIX, - name = "enabled", - havingValue = "true", - matchIfMissing = true - ) - public TongYiImagesModel tongYiImagesClient( - ImageSynthesis imageSynthesis, - TongYiImagesProperties imagesOptions, - TongYiConnectionProperties connectionProperties - ) { + @Bean + @ConditionalOnProperty( + prefix = TongYiImagesProperties.CONFIG_PREFIX, + name = "enabled", + havingValue = "true", + matchIfMissing = true + ) + public TongYiImagesModel tongYiImagesClient( + ImageSynthesis imageSynthesis, + TongYiImagesProperties imagesOptions, + TongYiConnectionProperties connectionProperties + ) { - settingApiKey(connectionProperties); + settingApiKey(connectionProperties); - return new TongYiImagesModel(imageSynthesis, imagesOptions.getOptions()); - } + return new TongYiImagesModel(imageSynthesis, imagesOptions.getOptions()); + } - @Bean - @ConditionalOnProperty( - prefix = TongYiAudioSpeechProperties.CONFIG_PREFIX, - name = "enabled", - havingValue = "true", - matchIfMissing = true - ) - public TongYiAudioSpeechModel tongYiAudioSpeechClient( - SpeechSynthesizer speechSynthesizer, - TongYiAudioSpeechProperties speechProperties, - TongYiConnectionProperties connectionProperties - ) { + @Bean + @ConditionalOnProperty( + prefix = TongYiAudioSpeechProperties.CONFIG_PREFIX, + name = "enabled", + havingValue = "true", + matchIfMissing = true + ) + public TongYiAudioSpeechModel tongYiAudioSpeechClient( + SpeechSynthesizer speechSynthesizer, + TongYiAudioSpeechProperties speechProperties, + TongYiConnectionProperties connectionProperties + ) { - settingApiKey(connectionProperties); + settingApiKey(connectionProperties); - return new TongYiAudioSpeechModel(speechSynthesizer, speechProperties.getOptions()); - } + return new TongYiAudioSpeechModel(speechSynthesizer, speechProperties.getOptions()); + } - @Bean - @ConditionalOnProperty( - prefix = TongYiAudioTranscriptionProperties.CONFIG_PREFIX, - name = "enabled", - havingValue = "true", - matchIfMissing = true - ) - public TongYiAudioTranscriptionModel tongYiAudioTranscriptionClient( - Transcription transcription, - TongYiAudioTranscriptionProperties transcriptionProperties, - TongYiConnectionProperties connectionProperties) { + @Bean + @ConditionalOnProperty( + prefix = TongYiAudioTranscriptionProperties.CONFIG_PREFIX, + name = "enabled", + havingValue = "true", + matchIfMissing = true + ) + public TongYiAudioTranscriptionModel tongYiAudioTranscriptionClient( + Transcription transcription, + TongYiAudioTranscriptionProperties transcriptionProperties, + TongYiConnectionProperties connectionProperties) { - settingApiKey(connectionProperties); + settingApiKey(connectionProperties); - return new TongYiAudioTranscriptionModel( - transcriptionProperties.getOptions(), - transcription - ); - } + return new TongYiAudioTranscriptionModel( + transcriptionProperties.getOptions(), + transcription + ); + } - @Bean - @ConditionalOnProperty( - prefix = TongYiTextEmbeddingProperties.CONFIG_PREFIX, - name = "enabled", - havingValue = "true", - matchIfMissing = true - ) - public TongYiTextEmbeddingModel tongYiTextEmbeddingClient( - TextEmbedding textEmbedding, - TongYiConnectionProperties connectionProperties - ) { + @Bean + @ConditionalOnProperty( + prefix = TongYiTextEmbeddingProperties.CONFIG_PREFIX, + name = "enabled", + havingValue = "true", + matchIfMissing = true + ) + public TongYiTextEmbeddingModel tongYiTextEmbeddingClient( + TextEmbedding textEmbedding, + TongYiConnectionProperties connectionProperties + ) { - settingApiKey(connectionProperties); - return new TongYiTextEmbeddingModel(textEmbedding); - } + settingApiKey(connectionProperties); + return new TongYiTextEmbeddingModel(textEmbedding); + } - /** - * Setting the API key. - * @param connectionProperties {@link TongYiConnectionProperties} - */ - private void settingApiKey(TongYiConnectionProperties connectionProperties) { + /** + * Setting the API key. + * + * @param connectionProperties {@link TongYiConnectionProperties} + */ + private void settingApiKey(TongYiConnectionProperties connectionProperties) { - String apiKey; + String apiKey; - try { - // It is recommended to set the key by defining the api-key in an environment variable. - var envKey = System.getenv(TongYiConstants.SCA_AI_TONGYI_API_KEY); - if (Objects.nonNull(envKey)) { - Constants.apiKey = envKey; - return; - } - if (Objects.nonNull(connectionProperties.getApiKey())) { - apiKey = connectionProperties.getApiKey(); - } - else { - apiKey = ApiKey.getApiKey(null); - } + try { + // It is recommended to set the key by defining the api-key in an environment variable. + var envKey = System.getenv(TongYiConstants.SCA_AI_TONGYI_API_KEY); + if (Objects.nonNull(envKey)) { + Constants.apiKey = envKey; + return; + } + if (Objects.nonNull(connectionProperties.getApiKey())) { + apiKey = connectionProperties.getApiKey(); + } else { + apiKey = ApiKey.getApiKey(null); + } - Constants.apiKey = apiKey; - } - catch (NoApiKeyException e) { + Constants.apiKey = apiKey; + } catch (NoApiKeyException e) { - throw new TongYiException(e.getMessage()); - } + throw new TongYiException(e.getMessage()); + } - } + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/TongYiConnectionProperties.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/TongYiConnectionProperties.java index 74141bd..30ab68d 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/TongYiConnectionProperties.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/TongYiConnectionProperties.java @@ -31,22 +31,22 @@ import static com.alibaba.cloud.ai.tongyi.common.constants.TongYiConstants.SCA_A @ConfigurationProperties(TongYiConnectionProperties.CONFIG_PREFIX) public class TongYiConnectionProperties { - /** - * Spring Cloud Alibaba AI connection configuration Prefix. - */ - public static final String CONFIG_PREFIX = SCA_AI_CONFIGURATION + "tongyi"; + /** + * Spring Cloud Alibaba AI connection configuration Prefix. + */ + public static final String CONFIG_PREFIX = SCA_AI_CONFIGURATION + "tongyi"; - /** - * TongYi LLM API key. - */ - private String apiKey; + /** + * TongYi LLM API key. + */ + private String apiKey; - public String getApiKey() { - return apiKey; - } + public String getApiKey() { + return apiKey; + } - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/AudioSpeechModels.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/AudioSpeechModels.java index 2c8bd70..8d77549 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/AudioSpeechModels.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/AudioSpeechModels.java @@ -27,14 +27,14 @@ package com.alibaba.cloud.ai.tongyi.audio; public final class AudioSpeechModels { - private AudioSpeechModels() { - } + private AudioSpeechModels() { + } - /** - * Male Voice of the Tongue(舌尖男声). - * zh & en. - * Default sample rate: 48 Hz. - */ - public static final String SAMBERT_ZHICHU_V1 = "sambert-zhichu-v1"; + /** + * Male Voice of the Tongue(舌尖男声). + * zh & en. + * Default sample rate: 48 Hz. + */ + public static final String SAMBERT_ZHICHU_V1 = "sambert-zhichu-v1"; } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/AudioTranscriptionModels.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/AudioTranscriptionModels.java index 4b84356..41b6279 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/AudioTranscriptionModels.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/AudioTranscriptionModels.java @@ -24,20 +24,20 @@ package com.alibaba.cloud.ai.tongyi.audio; public final class AudioTranscriptionModels { - private AudioTranscriptionModels() { - } + private AudioTranscriptionModels() { + } - /** - * Paraformer Chinese and English speech recognition model supports audio or video speech recognition with a sampling rate of 16kHz or above. - */ - public static final String Paraformer_V1 = "paraformer-v1"; - /** - * Paraformer Chinese speech recognition model, support 8kHz telephone speech recognition. - */ - public static final String Paraformer_8K_V1 = "paraformer-8k-v1"; - /** - * The Paraformer multilingual speech recognition model supports audio or video speech recognition with a sample rate of 16kHz or above. - */ - public static final String Paraformer_MTL_V1 = "paraformer-mtl-v1"; + /** + * Paraformer Chinese and English speech recognition model supports audio or video speech recognition with a sampling rate of 16kHz or above. + */ + public static final String Paraformer_V1 = "paraformer-v1"; + /** + * Paraformer Chinese speech recognition model, support 8kHz telephone speech recognition. + */ + public static final String Paraformer_8K_V1 = "paraformer-8k-v1"; + /** + * The Paraformer multilingual speech recognition model supports audio or video speech recognition with a sample rate of 16kHz or above. + */ + public static final String Paraformer_MTL_V1 = "paraformer-mtl-v1"; } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/TongYiAudioSpeechModel.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/TongYiAudioSpeechModel.java index f450042..932f320 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/TongYiAudioSpeechModel.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/TongYiAudioSpeechModel.java @@ -42,187 +42,194 @@ import java.nio.ByteBuffer; public class TongYiAudioSpeechModel implements SpeechModel, SpeechStreamModel { - private final Logger logger = LoggerFactory.getLogger(getClass()); + private final Logger logger = LoggerFactory.getLogger(getClass()); - /** - * Default speed rate. - */ - private static final float SPEED_RATE = 1.0f; + /** + * Default speed rate. + */ + private static final float SPEED_RATE = 1.0f; - /** - * TongYi models api. - */ - private final SpeechSynthesizer speechSynthesizer; + /** + * TongYi models api. + */ + private final SpeechSynthesizer speechSynthesizer; - /** - * TongYi models options. - */ - private final TongYiAudioSpeechOptions defaultOptions; + /** + * TongYi models options. + */ + private final TongYiAudioSpeechOptions defaultOptions; - /** - * TongYiAudioSpeechClient constructor. - * @param speechSynthesizer the speech synthesizer - */ - public TongYiAudioSpeechModel(SpeechSynthesizer speechSynthesizer) { + /** + * TongYiAudioSpeechClient constructor. + * + * @param speechSynthesizer the speech synthesizer + */ + public TongYiAudioSpeechModel(SpeechSynthesizer speechSynthesizer) { - this(speechSynthesizer, null); - } + this(speechSynthesizer, null); + } - /** - * TongYiAudioSpeechClient constructor. - * @param speechSynthesizer the speech synthesizer - * @param tongYiAudioOptions the tongYi audio options - */ - public TongYiAudioSpeechModel(SpeechSynthesizer speechSynthesizer, TongYiAudioSpeechOptions tongYiAudioOptions) { + /** + * TongYiAudioSpeechClient constructor. + * + * @param speechSynthesizer the speech synthesizer + * @param tongYiAudioOptions the tongYi audio options + */ + public TongYiAudioSpeechModel(SpeechSynthesizer speechSynthesizer, TongYiAudioSpeechOptions tongYiAudioOptions) { - Assert.notNull(speechSynthesizer, "speechSynthesizer must not be null"); - Assert.notNull(tongYiAudioOptions, "tongYiAudioOptions must not be null"); + Assert.notNull(speechSynthesizer, "speechSynthesizer must not be null"); + Assert.notNull(tongYiAudioOptions, "tongYiAudioOptions must not be null"); - this.speechSynthesizer = speechSynthesizer; - this.defaultOptions = tongYiAudioOptions; - } + this.speechSynthesizer = speechSynthesizer; + this.defaultOptions = tongYiAudioOptions; + } - /** - * Call the TongYi audio speech service. - * @param text the text message to be converted to audio. - * @return the audio byte buffer. - */ - @Override - public ByteBuffer call(String text) { + /** + * Call the TongYi audio speech service. + * + * @param text the text message to be converted to audio. + * @return the audio byte buffer. + */ + @Override + public ByteBuffer call(String text) { - var speechRequest = new SpeechPrompt(text); + var speechRequest = new SpeechPrompt(text); - return call(speechRequest).getResult().getOutput(); - } + return call(speechRequest).getResult().getOutput(); + } - /** - * Call the TongYi audio speech service. - * @param prompt the speech prompt. - * @return the speech response. - */ - @Override - public SpeechResponse call(SpeechPrompt prompt) { + /** + * Call the TongYi audio speech service. + * + * @param prompt the speech prompt. + * @return the speech response. + */ + @Override + public SpeechResponse call(SpeechPrompt prompt) { - var SCASpeechParam = merge(prompt.getOptions()); - var speechSynthesisParams = toSpeechSynthesisParams(SCASpeechParam); - speechSynthesisParams.setText(prompt.getInstructions().getText()); - logger.info(speechSynthesisParams.toString()); + var SCASpeechParam = merge(prompt.getOptions()); + var speechSynthesisParams = toSpeechSynthesisParams(SCASpeechParam); + speechSynthesisParams.setText(prompt.getInstructions().getText()); + logger.info(speechSynthesisParams.toString()); - var res = speechSynthesizer.call(speechSynthesisParams); + var res = speechSynthesizer.call(speechSynthesisParams); - return convert(res, null); - } + return convert(res, null); + } - /** - * Call the TongYi audio speech service. - * @param prompt the speech prompt. - * @param callback the result callback. - * {@link SpeechSynthesizer#call(SpeechSynthesisParam, ResultCallback)} - */ - public void call(SpeechPrompt prompt, ResultCallback callback) { + /** + * Call the TongYi audio speech service. + * + * @param prompt the speech prompt. + * @param callback the result callback. + * {@link SpeechSynthesizer#call(SpeechSynthesisParam, ResultCallback)} + */ + public void call(SpeechPrompt prompt, ResultCallback callback) { - var SCASpeechParam = merge(prompt.getOptions()); - var speechSynthesisParams = toSpeechSynthesisParams(SCASpeechParam); - speechSynthesisParams.setText(prompt.getInstructions().getText()); + var SCASpeechParam = merge(prompt.getOptions()); + var speechSynthesisParams = toSpeechSynthesisParams(SCASpeechParam); + speechSynthesisParams.setText(prompt.getInstructions().getText()); - speechSynthesizer.call(speechSynthesisParams, callback); - } + speechSynthesizer.call(speechSynthesisParams, callback); + } - /** - * Stream the TongYi audio speech service. - * @param prompt the speech prompt. - * @return the speech response. - * {@link SpeechSynthesizer#streamCall(SpeechSynthesisParam)} - */ - @Override - public Flux stream(SpeechPrompt prompt) { + /** + * Stream the TongYi audio speech service. + * + * @param prompt the speech prompt. + * @return the speech response. + * {@link SpeechSynthesizer#streamCall(SpeechSynthesisParam)} + */ + @Override + public Flux stream(SpeechPrompt prompt) { - var SCASpeechParam = merge(prompt.getOptions()); + var SCASpeechParam = merge(prompt.getOptions()); - Flowable resultFlowable = speechSynthesizer - .streamCall(toSpeechSynthesisParams(SCASpeechParam)); + Flowable resultFlowable = speechSynthesizer + .streamCall(toSpeechSynthesisParams(SCASpeechParam)); - return Flux.from(resultFlowable) - .flatMap( - res -> Flux.just(res.getAudioFrame()) - .map(audio -> { - var speech = new Speech(audio); - var respMetadata = TongYiAudioSpeechResponseMetadata.from(res); - return new SpeechResponse(speech, respMetadata); - }) - ).publishOn(Schedulers.parallel()); - } + return Flux.from(resultFlowable) + .flatMap( + res -> Flux.just(res.getAudioFrame()) + .map(audio -> { + var speech = new Speech(audio); + var respMetadata = TongYiAudioSpeechResponseMetadata.from(res); + return new SpeechResponse(speech, respMetadata); + }) + ).publishOn(Schedulers.parallel()); + } - public TongYiAudioSpeechOptions merge(TongYiAudioSpeechOptions target) { + public TongYiAudioSpeechOptions merge(TongYiAudioSpeechOptions target) { - var mergeBuilder = TongYiAudioSpeechOptions.builder(); + var mergeBuilder = TongYiAudioSpeechOptions.builder(); - mergeBuilder.withModel(defaultOptions.getModel() != null ? defaultOptions.getModel() : target.getModel()); - mergeBuilder.withPitch(defaultOptions.getPitch() != null ? defaultOptions.getPitch() : target.getPitch()); - mergeBuilder.withRate(defaultOptions.getRate() != null ? defaultOptions.getRate() : target.getRate()); - mergeBuilder.withFormat(defaultOptions.getFormat() != null ? defaultOptions.getFormat() : target.getFormat()); - mergeBuilder.withSampleRate(defaultOptions.getSampleRate() != null ? defaultOptions.getSampleRate() : target.getSampleRate()); - mergeBuilder.withTextType(defaultOptions.getTextType() != null ? defaultOptions.getTextType() : target.getTextType()); - mergeBuilder.withVolume(defaultOptions.getVolume() != null ? defaultOptions.getVolume() : target.getVolume()); - mergeBuilder.withEnablePhonemeTimestamp(defaultOptions.isEnablePhonemeTimestamp() != null ? defaultOptions.isEnablePhonemeTimestamp() : target.isEnablePhonemeTimestamp()); - mergeBuilder.withEnableWordTimestamp(defaultOptions.isEnableWordTimestamp() != null ? defaultOptions.isEnableWordTimestamp() : target.isEnableWordTimestamp()); + mergeBuilder.withModel(defaultOptions.getModel() != null ? defaultOptions.getModel() : target.getModel()); + mergeBuilder.withPitch(defaultOptions.getPitch() != null ? defaultOptions.getPitch() : target.getPitch()); + mergeBuilder.withRate(defaultOptions.getRate() != null ? defaultOptions.getRate() : target.getRate()); + mergeBuilder.withFormat(defaultOptions.getFormat() != null ? defaultOptions.getFormat() : target.getFormat()); + mergeBuilder.withSampleRate(defaultOptions.getSampleRate() != null ? defaultOptions.getSampleRate() : target.getSampleRate()); + mergeBuilder.withTextType(defaultOptions.getTextType() != null ? defaultOptions.getTextType() : target.getTextType()); + mergeBuilder.withVolume(defaultOptions.getVolume() != null ? defaultOptions.getVolume() : target.getVolume()); + mergeBuilder.withEnablePhonemeTimestamp(defaultOptions.isEnablePhonemeTimestamp() != null ? defaultOptions.isEnablePhonemeTimestamp() : target.isEnablePhonemeTimestamp()); + mergeBuilder.withEnableWordTimestamp(defaultOptions.isEnableWordTimestamp() != null ? defaultOptions.isEnableWordTimestamp() : target.isEnableWordTimestamp()); - return mergeBuilder.build(); - } + return mergeBuilder.build(); + } - public SpeechSynthesisParam toSpeechSynthesisParams(TongYiAudioSpeechOptions source) { + public SpeechSynthesisParam toSpeechSynthesisParams(TongYiAudioSpeechOptions source) { - var mergeBuilder = SpeechSynthesisParam.builder(); + var mergeBuilder = SpeechSynthesisParam.builder(); - mergeBuilder.model(source.getModel() != null ? source.getModel() : AudioSpeechModels.SAMBERT_ZHICHU_V1); - mergeBuilder.text(source.getText() != null ? source.getText() : ""); + mergeBuilder.model(source.getModel() != null ? source.getModel() : AudioSpeechModels.SAMBERT_ZHICHU_V1); + mergeBuilder.text(source.getText() != null ? source.getText() : ""); - if (source.getFormat() != null) { - mergeBuilder.format(source.getFormat()); - } - if (source.getRate() != null) { - mergeBuilder.rate(source.getRate()); - } - if (source.getPitch() != null) { - mergeBuilder.pitch(source.getPitch()); - } - if (source.getTextType() != null) { - mergeBuilder.textType(source.getTextType()); - } - if (source.getSampleRate() != null) { - mergeBuilder.sampleRate(source.getSampleRate()); - } - if (source.isEnablePhonemeTimestamp() != null) { - mergeBuilder.enablePhonemeTimestamp(source.isEnablePhonemeTimestamp()); - } - if (source.isEnableWordTimestamp() != null) { - mergeBuilder.enableWordTimestamp(source.isEnableWordTimestamp()); - } - if (source.getVolume() != null) { - mergeBuilder.volume(source.getVolume()); - } + if (source.getFormat() != null) { + mergeBuilder.format(source.getFormat()); + } + if (source.getRate() != null) { + mergeBuilder.rate(source.getRate()); + } + if (source.getPitch() != null) { + mergeBuilder.pitch(source.getPitch()); + } + if (source.getTextType() != null) { + mergeBuilder.textType(source.getTextType()); + } + if (source.getSampleRate() != null) { + mergeBuilder.sampleRate(source.getSampleRate()); + } + if (source.isEnablePhonemeTimestamp() != null) { + mergeBuilder.enablePhonemeTimestamp(source.isEnablePhonemeTimestamp()); + } + if (source.isEnableWordTimestamp() != null) { + mergeBuilder.enableWordTimestamp(source.isEnableWordTimestamp()); + } + if (source.getVolume() != null) { + mergeBuilder.volume(source.getVolume()); + } - return mergeBuilder.build(); - } + return mergeBuilder.build(); + } - /** - * Convert the TongYi audio speech service result to the speech response. - * @param result the audio byte buffer. - * @param synthesisResult the synthesis result. - * @return the speech response. - */ - private SpeechResponse convert(ByteBuffer result, SpeechSynthesisResult synthesisResult) { + /** + * Convert the TongYi audio speech service result to the speech response. + * + * @param result the audio byte buffer. + * @param synthesisResult the synthesis result. + * @return the speech response. + */ + private SpeechResponse convert(ByteBuffer result, SpeechSynthesisResult synthesisResult) { - if (synthesisResult == null) { + if (synthesisResult == null) { - return new SpeechResponse(new Speech(result)); - } + return new SpeechResponse(new Speech(result)); + } - var responseMetadata = TongYiAudioSpeechResponseMetadata.from(synthesisResult); - var speech = new Speech(synthesisResult.getAudioFrame()); + var responseMetadata = TongYiAudioSpeechResponseMetadata.from(synthesisResult); + var speech = new Speech(synthesisResult.getAudioFrame()); - return new SpeechResponse(speech, responseMetadata); - } + return new SpeechResponse(speech, responseMetadata); + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/TongYiAudioSpeechOptions.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/TongYiAudioSpeechOptions.java index 09f188f..0756e8c 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/TongYiAudioSpeechOptions.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/TongYiAudioSpeechOptions.java @@ -30,232 +30,232 @@ import org.springframework.ai.model.ModelOptions; public class TongYiAudioSpeechOptions implements ModelOptions { - /** - * Audio Speech models. - */ - private String model = AudioSpeechModels.SAMBERT_ZHICHU_V1; + /** + * Audio Speech models. + */ + private String model = AudioSpeechModels.SAMBERT_ZHICHU_V1; - /** - * Text content. - */ - private String text; + /** + * Text content. + */ + private String text; - /** - * Input text type. - */ - private SpeechSynthesisTextType textType = SpeechSynthesisTextType.PLAIN_TEXT; + /** + * Input text type. + */ + private SpeechSynthesisTextType textType = SpeechSynthesisTextType.PLAIN_TEXT; - /** - * synthesis audio format. - */ - private SpeechSynthesisAudioFormat format = SpeechSynthesisAudioFormat.WAV; + /** + * synthesis audio format. + */ + private SpeechSynthesisAudioFormat format = SpeechSynthesisAudioFormat.WAV; - /** - * synthesis audio sample rate. - */ - private Integer sampleRate = 16000; + /** + * synthesis audio sample rate. + */ + private Integer sampleRate = 16000; - /** - * synthesis audio volume. - */ - private Integer volume = 50; + /** + * synthesis audio volume. + */ + private Integer volume = 50; - /** - * synthesis audio speed. - */ - private Float rate = 1.0f; + /** + * synthesis audio speed. + */ + private Float rate = 1.0f; - /** - * synthesis audio pitch. - */ - private Float pitch = 1.0f; + /** + * synthesis audio pitch. + */ + private Float pitch = 1.0f; - /** - * enable word level timestamp. - */ - private Boolean enableWordTimestamp = false; + /** + * enable word level timestamp. + */ + private Boolean enableWordTimestamp = false; - /** - * enable phoneme level timestamp. - */ - private Boolean enablePhonemeTimestamp = false; + /** + * enable phoneme level timestamp. + */ + private Boolean enablePhonemeTimestamp = false; - public static Builder builder() { - return new Builder(); - } + public static Builder builder() { + return new Builder(); + } - public String getModel() { + public String getModel() { - return model; - } + return model; + } - public void setModel(String model) { + public void setModel(String model) { - this.model = model; - } + this.model = model; + } - public String getText() { + public String getText() { - return text; - } + return text; + } - public void setText(String text) { + public void setText(String text) { - this.text = text; - } + this.text = text; + } - public SpeechSynthesisTextType getTextType() { + public SpeechSynthesisTextType getTextType() { - return textType; - } + return textType; + } - public void setTextType(SpeechSynthesisTextType textType) { + public void setTextType(SpeechSynthesisTextType textType) { - this.textType = textType; - } + this.textType = textType; + } - public SpeechSynthesisAudioFormat getFormat() { + public SpeechSynthesisAudioFormat getFormat() { - return format; - } + return format; + } - public void setFormat(SpeechSynthesisAudioFormat format) { + public void setFormat(SpeechSynthesisAudioFormat format) { - this.format = format; - } + this.format = format; + } - public Integer getSampleRate() { + public Integer getSampleRate() { - return sampleRate; - } + return sampleRate; + } - public void setSampleRate(Integer sampleRate) { + public void setSampleRate(Integer sampleRate) { - this.sampleRate = sampleRate; - } + this.sampleRate = sampleRate; + } - public Integer getVolume() { + public Integer getVolume() { - return volume; - } + return volume; + } - public void setVolume(Integer volume) { + public void setVolume(Integer volume) { - this.volume = volume; - } + this.volume = volume; + } - public Float getRate() { + public Float getRate() { - return rate; - } + return rate; + } - public void setRate(Float rate) { + public void setRate(Float rate) { - this.rate = rate; - } + this.rate = rate; + } - public Float getPitch() { + public Float getPitch() { - return pitch; - } + return pitch; + } - public void setPitch(Float pitch) { + public void setPitch(Float pitch) { - this.pitch = pitch; - } + this.pitch = pitch; + } - public Boolean isEnableWordTimestamp() { + public Boolean isEnableWordTimestamp() { - return enableWordTimestamp; - } + return enableWordTimestamp; + } - public void setEnableWordTimestamp(Boolean enableWordTimestamp) { + public void setEnableWordTimestamp(Boolean enableWordTimestamp) { - this.enableWordTimestamp = enableWordTimestamp; - } + this.enableWordTimestamp = enableWordTimestamp; + } - public Boolean isEnablePhonemeTimestamp() { + public Boolean isEnablePhonemeTimestamp() { - return enablePhonemeTimestamp; - } + return enablePhonemeTimestamp; + } - public void setEnablePhonemeTimestamp(Boolean enablePhonemeTimestamp) { + public void setEnablePhonemeTimestamp(Boolean enablePhonemeTimestamp) { - this.enablePhonemeTimestamp = enablePhonemeTimestamp; - } + this.enablePhonemeTimestamp = enablePhonemeTimestamp; + } - /** - * Build a options instances. - */ - public static class Builder { + /** + * Build a options instances. + */ + public static class Builder { - private final TongYiAudioSpeechOptions options = new TongYiAudioSpeechOptions(); + private final TongYiAudioSpeechOptions options = new TongYiAudioSpeechOptions(); - public Builder withModel(String model) { + public Builder withModel(String model) { - options.model = model; - return this; - } + options.model = model; + return this; + } - public Builder withText(String text) { + public Builder withText(String text) { - options.text = text; - return this; - } + options.text = text; + return this; + } - public Builder withTextType(SpeechSynthesisTextType textType) { + public Builder withTextType(SpeechSynthesisTextType textType) { - options.textType = textType; - return this; - } + options.textType = textType; + return this; + } - public Builder withFormat(SpeechSynthesisAudioFormat format) { + public Builder withFormat(SpeechSynthesisAudioFormat format) { - options.format = format; - return this; - } + options.format = format; + return this; + } - public Builder withSampleRate(Integer sampleRate) { + public Builder withSampleRate(Integer sampleRate) { - options.sampleRate = sampleRate; - return this; - } + options.sampleRate = sampleRate; + return this; + } - public Builder withVolume(Integer volume) { + public Builder withVolume(Integer volume) { - options.volume = volume; - return this; - } + options.volume = volume; + return this; + } - public Builder withRate(Float rate) { + public Builder withRate(Float rate) { - options.rate = rate; - return this; - } + options.rate = rate; + return this; + } - public Builder withPitch(Float pitch) { + public Builder withPitch(Float pitch) { - options.pitch = pitch; - return this; - } + options.pitch = pitch; + return this; + } - public Builder withEnableWordTimestamp(Boolean enableWordTimestamp) { + public Builder withEnableWordTimestamp(Boolean enableWordTimestamp) { - options.enableWordTimestamp = enableWordTimestamp; - return this; - } + options.enableWordTimestamp = enableWordTimestamp; + return this; + } - public Builder withEnablePhonemeTimestamp(Boolean enablePhonemeTimestamp) { + public Builder withEnablePhonemeTimestamp(Boolean enablePhonemeTimestamp) { - options.enablePhonemeTimestamp = enablePhonemeTimestamp; - return this; - } + options.enablePhonemeTimestamp = enablePhonemeTimestamp; + return this; + } - public TongYiAudioSpeechOptions build() { + public TongYiAudioSpeechOptions build() { - return options; - } + return options; + } - } + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/TongYiAudioSpeechProperties.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/TongYiAudioSpeechProperties.java index a3b4357..93d8fed 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/TongYiAudioSpeechProperties.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/TongYiAudioSpeechProperties.java @@ -34,44 +34,44 @@ import static com.alibaba.cloud.ai.tongyi.common.constants.TongYiConstants.SCA_A @ConfigurationProperties(TongYiAudioSpeechProperties.CONFIG_PREFIX) public class TongYiAudioSpeechProperties { - /** - * Spring Cloud Alibaba AI configuration prefix. - */ - public static final String CONFIG_PREFIX = SCA_AI_CONFIGURATION + "audio.speech"; - /** - * Default TongYi Chat model. - */ - public static final String DEFAULT_AUDIO_MODEL_NAME = AudioSpeechModels.SAMBERT_ZHICHU_V1; + /** + * Spring Cloud Alibaba AI configuration prefix. + */ + public static final String CONFIG_PREFIX = SCA_AI_CONFIGURATION + "audio.speech"; + /** + * Default TongYi Chat model. + */ + public static final String DEFAULT_AUDIO_MODEL_NAME = AudioSpeechModels.SAMBERT_ZHICHU_V1; - /** - * Enable TongYiQWEN ai audio client. - */ - private boolean enabled = true; + /** + * Enable TongYiQWEN ai audio client. + */ + private boolean enabled = true; - @NestedConfigurationProperty - private TongYiAudioSpeechOptions options = TongYiAudioSpeechOptions.builder() - .withModel(DEFAULT_AUDIO_MODEL_NAME) - .withFormat(SpeechSynthesisAudioFormat.WAV) - .build(); + @NestedConfigurationProperty + private TongYiAudioSpeechOptions options = TongYiAudioSpeechOptions.builder() + .withModel(DEFAULT_AUDIO_MODEL_NAME) + .withFormat(SpeechSynthesisAudioFormat.WAV) + .build(); - public TongYiAudioSpeechOptions getOptions() { + public TongYiAudioSpeechOptions getOptions() { - return this.options; - } + return this.options; + } - public void setOptions(TongYiAudioSpeechOptions options) { + public void setOptions(TongYiAudioSpeechOptions options) { - this.options = options; - } + this.options = options; + } - public boolean isEnabled() { + public boolean isEnabled() { - return this.enabled; - } + return this.enabled; + } - public void setEnabled(boolean enabled) { + public void setEnabled(boolean enabled) { - this.enabled = enabled; - } + this.enabled = enabled; + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/Speech.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/Speech.java index adeef4e..b7e8ce1 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/Speech.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/Speech.java @@ -31,57 +31,57 @@ import java.util.Objects; public class Speech implements ModelResult { - private final ByteBuffer audio; + private final ByteBuffer audio; - private SpeechMetadata speechMetadata; + private SpeechMetadata speechMetadata; - public Speech(ByteBuffer audio) { - this.audio = audio; - } + public Speech(ByteBuffer audio) { + this.audio = audio; + } - @Override - public ByteBuffer getOutput() { - return this.audio; - } + @Override + public ByteBuffer getOutput() { + return this.audio; + } - @Override - public SpeechMetadata getMetadata() { + @Override + public SpeechMetadata getMetadata() { - return speechMetadata != null ? speechMetadata : SpeechMetadata.NULL; - } + return speechMetadata != null ? speechMetadata : SpeechMetadata.NULL; + } - public Speech withSpeechMetadata(@Nullable SpeechMetadata speechMetadata) { + public Speech withSpeechMetadata(@Nullable SpeechMetadata speechMetadata) { - this.speechMetadata = speechMetadata; - return this; - } + this.speechMetadata = speechMetadata; + return this; + } - @Override - public boolean equals(Object o) { + @Override + public boolean equals(Object o) { - if (this == o) { + if (this == o) { - return true; - } - if (!(o instanceof Speech that)) { + return true; + } + if (!(o instanceof Speech that)){ - return false; - } + return false; + } - return Arrays.equals(audio.array(), that.audio.array()) - && Objects.equals(speechMetadata, that.speechMetadata); - } + return Arrays.equals(audio.array(), that.audio.array()) + && Objects.equals(speechMetadata, that.speechMetadata); + } - @Override - public int hashCode() { + @Override + public int hashCode() { - return Objects.hash(Arrays.hashCode(audio.array()), speechMetadata); - } + return Objects.hash(Arrays.hashCode(audio.array()), speechMetadata); + } - @Override - public String toString() { + @Override + public String toString() { - return "Speech{" + "text=" + audio + ", speechMetadata=" + speechMetadata + '}'; - } + return "Speech{" + "text=" + audio + ", speechMetadata=" + speechMetadata + '}'; + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechMessage.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechMessage.java index 9748bcf..0b8b141 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechMessage.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechMessage.java @@ -29,52 +29,55 @@ import java.util.Objects; public class SpeechMessage { - private String text; + private String text; - /** - * Constructs a new {@link SpeechMessage} object with the given text. - * @param text the text to be converted to speech - */ - public SpeechMessage(String text) { - this.text = text; - } + /** + * Constructs a new {@link SpeechMessage} object with the given text. + * + * @param text the text to be converted to speech + */ + public SpeechMessage(String text) { + this.text = text; + } - /** - * Returns the text of this speech message. - * @return the text of this speech message - */ - public String getText() { - return text; - } + /** + * Returns the text of this speech message. + * + * @return the text of this speech message + */ + public String getText() { + return text; + } - /** - * Sets the text of this speech message. - * @param text the new text for this speech message - */ - public void setText(String text) { - this.text = text; - } + /** + * Sets the text of this speech message. + * + * @param text the new text for this speech message + */ + public void setText(String text) { + this.text = text; + } - @Override - public boolean equals(Object o) { + @Override + public boolean equals(Object o) { - if (this == o) { + if (this == o) { - return true; - } + return true; + } - if (!(o instanceof SpeechMessage that)) { + if (!(o instanceof SpeechMessage that)){ - return false; - } + return false; + } - return Objects.equals(text, that.text); - } + return Objects.equals(text, that.text); + } - @Override - public int hashCode() { + @Override + public int hashCode() { - return Objects.hash(text); - } + return Objects.hash(text); + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechMetadata.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechMetadata.java index 513a283..84a2092 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechMetadata.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechMetadata.java @@ -26,18 +26,19 @@ import org.springframework.ai.model.ResultMetadata; public interface SpeechMetadata extends ResultMetadata { - /** - * Null Object. - */ - SpeechMetadata NULL = SpeechMetadata.create(); + /** + * Null Object. + */ + SpeechMetadata NULL = SpeechMetadata.create(); - /** - * Factory method used to construct a new {@link SpeechMetadata}. - * @return a new {@link SpeechMetadata} - */ - static SpeechMetadata create() { - return new SpeechMetadata() { - }; - } + /** + * Factory method used to construct a new {@link SpeechMetadata}. + * + * @return a new {@link SpeechMetadata} + */ + static SpeechMetadata create() { + return new SpeechMetadata() { + }; + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechModel.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechModel.java index 601dce7..0723640 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechModel.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechModel.java @@ -29,23 +29,25 @@ import java.nio.ByteBuffer; @FunctionalInterface public interface SpeechModel extends Model { - /** - * Generates spoken audio from the provided text message. - * @param message the text message to be converted to audio. - * @return the resulting audio bytes. - */ - default ByteBuffer call(String message) { + /** + * Generates spoken audio from the provided text message. + * + * @param message the text message to be converted to audio. + * @return the resulting audio bytes. + */ + default ByteBuffer call(String message) { - SpeechPrompt prompt = new SpeechPrompt(message); + SpeechPrompt prompt = new SpeechPrompt(message); - return call(prompt).getResult().getOutput(); - } + return call(prompt).getResult().getOutput(); + } - /** - * Sends a speech request to the TongYi TTS API and returns the resulting speech response. - * @param request the speech prompt containing the input text and other parameters. - * @return the speech response containing the generated audio. - */ - SpeechResponse call(SpeechPrompt request); + /** + * Sends a speech request to the TongYi TTS API and returns the resulting speech response. + * + * @param request the speech prompt containing the input text and other parameters. + * @return the speech response containing the generated audio. + */ + SpeechResponse call(SpeechPrompt request); } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechPrompt.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechPrompt.java index dc89ff3..73e7d89 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechPrompt.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechPrompt.java @@ -29,61 +29,61 @@ import java.util.Objects; public class SpeechPrompt implements ModelRequest { - private TongYiAudioSpeechOptions speechOptions; + private TongYiAudioSpeechOptions speechOptions; - private final SpeechMessage message; + private final SpeechMessage message; - public SpeechPrompt(String instructions) { + public SpeechPrompt(String instructions) { - this(new SpeechMessage(instructions), TongYiAudioSpeechOptions.builder().build()); - } + this(new SpeechMessage(instructions), TongYiAudioSpeechOptions.builder().build()); + } - public SpeechPrompt(String instructions, TongYiAudioSpeechOptions speechOptions) { + public SpeechPrompt(String instructions, TongYiAudioSpeechOptions speechOptions) { - this(new SpeechMessage(instructions), speechOptions); - } + this(new SpeechMessage(instructions), speechOptions); + } - public SpeechPrompt(SpeechMessage speechMessage) { - this(speechMessage, TongYiAudioSpeechOptions.builder().build()); - } + public SpeechPrompt(SpeechMessage speechMessage) { + this(speechMessage, TongYiAudioSpeechOptions.builder().build()); + } - public SpeechPrompt(SpeechMessage speechMessage, TongYiAudioSpeechOptions speechOptions) { + public SpeechPrompt(SpeechMessage speechMessage, TongYiAudioSpeechOptions speechOptions) { - this.message = speechMessage; - this.speechOptions = speechOptions; - } + this.message = speechMessage; + this.speechOptions = speechOptions; + } - @Override - public SpeechMessage getInstructions() { - return this.message; - } + @Override + public SpeechMessage getInstructions() { + return this.message; + } - @Override - public TongYiAudioSpeechOptions getOptions() { + @Override + public TongYiAudioSpeechOptions getOptions() { - return speechOptions; - } + return speechOptions; + } - @Override - public boolean equals(Object o) { + @Override + public boolean equals(Object o) { - if (this == o) { + if (this == o) { - return true; - } - if (!(o instanceof SpeechPrompt that)) { + return true; + } + if (!(o instanceof SpeechPrompt that)){ - return false; - } + return false; + } - return Objects.equals(speechOptions, that.speechOptions) && Objects.equals(message, that.message); - } + return Objects.equals(speechOptions, that.speechOptions) && Objects.equals(message, that.message); + } - @Override - public int hashCode() { + @Override + public int hashCode() { - return Objects.hash(speechOptions, message); - } + return Objects.hash(speechOptions, message); + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechResponse.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechResponse.java index b8d7484..6059435 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechResponse.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechResponse.java @@ -31,70 +31,72 @@ import java.util.Objects; public class SpeechResponse implements ModelResponse { - private final Speech speech; + private final Speech speech; - private final TongYiAudioSpeechResponseMetadata speechResponseMetadata; + private final TongYiAudioSpeechResponseMetadata speechResponseMetadata; - /** - * Creates a new instance of SpeechResponse with the given speech result. - * @param speech the speech result to be set in the SpeechResponse - * @see Speech - */ - public SpeechResponse(Speech speech) { - this(speech, TongYiAudioSpeechResponseMetadata.NULL); - } + /** + * Creates a new instance of SpeechResponse with the given speech result. + * + * @param speech the speech result to be set in the SpeechResponse + * @see Speech + */ + public SpeechResponse(Speech speech) { + this(speech, TongYiAudioSpeechResponseMetadata.NULL); + } - /** - * Creates a new instance of SpeechResponse with the given speech result and speech - * response metadata. - * @param speech the speech result to be set in the SpeechResponse - * @param speechResponseMetadata the speech response metadata to be set in the - * SpeechResponse - * @see Speech - * @see TongYiAudioSpeechResponseMetadata - */ - public SpeechResponse(Speech speech, TongYiAudioSpeechResponseMetadata speechResponseMetadata) { + /** + * Creates a new instance of SpeechResponse with the given speech result and speech + * response metadata. + * + * @param speech the speech result to be set in the SpeechResponse + * @param speechResponseMetadata the speech response metadata to be set in the + * SpeechResponse + * @see Speech + * @see TongYiAudioSpeechResponseMetadata + */ + public SpeechResponse(Speech speech, TongYiAudioSpeechResponseMetadata speechResponseMetadata) { - this.speech = speech; - this.speechResponseMetadata = speechResponseMetadata; - } + this.speech = speech; + this.speechResponseMetadata = speechResponseMetadata; + } - @Override - public Speech getResult() { - return speech; - } + @Override + public Speech getResult() { + return speech; + } - @Override - public List getResults() { - return Collections.singletonList(speech); - } + @Override + public List getResults() { + return Collections.singletonList(speech); + } - @Override - public TongYiAudioSpeechResponseMetadata getMetadata() { - return speechResponseMetadata; - } + @Override + public TongYiAudioSpeechResponseMetadata getMetadata() { + return speechResponseMetadata; + } - @Override - public boolean equals(Object o) { + @Override + public boolean equals(Object o) { - if (this == o) { + if (this == o) { - return true; - } - if (!(o instanceof SpeechResponse that)) { + return true; + } + if (!(o instanceof SpeechResponse that)){ - return false; - } + return false; + } - return Objects.equals(speech, that.speech) - && Objects.equals(speechResponseMetadata, that.speechResponseMetadata); - } + return Objects.equals(speech, that.speech) + && Objects.equals(speechResponseMetadata, that.speechResponseMetadata); + } - @Override - public int hashCode() { + @Override + public int hashCode() { - return Objects.hash(speech, speechResponseMetadata); - } + return Objects.hash(speech, speechResponseMetadata); + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechStreamModel.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechStreamModel.java index d39c79a..2c38d7b 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechStreamModel.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/speech/api/SpeechStreamModel.java @@ -30,25 +30,26 @@ import java.nio.ByteBuffer; @FunctionalInterface public interface SpeechStreamModel extends StreamingModel { - /** - * Generates a stream of audio bytes from the provided text message. - * - * @param message the text message to be converted to audio - * @return a Flux of audio bytes representing the generated speech - */ - default Flux stream(String message) { + /** + * Generates a stream of audio bytes from the provided text message. + * + * @param message the text message to be converted to audio + * @return a Flux of audio bytes representing the generated speech + */ + default Flux stream(String message) { - SpeechPrompt prompt = new SpeechPrompt(message); - return stream(prompt).map(SpeechResponse::getResult).map(Speech::getOutput); - } + SpeechPrompt prompt = new SpeechPrompt(message); + return stream(prompt).map(SpeechResponse::getResult).map(Speech::getOutput); + } - /** - * Sends a speech request to the TongYi TTS API and returns a stream of the resulting - * speech responses. - * @param prompt the speech prompt containing the input text and other parameters. - * @return a Flux of speech responses, each containing a portion of the generated audio. - */ - @Override - Flux stream(SpeechPrompt prompt); + /** + * Sends a speech request to the TongYi TTS API and returns a stream of the resulting + * speech responses. + * + * @param prompt the speech prompt containing the input text and other parameters. + * @return a Flux of speech responses, each containing a portion of the generated audio. + */ + @Override + Flux stream(SpeechPrompt prompt); } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/TongYiAudioTranscriptionModel.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/TongYiAudioTranscriptionModel.java index 2068fee..a975420 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/TongYiAudioTranscriptionModel.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/TongYiAudioTranscriptionModel.java @@ -36,151 +36,149 @@ import java.util.stream.Collectors; /** * TongYiAudioTranscriptionModel is a client for TongYi audio transcription service for * Spring Cloud Alibaba AI. + * * @author xYLiu * @author yuluo * @since 2023.0.1.0 */ public class TongYiAudioTranscriptionModel - implements Model { + implements Model { - /** - * TongYi models options. - */ - private final TongYiAudioTranscriptionOptions defaultOptions; + /** + * TongYi models options. + */ + private final TongYiAudioTranscriptionOptions defaultOptions; - /** - * TongYi models api. - */ - private final Transcription transcription; + /** + * TongYi models api. + */ + private final Transcription transcription; - public TongYiAudioTranscriptionModel(Transcription transcription) { - this(null, transcription); - } + public TongYiAudioTranscriptionModel(Transcription transcription) { + this(null, transcription); + } - public TongYiAudioTranscriptionModel(TongYiAudioTranscriptionOptions defaultOptions, - Transcription transcription) { - Assert.notNull(transcription, "transcription must not be null"); - Assert.notNull(defaultOptions, "defaultOptions must not be null"); + public TongYiAudioTranscriptionModel(TongYiAudioTranscriptionOptions defaultOptions, + Transcription transcription) { + Assert.notNull(transcription, "transcription must not be null"); + Assert.notNull(defaultOptions, "defaultOptions must not be null"); - this.defaultOptions = defaultOptions; - this.transcription = transcription; - } + this.defaultOptions = defaultOptions; + this.transcription = transcription; + } - @Override - public AudioTranscriptionResponse call(AudioTranscriptionPrompt prompt) { + @Override + public AudioTranscriptionResponse call(AudioTranscriptionPrompt prompt) { - TranscriptionParam transcriptionParam; + TranscriptionParam transcriptionParam; - if (prompt.getOptions() != null) { - var param = merge(prompt.getOptions()); - transcriptionParam = toTranscriptionParam(param); - transcriptionParam.setFileUrls(prompt.getOptions().getFileUrls()); - } - else { - Resource instructions = prompt.getInstructions(); - try { - transcriptionParam = TranscriptionParam.builder() - .model(AudioTranscriptionModels.Paraformer_V1) - .fileUrls(List.of(String.valueOf(instructions.getURL()))) - .build(); - } - catch (IOException e) { - throw new TongYiException("Failed to create resource", e); - } - } + if (prompt.getOptions() != null) { + var param = merge(prompt.getOptions()); + transcriptionParam = toTranscriptionParam(param); + transcriptionParam.setFileUrls(prompt.getOptions().getFileUrls()); + } else { + Resource instructions = prompt.getInstructions(); + try { + transcriptionParam = TranscriptionParam.builder() + .model(AudioTranscriptionModels.Paraformer_V1) + .fileUrls(List.of(String.valueOf(instructions.getURL()))) + .build(); + } catch (IOException e) { + throw new TongYiException("Failed to create resource", e); + } + } - List taskResultList; - try { - // Submit a transcription request - TranscriptionResult result = transcription.asyncCall(transcriptionParam); - // Wait for the transcription to complete - result = transcription.wait(TranscriptionQueryParam - .FromTranscriptionParam(transcriptionParam, result.getTaskId())); - // Get the transcription results - System.out.println(result.getOutput().getAsJsonObject()); - taskResultList = result.getResults(); - System.out.println(Arrays.toString(taskResultList.toArray())); + List taskResultList; + try { + // Submit a transcription request + TranscriptionResult result = transcription.asyncCall(transcriptionParam); + // Wait for the transcription to complete + result = transcription.wait(TranscriptionQueryParam + .FromTranscriptionParam(transcriptionParam, result.getTaskId())); + // Get the transcription results + System.out.println(result.getOutput().getAsJsonObject()); + taskResultList = result.getResults(); + System.out.println(Arrays.toString(taskResultList.toArray())); - return new AudioTranscriptionResponse( - taskResultList.stream().map(taskResult -> - new AudioTranscriptionResult(taskResult.getTranscriptionUrl()) - ).collect(Collectors.toList()), - TongYiAudioTranscriptionResponseMetadata.from(result) - ); - } - catch (Exception e) { - throw new TongYiException("Failed to call audio transcription", e); - } + return new AudioTranscriptionResponse( + taskResultList.stream().map(taskResult -> + new AudioTranscriptionResult(taskResult.getTranscriptionUrl()) + ).collect(Collectors.toList()), + TongYiAudioTranscriptionResponseMetadata.from(result) + ); + } catch (Exception e) { + throw new TongYiException("Failed to call audio transcription", e); + } - } + } - public TongYiAudioTranscriptionOptions merge(TongYiAudioTranscriptionOptions target) { - var mergeBuilder = TongYiAudioTranscriptionOptions.builder(); + public TongYiAudioTranscriptionOptions merge(TongYiAudioTranscriptionOptions target) { + var mergeBuilder = TongYiAudioTranscriptionOptions.builder(); - mergeBuilder - .withModel(defaultOptions.getModel() != null ? defaultOptions.getModel() - : target.getModel()); - mergeBuilder.withChannelId( - defaultOptions.getChannelId() != null ? defaultOptions.getChannelId() - : target.getChannelId()); - mergeBuilder.withDiarizationEnabled(defaultOptions.getDiarizationEnabled() != null - ? defaultOptions.getDiarizationEnabled() - : target.getDiarizationEnabled()); - mergeBuilder.withDisfluencyRemovalEnabled( - defaultOptions.getDisfluencyRemovalEnabled() != null - ? defaultOptions.getDisfluencyRemovalEnabled() - : target.getDisfluencyRemovalEnabled()); - mergeBuilder.withTimestampAlignmentEnabled( - defaultOptions.getTimestampAlignmentEnabled() != null - ? defaultOptions.getTimestampAlignmentEnabled() - : target.getTimestampAlignmentEnabled()); - mergeBuilder.withSpecialWordFilter(defaultOptions.getSpecialWordFilter() != null - ? defaultOptions.getSpecialWordFilter() - : target.getSpecialWordFilter()); - mergeBuilder.withAudioEventDetectionEnabled( - defaultOptions.getAudioEventDetectionEnabled() != null - ? defaultOptions.getAudioEventDetectionEnabled() - : target.getAudioEventDetectionEnabled()); + mergeBuilder + .withModel(defaultOptions.getModel() != null ? defaultOptions.getModel() + : target.getModel()); + mergeBuilder.withChannelId( + defaultOptions.getChannelId() != null ? defaultOptions.getChannelId() + : target.getChannelId()); + mergeBuilder.withDiarizationEnabled(defaultOptions.getDiarizationEnabled() != null + ? defaultOptions.getDiarizationEnabled() + : target.getDiarizationEnabled()); + mergeBuilder.withDisfluencyRemovalEnabled( + defaultOptions.getDisfluencyRemovalEnabled() != null + ? defaultOptions.getDisfluencyRemovalEnabled() + : target.getDisfluencyRemovalEnabled()); + mergeBuilder.withTimestampAlignmentEnabled( + defaultOptions.getTimestampAlignmentEnabled() != null + ? defaultOptions.getTimestampAlignmentEnabled() + : target.getTimestampAlignmentEnabled()); + mergeBuilder.withSpecialWordFilter(defaultOptions.getSpecialWordFilter() != null + ? defaultOptions.getSpecialWordFilter() + : target.getSpecialWordFilter()); + mergeBuilder.withAudioEventDetectionEnabled( + defaultOptions.getAudioEventDetectionEnabled() != null + ? defaultOptions.getAudioEventDetectionEnabled() + : target.getAudioEventDetectionEnabled()); - return mergeBuilder.build(); - } + return mergeBuilder.build(); + } - public TranscriptionParam toTranscriptionParam( - TongYiAudioTranscriptionOptions source) { - var mergeBuilder = TranscriptionParam.builder(); + public TranscriptionParam toTranscriptionParam( + TongYiAudioTranscriptionOptions source) { + var mergeBuilder = TranscriptionParam.builder(); - mergeBuilder.model(source.getModel() != null ? source.getModel() - : AudioTranscriptionModels.Paraformer_V1); - mergeBuilder.fileUrls( - source.getFileUrls() != null ? source.getFileUrls() : new ArrayList<>()); - if (source.getPhraseId() != null) { - mergeBuilder.phraseId(source.getPhraseId()); - } - if (source.getChannelId() != null) { - mergeBuilder.channelId(source.getChannelId()); - } - if (source.getDiarizationEnabled() != null) { - mergeBuilder.diarizationEnabled(source.getDiarizationEnabled()); - } - if (source.getSpeakerCount() != null) { - mergeBuilder.speakerCount(source.getSpeakerCount()); - } - if (source.getDisfluencyRemovalEnabled() != null) { - mergeBuilder.disfluencyRemovalEnabled(source.getDisfluencyRemovalEnabled()); - } - if (source.getTimestampAlignmentEnabled() != null) { - mergeBuilder.timestampAlignmentEnabled(source.getTimestampAlignmentEnabled()); - } - if (source.getSpecialWordFilter() != null) { - mergeBuilder.specialWordFilter(source.getSpecialWordFilter()); - } - if (source.getAudioEventDetectionEnabled() != null) { - mergeBuilder - .audioEventDetectionEnabled(source.getAudioEventDetectionEnabled()); - } + mergeBuilder.model(source.getModel() != null ? source.getModel() + : AudioTranscriptionModels.Paraformer_V1); + mergeBuilder.fileUrls( + source.getFileUrls() != null ? source.getFileUrls() : new ArrayList<>()); + if (source.getPhraseId() != null) { + mergeBuilder.phraseId(source.getPhraseId()); + } + if (source.getChannelId() != null) { + mergeBuilder.channelId(source.getChannelId()); + } + if (source.getDiarizationEnabled() != null) { + mergeBuilder.diarizationEnabled(source.getDiarizationEnabled()); + } + if (source.getSpeakerCount() != null) { + mergeBuilder.speakerCount(source.getSpeakerCount()); + } + if (source.getDisfluencyRemovalEnabled() != null) { + mergeBuilder.disfluencyRemovalEnabled(source.getDisfluencyRemovalEnabled()); + } + if (source.getTimestampAlignmentEnabled() != null) { + mergeBuilder.timestampAlignmentEnabled(source.getTimestampAlignmentEnabled()); + } + if (source.getSpecialWordFilter() != null) { + mergeBuilder.specialWordFilter(source.getSpecialWordFilter()); + } + if (source.getAudioEventDetectionEnabled() != null) { + mergeBuilder + .audioEventDetectionEnabled(source.getAudioEventDetectionEnabled()); + } - return mergeBuilder.build(); - } + return mergeBuilder.build(); + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/TongYiAudioTranscriptionOptions.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/TongYiAudioTranscriptionOptions.java index 3fec637..4b89f4b 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/TongYiAudioTranscriptionOptions.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/TongYiAudioTranscriptionOptions.java @@ -31,173 +31,173 @@ import java.util.List; public class TongYiAudioTranscriptionOptions implements ModelOptions { - private String model = AudioTranscriptionModels.Paraformer_V1; + private String model = AudioTranscriptionModels.Paraformer_V1; - private List fileUrls = new ArrayList<>(); + private List fileUrls = new ArrayList<>(); - private String phraseId = null; + private String phraseId = null; - private List channelId = Collections.singletonList(0); + private List channelId = Collections.singletonList(0); - private Boolean diarizationEnabled = false; + private Boolean diarizationEnabled = false; - private Integer speakerCount = null; + private Integer speakerCount = null; - private Boolean disfluencyRemovalEnabled = false; + private Boolean disfluencyRemovalEnabled = false; - private Boolean timestampAlignmentEnabled = false; + private Boolean timestampAlignmentEnabled = false; - private String specialWordFilter = ""; + private String specialWordFilter = ""; - private Boolean audioEventDetectionEnabled = false; + private Boolean audioEventDetectionEnabled = false; - public static Builder builder() { + public static Builder builder() { - return new Builder(); - } + return new Builder(); + } - public String getModel() { - return model; - } + public String getModel() { + return model; + } - public void setModel(String model) { - this.model = model; - } + public void setModel(String model) { + this.model = model; + } - public List getFileUrls() { - return fileUrls; - } + public List getFileUrls() { + return fileUrls; + } - public void setFileUrls(List fileUrls) { - this.fileUrls = fileUrls; - } + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; + } - public String getPhraseId() { - return phraseId; - } + public String getPhraseId() { + return phraseId; + } - public void setPhraseId(String phraseId) { - this.phraseId = phraseId; - } + public void setPhraseId(String phraseId) { + this.phraseId = phraseId; + } - public List getChannelId() { - return channelId; - } + public List getChannelId() { + return channelId; + } - public void setChannelId(List channelId) { - this.channelId = channelId; - } + public void setChannelId(List channelId) { + this.channelId = channelId; + } - public Boolean getDiarizationEnabled() { - return diarizationEnabled; - } + public Boolean getDiarizationEnabled() { + return diarizationEnabled; + } - public void setDiarizationEnabled(Boolean diarizationEnabled) { - this.diarizationEnabled = diarizationEnabled; - } + public void setDiarizationEnabled(Boolean diarizationEnabled) { + this.diarizationEnabled = diarizationEnabled; + } - public Integer getSpeakerCount() { - return speakerCount; - } + public Integer getSpeakerCount() { + return speakerCount; + } - public void setSpeakerCount(Integer speakerCount) { - this.speakerCount = speakerCount; - } + public void setSpeakerCount(Integer speakerCount) { + this.speakerCount = speakerCount; + } - public Boolean getDisfluencyRemovalEnabled() { - return disfluencyRemovalEnabled; - } + public Boolean getDisfluencyRemovalEnabled() { + return disfluencyRemovalEnabled; + } - public void setDisfluencyRemovalEnabled(Boolean disfluencyRemovalEnabled) { - this.disfluencyRemovalEnabled = disfluencyRemovalEnabled; - } + public void setDisfluencyRemovalEnabled(Boolean disfluencyRemovalEnabled) { + this.disfluencyRemovalEnabled = disfluencyRemovalEnabled; + } - public Boolean getTimestampAlignmentEnabled() { - return timestampAlignmentEnabled; - } + public Boolean getTimestampAlignmentEnabled() { + return timestampAlignmentEnabled; + } - public void setTimestampAlignmentEnabled(Boolean timestampAlignmentEnabled) { - this.timestampAlignmentEnabled = timestampAlignmentEnabled; - } + public void setTimestampAlignmentEnabled(Boolean timestampAlignmentEnabled) { + this.timestampAlignmentEnabled = timestampAlignmentEnabled; + } - public String getSpecialWordFilter() { - return specialWordFilter; - } + public String getSpecialWordFilter() { + return specialWordFilter; + } - public void setSpecialWordFilter(String specialWordFilter) { - this.specialWordFilter = specialWordFilter; - } + public void setSpecialWordFilter(String specialWordFilter) { + this.specialWordFilter = specialWordFilter; + } - public Boolean getAudioEventDetectionEnabled() { - return audioEventDetectionEnabled; - } + public Boolean getAudioEventDetectionEnabled() { + return audioEventDetectionEnabled; + } - public void setAudioEventDetectionEnabled(Boolean audioEventDetectionEnabled) { - this.audioEventDetectionEnabled = audioEventDetectionEnabled; - } + public void setAudioEventDetectionEnabled(Boolean audioEventDetectionEnabled) { + this.audioEventDetectionEnabled = audioEventDetectionEnabled; + } - /** - * Builder class for constructing TongYiAudioTranscriptionOptions instances. - */ - public static class Builder { + /** + * Builder class for constructing TongYiAudioTranscriptionOptions instances. + */ + public static class Builder { - private final TongYiAudioTranscriptionOptions options = new TongYiAudioTranscriptionOptions(); + private final TongYiAudioTranscriptionOptions options = new TongYiAudioTranscriptionOptions(); - public Builder withModel(String model) { - options.model = model; - return this; - } + public Builder withModel(String model) { + options.model = model; + return this; + } - public Builder withFileUrls(List fileUrls) { - options.fileUrls = fileUrls; - return this; - } + public Builder withFileUrls(List fileUrls) { + options.fileUrls = fileUrls; + return this; + } - public Builder withPhraseId(String phraseId) { - options.phraseId = phraseId; - return this; - } + public Builder withPhraseId(String phraseId) { + options.phraseId = phraseId; + return this; + } - public Builder withChannelId(List channelId) { - options.channelId = channelId; - return this; - } + public Builder withChannelId(List channelId) { + options.channelId = channelId; + return this; + } - public Builder withDiarizationEnabled(Boolean diarizationEnabled) { - options.diarizationEnabled = diarizationEnabled; - return this; - } + public Builder withDiarizationEnabled(Boolean diarizationEnabled) { + options.diarizationEnabled = diarizationEnabled; + return this; + } - public Builder withSpeakerCount(Integer speakerCount) { - options.speakerCount = speakerCount; - return this; - } + public Builder withSpeakerCount(Integer speakerCount) { + options.speakerCount = speakerCount; + return this; + } - public Builder withDisfluencyRemovalEnabled(Boolean disfluencyRemovalEnabled) { - options.disfluencyRemovalEnabled = disfluencyRemovalEnabled; - return this; - } + public Builder withDisfluencyRemovalEnabled(Boolean disfluencyRemovalEnabled) { + options.disfluencyRemovalEnabled = disfluencyRemovalEnabled; + return this; + } - public Builder withTimestampAlignmentEnabled(Boolean timestampAlignmentEnabled) { - options.timestampAlignmentEnabled = timestampAlignmentEnabled; - return this; - } + public Builder withTimestampAlignmentEnabled(Boolean timestampAlignmentEnabled) { + options.timestampAlignmentEnabled = timestampAlignmentEnabled; + return this; + } - public Builder withSpecialWordFilter(String specialWordFilter) { - options.specialWordFilter = specialWordFilter; - return this; - } + public Builder withSpecialWordFilter(String specialWordFilter) { + options.specialWordFilter = specialWordFilter; + return this; + } - public Builder withAudioEventDetectionEnabled( - Boolean audioEventDetectionEnabled) { - options.audioEventDetectionEnabled = audioEventDetectionEnabled; - return this; - } + public Builder withAudioEventDetectionEnabled( + Boolean audioEventDetectionEnabled) { + options.audioEventDetectionEnabled = audioEventDetectionEnabled; + return this; + } - public TongYiAudioTranscriptionOptions build() { - // Perform any necessary validation here before returning the built object - return options; - } - } + public TongYiAudioTranscriptionOptions build() { + // Perform any necessary validation here before returning the built object + return options; + } + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/TongYiAudioTranscriptionProperties.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/TongYiAudioTranscriptionProperties.java index fe86d0d..d90744a 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/TongYiAudioTranscriptionProperties.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/TongYiAudioTranscriptionProperties.java @@ -31,42 +31,42 @@ import static com.alibaba.cloud.ai.tongyi.common.constants.TongYiConstants.SCA_A @ConfigurationProperties(TongYiAudioTranscriptionProperties.CONFIG_PREFIX) public class TongYiAudioTranscriptionProperties { - /** - * Spring Cloud Alibaba AI configuration prefix. - */ - public static final String CONFIG_PREFIX = SCA_AI_CONFIGURATION + "audio.transcription"; + /** + * Spring Cloud Alibaba AI configuration prefix. + */ + public static final String CONFIG_PREFIX = SCA_AI_CONFIGURATION + "audio.transcription"; - /** - * Default TongYi Chat model. - */ - public static final String DEFAULT_AUDIO_MODEL_NAME = AudioTranscriptionModels.Paraformer_V1; + /** + * Default TongYi Chat model. + */ + public static final String DEFAULT_AUDIO_MODEL_NAME = AudioTranscriptionModels.Paraformer_V1; - /** - * Enable TongYiQWEN ai audio client. - */ - private boolean enabled = true; + /** + * Enable TongYiQWEN ai audio client. + */ + private boolean enabled = true; - @NestedConfigurationProperty - private TongYiAudioTranscriptionOptions options = TongYiAudioTranscriptionOptions - .builder().withModel(DEFAULT_AUDIO_MODEL_NAME).build(); + @NestedConfigurationProperty + private TongYiAudioTranscriptionOptions options = TongYiAudioTranscriptionOptions + .builder().withModel(DEFAULT_AUDIO_MODEL_NAME).build(); - public TongYiAudioTranscriptionOptions getOptions() { + public TongYiAudioTranscriptionOptions getOptions() { - return this.options; - } + return this.options; + } - public void setOptions(TongYiAudioTranscriptionOptions options) { + public void setOptions(TongYiAudioTranscriptionOptions options) { - this.options = options; - } + this.options = options; + } - public boolean isEnabled() { + public boolean isEnabled() { - return this.enabled; - } + return this.enabled; + } - public void setEnabled(boolean enabled) { + public void setEnabled(boolean enabled) { - this.enabled = enabled; - } + this.enabled = enabled; + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/api/AudioTranscriptionPrompt.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/api/AudioTranscriptionPrompt.java index f4c2882..d2ac773 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/api/AudioTranscriptionPrompt.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/api/AudioTranscriptionPrompt.java @@ -28,29 +28,29 @@ import org.springframework.core.io.Resource; public class AudioTranscriptionPrompt implements ModelRequest { - private Resource audioResource; + private Resource audioResource; - private TongYiAudioTranscriptionOptions transcriptionOptions; + private TongYiAudioTranscriptionOptions transcriptionOptions; - public AudioTranscriptionPrompt(Resource resource) { - this.audioResource = resource; - } + public AudioTranscriptionPrompt(Resource resource) { + this.audioResource = resource; + } - public AudioTranscriptionPrompt(Resource resource, TongYiAudioTranscriptionOptions transcriptionOptions) { - this.audioResource = resource; - this.transcriptionOptions = transcriptionOptions; - } + public AudioTranscriptionPrompt(Resource resource, TongYiAudioTranscriptionOptions transcriptionOptions) { + this.audioResource = resource; + this.transcriptionOptions = transcriptionOptions; + } - @Override - public Resource getInstructions() { + @Override + public Resource getInstructions() { - return audioResource; - } + return audioResource; + } - @Override - public TongYiAudioTranscriptionOptions getOptions() { + @Override + public TongYiAudioTranscriptionOptions getOptions() { - return transcriptionOptions; - } + return transcriptionOptions; + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/api/AudioTranscriptionResponse.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/api/AudioTranscriptionResponse.java index 2e74015..ee35c01 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/api/AudioTranscriptionResponse.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/api/AudioTranscriptionResponse.java @@ -30,38 +30,38 @@ import java.util.List; public class AudioTranscriptionResponse implements ModelResponse { - private List resultList; + private List resultList; - private TongYiAudioTranscriptionResponseMetadata transcriptionResponseMetadata; + private TongYiAudioTranscriptionResponseMetadata transcriptionResponseMetadata; - public AudioTranscriptionResponse(List result) { + public AudioTranscriptionResponse(List result) { - this(result, TongYiAudioTranscriptionResponseMetadata.NULL); - } + this(result, TongYiAudioTranscriptionResponseMetadata.NULL); + } - public AudioTranscriptionResponse(List result, - TongYiAudioTranscriptionResponseMetadata transcriptionResponseMetadata) { + public AudioTranscriptionResponse(List result, + TongYiAudioTranscriptionResponseMetadata transcriptionResponseMetadata) { - this.resultList = List.copyOf(result); - this.transcriptionResponseMetadata = transcriptionResponseMetadata; - } + this.resultList = List.copyOf(result); + this.transcriptionResponseMetadata = transcriptionResponseMetadata; + } - @Override - public AudioTranscriptionResult getResult() { + @Override + public AudioTranscriptionResult getResult() { - return this.resultList.get(0); - } + return this.resultList.get(0); + } - @Override - public List getResults() { + @Override + public List getResults() { - return this.resultList; - } + return this.resultList; + } - @Override - public ResponseMetadata getMetadata() { + @Override + public ResponseMetadata getMetadata() { - return this.transcriptionResponseMetadata; - } + return this.transcriptionResponseMetadata; + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/api/AudioTranscriptionResult.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/api/AudioTranscriptionResult.java index 651855c..bd21a7a 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/api/AudioTranscriptionResult.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/audio/transcription/api/AudioTranscriptionResult.java @@ -29,40 +29,40 @@ import java.util.Objects; */ public class AudioTranscriptionResult implements ModelResult { - private String text; + private String text; - private TongYiAudioTranscriptionMetadata transcriptionMetadata; + private TongYiAudioTranscriptionMetadata transcriptionMetadata; - public AudioTranscriptionResult(String text) { - this.text = text; - } + public AudioTranscriptionResult(String text) { + this.text = text; + } - @Override - public String getOutput() { + @Override + public String getOutput() { - return this.text; - } + return this.text; + } - @Override - public ResultMetadata getMetadata() { + @Override + public ResultMetadata getMetadata() { - return transcriptionMetadata != null ? transcriptionMetadata : TongYiAudioTranscriptionMetadata.NULL; - } + return transcriptionMetadata != null ? transcriptionMetadata : TongYiAudioTranscriptionMetadata.NULL; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudioTranscriptionResult that = (AudioTranscriptionResult) o; - return Objects.equals(text, that.text) && Objects.equals(transcriptionMetadata, that.transcriptionMetadata); - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudioTranscriptionResult that = (AudioTranscriptionResult) o; + return Objects.equals(text, that.text) && Objects.equals(transcriptionMetadata, that.transcriptionMetadata); + } - @Override - public int hashCode() { - return Objects.hash(text, transcriptionMetadata); - } + @Override + public int hashCode() { + return Objects.hash(text, transcriptionMetadata); + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/chat/TongYiChatModel.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/chat/TongYiChatModel.java index c29ffbd..5744ab5 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/chat/TongYiChatModel.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/chat/TongYiChatModel.java @@ -60,423 +60,423 @@ import java.util.Set; * * @author yuluo * @author yuluo - * @since 2023.0.1.0 * @see ChatModel * @see com.alibaba.dashscope.aigc.generation + * @since 2023.0.1.0 */ public class TongYiChatModel extends - AbstractFunctionCallSupport< - com.alibaba.dashscope.common.Message, - ConversationParam, - GenerationResult> - implements ChatModel, StreamingChatModel { - - private static final Logger logger = LoggerFactory.getLogger(TongYiChatModel.class); - - /** - * DashScope generation client. - */ - private final Generation generation; - - /** - * The TongYi models default chat completion api. - */ - private TongYiChatOptions defaultOptions; - - /** - * User role message manager. - */ - @Autowired - private MessageManager msgManager; - - /** - * Initializes an instance of the TongYiChatClient. - * @param generation DashScope generation client. - */ - public TongYiChatModel(Generation generation) { - - this(generation, - TongYiChatOptions.builder() - .withTopP(0.8) - .withEnableSearch(true) - .withResultFormat(ConversationParam.ResultFormat.MESSAGE) - .build(), - null - ); - } - - /** - * Initializes an instance of the TongYiChatClient. - * @param generation DashScope generation client. - * @param options TongYi model params. - */ - public TongYiChatModel(Generation generation, TongYiChatOptions options) { - - this(generation, options, null); - } - - /** - * Create a TongYi models client. - * @param generation DashScope model generation client. - * @param options TongYi default chat completion api. - */ - public TongYiChatModel(Generation generation, TongYiChatOptions options, - FunctionCallbackContext functionCallbackContext) { - - super(functionCallbackContext); - this.generation = generation; - this.defaultOptions = options; - } - - /** - * Get default sca chat options. - * - * @return TongYiChatOptions default object. - */ - public TongYiChatOptions getDefaultOptions() { - - return this.defaultOptions; - } - - @Override - public ChatResponse call(Prompt prompt) { - - ConversationParam params = toTongYiChatParams(prompt); - - // TongYi models context loader. - com.alibaba.dashscope.common.Message message = new com.alibaba.dashscope.common.Message(); - message.setRole(Role.USER.getValue()); - message.setContent(prompt.getContents()); - msgManager.add(message); - params.setMessages(msgManager.get()); - - logger.trace("TongYi ConversationOptions: {}", params); - GenerationResult chatCompletions = this.callWithFunctionSupport(params); - logger.trace("TongYi ConversationOptions: {}", params); - - msgManager.add(chatCompletions); - - List generations = - chatCompletions - .getOutput() - .getChoices() - .stream() - .map(choice -> - new org.springframework.ai.chat.model.Generation( - choice - .getMessage() - .getContent() - ).withGenerationMetadata(generateChoiceMetadata(choice) - )) - .toList(); - - return new ChatResponse(generations); - - } - - @Override - public Flux stream(Prompt prompt) { - - Flowable genRes; - ConversationParam tongYiChatParams = toTongYiChatParams(prompt); - - // See https://help.aliyun.com/zh/dashscope/developer-reference/api-details?spm=a2c4g.11186623.0.0.655fc11aRR0jj7#b9ad0a10cfhpe - // tongYiChatParams.setIncrementalOutput(true); - - try { - genRes = generation.streamCall(tongYiChatParams); - } - catch (NoApiKeyException | InputRequiredException e) { - logger.warn("TongYi chat client: " + e.getMessage()); - throw new TongYiException(e.getMessage()); - } - - return Flux.from(genRes) - .flatMap( - message -> Flux.just( - message.getOutput() - .getChoices() - .get(0) - .getMessage() - .getContent()) - .map(content -> { - var gen = new org.springframework.ai.chat.model.Generation(content) - .withGenerationMetadata(generateChoiceMetadata( - message.getOutput() - .getChoices() - .get(0) - )); - return new ChatResponse(List.of(gen)); - }) - ) - .publishOn(Schedulers.parallel()); - - } - - /** - * Configuration properties to Qwen model params. - * Test access. - * - * @param prompt {@link Prompt} - * @return Qwen models params {@link ConversationParam} - */ - public ConversationParam toTongYiChatParams(Prompt prompt) { - - Set functionsForThisRequest = new HashSet<>(); - - List tongYiMessage = prompt.getInstructions().stream() - .map(this::fromSpringAIMessage) - .toList(); - - ConversationParam chatParams = ConversationParam.builder() - .messages(tongYiMessage) - // models setting - // {@link HalfDuplexServiceParam#models} - .model(Generation.Models.QWEN_TURBO) - // {@link GenerationOutput} - .resultFormat(ConversationParam.ResultFormat.MESSAGE) - .incrementalOutput(true) - - .build(); - - if (this.defaultOptions != null) { - - chatParams = merge(chatParams, this.defaultOptions); - Set defaultEnabledFunctions = this.handleFunctionCallbackConfigurations(this.defaultOptions, !IS_RUNTIME_CALL); - functionsForThisRequest.addAll(defaultEnabledFunctions); - } - if (prompt.getOptions() != null) { - if (prompt.getOptions() instanceof ChatOptions runtimeOptions) { - TongYiChatOptions updatedRuntimeOptions = ModelOptionsUtils.copyToTarget(runtimeOptions, - ChatOptions.class, TongYiChatOptions.class); - - chatParams = merge(updatedRuntimeOptions, chatParams); - - Set promptEnabledFunctions = this.handleFunctionCallbackConfigurations(updatedRuntimeOptions, - IS_RUNTIME_CALL); - functionsForThisRequest.addAll(promptEnabledFunctions); - - } - else { - throw new IllegalArgumentException("Prompt options are not of type ConversationParam:" - + prompt.getOptions().getClass().getSimpleName()); - } - } - - // Add the enabled functions definitions to the request's tools parameter. - - if (!CollectionUtils.isEmpty(functionsForThisRequest)) { - List tools = this.getFunctionTools(functionsForThisRequest); - - // todo chatParams.setTools(tools) - } - - return chatParams; - } - - private ChatGenerationMetadata generateChoiceMetadata(GenerationOutput.Choice choice) { - - return ChatGenerationMetadata.from( - String.valueOf(choice.getFinishReason()), - choice.getMessage().getContent() - ); - } - - private List getFunctionTools(Set functionNames) { - return this.resolveFunctionCallbacks(functionNames).stream().map(functionCallback -> { - - FunctionDefinition functionDefinition = FunctionDefinition.builder() - .name(functionCallback.getName()) - .description(functionCallback.getDescription()) - .parameters(JsonUtils.parametersToJsonObject( - ModelOptionsUtils.jsonToMap(functionCallback.getInputTypeSchema()) - )) - .build(); - - return functionDefinition; - }).toList(); - } - - - private ConversationParam merge(ConversationParam tongYiParams, TongYiChatOptions scaChatParams) { - - if (scaChatParams == null) { - - return tongYiParams; - } - - return ConversationParam.builder() - .messages(tongYiParams.getMessages()) - .maxTokens((tongYiParams.getMaxTokens() != null) ? tongYiParams.getMaxTokens() : scaChatParams.getMaxTokens()) - // When merge options. Because ConversationParams is must not null. So is setting. - .model(scaChatParams.getModel()) - .resultFormat((tongYiParams.getResultFormat() != null) ? tongYiParams.getResultFormat() : scaChatParams.getResultFormat()) - .enableSearch((tongYiParams.getEnableSearch() != null) ? tongYiParams.getEnableSearch() : scaChatParams.getEnableSearch()) - .topK((tongYiParams.getTopK() != null) ? tongYiParams.getTopK() : scaChatParams.getTopK()) - .topP((tongYiParams.getTopP() != null) ? tongYiParams.getTopP() : scaChatParams.getTopP()) - .incrementalOutput((tongYiParams.getIncrementalOutput() != null) ? tongYiParams.getIncrementalOutput() : scaChatParams.getIncrementalOutput()) - .temperature((tongYiParams.getTemperature() != null) ? tongYiParams.getTemperature() : scaChatParams.getTemperature()) - .repetitionPenalty((tongYiParams.getRepetitionPenalty() != null) ? tongYiParams.getRepetitionPenalty() : scaChatParams.getRepetitionPenalty()) - .seed((tongYiParams.getSeed() != null) ? tongYiParams.getSeed() : scaChatParams.getSeed()) - .build(); - - } - - private ConversationParam merge(TongYiChatOptions scaChatParams, ConversationParam tongYiParams) { - - if (scaChatParams == null) { - - return tongYiParams; - } - - ConversationParam mergedTongYiParams = ConversationParam.builder() - .model(Generation.Models.QWEN_TURBO) - .messages(tongYiParams.getMessages()) - .build(); - mergedTongYiParams = merge(tongYiParams, scaChatParams); - - if (scaChatParams.getMaxTokens() != null) { - mergedTongYiParams.setMaxTokens(scaChatParams.getMaxTokens()); - } - - if (scaChatParams.getStop() != null) { - mergedTongYiParams.setStopStrings(scaChatParams.getStop()); - } - - if (scaChatParams.getTemperature() != null) { - mergedTongYiParams.setTemperature(scaChatParams.getTemperature()); - } - - if (scaChatParams.getTopK() != null) { - mergedTongYiParams.setTopK(scaChatParams.getTopK()); - } - - if (scaChatParams.getTopK() != null) { - mergedTongYiParams.setTopK(scaChatParams.getTopK()); - } - - return mergedTongYiParams; - } - - private com.alibaba.dashscope.common.Message fromSpringAIMessage(Message message) { - - return switch (message.getMessageType()) { - case USER -> com.alibaba.dashscope.common.Message.builder() - .role(Role.USER.getValue()) - .content(message.getContent()) - .build(); - case SYSTEM -> com.alibaba.dashscope.common.Message.builder() - .role(Role.SYSTEM.getValue()) - .content(message.getContent()) - .build(); - case ASSISTANT -> com.alibaba.dashscope.common.Message.builder() - .role(Role.ASSISTANT.getValue()) - .content(message.getContent()) - .build(); - default -> throw new IllegalArgumentException("Unknown message type " + message.getMessageType()); - }; - - } - - @Override - protected ConversationParam doCreateToolResponseRequest( - ConversationParam previousRequest, - com.alibaba.dashscope.common.Message responseMessage, - List conversationHistory - ) { - for (ToolCallBase toolCall : responseMessage.getToolCalls()) { - if (toolCall instanceof ToolCallFunction toolCallFunction) { - if (toolCallFunction.getFunction() != null) { - var functionName = toolCallFunction.getFunction().getName(); - var functionArguments = toolCallFunction.getFunction().getArguments(); - - if (!this.functionCallbackRegister.containsKey(functionName)) { - throw new IllegalStateException("No function callback found for function name: " + functionName); - } - - String functionResponse = this.functionCallbackRegister.get(functionName).call(functionArguments); - - // Add the function response to the conversation. - conversationHistory - .add(com.alibaba.dashscope.common.Message.builder() - .content(functionResponse) - .role(Role.BOT.getValue()) - .toolCallId(toolCall.getId()) - .build() - ); - } - } - - } - - ConversationParam newRequest = ConversationParam.builder().messages(conversationHistory).build(); - - // todo: No @JsonProperty fields. - newRequest = ModelOptionsUtils.merge(newRequest, previousRequest, ConversationParam.class); - - return newRequest; - - } - - @Override - protected List doGetUserMessages(ConversationParam request) { - - return request.getMessages(); - } - - @Override - protected com.alibaba.dashscope.common.Message doGetToolResponseMessage(GenerationResult response) { - - var message = response.getOutput().getChoices().get(0).getMessage(); - var assistantMessage = com.alibaba.dashscope.common.Message.builder().role(Role.ASSISTANT.getValue()) - .content("").build(); - assistantMessage.setToolCalls(message.getToolCalls()); - - return assistantMessage; - } - - @Override - protected GenerationResult doChatCompletion(ConversationParam request) { - - GenerationResult result; - try { - result = generation.call(request); - } - catch (NoApiKeyException | InputRequiredException e) { - throw new RuntimeException(e); - } - - return result; - } - - @Override - protected Flux doChatCompletionStream(ConversationParam request) { - final Flowable genRes; - try { - genRes = generation.streamCall(request); - } - catch (NoApiKeyException | InputRequiredException e) { - logger.warn("TongYi chat client: " + e.getMessage()); - throw new TongYiException(e.getMessage()); - } - return Flux.from(genRes); - - } - - @Override - protected boolean isToolFunctionCall(GenerationResult response) { - - if (response == null || CollectionUtils.isEmpty(response.getOutput().getChoices())) { - - return false; - } - var choice = response.getOutput().getChoices().get(0); - if (choice == null || choice.getFinishReason() == null) { - - return false; - } + AbstractFunctionCallSupport< + com.alibaba.dashscope.common.Message, + ConversationParam, + GenerationResult> + implements ChatModel, StreamingChatModel { + + private static final Logger logger = LoggerFactory.getLogger(TongYiChatModel.class); + + /** + * DashScope generation client. + */ + private final Generation generation; + + /** + * The TongYi models default chat completion api. + */ + private TongYiChatOptions defaultOptions; + + /** + * User role message manager. + */ + @Autowired + private MessageManager msgManager; + + /** + * Initializes an instance of the TongYiChatClient. + * + * @param generation DashScope generation client. + */ + public TongYiChatModel(Generation generation) { + + this(generation, + TongYiChatOptions.builder() + .withTopP(0.8) + .withEnableSearch(true) + .withResultFormat(ConversationParam.ResultFormat.MESSAGE) + .build(), + null + ); + } + + /** + * Initializes an instance of the TongYiChatClient. + * + * @param generation DashScope generation client. + * @param options TongYi model params. + */ + public TongYiChatModel(Generation generation, TongYiChatOptions options) { + + this(generation, options, null); + } + + /** + * Create a TongYi models client. + * + * @param generation DashScope model generation client. + * @param options TongYi default chat completion api. + */ + public TongYiChatModel(Generation generation, TongYiChatOptions options, + FunctionCallbackContext functionCallbackContext) { + + super(functionCallbackContext); + this.generation = generation; + this.defaultOptions = options; + } + + /** + * Get default sca chat options. + * + * @return TongYiChatOptions default object. + */ + public TongYiChatOptions getDefaultOptions() { + + return this.defaultOptions; + } + + @Override + public ChatResponse call(Prompt prompt) { + + ConversationParam params = toTongYiChatParams(prompt); + + // TongYi models context loader. + com.alibaba.dashscope.common.Message message = new com.alibaba.dashscope.common.Message(); + message.setRole(Role.USER.getValue()); + message.setContent(prompt.getContents()); + msgManager.add(message); + params.setMessages(msgManager.get()); + + logger.trace("TongYi ConversationOptions: {}", params); + GenerationResult chatCompletions = this.callWithFunctionSupport(params); + logger.trace("TongYi ConversationOptions: {}", params); + + msgManager.add(chatCompletions); + + List generations = + chatCompletions + .getOutput() + .getChoices() + .stream() + .map(choice -> + new org.springframework.ai.chat.model.Generation( + choice + .getMessage() + .getContent() + ).withGenerationMetadata(generateChoiceMetadata(choice) + )) + .toList(); + + return new ChatResponse(generations); + + } + + @Override + public Flux stream(Prompt prompt) { + + Flowable genRes; + ConversationParam tongYiChatParams = toTongYiChatParams(prompt); + + // See https://help.aliyun.com/zh/dashscope/developer-reference/api-details?spm=a2c4g.11186623.0.0.655fc11aRR0jj7#b9ad0a10cfhpe + // tongYiChatParams.setIncrementalOutput(true); + + try { + genRes = generation.streamCall(tongYiChatParams); + } catch (NoApiKeyException | InputRequiredException e) { + logger.warn("TongYi chat client: " + e.getMessage()); + throw new TongYiException(e.getMessage()); + } + + return Flux.from(genRes) + .flatMap( + message -> Flux.just( + message.getOutput() + .getChoices() + .get(0) + .getMessage() + .getContent()) + .map(content -> { + var gen = new org.springframework.ai.chat.model.Generation(content) + .withGenerationMetadata(generateChoiceMetadata( + message.getOutput() + .getChoices() + .get(0) + )); + return new ChatResponse(List.of(gen)); + }) + ) + .publishOn(Schedulers.parallel()); + + } + + /** + * Configuration properties to Qwen model params. + * Test access. + * + * @param prompt {@link Prompt} + * @return Qwen models params {@link ConversationParam} + */ + public ConversationParam toTongYiChatParams(Prompt prompt) { + + Set functionsForThisRequest = new HashSet<>(); + + List tongYiMessage = prompt.getInstructions().stream() + .map(this::fromSpringAIMessage) + .toList(); + + ConversationParam chatParams = ConversationParam.builder() + .messages(tongYiMessage) + // models setting + // {@link HalfDuplexServiceParam#models} + .model(Generation.Models.QWEN_TURBO) + // {@link GenerationOutput} + .resultFormat(ConversationParam.ResultFormat.MESSAGE) + .incrementalOutput(true) + + .build(); + + if (this.defaultOptions != null) { + + chatParams = merge(chatParams, this.defaultOptions); + Set defaultEnabledFunctions = this.handleFunctionCallbackConfigurations(this.defaultOptions, !IS_RUNTIME_CALL); + functionsForThisRequest.addAll(defaultEnabledFunctions); + } + if (prompt.getOptions() != null) { + if (prompt.getOptions() instanceof ChatOptions runtimeOptions){ + TongYiChatOptions updatedRuntimeOptions = ModelOptionsUtils.copyToTarget(runtimeOptions, + ChatOptions.class, TongYiChatOptions.class); + + chatParams = merge(updatedRuntimeOptions, chatParams); + + Set promptEnabledFunctions = this.handleFunctionCallbackConfigurations(updatedRuntimeOptions, + IS_RUNTIME_CALL); + functionsForThisRequest.addAll(promptEnabledFunctions); + + } + else{ + throw new IllegalArgumentException("Prompt options are not of type ConversationParam:" + + prompt.getOptions().getClass().getSimpleName()); + } + } + + // Add the enabled functions definitions to the request's tools parameter. + + if (!CollectionUtils.isEmpty(functionsForThisRequest)) { + List tools = this.getFunctionTools(functionsForThisRequest); + + // todo chatParams.setTools(tools) + } + + return chatParams; + } + + private ChatGenerationMetadata generateChoiceMetadata(GenerationOutput.Choice choice) { + + return ChatGenerationMetadata.from( + String.valueOf(choice.getFinishReason()), + choice.getMessage().getContent() + ); + } + + private List getFunctionTools(Set functionNames) { + return this.resolveFunctionCallbacks(functionNames).stream().map(functionCallback -> { + + FunctionDefinition functionDefinition = FunctionDefinition.builder() + .name(functionCallback.getName()) + .description(functionCallback.getDescription()) + .parameters(JsonUtils.parametersToJsonObject( + ModelOptionsUtils.jsonToMap(functionCallback.getInputTypeSchema()) + )) + .build(); + + return functionDefinition; + }).toList(); + } + + + private ConversationParam merge(ConversationParam tongYiParams, TongYiChatOptions scaChatParams) { + + if (scaChatParams == null) { + + return tongYiParams; + } + + return ConversationParam.builder() + .messages(tongYiParams.getMessages()) + .maxTokens((tongYiParams.getMaxTokens() != null) ? tongYiParams.getMaxTokens() : scaChatParams.getMaxTokens()) + // When merge options. Because ConversationParams is must not null. So is setting. + .model(scaChatParams.getModel()) + .resultFormat((tongYiParams.getResultFormat() != null) ? tongYiParams.getResultFormat() : scaChatParams.getResultFormat()) + .enableSearch((tongYiParams.getEnableSearch() != null) ? tongYiParams.getEnableSearch() : scaChatParams.getEnableSearch()) + .topK((tongYiParams.getTopK() != null) ? tongYiParams.getTopK() : scaChatParams.getTopK()) + .topP((tongYiParams.getTopP() != null) ? tongYiParams.getTopP() : scaChatParams.getTopP()) + .incrementalOutput((tongYiParams.getIncrementalOutput() != null) ? tongYiParams.getIncrementalOutput() : scaChatParams.getIncrementalOutput()) + .temperature((tongYiParams.getTemperature() != null) ? tongYiParams.getTemperature() : scaChatParams.getTemperature()) + .repetitionPenalty((tongYiParams.getRepetitionPenalty() != null) ? tongYiParams.getRepetitionPenalty() : scaChatParams.getRepetitionPenalty()) + .seed((tongYiParams.getSeed() != null) ? tongYiParams.getSeed() : scaChatParams.getSeed()) + .build(); + + } + + private ConversationParam merge(TongYiChatOptions scaChatParams, ConversationParam tongYiParams) { + + if (scaChatParams == null) { + + return tongYiParams; + } + + ConversationParam mergedTongYiParams = ConversationParam.builder() + .model(Generation.Models.QWEN_TURBO) + .messages(tongYiParams.getMessages()) + .build(); + mergedTongYiParams = merge(tongYiParams, scaChatParams); + + if (scaChatParams.getMaxTokens() != null) { + mergedTongYiParams.setMaxTokens(scaChatParams.getMaxTokens()); + } + + if (scaChatParams.getStop() != null) { + mergedTongYiParams.setStopStrings(scaChatParams.getStop()); + } + + if (scaChatParams.getTemperature() != null) { + mergedTongYiParams.setTemperature(scaChatParams.getTemperature()); + } + + if (scaChatParams.getTopK() != null) { + mergedTongYiParams.setTopK(scaChatParams.getTopK()); + } + + if (scaChatParams.getTopK() != null) { + mergedTongYiParams.setTopK(scaChatParams.getTopK()); + } + + return mergedTongYiParams; + } + + private com.alibaba.dashscope.common.Message fromSpringAIMessage(Message message) { + + return switch (message.getMessageType()) { + case USER -> com.alibaba.dashscope.common.Message.builder() + .role(Role.USER.getValue()) + .content(message.getContent()) + .build(); + case SYSTEM -> com.alibaba.dashscope.common.Message.builder() + .role(Role.SYSTEM.getValue()) + .content(message.getContent()) + .build(); + case ASSISTANT -> com.alibaba.dashscope.common.Message.builder() + .role(Role.ASSISTANT.getValue()) + .content(message.getContent()) + .build(); + default -> throw new IllegalArgumentException("Unknown message type " + message.getMessageType()); + }; + + } + + @Override + protected ConversationParam doCreateToolResponseRequest( + ConversationParam previousRequest, + com.alibaba.dashscope.common.Message responseMessage, + List conversationHistory + ) { + for (ToolCallBase toolCall : responseMessage.getToolCalls()) { + if (toolCall instanceof ToolCallFunction toolCallFunction){ + if (toolCallFunction.getFunction() != null) { + var functionName = toolCallFunction.getFunction().getName(); + var functionArguments = toolCallFunction.getFunction().getArguments(); + + if (!this.functionCallbackRegister.containsKey(functionName)) { + throw new IllegalStateException("No function callback found for function name: " + functionName); + } + + String functionResponse = this.functionCallbackRegister.get(functionName).call(functionArguments); + + // Add the function response to the conversation. + conversationHistory + .add(com.alibaba.dashscope.common.Message.builder() + .content(functionResponse) + .role(Role.BOT.getValue()) + .toolCallId(toolCall.getId()) + .build() + ); + } + } + + } + + ConversationParam newRequest = ConversationParam.builder().messages(conversationHistory).build(); + + // todo: No @JsonProperty fields. + newRequest = ModelOptionsUtils.merge(newRequest, previousRequest, ConversationParam.class); + + return newRequest; + + } + + @Override + protected List doGetUserMessages(ConversationParam request) { + + return request.getMessages(); + } + + @Override + protected com.alibaba.dashscope.common.Message doGetToolResponseMessage(GenerationResult response) { + + var message = response.getOutput().getChoices().get(0).getMessage(); + var assistantMessage = com.alibaba.dashscope.common.Message.builder().role(Role.ASSISTANT.getValue()) + .content("").build(); + assistantMessage.setToolCalls(message.getToolCalls()); + + return assistantMessage; + } + + @Override + protected GenerationResult doChatCompletion(ConversationParam request) { + + GenerationResult result; + try { + result = generation.call(request); + } catch (NoApiKeyException | InputRequiredException e) { + throw new RuntimeException(e); + } + + return result; + } + + @Override + protected Flux doChatCompletionStream(ConversationParam request) { + final Flowable genRes; + try { + genRes = generation.streamCall(request); + } catch (NoApiKeyException | InputRequiredException e) { + logger.warn("TongYi chat client: " + e.getMessage()); + throw new TongYiException(e.getMessage()); + } + return Flux.from(genRes); + + } + + @Override + protected boolean isToolFunctionCall(GenerationResult response) { + + if (response == null || CollectionUtils.isEmpty(response.getOutput().getChoices())) { + + return false; + } + var choice = response.getOutput().getChoices().get(0); + if (choice == null || choice.getFinishReason() == null) { + + return false; + } - return Objects.equals(choice.getFinishReason(), ApiKeywords.TOOL_CALLS); - } + return Objects.equals(choice.getFinishReason(), ApiKeywords.TOOL_CALLS); + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/chat/TongYiChatOptions.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/chat/TongYiChatOptions.java index 20005fd..4255ab9 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/chat/TongYiChatOptions.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/chat/TongYiChatOptions.java @@ -33,431 +33,431 @@ import java.util.*; public class TongYiChatOptions implements FunctionCallingOptions, ChatOptions { - /** - * TongYi Models. - * {@link Generation.Models} - */ - private String model = Generation.Models.QWEN_TURBO; - - /** - * The random number seed used in generation, the user controls the randomness of the content generated by the model. - * seed supports unsigned 64-bit integers, with a default value of 1234. - * when using seed, the model will generate the same or similar results as much as possible, but there is currently no guarantee that the results will be exactly the same each time. - */ - private Integer seed = 1234; - - /** - * Used to specify the maximum number of tokens that the model can generate when generating content, - * it defines the upper limit of generation but does not guarantee that this number will be generated every time. - * For qwen-turbo the maximum and default values are 1500 tokens. - * The qwen-max, qwen-max-1201, qwen-max-longcontext, and qwen-plus models have a maximum and default value of 2000 tokens. - */ - private Integer maxTokens = 1500; - - /** - * The generation process kernel sampling method probability threshold, - * for example, takes the value of 0.8, only retains the smallest set of the most probable tokens with probabilities that add up to greater than or equal to 0.8 as the candidate set. - * The range of values is (0,1.0), the larger the value, the higher the randomness of generation; the lower the value, the higher the certainty of generation. - */ - private Double topP = 0.8; - - /** - * The size of the sampling candidate set at the time of generation. - * For example, with a value of 50, only the 50 highest scoring tokens in a single generation will form a randomly sampled candidate set. - * The larger the value, the higher the randomness of the generation; the smaller the value, the higher the certainty of the generation. - * This parameter is not passed by default, and a value of None or when top_k is greater than 100 indicates that the top_k policy is not enabled, - * at which time, only the top_p policy is in effect. - */ - private Integer topK; - - /** - * Used to control the repeatability of model generation. - * Increasing repetition_penalty reduces the repetition of model generation. 1.0 means no penalty. - */ - private Double repetitionPenalty = 1.1; - - /** - * is used to control the degree of randomness and diversity. - * Specifically, the temperature value controls the extent to which the probability distribution of each candidate word is smoothed when generating text. - * Higher values of temperature reduce the peak of the probability distribution, allowing more low-probability words to be selected and generating more diverse results, - * while lower values of temperature enhance the peak of the probability distribution, making it easier for high-probability words to be selected and generating more certain results. - * Range: [0, 2), 0 is not recommended, meaningless. - * java version >= 2.5.1 - */ - private Double temperature = 0.85; - - /** - * The stop parameter is used to realize precise control of the content generation process, automatically stopping when the generated content is about to contain the specified string or token_ids, - * and the generated content does not contain the specified content. - * For example, if stop is specified as "Hello", it means stop when "Hello" will be generated; if stop is specified as [37763, 367], it means stop when "Observation" will be generated. - * The stop parameter can be passed as a list of arrays of strings or token_ids to support the scenario of using multiple stops. - * Explanation: Do not mix strings and token_ids in list mode, the element types should be the same in list mode. - */ - private List stop; - - /** - * Whether or not to use stream output. When outputting the result in stream mode, the interface returns the result as generator, - * you need to iterate to get the result, the default output is the whole sequence of the current generation for each output, - * the last output is the final result of all the generation, you can change the output mode to non-incremental output by the parameter incremental_output to False. - */ - private Boolean stream = false; - - /** - * The model has a built-in Internet search service. - * This parameter controls whether the model refers to the use of Internet search results when generating text. The values are as follows: - * True: enable internet search, the model will use the search result as the reference information in the text generation process, but the model will "judge by itself" whether to use the internet search result based on its internal logic. - * False (default): Internet search is disabled. - */ - private Boolean enableSearch = false; + /** + * TongYi Models. + * {@link Generation.Models} + */ + private String model = Generation.Models.QWEN_TURBO; + + /** + * The random number seed used in generation, the user controls the randomness of the content generated by the model. + * seed supports unsigned 64-bit integers, with a default value of 1234. + * when using seed, the model will generate the same or similar results as much as possible, but there is currently no guarantee that the results will be exactly the same each time. + */ + private Integer seed = 1234; + + /** + * Used to specify the maximum number of tokens that the model can generate when generating content, + * it defines the upper limit of generation but does not guarantee that this number will be generated every time. + * For qwen-turbo the maximum and default values are 1500 tokens. + * The qwen-max, qwen-max-1201, qwen-max-longcontext, and qwen-plus models have a maximum and default value of 2000 tokens. + */ + private Integer maxTokens = 1500; + + /** + * The generation process kernel sampling method probability threshold, + * for example, takes the value of 0.8, only retains the smallest set of the most probable tokens with probabilities that add up to greater than or equal to 0.8 as the candidate set. + * The range of values is (0,1.0), the larger the value, the higher the randomness of generation; the lower the value, the higher the certainty of generation. + */ + private Double topP = 0.8; + + /** + * The size of the sampling candidate set at the time of generation. + * For example, with a value of 50, only the 50 highest scoring tokens in a single generation will form a randomly sampled candidate set. + * The larger the value, the higher the randomness of the generation; the smaller the value, the higher the certainty of the generation. + * This parameter is not passed by default, and a value of None or when top_k is greater than 100 indicates that the top_k policy is not enabled, + * at which time, only the top_p policy is in effect. + */ + private Integer topK; + + /** + * Used to control the repeatability of model generation. + * Increasing repetition_penalty reduces the repetition of model generation. 1.0 means no penalty. + */ + private Double repetitionPenalty = 1.1; + + /** + * is used to control the degree of randomness and diversity. + * Specifically, the temperature value controls the extent to which the probability distribution of each candidate word is smoothed when generating text. + * Higher values of temperature reduce the peak of the probability distribution, allowing more low-probability words to be selected and generating more diverse results, + * while lower values of temperature enhance the peak of the probability distribution, making it easier for high-probability words to be selected and generating more certain results. + * Range: [0, 2), 0 is not recommended, meaningless. + * java version >= 2.5.1 + */ + private Double temperature = 0.85; + + /** + * The stop parameter is used to realize precise control of the content generation process, automatically stopping when the generated content is about to contain the specified string or token_ids, + * and the generated content does not contain the specified content. + * For example, if stop is specified as "Hello", it means stop when "Hello" will be generated; if stop is specified as [37763, 367], it means stop when "Observation" will be generated. + * The stop parameter can be passed as a list of arrays of strings or token_ids to support the scenario of using multiple stops. + * Explanation: Do not mix strings and token_ids in list mode, the element types should be the same in list mode. + */ + private List stop; + + /** + * Whether or not to use stream output. When outputting the result in stream mode, the interface returns the result as generator, + * you need to iterate to get the result, the default output is the whole sequence of the current generation for each output, + * the last output is the final result of all the generation, you can change the output mode to non-incremental output by the parameter incremental_output to False. + */ + private Boolean stream = false; + + /** + * The model has a built-in Internet search service. + * This parameter controls whether the model refers to the use of Internet search results when generating text. The values are as follows: + * True: enable internet search, the model will use the search result as the reference information in the text generation process, but the model will "judge by itself" whether to use the internet search result based on its internal logic. + * False (default): Internet search is disabled. + */ + private Boolean enableSearch = false; - /** - * [text|message], defaults to text, when it is message, - * the output refers to the message result example. - * It is recommended to prioritize the use of message format. - */ - private String resultFormat = GenerationParam.ResultFormat.MESSAGE; + /** + * [text|message], defaults to text, when it is message, + * the output refers to the message result example. + * It is recommended to prioritize the use of message format. + */ + private String resultFormat = GenerationParam.ResultFormat.MESSAGE; - /** - * Control the streaming output mode, that is, the content will contain the content has been output; - * set to True, will open the incremental output mode, the output will not contain the content has been output, - * you need to splice the whole output, refer to the streaming output sample code. - */ - private Boolean incrementalOutput = false; + /** + * Control the streaming output mode, that is, the content will contain the content has been output; + * set to True, will open the incremental output mode, the output will not contain the content has been output, + * you need to splice the whole output, refer to the streaming output sample code. + */ + private Boolean incrementalOutput = false; - /** - * A list of tools that the model can optionally call. - * Currently only functions are supported, and even if multiple functions are entered, the model will only select one to generate the result. - */ - private List tools; + /** + * A list of tools that the model can optionally call. + * Currently only functions are supported, and even if multiple functions are entered, the model will only select one to generate the result. + */ + private List tools; - @Override - public Float getTemperature() { + @Override + public Float getTemperature() { - return this.temperature.floatValue(); - } + return this.temperature.floatValue(); + } - public void setTemperature(Float temperature) { + public void setTemperature(Float temperature) { - this.temperature = temperature.doubleValue(); - } + this.temperature = temperature.doubleValue(); + } - @Override - public Float getTopP() { + @Override + public Float getTopP() { - return this.topP.floatValue(); - } + return this.topP.floatValue(); + } - public void setTopP(Float topP) { + public void setTopP(Float topP) { - this.topP = topP.doubleValue(); - } + this.topP = topP.doubleValue(); + } - @Override - public Integer getTopK() { + @Override + public Integer getTopK() { - return this.topK; - } + return this.topK; + } - public void setTopK(Integer topK) { + public void setTopK(Integer topK) { - this.topK = topK; - } + this.topK = topK; + } - public String getModel() { + public String getModel() { - return model; - } + return model; + } - public void setModel(String model) { + public void setModel(String model) { - this.model = model; - } + this.model = model; + } - public Integer getSeed() { + public Integer getSeed() { - return seed; - } + return seed; + } - public String getResultFormat() { + public String getResultFormat() { - return resultFormat; - } + return resultFormat; + } - public void setResultFormat(String resultFormat) { + public void setResultFormat(String resultFormat) { - this.resultFormat = resultFormat; - } + this.resultFormat = resultFormat; + } - public void setSeed(Integer seed) { + public void setSeed(Integer seed) { - this.seed = seed; - } + this.seed = seed; + } - public Integer getMaxTokens() { + public Integer getMaxTokens() { - return maxTokens; - } + return maxTokens; + } - public void setMaxTokens(Integer maxTokens) { + public void setMaxTokens(Integer maxTokens) { - this.maxTokens = maxTokens; - } + this.maxTokens = maxTokens; + } - public Float getRepetitionPenalty() { + public Float getRepetitionPenalty() { - return repetitionPenalty.floatValue(); - } + return repetitionPenalty.floatValue(); + } - public void setRepetitionPenalty(Float repetitionPenalty) { + public void setRepetitionPenalty(Float repetitionPenalty) { - this.repetitionPenalty = repetitionPenalty.doubleValue(); - } + this.repetitionPenalty = repetitionPenalty.doubleValue(); + } - public List getStop() { + public List getStop() { - return stop; - } + return stop; + } - public void setStop(List stop) { + public void setStop(List stop) { - this.stop = stop; - } + this.stop = stop; + } - public Boolean getStream() { + public Boolean getStream() { - return stream; - } + return stream; + } - public void setStream(Boolean stream) { + public void setStream(Boolean stream) { - this.stream = stream; - } + this.stream = stream; + } - public Boolean getEnableSearch() { + public Boolean getEnableSearch() { - return enableSearch; - } + return enableSearch; + } - public void setEnableSearch(Boolean enableSearch) { + public void setEnableSearch(Boolean enableSearch) { - this.enableSearch = enableSearch; - } + this.enableSearch = enableSearch; + } - public Boolean getIncrementalOutput() { + public Boolean getIncrementalOutput() { - return incrementalOutput; - } + return incrementalOutput; + } - public void setIncrementalOutput(Boolean incrementalOutput) { + public void setIncrementalOutput(Boolean incrementalOutput) { - this.incrementalOutput = incrementalOutput; - } + this.incrementalOutput = incrementalOutput; + } - public List getTools() { + public List getTools() { - return tools; - } + return tools; + } - public void setTools(List tools) { + public void setTools(List tools) { - this.tools = tools; - } + this.tools = tools; + } - private List functionCallbacks = new ArrayList<>(); + private List functionCallbacks = new ArrayList<>(); - private Set functions = new HashSet<>(); + private Set functions = new HashSet<>(); - @Override - public List getFunctionCallbacks() { + @Override + public List getFunctionCallbacks() { - return this.functionCallbacks; - } + return this.functionCallbacks; + } - @Override - public void setFunctionCallbacks(List functionCallbacks) { + @Override + public void setFunctionCallbacks(List functionCallbacks) { - this.functionCallbacks = functionCallbacks; - } + this.functionCallbacks = functionCallbacks; + } - @Override - public Set getFunctions() { + @Override + public Set getFunctions() { - return this.functions; - } + return this.functions; + } - @Override - public void setFunctions(Set functions) { + @Override + public void setFunctions(Set functions) { - this.functions = functions; - } + this.functions = functions; + } - @Override - public boolean equals(Object o) { + @Override + public boolean equals(Object o) { - if (this == o) { - return true; - } + if (this == o) { + return true; + } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (o == null || getClass() != o.getClass()) { + return false; + } - TongYiChatOptions that = (TongYiChatOptions) o; + TongYiChatOptions that = (TongYiChatOptions) o; - return Objects.equals(model, that.model) - && Objects.equals(seed, that.seed) - && Objects.equals(maxTokens, that.maxTokens) - && Objects.equals(topP, that.topP) - && Objects.equals(topK, that.topK) - && Objects.equals(repetitionPenalty, that.repetitionPenalty) - && Objects.equals(temperature, that.temperature) - && Objects.equals(stop, that.stop) - && Objects.equals(stream, that.stream) - && Objects.equals(enableSearch, that.enableSearch) - && Objects.equals(resultFormat, that.resultFormat) - && Objects.equals(incrementalOutput, that.incrementalOutput) - && Objects.equals(tools, that.tools) - && Objects.equals(functionCallbacks, that.functionCallbacks) - && Objects.equals(functions, that.functions); - } + return Objects.equals(model, that.model) + && Objects.equals(seed, that.seed) + && Objects.equals(maxTokens, that.maxTokens) + && Objects.equals(topP, that.topP) + && Objects.equals(topK, that.topK) + && Objects.equals(repetitionPenalty, that.repetitionPenalty) + && Objects.equals(temperature, that.temperature) + && Objects.equals(stop, that.stop) + && Objects.equals(stream, that.stream) + && Objects.equals(enableSearch, that.enableSearch) + && Objects.equals(resultFormat, that.resultFormat) + && Objects.equals(incrementalOutput, that.incrementalOutput) + && Objects.equals(tools, that.tools) + && Objects.equals(functionCallbacks, that.functionCallbacks) + && Objects.equals(functions, that.functions); + } - @Override - public int hashCode() { + @Override + public int hashCode() { - return Objects.hash( - model, - seed, - maxTokens, - topP, - topK, - repetitionPenalty, - temperature, - stop, - stream, - enableSearch, - resultFormat, - incrementalOutput, - tools, - functionCallbacks, - functions - ); - } - - @Override - public String toString() { - - final StringBuilder sb = new StringBuilder("TongYiChatOptions{"); - - sb.append(", model='").append(model).append('\''); - sb.append(", seed=").append(seed); - sb.append(", maxTokens=").append(maxTokens); - sb.append(", topP=").append(topP); - sb.append(", topK=").append(topK); - sb.append(", repetitionPenalty=").append(repetitionPenalty); - sb.append(", temperature=").append(temperature); - sb.append(", stop=").append(stop); - sb.append(", stream=").append(stream); - sb.append(", enableSearch=").append(enableSearch); - sb.append(", resultFormat='").append(resultFormat).append('\''); - sb.append(", incrementalOutput=").append(incrementalOutput); - sb.append(", tools=").append(tools); - sb.append(", functionCallbacks=").append(functionCallbacks); - sb.append(", functions=").append(functions); - sb.append('}'); - - return sb.toString(); - } - - public static Builder builder() { - - return new Builder(); - } - - public static class Builder { - - protected TongYiChatOptions options; - - public Builder() { - - this.options = new TongYiChatOptions(); - } - - public Builder(TongYiChatOptions options) { - - this.options = options; - } - - public Builder withModel(String model) { - this.options.model = model; - return this; - } - - public Builder withMaxTokens(Integer maxTokens) { - this.options.maxTokens = maxTokens; - return this; - } - - public Builder withResultFormat(String rf) { - this.options.resultFormat = rf; - return this; - } - - public Builder withEnableSearch(Boolean enableSearch) { - this.options.enableSearch = enableSearch; - return this; - } - - public Builder withFunctionCallbacks(List functionCallbacks) { - this.options.functionCallbacks = functionCallbacks; - return this; - } - - public Builder withFunctions(Set functionNames) { - Assert.notNull(functionNames, "Function names must not be null"); - this.options.functions = functionNames; - return this; - } - - public Builder withFunction(String functionName) { - Assert.hasText(functionName, "Function name must not be empty"); - this.options.functions.add(functionName); - return this; - } - - public Builder withSeed(Integer seed) { - this.options.seed = seed; - return this; - } - - public Builder withStop(List stop) { - this.options.stop = stop; - return this; - } - - public Builder withTemperature(Double temperature) { - this.options.temperature = temperature; - return this; - } - - public Builder withTopP(Double topP) { - this.options.topP = topP; - return this; - } - - public Builder withTopK(Integer topK) { - this.options.topK = topK; - return this; - } - - public Builder withRepetitionPenalty(Double repetitionPenalty) { - this.options.repetitionPenalty = repetitionPenalty; - return this; - } - - public TongYiChatOptions build() { - - return this.options; - } - } + return Objects.hash( + model, + seed, + maxTokens, + topP, + topK, + repetitionPenalty, + temperature, + stop, + stream, + enableSearch, + resultFormat, + incrementalOutput, + tools, + functionCallbacks, + functions + ); + } + + @Override + public String toString() { + + final StringBuilder sb = new StringBuilder("TongYiChatOptions{"); + + sb.append(", model='").append(model).append('\''); + sb.append(", seed=").append(seed); + sb.append(", maxTokens=").append(maxTokens); + sb.append(", topP=").append(topP); + sb.append(", topK=").append(topK); + sb.append(", repetitionPenalty=").append(repetitionPenalty); + sb.append(", temperature=").append(temperature); + sb.append(", stop=").append(stop); + sb.append(", stream=").append(stream); + sb.append(", enableSearch=").append(enableSearch); + sb.append(", resultFormat='").append(resultFormat).append('\''); + sb.append(", incrementalOutput=").append(incrementalOutput); + sb.append(", tools=").append(tools); + sb.append(", functionCallbacks=").append(functionCallbacks); + sb.append(", functions=").append(functions); + sb.append('}'); + + return sb.toString(); + } + + public static Builder builder() { + + return new Builder(); + } + + public static class Builder { + + protected TongYiChatOptions options; + + public Builder() { + + this.options = new TongYiChatOptions(); + } + + public Builder(TongYiChatOptions options) { + + this.options = options; + } + + public Builder withModel(String model) { + this.options.model = model; + return this; + } + + public Builder withMaxTokens(Integer maxTokens) { + this.options.maxTokens = maxTokens; + return this; + } + + public Builder withResultFormat(String rf) { + this.options.resultFormat = rf; + return this; + } + + public Builder withEnableSearch(Boolean enableSearch) { + this.options.enableSearch = enableSearch; + return this; + } + + public Builder withFunctionCallbacks(List functionCallbacks) { + this.options.functionCallbacks = functionCallbacks; + return this; + } + + public Builder withFunctions(Set functionNames) { + Assert.notNull(functionNames, "Function names must not be null"); + this.options.functions = functionNames; + return this; + } + + public Builder withFunction(String functionName) { + Assert.hasText(functionName, "Function name must not be empty"); + this.options.functions.add(functionName); + return this; + } + + public Builder withSeed(Integer seed) { + this.options.seed = seed; + return this; + } + + public Builder withStop(List stop) { + this.options.stop = stop; + return this; + } + + public Builder withTemperature(Double temperature) { + this.options.temperature = temperature; + return this; + } + + public Builder withTopP(Double topP) { + this.options.topP = topP; + return this; + } + + public Builder withTopK(Integer topK) { + this.options.topK = topK; + return this; + } + + public Builder withRepetitionPenalty(Double repetitionPenalty) { + this.options.repetitionPenalty = repetitionPenalty; + return this; + } + + public TongYiChatOptions build() { + + return this.options; + } + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/chat/TongYiChatProperties.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/chat/TongYiChatProperties.java index 9a7e85a..01e9539 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/chat/TongYiChatProperties.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/chat/TongYiChatProperties.java @@ -32,52 +32,52 @@ import static com.alibaba.cloud.ai.tongyi.common.constants.TongYiConstants.SCA_A @ConfigurationProperties(TongYiChatProperties.CONFIG_PREFIX) public class TongYiChatProperties { - /** - * Spring Cloud Alibaba AI configuration prefix. - */ - public static final String CONFIG_PREFIX = SCA_AI_CONFIGURATION + "chat"; + /** + * Spring Cloud Alibaba AI configuration prefix. + */ + public static final String CONFIG_PREFIX = SCA_AI_CONFIGURATION + "chat"; - /** - * Default TongYi Chat model. - */ - public static final String DEFAULT_DEPLOYMENT_NAME = Generation.Models.QWEN_TURBO; + /** + * Default TongYi Chat model. + */ + public static final String DEFAULT_DEPLOYMENT_NAME = Generation.Models.QWEN_TURBO; - /** - * Default temperature speed. - */ - private static final Double DEFAULT_TEMPERATURE = 0.8; + /** + * Default temperature speed. + */ + private static final Double DEFAULT_TEMPERATURE = 0.8; - /** - * Enable TongYiQWEN ai chat client. - */ - private boolean enabled = true; + /** + * Enable TongYiQWEN ai chat client. + */ + private boolean enabled = true; - @NestedConfigurationProperty - private TongYiChatOptions options = TongYiChatOptions.builder() - .withModel(DEFAULT_DEPLOYMENT_NAME) - .withTemperature(DEFAULT_TEMPERATURE) - .withEnableSearch(true) - .withResultFormat(GenerationParam.ResultFormat.MESSAGE) - .build(); + @NestedConfigurationProperty + private TongYiChatOptions options = TongYiChatOptions.builder() + .withModel(DEFAULT_DEPLOYMENT_NAME) + .withTemperature(DEFAULT_TEMPERATURE) + .withEnableSearch(true) + .withResultFormat(GenerationParam.ResultFormat.MESSAGE) + .build(); - public TongYiChatOptions getOptions() { + public TongYiChatOptions getOptions() { - return this.options; - } + return this.options; + } - public void setOptions(TongYiChatOptions options) { + public void setOptions(TongYiChatOptions options) { - this.options = options; - } + this.options = options; + } - public boolean isEnabled() { + public boolean isEnabled() { - return this.enabled; - } + return this.enabled; + } - public void setEnabled(boolean enabled) { + public void setEnabled(boolean enabled) { - this.enabled = enabled; - } + this.enabled = enabled; + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/common/constants/TongYiConstants.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/common/constants/TongYiConstants.java index 6fe77bd..39b0f9c 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/common/constants/TongYiConstants.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/common/constants/TongYiConstants.java @@ -23,22 +23,22 @@ package com.alibaba.cloud.ai.tongyi.common.constants; public final class TongYiConstants { - private TongYiConstants() { - } + private TongYiConstants() { + } - /** - * Spring Cloud Alibaba AI configuration prefix. - */ - public static final String SCA_AI_CONFIGURATION = "spring.cloud.ai.tongyi."; + /** + * Spring Cloud Alibaba AI configuration prefix. + */ + public static final String SCA_AI_CONFIGURATION = "spring.cloud.ai.tongyi."; - /** - * Spring Cloud Alibaba AI constants prefix. - */ - public static final String SCA_AI = "SPRING_CLOUD_ALIBABA_"; + /** + * Spring Cloud Alibaba AI constants prefix. + */ + public static final String SCA_AI = "SPRING_CLOUD_ALIBABA_"; - /** - * TongYi AI apikey env name. - */ - public static final String SCA_AI_TONGYI_API_KEY = SCA_AI + "TONGYI_API_KEY"; + /** + * TongYi AI apikey env name. + */ + public static final String SCA_AI_TONGYI_API_KEY = SCA_AI + "TONGYI_API_KEY"; } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/common/exception/TongYiException.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/common/exception/TongYiException.java index 18e14ad..4ce2609 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/common/exception/TongYiException.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/common/exception/TongYiException.java @@ -26,13 +26,13 @@ package com.alibaba.cloud.ai.tongyi.common.exception; public class TongYiException extends RuntimeException { - public TongYiException(String message) { + public TongYiException(String message) { - super(message); - } + super(message); + } - public TongYiException(String message, Throwable cause) { + public TongYiException(String message, Throwable cause) { - super(message, cause); - } + super(message, cause); + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/common/exception/TongYiImagesException.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/common/exception/TongYiImagesException.java index 5e2e577..16cb1e4 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/common/exception/TongYiImagesException.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/common/exception/TongYiImagesException.java @@ -26,14 +26,14 @@ package com.alibaba.cloud.ai.tongyi.common.exception; public class TongYiImagesException extends TongYiException { - public TongYiImagesException(String message) { + public TongYiImagesException(String message) { - super(message); - } + super(message); + } - public TongYiImagesException(String message, Throwable cause) { + public TongYiImagesException(String message, Throwable cause) { - super(message, cause); - } + super(message, cause); + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/embedding/TongYiEmbeddingOptions.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/embedding/TongYiEmbeddingOptions.java index 2ad8125..135ca71 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/embedding/TongYiEmbeddingOptions.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/embedding/TongYiEmbeddingOptions.java @@ -30,55 +30,55 @@ import java.util.List; public final class TongYiEmbeddingOptions implements EmbeddingOptions { - private List texts; + private List texts; - private TextEmbeddingParam.TextType textType; + private TextEmbeddingParam.TextType textType; - public List getTexts() { - return texts; - } + public List getTexts() { + return texts; + } - public void setTexts(List texts) { - this.texts = texts; - } + public void setTexts(List texts) { + this.texts = texts; + } - public TextEmbeddingParam.TextType getTextType() { - return textType; - } + public TextEmbeddingParam.TextType getTextType() { + return textType; + } - public void setTextType(TextEmbeddingParam.TextType textType) { - this.textType = textType; - } + public void setTextType(TextEmbeddingParam.TextType textType) { + this.textType = textType; + } - public static Builder builder() { - return new Builder(); - } + public static Builder builder() { + return new Builder(); + } - public final static class Builder { + public final static class Builder { - private final TongYiEmbeddingOptions options; + private final TongYiEmbeddingOptions options; - private Builder() { - this.options = new TongYiEmbeddingOptions(); - } + private Builder() { + this.options = new TongYiEmbeddingOptions(); + } - public Builder withtexts(List texts) { + public Builder withtexts(List texts) { - options.setTexts(texts); - return this; - } + options.setTexts(texts); + return this; + } - public Builder withtextType(TextEmbeddingParam.TextType textType) { + public Builder withtextType(TextEmbeddingParam.TextType textType) { - options.setTextType(textType); - return this; - } + options.setTextType(textType); + return this; + } - public TongYiEmbeddingOptions build() { + public TongYiEmbeddingOptions build() { - return options; - } + return options; + } - } + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/embedding/TongYiTextEmbeddingModel.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/embedding/TongYiTextEmbeddingModel.java index ce92dae..0c012c4 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/embedding/TongYiTextEmbeddingModel.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/embedding/TongYiTextEmbeddingModel.java @@ -48,128 +48,127 @@ import java.util.stream.Collectors; public class TongYiTextEmbeddingModel extends AbstractEmbeddingModel { - private final Logger logger = LoggerFactory.getLogger(TongYiTextEmbeddingModel.class); + private final Logger logger = LoggerFactory.getLogger(TongYiTextEmbeddingModel.class); - /** - * TongYi Text Embedding client. - */ - private final TextEmbedding textEmbedding; + /** + * TongYi Text Embedding client. + */ + private final TextEmbedding textEmbedding; - /** - * {@link MetadataMode}. - */ - private final MetadataMode metadataMode; + /** + * {@link MetadataMode}. + */ + private final MetadataMode metadataMode; - private final TongYiEmbeddingOptions defaultOptions; + private final TongYiEmbeddingOptions defaultOptions; - public TongYiTextEmbeddingModel(TextEmbedding textEmbedding) { + public TongYiTextEmbeddingModel(TextEmbedding textEmbedding) { - this(textEmbedding, MetadataMode.EMBED); - } + this(textEmbedding, MetadataMode.EMBED); + } - public TongYiTextEmbeddingModel(TextEmbedding textEmbedding, MetadataMode metadataMode) { + public TongYiTextEmbeddingModel(TextEmbedding textEmbedding, MetadataMode metadataMode) { - this(textEmbedding, metadataMode, - TongYiEmbeddingOptions.builder() - .withtextType(TextEmbeddingParam.TextType.DOCUMENT) - .build() - ); - } + this(textEmbedding, metadataMode, + TongYiEmbeddingOptions.builder() + .withtextType(TextEmbeddingParam.TextType.DOCUMENT) + .build() + ); + } - public TongYiTextEmbeddingModel( - TextEmbedding textEmbedding, - MetadataMode metadataMode, - TongYiEmbeddingOptions options - ) { - Assert.notNull(textEmbedding, "textEmbedding must not be null"); - Assert.notNull(metadataMode, "Metadata mode must not be null"); - Assert.notNull(options, "TongYiEmbeddingOptions must not be null"); + public TongYiTextEmbeddingModel( + TextEmbedding textEmbedding, + MetadataMode metadataMode, + TongYiEmbeddingOptions options + ) { + Assert.notNull(textEmbedding, "textEmbedding must not be null"); + Assert.notNull(metadataMode, "Metadata mode must not be null"); + Assert.notNull(options, "TongYiEmbeddingOptions must not be null"); - this.metadataMode = metadataMode; - this.textEmbedding = textEmbedding; - this.defaultOptions = options; - } + this.metadataMode = metadataMode; + this.textEmbedding = textEmbedding; + this.defaultOptions = options; + } - public TongYiEmbeddingOptions getDefaultOptions() { + public TongYiEmbeddingOptions getDefaultOptions() { - return this.defaultOptions; - } + return this.defaultOptions; + } - @Override - public List embed(Document document) { + @Override + public List embed(Document document) { - return this.call( - new EmbeddingRequest( - List.of(document.getFormattedContent(this.metadataMode)), - null) - ).getResults().stream() - .map(Embedding::getOutput) - .flatMap(List::stream) - .toList(); - } + return this.call( + new EmbeddingRequest( + List.of(document.getFormattedContent(this.metadataMode)), + null) + ).getResults().stream() + .map(Embedding::getOutput) + .flatMap(List::stream) + .toList(); + } - @Override - public EmbeddingResponse call(EmbeddingRequest request) { + @Override + public EmbeddingResponse call(EmbeddingRequest request) { - TextEmbeddingParam embeddingParams = toEmbeddingParams(request); - logger.debug("Embedding request: {}", embeddingParams); - TextEmbeddingResult resp; + TextEmbeddingParam embeddingParams = toEmbeddingParams(request); + logger.debug("Embedding request: {}", embeddingParams); + TextEmbeddingResult resp; - try { - resp = textEmbedding.call(embeddingParams); - } - catch (NoApiKeyException e) { - throw new TongYiException(e.getMessage()); - } + try { + resp = textEmbedding.call(embeddingParams); + } catch (NoApiKeyException e) { + throw new TongYiException(e.getMessage()); + } - return genEmbeddingResp(resp); - } + return genEmbeddingResp(resp); + } - private EmbeddingResponse genEmbeddingResp(TextEmbeddingResult result) { + private EmbeddingResponse genEmbeddingResp(TextEmbeddingResult result) { - return new EmbeddingResponse( - genEmbeddingList(result.getOutput().getEmbeddings()), - TongYiTextEmbeddingResponseMetadata.from(result.getUsage()) - ); - } + return new EmbeddingResponse( + genEmbeddingList(result.getOutput().getEmbeddings()), + TongYiTextEmbeddingResponseMetadata.from(result.getUsage()) + ); + } - private List genEmbeddingList(List embeddings) { + private List genEmbeddingList(List embeddings) { - return embeddings.stream() - .map(embedding -> - new Embedding( - embedding.getEmbedding(), - embedding.getTextIndex() - )) - .collect(Collectors.toList()); - } + return embeddings.stream() + .map(embedding -> + new Embedding( + embedding.getEmbedding(), + embedding.getTextIndex() + )) + .collect(Collectors.toList()); + } - /** - * We recommend setting the model parameters by passing the embedding parameters through the code; - * yml configuration compatibility is not considered here. - * It is not recommended that users set parameters from yml, - * as this reduces the flexibility of the configuration. - * Because the model name keeps changing, strings are used here and constants are undefined: - * Model list: Text Embedding Model List - * @param requestOptions Client params. {@link EmbeddingRequest} - * @return {@link TextEmbeddingParam} - */ - private TextEmbeddingParam toEmbeddingParams(EmbeddingRequest requestOptions) { + /** + * We recommend setting the model parameters by passing the embedding parameters through the code; + * yml configuration compatibility is not considered here. + * It is not recommended that users set parameters from yml, + * as this reduces the flexibility of the configuration. + * Because the model name keeps changing, strings are used here and constants are undefined: + * Model list: Text Embedding Model List + * + * @param requestOptions Client params. {@link EmbeddingRequest} + * @return {@link TextEmbeddingParam} + */ + private TextEmbeddingParam toEmbeddingParams(EmbeddingRequest requestOptions) { - TextEmbeddingParam tongYiEmbeddingParams = TextEmbeddingParam.builder() - .texts(requestOptions.getInstructions()) - .textType(defaultOptions.getTextType() != null ? defaultOptions.getTextType() : TextEmbeddingParam.TextType.DOCUMENT) - .model("text-embedding-v1") - .build(); + TextEmbeddingParam tongYiEmbeddingParams = TextEmbeddingParam.builder() + .texts(requestOptions.getInstructions()) + .textType(defaultOptions.getTextType() != null ? defaultOptions.getTextType() : TextEmbeddingParam.TextType.DOCUMENT) + .model("text-embedding-v1") + .build(); - try { - tongYiEmbeddingParams.validate(); - } - catch (InputRequiredException e) { - throw new TongYiException(e.getMessage()); - } + try { + tongYiEmbeddingParams.validate(); + } catch (InputRequiredException e) { + throw new TongYiException(e.getMessage()); + } - return tongYiEmbeddingParams; - } + return tongYiEmbeddingParams; + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/embedding/TongYiTextEmbeddingProperties.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/embedding/TongYiTextEmbeddingProperties.java index 02196f4..d19b962 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/embedding/TongYiTextEmbeddingProperties.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/embedding/TongYiTextEmbeddingProperties.java @@ -30,21 +30,21 @@ import static com.alibaba.cloud.ai.tongyi.common.constants.TongYiConstants.SCA_A @ConfigurationProperties(TongYiTextEmbeddingProperties.CONFIG_PREFIX) public class TongYiTextEmbeddingProperties { - /** - * Prefix of TongYi Text Embedding properties. - */ - public static final String CONFIG_PREFIX = SCA_AI_CONFIGURATION + "embedding"; + /** + * Prefix of TongYi Text Embedding properties. + */ + public static final String CONFIG_PREFIX = SCA_AI_CONFIGURATION + "embedding"; - private boolean enabled = true; + private boolean enabled = true; - public boolean isEnabled() { + public boolean isEnabled() { - return this.enabled; - } + return this.enabled; + } - public void setEnabled(boolean enabled) { + public void setEnabled(boolean enabled) { - this.enabled = enabled; - } + this.enabled = enabled; + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/image/TongYiImagesModel.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/image/TongYiImagesModel.java index 55dbb33..a671d18 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/image/TongYiImagesModel.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/image/TongYiImagesModel.java @@ -44,194 +44,196 @@ import static com.alibaba.cloud.ai.tongyi.metadata.TongYiImagesResponseMetadata. public class TongYiImagesModel implements ImageModel { - private final Logger logger = LoggerFactory.getLogger(TongYiImagesModel.class); + private final Logger logger = LoggerFactory.getLogger(TongYiImagesModel.class); - /** - * Gen Images API. - */ - private final ImageSynthesis imageSynthesis; + /** + * Gen Images API. + */ + private final ImageSynthesis imageSynthesis; - /** - * TongYi Gen images properties. - */ - private TongYiImagesOptions defaultOptions; + /** + * TongYi Gen images properties. + */ + private TongYiImagesOptions defaultOptions; - /** - * Adapt TongYi images api size properties. - */ - private final String sizeConnection = "*"; + /** + * Adapt TongYi images api size properties. + */ + private final String sizeConnection = "*"; - /** - * Get default images options. - * - * @return Default TongYiImagesOptions. - */ - public TongYiImagesOptions getDefaultOptions() { + /** + * Get default images options. + * + * @return Default TongYiImagesOptions. + */ + public TongYiImagesOptions getDefaultOptions() { - return this.defaultOptions; - } + return this.defaultOptions; + } - /** - * TongYiImagesClient constructor. - * @param imageSynthesis the image synthesis - * {@link ImageSynthesis} - */ - public TongYiImagesModel(ImageSynthesis imageSynthesis) { + /** + * TongYiImagesClient constructor. + * + * @param imageSynthesis the image synthesis + * {@link ImageSynthesis} + */ + public TongYiImagesModel(ImageSynthesis imageSynthesis) { - this(imageSynthesis, TongYiImagesOptions. - builder() - .withModel(ImageSynthesis.Models.WANX_V1) - .withN(1) - .build() - ); - } + this(imageSynthesis, TongYiImagesOptions. + builder() + .withModel(ImageSynthesis.Models.WANX_V1) + .withN(1) + .build() + ); + } - /** - * TongYiImagesClient constructor. - * @param imageSynthesis {@link ImageSynthesis} - * @param imagesOptions {@link TongYiImagesOptions} - */ - public TongYiImagesModel(ImageSynthesis imageSynthesis, TongYiImagesOptions imagesOptions) { + /** + * TongYiImagesClient constructor. + * + * @param imageSynthesis {@link ImageSynthesis} + * @param imagesOptions {@link TongYiImagesOptions} + */ + public TongYiImagesModel(ImageSynthesis imageSynthesis, TongYiImagesOptions imagesOptions) { - Assert.notNull(imageSynthesis, "ImageSynthesis must not be null"); - Assert.notNull(imagesOptions, "TongYiImagesOptions must not be null"); + Assert.notNull(imageSynthesis, "ImageSynthesis must not be null"); + Assert.notNull(imagesOptions, "TongYiImagesOptions must not be null"); - this.imageSynthesis = imageSynthesis; - this.defaultOptions = imagesOptions; - } + this.imageSynthesis = imageSynthesis; + this.defaultOptions = imagesOptions; + } - /** - * Call the TongYi images service. - * @param imagePrompt the image prompt. - * @return the image response. - * {@link ImageSynthesis#call(ImageSynthesisParam)} - */ - @Override - public ImageResponse call(ImagePrompt imagePrompt) { + /** + * Call the TongYi images service. + * + * @param imagePrompt the image prompt. + * @return the image response. + * {@link ImageSynthesis#call(ImageSynthesisParam)} + */ + @Override + public ImageResponse call(ImagePrompt imagePrompt) { - ImageSynthesisResult result; - String prompt = imagePrompt.getInstructions().get(0).getText(); - var imgParams = ImageSynthesisParam.builder() - .prompt("") - .model(ImageSynthesis.Models.WANX_V1) - .build(); + ImageSynthesisResult result; + String prompt = imagePrompt.getInstructions().get(0).getText(); + var imgParams = ImageSynthesisParam.builder() + .prompt("") + .model(ImageSynthesis.Models.WANX_V1) + .build(); - if (this.defaultOptions != null) { + if (this.defaultOptions != null) { - imgParams = merge(this.defaultOptions); - } + imgParams = merge(this.defaultOptions); + } - if (imagePrompt.getOptions() != null) { + if (imagePrompt.getOptions() != null) { - imgParams = merge(toTingYiImageOptions(imagePrompt.getOptions())); - } - imgParams.setPrompt(prompt); + imgParams = merge(toTingYiImageOptions(imagePrompt.getOptions())); + } + imgParams.setPrompt(prompt); - try { - result = imageSynthesis.call(imgParams); - } - catch (NoApiKeyException e) { + try { + result = imageSynthesis.call(imgParams); + } catch (NoApiKeyException e) { - logger.error("TongYi models gen images failed: {}.", e.getMessage()); - throw new TongYiImagesException(e.getMessage()); - } + logger.error("TongYi models gen images failed: {}.", e.getMessage()); + throw new TongYiImagesException(e.getMessage()); + } - return convert(result); - } + return convert(result); + } - public ImageSynthesisParam merge(TongYiImagesOptions target) { + public ImageSynthesisParam merge(TongYiImagesOptions target) { - var builder = ImageSynthesisParam.builder(); + var builder = ImageSynthesisParam.builder(); - builder.model(this.defaultOptions.getModel() != null ? this.defaultOptions.getModel() : target.getModel()); - builder.n(this.defaultOptions.getN() != null ? this.defaultOptions.getN() : target.getN()); - builder.size((this.defaultOptions.getHeight() != null && this.defaultOptions.getWidth() != null) - ? this.defaultOptions.getHeight() + "*" + this.defaultOptions.getWidth() - : target.getHeight() + "*" + target.getWidth() - ); + builder.model(this.defaultOptions.getModel() != null ? this.defaultOptions.getModel() : target.getModel()); + builder.n(this.defaultOptions.getN() != null ? this.defaultOptions.getN() : target.getN()); + builder.size((this.defaultOptions.getHeight() != null && this.defaultOptions.getWidth() != null) + ? this.defaultOptions.getHeight() + "*" + this.defaultOptions.getWidth() + : target.getHeight() + "*" + target.getWidth() + ); - // prompt is marked non-null but is null. - builder.prompt(""); + // prompt is marked non-null but is null. + builder.prompt(""); - return builder.build(); - } + return builder.build(); + } - private ImageResponse convert(ImageSynthesisResult result) { + private ImageResponse convert(ImageSynthesisResult result) { - return new ImageResponse( - result.getOutput().getResults().stream() - .flatMap(value -> value.entrySet().stream()) - .map(entry -> { - String key = entry.getKey(); - String value = entry.getValue(); - try { - String base64Image = convertImageToBase64(value); - Image image = new Image(value, base64Image); - return new ImageGeneration(image); - } - catch (Exception e) { - throw new RuntimeException(e); - } - }) - .collect(Collectors.toList()), - from(result) - ); - } + return new ImageResponse( + result.getOutput().getResults().stream() + .flatMap(value -> value.entrySet().stream()) + .map(entry -> { + String key = entry.getKey(); + String value = entry.getValue(); + try { + String base64Image = convertImageToBase64(value); + Image image = new Image(value, base64Image); + return new ImageGeneration(image); + } catch (Exception e) { + throw new RuntimeException(e); + } + }) + .collect(Collectors.toList()), + from(result) + ); + } - public TongYiImagesOptions toTingYiImageOptions(ImageOptions runtimeImageOptions) { + public TongYiImagesOptions toTingYiImageOptions(ImageOptions runtimeImageOptions) { - var builder = TongYiImagesOptions.builder(); + var builder = TongYiImagesOptions.builder(); - if (runtimeImageOptions != null) { - if (runtimeImageOptions.getN() != null) { + if (runtimeImageOptions != null) { + if (runtimeImageOptions.getN() != null) { - builder.withN(runtimeImageOptions.getN()); - } - if (runtimeImageOptions.getModel() != null) { + builder.withN(runtimeImageOptions.getN()); + } + if (runtimeImageOptions.getModel() != null) { - builder.withModel(runtimeImageOptions.getModel()); - } - if (runtimeImageOptions.getHeight() != null) { + builder.withModel(runtimeImageOptions.getModel()); + } + if (runtimeImageOptions.getHeight() != null) { - builder.withHeight(runtimeImageOptions.getHeight()); - } - if (runtimeImageOptions.getWidth() != null) { + builder.withHeight(runtimeImageOptions.getHeight()); + } + if (runtimeImageOptions.getWidth() != null) { - builder.withWidth(runtimeImageOptions.getWidth()); - } + builder.withWidth(runtimeImageOptions.getWidth()); + } - // todo ImagesParams. - } + // todo ImagesParams. + } - return builder.build(); - } + return builder.build(); + } - /** - * Convert image to base64. - * @param imageUrl the image url. - * @return the base64 image. - * @throws Exception the exception. - */ - public String convertImageToBase64(String imageUrl) throws Exception { + /** + * Convert image to base64. + * + * @param imageUrl the image url. + * @return the base64 image. + * @throws Exception the exception. + */ + public String convertImageToBase64(String imageUrl) throws Exception { - var url = new URL(imageUrl); - var inputStream = url.openStream(); - var outputStream = new ByteArrayOutputStream(); - var buffer = new byte[4096]; - int bytesRead; + var url = new URL(imageUrl); + var inputStream = url.openStream(); + var outputStream = new ByteArrayOutputStream(); + var buffer = new byte[4096]; + int bytesRead; - while ((bytesRead = inputStream.read(buffer)) != -1) { - outputStream.write(buffer, 0, bytesRead); - } + while ((bytesRead = inputStream.read(buffer)) != -1) { + outputStream.write(buffer, 0, bytesRead); + } - var imageBytes = outputStream.toByteArray(); + var imageBytes = outputStream.toByteArray(); - String base64Image = Base64.getEncoder().encodeToString(imageBytes); + String base64Image = Base64.getEncoder().encodeToString(imageBytes); - inputStream.close(); - outputStream.close(); + inputStream.close(); + outputStream.close(); - return base64Image; - } + return base64Image; + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/image/TongYiImagesOptions.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/image/TongYiImagesOptions.java index 412b07b..67fdcec 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/image/TongYiImagesOptions.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/image/TongYiImagesOptions.java @@ -32,156 +32,156 @@ import java.util.Objects; public class TongYiImagesOptions implements ImageOptions { - /** - * Specify the model name, currently only wanx-v1 is supported. - */ - private String model = ImageSynthesis.Models.WANX_V1; + /** + * Specify the model name, currently only wanx-v1 is supported. + */ + private String model = ImageSynthesis.Models.WANX_V1; - /** - * Gen images number. - */ - private Integer n; + /** + * Gen images number. + */ + private Integer n; - /** - * The width of the generated images. - */ - private Integer width = 1024; + /** + * The width of the generated images. + */ + private Integer width = 1024; - /** - * The height of the generated images. - */ - private Integer height = 1024; + /** + * The height of the generated images. + */ + private Integer height = 1024; - @Override - public Integer getN() { + @Override + public Integer getN() { - return this.n; - } + return this.n; + } - @Override - public String getModel() { + @Override + public String getModel() { - return this.model; - } + return this.model; + } - @Override - public Integer getWidth() { + @Override + public Integer getWidth() { - return this.width; - } + return this.width; + } - @Override - public Integer getHeight() { + @Override + public Integer getHeight() { - return this.height; - } + return this.height; + } - @Override - public String getResponseFormat() { + @Override + public String getResponseFormat() { - throw new TongYiImagesException("unimplemented!"); - } + throw new TongYiImagesException("unimplemented!"); + } - public void setModel(String model) { + public void setModel(String model) { - this.model = model; - } + this.model = model; + } - public void setN(Integer n) { + public void setN(Integer n) { - this.n = n; - } + this.n = n; + } - public void setWidth(Integer width) { + public void setWidth(Integer width) { - this.width = width; - } + this.width = width; + } - public void setHeight(Integer height) { + public void setHeight(Integer height) { - this.height = height; - } + this.height = height; + } - @Override - public boolean equals(Object o) { - if (this == o) { + @Override + public boolean equals(Object o) { + if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { + return true; + } + if (o == null || getClass() != o.getClass()) { - return false; - } + return false; + } - TongYiImagesOptions that = (TongYiImagesOptions) o; + TongYiImagesOptions that = (TongYiImagesOptions) o; - return Objects.equals(model, that.model) - && Objects.equals(n, that.n) - && Objects.equals(width, that.width) - && Objects.equals(height, that.height); - } + return Objects.equals(model, that.model) + && Objects.equals(n, that.n) + && Objects.equals(width, that.width) + && Objects.equals(height, that.height); + } - @Override - public int hashCode() { + @Override + public int hashCode() { - return Objects.hash(model, n, width, height); - } + return Objects.hash(model, n, width, height); + } - @Override - public String toString() { + @Override + public String toString() { - final StringBuilder sb = new StringBuilder("TongYiImagesOptions{"); + final StringBuilder sb = new StringBuilder("TongYiImagesOptions{"); - sb.append("model='").append(model).append('\''); - sb.append(", n=").append(n); - sb.append(", width=").append(width); - sb.append(", height=").append(height); - sb.append('}'); + sb.append("model='").append(model).append('\''); + sb.append(", n=").append(n); + sb.append(", width=").append(width); + sb.append(", height=").append(height); + sb.append('}'); - return sb.toString(); - } + return sb.toString(); + } - public static Builder builder() { - return new Builder(); - } + public static Builder builder() { + return new Builder(); + } - public final static class Builder { + public final static class Builder { - private final TongYiImagesOptions options; + private final TongYiImagesOptions options; - private Builder() { - this.options = new TongYiImagesOptions(); - } + private Builder() { + this.options = new TongYiImagesOptions(); + } - public Builder withN(Integer n) { + public Builder withN(Integer n) { - options.setN(n); - return this; - } + options.setN(n); + return this; + } - public Builder withModel(String model) { + public Builder withModel(String model) { - options.setModel(model); - return this; - } + options.setModel(model); + return this; + } - public Builder withWidth(Integer width) { + public Builder withWidth(Integer width) { - options.setWidth(width); - return this; - } + options.setWidth(width); + return this; + } - public Builder withHeight(Integer height) { + public Builder withHeight(Integer height) { - options.setHeight(height); - return this; - } + options.setHeight(height); + return this; + } - public TongYiImagesOptions build() { + public TongYiImagesOptions build() { - return options; - } + return options; + } - } + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/image/TongYiImagesProperties.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/image/TongYiImagesProperties.java index 23f4d7f..3404b8c 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/image/TongYiImagesProperties.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/image/TongYiImagesProperties.java @@ -33,45 +33,45 @@ import static com.alibaba.cloud.ai.tongyi.common.constants.TongYiConstants.SCA_A @ConfigurationProperties(TongYiImagesProperties.CONFIG_PREFIX) public class TongYiImagesProperties { - /** - * Spring Cloud Alibaba AI configuration prefix. - */ - public static final String CONFIG_PREFIX = SCA_AI_CONFIGURATION + "images"; + /** + * Spring Cloud Alibaba AI configuration prefix. + */ + public static final String CONFIG_PREFIX = SCA_AI_CONFIGURATION + "images"; - /** - * Default TongYi Chat model. - */ - public static final String DEFAULT_IMAGES_MODEL_NAME = ImageSynthesis.Models.WANX_V1; + /** + * Default TongYi Chat model. + */ + public static final String DEFAULT_IMAGES_MODEL_NAME = ImageSynthesis.Models.WANX_V1; - /** - * Enable TongYiQWEN ai images client. - */ - private boolean enabled = true; + /** + * Enable TongYiQWEN ai images client. + */ + private boolean enabled = true; - @NestedConfigurationProperty - private TongYiImagesOptions options = TongYiImagesOptions.builder() - .withModel(DEFAULT_IMAGES_MODEL_NAME) - .withN(1) - .build(); + @NestedConfigurationProperty + private TongYiImagesOptions options = TongYiImagesOptions.builder() + .withModel(DEFAULT_IMAGES_MODEL_NAME) + .withN(1) + .build(); - public TongYiImagesOptions getOptions() { + public TongYiImagesOptions getOptions() { - return this.options; - } + return this.options; + } - public void setOptions(TongYiImagesOptions options) { + public void setOptions(TongYiImagesOptions options) { - this.options = options; - } + this.options = options; + } - public boolean isEnabled() { + public boolean isEnabled() { - return this.enabled; - } + return this.enabled; + } - public void setEnabled(boolean enabled) { + public void setEnabled(boolean enabled) { - this.enabled = enabled; - } + this.enabled = enabled; + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/TongYiAiChatResponseMetadata.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/TongYiAiChatResponseMetadata.java index 3918313..11f9c23 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/TongYiAiChatResponseMetadata.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/TongYiAiChatResponseMetadata.java @@ -25,7 +25,6 @@ import org.springframework.util.Assert; import java.util.HashMap; - /** * {@link ChatResponseMetadata} implementation for {@literal Alibaba DashScope}. * @@ -34,56 +33,56 @@ import java.util.HashMap; * @since 2023.0.1.0 */ -public class TongYiAiChatResponseMetadata extends HashMap implements ChatResponseMetadata { +public class TongYiAiChatResponseMetadata extends HashMap implements ChatResponseMetadata { - protected static final String AI_METADATA_STRING = "{ @type: %1$s, id: %2$s, usage: %3$s, rateLimit: %4$s }"; + protected static final String AI_METADATA_STRING = "{ @type: %1$s, id: %2$s, usage: %3$s, rateLimit: %4$s }"; - @SuppressWarnings("all") - public static TongYiAiChatResponseMetadata from(GenerationResult chatCompletions, - PromptMetadata promptFilterMetadata) { + @SuppressWarnings("all") + public static TongYiAiChatResponseMetadata from(GenerationResult chatCompletions, + PromptMetadata promptFilterMetadata) { - Assert.notNull(chatCompletions, "Alibaba ai ChatCompletions must not be null"); - String id = chatCompletions.getRequestId(); - TongYiAiUsage usage = TongYiAiUsage.from(chatCompletions); + Assert.notNull(chatCompletions, "Alibaba ai ChatCompletions must not be null"); + String id = chatCompletions.getRequestId(); + TongYiAiUsage usage = TongYiAiUsage.from(chatCompletions); - return new TongYiAiChatResponseMetadata( - id, - usage, - promptFilterMetadata - ); - } + return new TongYiAiChatResponseMetadata( + id, + usage, + promptFilterMetadata + ); + } - private final String id; + private final String id; - private final Usage usage; + private final Usage usage; - private final PromptMetadata promptMetadata; + private final PromptMetadata promptMetadata; - protected TongYiAiChatResponseMetadata(String id, TongYiAiUsage usage, PromptMetadata promptMetadata) { + protected TongYiAiChatResponseMetadata(String id, TongYiAiUsage usage, PromptMetadata promptMetadata) { - this.id = id; - this.usage = usage; - this.promptMetadata = promptMetadata; - } + this.id = id; + this.usage = usage; + this.promptMetadata = promptMetadata; + } - public String getId() { - return this.id; - } + public String getId() { + return this.id; + } - @Override - public Usage getUsage() { - return this.usage; - } + @Override + public Usage getUsage() { + return this.usage; + } - @Override - public PromptMetadata getPromptMetadata() { - return this.promptMetadata; - } + @Override + public PromptMetadata getPromptMetadata() { + return this.promptMetadata; + } - @Override - public String toString() { + @Override + public String toString() { - return AI_METADATA_STRING.formatted(getClass().getTypeName(), getId(), getUsage(), getRateLimit()); - } + return AI_METADATA_STRING.formatted(getClass().getTypeName(), getId(), getUsage(), getRateLimit()); + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/TongYiAiUsage.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/TongYiAiUsage.java index da086e5..fa27f14 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/TongYiAiUsage.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/TongYiAiUsage.java @@ -31,51 +31,51 @@ import org.springframework.util.Assert; public class TongYiAiUsage implements Usage { - private final GenerationUsage usage; + private final GenerationUsage usage; - public TongYiAiUsage(GenerationUsage usage) { + public TongYiAiUsage(GenerationUsage usage) { - Assert.notNull(usage, "GenerationUsage must not be null"); - this.usage = usage; - } + Assert.notNull(usage, "GenerationUsage must not be null"); + this.usage = usage; + } - public static TongYiAiUsage from(GenerationResult chatCompletions) { + public static TongYiAiUsage from(GenerationResult chatCompletions) { - Assert.notNull(chatCompletions, "ChatCompletions must not be null"); - return from(chatCompletions.getUsage()); - } + Assert.notNull(chatCompletions, "ChatCompletions must not be null"); + return from(chatCompletions.getUsage()); + } - public static TongYiAiUsage from(GenerationUsage usage) { + public static TongYiAiUsage from(GenerationUsage usage) { - return new TongYiAiUsage(usage); - } + return new TongYiAiUsage(usage); + } - protected GenerationUsage getUsage() { + protected GenerationUsage getUsage() { - return this.usage; - } + return this.usage; + } - @Override - public Long getPromptTokens() { + @Override + public Long getPromptTokens() { - throw new UnsupportedOperationException("Unimplemented method 'getPromptTokens'"); - } + throw new UnsupportedOperationException("Unimplemented method 'getPromptTokens'"); + } - @Override - public Long getGenerationTokens() { + @Override + public Long getGenerationTokens() { - return this.getUsage().getOutputTokens().longValue(); - } + return this.getUsage().getOutputTokens().longValue(); + } - @Override - public Long getTotalTokens() { + @Override + public Long getTotalTokens() { - return this.getUsage().getTotalTokens().longValue(); - } + return this.getUsage().getTotalTokens().longValue(); + } - @Override - public String toString() { + @Override + public String toString() { - return this.getUsage().toString(); - } + return this.getUsage().toString(); + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/TongYiImagesResponseMetadata.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/TongYiImagesResponseMetadata.java index 11b38f6..890016a 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/TongYiImagesResponseMetadata.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/TongYiImagesResponseMetadata.java @@ -31,101 +31,101 @@ import java.util.Objects; * @since 2023.0.1.0 */ -public class TongYiImagesResponseMetadata extends HashMap implements ImageResponseMetadata { +public class TongYiImagesResponseMetadata extends HashMap implements ImageResponseMetadata { - private final Long created; + private final Long created; - private String taskId; + private String taskId; - private ImageSynthesisTaskMetrics metrics; + private ImageSynthesisTaskMetrics metrics; - private ImageSynthesisUsage usage; + private ImageSynthesisUsage usage; - public static TongYiImagesResponseMetadata from(ImageSynthesisResult synthesisResult) { + public static TongYiImagesResponseMetadata from(ImageSynthesisResult synthesisResult) { - Assert.notNull(synthesisResult, "TongYiAiImageResponse must not be null"); + Assert.notNull(synthesisResult, "TongYiAiImageResponse must not be null"); - return new TongYiImagesResponseMetadata( - System.currentTimeMillis(), - synthesisResult.getOutput().getTaskMetrics(), - synthesisResult.getOutput().getTaskId(), - synthesisResult.getUsage() - ); - } + return new TongYiImagesResponseMetadata( + System.currentTimeMillis(), + synthesisResult.getOutput().getTaskMetrics(), + synthesisResult.getOutput().getTaskId(), + synthesisResult.getUsage() + ); + } - protected TongYiImagesResponseMetadata( - Long created, - ImageSynthesisTaskMetrics metrics, - String taskId, - ImageSynthesisUsage usage - ) { + protected TongYiImagesResponseMetadata( + Long created, + ImageSynthesisTaskMetrics metrics, + String taskId, + ImageSynthesisUsage usage + ) { - this.taskId = taskId; - this.metrics = metrics; - this.created = created; - this.usage = usage; - } + this.taskId = taskId; + this.metrics = metrics; + this.created = created; + this.usage = usage; + } - public ImageSynthesisUsage getUsage() { - return usage; - } + public ImageSynthesisUsage getUsage() { + return usage; + } - public void setUsage(ImageSynthesisUsage usage) { - this.usage = usage; - } + public void setUsage(ImageSynthesisUsage usage) { + this.usage = usage; + } - @Override - public Long getCreated() { - return created; - } + @Override + public Long getCreated() { + return created; + } - public String getTaskId() { - return taskId; - } + public String getTaskId() { + return taskId; + } - public void setTaskId(String taskId) { - this.taskId = taskId; - } + public void setTaskId(String taskId) { + this.taskId = taskId; + } - public ImageSynthesisTaskMetrics getMetrics() { - return metrics; - } + public ImageSynthesisTaskMetrics getMetrics() { + return metrics; + } - void setMetrics(ImageSynthesisTaskMetrics metrics) { - this.metrics = metrics; - } + void setMetrics(ImageSynthesisTaskMetrics metrics) { + this.metrics = metrics; + } - public Long created() { - return this.created; - } + public Long created() { + return this.created; + } - @Override - public String toString() { - return "TongYiImagesResponseMetadata {" + "created=" + created + '}'; - } + @Override + public String toString() { + return "TongYiImagesResponseMetadata {" + "created=" + created + '}'; + } - @Override - public boolean equals(Object o) { - if (this == o) { + @Override + public boolean equals(Object o) { + if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { + return true; + } + if (o == null || getClass() != o.getClass()) { - return false; - } + return false; + } - TongYiImagesResponseMetadata that = (TongYiImagesResponseMetadata) o; + TongYiImagesResponseMetadata that = (TongYiImagesResponseMetadata) o; - return Objects.equals(created, that.created) - && Objects.equals(taskId, that.taskId) - && Objects.equals(metrics, that.metrics); - } + return Objects.equals(created, that.created) + && Objects.equals(taskId, that.taskId) + && Objects.equals(metrics, that.metrics); + } - @Override - public int hashCode() { - return Objects.hash(created, taskId, metrics); - } + @Override + public int hashCode() { + return Objects.hash(created, taskId, metrics); + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/TongYiTextEmbeddingResponseMetadata.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/TongYiTextEmbeddingResponseMetadata.java index 414154b..b58b9e8 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/TongYiTextEmbeddingResponseMetadata.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/TongYiTextEmbeddingResponseMetadata.java @@ -28,26 +28,26 @@ import org.springframework.ai.embedding.EmbeddingResponseMetadata; public class TongYiTextEmbeddingResponseMetadata extends EmbeddingResponseMetadata { - private Integer totalTokens; + private Integer totalTokens; - protected TongYiTextEmbeddingResponseMetadata(Integer totalTokens) { + protected TongYiTextEmbeddingResponseMetadata(Integer totalTokens) { - this.totalTokens = totalTokens; - } + this.totalTokens = totalTokens; + } - public static TongYiTextEmbeddingResponseMetadata from(TextEmbeddingUsage usage) { + public static TongYiTextEmbeddingResponseMetadata from(TextEmbeddingUsage usage) { - return new TongYiTextEmbeddingResponseMetadata(usage.getTotalTokens()); - } + return new TongYiTextEmbeddingResponseMetadata(usage.getTotalTokens()); + } - public Integer getTotalTokens() { + public Integer getTotalTokens() { - return totalTokens; - } + return totalTokens; + } - public void setTotalTokens(Integer totalTokens) { + public void setTotalTokens(Integer totalTokens) { - this.totalTokens = totalTokens; - } + this.totalTokens = totalTokens; + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/audio/TongYiAudioSpeechResponseMetadata.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/audio/TongYiAudioSpeechResponseMetadata.java index 8647e3f..52df431 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/audio/TongYiAudioSpeechResponseMetadata.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/audio/TongYiAudioSpeechResponseMetadata.java @@ -28,106 +28,104 @@ import org.springframework.util.Assert; import java.util.HashMap; - /** * @author yuluo * @author yuluo * @since 2023.0.1.0 */ -public class TongYiAudioSpeechResponseMetadata extends HashMap implements ResponseMetadata { +public class TongYiAudioSpeechResponseMetadata extends HashMap implements ResponseMetadata { - private SpeechSynthesisUsage usage; + private SpeechSynthesisUsage usage; - private String requestId; + private String requestId; - private Sentence time; + private Sentence time; - protected static final String AI_METADATA_STRING = "{ @type: %1$s, requestsLimit: %2$s }"; + protected static final String AI_METADATA_STRING = "{ @type: %1$s, requestsLimit: %2$s }"; - /** - * NULL objects. - */ - public static final TongYiAudioSpeechResponseMetadata NULL = new TongYiAudioSpeechResponseMetadata() { - }; + /** + * NULL objects. + */ + public static final TongYiAudioSpeechResponseMetadata NULL = new TongYiAudioSpeechResponseMetadata() { + }; - public static TongYiAudioSpeechResponseMetadata from(SpeechSynthesisResult result) { + public static TongYiAudioSpeechResponseMetadata from(SpeechSynthesisResult result) { - Assert.notNull(result, "TongYi AI speech must not be null"); - TongYiAudioSpeechResponseMetadata speechResponseMetadata = new TongYiAudioSpeechResponseMetadata(); + Assert.notNull(result, "TongYi AI speech must not be null"); + TongYiAudioSpeechResponseMetadata speechResponseMetadata = new TongYiAudioSpeechResponseMetadata(); + return speechResponseMetadata; + } - return speechResponseMetadata; - } + public static TongYiAudioSpeechResponseMetadata from(String result) { - public static TongYiAudioSpeechResponseMetadata from(String result) { + Assert.notNull(result, "TongYi AI speech must not be null"); + TongYiAudioSpeechResponseMetadata speechResponseMetadata = new TongYiAudioSpeechResponseMetadata(); - Assert.notNull(result, "TongYi AI speech must not be null"); - TongYiAudioSpeechResponseMetadata speechResponseMetadata = new TongYiAudioSpeechResponseMetadata(); + return speechResponseMetadata; + } - return speechResponseMetadata; - } + @Nullable + private RateLimit rateLimit; - @Nullable - private RateLimit rateLimit; + public TongYiAudioSpeechResponseMetadata() { - public TongYiAudioSpeechResponseMetadata() { + this(null); + } - this(null); - } + public TongYiAudioSpeechResponseMetadata(@Nullable RateLimit rateLimit) { - public TongYiAudioSpeechResponseMetadata(@Nullable RateLimit rateLimit) { + this.rateLimit = rateLimit; + } - this.rateLimit = rateLimit; - } + @Nullable + public RateLimit getRateLimit() { - @Nullable - public RateLimit getRateLimit() { + RateLimit rateLimit = this.rateLimit; + return rateLimit != null ? rateLimit : new EmptyRateLimit(); + } - RateLimit rateLimit = this.rateLimit; - return rateLimit != null ? rateLimit : new EmptyRateLimit(); - } + public TongYiAudioSpeechResponseMetadata withRateLimit(RateLimit rateLimit) { - public TongYiAudioSpeechResponseMetadata withRateLimit(RateLimit rateLimit) { + this.rateLimit = rateLimit; + return this; + } - this.rateLimit = rateLimit; - return this; - } + public TongYiAudioSpeechResponseMetadata withUsage(SpeechSynthesisUsage usage) { - public TongYiAudioSpeechResponseMetadata withUsage(SpeechSynthesisUsage usage) { + this.usage = usage; + return this; + } - this.usage = usage; - return this; - } + public TongYiAudioSpeechResponseMetadata withRequestId(String id) { - public TongYiAudioSpeechResponseMetadata withRequestId(String id) { + this.requestId = id; + return this; + } - this.requestId = id; - return this; - } + public TongYiAudioSpeechResponseMetadata withSentence(Sentence sentence) { - public TongYiAudioSpeechResponseMetadata withSentence(Sentence sentence) { + this.time = sentence; + return this; + } - this.time = sentence; - return this; - } + public SpeechSynthesisUsage getUsage() { + return usage; + } - public SpeechSynthesisUsage getUsage() { - return usage; - } + public String getRequestId() { + return requestId; + } - public String getRequestId() { - return requestId; - } + public Sentence getTime() { + return time; + } - public Sentence getTime() { - return time; - } - - @Override - public String toString() { - return AI_METADATA_STRING.formatted(getClass().getName(), getRateLimit()); - } + @Override + public String toString() { + return AI_METADATA_STRING.formatted(getClass().getName(), getRateLimit()); + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/audio/TongYiAudioTranscriptionMetadata.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/audio/TongYiAudioTranscriptionMetadata.java index 32d5d63..2472f92 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/audio/TongYiAudioTranscriptionMetadata.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/audio/TongYiAudioTranscriptionMetadata.java @@ -26,18 +26,19 @@ import org.springframework.ai.model.ResultMetadata; public interface TongYiAudioTranscriptionMetadata extends ResultMetadata { - /** - * A constant instance of {@link TongYiAudioTranscriptionMetadata} that represents a null or empty metadata. - */ - TongYiAudioTranscriptionMetadata NULL = TongYiAudioTranscriptionMetadata.create(); + /** + * A constant instance of {@link TongYiAudioTranscriptionMetadata} that represents a null or empty metadata. + */ + TongYiAudioTranscriptionMetadata NULL = TongYiAudioTranscriptionMetadata.create(); - /** - * Factory method for creating a new instance of {@link TongYiAudioTranscriptionMetadata}. - * @return a new instance of {@link TongYiAudioTranscriptionMetadata} - */ - static TongYiAudioTranscriptionMetadata create() { - return new TongYiAudioTranscriptionMetadata() { - }; - } + /** + * Factory method for creating a new instance of {@link TongYiAudioTranscriptionMetadata}. + * + * @return a new instance of {@link TongYiAudioTranscriptionMetadata} + */ + static TongYiAudioTranscriptionMetadata create() { + return new TongYiAudioTranscriptionMetadata() { + }; + } } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/audio/TongYiAudioTranscriptionResponseMetadata.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/audio/TongYiAudioTranscriptionResponseMetadata.java index 36525d5..9722701 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/audio/TongYiAudioTranscriptionResponseMetadata.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/com/alibaba/cloud/ai/tongyi/metadata/audio/TongYiAudioTranscriptionResponseMetadata.java @@ -27,72 +27,71 @@ import javax.annotation.Nullable; import java.util.HashMap; - /** * @author yuluo * @author yuluo * @since 2023.0.1.0 */ -public class TongYiAudioTranscriptionResponseMetadata extends HashMap implements ResponseMetadata { +public class TongYiAudioTranscriptionResponseMetadata extends HashMap implements ResponseMetadata { - @Nullable - private RateLimit rateLimit; + @Nullable + private RateLimit rateLimit; - private JsonObject usage; + private JsonObject usage; - protected static final String AI_METADATA_STRING = "{ @type: %1$s, rateLimit: %4$s }"; + protected static final String AI_METADATA_STRING = "{ @type: %1$s, rateLimit: %4$s }"; - /** - * NULL objects. - */ - public static final TongYiAudioTranscriptionResponseMetadata NULL = new TongYiAudioTranscriptionResponseMetadata() { - }; + /** + * NULL objects. + */ + public static final TongYiAudioTranscriptionResponseMetadata NULL = new TongYiAudioTranscriptionResponseMetadata() { + }; - protected TongYiAudioTranscriptionResponseMetadata() { + protected TongYiAudioTranscriptionResponseMetadata() { - this(null, new JsonObject()); - } + this(null, new JsonObject()); + } - protected TongYiAudioTranscriptionResponseMetadata(JsonObject usage) { + protected TongYiAudioTranscriptionResponseMetadata(JsonObject usage) { - this(null, usage); - } + this(null, usage); + } - protected TongYiAudioTranscriptionResponseMetadata(@Nullable RateLimit rateLimit, JsonObject usage) { + protected TongYiAudioTranscriptionResponseMetadata(@Nullable RateLimit rateLimit, JsonObject usage) { - this.rateLimit = rateLimit; - this.usage = usage; - } + this.rateLimit = rateLimit; + this.usage = usage; + } - public static TongYiAudioTranscriptionResponseMetadata from(TranscriptionResult result) { + public static TongYiAudioTranscriptionResponseMetadata from(TranscriptionResult result) { - Assert.notNull(result, "TongYi Transcription must not be null"); - return new TongYiAudioTranscriptionResponseMetadata(result.getUsage()); - } + Assert.notNull(result, "TongYi Transcription must not be null"); + return new TongYiAudioTranscriptionResponseMetadata(result.getUsage()); + } - @Nullable - public RateLimit getRateLimit() { + @Nullable + public RateLimit getRateLimit() { - return this.rateLimit != null ? this.rateLimit : new EmptyRateLimit(); - } + return this.rateLimit != null ? this.rateLimit : new EmptyRateLimit(); + } - public void setRateLimit(@Nullable RateLimit rateLimit) { - this.rateLimit = rateLimit; - } + public void setRateLimit(@Nullable RateLimit rateLimit) { + this.rateLimit = rateLimit; + } - public JsonObject getUsage() { - return usage; - } + public JsonObject getUsage() { + return usage; + } - public void setUsage(JsonObject usage) { - this.usage = usage; - } + public void setUsage(JsonObject usage) { + this.usage = usage; + } - @Override - public String toString() { + @Override + public String toString() { - return AI_METADATA_STRING.formatted(getClass().getName(), getRateLimit()); - } + return AI_METADATA_STRING.formatted(getClass().getName(), getRateLimit()); + } } diff --git a/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/api/spu/ProductSpuApi.java b/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/api/spu/ProductSpuApi.java index 233d129..64d24c3 100644 --- a/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/api/spu/ProductSpuApi.java +++ b/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/api/spu/ProductSpuApi.java @@ -4,6 +4,9 @@ import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; import java.util.Collection; import java.util.List; +import java.util.Map; + +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap; /** * 商品 SPU API 接口 @@ -21,6 +24,16 @@ public interface ProductSpuApi { */ List getSpuList(Collection ids); + /** + * 批量查询 SPU MAP + * + * @param ids SPU 编号列表 + * @return SPU MAP + */ + default Map getSpusMap(Collection ids) { + return convertMap(getSpuList(ids), ProductSpuRespDTO::getId); + } + /** * 批量查询 SPU 数组,并且校验是否 SPU 是否有效。 * diff --git a/yudao-module-mp/yudao-module-mp-api/src/main/java/cn/iocoder/yudao/module/mp/enums/ErrorCodeConstants.java b/yudao-module-mp/yudao-module-mp-api/src/main/java/cn/iocoder/yudao/module/mp/enums/ErrorCodeConstants.java index 34c94fd..0b33b60 100644 --- a/yudao-module-mp/yudao-module-mp-api/src/main/java/cn/iocoder/yudao/module/mp/enums/ErrorCodeConstants.java +++ b/yudao-module-mp/yudao-module-mp-api/src/main/java/cn/iocoder/yudao/module/mp/enums/ErrorCodeConstants.java @@ -4,7 +4,7 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode; /** * Mp 错误码枚举类 - * + *

* mp 系统,使用 1-006-000-000 段 */ public interface ErrorCodeConstants { diff --git a/yudao-module-mp/yudao-module-mp-api/src/main/java/cn/iocoder/yudao/module/mp/package-info.java b/yudao-module-mp/yudao-module-mp-api/src/main/java/cn/iocoder/yudao/module/mp/package-info.java index 5987180..3b56a68 100644 --- a/yudao-module-mp/yudao-module-mp-api/src/main/java/cn/iocoder/yudao/module/mp/package-info.java +++ b/yudao-module-mp/yudao-module-mp-api/src/main/java/cn/iocoder/yudao/module/mp/package-info.java @@ -1,7 +1,7 @@ /** * mp 模块,我们放微信微信公众号。 * 例如说:提供微信公众号的账号、菜单、粉丝、标签、消息、自动回复、素材、模板通知、运营数据等功能 - * + *

* 1. Controller URL:以 /mp/ 开头,避免和其它 Module 冲突 * 2. DataObject 表名:以 mp_ 开头,方便在数据库中区分 */ diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/MpMenuController.http b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/MpMenuController.http index 2276b3b..908effe 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/MpMenuController.http +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/MpMenuController.http @@ -8,29 +8,31 @@ tenant-id: {{adminTenentId}} "accountId": "1", "menus": [ { - "type":"click", - "name":"今日歌曲", - "menuKey":"V1001_TODAY_MUSIC" + "type": "click", + "name": "今日歌曲", + "menuKey": "V1001_TODAY_MUSIC" }, { - "name":"搜索", - "type":"view", - "url":"https://www.soso.com/" + "name": "搜索", + "type": "view", + "url": "https://www.soso.com/" }, { "name": "父按钮", "children": [ { - "type":"click", - "name":"归去来兮", - "menuKey":"MUSIC" + "type": "click", + "name": "归去来兮", + "menuKey": "MUSIC" }, { - "name":"不说", - "type":"view", - "url":"https://www.soso.com/" - }] - }] + "name": "不说", + "type": "view", + "url": "https://www.soso.com/" + } + ] + } + ] } ### 请求 /mp/menu/save 接口 => 成功(清空) diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuBaseVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuBaseVO.java index cd0e5b2..7dda178 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuBaseVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuBaseVO.java @@ -26,7 +26,7 @@ public class MpMenuBaseVO { private String name; /** * 菜单标识 - * + *

* 支持多 DB 类型时,无法直接使用 key + @TableField("menuKey") 来实现转换,原因是 "menuKey" AS key 而存在报错 */ private String menuKey; @@ -39,7 +39,7 @@ public class MpMenuBaseVO { /** * 按钮类型 - * + *

* 枚举 {@link WxConsts.MenuButtonType} */ private String type; @@ -57,7 +57,7 @@ public class MpMenuBaseVO { @NotEmpty(message = "小程序的页面路径不能为空", groups = MiniProgramButtonGroup.class) private String miniProgramPagePath; - @Schema(description ="跳转图文的媒体编号", example = "jCQk93AIIgp8ixClWcW_NXXqBKInNWNmq2XnPeDZl7IMVqWiNeL4FfELtggRXd83") + @Schema(description = "跳转图文的媒体编号", example = "jCQk93AIIgp8ixClWcW_NXXqBKInNWNmq2XnPeDZl7IMVqWiNeL4FfELtggRXd83") @NotEmpty(message = "跳转图文的媒体编号不能为空", groups = ViewLimitedButtonGroup.class) private String articleId; @@ -83,7 +83,7 @@ public class MpMenuBaseVO { @Schema(description = "缩略图的媒体 id", example = "123456") @NotEmpty(message = "回复的消息 thumbMediaId 不能为空", groups = {MusicMessageGroup.class}) private String replyThumbMediaId; - @Schema(description = "缩略图的媒体 URL",example = "https://www.iocoder.cn/xxx.jpg") + @Schema(description = "缩略图的媒体 URL", example = "https://www.iocoder.cn/xxx.jpg") @NotEmpty(message = "回复的消息 thumbMedia 地址不能为空", groups = {MusicMessageGroup.class}) private String replyThumbMediaUrl; @@ -96,7 +96,7 @@ public class MpMenuBaseVO { /** * 回复的图文消息数组 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 NEWS */ @NotNull(message = "回复的图文消息不能为空", groups = {NewsMessageGroup.class, ViewLimitedButtonGroup.class}) diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyBaseVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyBaseVO.java index 4b84254..1c2c62a 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyBaseVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyBaseVO.java @@ -58,7 +58,7 @@ public class MpAutoReplyBaseVO { @Schema(description = "缩略图的媒体 id", example = "123456") @NotEmpty(message = "回复的消息 thumbMediaId 不能为空", groups = {MusicMessageGroup.class}) private String responseThumbMediaId; - @Schema(description = "缩略图的媒体 URL",example = "https://www.iocoder.cn/xxx.jpg") + @Schema(description = "缩略图的媒体 URL", example = "https://www.iocoder.cn/xxx.jpg") @NotEmpty(message = "回复的消息 thumbMedia 地址不能为空", groups = {MusicMessageGroup.class}) private String responseThumbMediaUrl; @@ -71,7 +71,7 @@ public class MpAutoReplyBaseVO { /** * 回复的图文消息 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 NEWS */ @NotNull(message = "回复的图文消息不能为空", groups = {NewsMessageGroup.class, ViewLimitedButtonGroup.class}) diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/message/MpMessageRespVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/message/MpMessageRespVO.java index fda5d26..aab758f 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/message/MpMessageRespVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/message/MpMessageRespVO.java @@ -78,7 +78,7 @@ public class MpMessageRespVO { /** * 图文消息数组 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 NEWS */ private List articles; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpDraftController.http b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpDraftController.http index 87f9d43..6c5153b 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpDraftController.http +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpDraftController.http @@ -37,18 +37,21 @@ Content-Type: application/json Authorization: Bearer {{token}} tenant-id: {{adminTenentId}} -[{ +[ + { "title": "我是标题(OOO)", "author": "我是作者", "digest": "我是摘要", "content": "我是内容", "contentSourceUrl": "https://www.iocoder.cn", "thumbMediaId": "r6ryvl6LrxBU0miaST4Y-pIcmK-zAAId-9TGgy-DrSLhjVuWbuT3ZBjk9K1yQ0Dn" -}, { - "title": "我是标题(XXX)", - "author": "我是作者", - "digest": "我是摘要", - "content": "我是内容", - "contentSourceUrl": "https://www.iocoder.cn", - "thumbMediaId": "r6ryvl6LrxBU0miaST4Y-pIcmK-zAAId-9TGgy-DrSLhjVuWbuT3ZBjk9K1yQ0Dn" -}] + }, + { + "title": "我是标题(XXX)", + "author": "我是作者", + "digest": "我是摘要", + "content": "我是内容", + "contentSourceUrl": "https://www.iocoder.cn", + "thumbMediaId": "r6ryvl6LrxBU0miaST4Y-pIcmK-zAAId-9TGgy-DrSLhjVuWbuT3ZBjk9K1yQ0Dn" + } +] diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/open/MpOpenController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/open/MpOpenController.java index 47e2392..816f9bd 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/open/MpOpenController.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/open/MpOpenController.java @@ -37,7 +37,7 @@ public class MpOpenController { /** * 接收微信公众号的校验签名 - * + *

* 对应 文档 */ @Operation(summary = "校验签名") // 参见 diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/MpUserController.http b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/MpUserController.http index 7c61581..1702abb 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/MpUserController.http +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/MpUserController.http @@ -14,5 +14,8 @@ tenant-id: {{adminTenentId}} "id": "3", "nickname": "test", "remark": "测试备注", - "tagIds": [103, 104] + "tagIds": [ + 103, + 104 + ] } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/vo/MpUserRespVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/vo/MpUserRespVO.java index 95f919a..4c4aaa6 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/vo/MpUserRespVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/vo/MpUserRespVO.java @@ -8,7 +8,7 @@ import java.util.List; @Schema(description = "管理后台 - 公众号粉丝 Response VO") @Data -public class MpUserRespVO { +public class MpUserRespVO { @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") private Long id; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/message/MpMessageConvert.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/message/MpMessageConvert.java index 8f31a68..e979789 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/message/MpMessageConvert.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/message/MpMessageConvert.java @@ -41,6 +41,7 @@ public interface MpMessageConvert { } return message; } + @Mappings(value = { @Mapping(source = "msgType", target = "type"), @Mapping(target = "createTime", ignore = true), @@ -117,6 +118,7 @@ public interface MpMessageConvert { builder.toUser(message.getOpenid()); return builder.build(); } + List convertList02(List list); default WxMpKefuMessage convert(MpMessageSendReqVO sendReqVO, MpUserDO user) { @@ -151,6 +153,7 @@ public interface MpMessageConvert { builder.toUser(user.getOpenid()); return builder.build(); } + List convertList03(List list); default MpMessageDO convert(WxMpKefuMessage wxMessage, MpAccountDO account, MpUserDO user) { @@ -163,6 +166,7 @@ public interface MpMessageConvert { } return message; } + @Mappings(value = { @Mapping(source = "msgType", target = "type"), @Mapping(target = "createTime", ignore = true), diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/material/MpMaterialDO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/material/MpMaterialDO.java index 735235e..7592e04 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/material/MpMaterialDO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/material/MpMaterialDO.java @@ -10,7 +10,7 @@ import me.chanjar.weixin.common.api.WxConsts; /** * 公众号素材 DO - * + *

* 1. 临时素材 * 2. 永久素材 * @@ -33,13 +33,13 @@ public class MpMaterialDO extends BaseDO { private Long id; /** * 公众号账号的编号 - * + *

* 关联 {@link MpAccountDO#getId()} */ private Long accountId; /** * 公众号 appId - * + *

* 冗余 {@link MpAccountDO#getAppId()} */ private String appId; @@ -50,13 +50,13 @@ public class MpMaterialDO extends BaseDO { private String mediaId; /** * 文件类型 - * + *

* 枚举 {@link WxConsts.MediaFileType} */ private String type; /** * 是否永久 - * + *

* true - 永久素材 * false - 临时素材 */ @@ -68,30 +68,30 @@ public class MpMaterialDO extends BaseDO { /** * 名字 - * + *

* 永久素材:非空 * 临时素材:可能为空。 - * 1. 为空的情况:粉丝主动发送的图片、语音等 - * 2. 非空的情况:主动发送给粉丝的图片、语音等 + * 1. 为空的情况:粉丝主动发送的图片、语音等 + * 2. 非空的情况:主动发送给粉丝的图片、语音等 */ private String name; /** * 公众号文件 URL - * + *

* 只有【永久素材】使用 */ private String mpUrl; /** * 视频素材的标题 - * + *

* 只有【永久素材】使用 */ private String title; /** * 视频素材的描述 - * + *

* 只有【永久素材】使用 */ private String introduction; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/menu/MpMenuDO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/menu/MpMenuDO.java index 6ae8e6b..37e891a 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/menu/MpMenuDO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/menu/MpMenuDO.java @@ -40,13 +40,13 @@ public class MpMenuDO extends BaseDO { private Long id; /** * 公众号账号的编号 - * + *

* 关联 {@link MpAccountDO#getId()} */ private Long accountId; /** * 公众号 appId - * + *

* 冗余 {@link MpAccountDO#getAppId()} */ private String appId; @@ -57,7 +57,7 @@ public class MpMenuDO extends BaseDO { private String name; /** * 菜单标识 - * + *

* 支持多 DB 类型时,无法直接使用 key + @TableField("menuKey") 来实现转换,原因是 "menuKey" AS key 而存在报错 */ private String menuKey; @@ -70,29 +70,29 @@ public class MpMenuDO extends BaseDO { /** * 按钮类型 - * + *

* 枚举 {@link MenuButtonType} */ private String type; /** * 网页链接 - * + *

* 粉丝点击菜单可打开链接,不超过 1024 字节 - * + *

* 类型为 {@link WxConsts.XmlMsgType} 的 VIEW、MINIPROGRAM */ private String url; /** * 小程序的 appId - * + *

* 类型为 {@link MenuButtonType} 的 MINIPROGRAM */ private String miniProgramAppId; /** * 小程序的页面路径 - * + *

* 类型为 {@link MenuButtonType} 的 MINIPROGRAM */ private String miniProgramPagePath; @@ -106,62 +106,62 @@ public class MpMenuDO extends BaseDO { /** * 消息类型 - * + *

* 当 {@link #type} 为 CLICK、SCANCODE_WAITMSG - * + *

* 枚举 {@link WxConsts.XmlMsgType} 中的 TEXT、IMAGE、VOICE、VIDEO、NEWS、MUSIC */ private String replyMessageType; /** * 回复的消息内容 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 TEXT */ private String replyContent; /** * 回复的媒体 id - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 IMAGE、VOICE、VIDEO */ private String replyMediaId; /** * 回复的媒体 URL - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 IMAGE、VOICE、VIDEO */ private String replyMediaUrl; /** * 回复的标题 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 VIDEO */ private String replyTitle; /** * 回复的描述 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 VIDEO */ private String replyDescription; /** * 回复的缩略图的媒体 id,通过素材管理中的接口上传多媒体文件,得到的 id - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 MUSIC、VIDEO */ private String replyThumbMediaId; /** * 回复的缩略图的媒体 URL - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 MUSIC、VIDEO */ private String replyThumbMediaUrl; /** * 回复的图文消息数组 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 NEWS */ @TableField(typeHandler = JacksonTypeHandler.class) @@ -169,15 +169,15 @@ public class MpMenuDO extends BaseDO { /** * 回复的音乐链接 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 MUSIC */ private String replyMusicUrl; /** * 回复的高质量音乐链接 - * + *

* WIFI 环境优先使用该链接播放音乐 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 MUSIC */ private String replyHqMusicUrl; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/message/MpAutoReplyDO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/message/MpAutoReplyDO.java index 6804e40..768475c 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/message/MpAutoReplyDO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/message/MpAutoReplyDO.java @@ -42,20 +42,20 @@ public class MpAutoReplyDO extends BaseDO { private Long id; /** * 公众号账号的编号 - * + *

* 关联 {@link MpAccountDO#getId()} */ private Long accountId; /** * 公众号 appId - * + *

* 冗余 {@link MpAccountDO#getAppId()} */ private String appId; /** * 回复类型 - * + *

* 枚举 {@link MpAutoReplyTypeEnum} */ private Integer type; @@ -64,24 +64,24 @@ public class MpAutoReplyDO extends BaseDO { /** * 请求的关键字 - * + *

* 当 {@link #type} 为 {@link MpAutoReplyTypeEnum#KEYWORD} */ private String requestKeyword; /** * 请求的关键字的匹配 - * + *

* 当 {@link #type} 为 {@link MpAutoReplyTypeEnum#KEYWORD} - * + *

* 枚举 {@link MpAutoReplyMatchEnum} */ private Integer requestMatch; /** * 请求的消息类型 - * + *

* 当 {@link #type} 为 {@link MpAutoReplyTypeEnum#MESSAGE} - * + *

* 枚举 {@link XmlMsgType} 中的 {@link #REQUEST_MESSAGE_TYPE} */ private String requestMessageType; @@ -90,21 +90,21 @@ public class MpAutoReplyDO extends BaseDO { /** * 回复的消息类型 - * + *

* 枚举 {@link XmlMsgType} 中的 TEXT、IMAGE、VOICE、VIDEO、NEWS */ private String responseMessageType; /** * 回复的消息内容 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 TEXT */ private String responseContent; /** * 回复的媒体 id - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 IMAGE、VOICE、VIDEO */ private String responseMediaId; @@ -115,33 +115,33 @@ public class MpAutoReplyDO extends BaseDO { /** * 回复的标题 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 VIDEO */ private String responseTitle; /** * 回复的描述 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 VIDEO */ private String responseDescription; /** * 回复的缩略图的媒体 id,通过素材管理中的接口上传多媒体文件,得到的 id - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 MUSIC、VIDEO */ private String responseThumbMediaId; /** * 回复的缩略图的媒体 URL - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 MUSIC、VIDEO */ private String responseThumbMediaUrl; /** * 回复的图文消息 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 NEWS */ @TableField(typeHandler = JacksonTypeHandler.class) @@ -149,15 +149,15 @@ public class MpAutoReplyDO extends BaseDO { /** * 回复的音乐链接 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 MUSIC */ private String responseMusicUrl; /** * 回复的高质量音乐链接 - * + *

* WIFI 环境优先使用该链接播放音乐 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 MUSIC */ private String responseHqMusicUrl; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/message/MpMessageDO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/message/MpMessageDO.java index 8c1ce74..cb3f2e8 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/message/MpMessageDO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/message/MpMessageDO.java @@ -42,38 +42,38 @@ public class MpMessageDO extends BaseDO { private Long msgId; /** * 公众号账号的 ID - * + *

* 关联 {@link MpAccountDO#getId()} */ private Long accountId; /** * 公众号 appid - * + *

* 冗余 {@link MpAccountDO#getAppId()} */ private String appId; /** * 公众号粉丝的编号 - * + *

* 关联 {@link MpUserDO#getId()} */ private Long userId; /** * 公众号粉丝标志 - * + *

* 冗余 {@link MpUserDO#getOpenid()} */ private String openid; /** * 消息类型 - * + *

* 枚举 {@link WxConsts.XmlMsgType} */ private String type; /** * 消息来源 - * + *

* 枚举 {@link MpMessageSendFromEnum} */ private Integer sendFrom; @@ -82,14 +82,14 @@ public class MpMessageDO extends BaseDO { /** * 消息内容 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 TEXT */ private String content; /** * 媒体文件的编号 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 IMAGE、VOICE、VIDEO */ private String mediaId; @@ -99,79 +99,79 @@ public class MpMessageDO extends BaseDO { private String mediaUrl; /** * 语音识别后文本 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 VOICE */ private String recognition; /** * 语音格式,如 amr,speex 等 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 VOICE */ private String format; /** * 标题 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 VIDEO、MUSIC、LINK */ private String title; /** * 描述 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 VIDEO、MUSIC */ private String description; /** * 缩略图的媒体 id,通过素材管理中的接口上传多媒体文件,得到的 id - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 MUSIC、VIDEO */ private String thumbMediaId; /** * 缩略图的媒体 URL - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 MUSIC、VIDEO */ private String thumbMediaUrl; /** * 点击图文消息跳转链接 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 LINK */ private String url; /** * 地理位置维度 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 LOCATION */ private Double locationX; /** * 地理位置经度 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 LOCATION */ private Double locationY; /** * 地图缩放大小 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 LOCATION */ private Double scale; /** * 详细地址 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 LOCATION - * + *

* 例如说杨浦区黄兴路 221-4 号临 */ private String label; /** * 图文消息数组 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 NEWS */ @TableField(typeHandler = JacksonTypeHandler.class) @@ -179,15 +179,15 @@ public class MpMessageDO extends BaseDO { /** * 音乐链接 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 MUSIC */ private String musicUrl; /** * 高质量音乐链接 - * + *

* WIFI 环境优先使用该链接播放音乐 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 MUSIC */ private String hqMusicUrl; @@ -196,13 +196,13 @@ public class MpMessageDO extends BaseDO { /** * 事件类型 - * + *

* 枚举 {@link WxConsts.EventType} */ private String event; /** * 事件 Key - * + *

* 1. {@link WxConsts.EventType} 的 SCAN:qrscene_ 为前缀,后面为二维码的参数值 * 2. {@link WxConsts.EventType} 的 CLICK:与自定义菜单接口中 KEY 值对应 */ @@ -226,7 +226,7 @@ public class MpMessageDO extends BaseDO { private String description; /** * 图片链接 - * + *

* 支持 JPG、PNG 格式,较好的效果为大图 360*200,小图 200*200 */ @NotEmpty(message = "图片链接不能为空", groups = NewsBuilder.class) diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/tag/MpTagDO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/tag/MpTagDO.java index 8a5b9f6..d1f7e3b 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/tag/MpTagDO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/tag/MpTagDO.java @@ -37,20 +37,20 @@ public class MpTagDO extends BaseDO { private String name; /** * 此标签下粉丝数 - * + *

* 冗余:{@link WxUserTag#getCount()} 字段,需要管理员点击【同步】后,更新该字段 */ private Integer count; /** * 公众号账号的编号 - * + *

* 关联 {@link MpAccountDO#getId()} */ private Long accountId; /** * 公众号 appId - * + *

* 冗余 {@link MpAccountDO#getAppId()} */ private String appId; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/user/MpUserDO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/user/MpUserDO.java index 418e96f..3038f99 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/user/MpUserDO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/user/MpUserDO.java @@ -44,7 +44,7 @@ public class MpUserDO extends BaseDO { private String unionId; /** * 关注状态 - * + *

* 枚举 {@link CommonStatusEnum} * 1. 开启 - 已关注 * 2. 禁用 - 取消关注 @@ -60,13 +60,13 @@ public class MpUserDO extends BaseDO { private LocalDateTime unsubscribeTime; /** * 昵称 - * + *

* 注意,2021-12-27 公众号接口不再返回头像和昵称,只能通过微信公众号的网页登录获取 */ private String nickname; /** * 头像地址 - * + *

* 注意,2021-12-27 公众号接口不再返回头像和昵称,只能通过微信公众号的网页登录获取 */ private String headImageUrl; @@ -92,7 +92,7 @@ public class MpUserDO extends BaseDO { private String remark; /** * 标签编号数组 - * + *

* 注意,对应的是 {@link MpTagDO#getTagId()} 字段 */ @TableField(typeHandler = LongListTypeHandler.class) @@ -100,13 +100,13 @@ public class MpUserDO extends BaseDO { /** * 公众号账号的编号 - * + *

* 关联 {@link MpAccountDO#getId()} */ private Long accountId; /** * 公众号 appId - * + *

* 冗余 {@link MpAccountDO#getAppId()} */ private String appId; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/framework/mp/core/context/MpContextHolder.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/framework/mp/core/context/MpContextHolder.java index e5c45c5..3f19027 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/framework/mp/core/context/MpContextHolder.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/framework/mp/core/context/MpContextHolder.java @@ -24,30 +24,29 @@ import me.chanjar.weixin.mp.api.WxMpMessageHandler; /** * 微信上下文 Context - * + *

* 目的:解决微信多公众号的问题,在 {@link WxMpMessageHandler} 实现类中,可以通过 {@link #getAppId()} 获取到当前的 appId * - * @see cn.iocoder.yudao.module.mp.controller.admin.open.MpOpenController#handleMessage(String, String, MpOpenHandleMessageReqVO) - * * @author 芋道源码 + * @see cn.iocoder.yudao.module.mp.controller.admin.open.MpOpenController#handleMessage(String, String, MpOpenHandleMessageReqVO) */ public class MpContextHolder { /** * 微信公众号的 appId 上下文 */ - private static final ThreadLocal APPID = new TransmittableThreadLocal<>(); + private static final ThreadLocal APPID = new TransmittableThreadLocal<>(); - public static void setAppId(String appId) { - APPID.set(appId); - } + public static void setAppId(String appId) { + APPID.set(appId); + } - public static String getAppId() { - return APPID.get(); - } + public static String getAppId() { + return APPID.get(); + } - public static void clear() { - APPID.remove(); - } + public static void clear() { + APPID.remove(); + } } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/framework/mp/core/util/MpUtils.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/framework/mp/core/util/MpUtils.java index 880d8c8..e0ffc3f 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/framework/mp/core/util/MpUtils.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/framework/mp/core/util/MpUtils.java @@ -18,7 +18,7 @@ public class MpUtils { /** * 校验消息的格式是否符合要求 * - * @param type 类型 + * @param type 类型 * @param message 消息 */ public static void validateMessage(Validator validator, String type, Object message) { @@ -91,7 +91,7 @@ public class MpUtils { /** * 根据消息类型,获得对应的媒体文件类型 - * + *

* 注意,不会返回 WxConsts.MediaFileType.THUMB,因为该类型会有明确标注 * * @param messageType 消息类型 {@link WxConsts.XmlMsgType} @@ -113,55 +113,66 @@ public class MpUtils { /** * Text 类型的消息,参数校验 Group */ - public interface TextMessageGroup {} + public interface TextMessageGroup { + } /** * Image 类型的消息,参数校验 Group */ - public interface ImageMessageGroup {} + public interface ImageMessageGroup { + } /** * Voice 类型的消息,参数校验 Group */ - public interface VoiceMessageGroup {} + public interface VoiceMessageGroup { + } /** * Video 类型的消息,参数校验 Group */ - public interface VideoMessageGroup {} + public interface VideoMessageGroup { + } /** * News 类型的消息,参数校验 Group */ - public interface NewsMessageGroup {} + public interface NewsMessageGroup { + } /** * Music 类型的消息,参数校验 Group */ - public interface MusicMessageGroup {} + public interface MusicMessageGroup { + } /** * Click 类型的按钮,参数校验 Group */ - public interface ClickButtonGroup {} + public interface ClickButtonGroup { + } /** * View 类型的按钮,参数校验 Group */ - public interface ViewButtonGroup {} + public interface ViewButtonGroup { + } /** * MiniProgram 类型的按钮,参数校验 Group */ - public interface MiniProgramButtonGroup {} + public interface MiniProgramButtonGroup { + } /** * SCANCODE_WAITMSG 类型的按钮,参数校验 Group */ - public interface ScanCodeWaitMsgButtonGroup {} + public interface ScanCodeWaitMsgButtonGroup { + } /** * VIEW_LIMITED 类型的按钮,参数校验 Group */ - public interface ViewLimitedButtonGroup {} + public interface ViewLimitedButtonGroup { + } } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/package-info.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/package-info.java index 5987180..3b56a68 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/package-info.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/package-info.java @@ -1,7 +1,7 @@ /** * mp 模块,我们放微信微信公众号。 * 例如说:提供微信公众号的账号、菜单、粉丝、标签、消息、自动回复、素材、模板通知、运营数据等功能 - * + *

* 1. Controller URL:以 /mp/ 开头,避免和其它 Module 冲突 * 2. DataObject 表名:以 mp_ 开头,方便在数据库中区分 */ diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/account/MpAccountService.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/account/MpAccountService.java index e122c6a..8673b25 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/account/MpAccountService.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/account/MpAccountService.java @@ -100,7 +100,7 @@ public interface MpAccountService { /** * 清空公众号账号的 API 配额 - * + *

* 参考文档:接口调用频次限制说明 * * @param id 编号 diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/account/MpAccountServiceImpl.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/account/MpAccountServiceImpl.java index a8f9b78..79ff572 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/account/MpAccountServiceImpl.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/account/MpAccountServiceImpl.java @@ -50,7 +50,7 @@ public class MpAccountServiceImpl implements MpAccountService { /** * 账号缓存 * key:账号编号 {@link MpAccountDO#getAppId()} - * + *

* 这里声明 volatile 修饰的原因是,每次刷新时,直接修改指向 */ @Getter @@ -88,7 +88,7 @@ public class MpAccountServiceImpl implements MpAccountService { /** * 通过定时任务轮询,刷新缓存 - * + *

* 目的:多节点部署时,通过轮询”通知“所有节点,进行刷新 */ @Scheduled(initialDelay = 60, fixedRate = 60, timeUnit = TimeUnit.SECONDS) diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/menu/MenuHandler.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/menu/MenuHandler.java index 0397125..1b7583c 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/menu/MenuHandler.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/menu/MenuHandler.java @@ -17,7 +17,7 @@ import static me.chanjar.weixin.common.api.WxConsts.MenuButtonType; /** * 自定义菜单的事件处理器 - * + *

* 逻辑:粉丝点击菜单时,触发对应的回复 * * @author 芋道源码 diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/user/LocationHandler.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/user/LocationHandler.java index 598ebb9..f066fb5 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/user/LocationHandler.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/user/LocationHandler.java @@ -18,9 +18,9 @@ import java.util.Map; /** * 上报地理位置的事件处理器 - * + *

* 触发操作:打开微信公众号 -> 点击 + 号 -> 选择「语音」 - * + *

* 逻辑:粉丝上传地理位置时,也可以触发自动回复 * * @author 芋道源码 diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/material/MpMaterialService.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/material/MpMaterialService.java index 60e4c07..fcc6eb9 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/material/MpMaterialService.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/material/MpMaterialService.java @@ -22,12 +22,12 @@ public interface MpMaterialService { /** * 获得素材的 URL - * + *

* 该 URL 来自我们自己的文件服务器存储的 URL,不是公众号存储的 URL * * @param accountId 公众号账号编号 - * @param mediaId 公众号素材 id - * @param type 文件类型 {@link WxConsts.MediaFileType} + * @param mediaId 公众号素材 id + * @param type 文件类型 {@link WxConsts.MediaFileType} * @return 素材的 URL */ String downloadMaterialUrl(Long accountId, String mediaId, String type); diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/material/MpMaterialServiceImpl.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/material/MpMaterialServiceImpl.java index 9e48a8f..89c17c3 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/material/MpMaterialServiceImpl.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/material/MpMaterialServiceImpl.java @@ -106,7 +106,7 @@ public class MpMaterialServiceImpl implements MpMaterialService { // 第二步,存储到数据库 MpAccountDO account = mpAccountService.getRequiredAccount(reqVO.getAccountId()); MpMaterialDO material = MpMaterialConvert.INSTANCE.convert(mediaId, reqVO.getType(), url, account, - reqVO.getFile().getName()).setPermanent(false); + reqVO.getFile().getName()).setPermanent(false); mpMaterialMapper.insert(material); return material; } @@ -139,7 +139,7 @@ public class MpMaterialServiceImpl implements MpMaterialService { // 第二步,存储到数据库 MpAccountDO account = mpAccountService.getRequiredAccount(reqVO.getAccountId()); MpMaterialDO material = MpMaterialConvert.INSTANCE.convert(mediaId, reqVO.getType(), url, account, - name, reqVO.getTitle(), reqVO.getIntroduction(), result.getUrl()).setPermanent(true); + name, reqVO.getTitle(), reqVO.getIntroduction(), result.getUrl()).setPermanent(true); mpMaterialMapper.insert(material); return material; } @@ -194,11 +194,11 @@ public class MpMaterialServiceImpl implements MpMaterialService { /** * 下载微信媒体文件的内容,并上传到文件服务 - * + *

* 为什么要下载?媒体文件在微信后台保存时间为 3 天,即 3 天后 media_id 失效。 * * @param accountId 公众号账号的编号 - * @param mediaId 媒体文件编号 + * @param mediaId 媒体文件编号 * @return 上传后的 URL */ public String downloadMedia(Long accountId, String mediaId) { diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/menu/MpMenuService.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/menu/MpMenuService.java index 19f3b14..7d361c3 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/menu/MpMenuService.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/menu/MpMenuService.java @@ -31,8 +31,8 @@ public interface MpMenuService { /** * 粉丝点击菜单按钮时,回复对应的消息 * - * @param appId 公众号 AppId - * @param key 菜单按钮的标识 + * @param appId 公众号 AppId + * @param key 菜单按钮的标识 * @param openid 粉丝的 openid * @return 消息 */ diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/menu/MpMenuServiceImpl.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/menu/MpMenuServiceImpl.java index eb9ceba..0b71c98 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/menu/MpMenuServiceImpl.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/menu/MpMenuServiceImpl.java @@ -104,9 +104,9 @@ public class MpMenuServiceImpl implements MpMenuService { /** * 创建菜单,并存储到数据库 * - * @param wxMenu 菜单信息 + * @param wxMenu 菜单信息 * @param parentMenu 父菜单 - * @param account 公众号账号 + * @param account 公众号账号 * @return 创建后的菜单 */ private MpMenuDO createMenu(MpMenuSaveReqVO.Menu wxMenu, MpMenuDO parentMenu, MpAccountDO account) { diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/message/MpAutoReplyService.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/message/MpAutoReplyService.java index fc125d0..e682d67 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/message/MpAutoReplyService.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/message/MpAutoReplyService.java @@ -57,7 +57,7 @@ public interface MpAutoReplyService { /** * 当收到消息时,自动回复 * - * @param appId 微信公众号 appId + * @param appId 微信公众号 appId * @param wxMessage 消息 * @return 回复的消息 */ @@ -66,7 +66,7 @@ public interface MpAutoReplyService { /** * 当粉丝关注时,自动回复 * - * @param appId 微信公众号 appId + * @param appId 微信公众号 appId * @param wxMessage 消息 * @return 回复的消息 */ diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/message/MpAutoReplyServiceImpl.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/message/MpAutoReplyServiceImpl.java index b90b82e..1aadfa1 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/message/MpAutoReplyServiceImpl.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/message/MpAutoReplyServiceImpl.java @@ -96,16 +96,16 @@ public class MpAutoReplyServiceImpl implements MpAutoReplyService { /** * 校验自动回复是否冲突 - * + *

* 不同的 type,会有不同的逻辑: * 1. type = SUBSCRIBE 时,不允许有其他的自动回复 * 2. type = MESSAGE 时,校验 requestMessageType 已经存在自动回复 * 3. type = KEYWORD 时,校验 keyword 已经存在自动回复 * - * @param id 自动回复编号 - * @param accountId 公众号账号的编号 - * @param type 类型 - * @param requestKeyword 请求关键词 + * @param id 自动回复编号 + * @param accountId 公众号账号的编号 + * @param type 类型 + * @param requestKeyword 请求关键词 * @param requestMessageType 请求消息类型 */ private void validateAutoReplyConflict(Long id, Long accountId, Integer type, @@ -129,7 +129,7 @@ public class MpAutoReplyServiceImpl implements MpAutoReplyService { // 存在冲突,抛出业务异常 if (id == null // 情况一,新增(id == null),存在记录,说明冲突 - || ObjUtil.notEqual(id, autoReply.getId())) { // 情况二,修改(id != null),id 不匹配,说明冲突 + || ObjUtil.notEqual(id, autoReply.getId())) { // 情况二,修改(id != null),id 不匹配,说明冲突 throw exception(errorCode); } } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/message/MpMessageService.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/message/MpMessageService.java index 01c691a..9ecfd29 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/message/MpMessageService.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/message/MpMessageService.java @@ -28,16 +28,16 @@ public interface MpMessageService { /** * 从公众号,接收到粉丝消息 * - * @param appId 微信公众号 appId + * @param appId 微信公众号 appId * @param wxMessage 消息 */ void receiveMessage(String appId, WxMpXmlMessage wxMessage); /** * 使用公众号,给粉丝回复消息 - * + *

* 例如说:自动回复、客服消息、菜单回复消息等场景 - * + *

* 注意,该方法只是返回 WxMpXmlOutMessage 对象,不会真的发送消息 * * @param sendReqBO 消息内容 @@ -47,7 +47,7 @@ public interface MpMessageService { /** * 使用公众号,给粉丝发送【客服】消息 - * + *

* 注意,该方法会真实发送消息 * * @param sendReqVO 消息内容 diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/message/bo/MpMessageSendOutReqBO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/message/bo/MpMessageSendOutReqBO.java index 9da7090..725194c 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/message/bo/MpMessageSendOutReqBO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/message/bo/MpMessageSendOutReqBO.java @@ -13,7 +13,7 @@ import java.util.List; /** * 公众号消息发送 Request BO - * + *

* 为什么要有该 BO 呢?在自动回复、客服消息、菜单回复消息等场景,都涉及到 MP 给粉丝发送消息,所以使用该 BO 统一承接 * * @author 芋道源码 @@ -35,7 +35,7 @@ public class MpMessageSendOutReqBO { // ========== 消息内容 ========== /** * 消息类型 - * + *

* 枚举 {@link WxConsts.XmlMsgType} 中的 TEXT、IMAGE、VOICE、VIDEO、NEWS、MUSIC */ @NotEmpty(message = "消息类型不能为空") @@ -43,7 +43,7 @@ public class MpMessageSendOutReqBO { /** * 消息内容 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 TEXT */ @NotEmpty(message = "消息内容不能为空", groups = TextMessageGroup.class) @@ -51,7 +51,7 @@ public class MpMessageSendOutReqBO { /** * 媒体 id - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 IMAGE、VOICE、VIDEO */ @NotEmpty(message = "消息 mediaId 不能为空", groups = {ImageMessageGroup.class, VoiceMessageGroup.class, VideoMessageGroup.class}) @@ -59,7 +59,7 @@ public class MpMessageSendOutReqBO { /** * 缩略图的媒体 id - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 VIDEO、MUSIC */ @NotEmpty(message = "消息 thumbMediaId 不能为空", groups = {MusicMessageGroup.class}) @@ -67,14 +67,14 @@ public class MpMessageSendOutReqBO { /** * 标题 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 VIDEO */ @NotEmpty(message = "消息标题不能为空", groups = VideoMessageGroup.class) private String title; /** * 描述 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 VIDEO */ @NotEmpty(message = "消息描述不能为空", groups = VideoMessageGroup.class) @@ -82,7 +82,7 @@ public class MpMessageSendOutReqBO { /** * 图文消息 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 NEWS */ @Valid @@ -91,7 +91,7 @@ public class MpMessageSendOutReqBO { /** * 音乐链接 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 MUSIC */ @NotEmpty(message = "音乐链接不能为空", groups = MusicMessageGroup.class) @@ -100,7 +100,7 @@ public class MpMessageSendOutReqBO { /** * 高质量音乐链接 - * + *

* 消息类型为 {@link WxConsts.XmlMsgType} 的 MUSIC */ @NotEmpty(message = "高质量音乐链接不能为空", groups = MusicMessageGroup.class) diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/statistics/MpStatisticsService.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/statistics/MpStatisticsService.java index 08e5c35..7c7abd1 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/statistics/MpStatisticsService.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/statistics/MpStatisticsService.java @@ -19,7 +19,7 @@ public interface MpStatisticsService { * 获取粉丝增减数据 * * @param accountId 公众号账号编号 - * @param date 时间区间 + * @param date 时间区间 * @return 粉丝增减数据 */ List getUserSummary(Long accountId, LocalDateTime[] date); @@ -28,7 +28,7 @@ public interface MpStatisticsService { * 获取粉丝累计数据 * * @param accountId 公众号账号编号 - * @param date 时间区间 + * @param date 时间区间 * @return 粉丝累计数据 */ List getUserCumulate(Long accountId, LocalDateTime[] date); @@ -37,7 +37,7 @@ public interface MpStatisticsService { * 获取消息发送概况数据 * * @param accountId 公众号账号编号 - * @param date 时间区间 + * @param date 时间区间 * @return 消息发送概况数据 */ List getUpstreamMessage(Long accountId, LocalDateTime[] date); @@ -46,7 +46,7 @@ public interface MpStatisticsService { * 获取接口分析数据 * * @param accountId 公众号账号编号 - * @param date 时间区间 + * @param date 时间区间 * @return 接口分析数据 */ List getInterfaceSummary(Long accountId, LocalDateTime[] date); diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagService.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagService.java index 77dbf33..294770e 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagService.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagService.java @@ -34,7 +34,7 @@ public interface MpTagService { /** * 删除公众号标签 * - * @param id 编号 + * @param id 编号 */ void deleteTag(Long id); @@ -48,6 +48,7 @@ public interface MpTagService { /** * 获得公众号标签详情 + * * @param id id查询 * @return 公众号标签详情 */ diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/user/MpUserService.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/user/MpUserService.java index bdefc0e..0df7b8d 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/user/MpUserService.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/user/MpUserService.java @@ -30,7 +30,7 @@ public interface MpUserService { /** * 使用 appId + openId,获得公众号粉丝 * - * @param appId 公众号 appId + * @param appId 公众号 appId * @param openId 公众号 openId * @return 公众号粉丝 */ @@ -68,10 +68,10 @@ public interface MpUserService { /** * 保存公众号粉丝 - * + *

* 新增或更新,根据是否存在数据库中 * - * @param appId 公众号 appId + * @param appId 公众号 appId * @param wxMpUser 公众号粉丝的信息 * @return 公众号粉丝 */ @@ -87,7 +87,7 @@ public interface MpUserService { /** * 更新公众号粉丝,取消关注 * - * @param appId 公众号 appId + * @param appId 公众号 appId * @param openId 公众号粉丝的 openid */ void updateUserUnsubscribe(String appId, String openId); diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/user/MpUserServiceImpl.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/user/MpUserServiceImpl.java index 0cef919..d459426 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/user/MpUserServiceImpl.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/user/MpUserServiceImpl.java @@ -204,7 +204,7 @@ public class MpUserServiceImpl implements MpUserService { if (CollUtil.isEmpty(tagIds)) { return; } - for (Long tagId: tagIds) { + for (Long tagId : tagIds) { mpService.getUserTagService().batchTagging(tagId, new String[]{openid}); } } catch (WxErrorException e) { diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml index 0627011..406173d 100644 --- a/yudao-server/pom.xml +++ b/yudao-server/pom.xml @@ -32,33 +32,33 @@ ${revision} - + cn.iocoder.boot yudao-module-member-biz ${revision} - + cn.iocoder.boot yudao-module-report-biz ${revision} - + cn.iocoder.boot yudao-module-bpm-biz ${revision} - + cn.iocoder.boot yudao-module-pay-biz ${revision} - + cn.iocoder.boot yudao-module-mp-biz @@ -71,7 +71,7 @@ ${revision} - + cn.iocoder.boot yudao-module-promotion-biz @@ -93,26 +93,26 @@ ${revision} - + cn.iocoder.boot yudao-module-crm-biz ${revision} - + cn.iocoder.boot yudao-module-erp-biz ${revision} - - - - - - + + + + + + diff --git a/yudao-server/src/main/java/cn/iocoder/yudao/server/YudaoServerApplication.java b/yudao-server/src/main/java/cn/iocoder/yudao/server/YudaoServerApplication.java index 27f5498..0ea4b76 100644 --- a/yudao-server/src/main/java/cn/iocoder/yudao/server/YudaoServerApplication.java +++ b/yudao-server/src/main/java/cn/iocoder/yudao/server/YudaoServerApplication.java @@ -6,7 +6,7 @@ import org.springframework.data.mongodb.repository.config.EnableMongoRepositorie /** * 项目的启动类 - * + *

* 如果你碰到启动的问题,请认真阅读 https://doc.iocoder.cn/quick-start/ 文章 * 如果你碰到启动的问题,请认真阅读 https://doc.iocoder.cn/quick-start/ 文章 * 如果你碰到启动的问题,请认真阅读 https://doc.iocoder.cn/quick-start/ 文章 diff --git a/yudao-server/src/main/resources/application.yaml b/yudao-server/src/main/resources/application.yaml index 3e46da8..3886fac 100644 --- a/yudao-server/src/main/resources/application.yaml +++ b/yudao-server/src/main/resources/application.yaml @@ -70,9 +70,9 @@ mybatis-plus: global-config: db-config: id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。 -# id-type: AUTO # 自增 ID,适合 MySQL 等直接自增的数据库 -# id-type: INPUT # 用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库 -# id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解 + # id-type: AUTO # 自增 ID,适合 MySQL 等直接自增的数据库 + # id-type: INPUT # 用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库 + # id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解 logic-delete-value: 1 # 逻辑已删除值(默认为 1) logic-not-delete-value: 0 # 逻辑未删除值(默认为 0) banner: false # 关闭控制台的 Banner 打印 @@ -181,13 +181,13 @@ yudao: model: generalv3.5 midjourney: enable: true - # base-url: https://api.holdai.top/mj-relax/mj + # base-url: https://api.holdai.top/mj-relax/mj base-url: https://api.holdai.top/mj api-key: sk-dZEPiVaNcT3FHhef51996bAa0bC74806BeAb620dA5Da10Bf notify-url: http://java.nat300.top/admin-api/ai/image/midjourney/notify suno: enable: true - # base-url: https://suno-55ishh05u-status2xxs-projects.vercel.app + # base-url: https://suno-55ishh05u-status2xxs-projects.vercel.app base-url: http://127.0.0.1:3001 --- #################### 芋道相关配置 #################### diff --git a/yudao-server/src/main/resources/logback-spring.xml b/yudao-server/src/main/resources/logback-spring.xml index b1b9f3f..1ffbfaf 100644 --- a/yudao-server/src/main/resources/logback-spring.xml +++ b/yudao-server/src/main/resources/logback-spring.xml @@ -1,10 +1,11 @@ - + - +       @@ -17,7 +18,7 @@ - + ${PATTERN_DEFAULT} @@ -27,7 +28,8 @@ ${LOG_FILE} - ${LOGBACK_ROLLINGPOLICY_FILE_NAME_PATTERN:-${LOG_FILE}.%d{yyyy-MM-dd}.%i.gz} + ${LOGBACK_ROLLINGPOLICY_FILE_NAME_PATTERN:-${LOG_FILE}.%d{yyyy-MM-dd}.%i.gz} + ${LOGBACK_ROLLINGPOLICY_CLEAN_HISTORY_ON_START:-false}