大屏项目初始化
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
package com.mini.mybigscreen.biz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.mini.mybigscreen.Model.Message;
|
||||
import com.mini.mybigscreen.Model.Result;
|
||||
import com.mini.mybigscreen.biz.domain.HomeModule;
|
||||
import com.mini.mybigscreen.biz.domain.HomeModuleUser;
|
||||
import com.mini.mybigscreen.biz.domain.HomeUser;
|
||||
import com.mini.mybigscreen.biz.service.HomeModuleService;
|
||||
import com.mini.mybigscreen.biz.service.HomeModuleUserService;
|
||||
import com.mini.mybigscreen.biz.service.HomeUserService;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
@@ -17,8 +17,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -39,27 +37,24 @@ public class HomeModuleUserController {
|
||||
@Resource
|
||||
private HomeModuleService moduleService;
|
||||
|
||||
@Resource
|
||||
private HomeModuleUserService moduleUserService;
|
||||
|
||||
|
||||
@GetMapping("list")
|
||||
public Result<List<HomeModule>> getList(HttpServletRequest request) {
|
||||
HttpSession session = request.getSession(false);
|
||||
String userName = (String) session.getAttribute("userName");
|
||||
QueryWrapper<HomeUser> userQuery = new QueryWrapper<>();
|
||||
userQuery.eq("user_name", userName);
|
||||
LambdaQueryWrapper<HomeUser> userQuery = new LambdaQueryWrapper<HomeUser>()
|
||||
.eq(HomeUser::getUserName, userName);
|
||||
HomeUser user = userService.getOne(userQuery);
|
||||
QueryWrapper<HomeModuleUser> moduleUserQuery = new QueryWrapper<>();
|
||||
moduleUserQuery.eq("user_id", user.getUserId())
|
||||
.eq("ustatus","1");
|
||||
List<HomeModuleUser> homeModuleUserList = moduleUserService.list(moduleUserQuery);
|
||||
QueryWrapper<HomeModule> moduleQuery = new QueryWrapper<>();
|
||||
moduleQuery.in("module_id", homeModuleUserList.stream()
|
||||
.map(HomeModuleUser::getModuleId)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList()));
|
||||
return Result.success(moduleService.list(moduleQuery));
|
||||
MPJLambdaWrapper<HomeModule> wrapper = new MPJLambdaWrapper<HomeModule>()
|
||||
.selectAll(HomeModule.class)
|
||||
.leftJoin(HomeModuleUser.class,
|
||||
HomeModuleUser::getModuleId,
|
||||
HomeModule::getModuleId)
|
||||
.eq(HomeModuleUser::getUserId, user.getUserId())
|
||||
.eq(HomeModuleUser::getUstatus, "1")
|
||||
.isNotNull(HomeModule::getModuleId);
|
||||
List<HomeModule> moduleList = moduleService.list(wrapper);
|
||||
return Result.success(moduleList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mini.mybigscreen.biz.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.mini.mybigscreen.biz.domain.Company;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
* @author gaoxq
|
||||
* @since 2026-03-03
|
||||
*/
|
||||
public interface CompanyMapper extends BaseMapper<Company> {
|
||||
public interface CompanyMapper extends MPJBaseMapper<Company> {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mini.mybigscreen.biz.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.mini.mybigscreen.biz.domain.HomeRole;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
* @author gaoxq
|
||||
* @since 2026-03-05
|
||||
*/
|
||||
public interface HomeRoleMapper extends BaseMapper<HomeRole> {
|
||||
public interface HomeRoleMapper extends MPJBaseMapper<HomeRole> {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mini.mybigscreen.biz.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.mini.mybigscreen.biz.domain.HomeRoleMenu;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
* @author gaoxq
|
||||
* @since 2026-03-05
|
||||
*/
|
||||
public interface HomeRoleMenuMapper extends BaseMapper<HomeRoleMenu> {
|
||||
public interface HomeRoleMenuMapper extends MPJBaseMapper<HomeRoleMenu> {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mini.mybigscreen.biz.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.mini.mybigscreen.biz.domain.IndexInfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
* @author gaoxq
|
||||
* @since 2026-03-02
|
||||
*/
|
||||
public interface IndexInfoMapper extends BaseMapper<IndexInfo> {
|
||||
public interface IndexInfoMapper extends MPJBaseMapper<IndexInfo> {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mini.mybigscreen.biz.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.mini.mybigscreen.biz.domain.ItemInfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
* @author gaoxq
|
||||
* @since 2026-02-24
|
||||
*/
|
||||
public interface ItemInfoMapper extends BaseMapper<ItemInfo> {
|
||||
public interface ItemInfoMapper extends MPJBaseMapper<ItemInfo> {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mini.mybigscreen.biz.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.mini.mybigscreen.biz.domain.ResumeEmployee;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
* @author gaoxq
|
||||
* @since 2026-03-03
|
||||
*/
|
||||
public interface ResumeEmployeeMapper extends BaseMapper<ResumeEmployee> {
|
||||
public interface ResumeEmployeeMapper extends MPJBaseMapper<ResumeEmployee> {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mini.mybigscreen.biz.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.mini.mybigscreen.biz.domain.WebsiteStorage;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
* @author gaoxq
|
||||
* @since 2026-03-03
|
||||
*/
|
||||
public interface WebsiteStorageMapper extends BaseMapper<WebsiteStorage> {
|
||||
public interface WebsiteStorageMapper extends MPJBaseMapper<WebsiteStorage> {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user