对接dmp
parent
272ac2f67f
commit
e346b5b326
@ -0,0 +1,44 @@
|
||||
package com.baiye.modules.system.domain;
|
||||
|
||||
import com.baiye.util.JpaConverterListJson;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jt
|
||||
* 关联动态任务和tag
|
||||
*/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name = "tb_task_tag")
|
||||
@EntityListeners(AuditingEntityListener.class)
|
||||
public class TaskTag implements Serializable {
|
||||
|
||||
@Id
|
||||
@Column(name = "id")
|
||||
@ApiModelProperty(value = "id")
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@Column(name = "task_id")
|
||||
@ApiModelProperty(value = "动态任务id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long taskId;
|
||||
|
||||
@Column(name = "user_id")
|
||||
@ApiModelProperty(value = "业务管理员id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long userId;
|
||||
|
||||
@Column(name = "tag")
|
||||
@ApiModelProperty(value = "tag")
|
||||
@Convert(converter = JpaConverterListJson.class)
|
||||
private List<String> tag;
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
package com.baiye.modules.system.httpRequest;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author jt
|
||||
* <p>
|
||||
* 请求ad_back 将任务对应的tag值传过去
|
||||
*/
|
||||
@Slf4j
|
||||
public class AdBackRequestApi {
|
||||
@Value("${ad-back.url}")
|
||||
private String url;
|
||||
|
||||
@Value("${ad-back.token}")
|
||||
private String token;
|
||||
|
||||
public void sendTag(Long taskId, Long userId, List<String> tagStr) {
|
||||
Map<String, Object> map = new HashMap<>(2);
|
||||
map.put("taskId", taskId);
|
||||
map.put("userId", userId);
|
||||
map.put("token", token);
|
||||
map.put("tagStr", tagStr);
|
||||
String post = HttpUtil.post(url, JSONUtil.toJsonStr(map));
|
||||
log.info("推送结果={}", post);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,29 @@
|
||||
package com.baiye.modules.system.service.dto;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jt
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class TaskTagDto {
|
||||
/**
|
||||
* 任务名
|
||||
*/
|
||||
@NotNull
|
||||
private String taskName;
|
||||
/**
|
||||
* 业务管理员
|
||||
*/
|
||||
@NotNull
|
||||
private Long userId;
|
||||
@NotNull
|
||||
private List<String> tagStr;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.baiye.module.entity;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author jt
|
||||
* 导入的imel
|
||||
*/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name = "tb_task_imel")
|
||||
@EntityListeners(AuditingEntityListener.class)
|
||||
public class TaskImel implements Serializable {
|
||||
@Id
|
||||
@Column(name = "id")
|
||||
@ApiModelProperty(value = "id")
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@Column(name = "task_id")
|
||||
@ApiModelProperty(value = "动态任务id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long taskId;
|
||||
|
||||
@Column(name = "imel")
|
||||
@ApiModelProperty(value = "imel")
|
||||
private String imel;
|
||||
|
||||
}
|
Loading…
Reference in New Issue