forked from github/dataease
Merge branch 'main' of github.com:dataease/dataease into main
This commit is contained in:
commit
695d22a288
125
backend/src/main/java/io/dataease/base/domain/License.java
Normal file
125
backend/src/main/java/io/dataease/base/domain/License.java
Normal file
@ -0,0 +1,125 @@
|
||||
package io.dataease.base.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
public class License implements Serializable {
|
||||
@ApiModelProperty("")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty("license")
|
||||
private String license;
|
||||
|
||||
@ApiModelProperty("F2C License")
|
||||
private String f2cLicense;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column license.id
|
||||
*
|
||||
* @return the value of license.id
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column license.id
|
||||
*
|
||||
* @param id the value for license.id
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setId(String id) {
|
||||
this.id = id == null ? null : id.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column license.update_time
|
||||
*
|
||||
* @return the value of license.update_time
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column license.update_time
|
||||
*
|
||||
* @param updateTime the value for license.update_time
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column license.license
|
||||
*
|
||||
* @return the value of license.license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public String getLicense() {
|
||||
return license;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column license.license
|
||||
*
|
||||
* @param license the value for license.license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setLicense(String license) {
|
||||
this.license = license == null ? null : license.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column license.f2c_license
|
||||
*
|
||||
* @return the value of license.f2c_license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public String getF2cLicense() {
|
||||
return f2cLicense;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column license.f2c_license
|
||||
*
|
||||
* @param f2cLicense the value for license.f2c_license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setF2cLicense(String f2cLicense) {
|
||||
this.f2cLicense = f2cLicense == null ? null : f2cLicense.trim();
|
||||
}
|
||||
}
|
@ -0,0 +1,578 @@
|
||||
package io.dataease.base.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class LicenseExample {
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
protected String orderByClause;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
protected boolean distinct;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public LicenseExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This class was generated by MyBatis Generator.
|
||||
* This class corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
protected abstract static class GeneratedCriteria {
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(String value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(String value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(String value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(String value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLike(String value) {
|
||||
addCriterion("id like", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotLike(String value) {
|
||||
addCriterion("id not like", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<String> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<String> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(String value1, String value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(String value1, String value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIsNull() {
|
||||
addCriterion("update_time is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIsNotNull() {
|
||||
addCriterion("update_time is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeEqualTo(Date value) {
|
||||
addCriterion("update_time =", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotEqualTo(Date value) {
|
||||
addCriterion("update_time <>", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeGreaterThan(Date value) {
|
||||
addCriterion("update_time >", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
|
||||
addCriterion("update_time >=", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeLessThan(Date value) {
|
||||
addCriterion("update_time <", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
|
||||
addCriterion("update_time <=", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIn(List<Date> values) {
|
||||
addCriterion("update_time in", values, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotIn(List<Date> values) {
|
||||
addCriterion("update_time not in", values, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
|
||||
addCriterion("update_time between", value1, value2, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
|
||||
addCriterion("update_time not between", value1, value2, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLicenseIsNull() {
|
||||
addCriterion("license is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLicenseIsNotNull() {
|
||||
addCriterion("license is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLicenseEqualTo(String value) {
|
||||
addCriterion("license =", value, "license");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLicenseNotEqualTo(String value) {
|
||||
addCriterion("license <>", value, "license");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLicenseGreaterThan(String value) {
|
||||
addCriterion("license >", value, "license");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLicenseGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("license >=", value, "license");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLicenseLessThan(String value) {
|
||||
addCriterion("license <", value, "license");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLicenseLessThanOrEqualTo(String value) {
|
||||
addCriterion("license <=", value, "license");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLicenseLike(String value) {
|
||||
addCriterion("license like", value, "license");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLicenseNotLike(String value) {
|
||||
addCriterion("license not like", value, "license");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLicenseIn(List<String> values) {
|
||||
addCriterion("license in", values, "license");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLicenseNotIn(List<String> values) {
|
||||
addCriterion("license not in", values, "license");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLicenseBetween(String value1, String value2) {
|
||||
addCriterion("license between", value1, value2, "license");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLicenseNotBetween(String value1, String value2) {
|
||||
addCriterion("license not between", value1, value2, "license");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andF2cLicenseIsNull() {
|
||||
addCriterion("f2c_license is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andF2cLicenseIsNotNull() {
|
||||
addCriterion("f2c_license is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andF2cLicenseEqualTo(String value) {
|
||||
addCriterion("f2c_license =", value, "f2cLicense");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andF2cLicenseNotEqualTo(String value) {
|
||||
addCriterion("f2c_license <>", value, "f2cLicense");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andF2cLicenseGreaterThan(String value) {
|
||||
addCriterion("f2c_license >", value, "f2cLicense");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andF2cLicenseGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("f2c_license >=", value, "f2cLicense");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andF2cLicenseLessThan(String value) {
|
||||
addCriterion("f2c_license <", value, "f2cLicense");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andF2cLicenseLessThanOrEqualTo(String value) {
|
||||
addCriterion("f2c_license <=", value, "f2cLicense");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andF2cLicenseLike(String value) {
|
||||
addCriterion("f2c_license like", value, "f2cLicense");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andF2cLicenseNotLike(String value) {
|
||||
addCriterion("f2c_license not like", value, "f2cLicense");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andF2cLicenseIn(List<String> values) {
|
||||
addCriterion("f2c_license in", values, "f2cLicense");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andF2cLicenseNotIn(List<String> values) {
|
||||
addCriterion("f2c_license not in", values, "f2cLicense");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andF2cLicenseBetween(String value1, String value2) {
|
||||
addCriterion("f2c_license between", value1, value2, "f2cLicense");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andF2cLicenseNotBetween(String value1, String value2) {
|
||||
addCriterion("f2c_license not between", value1, value2, "f2cLicense");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSqlCriterion(String value) {
|
||||
addCriterion("(" + value + ")");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This class was generated by MyBatis Generator.
|
||||
* This class corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated do_not_delete_during_merge
|
||||
*/
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This class was generated by MyBatis Generator.
|
||||
* This class corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public static class Criterion {
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package io.dataease.base.mapper;
|
||||
|
||||
import io.dataease.base.domain.License;
|
||||
import io.dataease.base.domain.LicenseExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface LicenseMapper {
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
long countByExample(LicenseExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int deleteByExample(LicenseExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int deleteByPrimaryKey(String id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int insert(License record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int insertSelective(License record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
List<License> selectByExample(LicenseExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
License selectByPrimaryKey(String id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByExampleSelective(@Param("record") License record, @Param("example") LicenseExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByExample(@Param("record") License record, @Param("example") LicenseExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKeySelective(License record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table license
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKey(License record);
|
||||
}
|
256
backend/src/main/java/io/dataease/base/mapper/LicenseMapper.xml
Normal file
256
backend/src/main/java/io/dataease/base/mapper/LicenseMapper.xml
Normal file
@ -0,0 +1,256 @@
|
||||
<?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="io.dataease.base.mapper.LicenseMapper">
|
||||
<resultMap id="BaseResultMap" type="io.dataease.base.domain.License">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="license" jdbcType="VARCHAR" property="license" />
|
||||
<result column="f2c_license" jdbcType="VARCHAR" property="f2cLicense" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<where>
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
id, update_time, license, f2c_license
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="io.dataease.base.domain.LicenseExample" resultMap="BaseResultMap">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from license
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from license
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
delete from license
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="io.dataease.base.domain.LicenseExample">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
delete from license
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="io.dataease.base.domain.License">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
insert into license (id, update_time, license,
|
||||
f2c_license)
|
||||
values (#{id,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{license,jdbcType=VARCHAR},
|
||||
#{f2cLicense,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.dataease.base.domain.License">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
insert into license
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="license != null">
|
||||
license,
|
||||
</if>
|
||||
<if test="f2cLicense != null">
|
||||
f2c_license,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="license != null">
|
||||
#{license,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="f2cLicense != null">
|
||||
#{f2cLicense,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="io.dataease.base.domain.LicenseExample" resultType="java.lang.Long">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select count(*) from license
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update license
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.license != null">
|
||||
license = #{record.license,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.f2cLicense != null">
|
||||
f2c_license = #{record.f2cLicense,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update license
|
||||
set id = #{record.id,jdbcType=VARCHAR},
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
license = #{record.license,jdbcType=VARCHAR},
|
||||
f2c_license = #{record.f2cLicense,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.License">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update license
|
||||
<set>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="license != null">
|
||||
license = #{license,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="f2cLicense != null">
|
||||
f2c_license = #{f2cLicense,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.License">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update license
|
||||
set update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
license = #{license,jdbcType=VARCHAR},
|
||||
f2c_license = #{f2cLicense,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
@ -0,0 +1,130 @@
|
||||
package io.dataease.commons.license;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import io.dataease.base.domain.License;
|
||||
import io.dataease.commons.exception.DEException;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class DefaultLicenseService {
|
||||
@Resource
|
||||
private InnerLicenseService innerLicenseService;
|
||||
@Value("${spring.application.name:null}")
|
||||
private String moduleId;
|
||||
|
||||
private static final String LICENSE_ID = "fit2cloud_license";
|
||||
private static final String validatorUtil = "/usr/bin/validator";
|
||||
private static final String product = "cmp";
|
||||
private static final String[] NO_PLU_LIMIT_MODULES = new String[]{"dashboard", "gateway"};
|
||||
|
||||
public F2CLicenseResponse validateLicense(String product, String licenseKey){
|
||||
List<String> command = new ArrayList<String>();
|
||||
StringBuilder result = new StringBuilder();
|
||||
command.add(validatorUtil);
|
||||
command.add(licenseKey);
|
||||
try{
|
||||
execCommand(result, command);
|
||||
F2CLicenseResponse f2CLicenseResponse = new Gson().fromJson(result.toString(), F2CLicenseResponse.class);
|
||||
if(f2CLicenseResponse.getStatus() != F2CLicenseResponse.Status.valid){
|
||||
return f2CLicenseResponse;
|
||||
}
|
||||
if(!StringUtils.equals(f2CLicenseResponse.getLicense().getProduct(), product)){
|
||||
f2CLicenseResponse.setStatus(F2CLicenseResponse.Status.invalid);
|
||||
f2CLicenseResponse.setLicense(null);
|
||||
f2CLicenseResponse.setMessage("The license is unavailable for this product.");
|
||||
return f2CLicenseResponse;
|
||||
}
|
||||
|
||||
// 检查每个模块的PLU限制
|
||||
// if(!Arrays.asList(NO_PLU_LIMIT_MODULES).contains(moduleId)){
|
||||
// AuthorizationUnit authorizationUnit= CommonBeanFactory.getBean(AuthorizationUnit.class);
|
||||
// try{
|
||||
// authorizationUnit.calculateAssets(f2CLicenseResponse.getLicense().getCount());
|
||||
// return f2CLicenseResponse;
|
||||
// }catch (Exception e){
|
||||
// f2CLicenseResponse.setStatus(F2CLicenseResponse.Status.invalid);
|
||||
// f2CLicenseResponse.setMessage(e.getMessage());
|
||||
// }
|
||||
// }
|
||||
return f2CLicenseResponse;
|
||||
}catch (Exception e){
|
||||
return F2CLicenseResponse.invalid(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static int execCommand(StringBuilder result, List<String> command) throws Exception{
|
||||
ProcessBuilder builder = new ProcessBuilder();
|
||||
builder.command(command);
|
||||
Process process = builder.start();
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
|
||||
String line = null;
|
||||
while ((line=bufferedReader.readLine()) != null){
|
||||
result.append(line).append("\n");
|
||||
}
|
||||
int exitCode = process.waitFor();
|
||||
command.clear();
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
public F2CLicenseResponse validateLicense() {
|
||||
try {
|
||||
License license = readLicense();
|
||||
return validateLicense(product, license.getLicense());
|
||||
} catch (Exception e) {
|
||||
return F2CLicenseResponse.invalid(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void validateF2cLicense(){
|
||||
License license = readLicense();
|
||||
F2CLicenseResponse f2CLicenseResponse = validateLicense(product, license.getLicense());
|
||||
writeLicense(license.getLicense(), f2CLicenseResponse);
|
||||
}
|
||||
|
||||
public F2CLicenseResponse updateLicense(String product, String licenseKey) {
|
||||
// 验证license
|
||||
F2CLicenseResponse response = validateLicense(product, licenseKey);
|
||||
if (response.getStatus() != F2CLicenseResponse.Status.valid) {
|
||||
return response;
|
||||
}
|
||||
// 覆盖原license
|
||||
writeLicense(licenseKey, response);
|
||||
return response;
|
||||
}
|
||||
|
||||
// 从数据库读取License
|
||||
public License readLicense() {
|
||||
License license = innerLicenseService.getLicense(LICENSE_ID);
|
||||
if (license == null) {
|
||||
/*DEException.throwException(Translator.get("i18n_no_license_record"));*/
|
||||
DEException.throwException("i18n_no_license_record");
|
||||
}
|
||||
if (StringUtils.isBlank(license.getLicense())) {
|
||||
DEException.throwException("i18n_license_is_empty");
|
||||
//F2CException.throwException(Translator.get("i18n_license_is_empty"));
|
||||
}
|
||||
return license;
|
||||
}
|
||||
|
||||
// 创建或更新License
|
||||
private void writeLicense(String licenseKey, F2CLicenseResponse response) {
|
||||
if (StringUtils.isBlank(licenseKey)) {
|
||||
|
||||
DEException.throwException("i18n_license_is_empty");
|
||||
|
||||
}
|
||||
License license = new License();
|
||||
license.setId(LICENSE_ID);
|
||||
license.setLicense(licenseKey);
|
||||
license.setF2cLicense(new Gson().toJson(response));
|
||||
innerLicenseService.saveLicense(license);
|
||||
}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package io.dataease.commons.license;
|
||||
|
||||
public class F2CLicense {
|
||||
|
||||
private String corporation;
|
||||
private String expired;
|
||||
private String licenseVersion;
|
||||
private String product;
|
||||
private Long generateTime;
|
||||
private String edition;
|
||||
private Long count;
|
||||
|
||||
public String getCorporation() {
|
||||
return corporation;
|
||||
}
|
||||
|
||||
public void setCorporation(String corporation) {
|
||||
this.corporation = corporation;
|
||||
}
|
||||
|
||||
public String getExpired() {
|
||||
return expired;
|
||||
}
|
||||
|
||||
public void setExpired(String expired) {
|
||||
this.expired = expired;
|
||||
}
|
||||
|
||||
public String getLicenseVersion() {
|
||||
return licenseVersion;
|
||||
}
|
||||
|
||||
public void setLicenseVersion(String licenseVersion) {
|
||||
this.licenseVersion = licenseVersion;
|
||||
}
|
||||
|
||||
public String getProduct() {
|
||||
return product;
|
||||
}
|
||||
|
||||
public void setProduct(String product) {
|
||||
this.product = product;
|
||||
}
|
||||
|
||||
public Long getGenerateTime() {
|
||||
return generateTime;
|
||||
}
|
||||
|
||||
public void setGenerateTime(Long generateTime) {
|
||||
this.generateTime = generateTime;
|
||||
}
|
||||
|
||||
public String getEdition() {
|
||||
return edition;
|
||||
}
|
||||
|
||||
public void setEdition(String edition) {
|
||||
this.edition = edition;
|
||||
}
|
||||
|
||||
public Long getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(Long count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package io.dataease.commons.license;
|
||||
|
||||
public class F2CLicenseResponse {
|
||||
|
||||
private Status status;
|
||||
private F2CLicense license;
|
||||
private String message;
|
||||
|
||||
public Status getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Status status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public F2CLicense getLicense() {
|
||||
return license;
|
||||
}
|
||||
|
||||
public void setLicense(F2CLicense license) {
|
||||
this.license = license;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public static enum Status {
|
||||
valid,
|
||||
invalid,
|
||||
expired;
|
||||
}
|
||||
|
||||
public static F2CLicenseResponse invalid(String a) {
|
||||
F2CLicenseResponse f2CLicenseResponse = new F2CLicenseResponse();
|
||||
f2CLicenseResponse.setStatus(Status.invalid);
|
||||
f2CLicenseResponse.setLicense(null);
|
||||
f2CLicenseResponse.setMessage(a);
|
||||
return f2CLicenseResponse;
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package io.dataease.commons.license;
|
||||
|
||||
import io.dataease.base.domain.License;
|
||||
import io.dataease.base.mapper.LicenseMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
class InnerLicenseService {
|
||||
|
||||
@Resource
|
||||
private LicenseMapper licenseMapper;
|
||||
|
||||
boolean existLicense(String key) {
|
||||
License license = licenseMapper.selectByPrimaryKey(key);
|
||||
return license != null;
|
||||
}
|
||||
|
||||
License getLicense(String key) {
|
||||
License license = licenseMapper.selectByPrimaryKey(key);
|
||||
if (license == null) return null;
|
||||
return license;
|
||||
}
|
||||
|
||||
void saveLicense(License license) {
|
||||
license.setUpdateTime(new Date());
|
||||
if (existLicense(license.getId())) {
|
||||
licenseMapper.updateByPrimaryKey(license);
|
||||
} else {
|
||||
licenseMapper.insert(license);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package io.dataease.controller;
|
||||
|
||||
|
||||
|
||||
import io.dataease.commons.license.DefaultLicenseService;
|
||||
import io.dataease.commons.license.F2CLicenseResponse;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
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;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(headers = "Accept=application/json")
|
||||
public class LicenseController {
|
||||
|
||||
@Value("${dataease.need_validate_lic:true}")
|
||||
private Boolean need_validate_lic;
|
||||
|
||||
@Resource
|
||||
private DefaultLicenseService defaultLicenseService;
|
||||
|
||||
@GetMapping(value = "anonymous/license/validate")
|
||||
public ResultHolder validateLicense() throws Exception {
|
||||
if (!need_validate_lic) {
|
||||
return ResultHolder.success(null);
|
||||
}
|
||||
/* License license = defaultLicenseService.readLicense();
|
||||
if(StringUtils.isEmpty(license.getF2cLicense())){
|
||||
throw new Exception("Invalid License.");
|
||||
}
|
||||
F2CLicenseResponse f2CLicenseResponse = new Gson().fromJson(license.getF2cLicense(), F2CLicenseResponse.class);*/
|
||||
F2CLicenseResponse f2CLicenseResponse = defaultLicenseService.validateLicense();
|
||||
switch (f2CLicenseResponse.getStatus()) {
|
||||
case valid:
|
||||
return ResultHolder.success(null);
|
||||
case expired:
|
||||
String expired = f2CLicenseResponse.getLicense().getExpired();
|
||||
throw new Exception("License has expired since " + expired + ", please update license.");
|
||||
case invalid:
|
||||
throw new Exception(f2CLicenseResponse.getMessage());
|
||||
default:
|
||||
throw new Exception("Invalid License.");
|
||||
}
|
||||
}
|
||||
}
|
@ -6,8 +6,13 @@ import io.dataease.commons.constants.RoleConstants;
|
||||
import io.dataease.dto.BaseSystemConfigDTO;
|
||||
import io.dataease.dto.SystemParameterDTO;
|
||||
import io.dataease.notice.domain.MailInfo;
|
||||
import io.dataease.service.FileService;
|
||||
import io.dataease.service.system.SystemParameterService;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@ -23,6 +28,9 @@ public class SystemParameterController {
|
||||
@Resource
|
||||
private SystemParameterService systemParameterService;
|
||||
|
||||
@Resource
|
||||
private FileService fileService;
|
||||
|
||||
@PostMapping("/edit/email")
|
||||
public void editMail(@RequestBody List<SystemParameter> systemParameter) {
|
||||
systemParameterService.editMail(systemParameter);
|
||||
@ -54,8 +62,16 @@ public class SystemParameterController {
|
||||
return systemParameterService.getSystemParameterInfo(ParamConstants.Classify.UI.getValue());
|
||||
}
|
||||
|
||||
@GetMapping(value="/ui/image/{imageId}", produces = {MediaType.IMAGE_JPEG_VALUE, MediaType.IMAGE_PNG_VALUE})
|
||||
public ResponseEntity<byte[]> image(@PathVariable("imageId") String imageId) {
|
||||
byte[] bytes = fileService.loadFileAsBytes(imageId);
|
||||
final HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.IMAGE_PNG);
|
||||
return new ResponseEntity<>(bytes, headers, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping(value="/save/ui", consumes = {"multipart/form-data"})
|
||||
public void saveUIInfo (@RequestPart("request") Map<String,List<SystemParameterDTO>> systemParameterMap,@RequestPart(value = "files") List<MultipartFile> bodyFiles) throws IOException {
|
||||
public void saveUIInfo (@RequestPart("request") Map<String,List<SystemParameterDTO>> systemParameterMap,@RequestPart(value = "files", required = false) List<MultipartFile> bodyFiles) throws IOException {
|
||||
systemParameterService.saveUIInfo(systemParameterMap,bodyFiles);
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ public class DataSetTableService {
|
||||
return datasetTable;
|
||||
}
|
||||
|
||||
public void delete(String id) throws Exception{
|
||||
public void delete(String id) throws Exception {
|
||||
datasetTableMapper.deleteByPrimaryKey(id);
|
||||
dataSetTableFieldsService.deleteByTableId(id);
|
||||
// 删除同步任务
|
||||
@ -120,10 +120,11 @@ public class DataSetTableService {
|
||||
deleteDorisTable(id);
|
||||
}
|
||||
|
||||
private void deleteDorisTable(String datasetId) throws Exception{
|
||||
private void deleteDorisTable(String datasetId) throws Exception {
|
||||
String dorisTableName = DorisTableUtils.dorisName(datasetId);
|
||||
Datasource dorisDatasource = (Datasource)CommonBeanFactory.getBean("DorisDatasource");
|
||||
JdbcProvider jdbcProvider = CommonBeanFactory.getBean(JdbcProvider.class);;
|
||||
Datasource dorisDatasource = (Datasource) CommonBeanFactory.getBean("DorisDatasource");
|
||||
JdbcProvider jdbcProvider = CommonBeanFactory.getBean(JdbcProvider.class);
|
||||
;
|
||||
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
||||
datasourceRequest.setDatasource(dorisDatasource);
|
||||
datasourceRequest.setQuery("drop table if exists " + dorisTableName);
|
||||
@ -548,7 +549,10 @@ public class DataSetTableService {
|
||||
JdbcProvider jdbcProvider = CommonBeanFactory.getBean(JdbcProvider.class);
|
||||
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
||||
datasourceRequest.setDatasource(dorisDatasource);
|
||||
datasourceRequest.setQuery("CREATE VIEW " + dorisTableName + " AS (" + customSql + ")");
|
||||
// 先删除表
|
||||
datasourceRequest.setQuery("DROP VIEW IF EXISTS " + dorisTableName);
|
||||
jdbcProvider.exec(datasourceRequest);
|
||||
datasourceRequest.setQuery("CREATE VIEW IF NOT EXISTS " + dorisTableName + " AS (" + customSql + ")");
|
||||
jdbcProvider.exec(datasourceRequest);
|
||||
}
|
||||
|
||||
|
@ -220,6 +220,7 @@ public class SystemParameterService {
|
||||
|
||||
public void saveUIInfo(Map<String,List<SystemParameterDTO>> request, List<MultipartFile> bodyFiles) throws IOException {
|
||||
List<SystemParameterDTO> parameters = request.get("systemParams");
|
||||
if (null != bodyFiles)
|
||||
for (MultipartFile multipartFile : bodyFiles) {
|
||||
if (!multipartFile.isEmpty()) {
|
||||
//防止添加非图片文件
|
||||
|
@ -271,3 +271,20 @@ BEGIN;
|
||||
COMMIT;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for license
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `license`;
|
||||
CREATE TABLE `license` (
|
||||
`id` varchar(50) NOT NULL,
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`license` longtext COMMENT 'license',
|
||||
`f2c_license` longtext COMMENT 'F2C License',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
8
frontend/src/api/system/lic.js
Normal file
8
frontend/src/api/system/lic.js
Normal file
@ -0,0 +1,8 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function validateLic() {
|
||||
return request({
|
||||
url: '/anonymous/license/validate',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
@ -29,3 +29,17 @@ export function validateUserName(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getUIinfo() {
|
||||
return request({
|
||||
url: '/system/ui/info',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function uiImage(imageId) {
|
||||
return request({
|
||||
url: '/display/file/' + imageId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ export default {
|
||||
},
|
||||
login: {
|
||||
title: 'Login Form',
|
||||
welcome: 'welcome To DataEase',
|
||||
welcome: 'welcome To ',
|
||||
logIn: 'Login',
|
||||
username: 'Username',
|
||||
password: 'Password',
|
||||
|
@ -74,7 +74,7 @@ export default {
|
||||
},
|
||||
login: {
|
||||
title: '系统登录',
|
||||
welcome: '歡迎使用DATAEASE',
|
||||
welcome: '歡迎使用',
|
||||
logIn: '登錄',
|
||||
username: '账号',
|
||||
password: '密码',
|
||||
|
@ -74,7 +74,7 @@ export default {
|
||||
},
|
||||
login: {
|
||||
title: '系统登录',
|
||||
welcome: '欢迎使用DataEase',
|
||||
welcome: '欢迎使用',
|
||||
logIn: '登录',
|
||||
username: '账号',
|
||||
password: '密码',
|
||||
@ -905,5 +905,12 @@ export default {
|
||||
un_install: '卸载',
|
||||
uninstall_confirm: '确定卸载该插件',
|
||||
uninstall_cancel: '取消卸载插件'
|
||||
},
|
||||
display: {
|
||||
logo: '头部系统logo',
|
||||
loginLogo: '登录页面头部logo',
|
||||
loginImage: '登录页面右侧图片',
|
||||
loginTitle: '登录页面标题',
|
||||
title: '系统名称'
|
||||
}
|
||||
}
|
||||
|
56
frontend/src/layout/components/Licbar.vue
Normal file
56
frontend/src/layout/components/Licbar.vue
Normal file
@ -0,0 +1,56 @@
|
||||
<template>
|
||||
<div v-if="!licstatus" class="lic">
|
||||
<strong>{{ msg }}</strong>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Licbar',
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
lic: true,
|
||||
msg: 'Cannot run program "/usr/local/bin/validator_darwin_amd64": error=2, No such file or directory'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
theme() {
|
||||
return this.$store.state.settings.theme
|
||||
},
|
||||
licstatus() {
|
||||
return this.$store.state.lic.validate
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
mounted() {
|
||||
// this.validate()
|
||||
},
|
||||
methods: {
|
||||
// validate() {
|
||||
// validateLic().then(res => {
|
||||
// this.lic = true
|
||||
// this.$store.dispatch('lic/setValidate', true)
|
||||
// }).catch((e) => {
|
||||
// this.msg = e.response.data.message
|
||||
// this.lic = false
|
||||
// this.$store.dispatch('lic/setValidate', false)
|
||||
// })
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.lic {
|
||||
height: 24px;
|
||||
background-color: #c92100;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
padding: 6px 11px;
|
||||
}
|
||||
|
||||
</style>
|
@ -1,7 +1,8 @@
|
||||
<template>
|
||||
<div class="top-nav" :style="{'background-color': theme}">
|
||||
<div class="log">
|
||||
<img src="@/assets/DataEase-white.png" width="160" alt="" style="padding-top: 8px;">
|
||||
<img v-if="!logoUrl" src="@/assets/DataEase-white.png" width="160" alt="" style="padding-top: 8px;">
|
||||
<img v-else :src="logoUrl" width="160" alt="" style="padding-top: 8px;">
|
||||
</div>
|
||||
<el-menu
|
||||
:active-text-color="variables.topMenuActiveText"
|
||||
@ -68,6 +69,7 @@ import Doc from '@/components/Doc'
|
||||
import Screenfull from '@/components/Screenfull'
|
||||
// import SizeSelect from '@/components/SizeSelect'
|
||||
import LangSelect from '@/components/LangSelect'
|
||||
import { getSysUI } from '@/utils/auth'
|
||||
export default {
|
||||
name: 'Topbar',
|
||||
components: {
|
||||
@ -79,9 +81,11 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
uiInfo: null,
|
||||
logoUrl: null
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
theme() {
|
||||
return this.$store.state.settings.theme
|
||||
@ -116,6 +120,14 @@ export default {
|
||||
mounted() {
|
||||
this.initCurrentRoutes()
|
||||
},
|
||||
created() {
|
||||
this.$store.dispatch('user/getUI').then(() => {
|
||||
this.uiInfo = getSysUI()
|
||||
if (this.uiInfo['ui.logo'] && this.uiInfo['ui.logo'].paramValue) {
|
||||
this.logoUrl = '/system/ui/image/' + this.uiInfo['ui.logo'].paramValue
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 通过当前路径找到二级菜单对应项,存到store,用来渲染左侧菜单
|
||||
initCurrentRoutes() {
|
||||
|
@ -3,3 +3,4 @@ export { default as Sidebar } from './Sidebar'
|
||||
export { default as Settings } from './Settings'
|
||||
export { default as AppMain } from './AppMain'
|
||||
export { default as Topbar } from './Topbar'
|
||||
export { default as Licbar } from './Licbar'
|
||||
|
@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div :class="classObj" class="app-wrapper">
|
||||
<!-- <licbar /> -->
|
||||
<topbar />
|
||||
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
|
||||
<sidebar v-if="!sidebar.hide" class="sidebar-container" />
|
||||
@ -17,6 +18,7 @@
|
||||
|
||||
<script>
|
||||
import RightPanel from '@/components/RightPanel'
|
||||
// import { Sidebar, Settings, AppMain, Topbar, Licbar } from './components'
|
||||
import { Sidebar, Settings, AppMain, Topbar } from './components'
|
||||
import ResizeMixin from './mixin/ResizeHandler'
|
||||
|
||||
@ -28,6 +30,7 @@ export default {
|
||||
Settings,
|
||||
AppMain,
|
||||
Topbar
|
||||
// Licbar
|
||||
},
|
||||
mixins: [ResizeMixin],
|
||||
computed: {
|
||||
|
@ -36,7 +36,11 @@ router.beforeEach(async(to, from, next) => {
|
||||
if (store.getters.roles.length === 0) { // 判断当前用户是否已拉取完user_info信息
|
||||
// get user info
|
||||
store.dispatch('user/getInfo').then(() => {
|
||||
loadMenus(next, to)
|
||||
store.dispatch('lic/getLicInfo').then(() => {
|
||||
loadMenus(next, to)
|
||||
}).catch(() => {
|
||||
loadMenus(next, to)
|
||||
})
|
||||
}).catch(() => {
|
||||
store.dispatch('user/logout').then(() => {
|
||||
location.reload() // 为了重新实例化vue-router对象 避免bug
|
||||
@ -45,7 +49,11 @@ router.beforeEach(async(to, from, next) => {
|
||||
} else if (store.getters.loadMenus) {
|
||||
// 修改成false,防止死循环
|
||||
store.dispatch('user/updateLoadMenus')
|
||||
loadMenus(next, to)
|
||||
store.dispatch('lic/getLicInfo').then(() => {
|
||||
loadMenus(next, to)
|
||||
}).catch(() => {
|
||||
loadMenus(next, to)
|
||||
})
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
@ -71,11 +79,48 @@ export const loadMenus = (next, to) => {
|
||||
asyncRouter.push({ path: '*', redirect: '/404', hidden: true })
|
||||
store.dispatch('permission/GenerateRoutes', asyncRouter).then(() => { // 存储路由
|
||||
router.addRoutes(asyncRouter)
|
||||
next({ ...to, replace: true })
|
||||
if (pathValid(to.path, asyncRouter)) {
|
||||
next({ ...to, replace: true })
|
||||
} else {
|
||||
next('/')
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 验证path是否有效
|
||||
* @param {*} path
|
||||
* @param {*} routers
|
||||
* @returns
|
||||
*/
|
||||
const pathValid = (path, routers) => {
|
||||
const temp = path.startsWith('/') ? path.substr(1) : path
|
||||
const locations = temp.split('/')
|
||||
if (locations.length === 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
return hasCurrentRouter(locations, routers, 0)
|
||||
}
|
||||
/**
|
||||
* 递归验证every level
|
||||
* @param {*} locations
|
||||
* @param {*} routers
|
||||
* @param {*} index
|
||||
* @returns
|
||||
*/
|
||||
const hasCurrentRouter = (locations, routers, index) => {
|
||||
const location = locations[index]
|
||||
let kids = []
|
||||
const isvalid = routers.some(router => {
|
||||
kids = router.children
|
||||
return (router.path === location || ('/' + location) === router.path)
|
||||
})
|
||||
if (isvalid && index < locations.length - 1) {
|
||||
return hasCurrentRouter(locations, kids, index + 1)
|
||||
}
|
||||
return isvalid
|
||||
}
|
||||
// 根据权限过滤菜单
|
||||
const filterRouter = routers => {
|
||||
const user_permissions = store.getters.permissions
|
||||
@ -96,6 +141,9 @@ const hasPermission = (router, user_permissions) => {
|
||||
if (router.permission && !user_permissions.includes(router.permission)) {
|
||||
return false
|
||||
}
|
||||
if (!filterLic(router)) {
|
||||
return false
|
||||
}
|
||||
// 如果有字菜单 则 判断是否满足 ‘任意一个子菜单有权限’
|
||||
if (router.children && router.children.length) {
|
||||
const permissionChilds = router.children.filter(item => hasPermission(item, user_permissions))
|
||||
@ -104,6 +152,13 @@ const hasPermission = (router, user_permissions) => {
|
||||
}
|
||||
return true
|
||||
}
|
||||
const xpackMenuNames = ['参数管理', '插件管理']
|
||||
const filterLic = (router) => {
|
||||
if (xpackMenuNames.some(name => name === router.name) && !store.getters.validate) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
router.afterEach(() => {
|
||||
// finish progress bar
|
||||
NProgress.done()
|
||||
|
@ -21,6 +21,8 @@ const getters = {
|
||||
beanMap: state => state.application.beanMap,
|
||||
leftWidgetMap: state => state.application.leftWidgetMap,
|
||||
dialogWidgetMap: state => state.application.dialogWidgetMap,
|
||||
drawWidgetMap: state => state.application.drawWidgetMap
|
||||
drawWidgetMap: state => state.application.drawWidgetMap,
|
||||
validate: state => state.lic.validate,
|
||||
uiInfo: state => state.user.uiInfo
|
||||
}
|
||||
export default getters
|
||||
|
@ -10,7 +10,7 @@ import chart from './modules/chart'
|
||||
import request from './modules/request'
|
||||
import panel from './modules/panel'
|
||||
import application from './modules/application'
|
||||
|
||||
import lic from './modules/lic'
|
||||
import animation from '@/components/canvas/store/animation'
|
||||
import compose from '@/components/canvas/store/compose'
|
||||
import contextmenu from '@/components/canvas/store/contextmenu'
|
||||
@ -134,7 +134,8 @@ const data = {
|
||||
chart,
|
||||
request,
|
||||
panel,
|
||||
application
|
||||
application,
|
||||
lic
|
||||
},
|
||||
getters
|
||||
}
|
||||
|
37
frontend/src/store/modules/lic.js
Normal file
37
frontend/src/store/modules/lic.js
Normal file
@ -0,0 +1,37 @@
|
||||
import { validateLic } from '@/api/system/lic'
|
||||
const state = {
|
||||
validate: true
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
SET_VALIDATE: (state, data) => {
|
||||
state.validate = data
|
||||
}
|
||||
}
|
||||
|
||||
const actions = {
|
||||
setValidate({ commit }, data) {
|
||||
commit('SET_VALIDATE', data)
|
||||
},
|
||||
|
||||
getLicInfo({ commit, state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
validateLic().then(response => {
|
||||
const { data } = response
|
||||
commit('SET_VALIDATE', true)
|
||||
resolve(data)
|
||||
}).catch(error => {
|
||||
commit('SET_VALIDATE', false)
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
mutations,
|
||||
actions
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
import { login, logout, getInfo } from '@/api/user'
|
||||
import { getToken, setToken, removeToken } from '@/utils/auth'
|
||||
import { login, logout, getInfo, getUIinfo } from '@/api/user'
|
||||
import { getToken, setToken, removeToken, setSysUI } from '@/utils/auth'
|
||||
import { resetRouter } from '@/router'
|
||||
import { format } from '@/utils/formatUi'
|
||||
|
||||
const getDefaultState = () => {
|
||||
return {
|
||||
@ -12,7 +13,9 @@ const getDefaultState = () => {
|
||||
// 第一次加载菜单时用到
|
||||
loadMenus: false,
|
||||
// 当前用户拥有哪些资源权限
|
||||
permissions: []
|
||||
permissions: [],
|
||||
|
||||
uiInfo: null
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,6 +48,9 @@ const mutations = {
|
||||
},
|
||||
SET_LOGIN_MSG: (state, msg) => {
|
||||
state.loginMsg = msg
|
||||
},
|
||||
SET_UI_INFO: (state, info) => {
|
||||
state.uiInfo = info
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,6 +101,20 @@ const actions = {
|
||||
})
|
||||
},
|
||||
|
||||
getUI({ commit, state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
getUIinfo().then(response => {
|
||||
const { data } = response
|
||||
const uiInfo = format(data)
|
||||
commit('SET_UI_INFO', uiInfo)
|
||||
setSysUI(uiInfo)
|
||||
resolve(uiInfo)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// user logout
|
||||
logout({ commit, state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
@ -29,3 +29,12 @@ export function removeLinkToken() {
|
||||
return Cookies.remove(linkTokenKey)
|
||||
}
|
||||
|
||||
export function setSysUI(uiInfo) {
|
||||
return Cookies.set('sysUiInfo', uiInfo ? JSON.stringify(uiInfo) : null)
|
||||
}
|
||||
|
||||
export function getSysUI() {
|
||||
const json = Cookies.get('sysUiInfo')
|
||||
return json ? JSON.parse(json) : null
|
||||
}
|
||||
|
||||
|
7
frontend/src/utils/formatUi.js
Normal file
7
frontend/src/utils/formatUi.js
Normal file
@ -0,0 +1,7 @@
|
||||
export function format(uiLists) {
|
||||
const result = {}
|
||||
uiLists.forEach(element => {
|
||||
result[element['paramKey']] = element
|
||||
})
|
||||
return result
|
||||
}
|
@ -1,8 +1,13 @@
|
||||
import defaultSettings from '@/settings'
|
||||
import { getSysUI } from '@/utils/auth'
|
||||
|
||||
const title = defaultSettings.title || 'Vue Admin Template'
|
||||
let title = defaultSettings.title || 'Vue Admin Template'
|
||||
|
||||
export default function getPageTitle(pageTitle) {
|
||||
const uiInfo = getSysUI()
|
||||
if (uiInfo && uiInfo['ui.title'] && uiInfo['ui.title'].paramValue) {
|
||||
title = uiInfo['ui.title'].paramValue
|
||||
}
|
||||
if (pageTitle) {
|
||||
return `${pageTitle} - ${title}`
|
||||
}
|
||||
|
@ -5,6 +5,8 @@
|
||||
<el-table
|
||||
size="mini"
|
||||
:data="unionData"
|
||||
:height="height"
|
||||
border
|
||||
style="width: 100%;margin-top: 10px;"
|
||||
>
|
||||
<el-table-column
|
||||
@ -28,8 +30,8 @@
|
||||
:label="$t('dataset.target_field')"
|
||||
/>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
width="100"
|
||||
align="left"
|
||||
:label="$t('dataset.operate')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" @click="edit(scope.row)">{{ $t('dataset.edit') }}</el-button>
|
||||
@ -143,6 +145,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
height: 500,
|
||||
union: {
|
||||
id: null,
|
||||
sourceTableId: this.table.id,
|
||||
@ -165,9 +168,17 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.calHeight()
|
||||
this.initUnion()
|
||||
},
|
||||
methods: {
|
||||
calHeight() {
|
||||
const that = this
|
||||
setTimeout(function() {
|
||||
const currentHeight = document.documentElement.clientHeight
|
||||
that.height = currentHeight - 56 - 30 - 26 - 25 - 55 - 38 - 28 - 10
|
||||
}, 10)
|
||||
},
|
||||
initUnion() {
|
||||
if (this.table.id) {
|
||||
post('dataset/union/listByTableId/' + this.table.id, {}).then(response => {
|
||||
|
@ -13,6 +13,7 @@
|
||||
size="mini"
|
||||
:data="taskLogData"
|
||||
border
|
||||
:height="height"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
@ -32,18 +33,18 @@
|
||||
:label="$t('dataset.end_time')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.endTime | timestampFormatDate }}</span>
|
||||
<span>{{ scope.row.endTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="status" :label="$t('dataset.status')" >
|
||||
<el-table-column prop="status" :label="$t('dataset.status')">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.status === 'Completed'" style="color: green">{{ $t('dataset.completed') }}</span>
|
||||
<span v-if="scope.row.status === 'Underway'" style="color: blue">
|
||||
<i class="el-icon-loading"></i>
|
||||
<span v-if="scope.row.status === 'Completed'" style="color: green">{{ $t('dataset.completed') }}</span>
|
||||
<span v-if="scope.row.status === 'Underway'" style="color: blue">
|
||||
<i class="el-icon-loading" />
|
||||
{{ $t('dataset.underway') }}
|
||||
</span>
|
||||
<span v-if="scope.row.status === 'Error'" style="color: red" >
|
||||
<span v-if="scope.row.status === 'Error'" style="color: red">
|
||||
<el-link type="danger" style="font-size: 12px" @click="showErrorMassage(scope.row.info)">{{ $t('dataset.error') }}</el-link>
|
||||
</span>
|
||||
</template>
|
||||
@ -67,8 +68,9 @@
|
||||
:visible="show_error_massage"
|
||||
:show-close="false"
|
||||
width="50%"
|
||||
class="dialog-css">
|
||||
<span>{{error_massage}}</span>
|
||||
class="dialog-css"
|
||||
>
|
||||
<span>{{ error_massage }}</span>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button size="mini" @click="show_error_massage = false">{{ $t('dataset.close') }}</el-button>
|
||||
</span>
|
||||
@ -161,7 +163,7 @@
|
||||
<el-button type="primary" size="mini" @click="saveTask(taskForm)">{{ $t('dataset.confirm') }}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-row >
|
||||
<el-row>
|
||||
<el-button icon="el-icon-plus" size="mini" @click="addTask(undefined)">
|
||||
{{ $t('dataset.add_task') }}
|
||||
</el-button>
|
||||
@ -295,6 +297,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
height: 500,
|
||||
update_setting: false,
|
||||
update_task: false,
|
||||
show_error_massage: false,
|
||||
@ -355,8 +358,7 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
table: {
|
||||
handler()
|
||||
{
|
||||
handler() {
|
||||
this.listTask()
|
||||
this.listTaskLog()
|
||||
},
|
||||
@ -364,21 +366,23 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
window.onresize = () => {
|
||||
return (() => {
|
||||
this.height = window.innerHeight / 2
|
||||
})()
|
||||
}
|
||||
this.height = window.innerHeight / 2
|
||||
this.calHeight()
|
||||
},
|
||||
methods: {
|
||||
cellStyle ({row, column}) {
|
||||
calHeight() {
|
||||
const that = this
|
||||
setTimeout(function() {
|
||||
const currentHeight = document.documentElement.clientHeight
|
||||
that.height = currentHeight - 56 - 30 - 26 - 25 - 55 - 38 - 28 - 10
|
||||
}, 10)
|
||||
},
|
||||
cellStyle({ row, column }) {
|
||||
// 状态列字体颜色
|
||||
if (row.status === 'Underway' && column === 'status') {
|
||||
return 'color: blue'
|
||||
} else if (row.status === 'Completed' && column === 'status') {
|
||||
return 'color: green'
|
||||
}else if (row.status === 'Error' && column === 'status') {
|
||||
} else if (row.status === 'Error' && column === 'status') {
|
||||
return 'color: red'
|
||||
}
|
||||
},
|
||||
@ -414,10 +418,10 @@ export default {
|
||||
this.listTask()
|
||||
this.getIncrementalConfig()
|
||||
},
|
||||
refreshLog(){
|
||||
refreshLog() {
|
||||
this.listTaskLog()
|
||||
},
|
||||
showErrorMassage(massage){
|
||||
showErrorMassage(massage) {
|
||||
this.show_error_massage = true
|
||||
this.error_massage = massage
|
||||
},
|
||||
|
@ -5,14 +5,15 @@
|
||||
<el-col :span="12">
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" size="default">
|
||||
<div class="login-logo">
|
||||
<img src="@/assets/DataEase-black.png" alt="">
|
||||
<img v-if="!loginLogoUrl" src="@/assets/DataEase-black.png" alt="">
|
||||
<img v-else :src="loginLogoUrl" alt="">
|
||||
</div>
|
||||
<div class="login-title">
|
||||
{{ $t('login.title') }}
|
||||
{{ uiInfo && uiInfo['ui.loginTitle'] && uiInfo['ui.loginTitle'].paramValue || $t('login.title') }}
|
||||
</div>
|
||||
<div class="login-border" />
|
||||
<div class="login-welcome">
|
||||
{{ $t('login.welcome') }}
|
||||
{{ $t('login.welcome') + (uiInfo && uiInfo['ui.title'] && uiInfo['ui.title'].paramValue || 'DATAEASE') }}
|
||||
</div>
|
||||
<div class="login-form">
|
||||
<el-form-item prop="username">
|
||||
@ -41,7 +42,8 @@
|
||||
</el-form>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="login-image" />
|
||||
<div v-if="!loginImageUrl" class="login-image" />
|
||||
<div v-else class="login-image-de" :style="{background:'url(' + loginImageUrl + ') no-repeat', 'backgroundSize':'cover'}" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
@ -52,6 +54,7 @@
|
||||
|
||||
import { encrypt } from '@/utils/rsaEncrypt'
|
||||
import { validateUserName } from '@/api/user'
|
||||
import { getSysUI } from '@/utils/auth'
|
||||
export default {
|
||||
name: 'Login',
|
||||
data() {
|
||||
@ -90,7 +93,10 @@ export default {
|
||||
},
|
||||
loading: false,
|
||||
passwordType: 'password',
|
||||
redirect: undefined
|
||||
redirect: undefined,
|
||||
uiInfo: null,
|
||||
loginImageUrl: null,
|
||||
loginLogoUrl: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -106,6 +112,21 @@ export default {
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$store.dispatch('user/getUI').then(() => {
|
||||
// const uiLists = this.$store.state.user.uiInfo
|
||||
// this.uiInfo = format(uiLists)
|
||||
this.uiInfo = getSysUI()
|
||||
if (this.uiInfo['ui.loginImage'] && this.uiInfo['ui.loginImage'].paramValue) {
|
||||
this.loginImageUrl = '/system/ui/image/' + this.uiInfo['ui.loginImage'].paramValue
|
||||
}
|
||||
if (this.uiInfo['ui.loginLogo'] && this.uiInfo['ui.loginLogo'].paramValue) {
|
||||
this.loginLogoUrl = '/system/ui/image/' + this.uiInfo['ui.loginLogo'].paramValue
|
||||
}
|
||||
}).catch(err => {
|
||||
console.error(err)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
handleLogin() {
|
||||
this.$refs.loginForm.validate(valid => {
|
||||
@ -245,5 +266,13 @@ export default {
|
||||
height: 380px;
|
||||
}
|
||||
}
|
||||
.login-image-de {
|
||||
background-size: cover;
|
||||
width: 100%;
|
||||
height: 520px;
|
||||
@media only screen and (max-width: 1280px) {
|
||||
height: 380px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -122,6 +122,7 @@
|
||||
</el-form-item>
|
||||
<!--favicon upload-->
|
||||
<el-form-item
|
||||
v-show="showfavicon"
|
||||
v-if="param.paramKey==='ui.favicon'"
|
||||
:label="$t('display.favicon')"
|
||||
>
|
||||
@ -211,7 +212,8 @@ export default {
|
||||
trigger: ['change', 'blur']
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
showfavicon: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -14,12 +14,12 @@ module.exports = {
|
||||
// 使用mock-server
|
||||
devServer: {
|
||||
port: port,
|
||||
// proxy: {
|
||||
// '^(?!/login)': {
|
||||
// target: 'http://localhost:8081/',
|
||||
// ws: false
|
||||
// }
|
||||
// },
|
||||
proxy: {
|
||||
'^(?!/login)': {
|
||||
target: 'http://localhost:8081/',
|
||||
ws: false
|
||||
}
|
||||
},
|
||||
open: true,
|
||||
overlay: {
|
||||
warnings: false,
|
||||
|
Loading…
Reference in New Issue
Block a user