管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-12-17 a2efc5b4bfc07a2ae735f6a9f63c3262c69de69a
1
已添加3个文件
已修改1个文件
282 ■■■■■ 文件已修改
data/db_tab.sql 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/sys/DownlogController.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/sys/DownlogEntity.java 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/mapper/sys/DownlogMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/db_tab.sql
@@ -192,15 +192,15 @@
create table lf.sys_login_2022 partition of lf.sys_login for values from ('2022-01-01') to ('2023-01-01');
create INDEX index_sys_login_2022_optime on lf.sys_login_2022 (optime);
create table lf.sys_login_2023 partition of lf.sys_login for values from ('2023-01-01') to ('2024-01-01');
create INDEX index_sys_login_2023_optime on lf.sys_login_2022 (optime);
create INDEX index_sys_login_2023_optime on lf.sys_login_2023 (optime);
create table lf.sys_login_2024 partition of lf.sys_login for values from ('2024-01-01') to ('2025-01-01');
create INDEX index_sys_login_2024_optime on lf.sys_login_2022 (optime);
create INDEX index_sys_login_2024_optime on lf.sys_login_2024 (optime);
create table lf.sys_login_2025 partition of lf.sys_login for values from ('2025-01-01') to ('2026-01-01');
create INDEX index_sys_login_2025_optime on lf.sys_login_2022 (optime);
create INDEX index_sys_login_2025_optime on lf.sys_login_2025 (optime);
create table lf.sys_login_2026 partition of lf.sys_login for values from ('2026-01-01') to ('2027-01-01');
create INDEX index_sys_login_2026_optime on lf.sys_login_2022 (optime);
create INDEX index_sys_login_2026_optime on lf.sys_login_2026 (optime);
create table lf.sys_login_2027 partition of lf.sys_login for values from ('2027-01-01') to ('2028-01-01');
create INDEX index_sys_login_2027_optime on lf.sys_login_2022 (optime);
create INDEX index_sys_login_2027_optime on lf.sys_login_2027 (optime);
comment on table lf.sys_login is '登录日志表';
comment on column lf.sys_login.id is '主键ID';
@@ -236,15 +236,15 @@
create table lf.sys_operate_2022 partition of lf.sys_operate for values from ('2022-01-01') to ('2023-01-01');
create INDEX index_sys_operate_2022_optime on lf.sys_operate_2022 (optime);
create table lf.sys_operate_2023 partition of lf.sys_operate for values from ('2023-01-01') to ('2024-01-01');
create INDEX index_sys_operate_2023_optime on lf.sys_operate_2022 (optime);
create INDEX index_sys_operate_2023_optime on lf.sys_operate_2023 (optime);
create table lf.sys_operate_2024 partition of lf.sys_operate for values from ('2024-01-01') to ('2025-01-01');
create INDEX index_sys_operate_2024_optime on lf.sys_operate_2022 (optime);
create INDEX index_sys_operate_2024_optime on lf.sys_operate_2024 (optime);
create table lf.sys_operate_2025 partition of lf.sys_operate for values from ('2025-01-01') to ('2026-01-01');
create INDEX index_sys_operate_2025_optime on lf.sys_operate_2022 (optime);
create INDEX index_sys_operate_2025_optime on lf.sys_operate_2025 (optime);
create table lf.sys_operate_2026 partition of lf.sys_operate for values from ('2026-01-01') to ('2027-01-01');
create INDEX index_sys_operate_2026_optime on lf.sys_operate_2022 (optime);
create INDEX index_sys_operate_2026_optime on lf.sys_operate_2026 (optime);
create table lf.sys_operate_2027 partition of lf.sys_operate for values from ('2027-01-01') to ('2028-01-01');
create INDEX index_sys_operate_2027_optime on lf.sys_operate_2022 (optime);
create INDEX index_sys_operate_2027_optime on lf.sys_operate_2027 (optime);
comment on table lf.sys_operate is '操作日志表';
comment on column lf.sys_operate.id is '主键ID';
@@ -286,15 +286,15 @@
create table lf.sys_token_2022 partition of lf.sys_token for values from ('2022-01-01') to ('2023-01-01');
create INDEX index_sys_token_2022_create_time on lf.sys_token_2022 (create_time);
create table lf.sys_token_2023 partition of lf.sys_token for values from ('2023-01-01') to ('2024-01-01');
create INDEX index_sys_token_2023_create_time on lf.sys_token_2022 (create_time);
create INDEX index_sys_token_2023_create_time on lf.sys_token_2023 (create_time);
create table lf.sys_token_2024 partition of lf.sys_token for values from ('2024-01-01') to ('2025-01-01');
create INDEX index_sys_token_2024_create_time on lf.sys_token_2022 (create_time);
create INDEX index_sys_token_2024_create_time on lf.sys_token_2024 (create_time);
create table lf.sys_token_2025 partition of lf.sys_token for values from ('2025-01-01') to ('2026-01-01');
create INDEX index_sys_token_2025_create_time on lf.sys_token_2022 (create_time);
create INDEX index_sys_token_2025_create_time on lf.sys_token_2025 (create_time);
create table lf.sys_token_2026 partition of lf.sys_token for values from ('2026-01-01') to ('2027-01-01');
create INDEX index_sys_token_2026_create_time on lf.sys_token_2022 (create_time);
create INDEX index_sys_token_2026_create_time on lf.sys_token_2026 (create_time);
create table lf.sys_token_2027 partition of lf.sys_token for values from ('2027-01-01') to ('2028-01-01');
create INDEX index_sys_token_2027_create_time on lf.sys_token_2022 (create_time);
create INDEX index_sys_token_2027_create_time on lf.sys_token_2027 (create_time);
comment on table lf.sys_token is '令牌表';
comment on column lf.sys_token.id is '主键ID';
@@ -366,15 +366,15 @@
create table lf.sys_res_op_2022 partition of lf.sys_res_op for values from ('2022-01-01') to ('2023-01-01');
create INDEX index_sys_res_op_2022_optime on lf.sys_res_op_2022 (optime);
create table lf.sys_res_op_2023 partition of lf.sys_res_op for values from ('2023-01-01') to ('2024-01-01');
create INDEX index_sys_res_op_2023_optime on lf.sys_res_op_2022 (optime);
create INDEX index_sys_res_op_2023_optime on lf.sys_res_op_2023 (optime);
create table lf.sys_res_op_2024 partition of lf.sys_res_op for values from ('2024-01-01') to ('2025-01-01');
create INDEX index_sys_res_op_2024_optime on lf.sys_res_op_2022 (optime);
create INDEX index_sys_res_op_2024_optime on lf.sys_res_op_2024 (optime);
create table lf.sys_res_op_2025 partition of lf.sys_res_op for values from ('2025-01-01') to ('2026-01-01');
create INDEX index_sys_res_op_2025_optime on lf.sys_res_op_2022 (optime);
create INDEX index_sys_res_op_2025_optime on lf.sys_res_op_2025 (optime);
create table lf.sys_res_op_2026 partition of lf.sys_res_op for values from ('2026-01-01') to ('2027-01-01');
create INDEX index_sys_res_op_2026_optime on lf.sys_res_op_2022 (optime);
create INDEX index_sys_res_op_2026_optime on lf.sys_res_op_2026 (optime);
create table lf.sys_res_op_2027 partition of lf.sys_res_op for values from ('2027-01-01') to ('2028-01-01');
create INDEX index_sys_res_op_2027_optime on lf.sys_res_op_2022 (optime);
create INDEX index_sys_res_op_2027_optime on lf.sys_res_op_2027 (optime);
comment on table lf.sys_res_op is '资源操作表';
comment on column lf.sys_res_op.id is '主键ID';
@@ -964,7 +964,7 @@
comment on column lf.sys_domain.bak is '备注';
select * from lf.sys_domain order by dom_name,orderid;
----------------------------------------------------------------------------------------------------- 27.项目表
----------------------------------------------------------------------------------------------------- 28.项目表
-- drop table if exists lf.sys_project;
create table if not exists lf.sys_project (
    id serial primary key,
@@ -1014,6 +1014,46 @@
comment on column lf.sys_project.geom is '空间位置';
select * from lf.sys_project;
----------------------------------------------------------------------------------------------------- 29.下载日志表
-- drop table if exists lf.sys_downlog;
create table lf.sys_downlog (
    id serial8,
    downid integer default 0,
    name varchar(50),
    type smallint default 1,
    sizes float8 default 0,
    ip varchar(30),
    create_user integer default 1,
    create_time timestamp(6) without time zone default now(),
    update_user integer,
    update_time timestamp(6) without time zone
) partition by range(create_time);
create table lf.sys_downlog_2022 partition of lf.sys_downlog for values from ('2022-01-01') to ('2023-01-01');
create index index_sys_downlog_2022_create_time on lf.sys_downlog_2022 (create_time);
create table lf.sys_downlog_2023 partition of lf.sys_downlog for values from ('2023-01-01') to ('2024-01-01');
create index index_sys_downlog_2023_create_time on lf.sys_downlog_2023 (create_time);
create table lf.sys_downlog_2024 partition of lf.sys_downlog for values from ('2024-01-01') to ('2025-01-01');
create index index_sys_downlog_2024_create_time on lf.sys_downlog_2024 (create_time);
create table lf.sys_downlog_2025 partition of lf.sys_downlog for values from ('2025-01-01') to ('2026-01-01');
create index index_sys_downlog_2025_create_time on lf.sys_downlog_2025 (create_time);
create table lf.sys_downlog_2026 partition of lf.sys_downlog for values from ('2026-01-01') to ('2027-01-01');
create index index_sys_downlog_2026_create_time on lf.sys_downlog_2026 (create_time);
create table lf.sys_downlog_2027 partition of lf.sys_downlog for values from ('2027-01-01') to ('2028-01-01');
create index index_sys_downlog_2027_create_time on lf.sys_downlog_2027 (create_time);
comment on table lf.sys_downlog is '下载日志表';
comment on column lf.sys_downlog.id is '主键id';
comment on column lf.sys_downlog.name is '名称';
comment on column lf.sys_downlog.type is '类型:1-Shp文件,2-专题图,3-元数据';
comment on column lf.sys_downlog.sizes is '文件大小:单位MB';
comment on column lf.sys_downlog.ip is 'IP地址';
comment on column lf.sys_downlog.create_user is '创建人id';
comment on column lf.sys_downlog.create_time is '创建时间';
comment on column lf.sys_downlog.update_user is '更新人id';
comment on column lf.sys_downlog.update_time is '更新时间';
-- insert into lf.sys_downlog(downid,name,type,sizes,ip,create_user) values (1,'test.zip',1,0.001,'192.168.20.39',1);
select * from lf.sys_downlog;
----------------------------------------------------------------------------------------------------- å…ƒæ•°æ®æµ‹è¯•表 *
-- drop table if exists md.md_zxcg;
create table md.md_zxcg(
src/main/java/com/lf/server/controller/sys/DownlogController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,65 @@
package com.lf.server.controller.sys;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lf.server.annotation.SysLog;
import com.lf.server.controller.all.BaseController;
import com.lf.server.entity.all.ResponseMsg;
import com.lf.server.entity.sys.BlacklistEntity;
import com.lf.server.entity.sys.DownlogEntity;
import com.lf.server.helper.StringHelper;
import com.lf.server.mapper.sys.DownlogMapper;
import com.lf.server.service.sys.DepService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
 * ä¸‹è½½æ—¥å¿—
 * @author WWW
 */
@Api(tags = "运维管理\\下载日志")
@RestController
@RequestMapping("/downlog")
public class DownlogController extends BaseController {
    @Autowired
    DownlogMapper downlogMapper;
    @SysLog()
    @ApiOperation(value = "分页查询并返回记录数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = ""),
            @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"),
            @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/selectByPageAndCount")
    public ResponseMsg<List<DownlogEntity>> selectByPageAndCount(String name, Integer pageSize, Integer pageIndex) {
        try {
            if (pageSize < 1 || pageIndex < 1) {
                return fail("每页页数或分页数小于1", null);
            }
            QueryWrapper wrapper = new QueryWrapper();
            if (!StringHelper.isEmpty(name)) {
                wrapper.like("name", name);
            }
            Page<DownlogEntity> page = new Page<>(pageIndex, pageSize);
            page.addOrder(OrderItem.asc("id"));
            IPage<DownlogEntity> paged = downlogMapper.selectPage(page, wrapper);
            return success(paged.getTotal(), paged.getRecords());
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
    }
}
src/main/java/com/lf/server/entity/sys/DownlogEntity.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,119 @@
package com.lf.server.entity.sys;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.sql.Timestamp;
/**
 * ä¸‹è½½æ—¥å¿—
 * @author WWW
 */
public class DownlogEntity implements Serializable {
    private static final long serialVersionUID = 2791055269920047470L;
    @TableId(type = IdType.AUTO)
    private Integer id;
    private Integer downid;
    private String name;
    private Integer type;
    private double sizes;
    private String ip;
    private Integer createUser;
    private Timestamp createTime;
    private Integer updateUser;
    private Timestamp updateTime;
    public DownlogEntity() {
    }
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public Integer getDownid() {
        return downid;
    }
    public void setDownid(Integer downid) {
        this.downid = downid;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public double getSizes() {
        return sizes;
    }
    public void setSizes(double sizes) {
        this.sizes = sizes;
    }
    public String getIp() {
        return ip;
    }
    public void setIp(String ip) {
        this.ip = ip;
    }
    public Integer getCreateUser() {
        return createUser;
    }
    public void setCreateUser(Integer createUser) {
        this.createUser = createUser;
    }
    public Timestamp getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }
    public Integer getUpdateUser() {
        return updateUser;
    }
    public void setUpdateUser(Integer updateUser) {
        this.updateUser = updateUser;
    }
    public Timestamp getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }
}
src/main/java/com/lf/server/mapper/sys/DownlogMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
package com.lf.server.mapper.sys;
import com.lf.server.entity.sys.DownlogEntity;
import com.lf.server.mapper.all.BasicMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
/**
 * ä¸‹è½½æ—¥å¿—
 * @author WWW
 */
@Mapper
@Repository
public interface DownlogMapper extends BasicMapper<DownlogEntity> {
    //
}