Commit 64e447eb by tiger

Merge branch 'v1.0.1' of http://192.168.3.233:8090/platform/platform-process-server into v1.0.1

# Conflicts:
#	platform-process/pom.xml
#	platform-process/src/main/java/cn/com/glsx/Application.java
#	platform-process/src/main/java/cn/com/glsx/process/job/DynamicConfig.java
#	platform-process/src/main/java/cn/com/glsx/process/job/DynamicTaskAdd.java
#	platform-process/src/main/java/cn/com/glsx/process/job/ElasticJobListener.java
#	platform-process/src/main/java/cn/com/glsx/process/modules/controller/TestJobController.java
2 parents 2872da07 253c9664
Showing 27 changed files with 1132 additions and 289 deletions
package cn.com.glsx.process.api;
import cn.com.glsx.process.modules.model.SopInstDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.Map;
/**
* @author payu
*/
@FeignClient(name = "rest-admin", contextId = "sop-inst", path = "/api/sopInsts/", decode404 = true)
public interface SopInstFeignClient {
/**
* 一、FeignClients使用注意事项:
* 1. @EnableFeignClients 默认扫描 xxxxApplication启动入口 所在包路径下的 @FeignClient bean,若无法扫描到, 可以在使用Feign调用外部模块的api时候,
* 需要在引用服务中 xxxxApplication 中的 `@EnableFeignClients(basePackages = "cn.tendyron.customer")` 添加外部包需要扫描FeignClient的路径,否则无法注入bean
* 2. @FeignClient 声明的类,使用 spring.application.name 作为 name配置 @FeignClient(name="xxxx"),如果想保留 context-path , 则需要配置 path 属性 ,如:@FeignClient(name="xxxx" , path="xxxx(context-path)")
* 3. @FeignClient 接口对应的实现类,需要使用 @RestController注解 声明
* 4. mapper注解不支持 : @GetMapping,@PostMapping , 参数要加 @RequestParam(“xxx”)
* 5. FeignClient 调用,实质是httpClient调用 ,若我们暴露的接口api,声明了对应的 http mapper 信息,在调用方调用时候,通过代理 发起了 http请求,到服务提供方对应的http服务上去,所以在服务提供方的接口,可以使用 @RestController
* 来声明接口的 实现,否则调用方无法找到 http 对应的路径,会报404 ;
* 或者 根据 api 声明的http 信息,构建一个 Controller ,再来调用接口的实现类,但是这样不太方便;
* 6.FeignClient是一个“客户端”,它是用来发起请求的,不是提供服务的。
*
*
* 二、fallback 几种模式:
* 1.EchoCenterFeignServiceFallback.class 直接fallback,获取不到HTTP请求错误状态码和信息
* 2.EchoCenterFeignFactory.class 特定类型工厂模式
* 3.FunFallbackFactory 使用统一的工厂模式处理
*
*
* 三、性能问题
* 1.Feign是一个http请求调用的轻量级框架,基于http协议,性能不如rpc
* 2.可以为Feign配置连接池,配合使用okhttp等
*/
/**
* 测试Feign Get ,普通处理
* 注意: @RequestParam("xx") 注解一定要写,而且属性名xx不能省略
*/
/**
* 通过实例默认输入参数查询指定门店模板实例
*
* @param instParam
* @return
*/
@GetMapping("/getOneByInstParam")
SopInstDTO getOneByInstParam(Map<String, Object> instParam);
}
package cn.com.glsx.process.modules.entity;
import java.util.Date;
import javax.persistence.*;
@Table(name = "job_manager")
public class JobManager {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(name = "job_name")
private String jobName;
private String cron;
@Column(name = "class")
private String className;
private String parameters;
@Column(name = "share_total_count")
private Integer shareTotalCount;
@Column(name = "del_flag")
private Integer delFlag;
@Column(name = "create_time")
private Date createTime;
@Column(name = "update_time")
private Date updateTime;
/**
* @return id
*/
public Integer getId() {
return id;
}
/**
* @param id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return job_name
*/
public String getJobName() {
return jobName;
}
/**
* @param jobName
*/
public void setJobName(String jobName) {
this.jobName = jobName == null ? null : jobName.trim();
}
/**
* @return cron
*/
public String getCron() {
return cron;
}
/**
* @param cron
*/
public void setCron(String cron) {
this.cron = cron == null ? null : cron.trim();
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
/**
* @return parameters
*/
public String getParameters() {
return parameters;
}
/**
* @param parameters
*/
public void setParameters(String parameters) {
this.parameters = parameters == null ? null : parameters.trim();
}
/**
* @return share_total_count
*/
public Integer getShareTotalCount() {
return shareTotalCount;
}
/**
* @param shareTotalCount
*/
public void setShareTotalCount(Integer shareTotalCount) {
this.shareTotalCount = shareTotalCount;
}
/**
* @return del_flag
*/
public Integer getDelFlag() {
return delFlag;
}
/**
* @param delFlag
*/
public void setDelFlag(Integer delFlag) {
this.delFlag = delFlag;
}
/**
* @return create_time
*/
public Date getCreateTime() {
return createTime;
}
/**
* @param createTime
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* @return update_time
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* @param updateTime
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file
......@@ -9,8 +9,8 @@ public class SopInst {
/**
* 启用状态:0,未启用;1,启用;-1,已删除/过期;
*/
public static final Byte INST_STATUS_UNUSED = 0;
public static final Byte INST_STATUS_DELETED = -1;
public static final byte INST_STATUS_UNUSED = 0;
public static final byte INST_STATUS_DELETED = -1;
/**
* 实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
......
package cn.com.glsx.process.modules.mapper;
import cn.com.glsx.process.modules.entity.JobManager;
import com.glsx.plat.mybatis.mapper.CommonBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface JobManagerMapper extends CommonBaseMapper<JobManager> {
JobManager findByName(@Param("jobName") String jobName);
}
\ No newline at end of file
package cn.com.glsx.process.modules.mapper;
import cn.com.glsx.process.modules.entity.SopInst;
import cn.com.glsx.process.modules.model.SopInstSearch;
import com.glsx.plat.mybatis.mapper.CommonBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface SopInstMapper extends CommonBaseMapper<SopInst> {
List<SopInst> selectByGroupId(SopInstSearch search);
/**
* 通过门店模板实例初始参数查询
*
* @param instParamJson
* @return
*/
List<SopInst> selectByInstParam(@Param("instParamJson") String instParamJson);
}
\ No newline at end of file
package cn.com.glsx.process.modules.model;
import cn.com.glsx.process.modules.entity.SopInstLink;
import cn.com.glsx.process.modules.entity.SopInstNode;
import java.util.Date;
import java.util.List;
public class SopInstDTO {
/**
* 实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
*/
private String instId;
/**
* 实例分组:当前场景下,分组id就是门店id
*/
private Integer grantId;
/**
* 实例名
*/
private String instName;
/**
* cron表达式,sop执行周期
*/
private String instCron;
/**
* sop简介
*/
private String instRemark;
private Date createTime;
private Date updateTime;
/**
* 启用状态:0,未启用;1,启用;-1,已删除/过期;
*/
private Byte instStatus;
/**
* 实例默认输入参数
*/
private String instParam;
/**
* sop有效期,每个sop都设置一个有效期,到期自动停止。
*/
private Date expireTime;
/**
* 当前生效的批次
*/
private String batchNo;
/**
* sop任务节点
*/
private List<SopInstNode> nodes;
/**
* sop任务节点连接
*/
private List<SopInstLink> links;
/**
* 获取实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
*
* @return inst_id - 实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
*/
public String getInstId() {
return instId;
}
/**
* 设置实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
*
* @param instId 实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
*/
public void setInstId(String instId) {
this.instId = instId == null ? null : instId.trim();
}
/**
* 获取实例分组:当前场景下,分组id就是门店id
*
* @return grant_id - 实例分组:当前场景下,分组id就是门店id
*/
public Integer getGrantId() {
return grantId;
}
/**
* 设置实例分组:当前场景下,分组id就是门店id
*
* @param grantId 实例分组:当前场景下,分组id就是门店id
*/
public void setGrantId(Integer grantId) {
this.grantId = grantId;
}
/**
* 获取实例名
*
* @return inst_name - 实例名
*/
public String getInstName() {
return instName;
}
/**
* 设置实例名
*
* @param instName 实例名
*/
public void setInstName(String instName) {
this.instName = instName == null ? null : instName.trim();
}
/**
* 获取cron表达式,sop执行周期
*
* @return inst_cron - cron表达式,sop执行周期
*/
public String getInstCron() {
return instCron;
}
/**
* 设置cron表达式,sop执行周期
*
* @param instCron cron表达式,sop执行周期
*/
public void setInstCron(String instCron) {
this.instCron = instCron == null ? null : instCron.trim();
}
/**
* 获取sop简介
*
* @return inst_remark - sop简介
*/
public String getInstRemark() {
return instRemark;
}
/**
* 设置sop简介
*
* @param instRemark sop简介
*/
public void setInstRemark(String instRemark) {
this.instRemark = instRemark == null ? null : instRemark.trim();
}
/**
* @return create_time
*/
public Date getCreateTime() {
return createTime;
}
/**
* @param createTime
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* @return update_time
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* @param updateTime
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* 获取启用状态:0,未启用;1,启用;-1,已删除/过期;
*
* @return inst_status - 启用状态:0,未启用;1,启用;-1,已删除/过期;
*/
public Byte getInstStatus() {
return instStatus;
}
/**
* 设置启用状态:0,未启用;1,启用;-1,已删除/过期;
*
* @param instStatus 启用状态:0,未启用;1,启用;-1,已删除/过期;
*/
public void setInstStatus(Byte instStatus) {
this.instStatus = instStatus;
}
public String getInstParam() {
return instParam;
}
public void setInstParam(String instParam) {
this.instParam = instParam;
}
/**
* 获取sop有效期,每个sop都设置一个有效期,到期自动停止。
*
* @return expire_time - sop有效期,每个sop都设置一个有效期,到期自动停止。
*/
public Date getExpireTime() {
return expireTime;
}
/**
* 设置sop有效期,每个sop都设置一个有效期,到期自动停止。
*
* @param expireTime sop有效期,每个sop都设置一个有效期,到期自动停止。
*/
public void setExpireTime(Date expireTime) {
this.expireTime = expireTime;
}
/**
* 获取当前生效的批次
*
* @return batch_no - 当前生效的批次
*/
public String getBatchNo() {
return batchNo;
}
/**
* 设置当前生效的批次
*
* @param batchNo 当前生效的批次
*/
public void setBatchNo(String batchNo) {
this.batchNo = batchNo == null ? null : batchNo.trim();
}
public List<SopInstNode> getNodes() {
return nodes;
}
public void setNodes(List<SopInstNode> nodes) {
this.nodes = nodes;
}
public List<SopInstLink> getLinks() {
return links;
}
public void setLinks(List<SopInstLink> links) {
this.links = links;
}
}
\ No newline at end of file
package cn.com.glsx.process.modules.model;
import cn.hutool.db.Page;
import javax.validation.constraints.NotEmpty;
import java.util.Date;
import java.util.List;
public class SopInstSearch extends Page {
/**
* 实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
*/
private String instId;
/**
* 实例分组:当前场景下,分组id就是门店id
*/
private Integer grantId;
/**
* 实例名
*/
private String instName;
/**
* cron表达式,sop执行周期
*/
private String instCron;
/**
* sop简介
*/
private String instRemark;
private Date createTime;
private Date updateTime;
/**
* 启用状态:0,未启用;1,启用;-1,已删除/过期;
*/
private List<Byte> instStatuses;
/**
* 实例默认输入参数
*/
private String instParam;
/**
* sop有效期,每个sop都设置一个有效期,到期自动停止。
*/
private Date expireTime;
/**
* 当前生效的批次
*/
private String batchNo;
/**
* 分组id就是门店id
*/
@NotEmpty(message = "门店id不能为空!")
private String groupId;
/**
* 获取实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
*
* @return inst_id - 实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
*/
public String getInstId() {
return instId;
}
/**
* 设置实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
*
* @param instId 实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
*/
public void setInstId(String instId) {
this.instId = instId == null ? null : instId.trim();
}
/**
* 获取实例分组:当前场景下,分组id就是门店id
*
* @return grant_id - 实例分组:当前场景下,分组id就是门店id
*/
public Integer getGrantId() {
return grantId;
}
/**
* 设置实例分组:当前场景下,分组id就是门店id
*
* @param grantId 实例分组:当前场景下,分组id就是门店id
*/
public void setGrantId(Integer grantId) {
this.grantId = grantId;
}
/**
* 获取实例名
*
* @return inst_name - 实例名
*/
public String getInstName() {
return instName;
}
/**
* 设置实例名
*
* @param instName 实例名
*/
public void setInstName(String instName) {
this.instName = instName == null ? null : instName.trim();
}
/**
* 获取cron表达式,sop执行周期
*
* @return inst_cron - cron表达式,sop执行周期
*/
public String getInstCron() {
return instCron;
}
/**
* 设置cron表达式,sop执行周期
*
* @param instCron cron表达式,sop执行周期
*/
public void setInstCron(String instCron) {
this.instCron = instCron == null ? null : instCron.trim();
}
/**
* 获取sop简介
*
* @return inst_remark - sop简介
*/
public String getInstRemark() {
return instRemark;
}
/**
* 设置sop简介
*
* @param instRemark sop简介
*/
public void setInstRemark(String instRemark) {
this.instRemark = instRemark == null ? null : instRemark.trim();
}
/**
* @return create_time
*/
public Date getCreateTime() {
return createTime;
}
/**
* @param createTime
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* @return update_time
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* @param updateTime
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public List<Byte> getInstStatuses() {
return instStatuses;
}
public void setInstStatuses(List<Byte> instStatuses) {
this.instStatuses = instStatuses;
}
public String getInstParam() {
return instParam;
}
public void setInstParam(String instParam) {
this.instParam = instParam;
}
/**
* 获取sop有效期,每个sop都设置一个有效期,到期自动停止。
*
* @return expire_time - sop有效期,每个sop都设置一个有效期,到期自动停止。
*/
public Date getExpireTime() {
return expireTime;
}
/**
* 设置sop有效期,每个sop都设置一个有效期,到期自动停止。
*
* @param expireTime sop有效期,每个sop都设置一个有效期,到期自动停止。
*/
public void setExpireTime(Date expireTime) {
this.expireTime = expireTime;
}
/**
* 获取当前生效的批次
*
* @return batch_no - 当前生效的批次
*/
public String getBatchNo() {
return batchNo;
}
/**
* 设置当前生效的批次
*
* @param batchNo 当前生效的批次
*/
public void setBatchNo(String batchNo) {
this.batchNo = batchNo == null ? null : batchNo.trim();
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>cn.com.glsx</groupId>
<artifactId>platform-process-server</artifactId>
......@@ -20,8 +18,7 @@
<artifactId>rest-admin-context</artifactId>
</dependency>
<!-- 接入微服务组件联盟 配置、注册、网关、链路、监控等
,单体应用无需引入(logback-spring.xml与logstash相关内容需要注释掉)-->
<!-- 接入微服务组件联盟 配置、注册、网关、链路、监控等 ,单体应用无需引入(logback-spring.xml与logstash相关内容需要注释掉)-->
<dependency>
<groupId>com.glsx</groupId>
<artifactId>rest-admin-alliance</artifactId>
......@@ -80,13 +77,13 @@
<version>2.1.5</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.freemarker/freemarker -->
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
</dependency>
</dependencies>
<build>
......
package cn.com.glsx;
import static java.time.ZoneId.of;
import static java.util.TimeZone.getTimeZone;
import java.util.TimeZone;
import javax.annotation.PostConstruct;
import cn.com.glsx.process.job.DynamicTaskAdd;
import com.glsx.plat.context.EnableRestAdmin;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;
import com.glsx.plat.context.EnableRestAdmin;
import javax.annotation.PostConstruct;
import java.util.TimeZone;
import static java.time.ZoneId.of;
import static java.util.TimeZone.getTimeZone;
/**
* @author payu
......@@ -23,7 +26,10 @@ import com.glsx.plat.context.EnableRestAdmin;
@EnableDiscoveryClient
@EnableFeignClients(basePackages = {"cn.com.glsx.*.api"})
@SpringBootApplication
public class Application {
public class Application implements CommandLineRunner {
@Autowired
private DynamicTaskAdd dynamicTaskAdd;
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
......@@ -34,4 +40,8 @@ public class Application {
TimeZone.setDefault(getTimeZone(of("Asia/Shanghai")));
}
@Override
public void run(String... args) throws Exception {
dynamicTaskAdd.scanAddJob();
}
}
package cn.com.glsx.process.job;
import com.dangdang.ddframe.job.reg.zookeeper.ZookeeperConfiguration;
import com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.dangdang.ddframe.job.reg.zookeeper.ZookeeperConfiguration;
import com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter;
import lombok.Data;
@Configuration
@Data
public class DynamicConfig {
@Value("${elaticjob.zookeeper.dynamiczk}")
......@@ -18,21 +15,20 @@ public class DynamicConfig {
@Value("${elaticjob.zookeeper.namespace}")
private String dynamicnamespace;
@Bean
public ZookeeperConfiguration zookeeperConfiguration() {
return new ZookeeperConfiguration(dynamiczk,dynamicnamespace);
return new ZookeeperConfiguration(dynamiczk, dynamicnamespace);
}
@Bean(initMethod = "init")
public ZookeeperRegistryCenter zookeeperRegistryCenter(ZookeeperConfiguration zookeeperConfiguration){
public ZookeeperRegistryCenter zookeeperRegistryCenter(ZookeeperConfiguration zookeeperConfiguration) {
return new ZookeeperRegistryCenter(zookeeperConfiguration);
}
@Bean
public ElasticJobListener elasticJobListener(){
return new ElasticJobListener(100, 100) ;
public ElasticJobListener elasticJobListener() {
return new ElasticJobListener(100, 100);
}
}
package cn.com.glsx.process.job;
import cn.com.glsx.process.modules.entity.JobManager;
import cn.com.glsx.process.modules.mapper.JobManagerMapper;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import com.dangdang.ddframe.job.config.JobCoreConfiguration;
import com.dangdang.ddframe.job.config.simple.SimpleJobConfiguration;
import com.dangdang.ddframe.job.lite.api.listener.ElasticJobListener;
import com.dangdang.ddframe.job.lite.config.LiteJobConfiguration;
import com.dangdang.ddframe.job.lite.internal.schedule.JobRegistry;
import com.dangdang.ddframe.job.lite.internal.schedule.JobScheduleController;
import com.dangdang.ddframe.job.lite.spring.api.SpringJobScheduler;
import com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@Component
@Slf4j
public class DynamicTaskAdd {
@Autowired
private ZookeeperRegistryCenter zookeeperRegistryCenter;
@Resource
private ElasticJobListener elasticJobListener;
@Autowired
private JobManagerMapper jobManagerMapper;
private static LiteJobConfiguration.Builder simpleJobConfigBuilder(String jobName,
Class<? extends SimpleJob> jobClass,
int shardTotalCount,
String cron,
String id) {
return LiteJobConfiguration.newBuilder(new SimpleJobConfiguration(
JobCoreConfiguration.newBuilder(jobName, cron, shardTotalCount).jobParameter(id).build(), jobClass.getCanonicalName()
));
}
/***
* 动态创建定时任务
* @param jobName:定时任务名称
* @param cron:表达式
* @param shardingTotalCount:分片数量
* @param instance:定时任务实例
* @param parameters:参数
*/
public void create(String jobName, String cron, int shardingTotalCount, SimpleJob instance, String parameters) {
LiteJobConfiguration jobConfig = simpleJobConfigBuilder(jobName, instance.getClass(), shardingTotalCount, cron, parameters)
.overwrite(true).build();
new SpringJobScheduler(instance, zookeeperRegistryCenter, jobConfig, elasticJobListener).init();
JobManager jobManager = jobManagerMapper.findByName(jobName);
if (jobManager == null) {
jobManager = new JobManager();
jobManager.setCron(cron);
jobManager.setJobName(jobName);
jobManager.setCreateTime(new Date());
jobManager.setParameters(parameters);
jobManager.setClassName(instance.getClass().getName());
jobManager.setDelFlag(0);
jobManager.setShareTotalCount(shardingTotalCount);
jobManagerMapper.insert(jobManager);
}
}
/**
* 更新定时任务
*
* @param jobName
* @param cron
*/
public void updateJob(String jobName, String cron) {
log.info("更新定时任务:jobName = {}, cron = {}", jobName, cron);
JobScheduleController jobScheduleController = JobRegistry.getInstance().getJobScheduleController(jobName);
if (jobScheduleController == null) {
log.info("未找到该job或者job已经下线{}", jobName);
} else {
jobScheduleController.rescheduleJob(cron);
JobManager jobManager = jobManagerMapper.findByName(jobName);
if (jobManager != null) {
jobManager.setCron(cron);
jobManager.setUpdateTime(new Date());
jobManagerMapper.updateByPrimaryKeySelective(jobManager);
}
}
}
/**
* 删除定时任务
*
* @param jobName
*/
public void removeJob(String jobName) {
log.info("删除定时任务:jobName = {}", jobName);
JobScheduleController jobScheduleController = JobRegistry.getInstance().getJobScheduleController(jobName);
if (jobScheduleController == null) {
log.info("未找到该job或者job已经下线{}", jobName);
} else {
jobScheduleController.shutdown();
JobManager jobManager = jobManagerMapper.findByName(jobName);
if (jobManager != null) {
jobManager.setDelFlag(-1);
jobManager.setUpdateTime(new Date());
jobManagerMapper.updateByPrimaryKeySelective(jobManager);
}
}
}
/**
* 扫描搜索下线的服务
*/
public void scanAddJob() {
List<JobManager> jobManagers = jobManagerMapper.selectAll();
if (CollectionUtils.isNotEmpty(jobManagers)) {
for (JobManager jobManager : jobManagers) {
String className = jobManager.getClassName();
try {
Class<?> aClass = Class.forName(className);
create(jobManager.getJobName(), jobManager.getCron(), jobManager.getShareTotalCount(), (SimpleJob) aClass.newInstance(), jobManager.getParameters());
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
throw new RuntimeException(e);
}
}
}
}
}
......@@ -3,9 +3,12 @@ package cn.com.glsx.process.job;
import com.dangdang.ddframe.job.executor.ShardingContexts;
import com.dangdang.ddframe.job.lite.api.listener.AbstractDistributeOnceElasticJobListener;
import javax.annotation.Resource;
public class ElasticJobListener extends AbstractDistributeOnceElasticJobListener {
public ElasticJobListener(long startedTimeoutMilliseconds, long completedTimeoutMilliseconds) {
super(startedTimeoutMilliseconds, completedTimeoutMilliseconds);
super(startedTimeoutMilliseconds,completedTimeoutMilliseconds);
}
@Override
......@@ -16,5 +19,6 @@ public class ElasticJobListener extends AbstractDistributeOnceElasticJobListener
@Override
public void doAfterJobExecutedAtLastCompleted(ShardingContexts shardingContexts) {
}
}
package cn.com.glsx.process.modules.api;
import cn.com.glsx.process.api.SopInstFeignClient;
import cn.com.glsx.process.modules.model.SopInstDTO;
import cn.com.glsx.process.modules.service.SopInstService;
import com.glsx.plat.core.annotation.ResponseResultBody;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Map;
/**
* 微服务应用在网关中处理统一返回体
*
* @author payu
*/
@Slf4j
@Tag(name = "SOP门店模板实例开放接口(Demo)")
@RestController
@RequestMapping(value = "/api/sopInsts")
@ResponseResultBody
public class SopInstApiController implements SopInstFeignClient {
@Resource
private SopInstService sopInstService;
@GetMapping("/getOneByInstParam")
@Override
public SopInstDTO getOneByInstParam(@RequestParam Map<String, Object> instParam) {
return sopInstService.getOneByInstParam(instParam);
}
}
package cn.com.glsx.process.modules.controller;
import cn.com.glsx.process.modules.BaseController;
import cn.com.glsx.process.modules.entity.SopInst;
import cn.com.glsx.process.modules.model.SopInstSearch;
import cn.com.glsx.process.modules.service.SopInstService;
import com.github.pagehelper.PageInfo;
import com.glsx.plat.core.annotation.ResponseResultBody;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@Slf4j
@Tag(name = "SOP门店模板实例开放接口")
@RestController
@RequestMapping(value = "/sop/sopInsts")
@ResponseResultBody
public class SopInstController extends BaseController {
@Resource
private SopInstService sopInstService;
@Operation(summary = "查询SOP门店模板实例分页列表", description = "查询SOP门店模板实例分页列表")
@GetMapping("/byGroupId")
public PageInfo<SopInst> selectByGroupId(@Validated SopInstSearch search) {
return sopInstService.selectByGroupId(search);
}
}
......@@ -32,8 +32,7 @@ public class SopTplController extends BaseController {
@Operation(summary = "SOP模板列表", description = "SOP模板列表")
@GetMapping
public PageInfo<SopTpl> page(SopTplSearch search) {
PageInfo<SopTpl> list = sopTplService.page(search);
return list;
return sopTplService.page(search);
}
@Operation(summary = "SOP模板详情", description = "SOP模板详情")
......
package cn.com.glsx.process.modules.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.glsx.plat.core.annotation.ResponseResultBody;
import cn.com.glsx.process.job.DynamicTaskService;
import cn.com.glsx.process.job.DynamicTaskAdd;
import cn.com.glsx.process.job.instance.DynamicJob;
import cn.com.glsx.process.job.instance.SopInstLoadJob;
import cn.com.glsx.process.modules.service.SopService;
import com.glsx.plat.core.annotation.ResponseResultBody;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Slf4j
@Tag(name = "动态任务(Demo)")
......@@ -25,16 +17,13 @@ import lombok.extern.slf4j.Slf4j;
public class TestJobController {
@Autowired
private DynamicTaskService dynamicTaskAdd;
@Autowired
private SopService sopService;
private DynamicTaskAdd dynamicTaskAdd;
@GetMapping("/jobtest")
@Operation(summary = "动态任务添加", description = "动态任务添加")
public void addtest(@RequestParam("cron") String cron) {
public void addtest(@RequestParam("cron") String cron,@RequestParam("jobName") String jobName) {
// cron表达式
dynamicTaskAdd.create("job001", cron, 1, new DynamicJob(), "test", "");
dynamicTaskAdd.create(jobName, cron, 1, new DynamicJob(), "test");
}
......@@ -48,15 +37,7 @@ public class TestJobController {
@PostMapping("/jobtestdel")
@Operation(summary = "动态任务删除", description = "动态任务删除")
public void deltest(@RequestParam("jobName") String jobName) {
dynamicTaskAdd.removeJob(jobName);
}
@GetMapping("/inst")
@Operation(summary = "动态任务添加", description = "动态任务添加")
public void inst(@RequestParam("instId") String instId) {
// cron表达式
dynamicTaskAdd.create("SopInstLoadJob", "11 */2 * * * ?", 1, new SopInstLoadJob(), "每2分钟同步一次", "");
dynamicTaskAdd.removeJob(jobName);
}
}
package cn.com.glsx.process.modules.converter;
import cn.com.glsx.process.modules.entity.SopInst;
import cn.com.glsx.process.modules.model.SopInstDTO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@Mapper
public interface SopInstConverter {
SopInstConverter INSTANCE = Mappers.getMapper(SopInstConverter.class);
SopInst do2do(SopInst sopInst);
SopInstDTO do2dto(SopInst sopInst);
}
package cn.com.glsx.process.modules.service;
import cn.com.glsx.process.modules.converter.SopInstConverter;
import cn.com.glsx.process.modules.entity.SopInst;
import cn.com.glsx.process.modules.entity.SopInstLink;
import cn.com.glsx.process.modules.entity.SopInstNode;
import cn.com.glsx.process.modules.mapper.SopInstLinkMapper;
import cn.com.glsx.process.modules.mapper.SopInstMapper;
import cn.com.glsx.process.modules.mapper.SopInstNodeMapper;
import cn.com.glsx.process.modules.model.SopInstDTO;
import cn.com.glsx.process.modules.model.SopInstSearch;
import cn.hutool.json.JSONUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Map;
@Service
public class SopInstService {
......@@ -11,6 +26,11 @@ public class SopInstService {
@Autowired
private SopInstMapper sopInstMapper;
@Autowired
private SopInstLinkMapper sopInstLinkMapper;
@Autowired
private SopInstNodeMapper sopInstNodeMapper;
/**
* 根据id查询
*
......@@ -58,4 +78,44 @@ public class SopInstService {
}
return false;
}
/**
* 查询SOP门店模板实例分页列表
*
* @param search
* @return
*/
public PageInfo<SopInst> selectByGroupId(SopInstSearch search) {
PageHelper.startPage(search.getPageNumber(), search.getPageSize());
List<SopInst> list = sopInstMapper.selectByGroupId(search);
return new PageInfo<>(list);
}
/**
* 通过实例默认输入参数查询指定门店模板实例
*
* @param instParam
* @return
*/
public SopInstDTO getOneByInstParam(Map<String, Object> instParam) {
String instParamJsonStr = JSONUtil.toJsonStr(instParam);
List<SopInst> sopInsts = sopInstMapper.selectByInstParam(instParamJsonStr);
if (CollectionUtils.isEmpty(sopInsts)) {
return null;
}
Assert.state(sopInsts.size() < 2, "根据查询条件找到多条记录,请检查参数是否有误!");
SopInstDTO sopInstDTO = SopInstConverter.INSTANCE.do2dto(sopInsts.get(0));
String instId = sopInstDTO.getInstId();
SopInstNode nodeQuery = new SopInstNode();
nodeQuery.setInstId(instId);
List<SopInstNode> nodes = sopInstNodeMapper.select(nodeQuery);
sopInstDTO.setNodes(nodes);
SopInstLink linkQuery = new SopInstLink();
linkQuery.setInstId(instId);
List<SopInstLink> links = sopInstLinkMapper.select(linkQuery);
sopInstDTO.setLinks(links);
return sopInstDTO;
}
}
......@@ -78,7 +78,6 @@ public class SopTplGrantService {
SopTplLink linkQuery = new SopTplLink();
linkQuery.setTplId(tplId);
List<SopTplLink> links = sopTplLinkMapper.select(linkQuery);
int count = sopTplGrantMapper.countAllByTplId(tplId);
SopTplConverter sopTplConverter = SopTplConverter.INSTANCE;
SopTplLinKConverter sopTplLinKConverter = SopTplLinKConverter.INSTANCE;
......
<?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="cn.com.glsx.process.modules.mapper.JobManagerMapper">
<resultMap id="BaseResultMap" type="cn.com.glsx.process.modules.entity.JobManager">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="job_name" jdbcType="VARCHAR" property="jobName" />
<result column="cron" jdbcType="VARCHAR" property="cron" />
<result column="class" jdbcType="VARCHAR" property="className" />
<result column="parameters" jdbcType="VARCHAR" property="parameters" />
<result column="share_total_count" jdbcType="INTEGER" property="shareTotalCount" />
<result column="del_flag" jdbcType="INTEGER" property="delFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
-->
id, job_name, cron, class, parameters, share_total_count, del_flag, create_time,
update_time
</sql>
<select id="findByName" resultType="cn.com.glsx.process.modules.entity.JobManager"
parameterType="java.lang.String">
select * from job_manager
where job_name=#{jobName} LIMIT 1
</select>
</mapper>
\ No newline at end of file
......@@ -25,4 +25,25 @@
inst_id, grant_id, inst_name, inst_cron, inst_remark, create_time, update_time, inst_status,
inst_param, inst_snapshot, expire_time, batch_no
</sql>
<select id="selectByGroupId" resultType="cn.com.glsx.process.modules.entity.SopInst">
SELECT si.inst_id, si.grant_id, si.inst_name, si.inst_cron, si.inst_remark, si.create_time, si.update_time, si.inst_status,
si.expire_time, si.batch_no
FROM sop_inst AS si
INNER JOIN sop_tpl_grant AS stg ON si.grant_id = stg.grant_id
WHERE stg.group_id = #{groupId}
<if test="instStatuses != null and instStatuses.size() > 0">
AND si.inst_status IN
<foreach collection="instStatuses" open="(" separator="," close=")" item="status">
#{status}
</foreach>
</if>
ORDER BY si.inst_status DESC
</select>
<select id="selectByInstParam" resultType="cn.com.glsx.process.modules.entity.SopInst">
SELECT
<include refid="Base_Column_List"/>
FROM sop_inst WHERE JSON_CONTAINS(inst_param, #{instParamJson},'$');
</select>
</mapper>
\ No newline at end of file
......@@ -12,7 +12,7 @@
<!--<property name="beginningDelimiter" value="`"/>-->
<!--<property name="endingDelimiter" value="`"/>-->
</plugin>
<jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://192.168.3.227:3306/platform_process?characterEncoding=utf8" userId="dev_admin" password="1f7e1ed2" />
<jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://192.168.3.222:3308/platform_process_dev?characterEncoding=utf8" userId="user_zhouhb" password="WoWP7N1u" />
<javaTypeResolver>
<property name="forceBigDecimals" value="false" />
</javaTypeResolver>
......@@ -34,7 +34,7 @@
<!--<table tableName="sop_data_source" domainObjectName="SopDataSource" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
</table>-->
<table tableName="sop_tpl_node" domainObjectName="SopTplNode" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">
<!-- <table tableName="sop_tpl_node" domainObjectName="SopTplNode" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
<columnOverride column="node_param_def" javaType="java.lang.String" jdbcType="VARCHAR" />
<columnOverride column="node_content_def" javaType="java.lang.String" jdbcType="VARCHAR" />
......@@ -77,6 +77,10 @@
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
<columnOverride column="inst_param" javaType="java.lang.String" jdbcType="VARCHAR" />
<columnOverride column="inst_snapshot" javaType="java.lang.String" jdbcType="VARCHAR" />
</table>-->
<table tableName="job_manager" domainObjectName="JobManager" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
</table>
</context>
</generatorConfiguration>
package cn.com.glsx.process.modules.converter;
import cn.com.glsx.process.modules.entity.SopInst;
import cn.com.glsx.process.modules.entity.SopTpl;
import cn.com.glsx.process.modules.model.SopTplDTO;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2023-09-11T15:01:39+0800",
comments = "version: 1.5.2.Final, compiler: javac, environment: Java 1.8.0_261 (Oracle Corporation)"
)
public class SopTplConverterImpl implements SopTplConverter {
@Override
public SopTplDTO do2dto(SopTpl sopTpl) {
if ( sopTpl == null ) {
return null;
}
SopTplDTO sopTplDTO = new SopTplDTO();
sopTplDTO.setTplId( sopTpl.getTplId() );
sopTplDTO.setTplName( sopTpl.getTplName() );
sopTplDTO.setTplCron( sopTpl.getTplCron() );
sopTplDTO.setTplRemark( sopTpl.getTplRemark() );
sopTplDTO.setTplStatus( sopTpl.getTplStatus() );
sopTplDTO.setTplParamDef( sopTpl.getTplParamDef() );
sopTplDTO.setTplResultDef( sopTpl.getTplResultDef() );
sopTplDTO.setTplSingleton( sopTpl.getTplSingleton() );
sopTplDTO.setCreateTime( sopTpl.getCreateTime() );
sopTplDTO.setUpdateTime( sopTpl.getUpdateTime() );
return sopTplDTO;
}
@Override
public SopTpl dto2do(SopTplDTO sopTplDTO) {
if ( sopTplDTO == null ) {
return null;
}
SopTpl sopTpl = new SopTpl();
sopTpl.setTplId( sopTplDTO.getTplId() );
sopTpl.setTplName( sopTplDTO.getTplName() );
sopTpl.setTplCron( sopTplDTO.getTplCron() );
sopTpl.setTplRemark( sopTplDTO.getTplRemark() );
sopTpl.setTplStatus( sopTplDTO.getTplStatus() );
sopTpl.setTplParamDef( sopTplDTO.getTplParamDef() );
sopTpl.setTplResultDef( sopTplDTO.getTplResultDef() );
sopTpl.setTplSingleton( sopTplDTO.getTplSingleton() );
sopTpl.setCreateTime( sopTplDTO.getCreateTime() );
sopTpl.setUpdateTime( sopTplDTO.getUpdateTime() );
return sopTpl;
}
@Override
public SopInst do2inst(SopTpl sopTpl) {
if ( sopTpl == null ) {
return null;
}
SopInst sopInst = new SopInst();
sopInst.setInstName( sopTpl.getTplName() );
sopInst.setInstCron( sopTpl.getTplCron() );
sopInst.setInstRemark( sopTpl.getTplRemark() );
sopInst.setInstParam( sopTpl.getTplParamDef() );
sopInst.setCreateTime( sopTpl.getCreateTime() );
sopInst.setUpdateTime( sopTpl.getUpdateTime() );
return sopInst;
}
}
package cn.com.glsx.process.modules.converter;
import cn.com.glsx.process.modules.entity.SopInstLink;
import cn.com.glsx.process.modules.entity.SopTplLink;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2023-09-11T15:01:39+0800",
comments = "version: 1.5.2.Final, compiler: javac, environment: Java 1.8.0_261 (Oracle Corporation)"
)
public class SopTplLinKConverterImpl implements SopTplLinKConverter {
@Override
public SopInstLink tpl2inst(SopTplLink link) {
if ( link == null ) {
return null;
}
SopInstLink sopInstLink = new SopInstLink();
sopInstLink.setSourceId( link.getSourceId() );
sopInstLink.setTargetId( link.getTargetId() );
return sopInstLink;
}
}
package cn.com.glsx.process.modules.converter;
import cn.com.glsx.process.modules.entity.SopInstNode;
import cn.com.glsx.process.modules.entity.SopTplNode;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2023-09-11T15:01:39+0800",
comments = "version: 1.5.2.Final, compiler: javac, environment: Java 1.8.0_261 (Oracle Corporation)"
)
public class SopTplNodeConverterImpl implements SopTplNodeConverter {
@Override
public SopInstNode tpl2inst(SopTplNode node) {
if ( node == null ) {
return null;
}
SopInstNode sopInstNode = new SopInstNode();
sopInstNode.setNodeParam( node.getNodeParamDef() );
sopInstNode.setNodeContent( node.getNodeContentDef() );
sopInstNode.setNodeId( node.getNodeId() );
sopInstNode.setNodeName( node.getNodeName() );
sopInstNode.setNodeType( node.getNodeType() );
sopInstNode.setNodeLabel( node.getNodeLabel() );
sopInstNode.setNodeKey( node.getNodeKey() );
sopInstNode.setNodeShow( node.getNodeShow() );
sopInstNode.setNodeVisible( node.getNodeVisible() );
sopInstNode.setNodeCron( node.getNodeCron() );
sopInstNode.setNodeExpireCron( node.getNodeExpireCron() );
return sopInstNode;
}
}
package cn.com.glsx.process.modules.converter;
import cn.com.glsx.process.modules.entity.User;
import cn.com.glsx.process.modules.model.UserBO;
import cn.com.glsx.process.modules.model.UserDTO;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2023-09-11T15:01:39+0800",
comments = "version: 1.5.2.Final, compiler: javac, environment: Java 1.8.0_261 (Oracle Corporation)"
)
public class UserConverterImpl implements UserConverter {
@Override
public UserDTO do2dto(User user) {
if ( user == null ) {
return null;
}
UserDTO userDTO = new UserDTO();
userDTO.setId( user.getId() );
userDTO.setAccount( user.getAccount() );
userDTO.setUsername( user.getUsername() );
userDTO.setRealname( user.getRealname() );
userDTO.setPassword( user.getPassword() );
userDTO.setPhone( user.getPhone() );
return userDTO;
}
@Override
public User dto2do(UserDTO userDTO) {
if ( userDTO == null ) {
return null;
}
User user = new User();
user.setId( userDTO.getId() );
user.setAccount( userDTO.getAccount() );
user.setPassword( userDTO.getPassword() );
user.setUsername( userDTO.getUsername() );
user.setRealname( userDTO.getRealname() );
user.setPhone( userDTO.getPhone() );
return user;
}
@Override
public UserBO do2bo(User user) {
if ( user == null ) {
return null;
}
UserBO userBO = new UserBO();
userBO.setRealName( user.getRealname() );
userBO.setId( user.getId() );
userBO.setAccount( user.getAccount() );
userBO.setPassword( user.getPassword() );
userBO.setUsername( user.getUsername() );
userBO.setPhone( user.getPhone() );
userBO.setAvatar( user.getAvatar() );
return userBO;
}
@Override
public User bo2do(UserBO userBO) {
if ( userBO == null ) {
return null;
}
User user = new User();
user.setRealname( userBO.getRealName() );
user.setId( userBO.getId() );
user.setAccount( userBO.getAccount() );
user.setPassword( userBO.getPassword() );
user.setUsername( userBO.getUsername() );
user.setPhone( userBO.getPhone() );
user.setAvatar( userBO.getAvatar() );
return user;
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!