puzhibing
2022-08-22 1421f8e9c308c4741cb396309035009393b5b036
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.stylefeng.guns.modular.api;
 
import com.stylefeng.guns.modular.system.service.IAgreementService;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.warpper.BaseWarpper;
import io.swagger.annotations.Api;
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;
 
/**
 * 协议控制器
 */
@Api
@RestController
@RequestMapping("/base/agreement")
public class AgreementController {
 
    @Autowired
    private IAgreementService agreementService;
 
 
    /**
     * 获取各种协议
     * @param type
     * @return
     */
    @ResponseBody
    @PostMapping("/queryByType")
    @ApiOperation(value = "获取各种协议及H5页面", tags = {"司机端-个人中心"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "数据类型(1:隐私协议,2:用户协议,3:用户指南,4:法律条款,5:关于我们,6=注册协议,7=取消订单说明,8=充值领券规则设置)", name = "type", required = true, dataType = "int")
    })
    public ResultUtil<BaseWarpper> queryByType(Integer type){
        try {
            String s = agreementService.queryByType(type);
            BaseWarpper baseWarpper = new BaseWarpper();
            baseWarpper.setContent(s);
            return ResultUtil.success(baseWarpper);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
}