Merge branch 'master' of https://gitea.zianxin.com/zax/biz-api-cloud
This commit is contained in:
commit
ee1736ccf8
15 files changed
+754
No files matched your search
+39
@@ -0,0 +1,39 @@
|
||||
package com.bsd.pjcloud.integrated.vo.banner;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* App端/外部系统轮播图VO
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-01-27
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "App端轮播图VO")
|
||||
public class SysBannerAppVo {
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "图片地址")
|
||||
private String imageUrl;
|
||||
|
||||
@Schema(description = "跳转类型:1-内部页面 2-外部链接 3-不跳转")
|
||||
private Integer jumpType;
|
||||
|
||||
@Schema(description = "跳转值(页面路径/外部链接)")
|
||||
private String jumpValue;
|
||||
|
||||
@Schema(description = "跳转参数JSON格式")
|
||||
private String params;
|
||||
|
||||
@Schema(description = "富文本内容(跳转到自编辑富文本页面时使用)")
|
||||
private String richTextContent;
|
||||
|
||||
@Schema(description = "排序序号")
|
||||
private Integer sortOrder;
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.bsd.pjcloud.integrated.vo.banner;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 轮播图详情VO(标题+富文本)
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-01-27
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "轮播图详情VO-标题与富文本")
|
||||
public class SysBannerDetailVo {
|
||||
|
||||
@Schema(description = "标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "富文本内容")
|
||||
private String richTextContent;
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.bsd.pjcloud.integrated.vo.internalpage;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 内部页面下拉选项VO
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-01-27
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "内部页面下拉选项")
|
||||
public class SysInternalPageSelectVo {
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "页面全路径(选后填到轮播图 jump_value)")
|
||||
private String path;
|
||||
|
||||
@Schema(description = "页面名称/显示名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "所属模块/分包名称")
|
||||
private String moduleLabel;
|
||||
}
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
package com.bsd.pjcloud.integrated.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.integrated.config.ExternalAppConfig;
|
||||
import com.bsd.pjcloud.integrated.entity.SysBannerEntity;
|
||||
import com.bsd.pjcloud.integrated.service.SysBannerService;
|
||||
import com.bsd.pjcloud.integrated.vo.banner.SysBannerAppVo;
|
||||
import com.bsd.pjcloud.integrated.vo.banner.SysBannerDetailVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 轮播图管理
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-01-27
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/sysBanner")
|
||||
@Tag(description = "sysBanner", name = "轮播图管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysBannerController {
|
||||
|
||||
private final SysBannerService sysBannerService;
|
||||
private final ExternalAppConfig externalAppConfig;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询轮播图")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('integrated_sysBanner_view')")
|
||||
public R getPage(@ParameterObject Page page, @ParameterObject SysBannerEntity sysBanner) {
|
||||
LambdaQueryWrapper<SysBannerEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.like(StrUtil.isNotBlank(sysBanner.getTitle()), SysBannerEntity::getTitle, sysBanner.getTitle())
|
||||
.eq(sysBanner.getStatus() != null, SysBannerEntity::getStatus, sysBanner.getStatus())
|
||||
.orderByAsc(SysBannerEntity::getSortOrder)
|
||||
.orderByDesc(SysBannerEntity::getCreateTime);
|
||||
return R.ok(sysBannerService.page(page, wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询轮播图")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('integrated_sysBanner_view')")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(sysBannerService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据轮播图id查询标题和富文本详情
|
||||
*/
|
||||
@Operation(summary = "轮播图详情", description = "根据轮播图id查询标题和富文本内容")
|
||||
@GetMapping("/detail/{id}")
|
||||
public R<SysBannerDetailVo> getDetailById(@PathVariable("id") Long id) {
|
||||
SysBannerEntity entity = sysBannerService.getById(id);
|
||||
if (entity == null) {
|
||||
return R.failed("轮播图不存在");
|
||||
}
|
||||
SysBannerDetailVo vo = new SysBannerDetailVo();
|
||||
vo.setTitle(entity.getTitle());
|
||||
vo.setRichTextContent(entity.getRichTextContent());
|
||||
return R.ok(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@Operation(summary = "新增轮播图", description = "新增轮播图")
|
||||
@SysLog("新增轮播图")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('integrated_sysBanner_add')")
|
||||
public R save(@RequestBody SysBannerEntity sysBanner) {
|
||||
return R.ok(sysBannerService.save(sysBanner));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@Operation(summary = "修改轮播图", description = "修改轮播图")
|
||||
@SysLog("修改轮播图")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('integrated_sysBanner_edit')")
|
||||
public R updateById(@RequestBody SysBannerEntity sysBanner) {
|
||||
return R.ok(sysBannerService.updateById(sysBanner));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*/
|
||||
@Operation(summary = "通过id删除", description = "通过id删除轮播图")
|
||||
@SysLog("通过id删除轮播图")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('integrated_sysBanner_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(sysBannerService.removeByIds(java.util.Arrays.asList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 外部系统/App端轮播图接口
|
||||
* 提供安全的API访问,用于其他系统或App展示轮播图
|
||||
* @param appId 应用ID
|
||||
* @param appSecret 应用密钥
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "外部系统轮播图接口", description = "提供安全的API访问,用于其他系统或App展示轮播图")
|
||||
@GetMapping("/app/list")
|
||||
@Inner(value = false)
|
||||
public R<List<SysBannerAppVo>> appList(
|
||||
@RequestHeader(value = "X-App-Id", required = false) String appId,
|
||||
@RequestHeader(value = "X-App-Secret", required = false) String appSecret) {
|
||||
|
||||
// 验证应用ID和密钥
|
||||
if (!isValidAppCredentials(appId, appSecret)) {
|
||||
return R.failed("无效的应用ID或密钥");
|
||||
}
|
||||
|
||||
List<SysBannerEntity> list = sysBannerService.listAppBanners();
|
||||
List<SysBannerAppVo> voList = list.stream()
|
||||
.map(e -> BeanUtils.toBean(e, SysBannerAppVo.class))
|
||||
.collect(Collectors.toList());
|
||||
return R.ok(voList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证应用ID和密钥
|
||||
*/
|
||||
private boolean isValidAppCredentials(String appId, String appSecret) {
|
||||
if (StrUtil.isBlank(appId) || StrUtil.isBlank(appSecret)) {
|
||||
return false;
|
||||
}
|
||||
if (externalAppConfig.getApps() != null) {
|
||||
return externalAppConfig.getApps().stream()
|
||||
.filter(ExternalAppConfig.AppCredential::getEnabled)
|
||||
.anyMatch(app -> appId.equals(app.getAppId()) && appSecret.equals(app.getAppSecret()));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
package com.bsd.pjcloud.integrated.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.integrated.entity.SysInternalPageEntity;
|
||||
import com.bsd.pjcloud.integrated.service.SysInternalPageService;
|
||||
import com.bsd.pjcloud.integrated.vo.internalpage.SysInternalPageSelectVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 内部页面配置(供轮播图等选择内部跳转路径)
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-01-27
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/sysInternalPage")
|
||||
@Tag(description = "sysInternalPage", name = "内部页面配置")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysInternalPageController {
|
||||
|
||||
private final SysInternalPageService sysInternalPageService;
|
||||
|
||||
/**
|
||||
* 下拉列表:供轮播图等选择内部页面路径
|
||||
*/
|
||||
@Operation(summary = "内部页面下拉列表", description = "供轮播图配置内部跳转时下拉选择,返回 path/name,选后 path 填到 jump_value")
|
||||
@GetMapping("/select")
|
||||
@PreAuthorize("@pms.hasPermission('integrated_sysInternalPage_view')")
|
||||
public R<List<SysInternalPageSelectVo>> selectList() {
|
||||
List<SysInternalPageEntity> list = sysInternalPageService.listForSelect();
|
||||
List<SysInternalPageSelectVo> voList = list.stream()
|
||||
.map(e -> BeanUtils.toBean(e, SysInternalPageSelectVo.class))
|
||||
.collect(Collectors.toList());
|
||||
return R.ok(voList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询内部页面配置")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('integrated_sysInternalPage_view')")
|
||||
public R getPage(@ParameterObject Page page, @ParameterObject SysInternalPageEntity sysInternalPage) {
|
||||
LambdaQueryWrapper<SysInternalPageEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.like(StrUtil.isNotBlank(sysInternalPage.getPath()), SysInternalPageEntity::getPath, sysInternalPage.getPath())
|
||||
.like(StrUtil.isNotBlank(sysInternalPage.getName()), SysInternalPageEntity::getName, sysInternalPage.getName())
|
||||
.eq(StrUtil.isNotBlank(sysInternalPage.getModuleLabel()), SysInternalPageEntity::getModuleLabel, sysInternalPage.getModuleLabel())
|
||||
.eq(sysInternalPage.getStatus() != null, SysInternalPageEntity::getStatus, sysInternalPage.getStatus())
|
||||
.orderByAsc(SysInternalPageEntity::getModuleLabel)
|
||||
.orderByAsc(SysInternalPageEntity::getSortOrder)
|
||||
.orderByAsc(SysInternalPageEntity::getId);
|
||||
return R.ok(sysInternalPageService.page(page, wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询内部页面配置")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('integrated_sysInternalPage_view')")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(sysInternalPageService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@Operation(summary = "新增内部页面", description = "新增内部页面配置")
|
||||
@SysLog("新增内部页面配置")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('integrated_sysInternalPage_add')")
|
||||
public R save(@RequestBody SysInternalPageEntity sysInternalPage) {
|
||||
return R.ok(sysInternalPageService.save(sysInternalPage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@Operation(summary = "修改内部页面", description = "修改内部页面配置")
|
||||
@SysLog("修改内部页面配置")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('integrated_sysInternalPage_edit')")
|
||||
public R updateById(@RequestBody SysInternalPageEntity sysInternalPage) {
|
||||
return R.ok(sysInternalPageService.updateById(sysInternalPage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*/
|
||||
@Operation(summary = "通过id删除", description = "通过id删除内部页面配置")
|
||||
@SysLog("通过id删除内部页面配置")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('integrated_sysInternalPage_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(sysInternalPageService.removeByIds(java.util.Arrays.asList(ids)));
|
||||
}
|
||||
}
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
package com.bsd.pjcloud.integrated.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 轮播图管理
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-01-27
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("sys_banner")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "轮播图管理")
|
||||
public class SysBannerEntity extends Model<SysBannerEntity> {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
@Schema(description = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@Schema(description = "标题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 图片地址
|
||||
*/
|
||||
@Schema(description = "图片地址")
|
||||
private String imageUrl;
|
||||
|
||||
/**
|
||||
* 跳转类型:1-内部页面 2-外部链接 3-不跳转
|
||||
*/
|
||||
@Schema(description = "跳转类型:1-内部页面 2-外部链接 3-不跳转")
|
||||
private Integer jumpType;
|
||||
|
||||
/**
|
||||
* 跳转值(页面路径/外部链接)
|
||||
*/
|
||||
@Schema(description = "跳转值(页面路径/外部链接)")
|
||||
private String jumpValue;
|
||||
|
||||
/**
|
||||
* 跳转参数JSON格式
|
||||
*/
|
||||
@Schema(description = "跳转参数JSON格式")
|
||||
private String params;
|
||||
|
||||
/**
|
||||
* 富文本内容(跳转到自编辑富文本页面时使用)
|
||||
*/
|
||||
@Schema(description = "富文本内容")
|
||||
private String richTextContent;
|
||||
|
||||
/**
|
||||
* 排序序号
|
||||
*/
|
||||
@Schema(description = "排序序号")
|
||||
private Integer sortOrder;
|
||||
|
||||
/**
|
||||
* 状态:0-禁用 1-启用
|
||||
*/
|
||||
@Schema(description = "状态:0-禁用 1-启用")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 生效时间
|
||||
*/
|
||||
@Schema(description = "生效时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 失效时间
|
||||
*/
|
||||
@Schema(description = "失效时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建者")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新者")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "是否删除")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
@Schema(description = "租户编号")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
package com.bsd.pjcloud.integrated.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 内部页面配置(移动端页面路径,供轮播图等下拉选择)
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-01-27
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("sys_internal_page")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "内部页面配置")
|
||||
public class SysInternalPageEntity extends Model<SysInternalPageEntity> {
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
@Schema(description = "主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "页面全路径")
|
||||
private String path;
|
||||
|
||||
@Schema(description = "页面名称/显示名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "所属模块/分包名称")
|
||||
private String moduleLabel;
|
||||
|
||||
@Schema(description = "排序序号")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "状态:0-禁用 1-启用")
|
||||
private Integer status;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建者")
|
||||
private String createBy;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新者")
|
||||
private String updateBy;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "是否删除")
|
||||
private String delFlag;
|
||||
|
||||
@Schema(description = "租户编号")
|
||||
private Long tenantId;
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.bsd.pjcloud.integrated.mapper;
|
||||
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.integrated.entity.SysBannerEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 轮播图管理
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-01-27
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysBannerMapper extends PjcloudBaseMapper<SysBannerEntity> {
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.bsd.pjcloud.integrated.mapper;
|
||||
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.integrated.entity.SysInternalPageEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 内部页面配置
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-01-27
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysInternalPageMapper extends PjcloudBaseMapper<SysInternalPageEntity> {
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.bsd.pjcloud.integrated.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.integrated.entity.SysBannerEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 轮播图管理
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-01-27
|
||||
*/
|
||||
public interface SysBannerService extends IService<SysBannerEntity> {
|
||||
|
||||
/**
|
||||
* App端获取启用的轮播图列表(在有效期内,按排序序号升序)
|
||||
*
|
||||
* @return 轮播图列表
|
||||
*/
|
||||
List<SysBannerEntity> listAppBanners();
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.bsd.pjcloud.integrated.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.integrated.entity.SysInternalPageEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 内部页面配置
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-01-27
|
||||
*/
|
||||
public interface SysInternalPageService extends IService<SysInternalPageEntity> {
|
||||
|
||||
/**
|
||||
* 下拉用:启用的内部页面列表,按模块和排序
|
||||
*/
|
||||
List<SysInternalPageEntity> listForSelect();
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.bsd.pjcloud.integrated.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.integrated.entity.SysBannerEntity;
|
||||
import com.bsd.pjcloud.integrated.mapper.SysBannerMapper;
|
||||
import com.bsd.pjcloud.integrated.service.SysBannerService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 轮播图管理
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-01-27
|
||||
*/
|
||||
@Service
|
||||
public class SysBannerServiceImpl extends ServiceImpl<SysBannerMapper, SysBannerEntity> implements SysBannerService {
|
||||
|
||||
@Override
|
||||
public List<SysBannerEntity> listAppBanners() {
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
LambdaQueryWrapper<SysBannerEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.eq(SysBannerEntity::getStatus, 1)
|
||||
.and(w -> w.isNull(SysBannerEntity::getStartTime).or().le(SysBannerEntity::getStartTime, now))
|
||||
.and(w -> w.isNull(SysBannerEntity::getEndTime).or().ge(SysBannerEntity::getEndTime, now))
|
||||
.orderByAsc(SysBannerEntity::getSortOrder);
|
||||
return list(wrapper);
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.bsd.pjcloud.integrated.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.integrated.entity.SysInternalPageEntity;
|
||||
import com.bsd.pjcloud.integrated.mapper.SysInternalPageMapper;
|
||||
import com.bsd.pjcloud.integrated.service.SysInternalPageService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 内部页面配置
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-01-27
|
||||
*/
|
||||
@Service
|
||||
public class SysInternalPageServiceImpl extends ServiceImpl<SysInternalPageMapper, SysInternalPageEntity> implements SysInternalPageService {
|
||||
|
||||
@Override
|
||||
public List<SysInternalPageEntity> listForSelect() {
|
||||
LambdaQueryWrapper<SysInternalPageEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.eq(SysInternalPageEntity::getStatus, 1)
|
||||
.orderByAsc(SysInternalPageEntity::getModuleLabel)
|
||||
.orderByAsc(SysInternalPageEntity::getSortOrder)
|
||||
.orderByAsc(SysInternalPageEntity::getId);
|
||||
return list(wrapper);
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.bsd.pjcloud.integrated.mapper.SysBannerMapper">
|
||||
|
||||
<resultMap id="sysBannerMap" type="com.bsd.pjcloud.integrated.entity.SysBannerEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="title" column="title"/>
|
||||
<result property="imageUrl" column="image_url"/>
|
||||
<result property="jumpType" column="jump_type"/>
|
||||
<result property="jumpValue" column="jump_value"/>
|
||||
<result property="params" column="params"/>
|
||||
<result property="richTextContent" column="rich_text_content"/>
|
||||
<result property="sortOrder" column="sort_order"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="startTime" column="start_time"/>
|
||||
<result property="endTime" column="end_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.bsd.pjcloud.integrated.mapper.SysInternalPageMapper">
|
||||
|
||||
<resultMap id="sysInternalPageMap" type="com.bsd.pjcloud.integrated.entity.SysInternalPageEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="path" column="path"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="moduleLabel" column="module_label"/>
|
||||
<result property="sortOrder" column="sort_order"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
Reference in new issue
Block a user