puzhibing
2023-06-13 7860e5cb6db60aeb82c640651998f8294635df5b
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
51
52
53
54
package com.dsh.course.controller;
 
import com.dsh.course.model.vo.BaseWarpper;
import com.dsh.course.service.IAgreementService;
import com.dsh.guns.modular.system.util.ResultUtil;
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 = "Get the various protocols and H5 pages获取各种协议及H5页面", tags = {"Client - protocol用户端-协议", "Driver side - Protocol司机端-协议"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "数据类型(1:隐私协议,2:用户协议,3:用户指南,4:法律条款,5:关于我们,6=注册协议,7=取消订单说明,8=充值领券规则设置,9=司机注册协议,10=改派说明,11=跨城出行乘车须知,12:常见问题,13:计价规则,14:包车协议)" +
                    "Data type (1: privacy agreement, 2: user agreement, 3: User guide, 4: legal terms, 5: about us, 6= registration agreement, 7= cancellation instructions, 8= top-up and voucher rules setting, 9= driver registration agreement, 10= reassignment instructions, 11= cross-city travel Instructions, 12: Frequently asked Questions, 13: pricing rules, 14: charter car agreement)", name = "type", required = true, dataType = "int"),
            @ApiImplicitParam(value = "User type (1= user, 2= driver)用户类型(1=用户,2=司机)", name = "userType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "Language (1= Chinese, 2= English, 3= Indonesian)语言(1=中文,2=英文,3=印尼文)", name = "language", required = true, dataType = "int"),
    })
    public ResultUtil<BaseWarpper> queryByType(Integer type, Integer userType,Integer language){
        try {
            String s = agreementService.queryByType(type, userType,language);
 
            BaseWarpper baseWarpper = new BaseWarpper();
            baseWarpper.setContent(s);
            return ResultUtil.success(baseWarpper);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
}