URL访问量,用户地址,日志登录,附件上传,下载,配置文件上传
This commit is contained in:
@@ -1,30 +1,47 @@
|
||||
package com.lovenav.controller;
|
||||
|
||||
import com.lovenav.entity.Config;
|
||||
import com.lovenav.service.AttachmentService;
|
||||
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;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@RestController
|
||||
public class ConfigController {
|
||||
//配置文件操作
|
||||
@Autowired
|
||||
ConfigService configService;
|
||||
@Autowired
|
||||
AttachmentService attachmentService;
|
||||
@RequestMapping("/updateConfig")
|
||||
public String updateConfig(Config config){
|
||||
if (configService.updateConfis(config)==1){
|
||||
return "更新成功";
|
||||
Date date=new Date();
|
||||
int date1=Integer.valueOf(date.toString());
|
||||
config.setUpdatetime(date1);
|
||||
if (config==null){
|
||||
return "配置文件不能为空!";
|
||||
}
|
||||
else {
|
||||
return "更新配置失败";
|
||||
if (configService.updateConfig(config)==1){
|
||||
|
||||
return "更新成功!";
|
||||
}
|
||||
else if (configService.updateConfig(config)==2){
|
||||
return "不存在名称为"+config.getName()+"的配置文件,请先添加!";
|
||||
}
|
||||
return "更新失败!";
|
||||
}
|
||||
@RequestMapping("/addConfig")
|
||||
@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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user