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

Mosher 部署微服务接口 [后台服务,接口示例]

上级 71d2ccd1
......@@ -37,6 +37,11 @@
git clone -b master $para2 demosys/
export NODE_OPTIONS=--max-old-space-size=4096
cd demosys/
mvn clean package -Pdemoapi
cd demo-provider/demo-provider-demoapi
mvn -Pdemoapi docker:build
mvn -Pdemoapi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/demo-provider-demoapi.yaml iBizDemo --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
......@@ -24,7 +24,7 @@
<!--输出实体[IBIZAPPVIEW]数据结构 -->
<changeSet author="a_LAB01_df847bdfd" id="tab-ibizappview-28-2">
<changeSet author="a_LAB01_df847bdfd" id="tab-ibizappview-30-2">
<createTable tableName="T_IBIZAPPVIEW">
<column name="IBIZAPPVIEWNAME" remarks="" type="VARCHAR(200)">
</column>
......@@ -74,7 +74,7 @@
<!--输出实体[IBIZBOOK]数据结构 -->
<changeSet author="a_LAB01_df847bdfd" id="tab-ibizbook-780-4">
<changeSet author="a_LAB01_df847bdfd" id="tab-ibizbook-793-4">
<createTable tableName="T_IBIZBOOK">
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -178,7 +178,7 @@
<!--输出实体[IBIZCUSTOMER]数据结构 -->
<changeSet author="a_LAB01_df847bdfd" id="tab-ibizcustomer-27-7">
<changeSet author="a_LAB01_df847bdfd" id="tab-ibizcustomer-28-7">
<createTable tableName="T_IBIZCUSTOMER">
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -1156,7 +1156,7 @@
<!--输出实体[IBIZVIEWMESS]数据结构 -->
<changeSet author="a_LAB01_df847bdfd" id="tab-ibizviewmess-3-40">
<changeSet author="a_LAB01_df847bdfd" id="tab-ibizviewmess-20-40">
<createTable tableName="T_IBIZVIEWMESS">
<column name="IBIZVIEWMESSNAME" remarks="" type="VARCHAR(200)">
</column>
......
......@@ -19,7 +19,7 @@
</createView>
</changeSet>
<!--输出实体[IBIZCUSTOMER]视图结构信息 runOnChange="true" 当视图发生变更时,通过liquibase强刷prod的视图,实现视图的同步-->
<changeSet author="a_LAB01_df847bdfd" id="view-ibizcustomer-27-4" runOnChange="true">
<changeSet author="a_LAB01_df847bdfd" id="view-ibizcustomer-28-4" runOnChange="true">
<createView fullDefinition="false" replaceIfExists="true" viewName="V_IBIZCUSTOMER">
<![CDATA[ SELECT t1.[ADDRESS], t1.[CREATEDATE], t1.[CREATEMAN], t1.[CUSTOMERUID], t1.[IBIZCUSTOMERID], t1.[IBIZCUSTOMERNAME], t1.[SN], t1.[UPDATEDATE], t1.[UPDATEMAN] FROM [T_IBIZCUSTOMER] t1 ]]>
</createView>
......
......@@ -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 /demo-provider-demoapi.jar
EXPOSE 8081
EXPOSE 51000
ADD demo-provider-demoapi.jar /demo-provider-demoapi.jar
......@@ -3,9 +3,24 @@ services:
demo-provider-demoapi:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/demo-provider-demoapi:latest
ports:
- "8081:8081"
- "51000:51000"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
- SERVER_PORT=51000
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.240.110:8848
- SPRING_REDIS_HOST=172.16.240.110
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_LAB01_df847bdfd
- SPRING_DATASOURCE_PASSWORD=3d6@460A
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.186.185:3306/a_LAB01_df847bdfd?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_LAB01_df847bdfd
- NACOS=172.16.240.110:8848
- SEATA_REGISTRY_NACOS_SERVER-ADDR=172.16.240.110:8848
- SEATA_ENABLED=true
deploy:
resources:
limits:
......
......@@ -47,6 +47,117 @@ public class IBIZVIEWMESSResource {
@Lazy
public IBIZVIEWMESSMapping ibizviewmessMapping;
@PreAuthorize("hasPermission(this.ibizviewmessMapping.toDomain(#ibizviewmessdto),'DemoSys-IBIZVIEWMESS-Create')")
@ApiOperation(value = "新建视图数据信息实体", tags = {"视图数据信息实体" }, notes = "新建视图数据信息实体")
@RequestMapping(method = RequestMethod.POST, value = "/ibizviewmesses")
public ResponseEntity<IBIZVIEWMESSDTO> create(@Validated @RequestBody IBIZVIEWMESSDTO ibizviewmessdto) {
IBIZVIEWMESS domain = ibizviewmessMapping.toDomain(ibizviewmessdto);
ibizviewmessService.create(domain);
IBIZVIEWMESSDTO dto = ibizviewmessMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.ibizviewmessMapping.toDomain(#ibizviewmessdtos),'DemoSys-IBIZVIEWMESS-Create')")
@ApiOperation(value = "批量新建视图数据信息实体", tags = {"视图数据信息实体" }, notes = "批量新建视图数据信息实体")
@RequestMapping(method = RequestMethod.POST, value = "/ibizviewmesses/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<IBIZVIEWMESSDTO> ibizviewmessdtos) {
ibizviewmessService.createBatch(ibizviewmessMapping.toDomain(ibizviewmessdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "ibizviewmess" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.ibizviewmessService.get(#ibizviewmess_id),'DemoSys-IBIZVIEWMESS-Update')")
@ApiOperation(value = "更新视图数据信息实体", tags = {"视图数据信息实体" }, notes = "更新视图数据信息实体")
@RequestMapping(method = RequestMethod.PUT, value = "/ibizviewmesses/{ibizviewmess_id}")
public ResponseEntity<IBIZVIEWMESSDTO> update(@PathVariable("ibizviewmess_id") String ibizviewmess_id, @RequestBody IBIZVIEWMESSDTO ibizviewmessdto) {
IBIZVIEWMESS domain = ibizviewmessMapping.toDomain(ibizviewmessdto);
domain .setIbizviewmessid(ibizviewmess_id);
ibizviewmessService.update(domain );
IBIZVIEWMESSDTO dto = ibizviewmessMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.ibizviewmessService.getIbizviewmessByEntities(this.ibizviewmessMapping.toDomain(#ibizviewmessdtos)),'DemoSys-IBIZVIEWMESS-Update')")
@ApiOperation(value = "批量更新视图数据信息实体", tags = {"视图数据信息实体" }, notes = "批量更新视图数据信息实体")
@RequestMapping(method = RequestMethod.PUT, value = "/ibizviewmesses/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<IBIZVIEWMESSDTO> ibizviewmessdtos) {
ibizviewmessService.updateBatch(ibizviewmessMapping.toDomain(ibizviewmessdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.ibizviewmessService.get(#ibizviewmess_id),'DemoSys-IBIZVIEWMESS-Remove')")
@ApiOperation(value = "删除视图数据信息实体", tags = {"视图数据信息实体" }, notes = "删除视图数据信息实体")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibizviewmesses/{ibizviewmess_id}")
public ResponseEntity<Boolean> remove(@PathVariable("ibizviewmess_id") String ibizviewmess_id) {
return ResponseEntity.status(HttpStatus.OK).body(ibizviewmessService.remove(ibizviewmess_id));
}
@PreAuthorize("hasPermission(this.ibizviewmessService.getIbizviewmessByIds(#ids),'DemoSys-IBIZVIEWMESS-Remove')")
@ApiOperation(value = "批量删除视图数据信息实体", tags = {"视图数据信息实体" }, notes = "批量删除视图数据信息实体")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibizviewmesses/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
ibizviewmessService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.ibizviewmessMapping.toDomain(returnObject.body),'DemoSys-IBIZVIEWMESS-Get')")
@ApiOperation(value = "获取视图数据信息实体", tags = {"视图数据信息实体" }, notes = "获取视图数据信息实体")
@RequestMapping(method = RequestMethod.GET, value = "/ibizviewmesses/{ibizviewmess_id}")
public ResponseEntity<IBIZVIEWMESSDTO> get(@PathVariable("ibizviewmess_id") String ibizviewmess_id) {
IBIZVIEWMESS domain = ibizviewmessService.get(ibizviewmess_id);
IBIZVIEWMESSDTO dto = ibizviewmessMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取视图数据信息实体草稿", tags = {"视图数据信息实体" }, notes = "获取视图数据信息实体草稿")
@RequestMapping(method = RequestMethod.GET, value = "/ibizviewmesses/getdraft")
public ResponseEntity<IBIZVIEWMESSDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(ibizviewmessMapping.toDto(ibizviewmessService.getDraft(new IBIZVIEWMESS())));
}
@ApiOperation(value = "检查视图数据信息实体", tags = {"视图数据信息实体" }, notes = "检查视图数据信息实体")
@RequestMapping(method = RequestMethod.POST, value = "/ibizviewmesses/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody IBIZVIEWMESSDTO ibizviewmessdto) {
return ResponseEntity.status(HttpStatus.OK).body(ibizviewmessService.checkKey(ibizviewmessMapping.toDomain(ibizviewmessdto)));
}
@PreAuthorize("hasPermission(this.ibizviewmessMapping.toDomain(#ibizviewmessdto),'DemoSys-IBIZVIEWMESS-Save')")
@ApiOperation(value = "保存视图数据信息实体", tags = {"视图数据信息实体" }, notes = "保存视图数据信息实体")
@RequestMapping(method = RequestMethod.POST, value = "/ibizviewmesses/save")
public ResponseEntity<Boolean> save(@RequestBody IBIZVIEWMESSDTO ibizviewmessdto) {
return ResponseEntity.status(HttpStatus.OK).body(ibizviewmessService.save(ibizviewmessMapping.toDomain(ibizviewmessdto)));
}
@PreAuthorize("hasPermission(this.ibizviewmessMapping.toDomain(#ibizviewmessdtos),'DemoSys-IBIZVIEWMESS-Save')")
@ApiOperation(value = "批量保存视图数据信息实体", tags = {"视图数据信息实体" }, notes = "批量保存视图数据信息实体")
@RequestMapping(method = RequestMethod.POST, value = "/ibizviewmesses/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<IBIZVIEWMESSDTO> ibizviewmessdtos) {
ibizviewmessService.saveBatch(ibizviewmessMapping.toDomain(ibizviewmessdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','DemoSys-IBIZVIEWMESS-searchDefault-all') and hasPermission(#context,'DemoSys-IBIZVIEWMESS-Get')")
@ApiOperation(value = "获取数据集", tags = {"视图数据信息实体" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/ibizviewmesses/fetchdefault")
public ResponseEntity<List<IBIZVIEWMESSDTO>> fetchDefault(IBIZVIEWMESSSearchContext context) {
Page<IBIZVIEWMESS> domains = ibizviewmessService.searchDefault(context) ;
List<IBIZVIEWMESSDTO> list = ibizviewmessMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','DemoSys-IBIZVIEWMESS-searchDefault-all') and hasPermission(#context,'DemoSys-IBIZVIEWMESS-Get')")
@ApiOperation(value = "查询数据集", tags = {"视图数据信息实体" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/ibizviewmesses/searchdefault")
public ResponseEntity<Page<IBIZVIEWMESSDTO>> searchDefault(@RequestBody IBIZVIEWMESSSearchContext context) {
Page<IBIZVIEWMESS> domains = ibizviewmessService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(ibizviewmessMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册