|
@@ -4,6 +4,7 @@ import cn.kdan.pdf.backend.core.enums.LanguageEnum;
|
|
import cn.kdan.pdf.backend.core.mapper.AdvertisementsMapper;
|
|
import cn.kdan.pdf.backend.core.mapper.AdvertisementsMapper;
|
|
import cn.kdan.pdf.backend.core.model.Advertisements;
|
|
import cn.kdan.pdf.backend.core.model.Advertisements;
|
|
import cn.kdan.pdf.backend.core.model.AdvertisementsExample;
|
|
import cn.kdan.pdf.backend.core.model.AdvertisementsExample;
|
|
|
|
+import cn.kdan.pdf.backend.core.params.AddAdvertisementParam;
|
|
import cn.kdan.pdf.backend.core.params.QueryAdvertisementParam;
|
|
import cn.kdan.pdf.backend.core.params.QueryAdvertisementParam;
|
|
import cn.kdan.pdf.backend.core.pojo.app.AdvertisementVo;
|
|
import cn.kdan.pdf.backend.core.pojo.app.AdvertisementVo;
|
|
import cn.kdan.pdf.backend.core.properties.OssProperties;
|
|
import cn.kdan.pdf.backend.core.properties.OssProperties;
|
|
@@ -14,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.StringUtils;
|
|
import org.springframework.util.StringUtils;
|
|
|
|
+import utils.CommonUtils;
|
|
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
@@ -102,4 +104,15 @@ public class AdvertisementServiceImpl implements AdvertisementService {
|
|
advertisementsMapper.updateByPrimaryKey(adv);
|
|
advertisementsMapper.updateByPrimaryKey(adv);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public String add(AddAdvertisementParam param) {
|
|
|
|
+ Advertisements adv = new Advertisements();
|
|
|
|
+ adv.setId(CommonUtils.generateId());
|
|
|
|
+ BeanUtils.copyProperties(param, adv);
|
|
|
|
+ Date now = new Date();
|
|
|
|
+ adv.setCreatedAt(now);
|
|
|
|
+ adv.setUpdatedAt(now);
|
|
|
|
+ advertisementsMapper.insert(adv);
|
|
|
|
+ return "增加广告成功";
|
|
|
|
+ }
|
|
}
|
|
}
|