推荐网址
This commit is contained in:
parent
f7269cc5e2
commit
0dde2afb6c
@ -101,4 +101,22 @@ public class UrlListController {
|
||||
}
|
||||
return JSONObject.toJSONString(result);
|
||||
}
|
||||
@RequestMapping("/recommendLatestUrl")
|
||||
public String recommendLatestUrl()
|
||||
{
|
||||
HashMap<String, Object> result = new HashMap<>();
|
||||
result.put("code", 200);
|
||||
result.put("msg", "处理成功");
|
||||
result.put("data",urlListService.latestEight());
|
||||
return JSONObject.toJSONString(result);
|
||||
}
|
||||
@RequestMapping("/recommendTopEightUrl")
|
||||
public String recommendTopEightUrl()
|
||||
{
|
||||
HashMap<String, Object> result = new HashMap<>();
|
||||
result.put("code", 200);
|
||||
result.put("msg", "处理成功");
|
||||
result.put("data",urlListService.TopEight());
|
||||
return JSONObject.toJSONString(result);
|
||||
}
|
||||
}
|
||||
|
@ -32,4 +32,6 @@ public interface UrlListDao {
|
||||
public List<UrlList> selectUrListByNeedLogin();
|
||||
|
||||
public int deleteByCateId(Long id);
|
||||
public List<UrlList> TopEight();
|
||||
public List<UrlList> latestEight();
|
||||
}
|
@ -18,4 +18,10 @@ public interface UrlListService {
|
||||
public int deleteByPrimaryKey(Long id);
|
||||
|
||||
public int deleteByCateId(Long id);
|
||||
|
||||
|
||||
public List<UrlList> TopEight();
|
||||
|
||||
|
||||
public List<UrlList> latestEight();
|
||||
}
|
||||
|
@ -87,4 +87,8 @@ public class UrlLiserServiceImpl implements UrlListService {
|
||||
{
|
||||
return urlListDao.deleteByCateId(id);
|
||||
}
|
||||
|
||||
public List<UrlList> TopEight(){return urlListDao.TopEight(); }
|
||||
|
||||
public List<UrlList> latestEight(){return urlListDao.latestEight(); }
|
||||
}
|
||||
|
@ -51,6 +51,23 @@
|
||||
where name like concat('%',#{input},'%')
|
||||
</select>
|
||||
|
||||
<select id="TopEight" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from ln_url_list
|
||||
where need_login = 1
|
||||
order by views limit 8
|
||||
</select>
|
||||
|
||||
<select id="latestEight" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from ln_url_list
|
||||
where need_login = 1
|
||||
order by createtime limit 8
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectUrlListByUrlId" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
|
Loading…
Reference in New Issue
Block a user