5 files modified
18 files added
| | |
| | | PropsUtil.setProperty(props, "spring.cloud.sentinel.transport.dashboard", LauncherConstant.sentinelAddr(profile)); |
| | | PropsUtil.setProperty(props, "spring.zipkin.base-url", LauncherConstant.zipkinAddr(profile)); |
| | | PropsUtil.setProperty(props, "spring.datasource.dynamic.enabled", "false"); |
| | | |
| | | // 开启elk日志 |
| | | // PropsUtil.setProperty(props, "blade.log.elk.destination", LauncherConstant.elkAddr(profile)); |
| | | |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.jfpt.avideo.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.jfpt.avideo.entity.Avideo; |
| | | import org.springblade.jfpt.avideo.vo.AvideoVO; |
| | | import org.springblade.jfpt.avideo.service.IAvideoService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-04-19 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/avideo") |
| | | @Api(value = "", tags = "接口") |
| | | public class AvideoController extends BladeController { |
| | | |
| | | private final IAvideoService avideoService; |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入avideo") |
| | | public R<Avideo> detail(Avideo avideo) { |
| | | Avideo detail = avideoService.getOne(Condition.getQueryWrapper(avideo)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入avideo") |
| | | public R<IPage<Avideo>> list(Avideo avideo, Query query) { |
| | | IPage<Avideo> pages = avideoService.page(Condition.getPage(query), Condition.getQueryWrapper(avideo)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入avideo") |
| | | public R<IPage<AvideoVO>> page(AvideoVO avideo, Query query) { |
| | | IPage<AvideoVO> pages = avideoService.selectAvideoPage(Condition.getPage(query), avideo); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入avideo") |
| | | public R save(@Valid @RequestBody Avideo avideo) { |
| | | return R.status(avideoService.save(avideo)); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入avideo") |
| | | public R update(@Valid @RequestBody Avideo avideo) { |
| | | return R.status(avideoService.updateById(avideo)); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入avideo") |
| | | public R submit(@Valid @RequestBody Avideo avideo) { |
| | | return R.status(avideoService.saveOrUpdate(avideo)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(avideoService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.jfpt.avideo.dto; |
| | | |
| | | import org.springblade.jfpt.avideo.entity.Avideo; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * 数据传输对象实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-04-19 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class AvideoDTO extends Avideo { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.jfpt.avideo.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | 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; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | /** |
| | | * 实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-04-19 |
| | | */ |
| | | @Data |
| | | @TableName("sys_avideo") |
| | | @ApiModel(value = "Avideo对象", description = "Avideo对象") |
| | | public class Avideo implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 警单id |
| | | */ |
| | | @ApiModelProperty(value = "警单id") |
| | | private String jid; |
| | | /** |
| | | * 音频发生时间 |
| | | */ |
| | | @ApiModelProperty(value = "音频发生时间") |
| | | private String rtime; |
| | | /** |
| | | * 音频地址 |
| | | */ |
| | | @ApiModelProperty(value = "音频地址") |
| | | private String address; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.jfpt.avideo.mapper; |
| | | |
| | | import org.springblade.jfpt.avideo.entity.Avideo; |
| | | import org.springblade.jfpt.avideo.vo.AvideoVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Mapper 接口 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-04-19 |
| | | */ |
| | | public interface AvideoMapper extends BaseMapper<Avideo> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param avideo |
| | | * @return |
| | | */ |
| | | List<AvideoVO> selectAvideoPage(IPage page, AvideoVO avideo); |
| | | |
| | | } |
| New file |
| | |
| | | <?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="org.springblade.jfpt.avideo.mapper.AvideoMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="avideoResultMap" type="org.springblade.jfpt.avideo.entity.Avideo"> |
| | | <id column="id" property="id"/> |
| | | <result column="jid" property="jid"/> |
| | | <result column="rtime" property="rtime"/> |
| | | <result column="address" property="address"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectAvideoPage" resultMap="avideoResultMap"> |
| | | select * from sys_avideo where is_deleted = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.jfpt.avideo.service; |
| | | |
| | | import org.springblade.jfpt.avideo.entity.Avideo; |
| | | import org.springblade.jfpt.avideo.vo.AvideoVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | /** |
| | | * 服务类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-04-19 |
| | | */ |
| | | public interface IAvideoService extends IService<Avideo> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param avideo |
| | | * @return |
| | | */ |
| | | IPage<AvideoVO> selectAvideoPage(IPage<AvideoVO> page, AvideoVO avideo); |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.jfpt.avideo.service.impl; |
| | | |
| | | import org.springblade.jfpt.avideo.entity.Avideo; |
| | | import org.springblade.jfpt.avideo.vo.AvideoVO; |
| | | import org.springblade.jfpt.avideo.mapper.AvideoMapper; |
| | | import org.springblade.jfpt.avideo.service.IAvideoService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-04-19 |
| | | */ |
| | | @Service |
| | | public class AvideoServiceImpl extends ServiceImpl<AvideoMapper, Avideo> implements IAvideoService { |
| | | |
| | | @Override |
| | | public IPage<AvideoVO> selectAvideoPage(IPage<AvideoVO> page, AvideoVO avideo) { |
| | | return page.setRecords(baseMapper.selectAvideoPage(page, avideo)); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.jfpt.avideo.vo; |
| | | |
| | | import org.springblade.jfpt.avideo.entity.Avideo; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import io.swagger.annotations.ApiModel; |
| | | |
| | | /** |
| | | * 视图实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-04-19 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "AvideoVO对象", description = "AvideoVO对象") |
| | | public class AvideoVO extends Avideo { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.jfpt.message.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.jfpt.message.entity.Message; |
| | | import org.springblade.jfpt.message.vo.MessageVO; |
| | | import org.springblade.jfpt.message.service.IMessageService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-04-19 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/message") |
| | | @Api(value = "", tags = "接口") |
| | | public class MessageController extends BladeController { |
| | | |
| | | private final IMessageService messageService; |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入message") |
| | | public R<Message> detail(Message message) { |
| | | Message detail = messageService.getOne(Condition.getQueryWrapper(message)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入message") |
| | | public R<IPage<Message>> list(Message message, Query query) { |
| | | IPage<Message> pages = messageService.page(Condition.getPage(query), Condition.getQueryWrapper(message)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入message") |
| | | public R<IPage<MessageVO>> page(MessageVO message, Query query) { |
| | | IPage<MessageVO> pages = messageService.selectMessagePage(Condition.getPage(query), message); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入message") |
| | | public R save(@Valid @RequestBody Message message) { |
| | | return R.status(messageService.save(message)); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入message") |
| | | public R update(@Valid @RequestBody Message message) { |
| | | return R.status(messageService.updateById(message)); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入message") |
| | | public R submit(@Valid @RequestBody Message message) { |
| | | return R.status(messageService.saveOrUpdate(message)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(messageService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.jfpt.message.dto; |
| | | |
| | | import org.springblade.jfpt.message.entity.Message; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * 数据传输对象实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-04-19 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class MessageDTO extends Message { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.jfpt.message.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | 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; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | /** |
| | | * 实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-04-19 |
| | | */ |
| | | @Data |
| | | @TableName("sys_message") |
| | | @ApiModel(value = "Message对象", description = "Message对象") |
| | | public class Message implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 设备名称 |
| | | */ |
| | | @ApiModelProperty(value = "设备名称") |
| | | private String enumber; |
| | | /** |
| | | * 报文内容 |
| | | */ |
| | | @ApiModelProperty(value = "报文内容") |
| | | private String content; |
| | | /** |
| | | * 接收时间 |
| | | */ |
| | | @ApiModelProperty(value = "接收时间") |
| | | private String time; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.jfpt.message.mapper; |
| | | |
| | | import org.springblade.jfpt.message.entity.Message; |
| | | import org.springblade.jfpt.message.vo.MessageVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Mapper 接口 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-04-19 |
| | | */ |
| | | public interface MessageMapper extends BaseMapper<Message> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param message |
| | | * @return |
| | | */ |
| | | List<MessageVO> selectMessagePage(IPage page, MessageVO message); |
| | | |
| | | } |
| New file |
| | |
| | | <?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="org.springblade.jfpt.message.mapper.MessageMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="messageResultMap" type="org.springblade.jfpt.message.entity.Message"> |
| | | <id column="id" property="id"/> |
| | | <result column="enumber" property="enumber"/> |
| | | <result column="content" property="content"/> |
| | | <result column="time" property="time"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectMessagePage" resultMap="messageResultMap"> |
| | | select * from sys_message where is_deleted = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.jfpt.message.service; |
| | | |
| | | import org.springblade.jfpt.message.entity.Message; |
| | | import org.springblade.jfpt.message.vo.MessageVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | /** |
| | | * 服务类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-04-19 |
| | | */ |
| | | public interface IMessageService extends IService<Message> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param message |
| | | * @return |
| | | */ |
| | | IPage<MessageVO> selectMessagePage(IPage<MessageVO> page, MessageVO message); |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.jfpt.message.service.impl; |
| | | |
| | | import org.springblade.jfpt.message.entity.Message; |
| | | import org.springblade.jfpt.message.vo.MessageVO; |
| | | import org.springblade.jfpt.message.mapper.MessageMapper; |
| | | import org.springblade.jfpt.message.service.IMessageService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-04-19 |
| | | */ |
| | | @Service |
| | | public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> implements IMessageService { |
| | | |
| | | @Override |
| | | public IPage<MessageVO> selectMessagePage(IPage<MessageVO> page, MessageVO message) { |
| | | return page.setRecords(baseMapper.selectMessagePage(page, message)); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.jfpt.message.vo; |
| | | |
| | | import org.springblade.jfpt.message.entity.Message; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import io.swagger.annotations.ApiModel; |
| | | |
| | | /** |
| | | * 视图实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-04-19 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "MessageVO对象", description = "MessageVO对象") |
| | | public class MessageVO extends Message { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| | |
| | | import org.springblade.jfpt.animalheat.service.AnimalHeatService; |
| | | import org.springblade.jfpt.catalog.service.catalogService; |
| | | import org.springblade.jfpt.equipment.service.IEquipmentService; |
| | | import org.springblade.jfpt.message.entity.Message; |
| | | import org.springblade.jfpt.message.service.IMessageService; |
| | | import org.springblade.jfpt.operation.service.IOperationService; |
| | | import org.springblade.jfpt.operation.vo.OperationVO; |
| | | import org.springblade.jfpt.webscoket.service.IPushMsgService; |
| | |
| | | |
| | | @Autowired |
| | | private org.springblade.jfpt.Netty.service.nettyService nettyService; |
| | | @Autowired |
| | | private IMessageService messageService; |
| | | |
| | | @Autowired |
| | | private IEquipmentService equipmentService; |
| | |
| | | @Override |
| | | public void channelRead(ChannelHandlerContext channelHandlerContext, Object info) throws Exception { |
| | | long startTime1 = System.currentTimeMillis(); |
| | | Date day = new Date(); |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | System.out.println("接收到了:" + info); |
| | | ByteBuf buf = (ByteBuf) info; |
| | | byte[] req = new byte[buf.readableBytes()]; |
| | |
| | | } |
| | | } else { |
| | | String ChannelName = content.substring(10, 22);//设备编码 |
| | | //报文内容保存 |
| | | Message message = new Message(); |
| | | message.setEnumber(ChannelName); |
| | | message.setContent(body); |
| | | message.setTime(df.format(day)); |
| | | serverHandler.messageService.save(message); |
| | | String sub = content.substring(23, 27); |
| | | ConcurrentHashMap<String, Channel> channelHashMap = ChannelMap.getChannelHashMap(); |
| | | if (channelHashMap == null) { |
| | |
| | | Alarm alarm = new Alarm(); |
| | | alarm.setAlarmType("一键报警"); |
| | | alarm.setGalarmPeople("报警主机"); |
| | | Date day = new Date(); |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | alarm.setAlarmTime(df.format(day)); |
| | | alarm.setPlace((String) list.get(0).get("streeName"));//事发地址 |
| | | alarm.setDeviceNumber((String) list.get(0).get("deviceNumber"));//设备编号 |
| | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "删除", notes = "传入ids") |
| | |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.jfpt.alarm.service.IAlarmService; |
| | | import org.springblade.jfpt.avideo.entity.Avideo; |
| | | import org.springblade.jfpt.avideo.service.IAvideoService; |
| | | import org.springblade.jfpt.wj.entity.Wj; |
| | | import org.springblade.jfpt.wj.service.IWjService; |
| | | import org.springblade.jfpt.xlfeedback.entity.Xlfeedback; |
| | |
| | | private IWjService iWjService; |
| | | private MinioTemplate minioTemplate; |
| | | private final IAlarmService alarmService; |
| | | private final IAvideoService iAvideoService; |
| | | |
| | | /** |
| | | * 详情 |
| | |
| | | String url = minioClient.getObjectUrl("jfpt", newName); //文件访问路径 |
| | | String substring = url.substring(25, url.length()); |
| | | String urls="https://web.byisf.com/minio"+substring; |
| | | alarmService.updateAaddress(url,jid); |
| | | return R.data(url); |
| | | //alarmService.updateAaddress(urls,jid); |
| | | Avideo avideo = new Avideo(); |
| | | avideo.setJid(jid); |
| | | avideo.setAddress(urls); |
| | | Date dd = new Date(); |
| | | SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String time = sim.format(dd); |
| | | avideo.setRtime(time); |
| | | iAvideoService.save(avideo); |
| | | return R.data(urls); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1383967981688827911', 1123598815738675201, 'avideo', '音频录制', 'menu', '/avideo/avideo', NULL, 1, 1, 0, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1383967981688827912', '1383967981688827911', 'avideo_add', '新增', 'add', '/avideo/avideo/add', 'plus', 1, 2, 1, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1383967981688827913', '1383967981688827911', 'avideo_edit', '修改', 'edit', '/avideo/avideo/edit', 'form', 2, 2, 2, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1383967981688827914', '1383967981688827911', 'avideo_delete', '删除', 'delete', '/api/blade-avideo/avideo/remove', 'delete', 3, 2, 3, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1383967981688827915', '1383967981688827911', 'avideo_view', '查看', 'view', '/avideo/avideo/view', 'file-text', 4, 2, 2, 1, NULL, 0); |
| New file |
| | |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1383952316860911623', 1123598815738675201, 'message', '报文保存', 'menu', '/message/message', NULL, 1, 1, 0, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1383952316860911624', '1383952316860911623', 'message_add', '新增', 'add', '/message/message/add', 'plus', 1, 2, 1, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1383952316860911625', '1383952316860911623', 'message_edit', '修改', 'edit', '/message/message/edit', 'form', 2, 2, 2, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1383952316860911626', '1383952316860911623', 'message_delete', '删除', 'delete', '/api/blade-message/message/remove', 'delete', 3, 2, 3, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1383952316860911627', '1383952316860911623', 'message_view', '查看', 'view', '/message/message/view', 'file-text', 4, 2, 2, 1, NULL, 0); |
| | |
| | | </select> |
| | | |
| | | <select id="selectInfo" resultType="java.util.HashMap"> |
| | | select id as deptid,dept_name from blade_dept where tenant_id=963841 and is_deleted=0 and parent_id!=0 |
| | | select id as deptid,dept_name from blade_dept where is_deleted=0 |
| | | </select> |
| | | |
| | | </mapper> |