package com.cool.store.controller.webc;

import com.cool.store.dto.huoma.*;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.xinfa.XinFaBusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author suzhuhong
 * @Date 2025/11/5 17:49
 * @Version 1.0
 */
@RestController
@RequestMapping("/mini/xinfa")
@Api(tags = "小程序-信发")
@Slf4j
public class MiniXinFaController {

    @Resource
    XinFaBusinessService xinFaBusinessService;
    @ApiOperation("测试门店设备信息")
    @GetMapping("/getStoreXinFaDeviceDetail")
    public ResponseResult<List<StoreXinFaDeviceDetail>> getStoreXinFaDeviceDetail(@RequestParam("storeNum")String storeNum) {
        return ResponseResult.success(xinFaBusinessService.getStoreXinFaDeviceDetail(storeNum));
    }

    @ApiOperation("测试标签信息")
    @PostMapping("/getAccountAllTags")
    public ResponseResult<List<TagDetailDTO>> getAccountAllTags(@RequestBody AccountTagDTO tagDTO) {
        List<TagDetailDTO> accountAllTags = xinFaBusinessService.getAccountAllTags(tagDTO.getStoreNum(), tagDTO.getDeviceName());
        return ResponseResult.success(accountAllTags);
    }

    @ApiOperation("获取节目列表")
    @PostMapping("/getProgramList")
    public ResponseResult<List<ProgramResponseDTO>> getProgramList(@RequestBody ProgramReqDTO programReqDTO) {
        List<ProgramResponseDTO> accountAllTags = xinFaBusinessService.getProgramList(programReqDTO);
        return ResponseResult.success(accountAllTags);
    }

    @ApiOperation("发布/上架")
    @PostMapping("/publishProgram")
    public ResponseResult<Boolean> publishProgram(@RequestBody PublishDTO publishDTO) {
        Boolean publishStatus = xinFaBusinessService.publishProgram(publishDTO);
        return ResponseResult.success(publishStatus);
    }

}
