| 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.*; | 
|   | 
| /** | 
|  * 协议控制器 | 
|  */ | 
| @Api | 
| @RestController | 
| @CrossOrigin | 
| @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=充值领券规则设置,9=司机注册协议,10=改派说明,11=机场专线乘车须知,12:常见问题,13:计价规则,14:公务用车协议)", 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(); | 
|         } | 
|     } | 
| } |