xuhy
2023-02-28 adb18caa714692ccabf111ae3ab3481bf04844d4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.supersavedriving.user.modular.api;
 
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.supersavedriving.user.core.common.annotion.ServiceLog;
import com.supersavedriving.user.modular.system.model.Html;
import com.supersavedriving.user.modular.system.service.IHtmlService;
import com.supersavedriving.user.modular.system.util.ResultUtil;
import com.supersavedriving.user.modular.system.warpper.ResponseWarpper;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * 协议控制器
 */
@RestController
@RequestMapping("")
public class HtmlController {
 
    @Autowired
    private IHtmlService htmlService;
 
 
 
 
    @ResponseBody
    @PostMapping("/base/html/queryHtml")
    @ServiceLog(name = "获取各种协议和说明", url = "/base/html/queryHtml")
    @ApiOperation(value = "获取各种协议和说明", tags = {"用户端-首页"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "类型(1=用户协议,2=隐私政策,3=法律条款,4=代驾服务协议,5=个人信息处理规则,6=积分说明,7=佣金规则说明,8=行程录音说明,9=预估价格说明,10=加盟基本要求,11=加盟流程,12=起步价说明,13=注销协议,14=关于我们,15=司机消单说明)", name = "type", required = true, dataType = "int"),
    })
    public ResponseWarpper<String> queryHtml(Integer type){
        if(null == type){
            return ResponseWarpper.success(ResultUtil.paranErr("type"));
        }
        try {
            Html html = htmlService.selectOne(new EntityWrapper<Html>().eq("type", type));
            return ResponseWarpper.success(null == html ? "" : html.getHtml());
        }catch (Exception e){
            e.printStackTrace();
            return new ResponseWarpper(500, e.getMessage());
        }
    }
}