This commit is contained in:
xiangwb
2018-04-23 16:28:41 +08:00
parent 7330a30030
commit 910cda7413
8 changed files with 18 additions and 16 deletions
@@ -55,6 +55,8 @@ public class DispatcherServletConfig extends WebMvcConfigurerAdapter {
// registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
//服务器部署的tomcat下html路径
// registry.addResourceHandler("/js/**").addResourceLocations("html/js/");
// registry.addResourceHandler("/css/**").addResourceLocations("html/css/");
// registry.addResourceHandler("/img/**").addResourceLocations("html/img/");
super.addResourceHandlers(registry);
}
@@ -14,11 +14,11 @@ import org.springframework.scheduling.annotation.Scheduled;
* 作者: xiangwb
*/
@Configuration
@EnableScheduling // 启用定时任务
@EnableScheduling//启用定时任务
public class SchedulingConfig {
private final Logger logger = LoggerFactory.getLogger(SchedulingConfig.class);
@Scheduled(cron = "0 0 6 * * ? ")//每天6点开启定时任务
@Scheduled(cron = "0 0 6 * * ? ")//每天6点执行定时任务
public void scheduler() {
logger.info("清除公共数据类过期数据===================");
CommonDataUtil.clearExpiryData();
@@ -94,7 +94,7 @@ public class SwaggerConfig {
}
/**
* 自定义返回信息
* 自定义返回状态信息描述
*
* @return
*/
@@ -42,7 +42,7 @@ public class DataDictionaryControl {
}
@LogInfo("修改字典")
@PostMapping("update")
@PutMapping("update")
@ApiOperation(value = "修改字典", response = RestMessageVo.class)
public JSONObject update(@RequestBody DataDictionary dictionary) {
if (StringUtils.isEmpty(dictionary.getId())) {
@@ -51,8 +51,8 @@ public class SysAuthorityControl {
@LogInfo("删除权限")
@ApiOperation(value = "删除权限", response = RestMessageVo.class)
@GetMapping("removeById")
public JSONObject removeById(@RequestParam String id) {
@DeleteMapping("removeById/{id}")
public JSONObject removeById(@PathVariable String id) {
if (StringUtils.isEmpty(id)) {
return JsonResult.toJSONObj("主键不能为空");
}
@@ -66,7 +66,7 @@ public class SysAuthorityControl {
@LogInfo("修改权限")
@ApiOperation(value = "修改权限", response = RestMessageVo.class)
@PostMapping("update")
@PutMapping("update")
public JSONObject update(@RequestBody SysAuthority sysAuthority) {
if (StringUtils.isEmpty(sysAuthority.getId())) {
return JsonResult.toJSONObj("主键不能为空");
@@ -43,8 +43,8 @@ public class SysConfigControl {
}
@ApiOperation(value = "删除", notes = "根据code删除系统配置信息", response = RestMessageVo.class)
@GetMapping("removeByCode")
public JSONObject removeByCode(@RequestParam String code) {
@DeleteMapping("removeByCode/{code}")
public JSONObject removeByCode(@PathVariable String code) {
String logMsg = "根据code删除系统配置信息";
logger.info(logMsg + " code:{}", code);
if (StringUtils.isEmpty(code)) {
@@ -55,7 +55,7 @@ public class SysConfigControl {
}
@ApiOperation(value = "修改", notes = "修改系统配置信息", response = RestMessageVo.class)
@PostMapping("update")
@PutMapping("update")
public JSONObject update(@RequestBody @Valid SysConfig sysConfig) {
String logMsg = "修改系统配置信息";
logger.info(logMsg);
@@ -50,8 +50,8 @@ public class SysRoleControl {
@LogInfo("删除角色")
@ApiOperation(value = "删除角色", response = RestMessageVo.class)
@GetMapping("removeById")
public JSONObject removeById(@RequestParam String id) {
@DeleteMapping("removeById/{id}")
public JSONObject removeById(@PathVariable String id) {
if (StringUtils.isEmpty(id)) {
return JsonResult.toJSONObj("主键不能为空");
}
@@ -61,7 +61,7 @@ public class SysRoleControl {
@LogInfo("修改角色")
@ApiOperation(value = "修改角色", response = RestMessageVo.class)
@PostMapping("update")
@PutMapping("update")
public JSONObject update(@RequestBody SysRole sysRole) {
if (StringUtils.isEmpty(sysRole.getId())) {
return JsonResult.toJSONObj("主键不能为空");
@@ -59,8 +59,8 @@ public class SysUserControl {
@LogInfo("删除用户")
@ApiOperation(value = "删除用户", response = RestMessageVo.class)
@GetMapping("removeById")
public JSONObject removeById(@RequestParam String id) {
@DeleteMapping("removeById/{id}")
public JSONObject removeById(@PathVariable String id) {
if (StringUtils.isEmpty(id)) {
return JsonResult.toJSONObj("主键不能为空");
}
@@ -70,7 +70,7 @@ public class SysUserControl {
@LogInfo("修改用户信息")
@ApiOperation(value = "修改用户信息", response = RestMessageVo.class)
@PostMapping("update")
@PutMapping("update")
public JSONObject update(@RequestBody @Valid SysUser sysUser) {
if (StringUtils.isEmpty(sysUser.getId())) {
return JsonResult.toJSONObj("主键不能为空");