package com.iailab.module.shasteel.service.demo; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.util.object.BeanUtils; import com.iailab.module.shasteel.controller.admin.demo.vo.DemoPageReqVO; import com.iailab.module.shasteel.controller.admin.demo.vo.DemoSaveReqVO; import com.iailab.module.shasteel.dal.dataobject.demo.DemoDO; import com.iailab.module.shasteel.dal.mysql.demo.DemoMapper; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import javax.annotation.Resource; /** * @author PanZhibao * @Description * @createTime 2024年08月17日 */ @Service @Slf4j public class DemoServiceImpl implements DemoService { @Resource private DemoMapper demoMapper; @Override public Long create(DemoSaveReqVO createReqVO) { DemoDO demo = BeanUtils.toBean(createReqVO, DemoDO.class); demoMapper.insert(demo); return demo.getId(); } @Override public Long update(DemoSaveReqVO createReqVO) { DemoDO demo = BeanUtils.toBean(createReqVO, DemoDO.class); demoMapper.updateById(demo); return demo.getId(); } @Override public void delete(Long id) { demoMapper.deleteById(id); } @Override public DemoDO getInfo(Long id) { return demoMapper.selectById(id); } @Override public PageResult getPage(DemoPageReqVO pageReqVO) { return demoMapper.selectPage(pageReqVO); } }