From 7b487d4c819bc67021cf224c5042066bf73df1e3 Mon Sep 17 00:00:00 2001
From: nickchange <126672920+nickchange@users.noreply.github.com>
Date: 星期六, 28 十月 2023 17:01:00 +0800
Subject: [PATCH] 10.28。2
---
cloud-server-other/src/main/java/com/dsh/other/controller/ProtocolController.java | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/cloud-server-other/src/main/java/com/dsh/other/controller/ProtocolController.java b/cloud-server-other/src/main/java/com/dsh/other/controller/ProtocolController.java
new file mode 100644
index 0000000..051d1f4
--- /dev/null
+++ b/cloud-server-other/src/main/java/com/dsh/other/controller/ProtocolController.java
@@ -0,0 +1,45 @@
+package com.dsh.other.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.dsh.other.entity.Protocol;
+import com.dsh.other.service.IProtocolService;
+import com.dsh.other.util.ResultUtil;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author zhibing.pu
+ * @date 2023/6/14 15:06
+ */
+@RestController
+@RequestMapping("/base/protocol")
+public class ProtocolController {
+
+ @Autowired
+ private IProtocolService protocolService;
+
+
+
+ @ResponseBody
+ @PostMapping("/queryProtocol")
+ @ApiOperation(value = "获取各种协议", tags = {"用户—登录注册"})
+ @ApiImplicitParams({
+ @ApiImplicitParam(value = "类型(1=用户协议,2=隐私协议,3=运动安全公告书)", name = "type", dataType = "int", required = true)
+ })
+ public ResultUtil<String> queryProtocol(Integer type){
+ try {
+ Protocol protocol = protocolService.getBaseMapper().selectOne(new QueryWrapper<Protocol>().eq("type", type));
+ return ResultUtil.success(null == protocol ? "" : protocol.getContent());
+ }catch (Exception e){
+ e.printStackTrace();
+ return ResultUtil.runErr();
+ }
+ }
+
+
+
+
+}
--
Gitblit v1.7.1