fix: application 添加 packageName website developer 属性
This commit is contained in:
@@ -33,6 +33,7 @@ public enum RCode {
|
||||
APP_DESCRIPTION_CANNOT_EMPTY(201006, "application description cannot be empty"),
|
||||
APP_DUPLICATE_RECORD(201007, "application duplicate record"),
|
||||
APP_NOT_EXIST(201008, "application does not exist"),
|
||||
APP_PACKAGE_NAME_FORMAT_ERROR(201009, "application package name format error"),
|
||||
|
||||
|
||||
// Package
|
||||
|
||||
@@ -18,6 +18,9 @@ public class ApplicationEntity {
|
||||
private String properties;
|
||||
private String description;
|
||||
private String surrogates;
|
||||
private String packageName;
|
||||
private String website;
|
||||
private String developer;
|
||||
|
||||
private Long createTimestamp;
|
||||
private Long updateTimestamp;
|
||||
|
||||
@@ -13,6 +13,9 @@ public class ApplicationLogEntity {
|
||||
private String properties;
|
||||
private String description;
|
||||
private String surrogates;
|
||||
private String packageName;
|
||||
private String website;
|
||||
private String developer;
|
||||
|
||||
private Long createTimestamp;
|
||||
private Long updateTimestamp;
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.geedge.asw.module.app.service.impl;
|
||||
|
||||
import cn.dev33.satoken.stp.SaTokenInfo;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.net.url.UrlBuilder;
|
||||
import cn.hutool.log.Log;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
@@ -78,7 +79,11 @@ public class ApplicationServiceImpl extends ServiceImpl<ApplicationDao, Applicat
|
||||
if (T.ObjectUtil.isNotNull(one)) {
|
||||
throw ASWException.builder().rcode(RCode.APP_DUPLICATE_RECORD).build();
|
||||
}
|
||||
|
||||
if (T.ObjectUtil.isNotEmpty(entity.getPackageName()) && !T.JSONUtil.isTypeJSON(entity.getPackageName())){
|
||||
throw ASWException.builder().rcode(RCode.APP_PACKAGE_NAME_FORMAT_ERROR).build();
|
||||
}else if (T.ObjectUtil.isEmpty(entity.getPackageName())){
|
||||
entity.setPackageName("{}");
|
||||
}
|
||||
entity.setCreateTimestamp(System.currentTimeMillis());
|
||||
entity.setUpdateTimestamp(System.currentTimeMillis());
|
||||
entity.setCreateUserId(StpUtil.getLoginIdAsString());
|
||||
@@ -98,7 +103,11 @@ public class ApplicationServiceImpl extends ServiceImpl<ApplicationDao, Applicat
|
||||
if (T.ObjectUtil.isNull(one)) {
|
||||
throw ASWException.builder().rcode(RCode.APP_NOT_EXIST).build();
|
||||
}
|
||||
|
||||
if (T.ObjectUtil.isNotEmpty(entity.getPackageName()) && !T.JSONUtil.isTypeJSON(entity.getPackageName())){
|
||||
throw ASWException.builder().rcode(RCode.APP_PACKAGE_NAME_FORMAT_ERROR).build();
|
||||
}else if (T.ObjectUtil.isEmpty(entity.getPackageName())){
|
||||
entity.setPackageName("{}");
|
||||
}
|
||||
entity.setUpdateTimestamp(System.currentTimeMillis());
|
||||
entity.setUpdateUserId(StpUtil.getLoginIdAsString());
|
||||
entity.setOpVersion(one.getOpVersion() + 1);
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
<result property="longName" column="long_name"/>
|
||||
<result property="properties" column="properties"/>
|
||||
<result property="description" column="description"/>
|
||||
<result property="packageName" column="package_name"/>
|
||||
<result property="website" column="website"/>
|
||||
<result property="developer" column="developer"/>
|
||||
<result property="surrogates" column="surrogates"/>
|
||||
<result property="createTimestamp" column="create_timestamp"/>
|
||||
<result property="updateTimestamp" column="update_timestamp"/>
|
||||
|
||||
@@ -246,6 +246,9 @@ CREATE TABLE `application` (
|
||||
`name` varchar(256) NOT NULL DEFAULT '' COMMENT '应用名称',
|
||||
`long_name` varchar(256) NOT NULL DEFAULT '' COMMENT '应用全称',
|
||||
`properties` text NOT NULL DEFAULT '' COMMENT '应用数据',
|
||||
`package_name` VARCHAR(512) NOT NULL DEFAULT '' COMMENT '包名',
|
||||
`website` VARCHAR(1024) NOT NULL DEFAULT '' COMMENT '网站',
|
||||
`developer` VARCHAR(256) NOT NULL DEFAULT '' COMMENT '开发者',
|
||||
`description` text NOT NULL DEFAULT '' COMMENT '描述信息',
|
||||
`surrogates` text NOT NULL DEFAULT '' COMMENT '',
|
||||
`create_timestamp` bigint(20) NOT NULL COMMENT '创建时间戳',
|
||||
@@ -270,6 +273,9 @@ CREATE TABLE `application_log` (
|
||||
`name` varchar(256) NOT NULL DEFAULT '' COMMENT '应用名称',
|
||||
`long_name` varchar(256) NOT NULL DEFAULT '' COMMENT '应用全称',
|
||||
`properties` text NOT NULL DEFAULT '' COMMENT '应用数据',
|
||||
`package_name` VARCHAR(512) NOT NULL DEFAULT '' COMMENT '包名',
|
||||
`website` VARCHAR(1024) NOT NULL DEFAULT '' COMMENT '网站',
|
||||
`developer` VARCHAR(256) NOT NULL DEFAULT '' COMMENT '开发者',
|
||||
`description` text NOT NULL DEFAULT '' COMMENT '描述信息',
|
||||
`surrogates` text NOT NULL DEFAULT '' COMMENT '',
|
||||
`create_timestamp` bigint(20) NOT NULL COMMENT '创建时间戳',
|
||||
|
||||
Reference in New Issue
Block a user