package com.bomaos.designer.service.impl;

import com.bomaos.designer.mapper.DesignerMapper;
import com.bomaos.designer.model.DesignerWork;
import com.bomaos.designer.service.DesignerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class DesignerServiceImpl implements DesignerService {

    @Autowired
    private DesignerMapper designerMapper;

    @Override
    public void uploadDesign(DesignerWork work) {
        work.setUploadTime(LocalDateTime.now());
        designerMapper.uploadDesign(work);
    }

    @Override
    public List<DesignerWork> getDesignsByDesigner(Integer designerId) {
        return designerMapper.findByDesignerId(designerId);
    }
}
