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

Mosher 发布系统代码 [后台服务,演示应用]

上级 c94f2b75
......@@ -53,6 +53,123 @@ export default class IBIZBOOKServiceBase extends EntityService {
return res;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof IBIZBOOKServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/ibizbooks`,data,isloading);
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof IBIZBOOKServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/ibizbooks/${context.ibizbook}`,data,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof IBIZBOOKServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/ibizbooks/${context.ibizbook}`,isloading);
return res;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof IBIZBOOKServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/ibizbooks/${context.ibizbook}`,isloading);
return res;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof IBIZBOOKServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/ibizbooks/getdraft`,isloading);
res.data.ibizbook = data.ibizbook;
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof IBIZBOOKServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/ibizbooks/${context.ibizbook}/checkkey`,data,isloading);
return res;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof IBIZBOOKServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/ibizbooks/${context.ibizbook}/save`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
......@@ -63,5 +180,8 @@ export default class IBIZBOOKServiceBase extends EntityService {
* @memberof IBIZBOOKServiceBase
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = Http.getInstance().get(`/ibizbooks/fetchdefault`,tempData,isloading);
return res;
}
}
\ No newline at end of file
......@@ -37,11 +37,6 @@
git clone -b master $para2 demosys/
export NODE_OPTIONS=--max-old-space-size=4096
cd demosys/
mvn clean package -Pweb
cd demo-app/demo-app-web
mvn -Pweb docker:build
mvn -Pweb docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/demo-app-web.yaml iBizDemo --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 /demo-app-web.jar
EXPOSE 51001
EXPOSE 8080
ADD demo-app-web.jar /demo-app-web.jar
......@@ -3,24 +3,9 @@ services:
demo-app-web:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/demo-app-web:latest
ports:
- "51001:51001"
- "8080:8080"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
- SERVER_PORT=51001
- 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:
......
......@@ -28,7 +28,7 @@
<!--输出实体[IBIZBOOK]数据结构 -->
<changeSet author="a_LAB01_df847bdfd" id="tab-ibizbook-68-2">
<changeSet author="a_LAB01_df847bdfd" id="tab-ibizbook-75-2">
<createTable tableName="T_IBIZBOOK">
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
......
......@@ -47,6 +47,117 @@ public class IBIZBOOKResource {
@Lazy
public IBIZBOOKMapping ibizbookMapping;
@PreAuthorize("hasPermission(this.ibizbookMapping.toDomain(#ibizbookdto),'DemoSys-IBIZBOOK-Create')")
@ApiOperation(value = "新建图书", tags = {"图书" }, notes = "新建图书")
@RequestMapping(method = RequestMethod.POST, value = "/ibizbooks")
public ResponseEntity<IBIZBOOKDTO> create(@Validated @RequestBody IBIZBOOKDTO ibizbookdto) {
IBIZBOOK domain = ibizbookMapping.toDomain(ibizbookdto);
ibizbookService.create(domain);
IBIZBOOKDTO dto = ibizbookMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.ibizbookMapping.toDomain(#ibizbookdtos),'DemoSys-IBIZBOOK-Create')")
@ApiOperation(value = "批量新建图书", tags = {"图书" }, notes = "批量新建图书")
@RequestMapping(method = RequestMethod.POST, value = "/ibizbooks/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<IBIZBOOKDTO> ibizbookdtos) {
ibizbookService.createBatch(ibizbookMapping.toDomain(ibizbookdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "ibizbook" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.ibizbookService.get(#ibizbook_id),'DemoSys-IBIZBOOK-Update')")
@ApiOperation(value = "更新图书", tags = {"图书" }, notes = "更新图书")
@RequestMapping(method = RequestMethod.PUT, value = "/ibizbooks/{ibizbook_id}")
public ResponseEntity<IBIZBOOKDTO> update(@PathVariable("ibizbook_id") String ibizbook_id, @RequestBody IBIZBOOKDTO ibizbookdto) {
IBIZBOOK domain = ibizbookMapping.toDomain(ibizbookdto);
domain .setIbizbookid(ibizbook_id);
ibizbookService.update(domain );
IBIZBOOKDTO dto = ibizbookMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.ibizbookService.getIbizbookByEntities(this.ibizbookMapping.toDomain(#ibizbookdtos)),'DemoSys-IBIZBOOK-Update')")
@ApiOperation(value = "批量更新图书", tags = {"图书" }, notes = "批量更新图书")
@RequestMapping(method = RequestMethod.PUT, value = "/ibizbooks/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<IBIZBOOKDTO> ibizbookdtos) {
ibizbookService.updateBatch(ibizbookMapping.toDomain(ibizbookdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.ibizbookService.get(#ibizbook_id),'DemoSys-IBIZBOOK-Remove')")
@ApiOperation(value = "删除图书", tags = {"图书" }, notes = "删除图书")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibizbooks/{ibizbook_id}")
public ResponseEntity<Boolean> remove(@PathVariable("ibizbook_id") String ibizbook_id) {
return ResponseEntity.status(HttpStatus.OK).body(ibizbookService.remove(ibizbook_id));
}
@PreAuthorize("hasPermission(this.ibizbookService.getIbizbookByIds(#ids),'DemoSys-IBIZBOOK-Remove')")
@ApiOperation(value = "批量删除图书", tags = {"图书" }, notes = "批量删除图书")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibizbooks/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
ibizbookService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.ibizbookMapping.toDomain(returnObject.body),'DemoSys-IBIZBOOK-Get')")
@ApiOperation(value = "获取图书", tags = {"图书" }, notes = "获取图书")
@RequestMapping(method = RequestMethod.GET, value = "/ibizbooks/{ibizbook_id}")
public ResponseEntity<IBIZBOOKDTO> get(@PathVariable("ibizbook_id") String ibizbook_id) {
IBIZBOOK domain = ibizbookService.get(ibizbook_id);
IBIZBOOKDTO dto = ibizbookMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取图书草稿", tags = {"图书" }, notes = "获取图书草稿")
@RequestMapping(method = RequestMethod.GET, value = "/ibizbooks/getdraft")
public ResponseEntity<IBIZBOOKDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(ibizbookMapping.toDto(ibizbookService.getDraft(new IBIZBOOK())));
}
@ApiOperation(value = "检查图书", tags = {"图书" }, notes = "检查图书")
@RequestMapping(method = RequestMethod.POST, value = "/ibizbooks/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody IBIZBOOKDTO ibizbookdto) {
return ResponseEntity.status(HttpStatus.OK).body(ibizbookService.checkKey(ibizbookMapping.toDomain(ibizbookdto)));
}
@PreAuthorize("hasPermission(this.ibizbookMapping.toDomain(#ibizbookdto),'DemoSys-IBIZBOOK-Save')")
@ApiOperation(value = "保存图书", tags = {"图书" }, notes = "保存图书")
@RequestMapping(method = RequestMethod.POST, value = "/ibizbooks/save")
public ResponseEntity<Boolean> save(@RequestBody IBIZBOOKDTO ibizbookdto) {
return ResponseEntity.status(HttpStatus.OK).body(ibizbookService.save(ibizbookMapping.toDomain(ibizbookdto)));
}
@PreAuthorize("hasPermission(this.ibizbookMapping.toDomain(#ibizbookdtos),'DemoSys-IBIZBOOK-Save')")
@ApiOperation(value = "批量保存图书", tags = {"图书" }, notes = "批量保存图书")
@RequestMapping(method = RequestMethod.POST, value = "/ibizbooks/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<IBIZBOOKDTO> ibizbookdtos) {
ibizbookService.saveBatch(ibizbookMapping.toDomain(ibizbookdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','DemoSys-IBIZBOOK-searchDefault-all') and hasPermission(#context,'DemoSys-IBIZBOOK-Get')")
@ApiOperation(value = "获取数据集", tags = {"图书" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.POST , value="/ibizbooks/fetchdefault")
public ResponseEntity<List<IBIZBOOKDTO>> fetchDefault(IBIZBOOKSearchContext context) {
Page<IBIZBOOK> domains = ibizbookService.searchDefault(context) ;
List<IBIZBOOKDTO> list = ibizbookMapping.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-IBIZBOOK-searchDefault-all') and hasPermission(#context,'DemoSys-IBIZBOOK-Get')")
@ApiOperation(value = "查询数据集", tags = {"图书" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/ibizbooks/searchdefault")
public ResponseEntity<Page<IBIZBOOKDTO>> searchDefault(@RequestBody IBIZBOOKSearchContext context) {
Page<IBIZBOOK> domains = ibizbookService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(ibizbookMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册