提交 1c337dda 编写于 作者: ibizdev's avatar ibizdev

ibiz4j 发布系统代码 [ibz-lite,应用]

上级 a07789c6
......@@ -233,6 +233,44 @@ mock.onPost(new RegExp(/^\/dstconfigs\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).re
return [status, data];
});
// Reset
mock.onPost(new RegExp(/^\/dstconfigs\/?([a-zA-Z0-9\-\;]{0,35})\/reset$/)).reply((config: any) => {
console.groupCollapsed("实体:dstconfig 方法: Reset");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['cfg_id'];
const matchArray:any = new RegExp(/^\/dstconfigs\/([a-zA-Z0-9\-\;]{1,35})\/reset$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.cfg_id, tempValue.cfg_id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['cfg_id'] == tempValue['cfg_id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// Save
mock.onPost(new RegExp(/^\/dstconfigs\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:dstconfig 方法: Save");
......
......@@ -153,6 +153,20 @@ export default class DstConfigServiceBase extends EntityService {
return res;
}
/**
* Reset接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DstConfigServiceBase
*/
public async Reset(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/dstconfigs/${context.dstconfig}/reset`,data,isloading);
return res;
}
/**
* Save接口方法
*
......
......@@ -37,11 +37,6 @@
git clone -b master $para2 ibzlite/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibzlite/
mvn clean package -Pweb
cd ibzlite-app/ibzlite-app-web
mvn -Pweb docker:build
mvn -Pweb docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzlite-app-web.yaml ibzlab-rt --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
......@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzlite-app-web.jar
EXPOSE 30010
EXPOSE 8080
ADD ibzlite-app-web.jar /ibzlite-app-web.jar
......@@ -3,22 +3,9 @@ services:
ibzlite-app-web:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzlite-app-web:latest
ports:
- "30010:30010"
- "8080:8080"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.180.237
- SERVER_PORT=30010
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.102.211:8848
- SPRING_REDIS_HOST=172.16.100.243
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_A_5d9d78509
- SPRING_DATASOURCE_PASSWORD=@6dEfb3@
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_A_5d9d78509
- NACOS=172.16.102.211:8848
deploy:
resources:
limits:
......
package cn.ibizlab.core.extensions.service;
import cn.ibizlab.core.lite.service.impl.DstConfigServiceImpl;
import lombok.extern.slf4j.Slf4j;
import cn.ibizlab.core.lite.domain.DstConfig;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Primary;
import java.util.*;
/**
* 实体[配置] 自定义服务对象
*/
@Slf4j
@Primary
@Service("DstConfigExService")
public class DstConfigExService extends DstConfigServiceImpl {
@Override
protected Class currentModelClass() {
return com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(this.getClass().getSuperclass(), 1);
}
/**
* 自定义行为[Reset]用户扩展
* @param et
* @return
*/
@Override
@Transactional
public DstConfig reset(DstConfig et) {
return super.reset(et);
}
}
......@@ -34,6 +34,7 @@ public interface IDstConfigService extends IService<DstConfig>{
DstConfig get(String key) ;
DstConfig getDraft(DstConfig et) ;
boolean checkKey(DstConfig et) ;
DstConfig reset(DstConfig et) ;
boolean save(DstConfig et) ;
void saveBatch(List<DstConfig> list) ;
Page<DstConfig> searchDefault(DstConfigSearchContext context) ;
......
......@@ -121,6 +121,13 @@ public class DstConfigServiceImpl extends ServiceImpl<DstConfigMapper, DstConfig
public boolean checkKey(DstConfig et) {
return (!ObjectUtils.isEmpty(et.getCfgId()))&&(!Objects.isNull(this.getById(et.getCfgId())));
}
@Override
@Transactional
public DstConfig reset(DstConfig et) {
//自定义代码
return et;
}
@Override
@Transactional
public boolean save(DstConfig et) {
......
......@@ -110,7 +110,7 @@
<!--输出实体[DST_CONFIG]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-dst_config-28-6">
<changeSet author="a_A_5d9d78509" id="tab-dst_config-31-6">
<createTable tableName="IBZCFG">
<column name="CFGID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_DST_CONFIG_CFGID"/>
......
......@@ -72,7 +72,7 @@
"delogicname":"配置",
"sysmoudle":{"id":"LITE","name":"lite"},
"dedataset":[{"id":"Default" , "name":"数据集"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Reset" , "name":"reset" , "type":"USERCUSTOM" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}]
}
, {
......
......@@ -121,6 +121,17 @@ public class DstConfigResource {
return ResponseEntity.status(HttpStatus.OK).body(dstconfigService.checkKey(dstconfigMapping.toDomain(dstconfigdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstConfig-Reset-all')")
@ApiOperation(value = "reset", tags = {"配置" }, notes = "reset")
@RequestMapping(method = RequestMethod.POST, value = "/dstconfigs/{dstconfig_id}/reset")
public ResponseEntity<DstConfigDTO> reset(@PathVariable("dstconfig_id") String dstconfig_id, @RequestBody DstConfigDTO dstconfigdto) {
DstConfig domain = dstconfigMapping.toDomain(dstconfigdto);
domain.setCfgId(dstconfig_id);
domain = dstconfigService.reset(domain);
dstconfigdto = dstconfigMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dstconfigdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstConfig-Save-all')")
@ApiOperation(value = "保存配置", tags = {"配置" }, notes = "保存配置")
@RequestMapping(method = RequestMethod.POST, value = "/dstconfigs/save")
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册