1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- package com.chelvc.cloud.admin.controller;
- import com.chelvc.cloud.vehicle.api.dto.HelpDTO;
- import com.chelvc.cloud.vehicle.api.param.HelpModifyParam;
- import com.chelvc.cloud.vehicle.api.param.HelpPagingParam;
- import com.chelvc.cloud.vehicle.api.service.IHelpService;
- import com.chelvc.framework.base.annotation.ResponseWrapping;
- import com.chelvc.framework.common.model.Pagination;
- import org.apache.dubbo.config.annotation.DubboReference;
- import org.springframework.security.access.prepost.PreAuthorize;
- import org.springframework.validation.annotation.Validated;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.PutMapping;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RestController;
- import javax.validation.Valid;
- import javax.validation.constraints.Min;
- /**
- * 问题接口
- *
- * @author liude
- * @date 2024/3/4
- */
- @Validated
- @RestController
- @ResponseWrapping
- @PreAuthorize("isScope('EMPLOYEE')")
- public class HelpController {
- @DubboReference
- private IHelpService helpService;
- /**
- * 新增问题配置
- *
- * @param param 新增参数
- * @return 问题配置主键
- */
- @PostMapping("/help")
- public void addHelp(@RequestBody @Valid HelpModifyParam param) {
- this.helpService.insertHelp(param);
- }
- /**
- * 修改问题配置
- *
- * @param id 问题配置主键
- * @param param 修改参数
- */
- @PutMapping("/help/{id}")
- public void updateHelp(@PathVariable("id") @Min(value = 1, message = "问题配置主键不能小于1") Long id,
- @RequestBody @Valid HelpModifyParam param) {
- this.helpService.updateHelp(id,param);
- }
- /**
- * 查询问题配置分页
- *
- * @param param 查询参数
- * @return 问题配置分页信息
- */
- @GetMapping("/help/paging")
- public Pagination<HelpDTO> getHelpPaging(@Valid HelpPagingParam param) {
- return this.helpService.getHelpPaging(param);
- }
- /**
- * 修改问题配置
- *
- * @param id 问题配置主键
- */
- @PutMapping("/help/delete/{id}")
- public void deleteHelp(@PathVariable("id") @Min(value = 1, message = "问题配置主键不能小于1") Long id) {
- this.helpService.deleteHelpById(id);
- }
- }
|