diff --git a/src/main/java/com/corewing/app/modules/app/AppAgreementController.java b/src/main/java/com/corewing/app/modules/app/AppAgreementController.java deleted file mode 100644 index 5c43f01..0000000 --- a/src/main/java/com/corewing/app/modules/app/AppAgreementController.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.corewing.app.modules.app; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; - -/** - * 隐私政策与协议 - */ -@Controller -@RequestMapping("/agreement") -public class AppAgreementController { - - /** - * 隐私政策列表 - * @return - */ - @GetMapping("/viewList/{lang}") - public String viewList(@PathVariable String lang) { - return "app/agreement/index"; - } - -} diff --git a/src/main/java/com/corewing/app/modules/app/AppPrivacyPolicyController.java b/src/main/java/com/corewing/app/modules/app/AppPrivacyPolicyController.java new file mode 100644 index 0000000..4ac6d4d --- /dev/null +++ b/src/main/java/com/corewing/app/modules/app/AppPrivacyPolicyController.java @@ -0,0 +1,37 @@ +package com.corewing.app.modules.app; + +import com.corewing.app.entity.PrivacyPolicy; +import com.corewing.app.service.PrivacyPolicyService; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 隐私政策与协议 + */ +@Controller +@RequestMapping("/privacy_policy") +public class AppPrivacyPolicyController { + + @Resource + private PrivacyPolicyService privacyPolicyService; + + /** + * 隐私政策列表 + * @return + */ + @GetMapping("/view_list/{lang}") + public String viewList(@PathVariable String lang, ModelMap modelMap) { + List list = privacyPolicyService.list(); + modelMap.put("list", list); + // 获取最新更新时间 + modelMap.put("lastUpdateTime", privacyPolicyService.getLastUpdateTime()); + return "app/privacyPolicy/index"; + } + +} diff --git a/src/main/java/com/corewing/app/service/PrivacyPolicyService.java b/src/main/java/com/corewing/app/service/PrivacyPolicyService.java index 58e6d31..0b3e5e5 100644 --- a/src/main/java/com/corewing/app/service/PrivacyPolicyService.java +++ b/src/main/java/com/corewing/app/service/PrivacyPolicyService.java @@ -7,4 +7,6 @@ import com.corewing.app.entity.PrivacyPolicy; public interface PrivacyPolicyService extends IService { Page page(PrivacyPolicy privacyPolicy); + + String getLastUpdateTime(); } diff --git a/src/main/java/com/corewing/app/service/impl/PrivacyPolicyServiceImpl.java b/src/main/java/com/corewing/app/service/impl/PrivacyPolicyServiceImpl.java index 6f0adc7..f1b880f 100644 --- a/src/main/java/com/corewing/app/service/impl/PrivacyPolicyServiceImpl.java +++ b/src/main/java/com/corewing/app/service/impl/PrivacyPolicyServiceImpl.java @@ -7,6 +7,7 @@ import com.corewing.app.common.page.PageContext; import com.corewing.app.entity.PrivacyPolicy; import com.corewing.app.mapper.PrivacyPolicyMapper; import com.corewing.app.service.PrivacyPolicyService; +import com.corewing.app.util.DateUtils; import org.springframework.aop.framework.ProxyFactory; import org.springframework.stereotype.Service; import org.springframework.util.StringUtils; @@ -21,4 +22,12 @@ public class PrivacyPolicyServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.orderByDesc(PrivacyPolicy::getUpdateTime, PrivacyPolicy::getCreateTime); + PrivacyPolicy privacyPolicy = list(queryWrapper).get(0); + return DateUtils.format(privacyPolicy.getUpdateTime() == null ? privacyPolicy.getCreateTime() : privacyPolicy.getUpdateTime(), "yyyy年MM月dd日"); + } } diff --git a/src/main/resources/templates/app/agreement/index.html b/src/main/resources/templates/app/agreement/index.html deleted file mode 100644 index 4c1e010..0000000 --- a/src/main/resources/templates/app/agreement/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - 隐私政策 - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/app/privacyPolicy/index.html b/src/main/resources/templates/app/privacyPolicy/index.html new file mode 100644 index 0000000..133f57d --- /dev/null +++ b/src/main/resources/templates/app/privacyPolicy/index.html @@ -0,0 +1,145 @@ + + + + + + 隐私政策 + + + + + + + + + + +
+
+

隐私政策

+ + + +
+
+ + +
+ +
+

+ + 最后更新日期: +

+
+ + +
+ +
+ +
+

+ +
+ + +
+
+

+ 这里将显示隐私政策的详细内容,包括我们如何收集、使用、存储和保护您的个人信息,以及您拥有的相关权利和选择。 +

+
+
+
+ + +
+
+

信息收集与使用

+ +
+
+
+

我们收集您在使用服务过程中提供的个人信息,包括但不限于姓名、联系方式、位置信息等。这些信息将用于提供、维护和改进我们的服务,开发新功能,并保护我们的用户和服务。

+
+
+
+ +
+
+

信息共享与披露

+ +
+
+
+

我们不会向第三方出售您的个人信息。在以下情况下,我们可能会共享您的信息:获得您的明确同意;为提供您要求的产品或服务;遵守适用的法律法规、法律程序或政府要求;保护我们的权利、财产或安全,以及我们的用户和公众的权利。

+
+
+
+
+ + +
+

如有任何疑问,请联系我们的客服团队

+

service@example.com

+
+
+ + + + \ No newline at end of file