package org.jeecg.modules.xcx.notice.service.impl;

import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.hotelnotice.entity.HotelNotice;
import org.jeecg.modules.hotelnotice.service.IHotelNoticeService;
import org.jeecg.modules.xcx.notice.service.INoticeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class NoticeServiceImpl implements INoticeService {

    @Resource
    private IHotelNoticeService hotelNoticeService;

    @Override
    public Result<?> getNotice() {
        HotelNotice notice = hotelNoticeService.getNotice();
        return Result.ok(notice);
    }

    @Override
    public Result<?> getNoticeDetail(String id) {
        HotelNotice hotelNotice = hotelNoticeService.lambdaQuery()
                .eq(HotelNotice::getDelFlag, 0)
                .eq(HotelNotice::getId, id)
                .one();
        return Result.OK(hotelNotice);
    }
}
