导航,附件,拦截器

This commit is contained in:
2023-12-22 22:07:53 +08:00
parent cffa534f2c
commit 3bf4a8e793
19 changed files with 434 additions and 41 deletions

View File

@@ -0,0 +1,32 @@
package com.lovenav.controller;
import com.lovenav.entity.Config;
import com.lovenav.service.ConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class ConfigController {
@Autowired
ConfigService configService;
@RequestMapping("/updateConfig")
public String updateConfig(Config config){
if (configService.updateConfis(config)==1){
return "更新成功";
}
else {
return "更新配置失败";
}
}
@RequestMapping("/addConfig")
public String addConfig(Config config){
if (config.getName()==null||config.getValue()==null){
return "属性值不能为空";
}else {
return configService.addConfig(config);
}
}
}