package com.sikey.wa04.api.websocket.client.mcDisk;

import com.sikey.wa04.business.application.service.message.McDiskMessageService;
import com.sikey.wa04.business.infrastructure.configuration.ProjectContextConstant;
import com.sikey.wa04.business.infrastructure.dto.response.messaging.MessagingPublishResponse;
import com.sikey.wa04.common.BaseController;
import com.sikey.wa04.common.dto.message.ActivateCloudPhotoAlbumMessage;
import com.sikey.wa04.common.dto.message.ReloginOnWwatchMessage;
import jakarta.annotation.Resource;
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: nelson
 * @Date: 2025/7/3
 * @Description: 移动云盘
 */
@RestController
@RequestMapping(ProjectContextConstant.MESSAGE_URL + "/messaging/publish")
public class McDiskMessageController extends BaseController {

    @Resource
    private McDiskMessageService mcDiskMessageService;

    /**
     * 手表重新登录
     *
     * @param request 请求
     * @return
     */
    @PostMapping("/reloginWatch")
    public MessagingPublishResponse reloginOnWwatch(
            @Validated @RequestBody ReloginOnWwatchMessage request) {
        mcDiskMessageService.reloginOnWwatch(request);
        return new MessagingPublishResponse();
    }

    /**
     * 通知手表开通云相册服务
     *
     * @param request 请求
     * @return
     */
    @PostMapping("/activateCloudPhotoAlbum")
    public MessagingPublishResponse activateCloudPhotoAlbum(
            @Validated @RequestBody ActivateCloudPhotoAlbumMessage request) {
        mcDiskMessageService.activateCloudPhotoAlbum(request);
        return new MessagingPublishResponse();
    }

}
