Commit 123699ee authored by wuwz's avatar wuwz

热门商家

parent d76bf8b6
...@@ -172,4 +172,11 @@ public class BranchCompany { ...@@ -172,4 +172,11 @@ public class BranchCompany {
@Column(name = "is_del") @Column(name = "is_del")
private Integer isDel; private Integer isDel;
//浏览量
@Column(name = "browse_num")
private Integer browseNum;
//点赞数量
@Column(name = "give_num")
private Integer giveNum;
} }
\ No newline at end of file
...@@ -5,6 +5,7 @@ import cn.hutool.json.JSONUtil; ...@@ -5,6 +5,7 @@ import cn.hutool.json.JSONUtil;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.admin.dto.CompanySearchDTO; import com.github.wxiaoqi.security.admin.dto.CompanySearchDTO;
import com.github.wxiaoqi.security.admin.entity.AppUserRelation;
import com.github.wxiaoqi.security.admin.entity.BranchCompany; import com.github.wxiaoqi.security.admin.entity.BranchCompany;
import com.github.wxiaoqi.security.admin.mapper.BranchCompanyMapper; import com.github.wxiaoqi.security.admin.mapper.BranchCompanyMapper;
import com.github.wxiaoqi.security.admin.vo.CompanySearchVO; import com.github.wxiaoqi.security.admin.vo.CompanySearchVO;
...@@ -16,6 +17,7 @@ import com.xxfc.platform.universal.feign.MQSenderFeign; ...@@ -16,6 +17,7 @@ import com.xxfc.platform.universal.feign.MQSenderFeign;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import java.util.List; import java.util.List;
...@@ -72,6 +74,12 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany ...@@ -72,6 +74,12 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
} }
public ObjectRestResponse getHotCompany(Integer page,Integer limit){
Example example = new Example(BranchCompany.class);
example.orderBy("browseNum").asc();
PageDataVO<BranchCompany> pageDataVO = PageDataVO.pageInfo(page, limit, () -> mapper.selectByExample(example));
return ObjectRestResponse.succ(pageDataVO);
}
} }
package com.github.wxiaoqi.security.admin.rest;
import com.github.wxiaoqi.security.admin.biz.BranchCompanyBiz;
import com.github.wxiaoqi.security.admin.biz.CompanyInfoApplyBiz;
import com.github.wxiaoqi.security.admin.biz.CompanyInfoOrderBiz;
import com.github.wxiaoqi.security.admin.entity.CompanyInfo;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @author Administrator
*/
@Slf4j
@RestController
@RequestMapping("app/branchCompany")
@RequiredArgsConstructor(onConstructor_ = {@Autowired})
@Api(tags = {"商家"})
public class AppBranchCompanyController extends BaseController<CompanyInfoApplyBiz> {
@Autowired
BranchCompanyBiz branchCompanyBiz;
@GetMapping("getHotCompany")
@ApiModelProperty("获取热门商家")
public ObjectRestResponse getHotCompany(@RequestParam("page") Integer page,
@RequestParam("limit") Integer limit) {
return ObjectRestResponse.succ(branchCompanyBiz.getHotCompany(page,limit));
}
}
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