You've already forked FrameTour-BE
支持用户切换景区账号,单账号多景区权限
This commit is contained in:
@@ -2,6 +2,7 @@ package com.ycwl.basic.controller.pc;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.ycwl.basic.mapper.ScenicAccountMapper;
|
||||
import com.ycwl.basic.model.pc.scenic.entity.ScenicAccountEntity;
|
||||
import com.ycwl.basic.model.pc.scenic.req.ScenicAccountReqQuery;
|
||||
import com.ycwl.basic.service.pc.ScenicAccountService;
|
||||
@@ -16,6 +17,8 @@ import java.util.List;
|
||||
public class ScenicAccountController {
|
||||
@Autowired
|
||||
private ScenicAccountService service;
|
||||
@Autowired
|
||||
private ScenicAccountMapper scenicAccountMapper;
|
||||
|
||||
// 添加景区账号
|
||||
@PostMapping("/add")
|
||||
@@ -62,6 +65,10 @@ public class ScenicAccountController {
|
||||
public ApiResponse<PageInfo<ScenicAccountEntity>> pageQuery(@RequestBody ScenicAccountReqQuery req) {
|
||||
PageHelper.startPage(req.getPageNum(), req.getPageSize());
|
||||
List<ScenicAccountEntity> list = service.pageQuery(req);
|
||||
list.forEach(entity -> {
|
||||
entity.setPassword("");
|
||||
entity.setScenicId(scenicAccountMapper.getAccountRelations(entity.getId()));
|
||||
});
|
||||
PageInfo<ScenicAccountEntity> pageInfo = new PageInfo<>(list);
|
||||
return ApiResponse.success(pageInfo);
|
||||
}
|
||||
|
Reference in New Issue
Block a user