| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- package com.ydtech.modules.admin.controller;
- import com.ydtech.core.page.HttpResult;
- import com.ydtech.modules.admin.model.po.SysSwitchConfig;
- import com.ydtech.modules.admin.model.vo.SysSwitchConfigQueryVo;
- import com.ydtech.modules.admin.model.vo.SysSwitchConfigVo;
- import com.ydtech.modules.admin.service.SysSwitchConfigService;
- import com.ydtech.modules.order.entity.BasePageResult;
- import com.ydtech.modules.protocol.utils.AssertionUtils;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import lombok.RequiredArgsConstructor;
- import org.springframework.web.bind.annotation.*;
- @RestController
- @RequestMapping("/sys/switch")
- @Api(tags = "开关配置")
- @RequiredArgsConstructor
- public class SysSwitchConfigController {
- private final SysSwitchConfigService sysSwitchConfigService;
- @PostMapping("/page")
- @ApiOperation(value = "获取分页列表")
- public HttpResult<BasePageResult<SysSwitchConfig>> queryPage(@RequestBody SysSwitchConfigQueryVo sysSwitchConfigQueryVo) {
- BasePageResult<SysSwitchConfig> pageResult = sysSwitchConfigService.queryPage(sysSwitchConfigQueryVo);
- return HttpResult.ok(pageResult);
- }
- @PostMapping
- @ApiOperation(value = "增加")
- public HttpResult<Object> add(@RequestBody SysSwitchConfigVo sysSwitchConfigVo) {
- sysSwitchConfigService.add(sysSwitchConfigVo);
- return HttpResult.ok();
- }
- @DeleteMapping("/{id}")
- @ApiOperation(value = "删除")
- public HttpResult<Object> del(@PathVariable String id) {
- boolean b = sysSwitchConfigService.removeById(id);
- AssertionUtils.isSucceed(b, "删除失败");
- return HttpResult.ok();
- }
- @PutMapping("/{id}")
- @ApiOperation(value = "修改")
- public HttpResult<Object> revise(@PathVariable String id, @RequestBody SysSwitchConfigVo sysSwitchConfigVo) {
- sysSwitchConfigService.revise(id, sysSwitchConfigVo);
- return HttpResult.ok();
- }
- @GetMapping("/appUndeveloped/display")
- @ApiOperation(value = "app未开发完功能隐藏")
- public HttpResult<Boolean> appUndeveloped() {
- boolean display = sysSwitchConfigService.appUndeveloped();
- return HttpResult.ok(display);
- }
- @GetMapping("/isEnabled")
- @ApiOperation(value = "开关是否开启")
- public HttpResult<Boolean> isEnabled(String keyWord) {
- boolean display = sysSwitchConfigService.isEnabled(keyWord);
- return HttpResult.ok(display);
- }
- }
|