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());
|
}
|
}
|
}
|