hejianhao
2026-09-01 540ef65220e05b75c183cd3554aaeb554927600a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.tcm.training.admin.app.home.controller;
 
import com.tcm.training.admin.app.home.dto.CreateLiveRoomEntryRequest;
import com.tcm.training.admin.app.home.service.AppVzanLiveEntryService;
import com.tcm.training.admin.app.home.vo.AppVzanLiveEntryVO;
import com.tcm.training.admin.common.ApiResponse;
import com.tcm.training.admin.live.service.LiveRoomSettingService;
import com.tcm.training.admin.live.vo.LiveRoomSettingVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.validation.Valid;
 
 
@RestController
@RequestMapping({"/api/app/home", "/api/v1/app/home"})
public class AppLiveRoomSettingController {
    private final LiveRoomSettingService service;
    private final AppVzanLiveEntryService vzanLiveEntryService;
 
    public AppLiveRoomSettingController(LiveRoomSettingService service,
                                        AppVzanLiveEntryService vzanLiveEntryService) {
        this.service = service;
        this.vzanLiveEntryService = vzanLiveEntryService;
    }
 
    @GetMapping("/live-room-setting")
    public ApiResponse<LiveRoomSettingVO> current() {
        return ApiResponse.ok(service.current());
    }
 
    @PostMapping("/live-room-entry")
    public ApiResponse<AppVzanLiveEntryVO> createEntry(@Valid @RequestBody CreateLiveRoomEntryRequest request) {
        return ApiResponse.ok(vzanLiveEntryService.createEntry(request.getUserId()));
    }
}