| | |
| | | |
| | | import com.ks.push.dao.BPushPlatformAppInfoDao; |
| | | import com.ks.push.pojo.DO.BPushPlatformAppInfo; |
| | | import com.ks.push.pojo.DO.PushPlatform; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | return bPushPlatformAppInfoDao.findList(query); |
| | | } |
| | | |
| | | /** |
| | | * 查询推送平台 |
| | | * |
| | | * @param appCode |
| | | * @param pushPlatform |
| | | * @return |
| | | */ |
| | | public BPushPlatformAppInfo selectByAppCodeAndPlatform(String appCode, PushPlatform pushPlatform) { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("appCode").is(appCode).and("platform").is(pushPlatform)); |
| | | return bPushPlatformAppInfoDao.findOne(query); |
| | | } |
| | | |
| | | |
| | | public String selectAppCode(String appId, PushPlatform pushPlatform) { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("pushAppInfo.appId").is(appId).and("platform").is(pushPlatform)); |
| | | BPushPlatformAppInfo appInfo = bPushPlatformAppInfoDao.findOne(query); |
| | | if (appInfo == null) { |
| | | return null; |
| | | } |
| | | return appInfo.getAppCode(); |
| | | } |
| | | |
| | | |
| | | } |