| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.model.THtmlConfig; |
| | | import com.ruoyi.system.service.THtmlConfigService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RequestMapping("/t-html-config") |
| | | public class THtmlConfigController { |
| | | |
| | | private final THtmlConfigService htmlConfigService; |
| | | @Autowired |
| | | public THtmlConfigController(THtmlConfigService htmlConfigService) { |
| | | this.htmlConfigService = htmlConfigService; |
| | | } |
| | | /** |
| | | * 修改系统配置-协议管理 |
| | | */ |
| | | @Log(title = "系统配置-协议管理", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "修改系统配置-协议管理管理") |
| | | @PostMapping(value = "/update") |
| | | public R<Boolean> update(@Validated @RequestBody THtmlConfig dto) { |
| | | THtmlConfig sysConfig = htmlConfigService.getOne(Wrappers.<THtmlConfig>lambdaQuery().eq(THtmlConfig::getConfigType, dto.getConfigType()) |
| | | .last("LIMIT 1")); |
| | | sysConfig.setContent(dto.getContent()); |
| | | return R.ok(htmlConfigService.updateById(sysConfig)); |
| | | } |
| | | |
| | | /** |
| | | * 查看系统配置-协议管理详情 |
| | | */ |
| | | @ApiOperation(value = "查看系统配置-协议管理详情",notes = "配置类型 类型 1=托育服务 2=阅芽计划 3=办事指南图文指引 4=暖心服务图片 5=注册协议 6=隐私政策 7=学习申请书 8=安全告知书 9=购买支付说明 10=微心愿风险提示 11=群众诉求服务说明 12=随手拍说明") |
| | | @GetMapping(value = "/getDetailById") |
| | | public R<THtmlConfig> getDetailById(@RequestParam Integer configType) { |
| | | THtmlConfig sysConfig = htmlConfigService.getOne(Wrappers.<THtmlConfig>lambdaQuery().eq(THtmlConfig::getConfigType, configType) |
| | | .last("LIMIT 1")); |
| | | return R.ok(sysConfig); |
| | | } |
| | | |
| | | } |
| | | |