Selaa lähdekoodia

分会场管理

huwhois 4 vuotta sitten
vanhempi
commit
2aa7b61e05

+ 7 - 7
src/main/java/io/renren/modules/admin/controller/MeetingController.java

50
    @GetMapping("/info/{id}")
50
    @GetMapping("/info/{id}")
51
    @RequiresPermissions("admin:meeting:info")
51
    @RequiresPermissions("admin:meeting:info")
52
    public R info(@PathVariable("id") Long id){
52
    public R info(@PathVariable("id") Long id){
53
		MeetingEntity meeting = meetingService.getById(id);
53
        MeetingEntity meeting = meetingService.getById(id);
54
54
55
        return R.ok().put("meeting", meeting);
55
        return R.ok().put("meeting", meeting);
56
    }
56
    }
62
    @RequiresPermissions("admin:meeting:save")
62
    @RequiresPermissions("admin:meeting:save")
63
    public R save(@RequestBody MeetingEntity meeting){
63
    public R save(@RequestBody MeetingEntity meeting){
64
        meeting.setCreateTime(new Date());
64
        meeting.setCreateTime(new Date());
65
		meetingService.save(meeting);
65
        meetingService.save(meeting);
66
66
67
        return R.ok();
67
        return R.ok();
68
    }
68
    }
74
    @RequiresPermissions("admin:meeting:update")
74
    @RequiresPermissions("admin:meeting:update")
75
    public R update(@RequestBody MeetingEntity meeting){
75
    public R update(@RequestBody MeetingEntity meeting){
76
        meeting.setModifyTime(new Date());
76
        meeting.setModifyTime(new Date());
77
		meetingService.updateById(meeting);
77
        meetingService.updateById(meeting);
78
78
79
        return R.ok();
79
        return R.ok();
80
    }
80
    }
85
    @PostMapping("/delete")
85
    @PostMapping("/delete")
86
    @RequiresPermissions("admin:meeting:delete")
86
    @RequiresPermissions("admin:meeting:delete")
87
    public R delete(@RequestBody Long[] ids){
87
    public R delete(@RequestBody Long[] ids){
88
		meetingService.removeByIds(Arrays.asList(ids));
88
        meetingService.removeByIds(Arrays.asList(ids));
89
89
90
        return R.ok();
90
        return R.ok();
91
    }
91
    }
111
    @PostMapping("/savebranch")
111
    @PostMapping("/savebranch")
112
    @RequiresPermissions("admin:meeting:save")
112
    @RequiresPermissions("admin:meeting:save")
113
    public R saveBranch(@RequestBody MeetingEntity meeting){
113
    public R saveBranch(@RequestBody MeetingEntity meeting){
114
        if (meeting.getPid()==0L) {
115
            return R.error("会议父id(pid)不能为空");
114
        if (meeting.getPid()==null || meeting.getPid()==0L) {
115
            return R.error("会议父id(pid)不能为空或0");
116
        }
116
        }
117
117
118
        meeting.setCreateTime(new Date());
118
        meeting.setCreateTime(new Date());
119
		meetingService.save(meeting);
119
        meetingService.save(meeting);
120
120
121
        return R.ok();
121
        return R.ok();
122
    }
122
    }