diff --git a/Dockerfile b/Dockerfile
index 7656851..98a375e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM eclipse-temurin:17 as builder
+FROM eclipse-temurin:17-alpine as builder
WORKDIR /app
@@ -6,7 +6,7 @@ COPY . /app
RUN /app/docker-build.sh
-FROM eclipse-temurin:17
+FROM eclipse-temurin:17-alpine
WORKDIR /app
diff --git a/license-header b/license-header.txt
similarity index 83%
rename from license-header
rename to license-header.txt
index 93806d4..99dcadc 100644
--- a/license-header
+++ b/license-header.txt
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/pom.xml b/pom.xml
index 61e8723..862fc39 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,12 +5,12 @@
org.springframework.boot
spring-boot-starter-parent
- 3.0.2
+ 3.1.0
xyz.playedu
playedu-api
- 1.0-beta.5
+ 1.0-beta.7
playedu-api
playedu-api
@@ -138,6 +138,25 @@
5.8.16
+
+
+ cn.dev33
+ sa-token-spring-boot3-starter
+ 1.34.0
+
+
+
+ cn.dev33
+ sa-token-dao-redis-jackson
+ 1.34.0
+
+
+
+ cn.dev33
+ sa-token-jwt
+ 1.34.0
+
+
org.springdoc
springdoc-openapi-starter-webmvc-ui
@@ -172,7 +191,7 @@
- ${project.basedir}/license-header
+ ${project.basedir}/license-header.txt
diff --git a/src/main/java/xyz/playedu/api/BCtx.java b/src/main/java/xyz/playedu/api/BCtx.java
index 4442887..cf3c057 100644
--- a/src/main/java/xyz/playedu/api/BCtx.java
+++ b/src/main/java/xyz/playedu/api/BCtx.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/FCtx.java b/src/main/java/xyz/playedu/api/FCtx.java
index 4b6ebb1..dc9188c 100644
--- a/src/main/java/xyz/playedu/api/FCtx.java
+++ b/src/main/java/xyz/playedu/api/FCtx.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,11 +19,6 @@ import xyz.playedu.api.domain.User;
import java.util.LinkedHashMap;
-/**
- * @Author 杭州白书科技有限公司
- *
- * @create 2023/3/13 09:24
- */
public class FCtx {
private static final java.lang.ThreadLocal> THREAD_LOCAL =
new java.lang.ThreadLocal<>();
diff --git a/src/main/java/xyz/playedu/api/PlayeduApiApplication.java b/src/main/java/xyz/playedu/api/PlayeduApiApplication.java
index 2019fd5..92e0b70 100644
--- a/src/main/java/xyz/playedu/api/PlayeduApiApplication.java
+++ b/src/main/java/xyz/playedu/api/PlayeduApiApplication.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/bus/AppBus.java b/src/main/java/xyz/playedu/api/bus/AppBus.java
index d9f967d..de9dc5f 100644
--- a/src/main/java/xyz/playedu/api/bus/AppBus.java
+++ b/src/main/java/xyz/playedu/api/bus/AppBus.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/bus/BackendBus.java b/src/main/java/xyz/playedu/api/bus/BackendBus.java
index 3336c32..15019e5 100644
--- a/src/main/java/xyz/playedu/api/bus/BackendBus.java
+++ b/src/main/java/xyz/playedu/api/bus/BackendBus.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -67,13 +67,15 @@ public class BackendBus {
}
public static String valueHidden(String permissionSlug, String type, String value) {
- if (BCtx.isNull()) { // 非后管环境返回原值
+ if (BCtx.isNull() || value == null) { // 非后管环境直接返回 || 值为null不需要处理
return value;
}
+
HashMap permissions = BCtx.getAdminPer();
if (permissions.get(permissionSlug) != null) {
return value;
}
+
if (BackendConstant.PRIVACY_FIELD_TYPE_EMAIL.equals(type)) {
return PrivacyUtil.hideEmail(value);
} else if (BackendConstant.PRIVACY_FIELD_TYPE_PHONE.equals(type)) {
diff --git a/src/main/java/xyz/playedu/api/bus/UserBus.java b/src/main/java/xyz/playedu/api/bus/UserBus.java
index 5df2956..ae90478 100644
--- a/src/main/java/xyz/playedu/api/bus/UserBus.java
+++ b/src/main/java/xyz/playedu/api/bus/UserBus.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/caches/CourseCache.java b/src/main/java/xyz/playedu/api/caches/CourseCache.java
index 6ae8464..b75cb6e 100644
--- a/src/main/java/xyz/playedu/api/caches/CourseCache.java
+++ b/src/main/java/xyz/playedu/api/caches/CourseCache.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/caches/UserCanSeeCourseCache.java b/src/main/java/xyz/playedu/api/caches/UserCanSeeCourseCache.java
index 2472523..bc9c4d8 100644
--- a/src/main/java/xyz/playedu/api/caches/UserCanSeeCourseCache.java
+++ b/src/main/java/xyz/playedu/api/caches/UserCanSeeCourseCache.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/caches/UserLastLearnTimeCache.java b/src/main/java/xyz/playedu/api/caches/UserLastLearnTimeCache.java
index 7c78e91..b13fc7d 100644
--- a/src/main/java/xyz/playedu/api/caches/UserLastLearnTimeCache.java
+++ b/src/main/java/xyz/playedu/api/caches/UserLastLearnTimeCache.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/checks/AdminPermissionCheck.java b/src/main/java/xyz/playedu/api/checks/AdminPermissionCheck.java
index ae5fcda..4486128 100644
--- a/src/main/java/xyz/playedu/api/checks/AdminPermissionCheck.java
+++ b/src/main/java/xyz/playedu/api/checks/AdminPermissionCheck.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,6 +18,7 @@ package xyz.playedu.api.checks;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
+import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import xyz.playedu.api.constant.BPermissionConstant;
@@ -26,11 +27,7 @@ import xyz.playedu.api.service.AdminPermissionService;
import java.util.*;
-/**
- * @Author 杭州白书科技有限公司
- *
- * @create 2023/2/20 14:31
- */
+@Order(1020)
@Component
public class AdminPermissionCheck implements ApplicationRunner {
@@ -109,20 +106,6 @@ public class AdminPermissionCheck implements ApplicationRunner {
}
},
});
- // 资源
- put(
- "资源",
- new AdminPermission[] {
- new AdminPermission() {
- {
- setSort(0);
- setName("删除");
- setSlug(
- BPermissionConstant
- .RESOURCE_DESTROY);
- }
- },
- });
// 学员
put(
"学员",
@@ -214,6 +197,18 @@ public class AdminPermissionCheck implements ApplicationRunner {
}
},
});
+ // 系统配置
+ put(
+ "系统配置",
+ new AdminPermission[] {
+ new AdminPermission() {
+ {
+ setSort(0);
+ setName("系统配置");
+ setSlug(BPermissionConstant.SYSTEM_CONFIG);
+ }
+ },
+ });
}
});
put(
diff --git a/src/main/java/xyz/playedu/api/checks/AdminRoleCheck.java b/src/main/java/xyz/playedu/api/checks/AdminRoleCheck.java
index edcea33..460eef1 100644
--- a/src/main/java/xyz/playedu/api/checks/AdminRoleCheck.java
+++ b/src/main/java/xyz/playedu/api/checks/AdminRoleCheck.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,6 +18,7 @@ package xyz.playedu.api.checks;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
+import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import xyz.playedu.api.constant.BackendConstant;
@@ -26,11 +27,7 @@ import xyz.playedu.api.service.AdminRoleService;
import java.util.Date;
-/**
- * @Author 杭州白书科技有限公司
- *
- * @create 2023/2/23 22:09
- */
+@Order(1010)
@Component
public class AdminRoleCheck implements ApplicationRunner {
diff --git a/src/main/java/xyz/playedu/api/checks/AppConfigCheck.java b/src/main/java/xyz/playedu/api/checks/AppConfigCheck.java
index f17b2ae..a7643c5 100644
--- a/src/main/java/xyz/playedu/api/checks/AppConfigCheck.java
+++ b/src/main/java/xyz/playedu/api/checks/AppConfigCheck.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,6 +18,7 @@ package xyz.playedu.api.checks;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
+import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import xyz.playedu.api.constant.BackendConstant;
@@ -27,12 +28,8 @@ import xyz.playedu.api.service.AppConfigService;
import java.util.*;
-/**
- * @Author 杭州白书科技有限公司
- *
- * @create 2023/3/9 13:29
- */
@Component
+@Order(1000)
public class AppConfigCheck implements ApplicationRunner {
private static final HashMap configs =
@@ -196,6 +193,7 @@ public class AppConfigCheck implements ApplicationRunner {
setFieldType(BackendConstant.APP_CONFIG_FIELD_TYPE_TEXT);
setKeyName(CConfig.MINIO_SECRET_KEY);
setKeyValue("");
+ setIsPrivate(1);
}
},
new AppConfig() {
diff --git a/src/main/java/xyz/playedu/api/checks/UpgradeCheck.java b/src/main/java/xyz/playedu/api/checks/UpgradeCheck.java
new file mode 100644
index 0000000..5eec804
--- /dev/null
+++ b/src/main/java/xyz/playedu/api/checks/UpgradeCheck.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2023 杭州白书科技有限公司
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package xyz.playedu.api.checks;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.ApplicationArguments;
+import org.springframework.boot.ApplicationRunner;
+import org.springframework.core.annotation.Order;
+import org.springframework.stereotype.Component;
+
+import xyz.playedu.api.domain.AppConfig;
+import xyz.playedu.api.service.AdminPermissionService;
+import xyz.playedu.api.service.AppConfigService;
+
+import java.util.ArrayList;
+
+@Order(10000)
+@Component
+public class UpgradeCheck implements ApplicationRunner {
+
+ @Autowired private AppConfigService appConfigService;
+
+ @Autowired private AdminPermissionService permissionService;
+
+ @Override
+ public void run(ApplicationArguments args) throws Exception {
+ upgrade_v1_beta7();
+ }
+
+ private void upgrade_v1_beta7() {
+ appConfigService.update(
+ new AppConfig() {
+ {
+ setIsPrivate(1);
+ }
+ },
+ appConfigService.query().getWrapper().eq("key_name", "minio.secret_key"));
+
+ permissionService.remove(
+ permissionService
+ .query()
+ .getWrapper()
+ .in(
+ "slug",
+ new ArrayList<>() {
+ {
+ add("resource-destroy");
+ }
+ }));
+ }
+}
diff --git a/src/main/java/xyz/playedu/api/types/JwtToken.java b/src/main/java/xyz/playedu/api/config/AuthConfig.java
similarity index 60%
rename from src/main/java/xyz/playedu/api/types/JwtToken.java
rename to src/main/java/xyz/playedu/api/config/AuthConfig.java
index 5c1ca87..66ce28d 100644
--- a/src/main/java/xyz/playedu/api/types/JwtToken.java
+++ b/src/main/java/xyz/playedu/api/config/AuthConfig.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,14 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package xyz.playedu.api.types;
+package xyz.playedu.api.config;
import lombok.Data;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
@Data
-public class JwtToken {
-
- private String token;
-
- private Long expire;
+public class AuthConfig {
+ @Value("${sa-token.timeout}")
+ private Integer expired;
}
diff --git a/src/main/java/xyz/playedu/api/config/MybatisPlusConfig.java b/src/main/java/xyz/playedu/api/config/MybatisPlusConfig.java
index 50f15d4..6fcc0ad 100644
--- a/src/main/java/xyz/playedu/api/config/MybatisPlusConfig.java
+++ b/src/main/java/xyz/playedu/api/config/MybatisPlusConfig.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/config/PlayEduConfig.java b/src/main/java/xyz/playedu/api/config/PlayEduConfig.java
index 6838fd1..35d5d46 100644
--- a/src/main/java/xyz/playedu/api/config/PlayEduConfig.java
+++ b/src/main/java/xyz/playedu/api/config/PlayEduConfig.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/config/RedisConfig.java b/src/main/java/xyz/playedu/api/config/RedisConfig.java
index efdf20e..0ef34a7 100644
--- a/src/main/java/xyz/playedu/api/config/RedisConfig.java
+++ b/src/main/java/xyz/playedu/api/config/RedisConfig.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/config/SaTokenConfigure.java b/src/main/java/xyz/playedu/api/config/SaTokenConfigure.java
new file mode 100644
index 0000000..cad6c62
--- /dev/null
+++ b/src/main/java/xyz/playedu/api/config/SaTokenConfigure.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2023 杭州白书科技有限公司
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package xyz.playedu.api.config;
+
+import cn.dev33.satoken.jwt.StpLogicJwtForSimple;
+import cn.dev33.satoken.stp.StpLogic;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class SaTokenConfigure {
+ // Sa-Token 整合 jwt (Simple 简单模式)
+ @Bean
+ public StpLogic getStpLogicJwt() {
+ return new StpLogicJwtForSimple();
+ }
+}
diff --git a/src/main/java/xyz/playedu/api/config/UniqueNameGenerator.java b/src/main/java/xyz/playedu/api/config/UniqueNameGenerator.java
index 2ad44a4..4c08869 100644
--- a/src/main/java/xyz/playedu/api/config/UniqueNameGenerator.java
+++ b/src/main/java/xyz/playedu/api/config/UniqueNameGenerator.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/config/WebMvcConfig.java b/src/main/java/xyz/playedu/api/config/WebMvcConfig.java
index 632f6fe..226873a 100644
--- a/src/main/java/xyz/playedu/api/config/WebMvcConfig.java
+++ b/src/main/java/xyz/playedu/api/config/WebMvcConfig.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/constant/BPermissionConstant.java b/src/main/java/xyz/playedu/api/constant/BPermissionConstant.java
index f49bc6d..96a0918 100644
--- a/src/main/java/xyz/playedu/api/constant/BPermissionConstant.java
+++ b/src/main/java/xyz/playedu/api/constant/BPermissionConstant.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -15,11 +15,6 @@
*/
package xyz.playedu.api.constant;
-/**
- * @Author 杭州白书科技有限公司
- *
- * @create 2023/2/21 14:57
- */
public class BPermissionConstant {
public static final String TYPE_ACTION = "action";
@@ -35,8 +30,6 @@ public class BPermissionConstant {
public static final String DEPARTMENT_CUD = "department-cud";
public static final String DEPARTMENT_USER_LEARN = "department-user-learn";
- public static final String RESOURCE_CATEGORY = "resource-category";
-
public static final String USER_INDEX = "user-index";
public static final String USER_STORE = "user-store";
public static final String USER_UPDATE = "user-update";
@@ -48,7 +41,11 @@ public class BPermissionConstant {
public static final String COURSE_USER = "course-user";
public static final String COURSE_USER_DESTROY = "course-user-destroy";
- public static final String RESOURCE_DESTROY = "resource-destroy";
+ public static final String RESOURCE_CATEGORY = "resource-category";
+
+ public static final String SYSTEM_CONFIG = "system-config";
+
+ // ##### 友情分割线 ##################################################
public static final String DATA_USER_NAME = "data-user-name";
public static final String DATA_USER_EMAIL = "data-user-email";
diff --git a/src/main/java/xyz/playedu/api/constant/BackendConstant.java b/src/main/java/xyz/playedu/api/constant/BackendConstant.java
index dbeeea8..8b7600d 100644
--- a/src/main/java/xyz/playedu/api/constant/BackendConstant.java
+++ b/src/main/java/xyz/playedu/api/constant/BackendConstant.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/constant/BackendLogConstant.java b/src/main/java/xyz/playedu/api/constant/BackendLogConstant.java
index a489c80..893e814 100644
--- a/src/main/java/xyz/playedu/api/constant/BackendLogConstant.java
+++ b/src/main/java/xyz/playedu/api/constant/BackendLogConstant.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/constant/CConfig.java b/src/main/java/xyz/playedu/api/constant/CConfig.java
index 95c0498..750b388 100644
--- a/src/main/java/xyz/playedu/api/constant/CConfig.java
+++ b/src/main/java/xyz/playedu/api/constant/CConfig.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/constant/FrontendConstant.java b/src/main/java/xyz/playedu/api/constant/FrontendConstant.java
index e9b634a..3bf18d3 100644
--- a/src/main/java/xyz/playedu/api/constant/FrontendConstant.java
+++ b/src/main/java/xyz/playedu/api/constant/FrontendConstant.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/constant/SystemConstant.java b/src/main/java/xyz/playedu/api/constant/SystemConstant.java
index fcf00b5..f80125f 100644
--- a/src/main/java/xyz/playedu/api/constant/SystemConstant.java
+++ b/src/main/java/xyz/playedu/api/constant/SystemConstant.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -30,4 +30,6 @@ public class SystemConstant {
public static final String INTERNAL_IP = "127.0.0.1";
public static final String INTERNAL_IP_AREA = "内网";
+
+ public static final String CONFIG_MASK = "********";
}
diff --git a/src/main/java/xyz/playedu/api/controller/ExceptionController.java b/src/main/java/xyz/playedu/api/controller/ExceptionController.java
index 5bc268b..7c8c379 100644
--- a/src/main/java/xyz/playedu/api/controller/ExceptionController.java
+++ b/src/main/java/xyz/playedu/api/controller/ExceptionController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -37,11 +37,11 @@ import java.util.List;
@Slf4j
public class ExceptionController {
- @ExceptionHandler(Exception.class)
- public JsonResponse exceptionHandler(Exception e) {
- log.error(e.getMessage());
- return JsonResponse.error("系统错误", 500);
- }
+ // @ExceptionHandler(Exception.class)
+ // public JsonResponse exceptionHandler(Exception e) {
+ // log.error(e.getMessage());
+ // return JsonResponse.error("系统错误", 500);
+ // }
@ExceptionHandler(ServiceException.class)
public JsonResponse serviceExceptionHandler(ServiceException e) {
diff --git a/src/main/java/xyz/playedu/api/controller/backend/AdminRoleController.java b/src/main/java/xyz/playedu/api/controller/backend/AdminRoleController.java
index 13f9939..e64a4c7 100644
--- a/src/main/java/xyz/playedu/api/controller/backend/AdminRoleController.java
+++ b/src/main/java/xyz/playedu/api/controller/backend/AdminRoleController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/controller/backend/AdminUserController.java b/src/main/java/xyz/playedu/api/controller/backend/AdminUserController.java
index a83fbf9..f31aa96 100644
--- a/src/main/java/xyz/playedu/api/controller/backend/AdminUserController.java
+++ b/src/main/java/xyz/playedu/api/controller/backend/AdminUserController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/controller/backend/AppConfigController.java b/src/main/java/xyz/playedu/api/controller/backend/AppConfigController.java
index e363042..5838782 100644
--- a/src/main/java/xyz/playedu/api/controller/backend/AppConfigController.java
+++ b/src/main/java/xyz/playedu/api/controller/backend/AppConfigController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,11 +18,16 @@ package xyz.playedu.api.controller.backend;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
+import xyz.playedu.api.constant.BPermissionConstant;
+import xyz.playedu.api.constant.SystemConstant;
import xyz.playedu.api.domain.AppConfig;
+import xyz.playedu.api.middleware.BackendPermissionMiddleware;
import xyz.playedu.api.request.backend.AppConfigRequest;
import xyz.playedu.api.service.AppConfigService;
import xyz.playedu.api.types.JsonResponse;
+import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
/**
@@ -36,15 +41,33 @@ public class AppConfigController {
@Autowired private AppConfigService configService;
+ @BackendPermissionMiddleware(slug = BPermissionConstant.SYSTEM_CONFIG)
@GetMapping("")
public JsonResponse index() {
List configs = configService.allShow();
- return JsonResponse.data(configs);
+ List data = new ArrayList<>();
+ for (AppConfig item : configs) {
+ if (item.getIsPrivate() == 1) {
+ item.setKeyValue(SystemConstant.CONFIG_MASK);
+ }
+ data.add(item);
+ }
+ return JsonResponse.data(data);
}
+ @BackendPermissionMiddleware(slug = BPermissionConstant.SYSTEM_CONFIG)
@PutMapping("")
public JsonResponse save(@RequestBody AppConfigRequest req) {
- configService.saveFromMap(req.getData());
+ HashMap data = new HashMap<>();
+ req.getData()
+ .forEach(
+ (key, value) -> {
+ if (SystemConstant.CONFIG_MASK.equals(value)) {
+ return;
+ }
+ data.put(key, value);
+ });
+ configService.saveFromMap(data);
return JsonResponse.data(null);
}
}
diff --git a/src/main/java/xyz/playedu/api/controller/backend/CourseChapterController.java b/src/main/java/xyz/playedu/api/controller/backend/CourseChapterController.java
index 05842d9..9b1489f 100644
--- a/src/main/java/xyz/playedu/api/controller/backend/CourseChapterController.java
+++ b/src/main/java/xyz/playedu/api/controller/backend/CourseChapterController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/controller/backend/CourseController.java b/src/main/java/xyz/playedu/api/controller/backend/CourseController.java
index e7db832..d4b9130 100644
--- a/src/main/java/xyz/playedu/api/controller/backend/CourseController.java
+++ b/src/main/java/xyz/playedu/api/controller/backend/CourseController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/controller/backend/CourseHourController.java b/src/main/java/xyz/playedu/api/controller/backend/CourseHourController.java
index 51bed2f..5ea5218 100644
--- a/src/main/java/xyz/playedu/api/controller/backend/CourseHourController.java
+++ b/src/main/java/xyz/playedu/api/controller/backend/CourseHourController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/controller/backend/CourseUserController.java b/src/main/java/xyz/playedu/api/controller/backend/CourseUserController.java
index 897907d..7ef7b51 100644
--- a/src/main/java/xyz/playedu/api/controller/backend/CourseUserController.java
+++ b/src/main/java/xyz/playedu/api/controller/backend/CourseUserController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/controller/backend/DashboardController.java b/src/main/java/xyz/playedu/api/controller/backend/DashboardController.java
index a7b2929..6a701b3 100644
--- a/src/main/java/xyz/playedu/api/controller/backend/DashboardController.java
+++ b/src/main/java/xyz/playedu/api/controller/backend/DashboardController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/controller/backend/DepartmentController.java b/src/main/java/xyz/playedu/api/controller/backend/DepartmentController.java
index e08c54a..f3bb170 100644
--- a/src/main/java/xyz/playedu/api/controller/backend/DepartmentController.java
+++ b/src/main/java/xyz/playedu/api/controller/backend/DepartmentController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/controller/backend/LoginController.java b/src/main/java/xyz/playedu/api/controller/backend/LoginController.java
index 119b177..e37fc7b 100644
--- a/src/main/java/xyz/playedu/api/controller/backend/LoginController.java
+++ b/src/main/java/xyz/playedu/api/controller/backend/LoginController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,18 +23,15 @@ import org.springframework.web.bind.annotation.*;
import xyz.playedu.api.BCtx;
import xyz.playedu.api.bus.BackendBus;
import xyz.playedu.api.constant.BPermissionConstant;
-import xyz.playedu.api.constant.SystemConstant;
import xyz.playedu.api.domain.AdminUser;
import xyz.playedu.api.event.AdminUserLoginEvent;
-import xyz.playedu.api.exception.JwtLogoutException;
import xyz.playedu.api.middleware.BackendPermissionMiddleware;
import xyz.playedu.api.middleware.ImageCaptchaCheckMiddleware;
import xyz.playedu.api.request.backend.LoginRequest;
import xyz.playedu.api.request.backend.PasswordChangeRequest;
import xyz.playedu.api.service.AdminUserService;
-import xyz.playedu.api.service.JWTService;
+import xyz.playedu.api.service.BackendAuthService;
import xyz.playedu.api.types.JsonResponse;
-import xyz.playedu.api.types.JwtToken;
import xyz.playedu.api.util.HelperUtil;
import xyz.playedu.api.util.IpUtil;
import xyz.playedu.api.util.RequestUtil;
@@ -49,7 +46,7 @@ public class LoginController {
@Autowired private BackendBus backendBus;
- @Autowired private JWTService jwtService;
+ @Autowired private BackendAuthService authService;
@Autowired private ApplicationContext ctx;
@@ -69,19 +66,16 @@ public class LoginController {
return JsonResponse.error("当前用户已禁止登录");
}
- String url = RequestUtil.url();
- JwtToken token =
- jwtService.generate(adminUser.getId(), url, SystemConstant.JWT_PRV_ADMIN_USER);
+ String token = authService.loginUsingId(adminUser.getId(), RequestUtil.url());
HashMap data = new HashMap<>();
- data.put("token", token.getToken());
- data.put("expire", token.getExpire());
+ data.put("token", token);
ctx.publishEvent(
new AdminUserLoginEvent(
this,
adminUser.getId(),
- token.getToken(),
+ token,
IpUtil.getIpAddress(),
adminUser.getLoginTimes()));
@@ -89,8 +83,8 @@ public class LoginController {
}
@PostMapping("/logout")
- public JsonResponse logout() throws JwtLogoutException {
- jwtService.adminUserLogout(RequestUtil.token());
+ public JsonResponse logout() {
+ authService.logout();
return JsonResponse.success("success");
}
diff --git a/src/main/java/xyz/playedu/api/controller/backend/ResourceCategoryController.java b/src/main/java/xyz/playedu/api/controller/backend/ResourceCategoryController.java
index 1a4ba22..7f6bfa4 100644
--- a/src/main/java/xyz/playedu/api/controller/backend/ResourceCategoryController.java
+++ b/src/main/java/xyz/playedu/api/controller/backend/ResourceCategoryController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/controller/backend/ResourceController.java b/src/main/java/xyz/playedu/api/controller/backend/ResourceController.java
index e4ecfac..98385b1 100644
--- a/src/main/java/xyz/playedu/api/controller/backend/ResourceController.java
+++ b/src/main/java/xyz/playedu/api/controller/backend/ResourceController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -15,21 +15,24 @@
*/
package xyz.playedu.api.controller.backend;
+import lombok.SneakyThrows;
+
import org.apache.commons.collections4.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
+import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import xyz.playedu.api.BCtx;
import xyz.playedu.api.bus.BackendBus;
-import xyz.playedu.api.constant.BPermissionConstant;
import xyz.playedu.api.constant.BackendConstant;
import xyz.playedu.api.domain.AdminUser;
import xyz.playedu.api.domain.Resource;
import xyz.playedu.api.domain.ResourceVideo;
import xyz.playedu.api.exception.NotFoundException;
-import xyz.playedu.api.middleware.BackendPermissionMiddleware;
+import xyz.playedu.api.exception.ServiceException;
import xyz.playedu.api.request.backend.ResourceDestroyMultiRequest;
+import xyz.playedu.api.request.backend.ResourceUpdateRequest;
import xyz.playedu.api.service.AdminUserService;
import xyz.playedu.api.service.MinioService;
import xyz.playedu.api.service.ResourceService;
@@ -41,11 +44,6 @@ import xyz.playedu.api.types.paginate.ResourcePaginateFilter;
import java.util.*;
import java.util.stream.Collectors;
-/**
- * @Author 杭州白书科技有限公司
- *
- * @create 2023/2/23 10:50
- */
@RestController
@RequestMapping("/backend/v1/resource")
public class ResourceController {
@@ -114,11 +112,18 @@ public class ResourceController {
return JsonResponse.data(data);
}
- @BackendPermissionMiddleware(slug = BPermissionConstant.RESOURCE_DESTROY)
@DeleteMapping("/{id}")
@Transactional
+ @SneakyThrows
public JsonResponse destroy(@PathVariable(name = "id") Integer id) throws NotFoundException {
Resource resource = resourceService.findOrFail(id);
+
+ if (!backendBus.isSuperAdmin()) {
+ if (!resource.getAdminId().equals(BCtx.getId())) {
+ throw new ServiceException("无权限");
+ }
+ }
+
// 删除文件
minioService.removeByPath(resource.getPath());
// 如果是视频资源文件则删除对应的时长关联记录
@@ -130,24 +135,70 @@ public class ResourceController {
return JsonResponse.success();
}
- @BackendPermissionMiddleware(slug = BPermissionConstant.RESOURCE_DESTROY)
@PostMapping("/destroy-multi")
- @Transactional
+ @SneakyThrows
public JsonResponse multiDestroy(@RequestBody ResourceDestroyMultiRequest req) {
if (req.getIds() == null || req.getIds().size() == 0) {
return JsonResponse.error("请选择需要删除的资源");
}
+
List resources = resourceService.chunks(req.getIds());
if (resources == null || resources.size() == 0) {
return JsonResponse.success();
}
+
for (Resource resourceItem : resources) {
+ // 权限校验
+ if (!backendBus.isSuperAdmin()) {
+ if (!resourceItem.getAdminId().equals(BCtx.getId())) {
+ throw new ServiceException("无权限");
+ }
+ }
+
+ // 删除资源源文件
minioService.removeByPath(resourceItem.getPath());
+ // 如果是视频资源的话还需要删除视频的关联资源,如: 封面截图
if (BackendConstant.RESOURCE_TYPE_VIDEO.equals(resourceItem.getType())) {
resourceVideoService.removeByRid(resourceItem.getId());
}
+ // 删除数据库的记录
resourceService.removeById(resourceItem.getId());
}
return JsonResponse.success();
}
+
+ @GetMapping("/{id}")
+ @SneakyThrows
+ public JsonResponse edit(@PathVariable(name = "id") Integer id) {
+ Resource resource = resourceService.findOrFail(id);
+
+ if (!backendBus.isSuperAdmin()) {
+ if (!resource.getAdminId().equals(BCtx.getId())) {
+ throw new ServiceException("无权限");
+ }
+ }
+
+ HashMap data = new HashMap<>();
+ data.put("resources", resource);
+ data.put("category_ids", resourceService.categoryIds(id));
+ return JsonResponse.data(data);
+ }
+
+ @PutMapping("/{id}")
+ @SneakyThrows
+ public JsonResponse update(
+ @RequestBody @Validated ResourceUpdateRequest req,
+ @PathVariable(name = "id") Integer id) {
+ Resource resource = resourceService.findOrFail(id);
+
+ if (!backendBus.isSuperAdmin()) {
+ if (!resource.getAdminId().equals(BCtx.getId())) {
+ throw new ServiceException("无权限");
+ }
+ }
+
+ resourceService.updateNameAndCategoryId(
+ resource.getId(), req.getName(), req.getCategoryId());
+ return JsonResponse.success();
+ }
}
diff --git a/src/main/java/xyz/playedu/api/controller/backend/SystemController.java b/src/main/java/xyz/playedu/api/controller/backend/SystemController.java
index e53e726..6e0f18f 100644
--- a/src/main/java/xyz/playedu/api/controller/backend/SystemController.java
+++ b/src/main/java/xyz/playedu/api/controller/backend/SystemController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -60,6 +60,10 @@ public class SystemController {
String apiUrl = configData.get(CConfig.SYSTEM_API_URL);
if (apiUrl == null || apiUrl.trim().length() == 0) {
apiUrl = RequestUtil.uriWithProtocol();
+ } else {
+ if (apiUrl.endsWith("/")) {
+ apiUrl = apiUrl.substring(0, apiUrl.length() - 1);
+ }
}
HashMap data = new HashMap<>();
diff --git a/src/main/java/xyz/playedu/api/controller/backend/UploadController.java b/src/main/java/xyz/playedu/api/controller/backend/UploadController.java
index 3735c28..32755a3 100644
--- a/src/main/java/xyz/playedu/api/controller/backend/UploadController.java
+++ b/src/main/java/xyz/playedu/api/controller/backend/UploadController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/controller/backend/UserController.java b/src/main/java/xyz/playedu/api/controller/backend/UserController.java
index a05335b..32bc29c 100644
--- a/src/main/java/xyz/playedu/api/controller/backend/UserController.java
+++ b/src/main/java/xyz/playedu/api/controller/backend/UserController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/controller/frontend/CategoryController.java b/src/main/java/xyz/playedu/api/controller/frontend/CategoryController.java
index 95b9cd0..3afdaa9 100644
--- a/src/main/java/xyz/playedu/api/controller/frontend/CategoryController.java
+++ b/src/main/java/xyz/playedu/api/controller/frontend/CategoryController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/controller/frontend/CourseController.java b/src/main/java/xyz/playedu/api/controller/frontend/CourseController.java
index 7fac3c6..10f0386 100644
--- a/src/main/java/xyz/playedu/api/controller/frontend/CourseController.java
+++ b/src/main/java/xyz/playedu/api/controller/frontend/CourseController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/controller/frontend/DepartmentController.java b/src/main/java/xyz/playedu/api/controller/frontend/DepartmentController.java
index 8866548..79c14aa 100644
--- a/src/main/java/xyz/playedu/api/controller/frontend/DepartmentController.java
+++ b/src/main/java/xyz/playedu/api/controller/frontend/DepartmentController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/controller/frontend/HourController.java b/src/main/java/xyz/playedu/api/controller/frontend/HourController.java
index d46b770..2c1c958 100644
--- a/src/main/java/xyz/playedu/api/controller/frontend/HourController.java
+++ b/src/main/java/xyz/playedu/api/controller/frontend/HourController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/controller/frontend/IndexController.java b/src/main/java/xyz/playedu/api/controller/frontend/IndexController.java
index a765a71..6de4065 100644
--- a/src/main/java/xyz/playedu/api/controller/frontend/IndexController.java
+++ b/src/main/java/xyz/playedu/api/controller/frontend/IndexController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/controller/frontend/LoginController.java b/src/main/java/xyz/playedu/api/controller/frontend/LoginController.java
index b5ad7ea..aaec818 100644
--- a/src/main/java/xyz/playedu/api/controller/frontend/LoginController.java
+++ b/src/main/java/xyz/playedu/api/controller/frontend/LoginController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,36 +24,28 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.playedu.api.FCtx;
-import xyz.playedu.api.constant.SystemConstant;
import xyz.playedu.api.domain.User;
import xyz.playedu.api.event.UserLoginEvent;
import xyz.playedu.api.event.UserLogoutEvent;
-import xyz.playedu.api.exception.JwtLogoutException;
import xyz.playedu.api.exception.LimitException;
import xyz.playedu.api.middleware.ImageCaptchaCheckMiddleware;
import xyz.playedu.api.request.frontend.LoginPasswordRequest;
-import xyz.playedu.api.service.JWTService;
+import xyz.playedu.api.service.FrontendAuthService;
import xyz.playedu.api.service.UserService;
import xyz.playedu.api.types.JsonResponse;
-import xyz.playedu.api.types.JwtToken;
import xyz.playedu.api.util.HelperUtil;
import xyz.playedu.api.util.IpUtil;
import xyz.playedu.api.util.RequestUtil;
import java.util.HashMap;
-/**
- * @Author 杭州白书科技有限公司
- *
- * @create 2023/3/2 21:51
- */
@RestController
@RequestMapping("/api/v1/auth/login")
public class LoginController {
@Autowired private UserService userService;
- @Autowired private JWTService jwtService;
+ @Autowired private FrontendAuthService authService;
@Autowired private ApplicationContext ctx;
@@ -74,19 +66,17 @@ public class LoginController {
return JsonResponse.error("当前学员已锁定无法登录");
}
- JwtToken token =
- jwtService.generate(user.getId(), RequestUtil.url(), SystemConstant.JWT_PRV_USER);
+ String token = authService.loginUsingId(user.getId(), RequestUtil.url());
HashMap data = new HashMap<>();
- data.put("token", token.getToken());
- data.put("expired", token.getExpire());
+ data.put("token", token);
ctx.publishEvent(
new UserLoginEvent(
this,
user.getId(),
user.getEmail(),
- token.getToken(),
+ token,
IpUtil.getIpAddress(),
RequestUtil.ua()));
@@ -94,8 +84,8 @@ public class LoginController {
}
@PostMapping("/logout")
- public JsonResponse logout() throws JwtLogoutException {
- jwtService.userLogout(RequestUtil.token());
+ public JsonResponse logout() {
+ authService.logout();
ctx.publishEvent(new UserLogoutEvent(this, FCtx.getId(), FCtx.getJwtJti()));
return JsonResponse.success();
}
diff --git a/src/main/java/xyz/playedu/api/controller/frontend/SystemController.java b/src/main/java/xyz/playedu/api/controller/frontend/SystemController.java
index 96e5694..f2d729e 100644
--- a/src/main/java/xyz/playedu/api/controller/frontend/SystemController.java
+++ b/src/main/java/xyz/playedu/api/controller/frontend/SystemController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/controller/frontend/UserController.java b/src/main/java/xyz/playedu/api/controller/frontend/UserController.java
index 08ef0e5..97b7fab 100644
--- a/src/main/java/xyz/playedu/api/controller/frontend/UserController.java
+++ b/src/main/java/xyz/playedu/api/controller/frontend/UserController.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -66,13 +66,14 @@ public class UserController {
@GetMapping("/detail")
public JsonResponse detail() {
User user = FCtx.getUser();
- List departments =
- departmentService.listByIds(userService.getDepIdsByUserId(user.getId()));
-
- if (user.getIdCard() != null && user.getIdCard().length() > 0) {
- user.setIdCard(PrivacyUtil.hideIDCard(user.getIdCard()));
+ List departments = new ArrayList<>();
+ List depIds = userService.getDepIdsByUserId(user.getId());
+ if (depIds != null && depIds.size() > 0) {
+ departments = departmentService.listByIds(depIds);
}
+ user.setIdCard(PrivacyUtil.hideIDCard(user.getIdCard()));
+
HashMap data = new HashMap<>();
data.put("user", user);
data.put("departments", departments);
diff --git a/src/main/java/xyz/playedu/api/domain/AdminLog.java b/src/main/java/xyz/playedu/api/domain/AdminLog.java
index 142b118..214b57e 100644
--- a/src/main/java/xyz/playedu/api/domain/AdminLog.java
+++ b/src/main/java/xyz/playedu/api/domain/AdminLog.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/AdminPermission.java b/src/main/java/xyz/playedu/api/domain/AdminPermission.java
index e5d0fa4..902ebcf 100644
--- a/src/main/java/xyz/playedu/api/domain/AdminPermission.java
+++ b/src/main/java/xyz/playedu/api/domain/AdminPermission.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/AdminRole.java b/src/main/java/xyz/playedu/api/domain/AdminRole.java
index b6773ac..7f0f926 100644
--- a/src/main/java/xyz/playedu/api/domain/AdminRole.java
+++ b/src/main/java/xyz/playedu/api/domain/AdminRole.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/AdminRolePermission.java b/src/main/java/xyz/playedu/api/domain/AdminRolePermission.java
index a769e0e..e8fe3b3 100644
--- a/src/main/java/xyz/playedu/api/domain/AdminRolePermission.java
+++ b/src/main/java/xyz/playedu/api/domain/AdminRolePermission.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/AdminUser.java b/src/main/java/xyz/playedu/api/domain/AdminUser.java
index cb6299d..b370643 100644
--- a/src/main/java/xyz/playedu/api/domain/AdminUser.java
+++ b/src/main/java/xyz/playedu/api/domain/AdminUser.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/AdminUserRole.java b/src/main/java/xyz/playedu/api/domain/AdminUserRole.java
index 643f0da..b35c8a2 100644
--- a/src/main/java/xyz/playedu/api/domain/AdminUserRole.java
+++ b/src/main/java/xyz/playedu/api/domain/AdminUserRole.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/AppConfig.java b/src/main/java/xyz/playedu/api/domain/AppConfig.java
index 40747cb..69a450b 100644
--- a/src/main/java/xyz/playedu/api/domain/AppConfig.java
+++ b/src/main/java/xyz/playedu/api/domain/AppConfig.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/CategoryCourse.java b/src/main/java/xyz/playedu/api/domain/CategoryCourse.java
index 1adba56..1a72662 100644
--- a/src/main/java/xyz/playedu/api/domain/CategoryCourse.java
+++ b/src/main/java/xyz/playedu/api/domain/CategoryCourse.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/Course.java b/src/main/java/xyz/playedu/api/domain/Course.java
index 00709fd..0d16fc0 100644
--- a/src/main/java/xyz/playedu/api/domain/Course.java
+++ b/src/main/java/xyz/playedu/api/domain/Course.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/CourseChapter.java b/src/main/java/xyz/playedu/api/domain/CourseChapter.java
index cc951de..488afe4 100644
--- a/src/main/java/xyz/playedu/api/domain/CourseChapter.java
+++ b/src/main/java/xyz/playedu/api/domain/CourseChapter.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/CourseDepartment.java b/src/main/java/xyz/playedu/api/domain/CourseDepartment.java
index 89b18e6..9a3237d 100644
--- a/src/main/java/xyz/playedu/api/domain/CourseDepartment.java
+++ b/src/main/java/xyz/playedu/api/domain/CourseDepartment.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/CourseHour.java b/src/main/java/xyz/playedu/api/domain/CourseHour.java
index b0782ee..e99041c 100644
--- a/src/main/java/xyz/playedu/api/domain/CourseHour.java
+++ b/src/main/java/xyz/playedu/api/domain/CourseHour.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/Department.java b/src/main/java/xyz/playedu/api/domain/Department.java
index 2ac2fb7..412bdaa 100644
--- a/src/main/java/xyz/playedu/api/domain/Department.java
+++ b/src/main/java/xyz/playedu/api/domain/Department.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/Resource.java b/src/main/java/xyz/playedu/api/domain/Resource.java
index 134afca..e794e6f 100644
--- a/src/main/java/xyz/playedu/api/domain/Resource.java
+++ b/src/main/java/xyz/playedu/api/domain/Resource.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/ResourceCategory.java b/src/main/java/xyz/playedu/api/domain/ResourceCategory.java
index 231b0c8..4a601c6 100644
--- a/src/main/java/xyz/playedu/api/domain/ResourceCategory.java
+++ b/src/main/java/xyz/playedu/api/domain/ResourceCategory.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/ResourceCategoryRelation.java b/src/main/java/xyz/playedu/api/domain/ResourceCategoryRelation.java
index 1fb80e4..8870d78 100644
--- a/src/main/java/xyz/playedu/api/domain/ResourceCategoryRelation.java
+++ b/src/main/java/xyz/playedu/api/domain/ResourceCategoryRelation.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/ResourceCourseCategory.java b/src/main/java/xyz/playedu/api/domain/ResourceCourseCategory.java
index a8681ec..57729da 100644
--- a/src/main/java/xyz/playedu/api/domain/ResourceCourseCategory.java
+++ b/src/main/java/xyz/playedu/api/domain/ResourceCourseCategory.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/ResourceVideo.java b/src/main/java/xyz/playedu/api/domain/ResourceVideo.java
index 86e118c..6a7f273 100644
--- a/src/main/java/xyz/playedu/api/domain/ResourceVideo.java
+++ b/src/main/java/xyz/playedu/api/domain/ResourceVideo.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/User.java b/src/main/java/xyz/playedu/api/domain/User.java
index d8d2cbc..7c3b986 100644
--- a/src/main/java/xyz/playedu/api/domain/User.java
+++ b/src/main/java/xyz/playedu/api/domain/User.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/UserCourseHourRecord.java b/src/main/java/xyz/playedu/api/domain/UserCourseHourRecord.java
index 12869d0..c8e6d32 100644
--- a/src/main/java/xyz/playedu/api/domain/UserCourseHourRecord.java
+++ b/src/main/java/xyz/playedu/api/domain/UserCourseHourRecord.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/UserCourseRecord.java b/src/main/java/xyz/playedu/api/domain/UserCourseRecord.java
index a652bb2..b11ed46 100644
--- a/src/main/java/xyz/playedu/api/domain/UserCourseRecord.java
+++ b/src/main/java/xyz/playedu/api/domain/UserCourseRecord.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/UserDepartment.java b/src/main/java/xyz/playedu/api/domain/UserDepartment.java
index 5abd955..2c736b1 100644
--- a/src/main/java/xyz/playedu/api/domain/UserDepartment.java
+++ b/src/main/java/xyz/playedu/api/domain/UserDepartment.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/UserLearnDurationRecord.java b/src/main/java/xyz/playedu/api/domain/UserLearnDurationRecord.java
index f5dc375..f159102 100644
--- a/src/main/java/xyz/playedu/api/domain/UserLearnDurationRecord.java
+++ b/src/main/java/xyz/playedu/api/domain/UserLearnDurationRecord.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/UserLearnDurationStats.java b/src/main/java/xyz/playedu/api/domain/UserLearnDurationStats.java
index 75ef6f9..dea8b56 100644
--- a/src/main/java/xyz/playedu/api/domain/UserLearnDurationStats.java
+++ b/src/main/java/xyz/playedu/api/domain/UserLearnDurationStats.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/UserLoginRecord.java b/src/main/java/xyz/playedu/api/domain/UserLoginRecord.java
index 7e28090..d95ad27 100644
--- a/src/main/java/xyz/playedu/api/domain/UserLoginRecord.java
+++ b/src/main/java/xyz/playedu/api/domain/UserLoginRecord.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/domain/UserUploadImageLog.java b/src/main/java/xyz/playedu/api/domain/UserUploadImageLog.java
index 977b8dc..392c6bd 100644
--- a/src/main/java/xyz/playedu/api/domain/UserUploadImageLog.java
+++ b/src/main/java/xyz/playedu/api/domain/UserUploadImageLog.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/event/AdminUserLoginEvent.java b/src/main/java/xyz/playedu/api/event/AdminUserLoginEvent.java
index a2b8bbc..f58228a 100644
--- a/src/main/java/xyz/playedu/api/event/AdminUserLoginEvent.java
+++ b/src/main/java/xyz/playedu/api/event/AdminUserLoginEvent.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/event/CourseCategoryDestroyEvent.java b/src/main/java/xyz/playedu/api/event/CourseCategoryDestroyEvent.java
index e17ff9f..9fc431e 100644
--- a/src/main/java/xyz/playedu/api/event/CourseCategoryDestroyEvent.java
+++ b/src/main/java/xyz/playedu/api/event/CourseCategoryDestroyEvent.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/event/CourseChapterDestroyEvent.java b/src/main/java/xyz/playedu/api/event/CourseChapterDestroyEvent.java
index 590ddd0..8dd6ad3 100644
--- a/src/main/java/xyz/playedu/api/event/CourseChapterDestroyEvent.java
+++ b/src/main/java/xyz/playedu/api/event/CourseChapterDestroyEvent.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/event/CourseDestroyEvent.java b/src/main/java/xyz/playedu/api/event/CourseDestroyEvent.java
index 1948700..1d55871 100644
--- a/src/main/java/xyz/playedu/api/event/CourseDestroyEvent.java
+++ b/src/main/java/xyz/playedu/api/event/CourseDestroyEvent.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/event/CourseHourCreatedEvent.java b/src/main/java/xyz/playedu/api/event/CourseHourCreatedEvent.java
index 1409c88..4a733dc 100644
--- a/src/main/java/xyz/playedu/api/event/CourseHourCreatedEvent.java
+++ b/src/main/java/xyz/playedu/api/event/CourseHourCreatedEvent.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/event/CourseHourDestroyEvent.java b/src/main/java/xyz/playedu/api/event/CourseHourDestroyEvent.java
index 1ebae77..f402b02 100644
--- a/src/main/java/xyz/playedu/api/event/CourseHourDestroyEvent.java
+++ b/src/main/java/xyz/playedu/api/event/CourseHourDestroyEvent.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/event/DepartmentDestroyEvent.java b/src/main/java/xyz/playedu/api/event/DepartmentDestroyEvent.java
index dc424bb..de9db84 100644
--- a/src/main/java/xyz/playedu/api/event/DepartmentDestroyEvent.java
+++ b/src/main/java/xyz/playedu/api/event/DepartmentDestroyEvent.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/event/ResourceCategoryDestroyEvent.java b/src/main/java/xyz/playedu/api/event/ResourceCategoryDestroyEvent.java
index 07d6556..f746430 100644
--- a/src/main/java/xyz/playedu/api/event/ResourceCategoryDestroyEvent.java
+++ b/src/main/java/xyz/playedu/api/event/ResourceCategoryDestroyEvent.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/event/UserCourseHourFinishedEvent.java b/src/main/java/xyz/playedu/api/event/UserCourseHourFinishedEvent.java
index 57afd07..b3e0c44 100644
--- a/src/main/java/xyz/playedu/api/event/UserCourseHourFinishedEvent.java
+++ b/src/main/java/xyz/playedu/api/event/UserCourseHourFinishedEvent.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/event/UserCourseHourRecordDestroyEvent.java b/src/main/java/xyz/playedu/api/event/UserCourseHourRecordDestroyEvent.java
index 29df33b..1fceeaa 100644
--- a/src/main/java/xyz/playedu/api/event/UserCourseHourRecordDestroyEvent.java
+++ b/src/main/java/xyz/playedu/api/event/UserCourseHourRecordDestroyEvent.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/event/UserCourseRecordDestroyEvent.java b/src/main/java/xyz/playedu/api/event/UserCourseRecordDestroyEvent.java
index 682ed0b..8fbe5ec 100644
--- a/src/main/java/xyz/playedu/api/event/UserCourseRecordDestroyEvent.java
+++ b/src/main/java/xyz/playedu/api/event/UserCourseRecordDestroyEvent.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/event/UserDestroyEvent.java b/src/main/java/xyz/playedu/api/event/UserDestroyEvent.java
index 3e369ea..988f648 100644
--- a/src/main/java/xyz/playedu/api/event/UserDestroyEvent.java
+++ b/src/main/java/xyz/playedu/api/event/UserDestroyEvent.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/event/UserLearnCourseUpdateEvent.java b/src/main/java/xyz/playedu/api/event/UserLearnCourseUpdateEvent.java
index c985c6a..3c023b7 100644
--- a/src/main/java/xyz/playedu/api/event/UserLearnCourseUpdateEvent.java
+++ b/src/main/java/xyz/playedu/api/event/UserLearnCourseUpdateEvent.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/event/UserLoginEvent.java b/src/main/java/xyz/playedu/api/event/UserLoginEvent.java
index 01024f6..011586a 100644
--- a/src/main/java/xyz/playedu/api/event/UserLoginEvent.java
+++ b/src/main/java/xyz/playedu/api/event/UserLoginEvent.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/event/UserLogoutEvent.java b/src/main/java/xyz/playedu/api/event/UserLogoutEvent.java
index f3afa45..a4ee518 100644
--- a/src/main/java/xyz/playedu/api/event/UserLogoutEvent.java
+++ b/src/main/java/xyz/playedu/api/event/UserLogoutEvent.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/exception/JwtLogoutException.java b/src/main/java/xyz/playedu/api/exception/JwtLogoutException.java
deleted file mode 100644
index c9bf060..0000000
--- a/src/main/java/xyz/playedu/api/exception/JwtLogoutException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2023 杭州白书科技有限公司
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package xyz.playedu.api.exception;
-
-public class JwtLogoutException extends Exception {
- public JwtLogoutException() {
- super();
- }
-
- public JwtLogoutException(String message) {
- super(message);
- }
-
- public JwtLogoutException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public JwtLogoutException(Throwable cause) {
- super(cause);
- }
-
- protected JwtLogoutException(
- String message,
- Throwable cause,
- boolean enableSuppression,
- boolean writableStackTrace) {
- super(message, cause, enableSuppression, writableStackTrace);
- }
-}
diff --git a/src/main/java/xyz/playedu/api/exception/LimitException.java b/src/main/java/xyz/playedu/api/exception/LimitException.java
index eb4b485..be9069d 100644
--- a/src/main/java/xyz/playedu/api/exception/LimitException.java
+++ b/src/main/java/xyz/playedu/api/exception/LimitException.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/exception/NotFoundException.java b/src/main/java/xyz/playedu/api/exception/NotFoundException.java
index 9b155ce..55ef707 100644
--- a/src/main/java/xyz/playedu/api/exception/NotFoundException.java
+++ b/src/main/java/xyz/playedu/api/exception/NotFoundException.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/exception/ServiceException.java b/src/main/java/xyz/playedu/api/exception/ServiceException.java
index 1726b1a..53da30f 100644
--- a/src/main/java/xyz/playedu/api/exception/ServiceException.java
+++ b/src/main/java/xyz/playedu/api/exception/ServiceException.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/listener/AdminUserLoginListener.java b/src/main/java/xyz/playedu/api/listener/AdminUserLoginListener.java
index bb45ba7..a4c2a4a 100644
--- a/src/main/java/xyz/playedu/api/listener/AdminUserLoginListener.java
+++ b/src/main/java/xyz/playedu/api/listener/AdminUserLoginListener.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/listener/CourseCategoryDestroyListener.java b/src/main/java/xyz/playedu/api/listener/CourseCategoryDestroyListener.java
index 8d976e9..8ecbcce 100644
--- a/src/main/java/xyz/playedu/api/listener/CourseCategoryDestroyListener.java
+++ b/src/main/java/xyz/playedu/api/listener/CourseCategoryDestroyListener.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/listener/CourseChapterDestroyListener.java b/src/main/java/xyz/playedu/api/listener/CourseChapterDestroyListener.java
index 61b3b88..e508d04 100644
--- a/src/main/java/xyz/playedu/api/listener/CourseChapterDestroyListener.java
+++ b/src/main/java/xyz/playedu/api/listener/CourseChapterDestroyListener.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/listener/CourseDestroyListener.java b/src/main/java/xyz/playedu/api/listener/CourseDestroyListener.java
index c8800b0..7d45007 100644
--- a/src/main/java/xyz/playedu/api/listener/CourseDestroyListener.java
+++ b/src/main/java/xyz/playedu/api/listener/CourseDestroyListener.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/listener/CourseHourCreatedListener.java b/src/main/java/xyz/playedu/api/listener/CourseHourCreatedListener.java
index 4f1a2ee..a91d993 100644
--- a/src/main/java/xyz/playedu/api/listener/CourseHourCreatedListener.java
+++ b/src/main/java/xyz/playedu/api/listener/CourseHourCreatedListener.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/listener/CourseHourDestroyListener.java b/src/main/java/xyz/playedu/api/listener/CourseHourDestroyListener.java
index 2dff635..fddc721 100644
--- a/src/main/java/xyz/playedu/api/listener/CourseHourDestroyListener.java
+++ b/src/main/java/xyz/playedu/api/listener/CourseHourDestroyListener.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/listener/DepartmentDestroyListener.java b/src/main/java/xyz/playedu/api/listener/DepartmentDestroyListener.java
index 3761149..1bf3c12 100644
--- a/src/main/java/xyz/playedu/api/listener/DepartmentDestroyListener.java
+++ b/src/main/java/xyz/playedu/api/listener/DepartmentDestroyListener.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/listener/UserCourseHourFinishedListener.java b/src/main/java/xyz/playedu/api/listener/UserCourseHourFinishedListener.java
index 7805098..6dcfcea 100644
--- a/src/main/java/xyz/playedu/api/listener/UserCourseHourFinishedListener.java
+++ b/src/main/java/xyz/playedu/api/listener/UserCourseHourFinishedListener.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/listener/UserCourseHourRecordDestroyListener.java b/src/main/java/xyz/playedu/api/listener/UserCourseHourRecordDestroyListener.java
index f3ce656..5fb1351 100644
--- a/src/main/java/xyz/playedu/api/listener/UserCourseHourRecordDestroyListener.java
+++ b/src/main/java/xyz/playedu/api/listener/UserCourseHourRecordDestroyListener.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/listener/UserCourseRecordDestroyListener.java b/src/main/java/xyz/playedu/api/listener/UserCourseRecordDestroyListener.java
index 5040695..6721d03 100644
--- a/src/main/java/xyz/playedu/api/listener/UserCourseRecordDestroyListener.java
+++ b/src/main/java/xyz/playedu/api/listener/UserCourseRecordDestroyListener.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/listener/UserDestroyListener.java b/src/main/java/xyz/playedu/api/listener/UserDestroyListener.java
index 483bd2b..8ef78a4 100644
--- a/src/main/java/xyz/playedu/api/listener/UserDestroyListener.java
+++ b/src/main/java/xyz/playedu/api/listener/UserDestroyListener.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/listener/UserLearnCourseUpdateListener.java b/src/main/java/xyz/playedu/api/listener/UserLearnCourseUpdateListener.java
index 6e379df..88b828b 100644
--- a/src/main/java/xyz/playedu/api/listener/UserLearnCourseUpdateListener.java
+++ b/src/main/java/xyz/playedu/api/listener/UserLearnCourseUpdateListener.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/listener/UserLoginListener.java b/src/main/java/xyz/playedu/api/listener/UserLoginListener.java
index 7eb0823..7ad380a 100644
--- a/src/main/java/xyz/playedu/api/listener/UserLoginListener.java
+++ b/src/main/java/xyz/playedu/api/listener/UserLoginListener.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -22,36 +22,34 @@ import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
-import xyz.playedu.api.constant.SystemConstant;
import xyz.playedu.api.event.UserLoginEvent;
-import xyz.playedu.api.exception.JwtLogoutException;
-import xyz.playedu.api.service.JWTService;
+import xyz.playedu.api.service.FrontendAuthService;
import xyz.playedu.api.service.UserLoginRecordService;
-import xyz.playedu.api.types.JWTPayload;
import xyz.playedu.api.util.IpUtil;
-/**
- * @Author 杭州白书科技有限公司
- *
- * @create 2023/3/10 13:45
- */
+import java.util.HashMap;
+
@Component
@Slf4j
public class UserLoginListener {
@Autowired private UserLoginRecordService loginRecordService;
- @Autowired private JWTService jwtService;
+ @Autowired private FrontendAuthService authService;
@Async
@EventListener
- public void updateLoginInfo(UserLoginEvent event) throws JwtLogoutException {
+ public void updateLoginInfo(UserLoginEvent event) {
String ipArea = IpUtil.getRealAddressByIP(event.getIp());
- JWTPayload payload = jwtService.parse(event.getToken(), SystemConstant.JWT_PRV_USER);
+
+ HashMap tokenData = authService.parse(event.getToken());
+ String jti = tokenData.get("jti");
+ Long exp = Long.parseLong(tokenData.get("exp"));
+
loginRecordService.store(
event.getUserId(),
- payload.getJti(),
- payload.getExp(),
+ jti,
+ exp,
event.getIp(),
ipArea,
event.getUserAgent().getBrowser().toString(),
diff --git a/src/main/java/xyz/playedu/api/listener/UserLogoutListener.java b/src/main/java/xyz/playedu/api/listener/UserLogoutListener.java
index baf1911e..11a08fe 100644
--- a/src/main/java/xyz/playedu/api/listener/UserLogoutListener.java
+++ b/src/main/java/xyz/playedu/api/listener/UserLogoutListener.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/AdminLogMapper.java b/src/main/java/xyz/playedu/api/mapper/AdminLogMapper.java
index 927b0c2..96072f5 100644
--- a/src/main/java/xyz/playedu/api/mapper/AdminLogMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/AdminLogMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/AdminPermissionMapper.java b/src/main/java/xyz/playedu/api/mapper/AdminPermissionMapper.java
index d6e9881..82fa850 100644
--- a/src/main/java/xyz/playedu/api/mapper/AdminPermissionMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/AdminPermissionMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/AdminRoleMapper.java b/src/main/java/xyz/playedu/api/mapper/AdminRoleMapper.java
index 970ad82..b2d37b1 100644
--- a/src/main/java/xyz/playedu/api/mapper/AdminRoleMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/AdminRoleMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/AdminRolePermissionMapper.java b/src/main/java/xyz/playedu/api/mapper/AdminRolePermissionMapper.java
index 678a2c2..b7a2a43 100644
--- a/src/main/java/xyz/playedu/api/mapper/AdminRolePermissionMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/AdminRolePermissionMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/AdminUserMapper.java b/src/main/java/xyz/playedu/api/mapper/AdminUserMapper.java
index c694020..453cf4d 100644
--- a/src/main/java/xyz/playedu/api/mapper/AdminUserMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/AdminUserMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/AdminUserRoleMapper.java b/src/main/java/xyz/playedu/api/mapper/AdminUserRoleMapper.java
index e12fbca..1a4a02c 100644
--- a/src/main/java/xyz/playedu/api/mapper/AdminUserRoleMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/AdminUserRoleMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/AppConfigMapper.java b/src/main/java/xyz/playedu/api/mapper/AppConfigMapper.java
index 7c2664b..ed52a14 100644
--- a/src/main/java/xyz/playedu/api/mapper/AppConfigMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/AppConfigMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/CategoryCourseMapper.java b/src/main/java/xyz/playedu/api/mapper/CategoryCourseMapper.java
index 6ec23e4..edc4b12 100644
--- a/src/main/java/xyz/playedu/api/mapper/CategoryCourseMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/CategoryCourseMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/CourseChapterMapper.java b/src/main/java/xyz/playedu/api/mapper/CourseChapterMapper.java
index 13cda3f..554a8d0 100644
--- a/src/main/java/xyz/playedu/api/mapper/CourseChapterMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/CourseChapterMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/CourseDepartmentMapper.java b/src/main/java/xyz/playedu/api/mapper/CourseDepartmentMapper.java
index 5a3808b..b67acf5 100644
--- a/src/main/java/xyz/playedu/api/mapper/CourseDepartmentMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/CourseDepartmentMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/CourseHourMapper.java b/src/main/java/xyz/playedu/api/mapper/CourseHourMapper.java
index b60056b..050acf9 100644
--- a/src/main/java/xyz/playedu/api/mapper/CourseHourMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/CourseHourMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/CourseMapper.java b/src/main/java/xyz/playedu/api/mapper/CourseMapper.java
index 591ff57..cfb2a0a 100644
--- a/src/main/java/xyz/playedu/api/mapper/CourseMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/CourseMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/DepartmentMapper.java b/src/main/java/xyz/playedu/api/mapper/DepartmentMapper.java
index 6eea2be..2257bb0 100644
--- a/src/main/java/xyz/playedu/api/mapper/DepartmentMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/DepartmentMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/ResourceCategoryMapper.java b/src/main/java/xyz/playedu/api/mapper/ResourceCategoryMapper.java
index 569ed4f..0e3f6c3 100644
--- a/src/main/java/xyz/playedu/api/mapper/ResourceCategoryMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/ResourceCategoryMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/ResourceCategoryRelationMapper.java b/src/main/java/xyz/playedu/api/mapper/ResourceCategoryRelationMapper.java
index 2515c6b..e846417 100644
--- a/src/main/java/xyz/playedu/api/mapper/ResourceCategoryRelationMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/ResourceCategoryRelationMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/ResourceCourseCategoryMapper.java b/src/main/java/xyz/playedu/api/mapper/ResourceCourseCategoryMapper.java
index f02a699..2fc4746 100644
--- a/src/main/java/xyz/playedu/api/mapper/ResourceCourseCategoryMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/ResourceCourseCategoryMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/ResourceMapper.java b/src/main/java/xyz/playedu/api/mapper/ResourceMapper.java
index 28b4782..9755104 100644
--- a/src/main/java/xyz/playedu/api/mapper/ResourceMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/ResourceMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/ResourceVideoMapper.java b/src/main/java/xyz/playedu/api/mapper/ResourceVideoMapper.java
index c464ab1..1389ac7 100644
--- a/src/main/java/xyz/playedu/api/mapper/ResourceVideoMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/ResourceVideoMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/UserCourseHourRecordMapper.java b/src/main/java/xyz/playedu/api/mapper/UserCourseHourRecordMapper.java
index b15d3a9..14792ac 100644
--- a/src/main/java/xyz/playedu/api/mapper/UserCourseHourRecordMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/UserCourseHourRecordMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/UserCourseRecordMapper.java b/src/main/java/xyz/playedu/api/mapper/UserCourseRecordMapper.java
index f5a574f..84d97de 100644
--- a/src/main/java/xyz/playedu/api/mapper/UserCourseRecordMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/UserCourseRecordMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/UserDepartmentMapper.java b/src/main/java/xyz/playedu/api/mapper/UserDepartmentMapper.java
index 549fbe2..65028b2 100644
--- a/src/main/java/xyz/playedu/api/mapper/UserDepartmentMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/UserDepartmentMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/UserLearnDurationRecordMapper.java b/src/main/java/xyz/playedu/api/mapper/UserLearnDurationRecordMapper.java
index ab05f9d..2f2be73 100644
--- a/src/main/java/xyz/playedu/api/mapper/UserLearnDurationRecordMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/UserLearnDurationRecordMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/UserLearnDurationStatsMapper.java b/src/main/java/xyz/playedu/api/mapper/UserLearnDurationStatsMapper.java
index afd791b..6914e13 100644
--- a/src/main/java/xyz/playedu/api/mapper/UserLearnDurationStatsMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/UserLearnDurationStatsMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/UserLoginRecordMapper.java b/src/main/java/xyz/playedu/api/mapper/UserLoginRecordMapper.java
index b431390..5cdb973 100644
--- a/src/main/java/xyz/playedu/api/mapper/UserLoginRecordMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/UserLoginRecordMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/UserMapper.java b/src/main/java/xyz/playedu/api/mapper/UserMapper.java
index 6979f04..f97c021 100644
--- a/src/main/java/xyz/playedu/api/mapper/UserMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/UserMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/mapper/UserUploadImageLogMapper.java b/src/main/java/xyz/playedu/api/mapper/UserUploadImageLogMapper.java
index 68a908b..5ea3a97 100644
--- a/src/main/java/xyz/playedu/api/mapper/UserUploadImageLogMapper.java
+++ b/src/main/java/xyz/playedu/api/mapper/UserUploadImageLogMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/middleware/AdminMiddleware.java b/src/main/java/xyz/playedu/api/middleware/AdminMiddleware.java
index f7f9e3e..dc81cbb 100644
--- a/src/main/java/xyz/playedu/api/middleware/AdminMiddleware.java
+++ b/src/main/java/xyz/playedu/api/middleware/AdminMiddleware.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -27,15 +27,12 @@ import org.springframework.web.servlet.HandlerInterceptor;
import xyz.playedu.api.BCtx;
import xyz.playedu.api.bus.AppBus;
import xyz.playedu.api.bus.BackendBus;
-import xyz.playedu.api.constant.SystemConstant;
import xyz.playedu.api.domain.AdminUser;
import xyz.playedu.api.service.AdminUserService;
import xyz.playedu.api.service.AppConfigService;
-import xyz.playedu.api.service.JWTService;
-import xyz.playedu.api.types.JWTPayload;
+import xyz.playedu.api.service.BackendAuthService;
import xyz.playedu.api.types.JsonResponse;
import xyz.playedu.api.util.HelperUtil;
-import xyz.playedu.api.util.RequestUtil;
import java.io.IOException;
import java.util.Map;
@@ -44,7 +41,7 @@ import java.util.Map;
@Slf4j
public class AdminMiddleware implements HandlerInterceptor {
- @Autowired private JWTService jwtService;
+ @Autowired private BackendAuthService authService;
@Autowired private AdminUserService adminUserService;
@@ -70,33 +67,23 @@ public class AdminMiddleware implements HandlerInterceptor {
return HandlerInterceptor.super.preHandle(request, response, handler);
}
- String token = RequestUtil.token();
- if (token.length() == 0) {
+ if (!authService.check()) {
return responseTransform(response, 401, "请登录");
}
- try {
- JWTPayload payload = jwtService.parse(token, SystemConstant.JWT_PRV_ADMIN_USER);
-
- AdminUser adminUser = adminUserService.findById(payload.getSub());
- if (adminUser == null) {
- return responseTransform(response, 401, "管理员不存在");
- }
- if (adminUser.getIsBanLogin() == 1) {
- return responseTransform(response, 403, "当前管理员禁止登录");
- }
-
- BCtx.setId(payload.getSub());
- BCtx.setAdminUser(adminUser);
- BCtx.setAdminPer(backendBus.adminUserPermissions(adminUser.getId()));
-
- return HandlerInterceptor.super.preHandle(request, response, handler);
- } catch (Exception e) {
- if (appBus.isDev()) {
- log.debug("jwt解析失败:" + e.getMessage());
- }
- return responseTransform(response, 401, "请重新登录");
+ AdminUser adminUser = adminUserService.findById(authService.userId());
+ if (adminUser == null) {
+ return responseTransform(response, 401, "管理员不存在");
}
+ if (adminUser.getIsBanLogin() == 1) {
+ return responseTransform(response, 403, "当前管理员禁止登录");
+ }
+
+ BCtx.setId(authService.userId());
+ BCtx.setAdminUser(adminUser);
+ BCtx.setAdminPer(backendBus.adminUserPermissions(adminUser.getId()));
+
+ return HandlerInterceptor.super.preHandle(request, response, handler);
}
private boolean responseTransform(HttpServletResponse response, int code, String msg)
diff --git a/src/main/java/xyz/playedu/api/middleware/BackendPermissionMiddleware.java b/src/main/java/xyz/playedu/api/middleware/BackendPermissionMiddleware.java
index 9823ce6..c1a865c 100644
--- a/src/main/java/xyz/playedu/api/middleware/BackendPermissionMiddleware.java
+++ b/src/main/java/xyz/playedu/api/middleware/BackendPermissionMiddleware.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/middleware/FrontMiddleware.java b/src/main/java/xyz/playedu/api/middleware/FrontMiddleware.java
index 8b6248f..1036770 100644
--- a/src/main/java/xyz/playedu/api/middleware/FrontMiddleware.java
+++ b/src/main/java/xyz/playedu/api/middleware/FrontMiddleware.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -26,27 +26,19 @@ import org.springframework.web.servlet.HandlerInterceptor;
import xyz.playedu.api.FCtx;
import xyz.playedu.api.constant.FrontendConstant;
-import xyz.playedu.api.constant.SystemConstant;
import xyz.playedu.api.domain.User;
-import xyz.playedu.api.service.JWTService;
+import xyz.playedu.api.service.FrontendAuthService;
import xyz.playedu.api.service.UserService;
-import xyz.playedu.api.types.JWTPayload;
import xyz.playedu.api.types.JsonResponse;
import xyz.playedu.api.util.HelperUtil;
-import xyz.playedu.api.util.RequestUtil;
import java.io.IOException;
-/**
- * @Author 杭州白书科技有限公司
- *
- * @create 2023/3/13 09:40
- */
@Component
@Slf4j
public class FrontMiddleware implements HandlerInterceptor {
- @Autowired private JWTService jwtService;
+ @Autowired private FrontendAuthService authService;
@Autowired private UserService userService;
@@ -62,31 +54,23 @@ public class FrontMiddleware implements HandlerInterceptor {
return HandlerInterceptor.super.preHandle(request, response, handler);
}
- String token = RequestUtil.token();
- if (token.length() == 0) {
+ if (!authService.check()) {
return responseTransform(response, 401, "请登录");
}
- try {
- JWTPayload payload = jwtService.parse(token, SystemConstant.JWT_PRV_USER);
-
- User user = userService.find(payload.getSub());
- if (user == null) {
- return responseTransform(response, 401, "请重新登录");
- }
- if (user.getIsLock() == 1) {
- return responseTransform(response, 403, "当前学员已锁定无法登录");
- }
-
- FCtx.setUser(user);
- FCtx.setId(user.getId());
- FCtx.setJWtJti(payload.getJti());
-
- return HandlerInterceptor.super.preHandle(request, response, handler);
- } catch (Exception e) {
- log.error(e.getMessage());
+ User user = userService.find(authService.userId());
+ if (user == null) {
return responseTransform(response, 401, "请重新登录");
}
+ if (user.getIsLock() == 1) {
+ return responseTransform(response, 403, "当前学员已锁定无法登录");
+ }
+
+ FCtx.setUser(user);
+ FCtx.setId(user.getId());
+ FCtx.setJWtJti(authService.jti());
+
+ return HandlerInterceptor.super.preHandle(request, response, handler);
}
private boolean responseTransform(HttpServletResponse response, int code, String msg)
diff --git a/src/main/java/xyz/playedu/api/middleware/ImageCaptchaCheckMiddleware.java b/src/main/java/xyz/playedu/api/middleware/ImageCaptchaCheckMiddleware.java
index 4fda83f..799834b 100644
--- a/src/main/java/xyz/playedu/api/middleware/ImageCaptchaCheckMiddleware.java
+++ b/src/main/java/xyz/playedu/api/middleware/ImageCaptchaCheckMiddleware.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/middleware/Lock.java b/src/main/java/xyz/playedu/api/middleware/Lock.java
index c04715d..a309560 100644
--- a/src/main/java/xyz/playedu/api/middleware/Lock.java
+++ b/src/main/java/xyz/playedu/api/middleware/Lock.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/middleware/impl/BackendPermissionMiddlewareImpl.java b/src/main/java/xyz/playedu/api/middleware/impl/BackendPermissionMiddlewareImpl.java
index 9a8b1e6..1d14025 100644
--- a/src/main/java/xyz/playedu/api/middleware/impl/BackendPermissionMiddlewareImpl.java
+++ b/src/main/java/xyz/playedu/api/middleware/impl/BackendPermissionMiddlewareImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/middleware/impl/ImageCaptchaCheckMiddlewareImpl.java b/src/main/java/xyz/playedu/api/middleware/impl/ImageCaptchaCheckMiddlewareImpl.java
index e20964d..50501ca 100644
--- a/src/main/java/xyz/playedu/api/middleware/impl/ImageCaptchaCheckMiddlewareImpl.java
+++ b/src/main/java/xyz/playedu/api/middleware/impl/ImageCaptchaCheckMiddlewareImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/middleware/impl/LockImpl.java b/src/main/java/xyz/playedu/api/middleware/impl/LockImpl.java
index ba06269..93ae682 100644
--- a/src/main/java/xyz/playedu/api/middleware/impl/LockImpl.java
+++ b/src/main/java/xyz/playedu/api/middleware/impl/LockImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/AdminRoleRequest.java b/src/main/java/xyz/playedu/api/request/backend/AdminRoleRequest.java
index 678b5bb..81282c4 100644
--- a/src/main/java/xyz/playedu/api/request/backend/AdminRoleRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/AdminRoleRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/AdminUserRequest.java b/src/main/java/xyz/playedu/api/request/backend/AdminUserRequest.java
index 3541650..4714813 100644
--- a/src/main/java/xyz/playedu/api/request/backend/AdminUserRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/AdminUserRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/AppConfigRequest.java b/src/main/java/xyz/playedu/api/request/backend/AppConfigRequest.java
index 913da80..7b3c7ab 100644
--- a/src/main/java/xyz/playedu/api/request/backend/AppConfigRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/AppConfigRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/CourseCategoryRequest.java b/src/main/java/xyz/playedu/api/request/backend/CourseCategoryRequest.java
index f852a72..8a8c301 100644
--- a/src/main/java/xyz/playedu/api/request/backend/CourseCategoryRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/CourseCategoryRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/CourseChapterRequest.java b/src/main/java/xyz/playedu/api/request/backend/CourseChapterRequest.java
index 3495ce6..3c44b7a 100644
--- a/src/main/java/xyz/playedu/api/request/backend/CourseChapterRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/CourseChapterRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/CourseChapterSortRequest.java b/src/main/java/xyz/playedu/api/request/backend/CourseChapterSortRequest.java
index 0b163f8..6d14029 100644
--- a/src/main/java/xyz/playedu/api/request/backend/CourseChapterSortRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/CourseChapterSortRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/CourseHourMultiRequest.java b/src/main/java/xyz/playedu/api/request/backend/CourseHourMultiRequest.java
index e97b4b6..7b67cef 100644
--- a/src/main/java/xyz/playedu/api/request/backend/CourseHourMultiRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/CourseHourMultiRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/CourseHourRequest.java b/src/main/java/xyz/playedu/api/request/backend/CourseHourRequest.java
index dbc430d..0175c1f 100644
--- a/src/main/java/xyz/playedu/api/request/backend/CourseHourRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/CourseHourRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/CourseHourSortRequest.java b/src/main/java/xyz/playedu/api/request/backend/CourseHourSortRequest.java
index 9e92833..6a49daf 100644
--- a/src/main/java/xyz/playedu/api/request/backend/CourseHourSortRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/CourseHourSortRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/CourseRequest.java b/src/main/java/xyz/playedu/api/request/backend/CourseRequest.java
index fa61426..16d35c1 100644
--- a/src/main/java/xyz/playedu/api/request/backend/CourseRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/CourseRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/CourseUserDestroyRequest.java b/src/main/java/xyz/playedu/api/request/backend/CourseUserDestroyRequest.java
index 674e2e2..e79df42 100644
--- a/src/main/java/xyz/playedu/api/request/backend/CourseUserDestroyRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/CourseUserDestroyRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/DepartmentParentRequest.java b/src/main/java/xyz/playedu/api/request/backend/DepartmentParentRequest.java
index b0c688c..47c78f8 100644
--- a/src/main/java/xyz/playedu/api/request/backend/DepartmentParentRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/DepartmentParentRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/DepartmentRequest.java b/src/main/java/xyz/playedu/api/request/backend/DepartmentRequest.java
index 764c2c0..9e09fce 100644
--- a/src/main/java/xyz/playedu/api/request/backend/DepartmentRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/DepartmentRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/DepartmentSortRequest.java b/src/main/java/xyz/playedu/api/request/backend/DepartmentSortRequest.java
index d6bbdb5..abf939d 100644
--- a/src/main/java/xyz/playedu/api/request/backend/DepartmentSortRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/DepartmentSortRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/LoginRequest.java b/src/main/java/xyz/playedu/api/request/backend/LoginRequest.java
index 4bd35b1..51745fb 100644
--- a/src/main/java/xyz/playedu/api/request/backend/LoginRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/LoginRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/PasswordChangeRequest.java b/src/main/java/xyz/playedu/api/request/backend/PasswordChangeRequest.java
index cf6b40b..312023e 100644
--- a/src/main/java/xyz/playedu/api/request/backend/PasswordChangeRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/PasswordChangeRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/types/JWTPayload.java b/src/main/java/xyz/playedu/api/request/backend/ResourceCategoryChangeRequest.java
similarity index 50%
rename from src/main/java/xyz/playedu/api/types/JWTPayload.java
rename to src/main/java/xyz/playedu/api/request/backend/ResourceCategoryChangeRequest.java
index 4b8f262..f9a15f9 100644
--- a/src/main/java/xyz/playedu/api/types/JWTPayload.java
+++ b/src/main/java/xyz/playedu/api/request/backend/ResourceCategoryChangeRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,34 +13,22 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package xyz.playedu.api.types;
+package xyz.playedu.api.request.backend;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import jakarta.validation.constraints.NotNull;
import lombok.Data;
-/**
- * @see https://www.rfc-editor.org/rfc/rfc7519#section-4.1
- */
+import java.util.List;
+
@Data
-public class JWTPayload {
+public class ResourceCategoryChangeRequest {
+ @NotNull(message = "参数为空")
+ private List ids;
- /** subject */
- private Integer sub;
-
- /** Issued At */
- private Long iat;
-
- /** Expiration Time */
- private Long exp;
-
- /** Not Before */
- private Long nbf;
-
- /** JWT ID */
- private String jti;
-
- /** Issuer */
- private String iss;
-
- /** Payload */
- private String prv;
+ @NotNull(message = "请选择分类")
+ @JsonProperty("category_id")
+ private Integer categoryId;
}
diff --git a/src/main/java/xyz/playedu/api/request/backend/ResourceCategoryParentRequest.java b/src/main/java/xyz/playedu/api/request/backend/ResourceCategoryParentRequest.java
index 51f8fd4..91aed7f 100644
--- a/src/main/java/xyz/playedu/api/request/backend/ResourceCategoryParentRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/ResourceCategoryParentRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/ResourceCategoryRequest.java b/src/main/java/xyz/playedu/api/request/backend/ResourceCategoryRequest.java
index 3090e10..d609b80 100644
--- a/src/main/java/xyz/playedu/api/request/backend/ResourceCategoryRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/ResourceCategoryRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/ResourceCategorySortRequest.java b/src/main/java/xyz/playedu/api/request/backend/ResourceCategorySortRequest.java
index e8ed348..51542d6 100644
--- a/src/main/java/xyz/playedu/api/request/backend/ResourceCategorySortRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/ResourceCategorySortRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/ResourceDestroyMultiRequest.java b/src/main/java/xyz/playedu/api/request/backend/ResourceDestroyMultiRequest.java
index 6dae78f..d488a30 100644
--- a/src/main/java/xyz/playedu/api/request/backend/ResourceDestroyMultiRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/ResourceDestroyMultiRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,13 +19,7 @@ import lombok.Data;
import java.util.List;
-/**
- * @Author 杭州白书科技有限公司
- *
- * @create 2023/3/13 10:41
- */
@Data
public class ResourceDestroyMultiRequest {
-
private List ids;
}
diff --git a/src/main/java/xyz/playedu/api/request/backend/ResourceRequest.java b/src/main/java/xyz/playedu/api/request/backend/ResourceRequest.java
index 56ba692..178ba2a 100644
--- a/src/main/java/xyz/playedu/api/request/backend/ResourceRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/ResourceRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/ResourceUpdateRequest.java b/src/main/java/xyz/playedu/api/request/backend/ResourceUpdateRequest.java
new file mode 100644
index 0000000..88125e3
--- /dev/null
+++ b/src/main/java/xyz/playedu/api/request/backend/ResourceUpdateRequest.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2023 杭州白书科技有限公司
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package xyz.playedu.api.request.backend;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+
+import lombok.Data;
+
+import org.hibernate.validator.constraints.Length;
+
+@Data
+public class ResourceUpdateRequest {
+
+ @NotBlank(message = "请输入资源名")
+ @Length(min = 1, max = 254, message = "资源名长度在1-254个字符之间")
+ private String name;
+
+ @NotNull(message = "category_id参数不存在")
+ @JsonProperty("category_id")
+ private Integer categoryId;
+}
diff --git a/src/main/java/xyz/playedu/api/request/backend/UploadVideoMergeRequest.java b/src/main/java/xyz/playedu/api/request/backend/UploadVideoMergeRequest.java
index 4530bb7..6ef5279 100644
--- a/src/main/java/xyz/playedu/api/request/backend/UploadVideoMergeRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/UploadVideoMergeRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/UserImportRequest.java b/src/main/java/xyz/playedu/api/request/backend/UserImportRequest.java
index 0ec83f7..34a7d2f 100644
--- a/src/main/java/xyz/playedu/api/request/backend/UserImportRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/UserImportRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/UserRequest.java b/src/main/java/xyz/playedu/api/request/backend/UserRequest.java
index 157ac72..2ecac01 100644
--- a/src/main/java/xyz/playedu/api/request/backend/UserRequest.java
+++ b/src/main/java/xyz/playedu/api/request/backend/UserRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/backend/types/ImageCaptchaRequestInterface.java b/src/main/java/xyz/playedu/api/request/backend/types/ImageCaptchaRequestInterface.java
index 3444f39..e84f959 100644
--- a/src/main/java/xyz/playedu/api/request/backend/types/ImageCaptchaRequestInterface.java
+++ b/src/main/java/xyz/playedu/api/request/backend/types/ImageCaptchaRequestInterface.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/frontend/ChangePasswordRequest.java b/src/main/java/xyz/playedu/api/request/frontend/ChangePasswordRequest.java
index 8a29fbf..cca0072 100644
--- a/src/main/java/xyz/playedu/api/request/frontend/ChangePasswordRequest.java
+++ b/src/main/java/xyz/playedu/api/request/frontend/ChangePasswordRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/frontend/CourseHourRecordRequest.java b/src/main/java/xyz/playedu/api/request/frontend/CourseHourRecordRequest.java
index 68da268..3ace8d9 100644
--- a/src/main/java/xyz/playedu/api/request/frontend/CourseHourRecordRequest.java
+++ b/src/main/java/xyz/playedu/api/request/frontend/CourseHourRecordRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/request/frontend/LoginPasswordRequest.java b/src/main/java/xyz/playedu/api/request/frontend/LoginPasswordRequest.java
index 42d9ce3..3d69777 100644
--- a/src/main/java/xyz/playedu/api/request/frontend/LoginPasswordRequest.java
+++ b/src/main/java/xyz/playedu/api/request/frontend/LoginPasswordRequest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/AdminLogService.java b/src/main/java/xyz/playedu/api/service/AdminLogService.java
index ad4aeb4..c255ed6 100644
--- a/src/main/java/xyz/playedu/api/service/AdminLogService.java
+++ b/src/main/java/xyz/playedu/api/service/AdminLogService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/AdminPermissionService.java b/src/main/java/xyz/playedu/api/service/AdminPermissionService.java
index 1ade4d3..75a57fb 100644
--- a/src/main/java/xyz/playedu/api/service/AdminPermissionService.java
+++ b/src/main/java/xyz/playedu/api/service/AdminPermissionService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/AdminRoleService.java b/src/main/java/xyz/playedu/api/service/AdminRoleService.java
index 9eb6bd9..4d168c0 100644
--- a/src/main/java/xyz/playedu/api/service/AdminRoleService.java
+++ b/src/main/java/xyz/playedu/api/service/AdminRoleService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/AdminUserService.java b/src/main/java/xyz/playedu/api/service/AdminUserService.java
index 2a8bca0..599220d 100644
--- a/src/main/java/xyz/playedu/api/service/AdminUserService.java
+++ b/src/main/java/xyz/playedu/api/service/AdminUserService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/AppConfigService.java b/src/main/java/xyz/playedu/api/service/AppConfigService.java
index 3cb7ce1..a2d7ec7 100644
--- a/src/main/java/xyz/playedu/api/service/AppConfigService.java
+++ b/src/main/java/xyz/playedu/api/service/AppConfigService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/AuthService.java b/src/main/java/xyz/playedu/api/service/AuthService.java
new file mode 100644
index 0000000..c3d13c1
--- /dev/null
+++ b/src/main/java/xyz/playedu/api/service/AuthService.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2023 杭州白书科技有限公司
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package xyz.playedu.api.service;
+
+import java.util.HashMap;
+
+public interface AuthService {
+ String loginUsingId(Integer userId, String loginUrl, String prv);
+
+ boolean check(String prv);
+
+ Integer userId();
+
+ void logout();
+
+ String jti();
+
+ Long expired();
+
+ HashMap parse(String token);
+}
diff --git a/src/main/java/xyz/playedu/api/service/BackendAuthService.java b/src/main/java/xyz/playedu/api/service/BackendAuthService.java
new file mode 100644
index 0000000..0c6e688
--- /dev/null
+++ b/src/main/java/xyz/playedu/api/service/BackendAuthService.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2023 杭州白书科技有限公司
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package xyz.playedu.api.service;
+
+import java.util.HashMap;
+
+public interface BackendAuthService {
+ String loginUsingId(Integer userId, String loginUrl);
+
+ boolean check();
+
+ Integer userId();
+
+ void logout();
+
+ String jti();
+
+ HashMap parse(String token);
+}
diff --git a/src/main/java/xyz/playedu/api/service/CourseChapterService.java b/src/main/java/xyz/playedu/api/service/CourseChapterService.java
index 6c506cc..022cc5d 100644
--- a/src/main/java/xyz/playedu/api/service/CourseChapterService.java
+++ b/src/main/java/xyz/playedu/api/service/CourseChapterService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/CourseDepartmentService.java b/src/main/java/xyz/playedu/api/service/CourseDepartmentService.java
index 8fc60b4..66f513f 100644
--- a/src/main/java/xyz/playedu/api/service/CourseDepartmentService.java
+++ b/src/main/java/xyz/playedu/api/service/CourseDepartmentService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/CourseHourService.java b/src/main/java/xyz/playedu/api/service/CourseHourService.java
index 16c1887..4e0c402 100644
--- a/src/main/java/xyz/playedu/api/service/CourseHourService.java
+++ b/src/main/java/xyz/playedu/api/service/CourseHourService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/CourseService.java b/src/main/java/xyz/playedu/api/service/CourseService.java
index d82a7a3..bdb721c 100644
--- a/src/main/java/xyz/playedu/api/service/CourseService.java
+++ b/src/main/java/xyz/playedu/api/service/CourseService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/DepartmentService.java b/src/main/java/xyz/playedu/api/service/DepartmentService.java
index d6ce589..963d492 100644
--- a/src/main/java/xyz/playedu/api/service/DepartmentService.java
+++ b/src/main/java/xyz/playedu/api/service/DepartmentService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/FrontendAuthService.java b/src/main/java/xyz/playedu/api/service/FrontendAuthService.java
new file mode 100644
index 0000000..9a6111e
--- /dev/null
+++ b/src/main/java/xyz/playedu/api/service/FrontendAuthService.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2023 杭州白书科技有限公司
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package xyz.playedu.api.service;
+
+import java.util.HashMap;
+
+public interface FrontendAuthService {
+ String loginUsingId(Integer userId, String loginUrl);
+
+ boolean check();
+
+ Integer userId();
+
+ void logout();
+
+ String jti();
+
+ HashMap parse(String token);
+}
diff --git a/src/main/java/xyz/playedu/api/service/ImageCaptchaService.java b/src/main/java/xyz/playedu/api/service/ImageCaptchaService.java
index f4e8ca3..b1b2dd5 100644
--- a/src/main/java/xyz/playedu/api/service/ImageCaptchaService.java
+++ b/src/main/java/xyz/playedu/api/service/ImageCaptchaService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/JWTService.java b/src/main/java/xyz/playedu/api/service/JWTService.java
deleted file mode 100644
index 5290732..0000000
--- a/src/main/java/xyz/playedu/api/service/JWTService.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2023 杭州白书科技有限公司
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package xyz.playedu.api.service;
-
-import xyz.playedu.api.exception.JwtLogoutException;
-import xyz.playedu.api.types.JWTPayload;
-import xyz.playedu.api.types.JwtToken;
-
-public interface JWTService {
- JwtToken generate(Integer userId, String iss, String prv);
-
- boolean isInBlack(String jti);
-
- void logout(String token, String prv) throws JwtLogoutException;
-
- void userLogout(String token) throws JwtLogoutException;
-
- void adminUserLogout(String token) throws JwtLogoutException;
-
- JWTPayload parse(String token, String prv) throws JwtLogoutException;
-}
diff --git a/src/main/java/xyz/playedu/api/service/MinioService.java b/src/main/java/xyz/playedu/api/service/MinioService.java
index 251a362..8bd0eb7 100644
--- a/src/main/java/xyz/playedu/api/service/MinioService.java
+++ b/src/main/java/xyz/playedu/api/service/MinioService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/ResourceCategoryService.java b/src/main/java/xyz/playedu/api/service/ResourceCategoryService.java
index 2ec4687..69f7c91 100644
--- a/src/main/java/xyz/playedu/api/service/ResourceCategoryService.java
+++ b/src/main/java/xyz/playedu/api/service/ResourceCategoryService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/ResourceService.java b/src/main/java/xyz/playedu/api/service/ResourceService.java
index 6aa5905..a4f42b3 100644
--- a/src/main/java/xyz/playedu/api/service/ResourceService.java
+++ b/src/main/java/xyz/playedu/api/service/ResourceService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,11 +24,6 @@ import xyz.playedu.api.types.paginate.ResourcePaginateFilter;
import java.util.List;
-/**
- * @author tengteng
- * @description 针对表【resources】的数据库操作Service
- * @createDate 2023-02-23 10:50:26
- */
public interface ResourceService extends IService {
PaginationResult paginate(int page, int size, ResourcePaginateFilter filter);
@@ -58,4 +53,8 @@ public interface ResourceService extends IService {
Integer total(String type);
Integer duration(Integer id);
+
+ void updateNameAndCategoryId(Integer id, String name, Integer categoryId);
+
+ List categoryIds(Integer resourceId);
}
diff --git a/src/main/java/xyz/playedu/api/service/ResourceVideoService.java b/src/main/java/xyz/playedu/api/service/ResourceVideoService.java
index 92df52c..aaccced 100644
--- a/src/main/java/xyz/playedu/api/service/ResourceVideoService.java
+++ b/src/main/java/xyz/playedu/api/service/ResourceVideoService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/UploadService.java b/src/main/java/xyz/playedu/api/service/UploadService.java
index 1b2898e..717e154 100644
--- a/src/main/java/xyz/playedu/api/service/UploadService.java
+++ b/src/main/java/xyz/playedu/api/service/UploadService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/UserCourseHourRecordService.java b/src/main/java/xyz/playedu/api/service/UserCourseHourRecordService.java
index 23998de..621f3c1 100644
--- a/src/main/java/xyz/playedu/api/service/UserCourseHourRecordService.java
+++ b/src/main/java/xyz/playedu/api/service/UserCourseHourRecordService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/UserCourseRecordService.java b/src/main/java/xyz/playedu/api/service/UserCourseRecordService.java
index 0f40a7f..828e721 100644
--- a/src/main/java/xyz/playedu/api/service/UserCourseRecordService.java
+++ b/src/main/java/xyz/playedu/api/service/UserCourseRecordService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/UserLearnDurationRecordService.java b/src/main/java/xyz/playedu/api/service/UserLearnDurationRecordService.java
index 79ce7bf..9df4e28 100644
--- a/src/main/java/xyz/playedu/api/service/UserLearnDurationRecordService.java
+++ b/src/main/java/xyz/playedu/api/service/UserLearnDurationRecordService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/UserLearnDurationStatsService.java b/src/main/java/xyz/playedu/api/service/UserLearnDurationStatsService.java
index 1f7fd85..75319d9 100644
--- a/src/main/java/xyz/playedu/api/service/UserLearnDurationStatsService.java
+++ b/src/main/java/xyz/playedu/api/service/UserLearnDurationStatsService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/UserLoginRecordService.java b/src/main/java/xyz/playedu/api/service/UserLoginRecordService.java
index 0b94bfd..d3acfb4 100644
--- a/src/main/java/xyz/playedu/api/service/UserLoginRecordService.java
+++ b/src/main/java/xyz/playedu/api/service/UserLoginRecordService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,11 +19,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
import xyz.playedu.api.domain.UserLoginRecord;
-/**
- * @author tengteng
- * @description 针对表【user_login_records】的数据库操作Service
- * @createDate 2023-03-10 13:40:33
- */
public interface UserLoginRecordService extends IService {
UserLoginRecord store(
Integer userId,
diff --git a/src/main/java/xyz/playedu/api/service/UserService.java b/src/main/java/xyz/playedu/api/service/UserService.java
index fe5bb82..25d984d 100644
--- a/src/main/java/xyz/playedu/api/service/UserService.java
+++ b/src/main/java/xyz/playedu/api/service/UserService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/UserUploadImageLogService.java b/src/main/java/xyz/playedu/api/service/UserUploadImageLogService.java
index 814cc05..c96fc35 100644
--- a/src/main/java/xyz/playedu/api/service/UserUploadImageLogService.java
+++ b/src/main/java/xyz/playedu/api/service/UserUploadImageLogService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/AdminLogServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/AdminLogServiceImpl.java
index 3c9e82a..3c5b909 100644
--- a/src/main/java/xyz/playedu/api/service/impl/AdminLogServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/AdminLogServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/AdminPermissionServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/AdminPermissionServiceImpl.java
index c58cc50..b4dbfda 100644
--- a/src/main/java/xyz/playedu/api/service/impl/AdminPermissionServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/AdminPermissionServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/AdminRoleServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/AdminRoleServiceImpl.java
index 2c45cbc..85210f0 100644
--- a/src/main/java/xyz/playedu/api/service/impl/AdminRoleServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/AdminRoleServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/AdminUserServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/AdminUserServiceImpl.java
index 5173406..97d139c 100644
--- a/src/main/java/xyz/playedu/api/service/impl/AdminUserServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/AdminUserServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/AppConfigServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/AppConfigServiceImpl.java
index aa0320f..782c56d 100644
--- a/src/main/java/xyz/playedu/api/service/impl/AppConfigServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/AppConfigServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/AuthServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/AuthServiceImpl.java
new file mode 100644
index 0000000..3e45371
--- /dev/null
+++ b/src/main/java/xyz/playedu/api/service/impl/AuthServiceImpl.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2023 杭州白书科技有限公司
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package xyz.playedu.api.service.impl;
+
+import cn.dev33.satoken.stp.SaLoginConfig;
+import cn.dev33.satoken.stp.StpUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import xyz.playedu.api.config.AuthConfig;
+import xyz.playedu.api.service.AuthService;
+
+import java.util.HashMap;
+
+@Service
+@Slf4j
+public class AuthServiceImpl implements AuthService {
+
+ @Autowired private AuthConfig authConfig;
+
+ @Override
+ public String loginUsingId(Integer userId, String loginUrl, String prv) {
+ StpUtil.login(
+ userId,
+ SaLoginConfig.setExtra("url", loginUrl)
+ .setExtra("prv", prv)
+ .setExtra(
+ "exp",
+ String.valueOf(
+ System.currentTimeMillis()
+ + authConfig.getExpired() * 1000L)));
+ return StpUtil.getTokenValue();
+ }
+
+ @Override
+ public boolean check(String prv) {
+ if (!StpUtil.isLogin()) {
+ return false;
+ }
+ String tokenPrv = (String) StpUtil.getExtra("prv");
+ return prv.equals(tokenPrv);
+ }
+
+ @Override
+ public Integer userId() {
+ return StpUtil.getLoginIdAsInt();
+ }
+
+ @Override
+ public void logout() {
+ StpUtil.logout();
+ }
+
+ @Override
+ public String jti() {
+ return (String) StpUtil.getExtra("rnStr");
+ }
+
+ @Override
+ public Long expired() {
+ return (Long) StpUtil.getExtra("exp");
+ }
+
+ @Override
+ public HashMap parse(String token) {
+ HashMap data = new HashMap<>();
+ data.put("jti", (String) StpUtil.getExtra(token, "rnStr"));
+ data.put("exp", (String) StpUtil.getExtra(token, "exp"));
+ return data;
+ }
+}
diff --git a/src/main/java/xyz/playedu/api/service/impl/BackendAuthServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/BackendAuthServiceImpl.java
new file mode 100644
index 0000000..f18400f
--- /dev/null
+++ b/src/main/java/xyz/playedu/api/service/impl/BackendAuthServiceImpl.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2023 杭州白书科技有限公司
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package xyz.playedu.api.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import xyz.playedu.api.constant.SystemConstant;
+import xyz.playedu.api.service.AuthService;
+import xyz.playedu.api.service.BackendAuthService;
+
+import java.util.HashMap;
+
+@Service
+public class BackendAuthServiceImpl implements BackendAuthService {
+ @Autowired private AuthService authService;
+
+ @Override
+ public String loginUsingId(Integer userId, String loginUrl) {
+ return authService.loginUsingId(userId, loginUrl, SystemConstant.JWT_PRV_ADMIN_USER);
+ }
+
+ @Override
+ public boolean check() {
+ return authService.check(SystemConstant.JWT_PRV_ADMIN_USER);
+ }
+
+ @Override
+ public Integer userId() {
+ return authService.userId();
+ }
+
+ @Override
+ public void logout() {
+ authService.logout();
+ }
+
+ @Override
+ public String jti() {
+ return authService.jti();
+ }
+
+ @Override
+ public HashMap parse(String token) {
+ return authService.parse(token);
+ }
+}
diff --git a/src/main/java/xyz/playedu/api/service/impl/CourseChapterServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/CourseChapterServiceImpl.java
index fa07fe2..3532954 100644
--- a/src/main/java/xyz/playedu/api/service/impl/CourseChapterServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/CourseChapterServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/CourseDepartmentServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/CourseDepartmentServiceImpl.java
index cb07a9e..91aa947 100644
--- a/src/main/java/xyz/playedu/api/service/impl/CourseDepartmentServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/CourseDepartmentServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/CourseHourServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/CourseHourServiceImpl.java
index 47b05fa..976e114 100644
--- a/src/main/java/xyz/playedu/api/service/impl/CourseHourServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/CourseHourServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/CourseServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/CourseServiceImpl.java
index 23b2513..3e86693 100644
--- a/src/main/java/xyz/playedu/api/service/impl/CourseServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/CourseServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/DepartmentServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/DepartmentServiceImpl.java
index 8b62a39..e05a6c5 100644
--- a/src/main/java/xyz/playedu/api/service/impl/DepartmentServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/DepartmentServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/FrontendAuthServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/FrontendAuthServiceImpl.java
new file mode 100644
index 0000000..efb11b7
--- /dev/null
+++ b/src/main/java/xyz/playedu/api/service/impl/FrontendAuthServiceImpl.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2023 杭州白书科技有限公司
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package xyz.playedu.api.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import xyz.playedu.api.constant.SystemConstant;
+import xyz.playedu.api.service.AuthService;
+import xyz.playedu.api.service.FrontendAuthService;
+
+import java.util.HashMap;
+
+@Service
+public class FrontendAuthServiceImpl implements FrontendAuthService {
+
+ @Autowired private AuthService authService;
+
+ @Override
+ public String loginUsingId(Integer userId, String loginUrl) {
+ return authService.loginUsingId(userId, loginUrl, SystemConstant.JWT_PRV_USER);
+ }
+
+ @Override
+ public boolean check() {
+ return authService.check(SystemConstant.JWT_PRV_USER);
+ }
+
+ @Override
+ public Integer userId() {
+ return authService.userId();
+ }
+
+ @Override
+ public void logout() {
+ authService.logout();
+ }
+
+ @Override
+ public String jti() {
+ return authService.jti();
+ }
+
+ @Override
+ public HashMap parse(String token) {
+ return authService.parse(token);
+ }
+}
diff --git a/src/main/java/xyz/playedu/api/service/impl/ImageCaptchaServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/ImageCaptchaServiceImpl.java
index a912782..9b7be22 100644
--- a/src/main/java/xyz/playedu/api/service/impl/ImageCaptchaServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/ImageCaptchaServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/JwtServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/JwtServiceImpl.java
deleted file mode 100644
index 2a6cf09..0000000
--- a/src/main/java/xyz/playedu/api/service/impl/JwtServiceImpl.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright 2023 杭州白书科技有限公司
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package xyz.playedu.api.service.impl;
-
-import io.jsonwebtoken.Claims;
-import io.jsonwebtoken.JwtBuilder;
-import io.jsonwebtoken.Jwts;
-import io.jsonwebtoken.security.Keys;
-
-import lombok.extern.slf4j.Slf4j;
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-
-import xyz.playedu.api.constant.SystemConstant;
-import xyz.playedu.api.exception.JwtLogoutException;
-import xyz.playedu.api.service.JWTService;
-import xyz.playedu.api.types.JWTPayload;
-import xyz.playedu.api.types.JwtToken;
-import xyz.playedu.api.util.HelperUtil;
-import xyz.playedu.api.util.RedisUtil;
-
-import java.nio.charset.StandardCharsets;
-import java.util.Date;
-
-import javax.crypto.SecretKey;
-
-@Slf4j
-@Service
-public class JwtServiceImpl implements JWTService {
-
- @Value("${playedu.jwt.key}")
- private String ConfigKey;
-
- @Value("${playedu.jwt.expire}")
- private Long ConfigExpire;
-
- @Value("${playedu.jwt.cache-black-prefix}")
- private String ConfigCacheBlackPrefix;
-
- public JwtToken generate(Integer userId, String iss, String prv) {
- long curTime = System.currentTimeMillis();
-
- JWTPayload payload = new JWTPayload();
- payload.setPrv(prv);
- payload.setIss(iss);
- payload.setJti(HelperUtil.uuid());
- payload.setNbf(curTime);
- payload.setIat(curTime);
- payload.setExp(curTime + ConfigExpire * 1000);
- payload.setSub(userId);
-
- JwtBuilder builder = Jwts.builder();
- builder.setId(payload.getJti())
- .setIssuedAt(new Date(payload.getIat()))
- .claim("prv", payload.getPrv());
- builder.setExpiration(new Date(payload.getExp())).setIssuer(payload.getIss());
- builder.setSubject(String.valueOf(payload.getSub()))
- .setNotBefore(new Date(payload.getNbf()));
- builder.signWith(getSecretKey());
-
- JwtToken token = new JwtToken();
- token.setToken(builder.compact());
- token.setExpire(payload.getExp() / 1000);
-
- return token;
- }
-
- public JWTPayload parse(String token, String prv) throws JwtLogoutException {
- Claims claims = parseToken(token, prv);
- JWTPayload payload = new JWTPayload();
-
- payload.setSub(Integer.valueOf(claims.getSubject()));
- payload.setIss(claims.getIssuer());
- payload.setPrv((String) claims.get("prv"));
- payload.setNbf(claims.getNotBefore().getTime());
- payload.setExp(claims.getExpiration().getTime());
- payload.setIat(claims.getIssuedAt().getTime());
- payload.setJti(claims.getId());
-
- return payload;
- }
-
- public boolean isInBlack(String jti) {
- return RedisUtil.exists(getBlackCacheKey(jti));
- }
-
- public void logout(String token, String prv) throws JwtLogoutException {
- Claims claims = parseToken(token, prv);
- String cacheKey = getBlackCacheKey(claims.getId());
- Long expire = (claims.getExpiration().getTime() - System.currentTimeMillis()) / 1000;
- RedisUtil.set(cacheKey, 1, expire);
- }
-
- @Override
- public void userLogout(String token) throws JwtLogoutException {
- logout(token, SystemConstant.JWT_PRV_USER);
- }
-
- @Override
- public void adminUserLogout(String token) throws JwtLogoutException {
- logout(token, SystemConstant.JWT_PRV_ADMIN_USER);
- }
-
- private Claims parseToken(String token, String prv) throws JwtLogoutException {
- Claims claims =
- (Claims)
- Jwts.parserBuilder()
- .setSigningKey(getSecretKey())
- .require("prv", prv)
- .build()
- .parse(token)
- .getBody();
- if (isInBlack(claims.getId())) {
- throw new JwtLogoutException();
- }
- return claims;
- }
-
- private SecretKey getSecretKey() {
- return Keys.hmacShaKeyFor(ConfigKey.getBytes(StandardCharsets.UTF_8));
- }
-
- private String getBlackCacheKey(String jti) {
- return ConfigCacheBlackPrefix + jti;
- }
-}
diff --git a/src/main/java/xyz/playedu/api/service/impl/MinioServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/MinioServiceImpl.java
index 3f34e67..7cc9c36 100644
--- a/src/main/java/xyz/playedu/api/service/impl/MinioServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/MinioServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/ResourceCategoryServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/ResourceCategoryServiceImpl.java
index bdc65ba..e03ae17 100644
--- a/src/main/java/xyz/playedu/api/service/impl/ResourceCategoryServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/ResourceCategoryServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/ResourceServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/ResourceServiceImpl.java
index 5991baa..b55d85b 100644
--- a/src/main/java/xyz/playedu/api/service/impl/ResourceServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/ResourceServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -89,13 +89,15 @@ public class ResourceServiceImpl extends ServiceImpl
if (categoryIds != null && categoryIds.trim().length() > 0) {
String[] idArray = categoryIds.split(",");
List relations = new ArrayList<>();
- for (int i = 0; i < idArray.length; i++) {
- String tmpId = idArray[i];
-
+ for (String s : idArray) {
+ int tmpId = Integer.parseInt(s);
+ if (tmpId == 0) {
+ continue;
+ }
relations.add(
new ResourceCategoryRelation() {
{
- setCid(Integer.valueOf(tmpId));
+ setCid(tmpId);
setRid(resource.getId());
}
});
@@ -153,4 +155,30 @@ public class ResourceServiceImpl extends ServiceImpl
}
return resourceVideo.getDuration();
}
+
+ @Override
+ @Transactional
+ public void updateNameAndCategoryId(Integer id, String name, Integer categoryId) {
+ Resource resource = new Resource();
+ resource.setId(id);
+ resource.setName(name);
+ updateById(resource);
+
+ relationService.rebuild(
+ id,
+ new ArrayList<>() {
+ {
+ add(categoryId);
+ }
+ });
+ }
+
+ @Override
+ public List categoryIds(Integer resourceId) {
+ return relationService
+ .list(relationService.query().getWrapper().eq("rid", resourceId))
+ .stream()
+ .map(ResourceCategoryRelation::getCid)
+ .toList();
+ }
}
diff --git a/src/main/java/xyz/playedu/api/service/impl/ResourceVideoServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/ResourceVideoServiceImpl.java
index 3d36a6d..82ea306 100644
--- a/src/main/java/xyz/playedu/api/service/impl/ResourceVideoServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/ResourceVideoServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/UploadServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/UploadServiceImpl.java
index 82926b2..f9fde7f 100644
--- a/src/main/java/xyz/playedu/api/service/impl/UploadServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/UploadServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/UserCourseHourRecordServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/UserCourseHourRecordServiceImpl.java
index 5965c46..0e7eb5b 100644
--- a/src/main/java/xyz/playedu/api/service/impl/UserCourseHourRecordServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/UserCourseHourRecordServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/UserCourseRecordServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/UserCourseRecordServiceImpl.java
index 53d8007..5448b73 100644
--- a/src/main/java/xyz/playedu/api/service/impl/UserCourseRecordServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/UserCourseRecordServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/UserLearnDurationRecordServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/UserLearnDurationRecordServiceImpl.java
index db83676..599d483 100644
--- a/src/main/java/xyz/playedu/api/service/impl/UserLearnDurationRecordServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/UserLearnDurationRecordServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/UserLearnDurationStatsServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/UserLearnDurationStatsServiceImpl.java
index ebfc19e..f436987 100644
--- a/src/main/java/xyz/playedu/api/service/impl/UserLearnDurationStatsServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/UserLearnDurationStatsServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/UserLoginRecordServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/UserLoginRecordServiceImpl.java
index 60b714d..e392d2d 100644
--- a/src/main/java/xyz/playedu/api/service/impl/UserLoginRecordServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/UserLoginRecordServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/UserServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/UserServiceImpl.java
index 07b8e92..665db06 100644
--- a/src/main/java/xyz/playedu/api/service/impl/UserServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/UserServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/UserUploadImageLogServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/UserUploadImageLogServiceImpl.java
index 17abd51..6b77237 100644
--- a/src/main/java/xyz/playedu/api/service/impl/UserUploadImageLogServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/UserUploadImageLogServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/internal/AdminRolePermissionServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/internal/AdminRolePermissionServiceImpl.java
index 92f0bbc..f5ca819 100644
--- a/src/main/java/xyz/playedu/api/service/impl/internal/AdminRolePermissionServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/internal/AdminRolePermissionServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/internal/AdminUserRoleServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/internal/AdminUserRoleServiceImpl.java
index 99b01ab..a10c52d 100644
--- a/src/main/java/xyz/playedu/api/service/impl/internal/AdminUserRoleServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/internal/AdminUserRoleServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/internal/ResourceCategoryRelationServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/internal/ResourceCategoryRelationServiceImpl.java
index 819d187..450c064 100644
--- a/src/main/java/xyz/playedu/api/service/impl/internal/ResourceCategoryRelationServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/internal/ResourceCategoryRelationServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,24 +23,29 @@ import xyz.playedu.api.domain.ResourceCategoryRelation;
import xyz.playedu.api.mapper.ResourceCategoryRelationMapper;
import xyz.playedu.api.service.internal.ResourceCategoryRelationService;
+import java.util.ArrayList;
import java.util.List;
-/**
- * @author tengteng
- * @description 针对表【resource_category】的数据库操作Service实现
- * @createDate 2023-03-08 16:54:56
- */
@Service
public class ResourceCategoryRelationServiceImpl
extends ServiceImpl
implements ResourceCategoryRelationService {
@Override
- public List getRidsByCids(List categoryIds) {
- List relations =
- list(query().getWrapper().in("cid", categoryIds));
- if (relations == null) {
- return null;
- }
- return relations.stream().map(ResourceCategoryRelation::getRid).toList();
+ public void rebuild(Integer resourceId, List categoryIds) {
+ remove(query().getWrapper().eq("rid", resourceId));
+
+ List data = new ArrayList<>();
+ categoryIds.forEach(
+ categoryId -> {
+ data.add(
+ new ResourceCategoryRelation() {
+ {
+ setCid(categoryId);
+ setRid(resourceId);
+ }
+ });
+ });
+
+ saveBatch(data);
}
}
diff --git a/src/main/java/xyz/playedu/api/service/impl/internal/ResourceCourseCategoryServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/internal/ResourceCourseCategoryServiceImpl.java
index 6321b91..b3f05c5 100644
--- a/src/main/java/xyz/playedu/api/service/impl/internal/ResourceCourseCategoryServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/internal/ResourceCourseCategoryServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/impl/internal/UserDepartmentServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/internal/UserDepartmentServiceImpl.java
index 6a619d3..a4de834 100644
--- a/src/main/java/xyz/playedu/api/service/impl/internal/UserDepartmentServiceImpl.java
+++ b/src/main/java/xyz/playedu/api/service/impl/internal/UserDepartmentServiceImpl.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/internal/AdminRolePermissionService.java b/src/main/java/xyz/playedu/api/service/internal/AdminRolePermissionService.java
index 66f05b6..9144406 100644
--- a/src/main/java/xyz/playedu/api/service/internal/AdminRolePermissionService.java
+++ b/src/main/java/xyz/playedu/api/service/internal/AdminRolePermissionService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/internal/AdminUserRoleService.java b/src/main/java/xyz/playedu/api/service/internal/AdminUserRoleService.java
index db55eca..a13a3bd 100644
--- a/src/main/java/xyz/playedu/api/service/internal/AdminUserRoleService.java
+++ b/src/main/java/xyz/playedu/api/service/internal/AdminUserRoleService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/internal/ResourceCategoryRelationService.java b/src/main/java/xyz/playedu/api/service/internal/ResourceCategoryRelationService.java
index 1403436..d29395c 100644
--- a/src/main/java/xyz/playedu/api/service/internal/ResourceCategoryRelationService.java
+++ b/src/main/java/xyz/playedu/api/service/internal/ResourceCategoryRelationService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -21,12 +21,6 @@ import xyz.playedu.api.domain.ResourceCategoryRelation;
import java.util.List;
-/**
- * @author tengteng
- * @description 针对表【resource_category】的数据库操作Service
- * @createDate 2023-03-08 16:54:56
- */
public interface ResourceCategoryRelationService extends IService {
-
- List getRidsByCids(List categoryIds);
+ void rebuild(Integer resourceId, List categoryIds);
}
diff --git a/src/main/java/xyz/playedu/api/service/internal/ResourceCourseCategoryService.java b/src/main/java/xyz/playedu/api/service/internal/ResourceCourseCategoryService.java
index b550307..c01e895 100644
--- a/src/main/java/xyz/playedu/api/service/internal/ResourceCourseCategoryService.java
+++ b/src/main/java/xyz/playedu/api/service/internal/ResourceCourseCategoryService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/service/internal/UserDepartmentService.java b/src/main/java/xyz/playedu/api/service/internal/UserDepartmentService.java
index 3d3161e..382560d 100644
--- a/src/main/java/xyz/playedu/api/service/internal/UserDepartmentService.java
+++ b/src/main/java/xyz/playedu/api/service/internal/UserDepartmentService.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/types/ImageCaptchaResult.java b/src/main/java/xyz/playedu/api/types/ImageCaptchaResult.java
index e2de692..ee069fd 100644
--- a/src/main/java/xyz/playedu/api/types/ImageCaptchaResult.java
+++ b/src/main/java/xyz/playedu/api/types/ImageCaptchaResult.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/types/JsonResponse.java b/src/main/java/xyz/playedu/api/types/JsonResponse.java
index d21e86a..e052e1d 100644
--- a/src/main/java/xyz/playedu/api/types/JsonResponse.java
+++ b/src/main/java/xyz/playedu/api/types/JsonResponse.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/types/SelectOption.java b/src/main/java/xyz/playedu/api/types/SelectOption.java
index bdbafd2..54e517f 100644
--- a/src/main/java/xyz/playedu/api/types/SelectOption.java
+++ b/src/main/java/xyz/playedu/api/types/SelectOption.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/types/UploadFileInfo.java b/src/main/java/xyz/playedu/api/types/UploadFileInfo.java
index 258aaf1..e187a12 100644
--- a/src/main/java/xyz/playedu/api/types/UploadFileInfo.java
+++ b/src/main/java/xyz/playedu/api/types/UploadFileInfo.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/types/config/MinioConfig.java b/src/main/java/xyz/playedu/api/types/config/MinioConfig.java
index dcfa4fd..e7481df 100644
--- a/src/main/java/xyz/playedu/api/types/config/MinioConfig.java
+++ b/src/main/java/xyz/playedu/api/types/config/MinioConfig.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/types/mapper/CourseCategoryCountMapper.java b/src/main/java/xyz/playedu/api/types/mapper/CourseCategoryCountMapper.java
index b96685e..47de9d5 100644
--- a/src/main/java/xyz/playedu/api/types/mapper/CourseCategoryCountMapper.java
+++ b/src/main/java/xyz/playedu/api/types/mapper/CourseCategoryCountMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/types/mapper/DepartmentsUserCountMapRes.java b/src/main/java/xyz/playedu/api/types/mapper/DepartmentsUserCountMapRes.java
index c9c561f..85d59be 100644
--- a/src/main/java/xyz/playedu/api/types/mapper/DepartmentsUserCountMapRes.java
+++ b/src/main/java/xyz/playedu/api/types/mapper/DepartmentsUserCountMapRes.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/types/mapper/ResourceCategoryCountMapper.java b/src/main/java/xyz/playedu/api/types/mapper/ResourceCategoryCountMapper.java
index 8c46c0a..7de26cc 100644
--- a/src/main/java/xyz/playedu/api/types/mapper/ResourceCategoryCountMapper.java
+++ b/src/main/java/xyz/playedu/api/types/mapper/ResourceCategoryCountMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/types/mapper/UserCourseHourRecordCourseCountMapper.java b/src/main/java/xyz/playedu/api/types/mapper/UserCourseHourRecordCourseCountMapper.java
index 0130f2d..1edb9f1 100644
--- a/src/main/java/xyz/playedu/api/types/mapper/UserCourseHourRecordCourseCountMapper.java
+++ b/src/main/java/xyz/playedu/api/types/mapper/UserCourseHourRecordCourseCountMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/types/mapper/UserCourseHourRecordUserCountMapper.java b/src/main/java/xyz/playedu/api/types/mapper/UserCourseHourRecordUserCountMapper.java
index a218219..84e8a93 100644
--- a/src/main/java/xyz/playedu/api/types/mapper/UserCourseHourRecordUserCountMapper.java
+++ b/src/main/java/xyz/playedu/api/types/mapper/UserCourseHourRecordUserCountMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/types/mapper/UserCourseHourRecordUserFirstCreatedAtMapper.java b/src/main/java/xyz/playedu/api/types/mapper/UserCourseHourRecordUserFirstCreatedAtMapper.java
index ef7c4cc..d348254 100644
--- a/src/main/java/xyz/playedu/api/types/mapper/UserCourseHourRecordUserFirstCreatedAtMapper.java
+++ b/src/main/java/xyz/playedu/api/types/mapper/UserCourseHourRecordUserFirstCreatedAtMapper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/types/paginate/AdminUserPaginateFilter.java b/src/main/java/xyz/playedu/api/types/paginate/AdminUserPaginateFilter.java
index 055ae82..da6e41a 100644
--- a/src/main/java/xyz/playedu/api/types/paginate/AdminUserPaginateFilter.java
+++ b/src/main/java/xyz/playedu/api/types/paginate/AdminUserPaginateFilter.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/types/paginate/CoursePaginateFiler.java b/src/main/java/xyz/playedu/api/types/paginate/CoursePaginateFiler.java
index 9cf7a4a..8166744 100644
--- a/src/main/java/xyz/playedu/api/types/paginate/CoursePaginateFiler.java
+++ b/src/main/java/xyz/playedu/api/types/paginate/CoursePaginateFiler.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/types/paginate/PaginationResult.java b/src/main/java/xyz/playedu/api/types/paginate/PaginationResult.java
index 47a9c32..f8247de 100644
--- a/src/main/java/xyz/playedu/api/types/paginate/PaginationResult.java
+++ b/src/main/java/xyz/playedu/api/types/paginate/PaginationResult.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/types/paginate/ResourcePaginateFilter.java b/src/main/java/xyz/playedu/api/types/paginate/ResourcePaginateFilter.java
index cfeaf2a..2a78545 100644
--- a/src/main/java/xyz/playedu/api/types/paginate/ResourcePaginateFilter.java
+++ b/src/main/java/xyz/playedu/api/types/paginate/ResourcePaginateFilter.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/types/paginate/UserCourseHourRecordPaginateFilter.java b/src/main/java/xyz/playedu/api/types/paginate/UserCourseHourRecordPaginateFilter.java
index a0a0592..3d49996 100644
--- a/src/main/java/xyz/playedu/api/types/paginate/UserCourseHourRecordPaginateFilter.java
+++ b/src/main/java/xyz/playedu/api/types/paginate/UserCourseHourRecordPaginateFilter.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/types/paginate/UserCourseRecordPaginateFilter.java b/src/main/java/xyz/playedu/api/types/paginate/UserCourseRecordPaginateFilter.java
index e372264..3ef30e8 100644
--- a/src/main/java/xyz/playedu/api/types/paginate/UserCourseRecordPaginateFilter.java
+++ b/src/main/java/xyz/playedu/api/types/paginate/UserCourseRecordPaginateFilter.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/types/paginate/UserPaginateFilter.java b/src/main/java/xyz/playedu/api/types/paginate/UserPaginateFilter.java
index d548249..ba1dc72 100644
--- a/src/main/java/xyz/playedu/api/types/paginate/UserPaginateFilter.java
+++ b/src/main/java/xyz/playedu/api/types/paginate/UserPaginateFilter.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/types/response/UserLatestLearn.java b/src/main/java/xyz/playedu/api/types/response/UserLatestLearn.java
index 48c2676..10b09d8 100644
--- a/src/main/java/xyz/playedu/api/types/response/UserLatestLearn.java
+++ b/src/main/java/xyz/playedu/api/types/response/UserLatestLearn.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/util/Base64Util.java b/src/main/java/xyz/playedu/api/util/Base64Util.java
index 5749098..a4e90cf 100644
--- a/src/main/java/xyz/playedu/api/util/Base64Util.java
+++ b/src/main/java/xyz/playedu/api/util/Base64Util.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/util/HelperUtil.java b/src/main/java/xyz/playedu/api/util/HelperUtil.java
index d78747c..824ca78 100644
--- a/src/main/java/xyz/playedu/api/util/HelperUtil.java
+++ b/src/main/java/xyz/playedu/api/util/HelperUtil.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/util/IpUtil.java b/src/main/java/xyz/playedu/api/util/IpUtil.java
index dc52cce..6c78ae8 100644
--- a/src/main/java/xyz/playedu/api/util/IpUtil.java
+++ b/src/main/java/xyz/playedu/api/util/IpUtil.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/util/PrivacyUtil.java b/src/main/java/xyz/playedu/api/util/PrivacyUtil.java
index fb31d65..f9ccfe6 100644
--- a/src/main/java/xyz/playedu/api/util/PrivacyUtil.java
+++ b/src/main/java/xyz/playedu/api/util/PrivacyUtil.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -15,22 +15,26 @@
*/
package xyz.playedu.api.util;
-/**
- * @Author 杭州白书科技有限公司
- *
- * @create 2023/3/3 10:51
- */
public class PrivacyUtil {
public static String hidePhone(String phone) {
+ if (phone == null) {
+ return null;
+ }
return phone.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2");
}
public static String hideEmail(String email) {
+ if (email == null) {
+ return null;
+ }
return email.replaceAll("(\\w?)(\\w+)(\\w)(@\\w+\\.[a-z]+(\\.[a-z]+)?)", "$1****$3$4");
}
public static String hideIDCard(String idCard) {
+ if (idCard == null) {
+ return null;
+ }
return idCard.replaceAll("(\\d{4})\\d{10}(\\w{4})", "$1*****$2");
}
diff --git a/src/main/java/xyz/playedu/api/util/RedisDistributedLock.java b/src/main/java/xyz/playedu/api/util/RedisDistributedLock.java
index 6410a6f..77f99e7 100644
--- a/src/main/java/xyz/playedu/api/util/RedisDistributedLock.java
+++ b/src/main/java/xyz/playedu/api/util/RedisDistributedLock.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/util/RedisUtil.java b/src/main/java/xyz/playedu/api/util/RedisUtil.java
index bd73f6a..5e80279 100644
--- a/src/main/java/xyz/playedu/api/util/RedisUtil.java
+++ b/src/main/java/xyz/playedu/api/util/RedisUtil.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/util/RequestUtil.java b/src/main/java/xyz/playedu/api/util/RequestUtil.java
index 7d995b4..da76c2a 100644
--- a/src/main/java/xyz/playedu/api/util/RequestUtil.java
+++ b/src/main/java/xyz/playedu/api/util/RequestUtil.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/util/StringUtil.java b/src/main/java/xyz/playedu/api/util/StringUtil.java
index 77c26df..7afa0e5 100644
--- a/src/main/java/xyz/playedu/api/util/StringUtil.java
+++ b/src/main/java/xyz/playedu/api/util/StringUtil.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/xyz/playedu/api/vendor/PlayEduMinioClient.java b/src/main/java/xyz/playedu/api/vendor/PlayEduMinioClient.java
index 3224896..4a8f9ae 100644
--- a/src/main/java/xyz/playedu/api/vendor/PlayEduMinioClient.java
+++ b/src/main/java/xyz/playedu/api/vendor/PlayEduMinioClient.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023 杭州白书科技有限公司
+ * Copyright (C) 2023 杭州白书科技有限公司
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 2d059e9..27b21d4 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -56,15 +56,18 @@ mybatis-plus:
# configuration:
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+sa-token:
+ token-name: "Authorization"
+ timeout: 1296000 #token有效期[单位:秒,默认15天]
+ is-concurrent: false #限制同时登录
+ is-share: false
+ jwt-secret-key: "playeduxyz"
+ token-prefix: "Bearer"
+
# PlayEdu
playedu:
# 图形验证码
captcha:
expire: 300 #有效期[单位:秒,默认5分钟]
cache-prefix: "captcha:key:" #存储key的前缀
- # JWT
- jwt:
- key: "eJTJSLPv13fw9twbuPoeicypLqnSfYWL" #32个字符,加密key用来加密jwt的数据[运行本系统之前请务必修改]
- expire: 1296000 #token有效期[单位:秒,默认15天]
- cache-black-prefix: "jwt:blk:" #主动注销的token黑名单缓存前缀