| | |
| | | package com.ks.lucky.service.impl; |
| | | |
| | | import com.ks.lucky.exception.LuckyActivityOpenInfoException; |
| | | import com.ks.lucky.mapper.LuckyActivityOpenInfoMapper; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityOpenInfo; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 活动开奖信息管理 |
| | |
| | | @Component |
| | | public class LuckyActivityOpenInfoManager { |
| | | |
| | | @Resource |
| | | private LuckyActivityOpenInfoMapper luckyActivityOpenInfoMapper; |
| | | |
| | | |
| | | /** |
| | | * 添加开奖信息 |
| | | * |
| | | * @param OpenInfo |
| | | * @param openInfo |
| | | * @throws LuckyActivityOpenInfoException |
| | | */ |
| | | public void addOpenInfo(LuckyActivityOpenInfo OpenInfo) throws LuckyActivityOpenInfoException { |
| | | |
| | | @Validated |
| | | public Long addOpenInfo(LuckyActivityOpenInfo openInfo) throws LuckyActivityOpenInfoException { |
| | | if (openInfo.getCreateTime() == null) { |
| | | openInfo.setCreateTime(new Date()); |
| | | } |
| | | luckyActivityOpenInfoMapper.insertSelective(openInfo); |
| | | return openInfo.getId(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改开奖信息 |
| | | * |
| | | * @param OpenInfo |
| | | * @param openInfo |
| | | * @throws LuckyActivityOpenInfoException |
| | | */ |
| | | public void updateOpenInfo(LuckyActivityOpenInfo OpenInfo) throws LuckyActivityOpenInfoException { |
| | | |
| | | public void updateOpenInfo(LuckyActivityOpenInfo openInfo) throws LuckyActivityOpenInfoException { |
| | | openInfo.setUpdateTime(new Date()); |
| | | luckyActivityOpenInfoMapper.updateByPrimaryKeySelective(openInfo); |
| | | } |
| | | |
| | | |
| | |
| | | public LuckyActivityOpenInfo getOpenInfo(Long activityId) { |
| | | |
| | | |
| | | return null; |
| | | return luckyActivityOpenInfoMapper.selectByActivityId(activityId); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public LuckyActivityOpenInfo getOpenInfoDetail(Long id) { |
| | | |
| | | return null; |
| | | return luckyActivityOpenInfoMapper.selectByPrimaryKey(id); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | |
| | | public void deleteOpenInfo(Long id) { |
| | | |
| | | luckyActivityOpenInfoMapper.deleteByPrimaryKey(id); |
| | | } |
| | | |
| | | |