| | |
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.homemodule.SpecialMapper;
|
| | | import com.yeshi.fanli.dto.common.CommonContentTypeEnum;
|
| | | import com.yeshi.fanli.entity.AppVersionInfo;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.exception.homemodule.SpecialException;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.AppVersionService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialCardService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialPlaceService;
|
| | |
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | @Resource
|
| | | private AppVersionService appVersionService;
|
| | | |
| | |
|
| | | @Override
|
| | | public Special selectByPrimaryKey(Long id) {
|
| | | return specialMapper.selectByPrimaryKey(id);
|
| | |
| | | Integer sex = record.getSex();
|
| | | if (sex == null) {
|
| | | throw new SpecialException(1, "性别不能为空");
|
| | | }
|
| | |
|
| | | String version = record.getVersion();
|
| | | Integer platformCode = record.getPlatform();
|
| | | if (!StringUtil.isNullOrEmpty(version) && platformCode != null) {
|
| | | String platform = "android";
|
| | | if (platformCode == 2)
|
| | | platform = "ios";
|
| | | AppVersionInfo versionInfo = appVersionService.getByPlatformAndVersion(platform, version);
|
| | | if (versionInfo == null)
|
| | | throw new SpecialException(1, "版本号信息缺失");
|
| | | |
| | | record.setVersionCode(versionInfo.getVersionCode());
|
| | | record.setPlatform(platformCode);
|
| | | } else {
|
| | | if (!StringUtil.isNullOrEmpty(version))
|
| | | throw new SpecialException(1, "平台类型不能为空");
|
| | | |
| | | if (platformCode != null) |
| | | throw new SpecialException(1, "版本号不能为空");
|
| | | }
|
| | |
|
| | | String params = record.getParams();
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Cacheable(value = "specialCache", key = "'listByVersion-'+#start+'-'+#count+'-'+#card+'-'+#platform+'-'+#versionCode")
|
| | | public List<Special> listByVersion(long start, int count, String card, Integer platform, Integer versionCode) {
|
| | | return specialMapper.listByVersion(start, count, card, platform, versionCode);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | @Cacheable(value = "specialCache", key = "'listCacheSpecialToIndex'+#acceptData.platform+'-'+#acceptData.version+'-'+#sex")
|
| | | public JSONObject listCacheSpecialToIndex(AcceptData acceptData, Integer sex) throws Exception {
|
| | |
|