Commit ba8a473e by 吴迪

【新增】请求gds接口限制

parent da037ca7
......@@ -873,4 +873,15 @@ public class NewsController extends AbstractController {
}
/**
* 获取专题数据
*/
@RequestMapping("/api/getTop9ByYear")
public R getTop9ByYear(@RequestBody Map<String,String> map){
List<NewsEntity> top9ByYear = newsService.getTop9ByYear(map.get("year"));
return R.ok().put("data", top9ByYear);
}
}
......@@ -113,4 +113,7 @@ public interface NewsDao extends BaseMapper<NewsEntity> {
List<Map<String, Object>> sydjwhTop4();
List<Map<String, Object>> sydjwhTop1();
List<NewsEntity> getTop9ByYear(@Param("year") String year);
}
......@@ -21,7 +21,7 @@ public class ClickDetailDTO implements Serializable {
/**
* 点击的知识id
*/
private Long cId;
private String cid;
/**
* $column.comments
*/
......
......@@ -9,7 +9,8 @@ import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.manage.vo.response.SearchVo;
import io.office.modules.sys.entity.SysUserEntity;
import java.util.*;
import java.util.List;
import java.util.Map;
/**
* ${comments}
......@@ -109,5 +110,8 @@ public interface NewsService extends IService<NewsEntity> {
List<Map<String, Object>> sydjwhTop4();
List<Map<String, Object>> sydjwhTop1();
List<NewsEntity> getTop9ByYear(String year);
}
package io.office.modules.manage.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.office.common.utils.PageUtils;
import io.office.common.utils.Query;
import io.office.common.utils.R;
import io.office.modules.manage.dao.NewsclassDao;
import io.office.modules.manage.dao.NewsDao;
import io.office.modules.manage.entity.*;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.manage.service.NewsService;
import io.office.modules.manage.vo.response.SearchVo;
import io.office.modules.sys.entity.SysUserEntity;
import lombok.extern.slf4j.Slf4j;
......@@ -17,15 +23,6 @@ import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.office.common.utils.PageUtils;
import io.office.common.utils.Query;
import io.office.modules.manage.dao.NewsDao;
import io.office.modules.manage.service.NewsService;
@Slf4j
@Service("newsService")
......@@ -643,5 +640,10 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
return retList;
}
@Override
public List<NewsEntity> getTop9ByYear(String year) {
return newsDao.getTop9ByYear(year);
}
}
......@@ -535,8 +535,8 @@
client_browser clientBrowser
from click_detail
<where>
<if test="clickDetailDTO.cId!=null and clickDetailDTO.cId!=''">
c_id = #{clickDetailDTO.cId}
<if test="clickDetailDTO.cid!=null and clickDetailDTO.cid!=''">
c_id = #{clickDetailDTO.cid}
</if>
<if test="clickDetailDTO.typeValue!=null and clickDetailDTO.typeValue!=''">
and type_Value = #{clickDetailDTO.typeValue}
......
......@@ -811,4 +811,11 @@ ORDER BY
levels DESC,
releasedate DESC
</select>
<select id="getTop9ByYear" parameterType="string" resultType="io.office.modules.manage.entity.NewsEntity">
select top 9 * from news where status=1 and levels>0 and classid = 6 and YEAR(publicdate) = #{year} ORDER BY levels DESC,id DESC
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment