大屏项目初始化

This commit is contained in:
2026-03-05 23:17:02 +08:00
parent 3422f7d4cc
commit a56cbbb078
8 changed files with 28 additions and 33 deletions

View File

@@ -1,13 +1,13 @@
package com.mini.mybigscreen.biz.controller; 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.Message;
import com.mini.mybigscreen.Model.Result; import com.mini.mybigscreen.Model.Result;
import com.mini.mybigscreen.biz.domain.HomeModule; import com.mini.mybigscreen.biz.domain.HomeModule;
import com.mini.mybigscreen.biz.domain.HomeModuleUser; import com.mini.mybigscreen.biz.domain.HomeModuleUser;
import com.mini.mybigscreen.biz.domain.HomeUser; import com.mini.mybigscreen.biz.domain.HomeUser;
import com.mini.mybigscreen.biz.service.HomeModuleService; import com.mini.mybigscreen.biz.service.HomeModuleService;
import com.mini.mybigscreen.biz.service.HomeModuleUserService;
import com.mini.mybigscreen.biz.service.HomeUserService; import com.mini.mybigscreen.biz.service.HomeUserService;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
@@ -17,8 +17,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/** /**
* <p> * <p>
@@ -39,27 +37,24 @@ public class HomeModuleUserController {
@Resource @Resource
private HomeModuleService moduleService; private HomeModuleService moduleService;
@Resource
private HomeModuleUserService moduleUserService;
@GetMapping("list") @GetMapping("list")
public Result<List<HomeModule>> getList(HttpServletRequest request) { public Result<List<HomeModule>> getList(HttpServletRequest request) {
HttpSession session = request.getSession(false); HttpSession session = request.getSession(false);
String userName = (String) session.getAttribute("userName"); String userName = (String) session.getAttribute("userName");
QueryWrapper<HomeUser> userQuery = new QueryWrapper<>(); LambdaQueryWrapper<HomeUser> userQuery = new LambdaQueryWrapper<HomeUser>()
userQuery.eq("user_name", userName); .eq(HomeUser::getUserName, userName);
HomeUser user = userService.getOne(userQuery); HomeUser user = userService.getOne(userQuery);
QueryWrapper<HomeModuleUser> moduleUserQuery = new QueryWrapper<>(); MPJLambdaWrapper<HomeModule> wrapper = new MPJLambdaWrapper<HomeModule>()
moduleUserQuery.eq("user_id", user.getUserId()) .selectAll(HomeModule.class)
.eq("ustatus","1"); .leftJoin(HomeModuleUser.class,
List<HomeModuleUser> homeModuleUserList = moduleUserService.list(moduleUserQuery); HomeModuleUser::getModuleId,
QueryWrapper<HomeModule> moduleQuery = new QueryWrapper<>(); HomeModule::getModuleId)
moduleQuery.in("module_id", homeModuleUserList.stream() .eq(HomeModuleUser::getUserId, user.getUserId())
.map(HomeModuleUser::getModuleId) .eq(HomeModuleUser::getUstatus, "1")
.filter(Objects::nonNull) .isNotNull(HomeModule::getModuleId);
.collect(Collectors.toList())); List<HomeModule> moduleList = moduleService.list(wrapper);
return Result.success(moduleService.list(moduleQuery)); return Result.success(moduleList);
} }

View File

@@ -1,7 +1,7 @@
package com.mini.mybigscreen.biz.mapper; package com.mini.mybigscreen.biz.mapper;
import com.github.yulichang.base.MPJBaseMapper;
import com.mini.mybigscreen.biz.domain.Company; import com.mini.mybigscreen.biz.domain.Company;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/** /**
* <p> * <p>
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author gaoxq * @author gaoxq
* @since 2026-03-03 * @since 2026-03-03
*/ */
public interface CompanyMapper extends BaseMapper<Company> { public interface CompanyMapper extends MPJBaseMapper<Company> {
} }

View File

@@ -1,7 +1,7 @@
package com.mini.mybigscreen.biz.mapper; package com.mini.mybigscreen.biz.mapper;
import com.github.yulichang.base.MPJBaseMapper;
import com.mini.mybigscreen.biz.domain.HomeRole; import com.mini.mybigscreen.biz.domain.HomeRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/** /**
* <p> * <p>
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author gaoxq * @author gaoxq
* @since 2026-03-05 * @since 2026-03-05
*/ */
public interface HomeRoleMapper extends BaseMapper<HomeRole> { public interface HomeRoleMapper extends MPJBaseMapper<HomeRole> {
} }

View File

@@ -1,7 +1,7 @@
package com.mini.mybigscreen.biz.mapper; package com.mini.mybigscreen.biz.mapper;
import com.github.yulichang.base.MPJBaseMapper;
import com.mini.mybigscreen.biz.domain.HomeRoleMenu; import com.mini.mybigscreen.biz.domain.HomeRoleMenu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/** /**
* <p> * <p>
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author gaoxq * @author gaoxq
* @since 2026-03-05 * @since 2026-03-05
*/ */
public interface HomeRoleMenuMapper extends BaseMapper<HomeRoleMenu> { public interface HomeRoleMenuMapper extends MPJBaseMapper<HomeRoleMenu> {
} }

View File

@@ -1,7 +1,7 @@
package com.mini.mybigscreen.biz.mapper; package com.mini.mybigscreen.biz.mapper;
import com.github.yulichang.base.MPJBaseMapper;
import com.mini.mybigscreen.biz.domain.IndexInfo; import com.mini.mybigscreen.biz.domain.IndexInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/** /**
* <p> * <p>
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author gaoxq * @author gaoxq
* @since 2026-03-02 * @since 2026-03-02
*/ */
public interface IndexInfoMapper extends BaseMapper<IndexInfo> { public interface IndexInfoMapper extends MPJBaseMapper<IndexInfo> {
} }

View File

@@ -1,7 +1,7 @@
package com.mini.mybigscreen.biz.mapper; package com.mini.mybigscreen.biz.mapper;
import com.github.yulichang.base.MPJBaseMapper;
import com.mini.mybigscreen.biz.domain.ItemInfo; import com.mini.mybigscreen.biz.domain.ItemInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/** /**
* <p> * <p>
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author gaoxq * @author gaoxq
* @since 2026-02-24 * @since 2026-02-24
*/ */
public interface ItemInfoMapper extends BaseMapper<ItemInfo> { public interface ItemInfoMapper extends MPJBaseMapper<ItemInfo> {
} }

View File

@@ -1,7 +1,7 @@
package com.mini.mybigscreen.biz.mapper; package com.mini.mybigscreen.biz.mapper;
import com.github.yulichang.base.MPJBaseMapper;
import com.mini.mybigscreen.biz.domain.ResumeEmployee; import com.mini.mybigscreen.biz.domain.ResumeEmployee;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/** /**
* <p> * <p>
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author gaoxq * @author gaoxq
* @since 2026-03-03 * @since 2026-03-03
*/ */
public interface ResumeEmployeeMapper extends BaseMapper<ResumeEmployee> { public interface ResumeEmployeeMapper extends MPJBaseMapper<ResumeEmployee> {
} }

View File

@@ -1,7 +1,7 @@
package com.mini.mybigscreen.biz.mapper; package com.mini.mybigscreen.biz.mapper;
import com.github.yulichang.base.MPJBaseMapper;
import com.mini.mybigscreen.biz.domain.WebsiteStorage; import com.mini.mybigscreen.biz.domain.WebsiteStorage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/** /**
* <p> * <p>
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author gaoxq * @author gaoxq
* @since 2026-03-03 * @since 2026-03-03
*/ */
public interface WebsiteStorageMapper extends BaseMapper<WebsiteStorage> { public interface WebsiteStorageMapper extends MPJBaseMapper<WebsiteStorage> {
} }