parent
dcbc8ee72b
commit
06cbf48e7c
|
|
@ -6,12 +6,6 @@ import io.swagger.v3.oas.annotations.servers.Server;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
||||||
import org.springframework.boot.web.servlet.ServletComponentScan;
|
|
||||||
import org.springframework.context.annotation.ComponentScan;
|
|
||||||
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
|
||||||
import org.springframework.scheduling.annotation.EnableAsync;
|
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类描述
|
* 类描述
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.gunshi.project.xyt.controller;
|
package com.gunshi.project.xyt.controller;
|
||||||
|
|
||||||
|
import com.gunshi.logging.access.annotation.LoginLogging;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|
@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
@RequestMapping("/ping")
|
@RequestMapping("/ping")
|
||||||
public class PingController {
|
public class PingController {
|
||||||
@Operation(summary = "测试接口")
|
@Operation(summary = "测试接口")
|
||||||
|
@LoginLogging
|
||||||
@GetMapping("")
|
@GetMapping("")
|
||||||
public String ping() {
|
public String ping() {
|
||||||
return "pong";
|
return "pong";
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.gunshi.project.xyt.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.gunshi.core.result.R;
|
||||||
|
import com.gunshi.project.xyt.model.ProtocolInfo;
|
||||||
|
import com.gunshi.project.xyt.model.ProtocolInfoAutoDao;
|
||||||
|
import com.gunshi.project.xyt.service.ProtocolInfoService;
|
||||||
|
import com.gunshi.project.xyt.so.ProtocolInfoSo;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.Update;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 协议信息控制器接口类
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-23
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/protocolInfo")
|
||||||
|
@Tag(name = "协议信息")
|
||||||
|
public class ProtocolInfoController {
|
||||||
|
@Autowired
|
||||||
|
private ProtocolInfoAutoDao dao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProtocolInfoService service;
|
||||||
|
|
||||||
|
@PostMapping("/save")
|
||||||
|
public R<Boolean> save(@Validated({Insert.class}) @RequestBody ProtocolInfo entity) {
|
||||||
|
// todo 无论是数据库设置默认值为GETDATE()还是使用注解fill = FieldFill.INSERT都不能自动插入当前时间
|
||||||
|
entity.setCreateTm(new Date());
|
||||||
|
entity.setEnable(1);
|
||||||
|
return R.ok(dao.save(entity));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/update")
|
||||||
|
public R<Boolean> update(@Validated({Update.class}) @RequestBody ProtocolInfo entity) {
|
||||||
|
return R.ok(dao.updateById(entity));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/delete/{id}")
|
||||||
|
public R<Boolean> delete(@PathVariable String id) {
|
||||||
|
return R.ok(dao.removeById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get/{id}")
|
||||||
|
public R<ProtocolInfo> getById(@PathVariable("id") String id) {
|
||||||
|
return R.ok(dao.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/page")
|
||||||
|
public R<Page<ProtocolInfo>> page(@Validated @RequestBody ProtocolInfoSo so) {
|
||||||
|
return R.ok(service.page(so));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,128 @@
|
||||||
|
package com.gunshi.project.xyt.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.gunshi.core.result.R;
|
||||||
|
import com.gunshi.project.xyt.model.ServiceResource;
|
||||||
|
import com.gunshi.project.xyt.model.ServiceResourceAutoDao;
|
||||||
|
import com.gunshi.project.xyt.model.ServiceResourceType;
|
||||||
|
import com.gunshi.project.xyt.model.ServiceResourceTypeAutoDao;
|
||||||
|
import com.gunshi.project.xyt.service.ServiceResourceMonitorRService;
|
||||||
|
import com.gunshi.project.xyt.so.ServiceResourceSo;
|
||||||
|
import com.gunshi.project.xyt.so.ServiceResourceTypeSo;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.QueryPage;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.QueryTimeRange;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.Update;
|
||||||
|
import com.gunshi.project.xyt.vo.ServiceResourceMonitorVo;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务资源及监控控制器接口类
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-24
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/serviceResource")
|
||||||
|
@Tag(name = "服务资源及监控")
|
||||||
|
public class ServiceResourceController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ServiceResourceAutoDao serviceResourceDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ServiceResourceMonitorRService serviceMonitorService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ServiceResourceTypeAutoDao serviceTypeDao;
|
||||||
|
|
||||||
|
@PostMapping("/save")
|
||||||
|
public R<Boolean> save(@Validated(Insert.class) @RequestBody ServiceResource entity) {
|
||||||
|
entity.setId(IdWorker.getIdStr());
|
||||||
|
entity.setRegisterDate(new Date());
|
||||||
|
entity.setEnable(1);
|
||||||
|
return R.ok(serviceResourceDao.save(entity));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/update")
|
||||||
|
public R<Boolean> update(@Validated(Update.class) @RequestBody ServiceResource entity) {
|
||||||
|
ServiceResource byId = serviceResourceDao.getById(entity.getId());
|
||||||
|
if (byId == null) {
|
||||||
|
return R.error(400, "数据不存在", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
entity.setRegisterDate(byId.getRegisterDate());
|
||||||
|
return R.ok(serviceResourceDao.updateById(entity));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/delete/{id}")
|
||||||
|
public R<Boolean> delete(@PathVariable("id") String id) {
|
||||||
|
return R.ok(serviceMonitorService.removeById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/page")
|
||||||
|
public R<Page<ServiceResource>> page(
|
||||||
|
@Validated({QueryPage.class, QueryTimeRange.class}) @RequestBody ServiceResourceSo so
|
||||||
|
) {
|
||||||
|
LambdaQueryWrapper<ServiceResource> query = new LambdaQueryWrapper<>();
|
||||||
|
if (StringUtils.isNotEmpty(so.getName())) {
|
||||||
|
query.like(ServiceResource::getName, so.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
query.le(ServiceResource::getRegisterDate, so.getTimeSo().getEnd());
|
||||||
|
query.ge(ServiceResource::getRegisterDate, so.getTimeSo().getStart());
|
||||||
|
query.orderByDesc(ServiceResource::getRegisterDate);
|
||||||
|
|
||||||
|
Page<ServiceResource> page = serviceResourceDao.page(so.getPageSo().toPage(), query);
|
||||||
|
return R.ok(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/monitor/page")
|
||||||
|
public R<Page<ServiceResourceMonitorVo>> pageMonitorR(
|
||||||
|
@Validated({QueryPage.class, QueryTimeRange.class}) @RequestBody ServiceResourceSo so
|
||||||
|
) {
|
||||||
|
Page<ServiceResourceMonitorVo> page = serviceMonitorService.page(so.getPageSo().toPage(), so);
|
||||||
|
return R.ok(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/type/save")
|
||||||
|
public R<Boolean> saveType(@Validated(Insert.class) @RequestBody ServiceResourceType entity) {
|
||||||
|
entity.setId(IdWorker.getIdStr());
|
||||||
|
return R.ok(serviceTypeDao.save(entity));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/type/update")
|
||||||
|
public R<Boolean> updateType(@Validated(Update.class) @RequestBody ServiceResourceType entity) {
|
||||||
|
return R.ok(serviceTypeDao.updateById(entity));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/type/delete/{id}")
|
||||||
|
public R<Boolean> deleteType(@PathVariable("id") String id) {
|
||||||
|
return R.ok(serviceTypeDao.removeById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/type/page")
|
||||||
|
public R<Page<ServiceResourceType>> pageType(
|
||||||
|
@Validated({QueryPage.class}) @RequestBody ServiceResourceTypeSo so
|
||||||
|
) {
|
||||||
|
LambdaQueryWrapper<ServiceResourceType> query = new LambdaQueryWrapper<>();
|
||||||
|
if (StringUtils.isNotEmpty(so.getName())) {
|
||||||
|
query.like(ServiceResourceType::getName, so.getName());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(so.getType())) {
|
||||||
|
query.like(ServiceResourceType::getType, so.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
Page<ServiceResourceType> page = serviceTypeDao.page(so.getPageSo().toPage(), query);
|
||||||
|
return R.ok(page);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.gunshi.project.xyt.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.gunshi.project.xyt.so.ServiceResourceSo;
|
||||||
|
import com.gunshi.project.xyt.vo.ServiceResourceMonitorVo;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类描述
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-24
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ServiceResourceMonitorRMapper {
|
||||||
|
@Select("""
|
||||||
|
<script>
|
||||||
|
SELECT r.*,sr.name FROM SERVICE_RESOURCE_MONITOR_R r
|
||||||
|
LEFT JOIN SERVICE_RESOURCE sr ON r.SR_ID=sr.ID
|
||||||
|
WHERE 1=1
|
||||||
|
<if test="so.name != null and so.name != ''">
|
||||||
|
AND sr.NAME LIKE CONCAT('%',#{so.name},'%')
|
||||||
|
</if>
|
||||||
|
<if test="so.timeSo.start != null">
|
||||||
|
AND r.LAST_CHANGE_TM >= #{so.timeSo.start}
|
||||||
|
</if>
|
||||||
|
<if test="so.timeSo.end != null">
|
||||||
|
AND r.LAST_CHANGE_TM <= #{so.timeSo.end}
|
||||||
|
</if>
|
||||||
|
</script>
|
||||||
|
""")
|
||||||
|
Page<ServiceResourceMonitorVo> page(@Param("page") Page page,@Param("so") ServiceResourceSo so);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
package com.gunshi.project.xyt.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.gunshi.core.dateformat.DateFormatString;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.Update;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接收协议
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
@Schema(description = "接收协议")
|
||||||
|
@TableName("PROTOCOL_INFO")
|
||||||
|
public class ProtocolInfo {
|
||||||
|
|
||||||
|
@NotEmpty(message = "协议编码不能为空", groups = {Insert.class, Update.class})
|
||||||
|
@Schema(description = "协议编码")
|
||||||
|
@TableId("ID")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@NotEmpty(message = "协议名称不能为空", groups = {Insert.class})
|
||||||
|
@Schema(description = "协议名称")
|
||||||
|
@TableField("NAME")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@NotEmpty(message = "IP地址不能为空", groups = {Insert.class})
|
||||||
|
@Schema(description = "IP地址")
|
||||||
|
@TableField("IP")
|
||||||
|
private String ip;
|
||||||
|
|
||||||
|
@NotNull(message = "监听端口不能为空", groups = {Insert.class})
|
||||||
|
@Schema(description = "监听端口")
|
||||||
|
@TableField("PORT")
|
||||||
|
private Integer port;
|
||||||
|
|
||||||
|
@NotEmpty(message = "协议标准不能为空", groups = {Insert.class})
|
||||||
|
@Schema(description = "协议标准")
|
||||||
|
@TableField("STD")
|
||||||
|
private String std;
|
||||||
|
|
||||||
|
@Schema(description = "传输协议,TCP或UDP")
|
||||||
|
@TableField("TRANS")
|
||||||
|
private String trans;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用", $comment = "1启用,0不启用,默认1")
|
||||||
|
@TableField(value = "ENABLE")
|
||||||
|
private Integer enable;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@TableField(value = "CREATE_TM")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||||
|
private Date createTm;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,102 @@
|
||||||
|
package com.gunshi.project.xyt.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.gunshi.core.dateformat.DateFormatString;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.Update;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据共享服务公共资源属性
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
@Schema(description = "服务资源")
|
||||||
|
@TableName("SERVICE_RESOURCE")
|
||||||
|
public class ServiceResource {
|
||||||
|
|
||||||
|
@Schema(description = "id")
|
||||||
|
@TableId("ID")
|
||||||
|
@NotEmpty(message = "服务ID不能为空", groups = {Update.class})
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "服务名称")
|
||||||
|
@TableField("NAME")
|
||||||
|
@NotEmpty(message = "服务名称不能为空", groups = {Insert.class})
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "服务描述")
|
||||||
|
@TableField("DESCRIPTION")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Schema(description = "服务类型")
|
||||||
|
@TableField("SERVICE_TYPE")
|
||||||
|
private String serviceType;
|
||||||
|
|
||||||
|
@Schema(description = "服务地址")
|
||||||
|
@TableField("URL")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@Schema(description = "服务端口")
|
||||||
|
@TableField("PORT")
|
||||||
|
private Integer port;
|
||||||
|
|
||||||
|
@Schema(description = "服务提供者")
|
||||||
|
@TableField("PROVIDER")
|
||||||
|
private String provider;
|
||||||
|
|
||||||
|
@Schema(description = "目标表")
|
||||||
|
@TableField("TARGET_TABLE")
|
||||||
|
private String targetTable;
|
||||||
|
|
||||||
|
@Schema(description = "目标时间依据字段")
|
||||||
|
@TableField("TARGET_TM_FIELD")
|
||||||
|
private String targetTmField;
|
||||||
|
|
||||||
|
@Schema(description = "路由")
|
||||||
|
@TableField("ROUTE")
|
||||||
|
private String route;
|
||||||
|
|
||||||
|
@Schema(description = "联系人")
|
||||||
|
@TableField("CONTACT")
|
||||||
|
private String contact;
|
||||||
|
|
||||||
|
@Schema(description = "联系电话")
|
||||||
|
@TableField("PHONE")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@Schema(description = "注册日期")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD, timezone = "GMT+8")
|
||||||
|
@TableField("REGISTER_DATE")
|
||||||
|
private Date registerDate;
|
||||||
|
|
||||||
|
@Schema(description = "修改日期")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||||
|
@TableField("UPDATE_TM")
|
||||||
|
private Date updateTm;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用,0-停用,1-启用")
|
||||||
|
@TableField("ENABLE")
|
||||||
|
private Integer enable;
|
||||||
|
|
||||||
|
@Schema(description = "状态,0-不在线/异常,1-在线/正常")
|
||||||
|
@TableField("STATUS")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "最近数据时间")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||||
|
@TableField("LAST_DATA_TM")
|
||||||
|
private Date lastChangeTm;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.gunshi.project.xyt.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.gunshi.core.dateformat.DateFormatString;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务资源监控记录
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
@Schema(description = "服务资源监控记录")
|
||||||
|
@TableName("SERVICE_RESOURCE_R")
|
||||||
|
public class ServiceResourceMonitorR {
|
||||||
|
|
||||||
|
@Schema(description = "id")
|
||||||
|
@TableId("ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "服务资源id")
|
||||||
|
@TableField("SR_ID")
|
||||||
|
private String srId;
|
||||||
|
|
||||||
|
@Schema(description = "最近数据时间")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||||
|
@TableField("LAST_CHANGE_TM")
|
||||||
|
private Date lastChangeTm;
|
||||||
|
|
||||||
|
@Schema(description = "共享数据(条)")
|
||||||
|
@TableField("RECORD_COUNT")
|
||||||
|
private Long recordCount;
|
||||||
|
|
||||||
|
@Schema(description = "共享站点数量")
|
||||||
|
@TableField("ST_COUNT")
|
||||||
|
private Integer stCount;
|
||||||
|
|
||||||
|
@Schema(description = "今日共享数据(条)")
|
||||||
|
@TableField("TODAY_COUNT")
|
||||||
|
private Long todayCount;
|
||||||
|
|
||||||
|
@Schema(description = "本周共享数据(条)")
|
||||||
|
@TableField("WEEKLY_COUNT")
|
||||||
|
private Long weeklyCount;
|
||||||
|
|
||||||
|
@Schema(description = "本月共享数据(条)")
|
||||||
|
@TableField("MONTHLY_COUNT")
|
||||||
|
private Long monthlyCount;
|
||||||
|
|
||||||
|
@Schema(description = "本年共享数据(条)")
|
||||||
|
@TableField("YEARLY_COUNT")
|
||||||
|
private Long yearlyCount;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.gunshi.project.xyt.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.Update;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务类型
|
||||||
|
* 纯字典,无意义,无关联,应标
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
@Schema(description = "服务类型")
|
||||||
|
@TableName("SERVICE_RESOURCE_TYPE")
|
||||||
|
public class ServiceResourceType {
|
||||||
|
@Schema(description = "id")
|
||||||
|
@TableId("ID")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "服务类型")
|
||||||
|
@TableField("TYPE")
|
||||||
|
@NotEmpty(message = "服务类型不能为空", groups = {Insert.class, Update.class})
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "服务名称")
|
||||||
|
@TableField("NAME")
|
||||||
|
@NotEmpty(message = "服务类型不能为空", groups = {Insert.class, Update.class})
|
||||||
|
private String name;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
package com.gunshi.project.xyt.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.gunshi.project.xyt.so.ProtocolInfoSo;
|
||||||
|
import com.gunshi.project.xyt.model.ProtocolInfo;
|
||||||
|
import com.gunshi.project.xyt.model.ProtocolInfoAutoDao;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类描述
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-23
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ProtocolInfoService {
|
||||||
|
@Autowired
|
||||||
|
private ProtocolInfoAutoDao dao;
|
||||||
|
|
||||||
|
|
||||||
|
public Page<ProtocolInfo> page(ProtocolInfoSo so) {
|
||||||
|
if (StringUtils.isNotEmpty(so.getId())) {
|
||||||
|
ProtocolInfo entity = dao.getById(so.getId());
|
||||||
|
if (entity == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<ProtocolInfo> records = List.of(entity);
|
||||||
|
return new Page<ProtocolInfo>(1, 1, 1).setRecords(records);
|
||||||
|
}
|
||||||
|
|
||||||
|
LambdaQueryWrapper<ProtocolInfo> query = new LambdaQueryWrapper<>();
|
||||||
|
if (StringUtils.isNotEmpty(so.getName())) {
|
||||||
|
query.like(StringUtils.isNotEmpty(so.getName()),ProtocolInfo::getName, so.getName());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(so.getIp())) {
|
||||||
|
query.like(ProtocolInfo::getIp, so.getIp());
|
||||||
|
}
|
||||||
|
if (so.getPort() != null) {
|
||||||
|
query.eq(ProtocolInfo::getPort, so.getPort());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(so.getStd())) {
|
||||||
|
query.like(ProtocolInfo::getStd, so.getStd());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(so.getTrans())) {
|
||||||
|
query.like(ProtocolInfo::getTrans, so.getTrans());
|
||||||
|
}
|
||||||
|
if (so.getEnable() != null) {
|
||||||
|
query.eq(ProtocolInfo::getEnable, so.getEnable());
|
||||||
|
}
|
||||||
|
query.orderByDesc(ProtocolInfo::getCreateTm);
|
||||||
|
|
||||||
|
return dao.page(so.getPageSo().toPage(), query);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
package com.gunshi.project.xyt.service;
|
||||||
|
|
||||||
|
import cn.hutool.db.Db;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.gunshi.project.xyt.mapper.ServiceResourceMonitorRMapper;
|
||||||
|
import com.gunshi.project.xyt.model.ServiceResource;
|
||||||
|
import com.gunshi.project.xyt.model.ServiceResourceAutoDao;
|
||||||
|
import com.gunshi.project.xyt.model.ServiceResourceMonitorR;
|
||||||
|
import com.gunshi.project.xyt.model.ServiceResourceMonitorRAutoDao;
|
||||||
|
import com.gunshi.project.xyt.so.ServiceResourceSo;
|
||||||
|
import com.gunshi.project.xyt.vo.ServiceResourceMonitorVo;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类描述
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-24
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ServiceResourceMonitorRService {
|
||||||
|
@Autowired
|
||||||
|
private ServiceResourceAutoDao serviceResourceDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ServiceResourceMonitorRAutoDao serviceMonitorDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ServiceResourceMonitorRMapper serviceMonitorMapper;
|
||||||
|
|
||||||
|
public Page<ServiceResourceMonitorVo> page(Page page, ServiceResourceSo so) {
|
||||||
|
return serviceMonitorMapper.page(page, so);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public Boolean removeById(String id) {
|
||||||
|
ServiceResource byId = serviceResourceDao.getById(id);
|
||||||
|
if (byId == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return serviceResourceDao.removeById(id) &&
|
||||||
|
serviceMonitorDao.remove(
|
||||||
|
new LambdaQueryWrapper<ServiceResourceMonitorR>()
|
||||||
|
.eq(ServiceResourceMonitorR::getSrId, id)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void scanByTm() {
|
||||||
|
List<ServiceResource> serviceResources = serviceResourceDao.list();
|
||||||
|
for (ServiceResource serviceResource : serviceResources) {
|
||||||
|
if (StringUtils.isNotEmpty(serviceResource.getTargetTable()) &&
|
||||||
|
StringUtils.isNotEmpty(serviceResource.getTargetTmField())) {
|
||||||
|
// Db.getMap(new QueryWrapper<>().orderByDesc(serviceResource.getTargetTmField()).last("limit 1"), serviceResource.getTargetTable());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
package com.gunshi.project.xyt.so;
|
||||||
|
|
||||||
|
import com.gunshi.db.dto.PageSo;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.Query;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 协议信息查询参数
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "协议信息查询参数")
|
||||||
|
public class ProtocolInfoSo {
|
||||||
|
|
||||||
|
@NotNull(message = "分页参数不能为空")
|
||||||
|
private PageSo pageSo;
|
||||||
|
|
||||||
|
@Schema(description = "协议编码")
|
||||||
|
@NotEmpty(groups = {Query.class})
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "协议名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "IP地址")
|
||||||
|
private String ip;
|
||||||
|
|
||||||
|
@Schema(description = "监听端口")
|
||||||
|
private Integer port;
|
||||||
|
|
||||||
|
@Schema(description = "协议标准")
|
||||||
|
private String std;
|
||||||
|
|
||||||
|
@Schema(description = "传输协议,TCP或UDP")
|
||||||
|
private String trans;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用, 1启用,0不启用,默认1")
|
||||||
|
private Integer enable;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.gunshi.project.xyt.so;
|
||||||
|
|
||||||
|
import com.gunshi.db.dto.DateTimeRangeSo;
|
||||||
|
import com.gunshi.db.dto.PageSo;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.QueryPage;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.QueryTimeRange;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务资源查询参数
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "服务资源查询参数")
|
||||||
|
public class ServiceResourceSo {
|
||||||
|
|
||||||
|
@NotNull(message = "分页参数不能为空", groups = {QueryPage.class})
|
||||||
|
private PageSo pageSo;
|
||||||
|
|
||||||
|
@NotNull(message = "时间范围不能为空", groups = {QueryTimeRange.class})
|
||||||
|
private DateTimeRangeSo timeSo;
|
||||||
|
|
||||||
|
@Schema(description = "服务名称")
|
||||||
|
private String name;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.gunshi.project.xyt.so;
|
||||||
|
|
||||||
|
import com.gunshi.db.dto.DateTimeRangeSo;
|
||||||
|
import com.gunshi.db.dto.PageSo;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.QueryPage;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.QueryTimeRange;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务资源查询参数
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "服务资源查询参数")
|
||||||
|
public class ServiceResourceTypeSo {
|
||||||
|
|
||||||
|
@NotNull(message = "分页参数不能为空", groups = {QueryPage.class})
|
||||||
|
private PageSo pageSo;
|
||||||
|
|
||||||
|
@Schema(description = "服务名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "服务类型")
|
||||||
|
private String type;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.gunshi.project.xyt.validate.markers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类描述
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-23
|
||||||
|
*/
|
||||||
|
public interface Delete {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.gunshi.project.xyt.validate.markers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类描述
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-23
|
||||||
|
*/
|
||||||
|
public interface Insert {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.gunshi.project.xyt.validate.markers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类描述
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-23
|
||||||
|
*/
|
||||||
|
public interface Query {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.gunshi.project.xyt.validate.markers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类描述
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-24
|
||||||
|
*/
|
||||||
|
public interface QueryPage {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.gunshi.project.xyt.validate.markers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类描述
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-24
|
||||||
|
*/
|
||||||
|
public interface QueryTimeRange {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.gunshi.project.xyt.validate.markers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类描述
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-23
|
||||||
|
*/
|
||||||
|
public interface Update {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.gunshi.project.xyt.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.gunshi.core.dateformat.DateFormatString;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类描述
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-24
|
||||||
|
*/
|
||||||
|
public class ServiceResourceMonitorVo {
|
||||||
|
//region ServiceResourceMonitorR
|
||||||
|
@Schema(description = "id")
|
||||||
|
@TableId("ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "服务资源id")
|
||||||
|
@TableField("SR_ID")
|
||||||
|
private String srId;
|
||||||
|
|
||||||
|
@Schema(description = "最近数据时间")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||||
|
@TableField("LAST_CHANGE_TM")
|
||||||
|
private Date lastChangeTm;
|
||||||
|
|
||||||
|
@Schema(description = "共享数据(条)")
|
||||||
|
@TableField("RECORD_COUNT")
|
||||||
|
private Long recordCount;
|
||||||
|
|
||||||
|
@Schema(description = "共享站点数量")
|
||||||
|
@TableField("ST_COUNT")
|
||||||
|
private Integer stCount;
|
||||||
|
|
||||||
|
@Schema(description = "今日共享数据(条)")
|
||||||
|
@TableField("TODAY_COUNT")
|
||||||
|
private Long todayCount;
|
||||||
|
|
||||||
|
@Schema(description = "本周共享数据(条)")
|
||||||
|
@TableField("WEEKLY_COUNT")
|
||||||
|
private Long weeklyCount;
|
||||||
|
|
||||||
|
@Schema(description = "本月共享数据(条)")
|
||||||
|
@TableField("MONTHLY_COUNT")
|
||||||
|
private Long monthlyCount;
|
||||||
|
|
||||||
|
@Schema(description = "本年共享数据(条)")
|
||||||
|
@TableField("YEARLY_COUNT")
|
||||||
|
private Long yearlyCount;
|
||||||
|
//endregion
|
||||||
|
|
||||||
|
//region ServiceResource
|
||||||
|
@Schema(description = "服务名称")
|
||||||
|
@TableField("NAME")
|
||||||
|
private String name;
|
||||||
|
//endregion
|
||||||
|
}
|
||||||
|
|
@ -56,3 +56,6 @@ gunshi:
|
||||||
username: gunshi_logger
|
username: gunshi_logger
|
||||||
password: 1234567a
|
password: 1234567a
|
||||||
|
|
||||||
|
mybatis-plus:
|
||||||
|
configuration:
|
||||||
|
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
|
|
@ -0,0 +1,168 @@
|
||||||
|
/*
|
||||||
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
|
Source Server : dev-mssql
|
||||||
|
Source Server Type : SQL Server
|
||||||
|
Source Server Version : 16001000
|
||||||
|
Source Host : 10.0.41.115:1433
|
||||||
|
Source Catalog : xyt
|
||||||
|
Source Schema : dbo
|
||||||
|
|
||||||
|
Target Server Type : SQL Server
|
||||||
|
Target Server Version : 16001000
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 24/01/2024 16:12:30
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for SERVICE_RESOURCE
|
||||||
|
-- ----------------------------
|
||||||
|
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[SERVICE_RESOURCE]') AND type IN ('U'))
|
||||||
|
DROP TABLE [dbo].[SERVICE_RESOURCE]
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE TABLE [dbo].[SERVICE_RESOURCE] (
|
||||||
|
[ID] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL,
|
||||||
|
[NAME] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL,
|
||||||
|
[DESCRIPTION] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL,
|
||||||
|
[SERVICE_TYPE] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL,
|
||||||
|
[URL] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL,
|
||||||
|
[PORT] int NULL,
|
||||||
|
[PROVIDER] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL,
|
||||||
|
[TARGET_TABLE] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL,
|
||||||
|
[TARGET_TM_FIELD] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL,
|
||||||
|
[ROUTE] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL,
|
||||||
|
[CONTACT] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL,
|
||||||
|
[PHONE] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL,
|
||||||
|
[REGISTER_DATE] datetime NULL,
|
||||||
|
[UPDATE_TM] datetime NULL,
|
||||||
|
[ENABLE] int NULL,
|
||||||
|
[STATUS] int NULL,
|
||||||
|
[LAST_DATA_TM] datetime NULL
|
||||||
|
)
|
||||||
|
GO
|
||||||
|
|
||||||
|
ALTER TABLE [dbo].[SERVICE_RESOURCE] SET (LOCK_ESCALATION = TABLE)
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sp_addextendedproperty
|
||||||
|
'MS_Description', N'id',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'SERVICE_RESOURCE',
|
||||||
|
'COLUMN', N'ID'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sp_addextendedproperty
|
||||||
|
'MS_Description', N'服务名称',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'SERVICE_RESOURCE',
|
||||||
|
'COLUMN', N'NAME'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sp_addextendedproperty
|
||||||
|
'MS_Description', N'服务描述',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'SERVICE_RESOURCE',
|
||||||
|
'COLUMN', N'DESCRIPTION'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sp_addextendedproperty
|
||||||
|
'MS_Description', N'服务类型',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'SERVICE_RESOURCE',
|
||||||
|
'COLUMN', N'SERVICE_TYPE'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sp_addextendedproperty
|
||||||
|
'MS_Description', N'服务地址',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'SERVICE_RESOURCE',
|
||||||
|
'COLUMN', N'URL'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sp_addextendedproperty
|
||||||
|
'MS_Description', N'服务端口',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'SERVICE_RESOURCE',
|
||||||
|
'COLUMN', N'PORT'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sp_addextendedproperty
|
||||||
|
'MS_Description', N'服务提供者',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'SERVICE_RESOURCE',
|
||||||
|
'COLUMN', N'PROVIDER'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sp_addextendedproperty
|
||||||
|
'MS_Description', N'目标表',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'SERVICE_RESOURCE',
|
||||||
|
'COLUMN', N'TARGET_TABLE'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sp_addextendedproperty
|
||||||
|
'MS_Description', N'目标时间依据字段',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'SERVICE_RESOURCE',
|
||||||
|
'COLUMN', N'TARGET_TM_FIELD'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sp_addextendedproperty
|
||||||
|
'MS_Description', N'路由',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'SERVICE_RESOURCE',
|
||||||
|
'COLUMN', N'ROUTE'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sp_addextendedproperty
|
||||||
|
'MS_Description', N'联系人',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'SERVICE_RESOURCE',
|
||||||
|
'COLUMN', N'CONTACT'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sp_addextendedproperty
|
||||||
|
'MS_Description', N'联系电话',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'SERVICE_RESOURCE',
|
||||||
|
'COLUMN', N'PHONE'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sp_addextendedproperty
|
||||||
|
'MS_Description', N'注册日期',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'SERVICE_RESOURCE',
|
||||||
|
'COLUMN', N'REGISTER_DATE'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sp_addextendedproperty
|
||||||
|
'MS_Description', N'修改日期',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'SERVICE_RESOURCE',
|
||||||
|
'COLUMN', N'UPDATE_TM'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sp_addextendedproperty
|
||||||
|
'MS_Description', N'启用, 0-停用,1-启用',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'SERVICE_RESOURCE',
|
||||||
|
'COLUMN', N'ENABLE'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sp_addextendedproperty
|
||||||
|
'MS_Description', N'状态, 0-不在线/异常,1-在线/正常',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'SERVICE_RESOURCE',
|
||||||
|
'COLUMN', N'STATUS'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sp_addextendedproperty
|
||||||
|
'MS_Description', N'最近数据时间',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'SERVICE_RESOURCE',
|
||||||
|
'COLUMN', N'LAST_DATA_TM'
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.gunshi.project.xyt;
|
||||||
|
|
||||||
|
import com.gunshi.core.annotation.GunShiApplication;
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类描述
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-23
|
||||||
|
*/
|
||||||
|
@GunShiApplication
|
||||||
|
@MapperScan(basePackages = {"com.gunshi.**.mapper", "com.gunshi.**.model"})
|
||||||
|
public class TestMain {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.gunshi.project.xyt.controller;
|
||||||
|
|
||||||
|
import com.gunshi.logging.access.annotation.LoginLogging;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类描述
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-23
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/test")
|
||||||
|
public class TestController {
|
||||||
|
@LoginLogging
|
||||||
|
@GetMapping("/ping")
|
||||||
|
public String pong() {
|
||||||
|
return "pong";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -28,6 +28,13 @@ spring:
|
||||||
gunshi:
|
gunshi:
|
||||||
core:
|
core:
|
||||||
appName: project-xyt
|
appName: project-xyt
|
||||||
|
file:
|
||||||
|
key: test.by_lyf.tmp
|
||||||
|
secret: xPXPAb63FphkGkPU0ZZkNIXmDzjDVeF3PBH6ZEKw
|
||||||
|
endpoint: http://223.75.53.141:9102
|
||||||
|
publicBucket: test.by-lyf.tmp
|
||||||
|
loginBucket: test.by-lyf.tmp
|
||||||
|
privateBucket: test.by-lyf.tmp
|
||||||
access:
|
access:
|
||||||
logging:
|
logging:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
@ -48,10 +55,4 @@ gunshi:
|
||||||
database: gunshi-logging
|
database: gunshi-logging
|
||||||
username: gunshi_logger
|
username: gunshi_logger
|
||||||
password: 1234567a
|
password: 1234567a
|
||||||
file:
|
|
||||||
key: test.by_lyf.tmp
|
|
||||||
secret: xPXPAb63FphkGkPU0ZZkNIXmDzjDVeF3PBH6ZEKw
|
|
||||||
endpoint: http://223.75.53.141:9102
|
|
||||||
publicBucket: test.by-lyf.tmp
|
|
||||||
loginBucket: test.by-lyf.tmp
|
|
||||||
privateBucket: test.by-lyf.tmp
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue