package com.zanxiang.game.module.manage.controller.api;

import com.zanxiang.game.module.manage.pojo.params.ChatSubmitParam;
import com.zanxiang.game.module.manage.pojo.params.OpenGameServerParam;
import com.zanxiang.game.module.manage.service.api.CpServerApiService;
import com.zanxiang.module.util.pojo.ResultVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
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;

/**
 * @author : lingfeng
 * @time : 2024-04-25
 * @description : Cp服务端接口
 */
@RestController
@RequestMapping("/api")
@Slf4j
public class CpServerApi {

    @Autowired
    private CpServerApiService cpServerApiService;

    @PostMapping(value = "/chat/msg/submit")
    public ResultVO<Boolean> chatMsgSubmit(@Validated @RequestBody ChatSubmitParam param) {
        return ResultVO.ok(cpServerApiService.chatMsgSubmit(param));
    }

    @PostMapping(value = "/open/game/server")
    public ResultVO<Boolean> list(@Validated @RequestBody OpenGameServerParam param) {
        return ResultVO.ok(cpServerApiService.openGameServer(param));
    }
}
