package com.agentdriving.driver.modular.system.api; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.agentdriving.driver.modular.system.model.Html; import com.agentdriving.driver.modular.system.service.IHtmlService; import com.agentdriving.driver.modular.system.util.ResultUtil; import com.agentdriving.driver.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=司机消单说明)", name = "type", required = true, dataType = "int"), }) public ResponseWarpper queryHtml(Integer type){ if(null == type){ return ResponseWarpper.success(ResultUtil.paranErr("type")); } try { Html html = htmlService.selectOne(new EntityWrapper().eq("type", type)); return ResponseWarpper.success(null == html ? "" : html.getHtml()); }catch (Exception e){ e.printStackTrace(); return new ResponseWarpper(500, e.getMessage()); } } }