whycxzp
2021-10-12 d5cf76188ad37f062f37ebce3464097203b4db05
src/main/java/com/whyc/controller/ApplicationController.java
@@ -24,34 +24,55 @@
    @Autowired
    private ApplicationService service;
    /*======应用管理,admin才有权限更改======*/
    /*======应用管理======*/
    @PostMapping
    @ApiOperation(value = "应用-创建")
    public Response create(@RequestBody ApplicationDTO app){
    public Response create(@RequestBody Application app){
        return service.insert(app);
    }
    @GetMapping("all")
    @ApiOperation(value = "应用-查询所有")
    public Response getAll(){
        return service.getAll();
    public Response getAll(@RequestParam Integer userId){
        return service.getAll(userId);
    }
    /**TODO:需要添加操作日志*/
    /**
     * 如果更新的为默认布局,则复制默认布局为当前用户布局
     */
    @PutMapping
    @ApiOperation(value = "应用-更新名称")
    public Response update(@RequestBody ApplicationDTO app){
    public Response update(@RequestBody Application app){
        return service.update(app);
    }
    /**TODO:需要添加操作日志*/
    @DeleteMapping
    @ApiOperation(value = "应用-删除")
    public Response delete(@RequestBody ApplicationDTO app){
        return service.delete(app);
    public Response delete(@RequestParam Integer appId){
        return service.delete(appId);
    }
    @PutMapping("active")
    @ApiOperation(value = "应用-设置激活")
    public Response updateActive(@RequestBody Application app){
        return service.updateActive(app);
    }
    /**
     * 针对每个用户的<默认应用布局>这一功能,查询时,如果没有激活的应用,则展示 默认应用布局
     */
    @GetMapping("active")
    @ApiOperation(value = "应用-查询当前激活")
    public Response getActive(@RequestParam Integer userId){
        return service.getActive(userId);
    }
    /*======应用配置======*/
    /**
     * 不允许appId=0的应用进行修改,需要先重命名应用
     * @param configDTO
     * @return
     */
    @PostMapping("config")
    @ApiOperation(value = "配置-保存当前应用的配置")
    public Response saveConfig(@RequestBody ApplicationConfigDTO configDTO){
@@ -61,7 +82,8 @@
    @GetMapping("allConfig")
    @ApiOperation(value = "配置-查询当前应用的配置")
    public Response getAllConfig(@RequestParam int appId,@RequestParam int userId){
        return service.getAllConfig(appId,userId);
    public Response getAllConfig(@RequestParam Integer appId){
        return service.getAllConfig(appId);
    }
}