package com.playlet.web.service.app.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.playlet.common.utils.DateUtils;
import com.playlet.system.domain.PlayletUserTask;
import com.playlet.system.service.IPlayletUserTaskService;
import com.playlet.web.service.app.PlayletUserTaskAppService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Date: 2024-03-22 12:13
 * @Author: 但星霖
 * @Version: v1.0
 * @Description: 任务用户app Service接口实现
 */
@Slf4j
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class PlayletUserTaskAppServiceImpl implements PlayletUserTaskAppService {

    private final IPlayletUserTaskService service;

    @Override
    public List<PlayletUserTask> searchByTaskIdList(Long taskId) {
        return service.searchByTaskIdList(taskId);
    }

    /**
     * 查询短剧用户任务
     *
     * @param id 短剧用户任务主键
     * @return 短剧用户任务
     */
    @Override
    public PlayletUserTask selectPlayletUserTaskById(Long id) {
        return service.selectPlayletUserTaskById(id);
    }

    /**
     * 查询短剧用户任务列表
     *
     * @param playletUserTask 短剧用户任务
     * @return 短剧用户任务
     */
    @Override
    public List<PlayletUserTask> selectPlayletUserTaskList(PlayletUserTask playletUserTask) {
        return service.selectPlayletUserTaskList(playletUserTask);
    }

    /**
     * 新增短剧用户任务
     *
     * @param playletUserTask 短剧用户任务
     * @return 结果
     */
    @Override
    public int insertPlayletUserTask(PlayletUserTask playletUserTask) {
        playletUserTask.setCreateTime(DateUtils.getNowDate());
        return service.insertPlayletUserTask(playletUserTask);
    }

    /**
     * 修改短剧用户任务
     *
     * @param playletUserTask 短剧用户任务
     * @return 结果
     */
    @Override
    public int updatePlayletUserTask(PlayletUserTask playletUserTask) {
        playletUserTask.setUpdateTime(DateUtils.getNowDate());
        return service.updatePlayletUserTask(playletUserTask);
    }

    /**
     * 批量删除短剧用户任务
     *
     * @param ids 需要删除的短剧用户任务主键
     * @return 结果
     */
    @Override
    public int deletePlayletUserTaskByIds(String ids) {
        return service.deletePlayletUserTaskByIds(ids);
    }

    /**
     * 删除短剧用户任务信息
     *
     * @param id 短剧用户任务主键
     * @return 结果
     */
    @Override
    public int deletePlayletUserTaskById(Long id) {
        return service.deletePlayletUserTaskById(id);
    }
}
