
package com.tmerclub.cloud.platform.controller.platform;

import com.tmerclub.cloud.api.platform.constant.OfflineHandleEventType;
import com.tmerclub.cloud.api.platform.vo.OfflineHandleEventVO;
import com.tmerclub.cloud.common.response.ServerResponseEntity;
import com.tmerclub.cloud.platform.service.OfflineHandleEventService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author lth
 * @Date 2021/5/21 15:41
 */
@RestController("platformOfflineHandleEventController")
@RequestMapping("/p/offline_handle_event")
@Tag(name = "platform-下线处理事件信息")
public class OfflineHandleEventController {

    @Autowired
    private OfflineHandleEventService offlineHandleEventService;

    @GetMapping("/getOfflineHandleEventByShopId/{shopId}/{sysType}")
    @Operation(summary = "通过店铺id获取下线信息", description = "通过店铺id获取下线信息")
    public ServerResponseEntity<OfflineHandleEventVO> getOfflineHandleEventByShopId(@PathVariable("shopId") Long shopId, @PathVariable("sysType") Integer sysType) {
        OfflineHandleEventVO offlineHandleEvent = offlineHandleEventService.getProcessingEventByHandleTypeAndHandleId(OfflineHandleEventType.SHOP.getValue(), shopId, sysType);
        return ServerResponseEntity.success(offlineHandleEvent);
    }
}
