package com.liquidnet.service.platform.controller.ticketSystem;

import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.platform.param.ticketSystem.STFieldListParam;
import com.liquidnet.service.platform.param.ticketSystem.STInsertFieldParam;
import com.liquidnet.service.platform.service.ticketSystem.ITicketSystemService;
import com.liquidnet.service.platform.vo.ticketSystem.STAccessTokenVo;
import com.liquidnet.service.platform.vo.ticketSystem.STFieldChangeVo;
import com.liquidnet.service.platform.vo.ticketSystem.STFieldListVo;
import com.liquidnet.service.platform.vo.ticketSystem.STPTListVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;
import java.util.List;

@Api(tags = "票务平台")
@RestController
@RequestMapping("st")
public class TicketSystemController {

    @Autowired
    ITicketSystemService ticketSystemService;

    @PostMapping("performance")
    @ApiOperation("演出数据迁移")
    public ResponseDto<List<STPTListVo>> getPerformanceTypeList() {
        String accessToken = ticketSystemService.getAccessToken();
        List<STPTListVo> vo = ticketSystemService.getPerformanceTypeList(accessToken);
        return ResponseDto.success(vo);
    }

    @PostMapping("performance")
    @ApiOperation("演出数据迁移")
    public ResponseDto<List<STFieldListVo>> getFieldList(STFieldListParam fieldListParam) {
        String accessToken = ticketSystemService.getAccessToken();
        List<STFieldListVo> vo = ticketSystemService.getFieldList(accessToken, fieldListParam);
        return ResponseDto.success(vo);
    }

    @PostMapping("performance")
    @ApiOperation("演出数据迁移")
    public ResponseDto<STFieldChangeVo> getFieldList(STInsertFieldParam insertFieldParam) {
        String accessToken = ticketSystemService.getAccessToken();
        STFieldChangeVo vo = ticketSystemService.insertField(accessToken, insertFieldParam);
        return ResponseDto.success(vo);
    }
}
