package com.sw.mes.yb.seed.controller;

import com.sw.mes.yb.seed.dto.SeedGroupBracketDetailsDto;
import com.sw.mes.yb.seed.dto.SeedPlanOrderDto;
import com.sw.mes.yb.seed.entity.SeedGroupBracketDetails;
import com.sw.mes.yb.seed.entity.SeedPlanOrder;
import com.sw.mes.yb.seed.service.SeedGroupBracketDetailsService;
import com.sw.mes.yb.seed.service.SeedGroupBracketService;
import io.swagger.annotations.Api;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/seed/bracketDetails")
@Api(description = "籽晶组托明细接口")
@Transactional
public class SeedGroupBracketDetailsController {
    @Autowired
    ModelMapper modelMapper;
    @Autowired
    private SeedGroupBracketService seedGroupBracketService;
    @Autowired
    private SeedGroupBracketDetailsService seedGroupBracketDetailsService;


    public SeedGroupBracketDetailsDto toLazyDto(SeedGroupBracketDetails entity) {
        return modelMapper.map(entity, SeedGroupBracketDetailsDto.class);
    }

    public SeedGroupBracketDetailsDto toEagerDto(SeedGroupBracketDetails entity) {
        SeedGroupBracketDetailsDto dto = modelMapper.map(entity, SeedGroupBracketDetailsDto.class);
        return dto;
    }

    public SeedGroupBracketDetails fromDto(SeedGroupBracketDetailsDto dto) {
        return modelMapper.map(dto, SeedGroupBracketDetails.class);
    }
}
