This commit is contained in:
xiangwb
2017-11-13 16:49:32 +08:00
parent 7cfde46e7e
commit f348f60b44
5 changed files with 32 additions and 22 deletions
@@ -49,8 +49,8 @@ public class SysConfigControl {
@ApiOperation(value = "删除", notes = "根据code删除系统配置信息")
@ApiImplicitParam(name = "code", value = "配置项的code", paramType = "query", required = true, dataType = "string")
@GetMapping("removeByCode/{code}")
public JSONObject removeByCode(@PathVariable String code) {
@GetMapping("removeByCode")
public JSONObject removeByCode(@RequestParam String code) {
String logMsg = "删除系统配置信息";
logger.info(logMsg + " code:{}", code);
if (StringUtils.isEmpty(code)) {
@@ -67,7 +67,7 @@ public class SysConfigControl {
@ApiImplicitParam(name = "enable", value = "是否启用,格式为Y|N", paramType = "query", required = true, dataType = "string"),
})
@PostMapping("update")
public JSONObject update(@RequestBody SysConfig sysConfig) {
public JSONObject update(SysConfig sysConfig) {
String logMsg = "修改系统配置信息";
logger.info(logMsg);
if (StringUtils.isEmpty(sysConfig.getCode()))
@@ -8,6 +8,8 @@ import com.xwbing.service.SysUserService;
import com.xwbing.util.JSONObjResult;
import com.xwbing.util.RestMessage;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -28,6 +30,7 @@ public class SysUserControl {
private SysUserService sysUserService;
@Resource
private SysUserLoginInOutService loginInOutService;
private final Logger logger = LoggerFactory.getLogger(SysUserControl.class);
@LogInfo("添加用户")
@PostMapping("save")
@@ -33,7 +33,6 @@ public class GlobalExceptionHandler {
/**
* 自定义业务异常
*
* @param request
* @param ex
* @return
*/
@@ -42,7 +41,7 @@ public class GlobalExceptionHandler {
// 返回给页面200状态码
@ResponseStatus(value = HttpStatus.OK)
@ResponseBody
public JSONObject handlerGuideException(HttpServletRequest request, Exception ex) {
public JSONObject handlerGuideException(Exception ex) {
logger.error(ex.getMessage());
return JSONObjResult.toJSONObj(ex.getMessage());
}
+4
View File
@@ -64,6 +64,8 @@
<!-- Root Logger -->
<root level="debug">
<appender-ref ref="Console"/>
<appender-ref ref="info_appender"/>
<appender-ref ref="error_appender"/>
</root>
<!-- 3rdparty Loggers -->
<logger name="org.springframework.core" level="info"/>
@@ -74,11 +76,13 @@
<logger name="org.apache.http" level="warn"/>
<!-- 默认为root。匹配该name下的所有子类,由于这个logger也是满足root的,additivity为true,该logger和root都会打印。
additivity为false,匹配该logger的信息只会在该logger下打印,不会在root下打印 -->
<!--
<logger name="com.xwbing.handler.WebLogAspect" level="INFO" additivity="true">
<appender-ref ref="info_appender"/>
</logger>
<logger name="com.xwbing.handler.GlobalExceptionHandler" level="ERROR" additivity="true">
<appender-ref ref="error_appender"/>
</logger>
-->
</Loggers>
</Configuration>