推荐网址

This commit is contained in:
cyk 2023-12-25 13:28:47 +08:00
parent f7269cc5e2
commit 0dde2afb6c
5 changed files with 47 additions and 0 deletions

View File

@ -101,4 +101,22 @@ public class UrlListController {
} }
return JSONObject.toJSONString(result); 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);
}
} }

View File

@ -32,4 +32,6 @@ public interface UrlListDao {
public List<UrlList> selectUrListByNeedLogin(); public List<UrlList> selectUrListByNeedLogin();
public int deleteByCateId(Long id); public int deleteByCateId(Long id);
public List<UrlList> TopEight();
public List<UrlList> latestEight();
} }

View File

@ -18,4 +18,10 @@ public interface UrlListService {
public int deleteByPrimaryKey(Long id); public int deleteByPrimaryKey(Long id);
public int deleteByCateId(Long id); public int deleteByCateId(Long id);
public List<UrlList> TopEight();
public List<UrlList> latestEight();
} }

View File

@ -87,4 +87,8 @@ public class UrlLiserServiceImpl implements UrlListService {
{ {
return urlListDao.deleteByCateId(id); return urlListDao.deleteByCateId(id);
} }
public List<UrlList> TopEight(){return urlListDao.TopEight(); }
public List<UrlList> latestEight(){return urlListDao.latestEight(); }
} }

View File

@ -51,6 +51,23 @@
where name like concat('%',#{input},'%') where name like concat('%',#{input},'%')
</select> </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 id="selectUrlListByUrlId" parameterType="java.lang.Long" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />