@ -2,6 +2,8 @@ package cn.estsh.i3plus.core.apiservice.controller.busi;
import cn.estsh.i3plus.core.api.iservice.busi.ISysConfigService ;
import cn.estsh.i3plus.core.api.iservice.busi.ISysConfigService ;
import cn.estsh.i3plus.platform.common.convert.ConvertBean ;
import cn.estsh.i3plus.platform.common.convert.ConvertBean ;
import cn.estsh.i3plus.pojo.base.bean.ListPager ;
import cn.estsh.i3plus.pojo.base.common.Pager ;
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil ;
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil ;
import cn.estsh.i3plus.pojo.platform.bean.SessionUser ;
import cn.estsh.i3plus.pojo.platform.bean.SessionUser ;
import cn.estsh.i3plus.pojo.platform.bean.SysConfig ;
import cn.estsh.i3plus.pojo.platform.bean.SysConfig ;
@ -27,7 +29,7 @@ import java.util.List;
* @Modify :
* @Modify :
* * /
* * /
@RestController
@RestController
@RequestMapping ( "/sys _ config")
@RequestMapping ( "/sys - config")
@Api ( description = "系统参数管理服务" )
@Api ( description = "系统参数管理服务" )
public class SysConfigController {
public class SysConfigController {
public static final Logger LOGGER = LoggerFactory . getLogger ( SysConfigController . class ) ;
public static final Logger LOGGER = LoggerFactory . getLogger ( SysConfigController . class ) ;
@ -35,7 +37,7 @@ public class SysConfigController {
@Autowired
@Autowired
public ISysConfigService sysConfigService ;
public ISysConfigService sysConfigService ;
@P u tMapping( "/insert" )
@P os tMapping( "/insert" )
@ApiOperation ( value = "添加系统参数" , notes = "添加系统参数" )
@ApiOperation ( value = "添加系统参数" , notes = "添加系统参数" )
public ResultBean insertSysConfig ( SysConfig sysConfig ) {
public ResultBean insertSysConfig ( SysConfig sysConfig ) {
try {
try {
@ -62,9 +64,9 @@ public class SysConfigController {
}
}
}
}
@DeleteMapping ( value = "/delete ")
@DeleteMapping ( value = "/delete /{id} ")
@ApiOperation ( value = "根据id删除系统参数" , notes = "根据id删除系统参数" )
@ApiOperation ( value = "根据id删除系统参数" , notes = "根据id删除系统参数" )
public ResultBean deleteSysConfig ( String id ) {
public ResultBean deleteSysConfig ( @PathVariable ( "id" ) String id ) {
try {
try {
sysConfigService . deleteSysConfigById ( id ) ;
sysConfigService . deleteSysConfigById ( id ) ;
return ResultBean . success ( "删除成功" ) . setCode ( ResourceEnumUtil . MESSAGE . SUCCESS . getCode ( ) ) ;
return ResultBean . success ( "删除成功" ) . setCode ( ResourceEnumUtil . MESSAGE . SUCCESS . getCode ( ) ) ;
@ -104,13 +106,13 @@ public class SysConfigController {
}
}
}
}
@GetMapping ( value = "/ find-all ")
@GetMapping ( value = "/ list ")
@ApiOperation ( value = "查询全部系统参数" , notes = "查询全部系统参数" )
@ApiOperation ( value = "查询全部系统参数" , notes = "查询全部系统参数" )
public ResultBean findSysConfigAll ( ) {
public ResultBean findSysConfigAll ( ) {
try {
try {
List < SysConfig > sysConfig = sysConfigService . findSysConfigAll ( ) ;
List < SysConfig > sysConfig List = sysConfigService . ListSysConfig ( ) ;
return ResultBean . success ( "查询成功" )
return ResultBean . success ( "查询成功" )
. setResultList ( sysConfig )
. setResultList ( sysConfig List )
. setCode ( ResourceEnumUtil . MESSAGE . SUCCESS . getCode ( ) ) ;
. setCode ( ResourceEnumUtil . MESSAGE . SUCCESS . getCode ( ) ) ;
} catch ( ImppBusiException busExcep ) {
} catch ( ImppBusiException busExcep ) {
LOGGER . error ( busExcep . getErrorMsg ( ) + ": {}" , busExcep . getErrorDetail ( ) , busExcep ) ;
LOGGER . error ( busExcep . getErrorMsg ( ) + ": {}" , busExcep . getErrorDetail ( ) , busExcep ) ;
@ -121,8 +123,9 @@ public class SysConfigController {
}
}
}
}
@GetMapping ( value = "/get-by-id" )
@GetMapping ( value = "/get/{id}" )
public ResultBean getSysConfigById ( String id ) {
@ApiOperation ( value = "根据id查询系统参数" , notes = "根据id查询系统参数" )
public ResultBean getSysConfigById ( @PathVariable ( "id" ) String id ) {
try {
try {
SysConfig sysConfig = sysConfigService . getSysConfigById ( id ) ;
SysConfig sysConfig = sysConfigService . getSysConfigById ( id ) ;
return ResultBean . success ( "查询成功" )
return ResultBean . success ( "查询成功" )
@ -137,4 +140,21 @@ public class SysConfigController {
}
}
}
}
@GetMapping ( "/query" )
@ApiOperation ( value = "系统参数复杂查询,分页,排序" )
public ResultBean querySysConfigByPager ( SysConfig sysConfig , Pager pager ) {
try {
ListPager sysConfigListPager = sysConfigService . querySysConfigByPager ( sysConfig , pager ) ;
return ResultBean . success ( "查询成功" )
. setListPager ( sysConfigListPager )
. setCode ( ResourceEnumUtil . MESSAGE . SUCCESS . getCode ( ) ) ;
} catch ( ImppBusiException busExcep ) {
LOGGER . error ( busExcep . getErrorMsg ( ) + ": {}" , busExcep . getErrorDetail ( ) , busExcep ) ;
return ResultBean . fail ( busExcep . getErrorShow ( ) ) ;
} catch ( Exception e ) {
LOGGER . error ( ImppExceptionEnum . SYSTEM_EXCEPTION . getDescription ( ) + ": {}" , e . getMessage ( ) , e ) ;
return ResultBean . fail ( ) . setCode ( ImppExceptionEnum . SYSTEM_EXCEPTION . getCode ( ) ) ;
}
}
}
}