|
|
@ -32,19 +32,12 @@ public class ConfigController{
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private ConfigService configService;
|
|
|
|
private ConfigService configService;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 列表
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@RequestMapping("/page")
|
|
|
|
@RequestMapping("/page")
|
|
|
|
public R page(@RequestParam Map<String, Object> params,ConfigEntity config){
|
|
|
|
public R page(@RequestParam Map<String, Object> params,ConfigEntity config){
|
|
|
|
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
|
|
|
|
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
|
|
|
|
PageUtils page = configService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, config), params), params));
|
|
|
|
PageUtils page = configService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, config), params), params));
|
|
|
|
return R.ok().put("data", page);
|
|
|
|
return R.ok().put("data", page);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 列表
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@IgnoreAuth
|
|
|
|
@IgnoreAuth
|
|
|
|
@RequestMapping("/list")
|
|
|
|
@RequestMapping("/list")
|
|
|
|
public R list(@RequestParam Map<String, Object> params,ConfigEntity config){
|
|
|
|
public R list(@RequestParam Map<String, Object> params,ConfigEntity config){
|
|
|
@ -53,37 +46,24 @@ public class ConfigController{
|
|
|
|
return R.ok().put("data", page);
|
|
|
|
return R.ok().put("data", page);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 信息
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@RequestMapping("/info/{id}")
|
|
|
|
@RequestMapping("/info/{id}")
|
|
|
|
public R info(@PathVariable("id") String id){
|
|
|
|
public R info(@PathVariable("id") String id){
|
|
|
|
ConfigEntity config = configService.selectById(id);
|
|
|
|
ConfigEntity config = configService.selectById(id);
|
|
|
|
return R.ok().put("data", config);
|
|
|
|
return R.ok().put("data", config);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 详情
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@IgnoreAuth
|
|
|
|
@IgnoreAuth
|
|
|
|
@RequestMapping("/detail/{id}")
|
|
|
|
@RequestMapping("/detail/{id}")
|
|
|
|
public R detail(@PathVariable("id") String id){
|
|
|
|
public R detail(@PathVariable("id") String id){
|
|
|
|
ConfigEntity config = configService.selectById(id);
|
|
|
|
ConfigEntity config = configService.selectById(id);
|
|
|
|
return R.ok().put("data", config);
|
|
|
|
return R.ok().put("data", config);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 根据name获取信息
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@RequestMapping("/info")
|
|
|
|
@RequestMapping("/info")
|
|
|
|
public R infoByName(@RequestParam String name){
|
|
|
|
public R infoByName(@RequestParam String name){
|
|
|
|
ConfigEntity config = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
|
|
|
|
ConfigEntity config = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
|
|
|
|
return R.ok().put("data", config);
|
|
|
|
return R.ok().put("data", config);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 保存
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@PostMapping("/save")
|
|
|
|
@PostMapping("/save")
|
|
|
|
public R save(@RequestBody ConfigEntity config){
|
|
|
|
public R save(@RequestBody ConfigEntity config){
|
|
|
|
// ValidatorUtils.validateEntity(config);
|
|
|
|
// ValidatorUtils.validateEntity(config);
|
|
|
@ -91,19 +71,13 @@ public class ConfigController{
|
|
|
|
return R.ok();
|
|
|
|
return R.ok();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 修改
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@RequestMapping("/update")
|
|
|
|
@RequestMapping("/update")
|
|
|
|
public R update(@RequestBody ConfigEntity config){
|
|
|
|
public R update(@RequestBody ConfigEntity config){
|
|
|
|
// ValidatorUtils.validateEntity(config);
|
|
|
|
// ValidatorUtils.validateEntity(config);
|
|
|
|
configService.updateById(config);//全部更新
|
|
|
|
configService.updateById(config);//全部更新
|
|
|
|
return R.ok();
|
|
|
|
return R.ok();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 删除
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@RequestMapping("/delete")
|
|
|
|
@RequestMapping("/delete")
|
|
|
|
public R delete(@RequestBody Long[] ids){
|
|
|
|
public R delete(@RequestBody Long[] ids){
|
|
|
|
configService.deleteBatchIds(Arrays.asList(ids));
|
|
|
|
configService.deleteBatchIds(Arrays.asList(ids));
|
|
|
|