Merge pull request 'master' (#1) from master into dev

Reviewed-on: #1
dev
TreeData 2024-08-21 11:39:47 +08:00
commit b3c85653ec
11 changed files with 203 additions and 3 deletions

View File

@ -0,0 +1,31 @@
package com.muyu.domain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.Date;
/**
* @Authorqdm
* @Packagecom.muyu.domain
* @Projectcloud-etlsdadawd
* @nameDictionary
* @Date2024/8/21 10:31
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public class Dictionary {
private Integer createBy;
private Date createTime;
private Integer updateBy;
private Date updateTime;
private String remark;
private Long id;
private String code;
private String descriotion;
private Integer typeId;
}

View File

@ -0,0 +1,23 @@
package com.muyu.domain;
import jdk.jfr.DataAmount;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
/**
* @Authorqdm
* @Packagecom.muyu.domain
* @Projectcloud-etlsdadawd
* @nameDictionaryTYpe
* @Date2024/8/21 10:32
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public class DictionaryTYpe {
private Long id;
private String typeName;
}

View File

@ -1,4 +1,4 @@
package com.muyu.domain.Req;
package com.muyu.domain.req;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

View File

@ -0,0 +1,33 @@
package com.muyu.cloud.etl.controller;
import com.muyu.cloud.etl.service.DictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.xml.transform.Result;
/**
* @Authorqdm
* @Packagecom.muyu.cloud.etl.controller
* @Projectcloud-etlsdadawd
* @nameDictionaryController
* @Date2024/8/21 10:34
*/
@RestController
@RequestMapping("/etl")
public class DictionaryController {
@Autowired
private DictionaryService dictionaryService;
@PostMapping("/open/{id}")
public Result open(@PathVariable Long id){
return dictionaryService.open(id);
}
@PostMapping("/close/{id}")
public Result close(@PathVariable Long id){
return dictionaryService.close(id);
}
}

View File

@ -0,0 +1,20 @@
package com.muyu.cloud.etl.mapper;
import feign.Param;
import org.apache.ibatis.annotations.Mapper;
import javax.xml.transform.Result;
/**
* @Authorqdm
* @Packagecom.muyu.cloud.etl.mapper
* @Projectcloud-etlsdadawd
* @nameDictionaryMapper
* @Date2024/8/21 10:39
*/
@Mapper
public interface DictionaryMapper {
Result open(@Param("id") Long id);
Result close(@Param("id") Long id);
}

View File

@ -0,0 +1,16 @@
package com.muyu.cloud.etl.service;
import javax.xml.transform.Result;
/**
* @Authorqdm
* @Packagecom.muyu.cloud.etl.service
* @Projectcloud-etlsdadawd
* @nameDictionaryService
* @Date2024/8/21 10:35
*/
public interface DictionaryService {
Result open(Long id);
Result close(Long id);
}

View File

@ -0,0 +1,32 @@
package com.muyu.cloud.etl.service.impl;
import com.muyu.cloud.etl.mapper.DictionaryMapper;
import com.muyu.cloud.etl.service.DictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.xml.transform.Result;
import java.util.List;
/**
* @Authorqdm
* @Packagecom.muyu.cloud.etl.service.impl
* @Projectcloud-etlsdadawd
* @nameDictionaryServiceImpl
* @Date2024/8/21 10:35
*/
@Service
public class DictionaryServiceImpl implements DictionaryService {
@Autowired
private DictionaryMapper dictionaryMapper;
@Override
public Result open(Long id) {
return dictionaryMapper.open(id);
}
@Override
public Result close(Long id) {
return dictionaryMapper.close(id);
}
}

View File

@ -1,6 +1,13 @@
# Tomcat
server:
port: 10005
# nacos线上地址
nacos:
addr: 47.116.184.54:8848
user-name: nacos
password: nacos
namespace: cloud-2112
# Spring
spring:
application:
@ -13,9 +20,28 @@ spring:
nacos:
discovery:
# 服务注册地址
server-addr: ${nacos.addr}
# nacos用户名
username: ${nacos.user-name}
# nacos密码
password: ${nacos.password}
# 命名空间
namespace: ${nacos.namespace}
config:
# 服务注册地址
server-addr: ${nacos.addr}
# nacos用户名
username: ${nacos.user-name}
# nacos密码
password: ${nacos.password}
# 命名空间
namespace: ${nacos.namespace}
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
# 系统共享配置
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
# 系统环境Config共享配置
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.muyu.cloud.etl.mapper.DictionaryMapper">
<update id="open">
update dictionary set status = 1 where id = #{id}
</update>
<update id="close">
update dictionary set status = 2 where id = #{id}
</update>
</mapper>

View File

@ -87,3 +87,10 @@
21:58:12.219 [main] INFO c.a.d.p.DruidDataSource - [init,1002] - {dataSource-1,master} inited
21:58:12.222 [Druid-ConnectionPool-Create-136289025] INFO c.a.d.p.DruidAbstractDataSource - [setFailContinuous,1900] - {dataSource-1} failContinuous is true
21:58:12.223 [main] INFO o.a.c.c.StandardService - [log,173] - Stopping service [Tomcat]
11:33:52.158 [main] INFO c.m.c.e.MuYuEtlApplication - [logStartupProfileInfo,660] - The following 1 profile is active: "dev"
11:33:54.779 [main] INFO o.a.c.c.StandardService - [log,173] - Starting service [Tomcat]
11:33:54.779 [main] INFO o.a.c.c.StandardEngine - [log,173] - Starting Servlet engine: [Apache Tomcat/10.1.24]
11:33:54.858 [main] INFO o.a.c.c.C.[.[.[/] - [log,173] - Initializing Spring embedded WebApplicationContext
11:33:55.452 [main] INFO c.a.d.p.DruidDataSource - [init,1002] - {dataSource-1,master} inited
11:33:55.453 [Druid-ConnectionPool-Create-1932244125] INFO c.a.d.p.DruidAbstractDataSource - [setFailContinuous,1900] - {dataSource-1} failContinuous is true
11:33:55.454 [main] INFO o.a.c.c.StandardService - [log,173] - Stopping service [Tomcat]

View File

@ -6,8 +6,8 @@
<parent>
<groupId>com.muyu</groupId>
<artifactId>cloud-server-parent</artifactId>
<version>3.6.4</version>
<artifactId>cloud-server</artifactId>
<version>3.6.3</version>
</parent>
<groupId>com.muyu</groupId>