增加开放平台代码

This commit is contained in:
xu_lw
2019-08-30 15:13:10 +08:00
parent 4bc93173c3
commit 39308d6fa0
31 changed files with 2017 additions and 0 deletions
@@ -0,0 +1,55 @@
<template>
<div>
<el-table style="width: 100%" height="600" :data="groupDataList">
<el-table-column fixed prop="name" label="后台名称" width="80"></el-table-column>
<el-table-column fixed prop="addr" label="后台地址" width="80"></el-table-column>
<el-table-column header-align="center" align="center" width="50">
<template slot-scope="scope">
<el-dropdown>
<span class="el-dropdown-link">
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>删除</el-dropdown-item>
<el-dropdown-item>修改</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import { isGDASucc } from '@/utils'
export default {
data() {
return {
groupDataList: [
{ 'name': '用户' },
{ 'name': '卡包' },
{ 'name': '单卡' }
],
interfaceDataList: [
{ 'name': '查询用户信息', 'url': '/user/query', 'remark': '查询用户信息' },
{ 'name': '查询用户账户余额', 'url': '/user/query', 'remark': '查询用户信息' },
{ 'name': '查询用户账户信息', 'url': '/user/query', 'remark': '查询用户信息' }
]
}
},
components: {
},
activated() {
},
methods: {
handleSelect(key, keyPath) {
console.log(key, keyPath)
},
queryHandler(id) {
}
}
}
</script>
@@ -0,0 +1,80 @@
<template>
<div class="mod-user">
<el-row>
<el-col :span="4">
<el-menu default-active="1" @select="handleSelect">
<el-menu-item index="1">
<i class="el-icon-setting"></i>
<span slot="title">接口管理</span>
</el-menu-item>
<el-menu-item index="2">
<i class="el-icon-setting"></i>
<span slot="title">后台管理</span>
</el-menu-item>
<el-menu-item index="3">
<i class="el-icon-setting"></i>
<span slot="title">安全管理</span>
</el-menu-item>
<el-menu-item index="4">
<i class="el-icon-setting"></i>
<span slot="title">全局白名单管理</span>
</el-menu-item>
</el-menu>
</el-col>
<el-col :span="20">
<div>
<opn-interface v-if="interfaceVisible" ref="opnInterface"></opn-interface>
<opn-backend v-if="backendVisible" ref="opnInterface"></opn-backend>
</div>
</el-col>
</el-row>
</div>
</template>
<script>
import { isGDASucc } from '@/utils'
import OpnInterface from './opninterfaceinf'
import OpnBackend from './opn-backend'
export default {
data() {
return {
interfaceVisible: false,
backendVisible: false,
groupDataList: [
{ 'name': '用户' },
{ 'name': '卡包' },
{ 'name': '单卡' }
],
interfaceDataList: [
{ 'name': '查询用户信息', 'url': '/user/query', 'remark': '查询用户信息' },
{ 'name': '查询用户账户余额', 'url': '/user/query', 'remark': '查询用户信息' },
{ 'name': '查询用户账户信息', 'url': '/user/query', 'remark': '查询用户信息' }
]
}
},
components: {
OpnInterface,
OpnBackend
},
activated() {
this.interfaceVisible = true
},
methods: {
handleSelect(key, keyPath) {
let value = key[0]
if (value === '1') {
this.backendVisible = false
this.interfaceVisible = true
} else if (value === '2') {
this.backendVisible = true
this.interfaceVisible = false
}
console.log(key, keyPath)
},
queryHandler(id) {
}
}
}
</script>
@@ -0,0 +1,214 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList01()">
<el-form-item>
<el-input v-model="dataForm.search" placeholder="搜索内容" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList01()">查询</el-button>
<el-button v-if="isAuth('opn:opninterfacegroupinf:query')" type="primary" @click="queryHandle()">查看</el-button>
<el-button v-if="isAuth('opn:opninterfacegroupinf:add')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('opn:opninterfacegroupinf:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;"
height="400">
<el-table-column
fixed
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="标识">
</el-table-column>
<el-table-column
prop="gateway_id"
header-align="center"
align="center"
label="网关标识">
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
label="组名称">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="center"
label="状态(0-无效,1-有效)">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button v-if="isAuth('opn:opninterfacegroupinf:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button v-if="isAuth('opn:opninterfacegroupinf:delete')" type="text" size="small" @click="deleteHandle(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
ref="pagination"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './opninterfacegroupinf-add-or-update'
import { isGDASucc, getDictValue } from '@/utils'
export default {
data () {
return {
dataForm: {
search: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false,
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList01 () {
this.pageIndex = 1
this.$refs.pagination.lastEmittedPage = 1
this.getDataList()
},
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/buiopnbpc1/opninterfacegroupinf/list.do'),
method: 'get',
params: this.$http.adornParams({
'page_no': this.pageIndex,
'page_size': this.pageSize,
'tot_rec_num': this.totalPage,
'search': this.dataForm.search
})
}).then(({data}) => {
if (isGDASucc(data)) {
if (data.data) {
this.dataList = data.data
this.totalPage = parseInt(data.tot_rec_num)
} else {
this.dataList = []
this.totalPage = 0
}
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.readonly = false
this.$refs.addOrUpdate.init(id)
})
},
// 查看
queryHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.readonly = true
this.$refs.addOrUpdate.init(id)
})
},
// 删除
deleteHandle (row) {
var ids = row ? [row.id] : this.dataListSelections.map(item => {
return item.id
})
// var ids2 = row ? [row.oper_no] : this.dataListSelections.map(item => {
// return item.oper_no
// })
this.$confirm(`确定对[${ids.join(',')}]进行[${row ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/buiopnbpc1/opninterfacegroupinf/delete.do'),
method: 'post',
data: this.$http.adornData({
'ids': ids.join(',')
}, false)
}).then(({data}) => {
if (isGDASucc(data)) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>
@@ -0,0 +1,65 @@
package com.murong.ecp.netpay.mbu.web.opn.action.buiopnbpc1;
import com.alibaba.fastjson.JSONObject;
import com.murong.ecp.netpay.mbu.web.common.utils.*;
import com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceGroupInfDO;
import com.murong.ecp.netpay.mbu.web.opn.dal.dao.OpnInterfaceGroupInfMapper;
import com.yuangou.ecp.biz.transengine.sqlsession.YGPageEntity;
import com.yuangou.ecp.bp.core.common.exception.YGException;
import com.yuangou.ecp.bp.core.common.message.YGBizMessage;
import com.yuangou.ecp.bp.core.common.message.YGBizMessageContext;
import com.yuangou.ecp.bp.core.common.yglog4j.Logger;
import com.yuangou.ecp.bp.core.common.yglog4j.YGLogger;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang.StringUtils;
import com.yuangou.ecp.bp.core.common.message.YGEDB;
import org.springframework.stereotype.Service;
import com.murong.ecp.netpay.mbu.web.opn.model.*;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
/**
* 接口信息表管理服务
* Created by xu_lw on 2019-08-29 22:54:03.
*/
@Service("opninterfacegroupinfAdd")
@Slf4j
public class OpnInterfaceGroupInfAddAction extends BaseAction {
@Autowired
private OpnInterfaceGroupInfMapper opnInterfaceGroupInfMapper;
/**
* 增加记录
* @param bizCtx 上下文
* @param reqBO 请求对象
* @return
* @throws YGException
*/
public ResultT execute(YGBizMessageContext bizCtx, OpnInterfaceGroupInfAddReqBO reqBO) throws YGException {
YGBizMessage bizMsg = bizCtx.getCurrentMsg();
Logger msgLog = YGLogger.getLogger(bizMsg);
msgLog.info("add, reqBO=" + JSONObject.toJSON(reqBO));
ValidatorUtil.validateObject(reqBO);
OpnInterfaceGroupInfDO entity = new OpnInterfaceGroupInfDO();
BeanUtils.copyProperties(reqBO, entity);
BuiOperDTO operDTO = OperSession.getOperInf(bizMsg);
AuditUtil.addAudit(entity, operDTO);
int retCode = opnInterfaceGroupInfMapper.insertSelective(entity);
ResultT resultT = new ResultT();
if( retCode > 0 ) {
resultT.setMsgCod(CommonMessageCode.SUCC);
} else {
resultT.setMsgCod(CommonMessageCode.REC_NFND);
}
return resultT;
}
}
@@ -0,0 +1,59 @@
package com.murong.ecp.netpay.mbu.web.opn.action.buiopnbpc1;
import com.alibaba.fastjson.JSONObject;
import com.murong.ecp.netpay.mbu.web.common.utils.*;
import com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceGroupInfDO;
import com.murong.ecp.netpay.mbu.web.opn.dal.dao.OpnInterfaceGroupInfMapper;
import com.yuangou.ecp.biz.transengine.sqlsession.YGPageEntity;
import com.yuangou.ecp.bp.core.common.exception.YGException;
import com.yuangou.ecp.bp.core.common.message.YGBizMessage;
import com.yuangou.ecp.bp.core.common.message.YGBizMessageContext;
import com.yuangou.ecp.bp.core.common.yglog4j.Logger;
import com.yuangou.ecp.bp.core.common.yglog4j.YGLogger;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang.StringUtils;
import com.yuangou.ecp.bp.core.common.message.YGEDB;
import org.springframework.stereotype.Service;
import com.murong.ecp.netpay.mbu.web.opn.model.*;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
/**
* 接口信息表管理服务
* Created by xu_lw on 2019-08-29 22:54:03.
*/
@Service("opninterfacegroupinfDelete")
@Slf4j
public class OpnInterfaceGroupInfDeleteAction extends BaseAction {
@Autowired
private OpnInterfaceGroupInfMapper opnInterfaceGroupInfMapper;
/**
* 删除记录
* @param bizCtx
* @param reqBO
* @return
* @throws YGException
*/
public ResultT execute(YGBizMessageContext bizCtx, OpnInterfaceGroupInfDeleteReqBO reqBO) throws YGException {
YGBizMessage bizMsg = bizCtx.getCurrentMsg();
Logger msgLog = YGLogger.getLogger(bizMsg);
msgLog.info("delete, reqBO=" + JSONObject.toJSON(reqBO));
ValidatorUtil.validateObject(reqBO);
int retCod = opnInterfaceGroupInfMapper.deleteByIds(reqBO.getIds());
ResultT resultT = new ResultT();
if( retCod > 0 ) {
resultT.setMsgCod(CommonMessageCode.SUCC);
} else {
resultT.setMsgCod(CommonMessageCode.REC_NFND);
}
return resultT;
}
}
@@ -0,0 +1,70 @@
package com.murong.ecp.netpay.mbu.web.opn.action.buiopnbpc1;
import com.alibaba.fastjson.JSONObject;
import com.murong.ecp.netpay.mbu.web.common.utils.*;
import com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceGroupInfDO;
import com.murong.ecp.netpay.mbu.web.opn.dal.dao.OpnInterfaceGroupInfMapper;
import com.yuangou.ecp.biz.transengine.sqlsession.YGPageEntity;
import com.yuangou.ecp.bp.core.common.exception.YGException;
import com.yuangou.ecp.bp.core.common.message.YGBizMessage;
import com.yuangou.ecp.bp.core.common.message.YGBizMessageContext;
import com.yuangou.ecp.bp.core.common.yglog4j.Logger;
import com.yuangou.ecp.bp.core.common.yglog4j.YGLogger;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang.StringUtils;
import com.yuangou.ecp.bp.core.common.message.YGEDB;
import org.springframework.stereotype.Service;
import com.murong.ecp.netpay.mbu.web.opn.model.*;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
/**
* 接口信息表管理服务
* Created by xu_lw on 2019-08-29 22:54:03.
*/
@Service("opninterfacegroupinfList")
@Slf4j
public class OpnInterfaceGroupInfListAction extends BaseAction {
@Autowired
private OpnInterfaceGroupInfMapper opnInterfaceGroupInfMapper;
/**
* 分页查询
* @param bizCtx 上下文
* @param reqBO 请求对象
* @return
* @throws YGException
*/
public PageResultT<OpnInterfaceGroupInfDO> execute(YGBizMessageContext bizCtx, OpnInterfaceGroupInfListReqBO reqBO) throws YGException {
YGBizMessage bizMsg = bizCtx.getCurrentMsg();
Logger msgLog = YGLogger.getLogger(bizMsg);
YGEDB root = bizMsg.getEDBBody();
msgLog.info("list, reqBO=" + JSONObject.toJSON(reqBO));
ValidatorUtil.validateObject(reqBO);
OpnInterfaceGroupInfDO entity = new OpnInterfaceGroupInfDO();
BeanUtils.copyProperties(reqBO, entity);
entity.setName(reqBO.getSearch());
entity.setStatus(reqBO.getSearch());
entity.setRemark(reqBO.getSearch());
YGPageEntity pageEntity = YGPageEntity.createPageEntity(root);
pageEntity.setTot_rec_num(NumberUtils.toInt(root.getData("totalrows")));
List<OpnInterfaceGroupInfDO> list = opnInterfaceGroupInfMapper.selectPage(pageEntity, entity);
PageResultT resultT = new PageResultT();
resultT.setPageEntity(pageEntity);
if( list == null || list.isEmpty() ) {
resultT.setMsgCod(CommonMessageCode.REC_NFND);
} else {
resultT.setMsgCod(CommonMessageCode.SUCC);
resultT.setData(list);
}
return resultT;
}
}
@@ -0,0 +1,62 @@
package com.murong.ecp.netpay.mbu.web.opn.action.buiopnbpc1;
import com.alibaba.fastjson.JSONObject;
import com.murong.ecp.netpay.mbu.web.common.utils.*;
import com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceGroupInfDO;
import com.murong.ecp.netpay.mbu.web.opn.dal.dao.OpnInterfaceGroupInfMapper;
import com.yuangou.ecp.biz.transengine.sqlsession.YGPageEntity;
import com.yuangou.ecp.bp.core.common.exception.YGException;
import com.yuangou.ecp.bp.core.common.message.YGBizMessage;
import com.yuangou.ecp.bp.core.common.message.YGBizMessageContext;
import com.yuangou.ecp.bp.core.common.yglog4j.Logger;
import com.yuangou.ecp.bp.core.common.yglog4j.YGLogger;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang.StringUtils;
import com.yuangou.ecp.bp.core.common.message.YGEDB;
import org.springframework.stereotype.Service;
import com.murong.ecp.netpay.mbu.web.opn.model.*;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
/**
* 接口信息表管理服务
* Created by xu_lw on 2019-08-29 22:54:03.
*/
@Service("opninterfacegroupinfQuery")
@Slf4j
public class OpnInterfaceGroupInfQueryAction extends BaseAction {
@Autowired
private OpnInterfaceGroupInfMapper opnInterfaceGroupInfMapper;
/**
* 查询单笔
* @param bizCtx 上下文
* @param reqBO 请求对象
* @return
* @throws YGException
*/
public ResultT<OpnInterfaceGroupInfDO> execute(YGBizMessageContext bizCtx, OpnInterfaceGroupInfQueryReqBO reqBO) throws YGException {
YGBizMessage bizMsg = bizCtx.getCurrentMsg();
Logger msgLog = YGLogger.getLogger(bizMsg);
msgLog.info("query, reqBO=" + JSONObject.toJSON(reqBO));
ValidatorUtil.validateObject(reqBO);
OpnInterfaceGroupInfDO entity = new OpnInterfaceGroupInfDO();
BeanUtils.copyProperties(reqBO, entity);
entity = opnInterfaceGroupInfMapper.selectByPrimaryKey(entity);
ResultT resultT = new ResultT();
if( entity != null ) {
resultT.setMsgCod(CommonMessageCode.SUCC);
resultT.setData(entity);
} else {
resultT.setMsgCod(CommonMessageCode.REC_NFND);
}
return resultT;
}
}
@@ -0,0 +1,63 @@
package com.murong.ecp.netpay.mbu.web.opn.action.buiopnbpc1;
import com.alibaba.fastjson.JSONObject;
import com.murong.ecp.netpay.mbu.web.common.utils.*;
import com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceGroupInfDO;
import com.murong.ecp.netpay.mbu.web.opn.dal.dao.OpnInterfaceGroupInfMapper;
import com.yuangou.ecp.biz.transengine.sqlsession.YGPageEntity;
import com.yuangou.ecp.bp.core.common.exception.YGException;
import com.yuangou.ecp.bp.core.common.message.YGBizMessage;
import com.yuangou.ecp.bp.core.common.message.YGBizMessageContext;
import com.yuangou.ecp.bp.core.common.yglog4j.Logger;
import com.yuangou.ecp.bp.core.common.yglog4j.YGLogger;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang.StringUtils;
import com.yuangou.ecp.bp.core.common.message.YGEDB;
import org.springframework.stereotype.Service;
import com.murong.ecp.netpay.mbu.web.opn.model.*;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
/**
* 接口信息表管理服务
* Created by xu_lw on 2019-08-29 22:54:03.
*/
@Service("opninterfacegroupinfUpdate")
@Slf4j
public class OpnInterfaceGroupInfUpdateAction extends BaseAction {
@Autowired
private OpnInterfaceGroupInfMapper opnInterfaceGroupInfMapper;
/**
* 更新单笔
* @param bizCtx 上下文
* @param reqBO 请求对象
* @return
* @throws YGException
*/
public ResultT execute(YGBizMessageContext bizCtx, OpnInterfaceGroupInfUpdateReqBO reqBO) throws YGException {
YGBizMessage bizMsg = bizCtx.getCurrentMsg();
Logger msgLog = YGLogger.getLogger(bizMsg);
msgLog.info("update, reqBO=" + JSONObject.toJSON(reqBO));
ValidatorUtil.validateObject(reqBO);
OpnInterfaceGroupInfDO entity = new OpnInterfaceGroupInfDO();
BeanUtils.copyProperties(reqBO, entity);
BuiOperDTO operDTO = OperSession.getOperInf(bizMsg);
AuditUtil.updateAudit(entity, operDTO);
int retCode = opnInterfaceGroupInfMapper.updateByPrimaryKeySelective(entity);
ResultT resultT = new ResultT();
if( retCode > 0 ) {
resultT.setMsgCod(CommonMessageCode.SUCC);
} else {
resultT.setMsgCod(CommonMessageCode.REC_NFND);
}
return resultT;
}
}
@@ -0,0 +1,65 @@
package com.murong.ecp.netpay.mbu.web.opn.action.buiopnbpc1;
import com.alibaba.fastjson.JSONObject;
import com.murong.ecp.netpay.mbu.web.common.utils.*;
import com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceInfDO;
import com.murong.ecp.netpay.mbu.web.opn.dal.dao.OpnInterfaceInfMapper;
import com.yuangou.ecp.biz.transengine.sqlsession.YGPageEntity;
import com.yuangou.ecp.bp.core.common.exception.YGException;
import com.yuangou.ecp.bp.core.common.message.YGBizMessage;
import com.yuangou.ecp.bp.core.common.message.YGBizMessageContext;
import com.yuangou.ecp.bp.core.common.yglog4j.Logger;
import com.yuangou.ecp.bp.core.common.yglog4j.YGLogger;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang.StringUtils;
import com.yuangou.ecp.bp.core.common.message.YGEDB;
import org.springframework.stereotype.Service;
import com.murong.ecp.netpay.mbu.web.opn.model.*;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
/**
* 接口信息表管理服务
* Created by xu_lw on 2019-08-29 22:54:06.
*/
@Service("opninterfaceinfAdd")
@Slf4j
public class OpnInterfaceInfAddAction extends BaseAction {
@Autowired
private OpnInterfaceInfMapper opnInterfaceInfMapper;
/**
* 增加记录
* @param bizCtx 上下文
* @param reqBO 请求对象
* @return
* @throws YGException
*/
public ResultT execute(YGBizMessageContext bizCtx, OpnInterfaceInfAddReqBO reqBO) throws YGException {
YGBizMessage bizMsg = bizCtx.getCurrentMsg();
Logger msgLog = YGLogger.getLogger(bizMsg);
msgLog.info("add, reqBO=" + JSONObject.toJSON(reqBO));
ValidatorUtil.validateObject(reqBO);
OpnInterfaceInfDO entity = new OpnInterfaceInfDO();
BeanUtils.copyProperties(reqBO, entity);
BuiOperDTO operDTO = OperSession.getOperInf(bizMsg);
AuditUtil.addAudit(entity, operDTO);
int retCode = opnInterfaceInfMapper.insertSelective(entity);
ResultT resultT = new ResultT();
if( retCode > 0 ) {
resultT.setMsgCod(CommonMessageCode.SUCC);
} else {
resultT.setMsgCod(CommonMessageCode.REC_NFND);
}
return resultT;
}
}
@@ -0,0 +1,59 @@
package com.murong.ecp.netpay.mbu.web.opn.action.buiopnbpc1;
import com.alibaba.fastjson.JSONObject;
import com.murong.ecp.netpay.mbu.web.common.utils.*;
import com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceInfDO;
import com.murong.ecp.netpay.mbu.web.opn.dal.dao.OpnInterfaceInfMapper;
import com.yuangou.ecp.biz.transengine.sqlsession.YGPageEntity;
import com.yuangou.ecp.bp.core.common.exception.YGException;
import com.yuangou.ecp.bp.core.common.message.YGBizMessage;
import com.yuangou.ecp.bp.core.common.message.YGBizMessageContext;
import com.yuangou.ecp.bp.core.common.yglog4j.Logger;
import com.yuangou.ecp.bp.core.common.yglog4j.YGLogger;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang.StringUtils;
import com.yuangou.ecp.bp.core.common.message.YGEDB;
import org.springframework.stereotype.Service;
import com.murong.ecp.netpay.mbu.web.opn.model.*;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
/**
* 接口信息表管理服务
* Created by xu_lw on 2019-08-29 22:54:06.
*/
@Service("opninterfaceinfDelete")
@Slf4j
public class OpnInterfaceInfDeleteAction extends BaseAction {
@Autowired
private OpnInterfaceInfMapper opnInterfaceInfMapper;
/**
* 删除记录
* @param bizCtx
* @param reqBO
* @return
* @throws YGException
*/
public ResultT execute(YGBizMessageContext bizCtx, OpnInterfaceInfDeleteReqBO reqBO) throws YGException {
YGBizMessage bizMsg = bizCtx.getCurrentMsg();
Logger msgLog = YGLogger.getLogger(bizMsg);
msgLog.info("delete, reqBO=" + JSONObject.toJSON(reqBO));
ValidatorUtil.validateObject(reqBO);
int retCod = opnInterfaceInfMapper.deleteByIds(reqBO.getIds());
ResultT resultT = new ResultT();
if( retCod > 0 ) {
resultT.setMsgCod(CommonMessageCode.SUCC);
} else {
resultT.setMsgCod(CommonMessageCode.REC_NFND);
}
return resultT;
}
}
@@ -0,0 +1,78 @@
package com.murong.ecp.netpay.mbu.web.opn.action.buiopnbpc1;
import com.alibaba.fastjson.JSONObject;
import com.murong.ecp.netpay.mbu.web.common.utils.*;
import com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceInfDO;
import com.murong.ecp.netpay.mbu.web.opn.dal.dao.OpnInterfaceInfMapper;
import com.yuangou.ecp.biz.transengine.sqlsession.YGPageEntity;
import com.yuangou.ecp.bp.core.common.exception.YGException;
import com.yuangou.ecp.bp.core.common.message.YGBizMessage;
import com.yuangou.ecp.bp.core.common.message.YGBizMessageContext;
import com.yuangou.ecp.bp.core.common.yglog4j.Logger;
import com.yuangou.ecp.bp.core.common.yglog4j.YGLogger;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang.StringUtils;
import com.yuangou.ecp.bp.core.common.message.YGEDB;
import org.springframework.stereotype.Service;
import com.murong.ecp.netpay.mbu.web.opn.model.*;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
/**
* 接口信息表管理服务
* Created by xu_lw on 2019-08-29 22:54:06.
*/
@Service("opninterfaceinfList")
@Slf4j
public class OpnInterfaceInfListAction extends BaseAction {
@Autowired
private OpnInterfaceInfMapper opnInterfaceInfMapper;
/**
* 分页查询
* @param bizCtx 上下文
* @param reqBO 请求对象
* @return
* @throws YGException
*/
public PageResultT<OpnInterfaceInfDO> execute(YGBizMessageContext bizCtx, OpnInterfaceInfListReqBO reqBO) throws YGException {
YGBizMessage bizMsg = bizCtx.getCurrentMsg();
Logger msgLog = YGLogger.getLogger(bizMsg);
YGEDB root = bizMsg.getEDBBody();
msgLog.info("list, reqBO=" + JSONObject.toJSON(reqBO));
ValidatorUtil.validateObject(reqBO);
OpnInterfaceInfDO entity = new OpnInterfaceInfDO();
BeanUtils.copyProperties(reqBO, entity);
entity.setName(reqBO.getSearch());
entity.setReqMethod(reqBO.getSearch());
entity.setGwReqPath(reqBO.getSearch());
entity.setBackendReqType(reqBO.getSearch());
entity.setBackendService(reqBO.getSearch());
entity.setBackendReqPath(reqBO.getSearch());
entity.setReqParams(reqBO.getSearch());
entity.setRspParams(reqBO.getSearch());
entity.setConstParams(reqBO.getSearch());
entity.setStatus(reqBO.getSearch());
entity.setRemark(reqBO.getSearch());
YGPageEntity pageEntity = YGPageEntity.createPageEntity(root);
pageEntity.setTot_rec_num(NumberUtils.toInt(root.getData("totalrows")));
List<OpnInterfaceInfDO> list = opnInterfaceInfMapper.selectPage(pageEntity, entity);
PageResultT resultT = new PageResultT();
resultT.setPageEntity(pageEntity);
if( list == null || list.isEmpty() ) {
resultT.setMsgCod(CommonMessageCode.REC_NFND);
} else {
resultT.setMsgCod(CommonMessageCode.SUCC);
resultT.setData(list);
}
return resultT;
}
}
@@ -0,0 +1,62 @@
package com.murong.ecp.netpay.mbu.web.opn.action.buiopnbpc1;
import com.alibaba.fastjson.JSONObject;
import com.murong.ecp.netpay.mbu.web.common.utils.*;
import com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceInfDO;
import com.murong.ecp.netpay.mbu.web.opn.dal.dao.OpnInterfaceInfMapper;
import com.yuangou.ecp.biz.transengine.sqlsession.YGPageEntity;
import com.yuangou.ecp.bp.core.common.exception.YGException;
import com.yuangou.ecp.bp.core.common.message.YGBizMessage;
import com.yuangou.ecp.bp.core.common.message.YGBizMessageContext;
import com.yuangou.ecp.bp.core.common.yglog4j.Logger;
import com.yuangou.ecp.bp.core.common.yglog4j.YGLogger;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang.StringUtils;
import com.yuangou.ecp.bp.core.common.message.YGEDB;
import org.springframework.stereotype.Service;
import com.murong.ecp.netpay.mbu.web.opn.model.*;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
/**
* 接口信息表管理服务
* Created by xu_lw on 2019-08-29 22:54:06.
*/
@Service("opninterfaceinfQuery")
@Slf4j
public class OpnInterfaceInfQueryAction extends BaseAction {
@Autowired
private OpnInterfaceInfMapper opnInterfaceInfMapper;
/**
* 查询单笔
* @param bizCtx 上下文
* @param reqBO 请求对象
* @return
* @throws YGException
*/
public ResultT<OpnInterfaceInfDO> execute(YGBizMessageContext bizCtx, OpnInterfaceInfQueryReqBO reqBO) throws YGException {
YGBizMessage bizMsg = bizCtx.getCurrentMsg();
Logger msgLog = YGLogger.getLogger(bizMsg);
msgLog.info("query, reqBO=" + JSONObject.toJSON(reqBO));
ValidatorUtil.validateObject(reqBO);
OpnInterfaceInfDO entity = new OpnInterfaceInfDO();
BeanUtils.copyProperties(reqBO, entity);
entity = opnInterfaceInfMapper.selectByPrimaryKey(entity);
ResultT resultT = new ResultT();
if( entity != null ) {
resultT.setMsgCod(CommonMessageCode.SUCC);
resultT.setData(entity);
} else {
resultT.setMsgCod(CommonMessageCode.REC_NFND);
}
return resultT;
}
}
@@ -0,0 +1,63 @@
package com.murong.ecp.netpay.mbu.web.opn.action.buiopnbpc1;
import com.alibaba.fastjson.JSONObject;
import com.murong.ecp.netpay.mbu.web.common.utils.*;
import com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceInfDO;
import com.murong.ecp.netpay.mbu.web.opn.dal.dao.OpnInterfaceInfMapper;
import com.yuangou.ecp.biz.transengine.sqlsession.YGPageEntity;
import com.yuangou.ecp.bp.core.common.exception.YGException;
import com.yuangou.ecp.bp.core.common.message.YGBizMessage;
import com.yuangou.ecp.bp.core.common.message.YGBizMessageContext;
import com.yuangou.ecp.bp.core.common.yglog4j.Logger;
import com.yuangou.ecp.bp.core.common.yglog4j.YGLogger;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang.StringUtils;
import com.yuangou.ecp.bp.core.common.message.YGEDB;
import org.springframework.stereotype.Service;
import com.murong.ecp.netpay.mbu.web.opn.model.*;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
/**
* 接口信息表管理服务
* Created by xu_lw on 2019-08-29 22:54:06.
*/
@Service("opninterfaceinfUpdate")
@Slf4j
public class OpnInterfaceInfUpdateAction extends BaseAction {
@Autowired
private OpnInterfaceInfMapper opnInterfaceInfMapper;
/**
* 更新单笔
* @param bizCtx 上下文
* @param reqBO 请求对象
* @return
* @throws YGException
*/
public ResultT execute(YGBizMessageContext bizCtx, OpnInterfaceInfUpdateReqBO reqBO) throws YGException {
YGBizMessage bizMsg = bizCtx.getCurrentMsg();
Logger msgLog = YGLogger.getLogger(bizMsg);
msgLog.info("update, reqBO=" + JSONObject.toJSON(reqBO));
ValidatorUtil.validateObject(reqBO);
OpnInterfaceInfDO entity = new OpnInterfaceInfDO();
BeanUtils.copyProperties(reqBO, entity);
BuiOperDTO operDTO = OperSession.getOperInf(bizMsg);
AuditUtil.updateAudit(entity, operDTO);
int retCode = opnInterfaceInfMapper.updateByPrimaryKeySelective(entity);
ResultT resultT = new ResultT();
if( retCode > 0 ) {
resultT.setMsgCod(CommonMessageCode.SUCC);
} else {
resultT.setMsgCod(CommonMessageCode.REC_NFND);
}
return resultT;
}
}
@@ -0,0 +1,27 @@
/**
* OpnInterfaceGroupInfMapper.java
* Copyright(C) 北京沐融信息科技有限公司
* All rights reserved
* ------------------------------------------------
* Created by xu_lw on 2019-08-29 22:54:03.
*/
package com.murong.ecp.netpay.mbu.web.opn.dal.dao;
import com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceGroupInfDO;
import com.yuangou.ecp.biz.transengine.sqlsession.YGPageEntity;
import com.yuangou.ecp.biz.transengine.sqlsession.YGResultHandler;
import com.yuangou.ecp.biz.transengine.sqlsession.YGSqlCursor;
import java.util.List;
public interface OpnInterfaceGroupInfMapper {
OpnInterfaceGroupInfDO selectByPrimaryKey(OpnInterfaceGroupInfDO entity);
int updateByPrimaryKey(OpnInterfaceGroupInfDO entity);
int updateByPrimaryKeySelective(OpnInterfaceGroupInfDO entity);
int deleteByIds(String ids);
int deleteByPrimaryKey(OpnInterfaceGroupInfDO entity);
int insertSelective(OpnInterfaceGroupInfDO entity);
int insert(OpnInterfaceGroupInfDO entity);
List<OpnInterfaceGroupInfDO> selectPage(YGPageEntity pageEntity, OpnInterfaceGroupInfDO entity);
YGSqlCursor selectCursor(OpnInterfaceGroupInfDO entity);
void selectResultHandler(OpnInterfaceGroupInfDO entity, YGResultHandler resultHandler);
}
@@ -0,0 +1,27 @@
/**
* OpnInterfaceInfMapper.java
* Copyright(C) 北京沐融信息科技有限公司
* All rights reserved
* ------------------------------------------------
* Created by xu_lw on 2019-08-29 22:54:06.
*/
package com.murong.ecp.netpay.mbu.web.opn.dal.dao;
import com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceInfDO;
import com.yuangou.ecp.biz.transengine.sqlsession.YGPageEntity;
import com.yuangou.ecp.biz.transengine.sqlsession.YGResultHandler;
import com.yuangou.ecp.biz.transengine.sqlsession.YGSqlCursor;
import java.util.List;
public interface OpnInterfaceInfMapper {
OpnInterfaceInfDO selectByPrimaryKey(OpnInterfaceInfDO entity);
int updateByPrimaryKey(OpnInterfaceInfDO entity);
int updateByPrimaryKeySelective(OpnInterfaceInfDO entity);
int deleteByIds(String ids);
int deleteByPrimaryKey(OpnInterfaceInfDO entity);
int insertSelective(OpnInterfaceInfDO entity);
int insert(OpnInterfaceInfDO entity);
List<OpnInterfaceInfDO> selectPage(YGPageEntity pageEntity, OpnInterfaceInfDO entity);
YGSqlCursor selectCursor(OpnInterfaceInfDO entity);
void selectResultHandler(OpnInterfaceInfDO entity, YGResultHandler resultHandler);
}
@@ -0,0 +1,89 @@
/**
* OpnInterfaceGroupInfDO.java
* Copyright(C) 北京沐融信息科技有限公司
* ------------------------------------------------
* Created by xu_lw on 2019-08-29 22:54:03.
*/
package com.murong.ecp.netpay.mbu.web.opn.dal.entity;
import com.murong.ecp.bp.common.util.BaseDO;
import net.sf.json.JSONObject;
import com.yuangou.ecp.bp.comp.pubatc.common.YGAmt;
import java.math.BigDecimal;
/**
* 接口信息表
*/
public class OpnInterfaceGroupInfDO extends BaseDO {
/**
* 标识
*/
private Long id;
/**
* 网关标识
*/
private Long gatewayId;
/**
* 组名称
*/
private String name;
/**
* 状态(0-无效,1-有效)
*/
private String status;
/**
* 备注
*/
private String remark;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id == null ? Long.valueOf(0) : id;
}
public Long getGatewayId() {
return gatewayId;
}
public void setGatewayId(Long gatewayId) {
this.gatewayId = gatewayId == null ? Long.valueOf(0) : gatewayId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? "" : name.trim();
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? "" : status.trim();
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? "" : remark.trim();
}
@Override
public void clean() {
super.clean();
setId(null);
setGatewayId(null);
setName(null);
setStatus(null);
setRemark(null);
}
}
@@ -0,0 +1,206 @@
/**
* OpnInterfaceInfDO.java
* Copyright(C) 北京沐融信息科技有限公司
* ------------------------------------------------
* Created by xu_lw on 2019-08-29 22:54:06.
*/
package com.murong.ecp.netpay.mbu.web.opn.dal.entity;
import com.murong.ecp.bp.common.util.BaseDO;
import net.sf.json.JSONObject;
import com.yuangou.ecp.bp.comp.pubatc.common.YGAmt;
import java.math.BigDecimal;
/**
* 接口信息表
*/
public class OpnInterfaceInfDO extends BaseDO {
/**
* 标识
*/
private Long id;
/**
* 网关标识
*/
private Long gatewayId;
/**
* 组标识
*/
private Long groupId;
/**
* 名称
*/
private String name;
/**
* 网关请求方式(P-POST,G-GET,U-PUT,D-DELETE,H-HEAD,O-OPTIONS,C-PATCH)
*/
private String reqMethod;
/**
* 网关请求路径
*/
private String gwReqPath;
/**
* 后端请求类型(F-跟随,P-POST,G-GET,U-PUT,D-DELETE,H-HEAD,O-OPTIONS,C-PATCH)
*/
private String backendReqType;
/**
* 后端请求服务
*/
private String backendService;
/**
* 后端请求路径
*/
private String backendReqPath;
/**
* 请求参数
*/
private String reqParams;
/**
* 响应参数
*/
private String rspParams;
/**
* 常量参数
*/
private String constParams;
/**
* 状态(1-有效,0-无效)
*/
private String status;
/**
* 备注
*/
private String remark;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id == null ? Long.valueOf(0) : id;
}
public Long getGatewayId() {
return gatewayId;
}
public void setGatewayId(Long gatewayId) {
this.gatewayId = gatewayId == null ? Long.valueOf(0) : gatewayId;
}
public Long getGroupId() {
return groupId;
}
public void setGroupId(Long groupId) {
this.groupId = groupId == null ? Long.valueOf(0) : groupId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? "" : name.trim();
}
public String getReqMethod() {
return reqMethod;
}
public void setReqMethod(String reqMethod) {
this.reqMethod = reqMethod == null ? "" : reqMethod.trim();
}
public String getGwReqPath() {
return gwReqPath;
}
public void setGwReqPath(String gwReqPath) {
this.gwReqPath = gwReqPath == null ? "" : gwReqPath.trim();
}
public String getBackendReqType() {
return backendReqType;
}
public void setBackendReqType(String backendReqType) {
this.backendReqType = backendReqType == null ? "" : backendReqType.trim();
}
public String getBackendService() {
return backendService;
}
public void setBackendService(String backendService) {
this.backendService = backendService == null ? "" : backendService.trim();
}
public String getBackendReqPath() {
return backendReqPath;
}
public void setBackendReqPath(String backendReqPath) {
this.backendReqPath = backendReqPath == null ? "" : backendReqPath.trim();
}
public String getReqParams() {
return reqParams;
}
public void setReqParams(String reqParams) {
this.reqParams = reqParams == null ? "" : reqParams.trim();
}
public String getRspParams() {
return rspParams;
}
public void setRspParams(String rspParams) {
this.rspParams = rspParams == null ? "" : rspParams.trim();
}
public String getConstParams() {
return constParams;
}
public void setConstParams(String constParams) {
this.constParams = constParams == null ? "" : constParams.trim();
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? "" : status.trim();
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? "" : remark.trim();
}
@Override
public void clean() {
super.clean();
setId(null);
setGatewayId(null);
setGroupId(null);
setName(null);
setReqMethod(null);
setGwReqPath(null);
setBackendReqType(null);
setBackendService(null);
setBackendReqPath(null);
setReqParams(null);
setRspParams(null);
setConstParams(null);
setStatus(null);
setRemark(null);
}
}
@@ -0,0 +1,44 @@
package com.murong.ecp.netpay.mbu.web.opn.model;
import java.math.BigDecimal;
import net.sf.oval.constraint.NotEmpty;
import net.sf.oval.constraint.Size;
import net.sf.oval.constraint.NotNull;
import com.murong.ecp.netpay.mbu.web.common.utils.*;
import com.murong.ecp.bp.common.dict.ECPDict;
import com.murong.ecp.bp.common.dict.ECPDict;
import com.yuangou.ecp.bp.comp.pubatc.common.YGAmt;
import lombok.Data;
/**
* Created by syxlw on 2018/4/28.
*/
@Data
public class OpnInterfaceGroupInfAddReqBO {
/**
* 网关标识
*/
@ECPDict(required = true, message = "gatewayId值不合法")
private Long gatewayId;
/**
* 组名称
*/
@ECPDict(required = true,length = 60, message = "name值不合法")
private String name;
/**
* 状态(0-无效,1-有效)
*/
@ECPDict(required = true,length = 1, message = "status值不合法")
private String status;
/**
* 备注
*/
@ECPDict(required = true,length = 80, message = "remark值不合法")
private String remark;
}
@@ -0,0 +1,23 @@
package com.murong.ecp.netpay.mbu.web.opn.model;
import java.math.BigDecimal;
import net.sf.oval.constraint.NotEmpty;
import net.sf.oval.constraint.Size;
import net.sf.oval.constraint.NotNull;
import com.murong.ecp.netpay.mbu.web.common.utils.*;
import com.murong.ecp.bp.common.dict.ECPDict;
import com.yuangou.ecp.bp.comp.pubatc.common.YGAmt;
import lombok.Data;
/**
* Created by syxlw on 2018/4/28.
*/
@Data
public class OpnInterfaceGroupInfDeleteReqBO {
/**
* id
*/
@ECPDict(required = true, message = "ids值不合法")
private String ids;
}
@@ -0,0 +1,21 @@
package com.murong.ecp.netpay.mbu.web.opn.model;
import java.math.BigDecimal;
import com.murong.ecp.netpay.mbu.web.common.utils.PageRequest;
import net.sf.oval.constraint.NotNull;
import net.sf.oval.constraint.Size;
import net.sf.oval.constraint.NotEmpty;
import com.murong.ecp.netpay.mbu.web.common.utils.*;
import com.murong.ecp.bp.common.dict.ECPDict;
import com.yuangou.ecp.bp.comp.pubatc.common.YGAmt;
import lombok.Data;
/**
* Created by syxlw on 2018/4/28.
*/
@Data
public class OpnInterfaceGroupInfListReqBO extends PageRequest {
/**
* search
*/
private String search;
}
@@ -0,0 +1,23 @@
package com.murong.ecp.netpay.mbu.web.opn.model;
import net.sf.oval.constraint.NotNull;
import net.sf.oval.constraint.Size;
import net.sf.oval.constraint.NotEmpty;
import java.math.BigDecimal;
import com.murong.ecp.netpay.mbu.web.common.utils.*;
import com.murong.ecp.bp.common.dict.ECPDict;
import com.yuangou.ecp.bp.comp.pubatc.common.YGAmt;
import lombok.Data;
/**
* Created by syxlw on 2018/4/28.
*/
@Data
public class OpnInterfaceGroupInfQueryReqBO {
/**
* 标识
*/
@ECPDict(required = true, message = "id值不合法")
private Long id;
}
@@ -0,0 +1,47 @@
package com.murong.ecp.netpay.mbu.web.opn.model;
import java.math.BigDecimal;
import net.sf.oval.constraint.NotNull;
import net.sf.oval.constraint.Size;
import net.sf.oval.constraint.NotEmpty;
import com.murong.ecp.netpay.mbu.web.common.utils.*;
import com.murong.ecp.bp.common.dict.ECPDict;
import com.yuangou.ecp.bp.comp.pubatc.common.YGAmt;
import lombok.Data;
/**
* Created by syxlw on 2018/4/28.
*/
@Data
public class OpnInterfaceGroupInfUpdateReqBO {
/**
* 标识
*/
@ECPDict(required = true, message = "id值不合法")
private Long id;
/**
* 网关标识
*/
@ECPDict(required = true, message = "gatewayId值不合法")
private Long gatewayId;
/**
* 组名称
*/
@ECPDict(required = true,length = 60, message = "name值不合法")
private String name;
/**
* 状态(0-无效,1-有效)
*/
@ECPDict(required = true,length = 1, message = "status值不合法")
private String status;
/**
* 备注
*/
@ECPDict(required = true,length = 80, message = "remark值不合法")
private String remark;
}
@@ -0,0 +1,98 @@
package com.murong.ecp.netpay.mbu.web.opn.model;
import java.math.BigDecimal;
import net.sf.oval.constraint.NotEmpty;
import net.sf.oval.constraint.Size;
import net.sf.oval.constraint.NotNull;
import com.murong.ecp.netpay.mbu.web.common.utils.*;
import com.murong.ecp.bp.common.dict.ECPDict;
import com.murong.ecp.bp.common.dict.ECPDict;
import com.yuangou.ecp.bp.comp.pubatc.common.YGAmt;
import lombok.Data;
/**
* Created by syxlw on 2018/4/28.
*/
@Data
public class OpnInterfaceInfAddReqBO {
/**
* 网关标识
*/
@ECPDict(required = true, message = "gatewayId值不合法")
private Long gatewayId;
/**
* 组标识
*/
@ECPDict(required = true, message = "groupId值不合法")
private Long groupId;
/**
* 名称
*/
@ECPDict(required = true,length = 60, message = "name值不合法")
private String name;
/**
* 网关请求方式(P-POST,G-GET,U-PUT,D-DELETE,H-HEAD,O-OPTIONS,C-PATCH)
*/
@ECPDict(required = true,length = 10, message = "reqMethod值不合法")
private String reqMethod;
/**
* 网关请求路径
*/
@ECPDict(required = true,length = 80, message = "gwReqPath值不合法")
private String gwReqPath;
/**
* 后端请求类型(F-跟随,P-POST,G-GET,U-PUT,D-DELETE,H-HEAD,O-OPTIONS,C-PATCH)
*/
@ECPDict(required = true,length = 1, message = "backendReqType值不合法")
private String backendReqType;
/**
* 后端请求服务
*/
@ECPDict(required = true,length = 80, message = "backendService值不合法")
private String backendService;
/**
* 后端请求路径
*/
@ECPDict(required = true,length = 80, message = "backendReqPath值不合法")
private String backendReqPath;
/**
* 请求参数
*/
@ECPDict(required = true,length = 2048, message = "reqParams值不合法")
private String reqParams;
/**
* 响应参数
*/
@ECPDict(required = true,length = 2048, message = "rspParams值不合法")
private String rspParams;
/**
* 常量参数
*/
@ECPDict(required = true,length = 256, message = "constParams值不合法")
private String constParams;
/**
* 状态(1-有效,0-无效)
*/
@ECPDict(required = true,length = 1, message = "status值不合法")
private String status;
/**
* 备注
*/
@ECPDict(required = true,length = 80, message = "remark值不合法")
private String remark;
}
@@ -0,0 +1,23 @@
package com.murong.ecp.netpay.mbu.web.opn.model;
import java.math.BigDecimal;
import net.sf.oval.constraint.NotEmpty;
import net.sf.oval.constraint.Size;
import net.sf.oval.constraint.NotNull;
import com.murong.ecp.netpay.mbu.web.common.utils.*;
import com.murong.ecp.bp.common.dict.ECPDict;
import com.yuangou.ecp.bp.comp.pubatc.common.YGAmt;
import lombok.Data;
/**
* Created by syxlw on 2018/4/28.
*/
@Data
public class OpnInterfaceInfDeleteReqBO {
/**
* id
*/
@ECPDict(required = true, message = "ids值不合法")
private String ids;
}
@@ -0,0 +1,21 @@
package com.murong.ecp.netpay.mbu.web.opn.model;
import java.math.BigDecimal;
import com.murong.ecp.netpay.mbu.web.common.utils.PageRequest;
import net.sf.oval.constraint.NotNull;
import net.sf.oval.constraint.Size;
import net.sf.oval.constraint.NotEmpty;
import com.murong.ecp.netpay.mbu.web.common.utils.*;
import com.murong.ecp.bp.common.dict.ECPDict;
import com.yuangou.ecp.bp.comp.pubatc.common.YGAmt;
import lombok.Data;
/**
* Created by syxlw on 2018/4/28.
*/
@Data
public class OpnInterfaceInfListReqBO extends PageRequest {
/**
* search
*/
private String search;
}
@@ -0,0 +1,23 @@
package com.murong.ecp.netpay.mbu.web.opn.model;
import net.sf.oval.constraint.NotNull;
import net.sf.oval.constraint.Size;
import net.sf.oval.constraint.NotEmpty;
import java.math.BigDecimal;
import com.murong.ecp.netpay.mbu.web.common.utils.*;
import com.murong.ecp.bp.common.dict.ECPDict;
import com.yuangou.ecp.bp.comp.pubatc.common.YGAmt;
import lombok.Data;
/**
* Created by syxlw on 2018/4/28.
*/
@Data
public class OpnInterfaceInfQueryReqBO {
/**
* 标识
*/
@ECPDict(required = true, message = "id值不合法")
private Long id;
}
@@ -0,0 +1,101 @@
package com.murong.ecp.netpay.mbu.web.opn.model;
import java.math.BigDecimal;
import net.sf.oval.constraint.NotNull;
import net.sf.oval.constraint.Size;
import net.sf.oval.constraint.NotEmpty;
import com.murong.ecp.netpay.mbu.web.common.utils.*;
import com.murong.ecp.bp.common.dict.ECPDict;
import com.yuangou.ecp.bp.comp.pubatc.common.YGAmt;
import lombok.Data;
/**
* Created by syxlw on 2018/4/28.
*/
@Data
public class OpnInterfaceInfUpdateReqBO {
/**
* 标识
*/
@ECPDict(required = true, message = "id值不合法")
private Long id;
/**
* 网关标识
*/
@ECPDict(required = true, message = "gatewayId值不合法")
private Long gatewayId;
/**
* 组标识
*/
@ECPDict(required = true, message = "groupId值不合法")
private Long groupId;
/**
* 名称
*/
@ECPDict(required = true,length = 60, message = "name值不合法")
private String name;
/**
* 网关请求方式(P-POST,G-GET,U-PUT,D-DELETE,H-HEAD,O-OPTIONS,C-PATCH)
*/
@ECPDict(required = true,length = 10, message = "reqMethod值不合法")
private String reqMethod;
/**
* 网关请求路径
*/
@ECPDict(required = true,length = 80, message = "gwReqPath值不合法")
private String gwReqPath;
/**
* 后端请求类型(F-跟随,P-POST,G-GET,U-PUT,D-DELETE,H-HEAD,O-OPTIONS,C-PATCH)
*/
@ECPDict(required = true,length = 1, message = "backendReqType值不合法")
private String backendReqType;
/**
* 后端请求服务
*/
@ECPDict(required = true,length = 80, message = "backendService值不合法")
private String backendService;
/**
* 后端请求路径
*/
@ECPDict(required = true,length = 80, message = "backendReqPath值不合法")
private String backendReqPath;
/**
* 请求参数
*/
@ECPDict(required = true,length = 2048, message = "reqParams值不合法")
private String reqParams;
/**
* 响应参数
*/
@ECPDict(required = true,length = 2048, message = "rspParams值不合法")
private String rspParams;
/**
* 常量参数
*/
@ECPDict(required = true,length = 256, message = "constParams值不合法")
private String constParams;
/**
* 状态(1-有效,0-无效)
*/
@ECPDict(required = true,length = 1, message = "status值不合法")
private String status;
/**
* 备注
*/
@ECPDict(required = true,length = 80, message = "remark值不合法")
private String remark;
}
@@ -6,6 +6,7 @@ import com.murong.ecp.netpay.mbu.web.common.utils.CommonMessageCode;
import com.murong.ecp.netpay.mbu.web.common.utils.ResultT;
import com.murong.ecp.netpay.mbu.web.common.utils.ValidatorUtil;
import com.murong.ecp.netpay.mbu.web.pub.dal.dao.BuiDctMapper;
import com.murong.ecp.netpay.mbu.web.pub.dal.dao.BuiHlpMapper;
import com.murong.ecp.netpay.mbu.web.pub.dal.entity.BuiDctDO;
import com.murong.ecp.netpay.mbu.web.pub.model.BuiDctDeleteReqBO;
import com.yuangou.ecp.bp.core.common.exception.YGException;
@@ -14,6 +15,7 @@ import com.yuangou.ecp.bp.core.common.message.YGBizMessageContext;
import com.yuangou.ecp.bp.core.common.yglog4j.Logger;
import com.yuangou.ecp.bp.core.common.yglog4j.YGLogger;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -28,6 +30,9 @@ public class BuiDctDeleteAction extends BaseAction {
@Autowired
private BuiDctMapper buiDctMapper;
@Autowired
private BuiHlpMapper buiHlpMapper;
/**
* 删除记录
*
@@ -43,6 +48,13 @@ public class BuiDctDeleteAction extends BaseAction {
ValidatorUtil.validateObject(reqBO);
String ids = reqBO.getIds();
String[] idList = StringUtils.split(ids, ",");
for( String id : idList) {
BuiDctDO buiDctDO = buiDctMapper.selectByPrimaryKey(Long.valueOf(id));
buiHlpMapper.deleteByName(buiDctDO.getDctNm());
}
int retCod = buiDctMapper.deleteByIds(reqBO.getIds());
ResultT resultT = new ResultT();
@@ -35,4 +35,6 @@ public interface BuiDctMapper {
int deleteByIds(String ids);
BuiDctDO selectByPrimaryKey(Long id);
}
@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="GBK"?>
<!-- Created by xu_lw on 2019-08-29 22:54:03. -->
<mapper namespace="com.murong.ecp.netpay.mbu.web.opn.dal.dao.OpnInterfaceGroupInfMapper">
<select id="selectByPrimaryKey" resultType="com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceGroupInfDO">
select <include refid="base_column_list"/>
from T_OPN_INTERFACE_GROUP_INF where id = #{id}
</select>
<!-- 分页查询id后缀必须为Page -->
<select id="selectPage" resultType="com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceGroupInfDO">
select <include refid="base_column_list"/>
from T_OPN_INTERFACE_GROUP_INF where name like '%%${name}%%' or status like '%%${status}%%' or remark like '%%${remark}%%' order by id
</select>
<!-- 游标后缀必须为Cursor -->
<select id="selectCursor" resultType="com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceGroupInfDO">
select <include refid="base_column_list"/>
from T_OPN_INTERFACE_GROUP_INF
</select>
<!-- 查询id后缀必须为ResultHandler -->
<select id="selectResultHandler" resultType="com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceGroupInfDO">
select <include refid="base_column_list"/>
from T_OPN_INTERFACE_GROUP_INF
</select>
<delete id="deleteByPrimaryKey" parameterType="com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceGroupInfDO">
delete from T_OPN_INTERFACE_GROUP_INF where id = #{id}
</delete>
<delete id="deleteByIds" parameterType="java.lang.String">
delete from T_OPN_INTERFACE_GROUP_INF where id in (${ids})
</delete>
<update id="updateByPrimaryKey" parameterType="com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceGroupInfDO">
update T_OPN_INTERFACE_GROUP_INF
<trim prefix="set" suffixOverrides = ",">
<if test="isNotNull(id)">id=#{id},</if>
<if test="isNotNull(gatewayId)">gateway_id=#{gatewayId},</if>
<if test="isNotNull(name)">name=#{name},</if>
<if test="isNotNull(status)">status=#{status},</if>
<if test="isNotNull(remark)">remark=#{remark},</if>
</trim>
where id = #{id}
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceGroupInfDO">
update T_OPN_INTERFACE_GROUP_INF
<trim prefix="set" suffixOverrides = ",">
<if test="isNotNull(id)">id=#{id},</if>
<if test="isNotNull(gatewayId)">gateway_id=#{gatewayId},</if>
<if test="isNotNull(name)">name=#{name},</if>
<if test="isNotNull(status)">status=#{status},</if>
<if test="isNotNull(remark)">remark=#{remark},</if>
</trim>
where id = #{id}
</update>
<insert id="insert" parameterType="com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceGroupInfDO">
insert into T_OPN_INTERFACE_GROUP_INF(id, gateway_id, name, status, remark)
values( S_PUB_ID.nextval#{gatewayId}, #{name}, #{status}, #{remark})
</insert>
<insert id="insertSelective" parameterType="com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceGroupInfDO">
insert into T_OPN_INTERFACE_GROUP_INF
<trim prefix="(" suffix=')' suffixOverrides=",">
id ,
<if test="isNotNull(gatewayId)">gateway_id,</if>
<if test="isNotNull(name)">name,</if>
<if test="isNotNull(status)">status,</if>
<if test="isNotNull(remark)">remark,</if>
</trim>
<trim prefix="values(" suffix=')' suffixOverrides=",">
S_PUB_ID.nextval ,
<if test="isNotNull(gatewayId)">#{gatewayId},</if>
<if test="isNotNull(name)">#{name},</if>
<if test="isNotNull(status)">#{status},</if>
<if test="isNotNull(remark)">#{remark},</if>
</trim>
</insert>
<sql id="base_column_list">
id, gateway_id, name, status, remark
</sql>
<sql id="where_condition">
<trim prefix="where" prefixOverrides="and">
<if test="isNotNull(id)">id=#{id},</if>
<if test="isNotNull(gatewayId)">gateway_id=#{gatewayId},</if>
<if test="isNotNull(name)">name=#{name},</if>
<if test="isNotNull(status)">status=#{status},</if>
<if test="isNotNull(remark)">remark=#{remark},</if>
</trim>
</sql>
</mapper>
@@ -0,0 +1,140 @@
<?xml version="1.0" encoding="GBK"?>
<!-- Created by xu_lw on 2019-08-29 22:54:06. -->
<mapper namespace="com.murong.ecp.netpay.mbu.web.opn.dal.dao.OpnInterfaceInfMapper">
<select id="selectByPrimaryKey" resultType="com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceInfDO">
select <include refid="base_column_list"/>
from T_OPN_INTERFACE_INF where id = #{id}
</select>
<!-- 分页查询id后缀必须为Page -->
<select id="selectPage" resultType="com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceInfDO">
select <include refid="base_column_list"/>
from T_OPN_INTERFACE_INF where name like '%%${name}%%' or req_method like '%%${reqMethod}%%' or gw_req_path like '%%${gwReqPath}%%' or backend_req_type like '%%${backendReqType}%%' or backend_service like '%%${backendService}%%' or backend_req_path like '%%${backendReqPath}%%' or req_params like '%%${reqParams}%%' or rsp_params like '%%${rspParams}%%' or const_params like '%%${constParams}%%' or status like '%%${status}%%' or remark like '%%${remark}%%' order by id
</select>
<!-- 游标后缀必须为Cursor -->
<select id="selectCursor" resultType="com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceInfDO">
select <include refid="base_column_list"/>
from T_OPN_INTERFACE_INF
</select>
<!-- 查询id后缀必须为ResultHandler -->
<select id="selectResultHandler" resultType="com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceInfDO">
select <include refid="base_column_list"/>
from T_OPN_INTERFACE_INF
</select>
<delete id="deleteByPrimaryKey" parameterType="com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceInfDO">
delete from T_OPN_INTERFACE_INF where id = #{id}
</delete>
<delete id="deleteByIds" parameterType="java.lang.String">
delete from T_OPN_INTERFACE_INF where id in (${ids})
</delete>
<update id="updateByPrimaryKey" parameterType="com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceInfDO">
update T_OPN_INTERFACE_INF
<trim prefix="set" suffixOverrides = ",">
<if test="isNotNull(id)">id=#{id},</if>
<if test="isNotNull(gatewayId)">gateway_id=#{gatewayId},</if>
<if test="isNotNull(groupId)">group_id=#{groupId},</if>
<if test="isNotNull(name)">name=#{name},</if>
<if test="isNotNull(reqMethod)">req_method=#{reqMethod},</if>
<if test="isNotNull(gwReqPath)">gw_req_path=#{gwReqPath},</if>
<if test="isNotNull(backendReqType)">backend_req_type=#{backendReqType},</if>
<if test="isNotNull(backendService)">backend_service=#{backendService},</if>
<if test="isNotNull(backendReqPath)">backend_req_path=#{backendReqPath},</if>
<if test="isNotNull(reqParams)">req_params=#{reqParams},</if>
<if test="isNotNull(rspParams)">rsp_params=#{rspParams},</if>
<if test="isNotNull(constParams)">const_params=#{constParams},</if>
<if test="isNotNull(status)">status=#{status},</if>
<if test="isNotNull(remark)">remark=#{remark},</if>
</trim>
where id = #{id}
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceInfDO">
update T_OPN_INTERFACE_INF
<trim prefix="set" suffixOverrides = ",">
<if test="isNotNull(id)">id=#{id},</if>
<if test="isNotNull(gatewayId)">gateway_id=#{gatewayId},</if>
<if test="isNotNull(groupId)">group_id=#{groupId},</if>
<if test="isNotNull(name)">name=#{name},</if>
<if test="isNotNull(reqMethod)">req_method=#{reqMethod},</if>
<if test="isNotNull(gwReqPath)">gw_req_path=#{gwReqPath},</if>
<if test="isNotNull(backendReqType)">backend_req_type=#{backendReqType},</if>
<if test="isNotNull(backendService)">backend_service=#{backendService},</if>
<if test="isNotNull(backendReqPath)">backend_req_path=#{backendReqPath},</if>
<if test="isNotNull(reqParams)">req_params=#{reqParams},</if>
<if test="isNotNull(rspParams)">rsp_params=#{rspParams},</if>
<if test="isNotNull(constParams)">const_params=#{constParams},</if>
<if test="isNotNull(status)">status=#{status},</if>
<if test="isNotNull(remark)">remark=#{remark},</if>
</trim>
where id = #{id}
</update>
<insert id="insert" parameterType="com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceInfDO">
insert into T_OPN_INTERFACE_INF(id, gateway_id, group_id, name, req_method, gw_req_path, backend_req_type, backend_service, backend_req_path, req_params, rsp_params, const_params, status, remark)
values( S_PUB_ID.nextval#{gatewayId}, #{groupId}, #{name}, #{reqMethod}, #{gwReqPath}, #{backendReqType}, #{backendService}, #{backendReqPath}, #{reqParams}, #{rspParams}, #{constParams}, #{status}, #{remark})
</insert>
<insert id="insertSelective" parameterType="com.murong.ecp.netpay.mbu.web.opn.dal.entity.OpnInterfaceInfDO">
insert into T_OPN_INTERFACE_INF
<trim prefix="(" suffix=')' suffixOverrides=",">
id ,
<if test="isNotNull(gatewayId)">gateway_id,</if>
<if test="isNotNull(groupId)">group_id,</if>
<if test="isNotNull(name)">name,</if>
<if test="isNotNull(reqMethod)">req_method,</if>
<if test="isNotNull(gwReqPath)">gw_req_path,</if>
<if test="isNotNull(backendReqType)">backend_req_type,</if>
<if test="isNotNull(backendService)">backend_service,</if>
<if test="isNotNull(backendReqPath)">backend_req_path,</if>
<if test="isNotNull(reqParams)">req_params,</if>
<if test="isNotNull(rspParams)">rsp_params,</if>
<if test="isNotNull(constParams)">const_params,</if>
<if test="isNotNull(status)">status,</if>
<if test="isNotNull(remark)">remark,</if>
</trim>
<trim prefix="values(" suffix=')' suffixOverrides=",">
S_PUB_ID.nextval ,
<if test="isNotNull(gatewayId)">#{gatewayId},</if>
<if test="isNotNull(groupId)">#{groupId},</if>
<if test="isNotNull(name)">#{name},</if>
<if test="isNotNull(reqMethod)">#{reqMethod},</if>
<if test="isNotNull(gwReqPath)">#{gwReqPath},</if>
<if test="isNotNull(backendReqType)">#{backendReqType},</if>
<if test="isNotNull(backendService)">#{backendService},</if>
<if test="isNotNull(backendReqPath)">#{backendReqPath},</if>
<if test="isNotNull(reqParams)">#{reqParams},</if>
<if test="isNotNull(rspParams)">#{rspParams},</if>
<if test="isNotNull(constParams)">#{constParams},</if>
<if test="isNotNull(status)">#{status},</if>
<if test="isNotNull(remark)">#{remark},</if>
</trim>
</insert>
<sql id="base_column_list">
id, gateway_id, group_id, name, req_method, gw_req_path, backend_req_type, backend_service, backend_req_path, req_params, rsp_params, const_params, status, remark
</sql>
<sql id="where_condition">
<trim prefix="where" prefixOverrides="and">
<if test="isNotNull(id)">id=#{id},</if>
<if test="isNotNull(gatewayId)">gateway_id=#{gatewayId},</if>
<if test="isNotNull(groupId)">group_id=#{groupId},</if>
<if test="isNotNull(name)">name=#{name},</if>
<if test="isNotNull(reqMethod)">req_method=#{reqMethod},</if>
<if test="isNotNull(gwReqPath)">gw_req_path=#{gwReqPath},</if>
<if test="isNotNull(backendReqType)">backend_req_type=#{backendReqType},</if>
<if test="isNotNull(backendService)">backend_service=#{backendService},</if>
<if test="isNotNull(backendReqPath)">backend_req_path=#{backendReqPath},</if>
<if test="isNotNull(reqParams)">req_params=#{reqParams},</if>
<if test="isNotNull(rspParams)">rsp_params=#{rspParams},</if>
<if test="isNotNull(constParams)">const_params=#{constParams},</if>
<if test="isNotNull(status)">status=#{status},</if>
<if test="isNotNull(remark)">remark=#{remark},</if>
</trim>
</sql>
</mapper>