package com.ruoyi.other.controller; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.other.api.domain.THtml; import com.ruoyi.other.api.domain.TNotice; import com.ruoyi.other.service.THtmlService; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; /** *
* 前端控制器 *
* * @author 无关风月 * @since 2024-08-06 */ @RestController @RequestMapping("/t-html") public class THtmlController { @Resource private THtmlService htmlService; @ApiOperation(tags = {"后台-内容设置-协议服务"},value = "新增修改") @PostMapping(value = "/saveOrUpdate") public AjaxResult saveOrUpdate(@RequestBody THtml tHtml) { htmlService.saveOrUpdate(tHtml); return AjaxResult.success(); } @ApiOperation(tags = {"后台-内容设置-协议服务"},value = "查询") @GetMapping(value = "/selectByType/{type}") public AjaxResult selectByType(@PathVariable Integer type) { THtml one = htmlService.lambdaQuery().eq(THtml::getType, type).last("limit 1").one(); return AjaxResult.success(one); } }