|
@@ -1,6 +1,8 @@
|
|
|
package com.goafanti.demand.service.impl;
|
|
package com.goafanti.demand.service.impl;
|
|
|
|
|
|
|
|
import java.util.Calendar;
|
|
import java.util.Calendar;
|
|
|
|
|
+import java.util.HashMap;
|
|
|
|
|
+import java.util.Map;
|
|
|
import java.util.UUID;
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -8,9 +10,12 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import com.goafanti.common.dao.DemandInterestMapper;
|
|
import com.goafanti.common.dao.DemandInterestMapper;
|
|
|
import com.goafanti.common.model.DemandInterest;
|
|
import com.goafanti.common.model.DemandInterest;
|
|
|
|
|
+import com.goafanti.common.model.User;
|
|
|
import com.goafanti.core.mybatis.BaseMybatisDao;
|
|
import com.goafanti.core.mybatis.BaseMybatisDao;
|
|
|
|
|
+import com.goafanti.core.mybatis.page.Pagination;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
import com.goafanti.demand.service.DemandInterestService;
|
|
import com.goafanti.demand.service.DemandInterestService;
|
|
|
|
|
+import com.goafanti.portal.bo.DemandInterestListBo;
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
|
public class DemandInterestServiceImpl extends BaseMybatisDao<DemandInterestMapper> implements DemandInterestService {
|
|
public class DemandInterestServiceImpl extends BaseMybatisDao<DemandInterestMapper> implements DemandInterestService {
|
|
@@ -39,5 +44,24 @@ public class DemandInterestServiceImpl extends BaseMybatisDao<DemandInterestMapp
|
|
|
return demandInterestMapper.selectDemandInterestByUidAndDemandId(uid, id);
|
|
return demandInterestMapper.selectDemandInterestByUidAndDemandId(uid, id);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Pagination<DemandInterestListBo> listDemandInterest(Integer pNo, Integer pSize) {
|
|
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
|
|
+
|
|
|
|
|
+ if (pNo == null || pNo < 0) {
|
|
|
|
|
+ pNo = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (pSize == null || pSize < 0 || pSize > 10) {
|
|
|
|
|
+ pSize = 10;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (TokenManager.getToken() instanceof User) {
|
|
|
|
|
+ params.put("uid", TokenManager.getUserId());
|
|
|
|
|
+ }
|
|
|
|
|
+ return (Pagination<DemandInterestListBo>) findPage("findDemandInterestListByPage",
|
|
|
|
|
+ "findDemandInterestCount", params, pNo, pSize);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
}
|
|
}
|