导航,附件,拦截器
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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
41
src/main/java/com/lovenav/controller/NavController.java
Normal file
41
src/main/java/com/lovenav/controller/NavController.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package com.lovenav.controller;
|
||||
|
||||
import com.lovenav.entity.Nav;
|
||||
import com.lovenav.service.NavService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class NavController {
|
||||
@Autowired
|
||||
NavService navService;
|
||||
@RequestMapping("/updateNav")
|
||||
public String updateNav(Nav nav){
|
||||
if (nav==null){
|
||||
return "选择更新的导航标签!";
|
||||
}
|
||||
return navService.updateNav(nav);
|
||||
}
|
||||
|
||||
@RequestMapping("/addNav")
|
||||
public String addNav(Nav nav){
|
||||
if (nav==null){
|
||||
return "添加的导航不能为空";
|
||||
}
|
||||
return navService.addNav(nav);
|
||||
}
|
||||
@RequestMapping("/deleteNav")
|
||||
public String deleteNav(Nav nav){
|
||||
if (nav==null){
|
||||
return "删除的导航不能为空";
|
||||
}
|
||||
return navService.deleteNav(nav);
|
||||
}
|
||||
|
||||
@RequestMapping("/selectAllNav")
|
||||
public String selectAllNav(){
|
||||
return navService.selectAllNav();
|
||||
}
|
||||
|
||||
}
|
23
src/main/java/com/lovenav/controller/UrlListController.java
Normal file
23
src/main/java/com/lovenav/controller/UrlListController.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package com.lovenav.controller;
|
||||
|
||||
import com.lovenav.entity.UrlList;
|
||||
import com.lovenav.service.UrlListService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class UrlListController {
|
||||
@Autowired
|
||||
UrlListService urlListService;
|
||||
//后台修改网站状态
|
||||
@RequestMapping("/admin/weblist/alterUrlStatus")
|
||||
public String setUrlStatus(UrlList urlList){
|
||||
int result=urlListService.updateUrlStatusListById(urlList);
|
||||
if (result==1){
|
||||
return "修改成功";
|
||||
}else {
|
||||
return "修改失败";
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,6 +1,7 @@
|
||||
package com.lovenav.controller;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.lovenav.entity.UrlList;
|
||||
import com.lovenav.entity.User;
|
||||
import com.lovenav.service.UserService;
|
||||
import com.lovenav.utils.MD5Utils;
|
||||
@@ -146,4 +147,5 @@ public class UserController {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user