Browse Source

Merge branch 'han' of uskycloud/usky-cloud into master

gez 2 years ago
parent
commit
2de8de4ae8

+ 2 - 2
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/MybatisGeneratorUtils.java

@@ -32,7 +32,7 @@ public class MybatisGeneratorUtils {
         projectPath += "/" + model;
         gc.setOutputDir(projectPath + "/src/main/java");  //生成路径(一般都是生成在此项目的src/main/java下面)
         //修改为自己的名字
-        gc.setAuthor("JCB"); //设置作者
+        gc.setAuthor("han"); //设置作者
         gc.setOpen(false);
         gc.setFileOverride(true); //第二次生成会把第一次生成的覆盖掉
         gc.setServiceName("%sService"); //生成的service接口名字首字母是否为I,这样设置就没有
@@ -70,7 +70,7 @@ public class MybatisGeneratorUtils {
         // strategy.setTablePrefix("t_"); // 表名前缀
         strategy.setEntityLombokModel(true); //使用lombok
         //修改自己想要生成的表
-        strategy.setInclude("sys_user_person");  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
+        strategy.setInclude("sys_mobile_banner");  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
         mpg.setStrategy(strategy);
 
         // 关闭默认 xml 生成,调整生成 至 根目录

+ 62 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/SysMobileBannerController.java

@@ -0,0 +1,62 @@
+package com.usky.system.controller.web;
+
+
+import com.usky.common.core.bean.ApiResult;
+import com.usky.system.domain.SysMobileBanner;
+import com.usky.system.service.SysMobileBannerService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 移动端_banner图配置表 前端控制器
+ * </p>
+ *
+ * @author han
+ * @since 2023-03-30
+ */
+@RestController
+@RequestMapping("/sysMobileBanner")
+public class SysMobileBannerController extends BaseController{
+
+    @Autowired
+    private SysMobileBannerService sysMobileBannerService;
+
+    /**
+     * 租户管理-系统配置-移动端banner图配置新增
+     *
+     * @param sysMobileBanner
+     * @return
+     */
+    @PostMapping("addMobileBanner")
+    public ApiResult<Void> addMobileBanner(@RequestBody SysMobileBanner sysMobileBanner){
+        sysMobileBannerService.addMobileBanner(sysMobileBanner);
+        return ApiResult.success();
+    }
+
+    /**
+     * 租户管理-系统配置-移动端banner图配置修改
+     *
+     * @param sysMobileBanner
+     * @return
+     */
+    @PutMapping("updateMobileBanner")
+    public ApiResult<Void> updateMobileBanner(@RequestBody SysMobileBanner sysMobileBanner) {
+        sysMobileBannerService.updateMobileBanner(sysMobileBanner);
+        return ApiResult.success();
+    }
+
+    /**
+     * 租户管理-系统配置-移动端banner图配置查询
+     *
+     * @param tenantId 租户ID
+     * @return
+     */
+    @GetMapping("getMobileBanner")
+    public ApiResult<List<SysMobileBanner>> getMobileBanner(@RequestParam Integer tenantId) {
+        return ApiResult.success(sysMobileBannerService.getMobileBanner(tenantId));
+    }
+}
+

+ 0 - 2
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/SysNoticeController.java

@@ -27,7 +27,6 @@ public class SysNoticeController extends BaseController
     /**
      * 获取通知公告列表
      */
-    @RequiresPermissions("system:notice:list")
     @GetMapping("/list")
     public ApiResult<TableDataInfo> list(SysNotice notice)
     {
@@ -39,7 +38,6 @@ public class SysNoticeController extends BaseController
     /**
      * 根据通知公告编号获取详细信息
      */
-    @RequiresPermissions("system:notice:query")
     @GetMapping(value = "/{noticeId}")
     public ApiResult getInfo(@PathVariable Long noticeId)
     {

+ 141 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/domain/SysMobileBanner.java

@@ -0,0 +1,141 @@
+package com.usky.system.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 移动端_banner图配置表
+ * </p>
+ *
+ * @author han
+ * @since 2023-03-30
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class SysMobileBanner implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 租户ID
+     */
+    private Integer tenantId;
+
+    /**
+     * 是否开启banner;0、关闭 1、开启
+     */
+    private Integer openNot;
+
+    /**
+     * 轮播时间(s)
+     */
+    private Integer carouselTime;
+
+    /**
+     * 轮播图路径1
+     */
+    private String bannerPath1;
+
+    /**
+     * 轮播图路径2
+     */
+    private String bannerPath2;
+
+    /**
+     * 轮播图路径3
+     */
+    private String bannerPath3;
+
+    /**
+     * 轮播图路径4
+     */
+    private String bannerPath4;
+
+    /**
+     * 轮播图路径5
+     */
+    private String bannerPath5;
+
+    /**
+     * 链接类型1;1、内链 2、外链
+     */
+    private Integer linkType1;
+
+    /**
+     * 链接类型2;1、内链 2、外链
+     */
+    private Integer linkType2;
+
+    /**
+     * 链接类型3;1、内链 2、外链
+     */
+    private Integer linkType3;
+
+    /**
+     * 链接类型4;1、内链 2、外链
+     */
+    private Integer linkType4;
+
+    /**
+     * 链接类型5;1、内链 2、外链
+     */
+    private Integer linkType5;
+
+    /**
+     * 链接地址1
+     */
+    private String linkUrl1;
+
+    /**
+     * 链接地址3
+     */
+    private String linkUrl3;
+
+    /**
+     * 链接地址4
+     */
+    private String linkUrl4;
+
+    /**
+     * 链接地址4
+     */
+    private String linkUrl5;
+
+    /**
+     * 链接地址2
+     */
+    private String linkUrl2;
+
+    /**
+     * 创建者
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 更新者
+     */
+    private String updateBy;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
+
+
+}

+ 16 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/SysMobileBannerMapper.java

@@ -0,0 +1,16 @@
+package com.usky.system.mapper;
+
+import com.usky.system.domain.SysMobileBanner;
+import com.usky.common.mybatis.core.CrudMapper;
+
+/**
+ * <p>
+ * 移动端_banner图配置表 Mapper 接口
+ * </p>
+ *
+ * @author han
+ * @since 2023-03-30
+ */
+public interface SysMobileBannerMapper extends CrudMapper<SysMobileBanner> {
+
+}

+ 41 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/SysMobileBannerService.java

@@ -0,0 +1,41 @@
+package com.usky.system.service;
+
+import com.usky.system.domain.SysMobileBanner;
+import com.usky.common.mybatis.core.CrudService;
+import com.usky.system.domain.SysMobileTenantConfig;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 移动端_banner图配置表 服务类
+ * </p>
+ *
+ * @author han
+ * @since 2023-03-30
+ */
+public interface SysMobileBannerService extends CrudService<SysMobileBanner> {
+    /**
+     * 租户管理-系统配置-移动端banner图配置新增
+     *
+     * @param sysMobileBanner
+     * @return
+     */
+    void addMobileBanner(SysMobileBanner sysMobileBanner);
+
+    /**
+     * 租户管理-系统配置-移动端banner图配置修改
+     *
+     * @param sysMobileBanner
+     * @return
+     */
+    void updateMobileBanner(SysMobileBanner sysMobileBanner);
+
+    /**
+     * 租户管理-系统配置-移动端banner图配置查询
+     *
+     * @param tenantId 租户Id
+     * @return
+     */
+    List<SysMobileBanner> getMobileBanner(Integer tenantId);
+}

+ 47 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysMobileBannerServiceImpl.java

@@ -0,0 +1,47 @@
+package com.usky.system.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.usky.common.security.utils.SecurityUtils;
+import com.usky.system.domain.SysMobileBanner;
+import com.usky.system.domain.SysMobileTenantConfig;
+import com.usky.system.mapper.SysMobileBannerMapper;
+import com.usky.system.service.SysMobileBannerService;
+import com.usky.common.mybatis.core.AbstractCrudService;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+/**
+ * <p>
+ * 移动端_banner图配置表 服务实现类
+ * </p>
+ *
+ * @author han
+ * @since 2023-03-30
+ */
+@Service
+public class SysMobileBannerServiceImpl extends AbstractCrudService<SysMobileBannerMapper, SysMobileBanner> implements SysMobileBannerService {
+    @Override
+    public void addMobileBanner(SysMobileBanner sysMobileBanner){
+        sysMobileBanner.setCreateBy(SecurityUtils.getUsername());
+        sysMobileBanner.setCreateTime(LocalDateTime.now());
+        this.save(sysMobileBanner);
+    }
+
+    @Override
+    public void updateMobileBanner(SysMobileBanner sysMobileBanner){
+        sysMobileBanner.setUpdateBy(SecurityUtils.getUsername());
+        sysMobileBanner.setUpdateTime(LocalDateTime.now());
+        this.updateById(sysMobileBanner);
+    }
+
+    @Override
+    public List<SysMobileBanner> getMobileBanner(Integer tenantId) {
+        LambdaQueryWrapper<SysMobileBanner> query = Wrappers.lambdaQuery();
+        query.eq(SysMobileBanner::getTenantId, tenantId);
+        List<SysMobileBanner> list = this.list(query);
+        return list;
+    }
+}

+ 32 - 0
base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysMobileBannerMapper.xml

@@ -0,0 +1,32 @@
+<?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.usky.system.mapper.SysMobileBannerMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.usky.system.domain.SysMobileBanner">
+        <id column="id" property="id" />
+        <result column="tenant_id" property="tenantId" />
+        <result column="open_not" property="openNot" />
+        <result column="carousel_time" property="carouselTime" />
+        <result column="banner_path1" property="bannerPath1" />
+        <result column="banner_path2" property="bannerPath2" />
+        <result column="banner_path3" property="bannerPath3" />
+        <result column="banner_path4" property="bannerPath4" />
+        <result column="banner_path5" property="bannerPath5" />
+        <result column="link_type1" property="linkType1" />
+        <result column="link_type2" property="linkType2" />
+        <result column="link_type3" property="linkType3" />
+        <result column="link_type4" property="linkType4" />
+        <result column="link_type5" property="linkType5" />
+        <result column="link_url1" property="linkUrl1" />
+        <result column="link_url3" property="linkUrl3" />
+        <result column="link_url4" property="linkUrl4" />
+        <result column="link_url5" property="linkUrl5" />
+        <result column="link_url2" property="linkUrl2" />
+        <result column="create_by" property="createBy" />
+        <result column="create_time" property="createTime" />
+        <result column="update_by" property="updateBy" />
+        <result column="update_time" property="updateTime" />
+    </resultMap>
+
+</mapper>