Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dm_project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姚本章
dm_project
Commits
88042ad1
Commit
88042ad1
authored
Feb 23, 2021
by
zhangc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加function列表查询接口
parent
47c2622a
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
66 additions
and
39 deletions
+66
-39
api_gateway.sql
database/zc/api_gateway.sql
+19
-1
RouteType.java
...teway/src/main/java/com/jz/dm/common/enums/RouteType.java
+0
-13
DirectionTypeEnum.java
...a/com/jz/dm/common/enums/direction/DirectionTypeEnum.java
+1
-1
OrgStatusEnum.java
...c/main/java/com/jz/dm/common/enums/org/OrgStatusEnum.java
+1
-1
OpenApiResultCode.java
...rc/main/java/com/jz/dm/common/util/OpenApiResultCode.java
+0
-10
SwaggerConfiguration.java
.../src/main/java/com/jz/dm/config/SwaggerConfiguration.java
+4
-0
ProducerController.java
...rc/main/java/com/jz/dm/controller/ProducerController.java
+5
-0
MybatisPlusGenerate.java
...src/main/java/com/jz/dm/generate/MybatisPlusGenerate.java
+8
-8
ProducerService.java
...eway/src/main/java/com/jz/dm/service/ProducerService.java
+6
-0
ProducerServiceImpl.java
...main/java/com/jz/dm/service/impl/ProducerServiceImpl.java
+18
-5
application-test.yml
jz-dm-apigateway/src/main/resources/application-test.yml
+4
-0
banner002.txt
jz-dm-apigateway/src/main/resources/banner002.txt
+0
-0
No files found.
database/zc/api_gateway.sql
View file @
88042ad1
...
...
@@ -278,4 +278,22 @@ CREATE TABLE `t_api_direction` (
`create_user`
varchar
(
100
)
DEFAULT
NULL
COMMENT
'创建人'
,
`is_deleted`
tinyint
(
2
)
unsigned
NOT
NULL
DEFAULT
'0'
COMMENT
'是否删除'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'api字典表信息表'
;
\ No newline at end of file
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'api字典表信息表'
;
#
api
模板方法表
CREATE
TABLE
`t_api_function`
(
`id`
bigint
(
20
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'api 信息表自增ID'
,
`alias`
varchar
(
100
)
DEFAULT
NULL
COMMENT
'别名'
,
`name`
varchar
(
100
)
NOT
NULL
COMMENT
'模板名称'
,
`template_url`
varchar
(
200
)
DEFAULT
''
COMMENT
'请求路径'
,
`type`
varchar
(
100
)
DEFAULT
''
COMMENT
'模板类型'
,
`status`
tinyint
(
2
)
NOT
NULL
DEFAULT
'1'
COMMENT
'是否启用:0 否, 1 是'
,
`remark`
varchar
(
500
)
DEFAULT
NULL
COMMENT
'备注'
,
`create_date`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`create_user`
varchar
(
100
)
DEFAULT
NULL
COMMENT
'创建人'
,
`update_date`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'修改时间'
,
`update_user`
varchar
(
100
)
DEFAULT
NULL
COMMENT
'更新人'
,
`is_deleted`
tinyint
(
2
)
unsigned
NOT
NULL
DEFAULT
'0'
COMMENT
'是否删除'
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`API_ID_UNIQ_INDEX`
(
`name`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'api模板方法表'
;
\ No newline at end of file
jz-dm-apigateway/src/main/java/com/jz/dm/common/enums/RouteType.java
deleted
100644 → 0
View file @
47c2622a
package
com
.
jz
.
dm
.
common
.
enums
;
/**
* 路由类型
* @author key
*/
public
enum
RouteType
{
/**
* 漏油类型
*/
SRPING
;
}
jz-dm-apigateway/src/main/java/com/jz/dm/common/enums/direction/DirectionTypeEnum.java
View file @
88042ad1
...
...
@@ -15,7 +15,7 @@ public enum DirectionTypeEnum {
*/
API_TYPE
;
public
static
DirectionTypeEnum
fromTypeName
(
String
typeName
)
{
public
static
DirectionTypeEnum
fromType
Direction
Name
(
String
typeName
)
{
for
(
DirectionTypeEnum
type
:
DirectionTypeEnum
.
values
())
{
if
(
type
.
name
().
equals
(
typeName
))
{
return
type
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/common/enums/org/OrgStatusEnum.java
View file @
88042ad1
...
...
@@ -25,7 +25,7 @@ public enum OrgStatusEnum {
return
text
;
}
public
static
OrgStatusEnum
fromTypeName
(
String
typeName
)
{
public
static
OrgStatusEnum
from
OrgStatus
TypeName
(
String
typeName
)
{
for
(
OrgStatusEnum
type
:
OrgStatusEnum
.
values
())
{
if
(
type
.
name
().
equals
(
typeName
))
{
return
type
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/OpenApiResultCode.java
View file @
88042ad1
...
...
@@ -42,16 +42,6 @@ public enum OpenApiResultCode implements ResultCode {
/** 签名校验错误 */
SIGN_VERIFY_ERROR
(
"SIGN_VERIFY_ERROR"
,
"签名校验错误"
),
/*
*//** 不支持该信息摘要算法 *//*
NO_SUCH_MD_ALGORITHM("NO_SUCH_MD_ALGORITHM", "不支持该信息摘要算法"),*/
/*
*/
/** 信息摘要错误 *//*
MESSAGE_DIGEST_ERROR("MESSAGE_DIGEST_ERROR", "信息摘要错误"),
*/
/** 数据加密错误 */
DATA_ENCRYPTION_ERROR
(
"DATA_ENCRYPTION_ERROR"
,
"数据加密错误"
),;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/config/SwaggerConfiguration.java
View file @
88042ad1
package
com
.
jz
.
dm
.
config
;
import
com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
springfox.documentation.builders.ApiInfoBuilder
;
...
...
@@ -21,9 +22,12 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@EnableSwaggerBootstrapUI
public
class
SwaggerConfiguration
{
@Value
(
"${swagger.enable}"
)
private
Boolean
swaggerEnable
;
@Bean
public
Docket
createRestApi
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
enable
(
swaggerEnable
)
.
apiInfo
(
apiInfo
())
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"com.jz.dm.controller"
))
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/controller/ProducerController.java
View file @
88042ad1
...
...
@@ -73,6 +73,11 @@ public class ProducerController {
public
Mono
<
Result
>
bigDataMakeApi
(
@RequestBody
@Valid
ApiInterfaceReq
req
)
{
return
Mono
.
fromSupplier
(()
->
producerService
.
addBigDataMakeApi
(
req
));
}
@ApiOperation
(
"获取function模板列表"
)
@GetMapping
(
value
=
"/getFunctionTemplateList"
)
public
Mono
<
Result
>
getFunctionTemplateList
()
{
return
Mono
.
fromSupplier
(()
->
producerService
.
getFunctionTemplateList
());
}
/* @ApiOperation("服务发布列表")
@PostMapping(value = "/getServiceIssueList")
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/generate/MybatisPlusGenerate.java
View file @
88042ad1
...
...
@@ -33,7 +33,7 @@ public class MybatisPlusGenerate {
.
setAuthor
(
"ZC"
)
// 生成路径,最好使用绝对路径,window路径是不一样的
//TODO TODO TODO TODO
.
setOutputDir
(
"
/Users/xdclass/Desktop/demo/src/main/java
"
)
.
setOutputDir
(
"
C:\\Users\\key\\Desktop\\make
"
)
// 文件覆盖
.
setFileOverride
(
true
)
// 主键策略
...
...
@@ -59,11 +59,11 @@ public class MybatisPlusGenerate {
DataSourceConfig
dsConfig
=
new
DataSourceConfig
();
// 设置数据库类型
dsConfig
.
setDbType
(
DbType
.
MYSQL
)
.
setDriverName
(
"com.mysql.
cj.
jdbc.Driver"
)
.
setDriverName
(
"com.mysql.jdbc.Driver"
)
//TODO TODO TODO TODO
.
setUrl
(
"jdbc:mysql://1
27.0.0.1:3306/xd_shop?
useSSL=false"
)
.
setUsername
(
"
root
"
)
.
setPassword
(
"
xdclass.net
"
);
.
setUrl
(
"jdbc:mysql://1
19.23.32.151:3306/api_gateway?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&
useSSL=false"
)
.
setUsername
(
"
dmp
"
)
.
setPassword
(
"
Ioubuy@2019@!
"
);
//3. 策略配置globalConfiguration中
StrategyConfig
stConfig
=
new
StrategyConfig
();
...
...
@@ -81,13 +81,13 @@ public class MybatisPlusGenerate {
// 生成的表, 支持多表一起生成,以数组形式填写
//TODO TODO TODO TODO 两个方式,直接写,或者使用命令行输入
.
setInclude
(
"
product"
,
"banner"
,
"address"
,
"coupon"
,
"product_order
"
);
.
setInclude
(
"
t_api_function
"
);
//.setInclude(scanner("表名,多个英文逗号分割").split(","));
//TODO TODO TODO TODO
//4. 包名策略配置(生成的项目包名)
PackageConfig
pkConfig
=
new
PackageConfig
();
pkConfig
.
setParent
(
"
net.xdclass.shopmanager
"
)
pkConfig
.
setParent
(
"
com.jz.dm.models.domian
"
)
.
setMapper
(
"mapper"
)
.
setService
(
"service"
)
.
setController
(
"controller"
)
...
...
@@ -103,7 +103,7 @@ public class MybatisPlusGenerate {
//6. 执行操作
ag
.
execute
();
System
.
out
.
println
(
"=======
小滴课堂
Done 相关代码生成完毕 ========"
);
System
.
out
.
println
(
"======= Done 相关代码生成完毕 ========"
);
}
/**
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/service/ProducerService.java
View file @
88042ad1
...
...
@@ -125,6 +125,12 @@ public interface ProducerService {
*/
Result
serverUpload
(
Long
id
);
/**
* 获取function模板方法列表
* @return
*/
Result
getFunctionTemplateList
();
//Result saveObjOnRedis();
//Result getObjOnRedis();
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/service/impl/ProducerServiceImpl.java
View file @
88042ad1
...
...
@@ -14,15 +14,13 @@ import com.jz.dm.common.enums.GeneralStatusTypeEnum;
import
com.jz.dm.common.enums.apiInterface.ApiInfoOutTypeEnum
;
import
com.jz.dm.common.enums.apiInterface.ApiStatusEnum
;
import
com.jz.dm.common.util.RandomUtil
;
import
com.jz.dm.mapper.ApiInterfaceCustomMapper
;
import
com.jz.dm.mapper.ApiInterfaceFileMapper
;
import
com.jz.dm.mapper.ApiInterfaceMapper
;
import
com.jz.dm.mapper.ApiOpenApiEsFieldsMapper
;
import
com.jz.dm.mapper.*
;
import
com.jz.dm.models.domian.*
;
import
com.jz.dm.models.dto.DataFileDto
;
import
com.jz.dm.models.req.folder.CreateFolderReq
;
import
com.jz.dm.models.req.producer.ApiInterfaceReq
;
import
com.jz.dm.service.ApiInterfaceService
;
import
com.jz.dm.service.OrganizationManageService
;
import
com.jz.dm.service.ProducerService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
...
...
@@ -64,7 +62,9 @@ public class ProducerServiceImpl implements ProducerService {
@Autowired
private
ApiInterfaceService
apiInterfaceService
;
@Autowired
private
com
.
jz
.
dm
.
service
.
OrganizationManageService
organizationManageService
;
private
OrganizationManageService
organizationManageService
;
@Autowired
private
ApiFunctionMapper
apiFunctionMapper
;
@Autowired
private
RedisUtils
redisUtils
;
@Autowired
...
...
@@ -87,6 +87,19 @@ public class ProducerServiceImpl implements ProducerService {
@Value
(
"${data.select.flowUrl}"
)
private
String
flowUrl
;
/**
* 获取function模板方法列表
* @return
*/
@Override
public
Result
getFunctionTemplateList
()
{
QueryWrapper
<
ApiFunction
>
queryWra
=
new
QueryWrapper
<>();
queryWra
.
eq
(
"status"
,
true
);
queryWra
.
eq
(
"is_deleted"
,
0
);
List
<
ApiFunction
>
list
=
apiFunctionMapper
.
selectList
(
queryWra
);
return
Result
.
of_success
(
list
);
}
/**
* 获取文件列表
*
...
...
jz-dm-apigateway/src/main/resources/application-test.yml
View file @
88042ad1
...
...
@@ -109,6 +109,10 @@ data:
#token: #dataBank 制作验签
# dataBank: dataBank123
swagger
:
enable
:
true
...
...
jz-dm-apigateway/src/main/resources/banner.txt
→
jz-dm-apigateway/src/main/resources/banner
002
.txt
View file @
88042ad1
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment