fix(): 代码规范更改
parent
6b36dc5294
commit
8373c9ce1b
|
@ -61,7 +61,7 @@ public class BaseController {
|
|||
/**
|
||||
* 返回成功消息
|
||||
*/
|
||||
public Result success (Object data) {
|
||||
public <T> Result<T> success (T data) {
|
||||
return Result.success(data);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class SysConfigController extends BaseController {
|
|||
@PostMapping("/export")
|
||||
public void export (HttpServletResponse response, SysConfigListReq sysConfigListReq) {
|
||||
PageQueryModel<SysConfig> pageQueryModel = configService.pageQuery(SysConfigPageQueryModel.reqBuild(sysConfigListReq));
|
||||
ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
|
||||
ExcelUtil<SysConfig> util = new ExcelUtil<>(SysConfig.class);
|
||||
util.exportExcel(response, pageQueryModel.getDataList(), "参数数据");
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ public class SysConfigController extends BaseController {
|
|||
* 根据参数编号获取详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{configId}")
|
||||
public Result getInfo (@PathVariable("configId") Long configId) {
|
||||
public Result<SysConfig> getInfo (@PathVariable("configId") Long configId) {
|
||||
return success(configService.getById(configId));
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ public class SysConfigController extends BaseController {
|
|||
@RequiresPermissions("system:config:add")
|
||||
@Log(title = "参数管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add (@Validated @RequestBody SysConfigAddReq sysConfigAddReq) {
|
||||
public Result<String> add (@Validated @RequestBody SysConfigAddReq sysConfigAddReq) {
|
||||
if (!configService.checkConfigKeyUnique(sysConfigAddReq.getConfigKey())) {
|
||||
return error(StringUtils.format("新增参数「{}」失败,参数键名已存在",sysConfigAddReq.getConfigName()));
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ public class SysConfigController extends BaseController {
|
|||
@RequiresPermissions("system:config:edit")
|
||||
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{sysConfigId}")
|
||||
public Result edit (@PathVariable("sysConfigId")Long sysConfigId, @Validated @RequestBody SysConfigUpdReq sysConfigUpdReq) {
|
||||
public Result<String> edit (@PathVariable("sysConfigId")Long sysConfigId, @Validated @RequestBody SysConfigUpdReq sysConfigUpdReq) {
|
||||
if (!configService.checkConfigKeyUnique(sysConfigUpdReq.getConfigKey())) {
|
||||
return error("修改参数'" + sysConfigUpdReq.getConfigName() + "'失败,参数键名已存在");
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ public class SysConfigController extends BaseController {
|
|||
@RequiresPermissions("system:config:remove")
|
||||
@Log(title = "参数管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{configIds}")
|
||||
public Result remove (@PathVariable("configIds") Long[] configIds) {
|
||||
public Result<String> remove (@PathVariable("configIds") Long[] configIds) {
|
||||
configService.removeBatchByIds(Arrays.asList(configIds));
|
||||
return success();
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ public class SysConfigController extends BaseController {
|
|||
@RequiresPermissions("system:config:remove")
|
||||
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
|
||||
@DeleteMapping("/refreshCache")
|
||||
public Result refreshCache () {
|
||||
public Result<String> refreshCache () {
|
||||
configService.resetConfigCache();
|
||||
return success();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.muyu.system.domain.rep;
|
||||
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
|
@ -16,6 +16,11 @@ import java.util.List;
|
|||
public interface SysConfigService extends IService<SysConfig> {
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param pageQueryModel 查询模型
|
||||
* @return 查询结果
|
||||
*/
|
||||
PageQueryModel<SysConfig> pageQuery (SysConfigPageQueryModel pageQueryModel);
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue