导航,附件,拦截器
This commit is contained in:
32
src/main/java/com/lovenav/controller/ConfigController.java
Normal file
32
src/main/java/com/lovenav/controller/ConfigController.java
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user