package com.ruoyi.other.controller;
|
|
|
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.other.api.domain.SystemConfig;
|
import com.ruoyi.other.service.SystemConfigService;
|
import org.springframework.web.bind.annotation.*;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
|
import javax.annotation.Resource;
|
|
/**
|
* <p>
|
* 前端控制器
|
* </p>
|
*
|
* @author luodangjia
|
* @since 2024-11-20
|
*/
|
@RestController
|
@RequestMapping("/system-config")
|
public class SystemConfigController {
|
@Resource
|
private SystemConfigService systemConfigService;
|
@GetMapping("/byType")
|
@ApiOperation(value = "1=启动页管理,2=首页配置,3=订单包邮设置", tags = {"小程序-启动页面","小程序-首页","订单包邮配置"})
|
public R<SystemConfig> byType(Integer type){
|
SystemConfig one = systemConfigService.lambdaQuery().eq(SystemConfig::getType, type).last("limit 1").one();
|
return R.ok(one);
|
}
|
|
|
/**
|
* 根据类型获取系统配置
|
* @param type
|
* @return
|
*/
|
@ResponseBody
|
@PostMapping("/getSystemConfig")
|
public R<SystemConfig> getSystemConfig(@RequestParam("type") Integer type){
|
SystemConfig one = systemConfigService.lambdaQuery().eq(SystemConfig::getType, type).last("limit 1").one();
|
return R.ok(one);
|
}
|
}
|