返回cate和list数量
This commit is contained in:
@@ -8,6 +8,7 @@ import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
@RestController
|
||||
@@ -20,9 +21,9 @@ public class ConfigController {
|
||||
@RequestMapping("/updateConfig")
|
||||
public String updateConfig(Config config){
|
||||
Date date=new Date();
|
||||
int date1=Integer.valueOf(date.toString());
|
||||
config.setUpdatetime(date1);
|
||||
if (config==null){
|
||||
try {
|
||||
config.setUpdatetime(date.getTime());
|
||||
if (config.getName().equals("")||config.getValue().equals("")){
|
||||
return "配置文件不能为空!";
|
||||
}
|
||||
if (configService.updateConfig(config)==1){
|
||||
@@ -32,18 +33,24 @@ public class ConfigController {
|
||||
else if (configService.updateConfig(config)==2){
|
||||
return "不存在名称为"+config.getName()+"的配置文件,请先添加!";
|
||||
}
|
||||
return "更新失败!";
|
||||
return "更新失败!";}catch (NullPointerException e){
|
||||
return "请输入配置信息!";
|
||||
}
|
||||
}
|
||||
@RequestMapping("/addConfigString")
|
||||
public String addConfig(Config config){
|
||||
if (config.getName()==null||config.getValue()==null){
|
||||
return "属性值不能为空";
|
||||
}else {
|
||||
Date date=new Date();
|
||||
int date1=Integer.valueOf(date.toString());
|
||||
config.setUpdatetime(date1);
|
||||
return configService.addConfig(config);
|
||||
try {
|
||||
if (config.getName().equals("")||config.getValue().equals("")){
|
||||
return "属性值不能为空";
|
||||
}else {
|
||||
Date date=new Date();
|
||||
config.setUpdatetime(date.getTime());
|
||||
return configService.addConfig(config);
|
||||
}
|
||||
}catch (NullPointerException e){
|
||||
return "请输入配置信息";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user