Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
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
项目统一框架
amos-boot-biz
Commits
fac82491
Commit
fac82491
authored
Jun 07, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
户用光伏数据同步采集框架代码初版提交
parent
55fdcd24
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
908 additions
and
12 deletions
+908
-12
AccessapiApplication.java
.../src/main/java/com/yeejoin/amos/AccessapiApplication.java
+7
-7
HttpUtils.java
...va/com/yeejoin/amos/api/householdapi/Utils/HttpUtils.java
+244
-0
Constant.java
.../com/yeejoin/amos/api/householdapi/constant/Constant.java
+7
-0
HouseholdPvApiController.java
...api/householdapi/controller/HouseholdPvApiController.java
+116
-0
HouseholdPvApiTestController.java
...householdapi/controller/HouseholdPvApiTestController.java
+54
-0
HouseholdPvProducerInfoController.java
...holdapi/controller/HouseholdPvProducerInfoController.java
+116
-0
HouseholdPvApiDto.java
...n/amos/api/householdapi/face/model/HouseholdPvApiDto.java
+43
-0
HouseholdPvProducerInfoDto.java
...i/householdapi/face/model/HouseholdPvProducerInfoDto.java
+49
-0
HouseholdPvApiMapper.java
...s/api/householdapi/face/orm/dao/HouseholdPvApiMapper.java
+14
-0
HouseholdPvProducerInfoMapper.java
...seholdapi/face/orm/dao/HouseholdPvProducerInfoMapper.java
+15
-0
HouseholdPvApi.java
...amos/api/householdapi/face/orm/entity/HouseholdPvApi.java
+62
-0
HouseholdPvProducerInfo.java
...householdapi/face/orm/entity/HouseholdPvProducerInfo.java
+74
-0
IHouseholdPvApiService.java
...api/householdapi/face/service/IHouseholdPvApiService.java
+12
-0
IHouseholdPvCommonService.java
.../householdapi/face/service/IHouseholdPvCommonService.java
+9
-0
IHouseholdPvProducerInfoService.java
...holdapi/face/service/IHouseholdPvProducerInfoService.java
+12
-0
HouseholdPvApiServiceImpl.java
...eholdapi/face/service/impl/HouseholdPvApiServiceImpl.java
+34
-0
HouseholdPvProducerInfoServiceImpl.java
...face/service/impl/HouseholdPvProducerInfoServiceImpl.java
+35
-0
application-dev.properties
...a-accessapi/src/main/resources/application-dev.properties
+4
-4
application.properties
...-data-accessapi/src/main/resources/application.properties
+1
-1
No files found.
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/AccessapiApplication.java
View file @
fac82491
...
@@ -47,8 +47,8 @@ import com.yeejoin.amos.api.openapi.face.service.TaAccessConfigServiceImpl;
...
@@ -47,8 +47,8 @@ import com.yeejoin.amos.api.openapi.face.service.TaAccessConfigServiceImpl;
@ComponentScan
({
"org.typroject"
,
"com.yeejoin.amos"
})
@ComponentScan
({
"org.typroject"
,
"com.yeejoin.amos"
})
public
class
AccessapiApplication
{
public
class
AccessapiApplication
{
@Autowired
//
@Autowired
private
TaAccessConfigServiceImpl
taAccessConfigServiceImpl
;
//
private TaAccessConfigServiceImpl taAccessConfigServiceImpl;
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
AccessapiApplication
.
class
);
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
AccessapiApplication
.
class
);
...
@@ -69,9 +69,9 @@ public class AccessapiApplication {
...
@@ -69,9 +69,9 @@ public class AccessapiApplication {
+
path
+
"/doc.html\n"
+
"----------------------------------------------------------"
);
+
path
+
"/doc.html\n"
+
"----------------------------------------------------------"
);
}
}
@Bean
//
@Bean
public
void
initAccessConfig
()
{
//
public void initAccessConfig() {
taAccessConfigServiceImpl
.
refreshConfig
();
//
taAccessConfigServiceImpl.refreshConfig();
taAccessConfigServiceImpl
.
startTask
();
//
taAccessConfigServiceImpl.startTask();
}
//
}
}
}
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/householdapi/Utils/HttpUtils.java
0 → 100644
View file @
fac82491
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
Utils
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.NameValuePair
;
import
org.apache.http.client.HttpClient
;
import
org.apache.http.client.config.RequestConfig
;
import
org.apache.http.client.entity.UrlEncodedFormEntity
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.HttpGet
;
import
org.apache.http.client.methods.HttpPost
;
import
org.apache.http.conn.ssl.SSLConnectionSocketFactory
;
import
org.apache.http.conn.ssl.TrustStrategy
;
import
org.apache.http.entity.StringEntity
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.impl.conn.PoolingHttpClientConnectionManager
;
import
org.apache.http.message.BasicNameValuePair
;
import
org.apache.http.ssl.SSLContextBuilder
;
import
org.apache.http.util.EntityUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
javax.net.ssl.HostnameVerifier
;
import
javax.net.ssl.SSLContext
;
import
javax.net.ssl.SSLSession
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.nio.charset.Charset
;
import
java.security.GeneralSecurityException
;
import
java.security.cert.CertificateException
;
import
java.security.cert.X509Certificate
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
HttpUtils
{
private
static
PoolingHttpClientConnectionManager
connMgr
;
private
static
RequestConfig
requestConfig
;
private
static
final
int
MAX_TIMEOUT
=
50000
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
HttpUtils
.
class
);
static
{
// 设置连接池
connMgr
=
new
PoolingHttpClientConnectionManager
();
// 设置连接池大小
connMgr
.
setMaxTotal
(
100
);
connMgr
.
setDefaultMaxPerRoute
(
connMgr
.
getMaxTotal
());
// Validate connections after 1 sec of inactivity
connMgr
.
setValidateAfterInactivity
(
5000
);
RequestConfig
.
Builder
configBuilder
=
RequestConfig
.
custom
();
// 设置连接超时
configBuilder
.
setConnectTimeout
(
MAX_TIMEOUT
);
// 设置读取超时
configBuilder
.
setSocketTimeout
(
MAX_TIMEOUT
);
// 设置从连接池获取连接实例的超时
configBuilder
.
setConnectionRequestTimeout
(
MAX_TIMEOUT
);
requestConfig
=
configBuilder
.
build
();
}
/**
* 发送 GET 请求(HTTP),不带输入数据
*
* @param url
* @return
*/
public
static
String
doGet
(
String
url
)
{
return
doGet
(
url
,
new
HashMap
<
String
,
Object
>());
}
/**
* 发送 GET 请求(HTTP),K-V形式
*
* @param url
* @param params
* @return
*/
public
static
String
doGet
(
String
url
,
Map
<
String
,
Object
>
params
)
{
String
apiUrl
=
url
;
StringBuffer
param
=
new
StringBuffer
();
int
i
=
0
;
for
(
String
key
:
params
.
keySet
())
{
if
(
i
==
0
)
param
.
append
(
"?"
);
else
param
.
append
(
"&"
);
param
.
append
(
key
).
append
(
"="
).
append
(
params
.
get
(
key
));
i
++;
}
apiUrl
+=
param
;
String
result
=
null
;
HttpClient
httpClient
=
null
;
if
(
apiUrl
.
startsWith
(
"https"
))
{
httpClient
=
HttpClients
.
custom
().
setSSLSocketFactory
(
createSSLConnSocketFactory
())
.
setConnectionManager
(
connMgr
).
setDefaultRequestConfig
(
requestConfig
).
build
();
}
else
{
httpClient
=
HttpClients
.
createDefault
();
}
try
{
HttpGet
httpGet
=
new
HttpGet
(
apiUrl
);
HttpResponse
response
=
httpClient
.
execute
(
httpGet
);
HttpEntity
entity
=
response
.
getEntity
();
if
(
entity
!=
null
)
{
InputStream
instream
=
entity
.
getContent
();
result
=
IOUtils
.
toString
(
instream
,
"UTF-8"
);
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
result
;
}
/**
* 发送 POST 请求(HTTP),不带输入数据
*
* @param apiUrl
* @return
*/
public
static
String
doPost
(
String
apiUrl
)
{
return
doPost
(
apiUrl
,
new
HashMap
<
String
,
Object
>());
}
/**
* 发送 POST 请求,K-V形式
*
* @param apiUrl
* API接口URL
* @param params
* 参数map
* @return
*/
public
static
String
doPost
(
String
apiUrl
,
Map
<
String
,
Object
>
params
)
{
CloseableHttpClient
httpClient
=
null
;
if
(
apiUrl
.
startsWith
(
"https"
))
{
httpClient
=
HttpClients
.
custom
().
setSSLSocketFactory
(
createSSLConnSocketFactory
())
.
setConnectionManager
(
connMgr
).
setDefaultRequestConfig
(
requestConfig
).
build
();
}
else
{
httpClient
=
HttpClients
.
createDefault
();
}
String
httpStr
=
null
;
HttpPost
httpPost
=
new
HttpPost
(
apiUrl
);
CloseableHttpResponse
response
=
null
;
try
{
httpPost
.
setConfig
(
requestConfig
);
List
<
NameValuePair
>
pairList
=
new
ArrayList
<>(
params
.
size
());
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
params
.
entrySet
())
{
NameValuePair
pair
=
new
BasicNameValuePair
(
entry
.
getKey
(),
entry
.
getValue
()!=
null
?
entry
.
getValue
().
toString
():
""
);
pairList
.
add
(
pair
);
}
httpPost
.
setEntity
(
new
UrlEncodedFormEntity
(
pairList
,
Charset
.
forName
(
"UTF-8"
)));
response
=
httpClient
.
execute
(
httpPost
);
HttpEntity
entity
=
response
.
getEntity
();
httpStr
=
EntityUtils
.
toString
(
entity
,
"UTF-8"
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
response
!=
null
)
{
try
{
EntityUtils
.
consume
(
response
.
getEntity
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
return
httpStr
;
}
/**
* 发送 POST 请求,JSON形式,接收端需要支持json形式,否则取不到数据
*
* @param apiUrl
* @param json
* json对象
* @return
*/
public
static
String
doPost
(
String
apiUrl
,
String
json
)
{
CloseableHttpClient
httpClient
=
null
;
if
(
apiUrl
.
startsWith
(
"https"
))
{
httpClient
=
HttpClients
.
custom
().
setSSLSocketFactory
(
createSSLConnSocketFactory
()).
setConnectionManager
(
connMgr
).
setDefaultRequestConfig
(
requestConfig
).
build
();
}
else
{
httpClient
=
HttpClients
.
createDefault
();
}
String
httpStr
=
null
;
HttpPost
httpPost
=
new
HttpPost
(
apiUrl
);
CloseableHttpResponse
response
=
null
;
try
{
httpPost
.
setConfig
(
requestConfig
);
StringEntity
stringEntity
=
new
StringEntity
(
json
,
"UTF-8"
);
// 解决中文乱码问题
stringEntity
.
setContentEncoding
(
"UTF-8"
);
stringEntity
.
setContentType
(
"application/json"
);
httpPost
.
setEntity
(
stringEntity
);
response
=
httpClient
.
execute
(
httpPost
);
HttpEntity
entity
=
response
.
getEntity
();
httpStr
=
EntityUtils
.
toString
(
entity
,
"UTF-8"
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
response
!=
null
)
{
try
{
EntityUtils
.
consume
(
response
.
getEntity
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
return
httpStr
;
}
/**
* 创建SSL安全连接
*
* @return
*/
private
static
SSLConnectionSocketFactory
createSSLConnSocketFactory
()
{
SSLConnectionSocketFactory
sslsf
=
null
;
try
{
SSLContext
sslContext
=
new
SSLContextBuilder
().
loadTrustMaterial
(
null
,
new
TrustStrategy
()
{
public
boolean
isTrusted
(
X509Certificate
[]
chain
,
String
authType
)
throws
CertificateException
{
return
true
;
}
}).
build
();
sslsf
=
new
SSLConnectionSocketFactory
(
sslContext
,
new
HostnameVerifier
()
{
@Override
public
boolean
verify
(
String
arg0
,
SSLSession
arg1
)
{
return
true
;
}
});
}
catch
(
GeneralSecurityException
e
)
{
e
.
printStackTrace
();
}
return
sslsf
;
}
}
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/householdapi/constant/Constant.java
0 → 100644
View file @
fac82491
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
constant
;
public
class
Constant
{
public
static
final
String
TOKEN_PREFIX
=
"OPENAPI_"
;
public
static
final
String
SECRETKEY
=
"tzs"
;
}
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/householdapi/controller/HouseholdPvApiController.java
0 → 100644
View file @
fac82491
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
controller
;
import
com.yeejoin.amos.api.householdapi.face.model.HouseholdPvApiDto
;
import
com.yeejoin.amos.api.householdapi.face.service.impl.HouseholdPvApiServiceImpl
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
/**
* 户用光伏-厂商API haders
*
* @author system_generator
* @date 2023-06-07
*/
@RestController
@Api
(
tags
=
"户用光伏-厂商API hadersApi"
)
@RequestMapping
(
value
=
"/household-pv-api"
)
public
class
HouseholdPvApiController
{
@Autowired
HouseholdPvApiServiceImpl
householdPvApiServiceImpl
;
/**
* 新增户用光伏-厂商API haders
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增户用光伏-厂商API haders"
,
notes
=
"新增户用光伏-厂商API haders"
)
public
ResponseModel
<
HouseholdPvApiDto
>
save
(
@RequestBody
HouseholdPvApiDto
model
)
{
model
=
householdPvApiServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新户用光伏-厂商API haders"
,
notes
=
"根据sequenceNbr更新户用光伏-厂商API haders"
)
public
ResponseModel
<
HouseholdPvApiDto
>
updateBySequenceNbrHouseholdPvApi
(
@RequestBody
HouseholdPvApiDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
householdPvApiServiceImpl
.
updateWithModel
(
model
));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除户用光伏-厂商API haders"
,
notes
=
"根据sequenceNbr删除户用光伏-厂商API haders"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
){
return
ResponseHelper
.
buildResponse
(
householdPvApiServiceImpl
.
removeById
(
sequenceNbr
));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个户用光伏-厂商API haders"
,
notes
=
"根据sequenceNbr查询单个户用光伏-厂商API haders"
)
public
ResponseModel
<
HouseholdPvApiDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
householdPvApiServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"户用光伏-厂商API haders分页查询"
,
notes
=
"户用光伏-厂商API haders分页查询"
)
public
ResponseModel
<
Page
<
HouseholdPvApiDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
HouseholdPvApiDto
>
page
=
new
Page
<
HouseholdPvApiDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
householdPvApiServiceImpl
.
queryForHouseholdPvApiPage
(
page
));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"户用光伏-厂商API haders列表全部数据查询"
,
notes
=
"户用光伏-厂商API haders列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
HouseholdPvApiDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
householdPvApiServiceImpl
.
queryForHouseholdPvApiList
());
}
}
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/householdapi/controller/HouseholdPvApiTestController.java
0 → 100644
View file @
fac82491
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
controller
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.api.householdapi.Utils.HttpUtils
;
import
com.yeejoin.amos.api.householdapi.face.model.HouseholdPvApiDto
;
import
com.yeejoin.amos.api.householdapi.face.service.impl.HouseholdPvApiServiceImpl
;
import
com.yeejoin.amos.api.householdapi.face.service.impl.HouseholdPvProducerInfoServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.ibatis.jdbc.Null
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
rx.Producer
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.HashMap
;
import
java.util.List
;
/**
* 户用光伏-厂商API haders
*
* @author system_generator
* @date 2023-06-07
*/
@RestController
@Api
(
tags
=
"测试"
)
@RequestMapping
(
value
=
"/household-pv-api-test"
)
public
class
HouseholdPvApiTestController
{
@Autowired
private
HouseholdPvApiServiceImpl
householdPvApiServiceImpl
;
@Autowired
private
HouseholdPvProducerInfoServiceImpl
householdPvProducerInfoServiceImpl
;
/**
* 新增户用光伏-厂商API haders
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/Test"
)
@ApiOperation
(
httpMethod
=
"get"
,
value
=
"新增户用光伏-厂商API haders"
,
notes
=
"新增户用光伏-厂商API haders"
)
public
ResponseModel
<
Null
>
save
(
@RequestParam
Long
seq
)
{
HouseholdPvApiDto
householdPvApiDto
=
householdPvApiServiceImpl
.
queryBySeq
(
seq
);
String
result
=
HttpUtils
.
doPost
(
householdPvApiDto
.
getApiUrl
(),
"1"
);
System
.
out
.
println
(
result
);
return
null
;
}
}
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/householdapi/controller/HouseholdPvProducerInfoController.java
0 → 100644
View file @
fac82491
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
controller
;
import
com.yeejoin.amos.api.householdapi.face.model.HouseholdPvProducerInfoDto
;
import
com.yeejoin.amos.api.householdapi.face.service.impl.HouseholdPvProducerInfoServiceImpl
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
/**
* 户用光伏-厂商信息表
*
* @author system_generator
* @date 2023-06-07
*/
@RestController
@Api
(
tags
=
"户用光伏-厂商信息表Api"
)
@RequestMapping
(
value
=
"/household-pv-producer-info"
)
public
class
HouseholdPvProducerInfoController
{
@Autowired
HouseholdPvProducerInfoServiceImpl
householdPvProducerInfoServiceImpl
;
/**
* 新增户用光伏-厂商信息表
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增户用光伏-厂商信息表"
,
notes
=
"新增户用光伏-厂商信息表"
)
public
ResponseModel
<
HouseholdPvProducerInfoDto
>
save
(
@RequestBody
HouseholdPvProducerInfoDto
model
)
{
model
=
householdPvProducerInfoServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新户用光伏-厂商信息表"
,
notes
=
"根据sequenceNbr更新户用光伏-厂商信息表"
)
public
ResponseModel
<
HouseholdPvProducerInfoDto
>
updateBySequenceNbrHouseholdPvProducerInfo
(
@RequestBody
HouseholdPvProducerInfoDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
householdPvProducerInfoServiceImpl
.
updateWithModel
(
model
));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除户用光伏-厂商信息表"
,
notes
=
"根据sequenceNbr删除户用光伏-厂商信息表"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
){
return
ResponseHelper
.
buildResponse
(
householdPvProducerInfoServiceImpl
.
removeById
(
sequenceNbr
));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个户用光伏-厂商信息表"
,
notes
=
"根据sequenceNbr查询单个户用光伏-厂商信息表"
)
public
ResponseModel
<
HouseholdPvProducerInfoDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
householdPvProducerInfoServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"户用光伏-厂商信息表分页查询"
,
notes
=
"户用光伏-厂商信息表分页查询"
)
public
ResponseModel
<
Page
<
HouseholdPvProducerInfoDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
HouseholdPvProducerInfoDto
>
page
=
new
Page
<
HouseholdPvProducerInfoDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
householdPvProducerInfoServiceImpl
.
queryForHouseholdPvProducerInfoPage
(
page
));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"户用光伏-厂商信息表列表全部数据查询"
,
notes
=
"户用光伏-厂商信息表列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
HouseholdPvProducerInfoDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
householdPvProducerInfoServiceImpl
.
queryForHouseholdPvProducerInfoList
());
}
}
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/householdapi/face/model/HouseholdPvApiDto.java
0 → 100644
View file @
fac82491
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
model
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.typroject.tyboot.core.rdbms.model.BaseModel
;
import
java.util.Date
;
/**
* 户用光伏-厂商API haders
*
* @author system_generator
* @date 2023-06-07
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"HouseholdPvApiDto"
,
description
=
"户用光伏-厂商API haders"
)
public
class
HouseholdPvApiDto
extends
BaseModel
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"厂商id"
)
private
String
producerId
;
@ApiModelProperty
(
value
=
"api名称"
)
private
String
apiName
;
@ApiModelProperty
(
value
=
"请求方式 GET或者POST"
)
private
String
requestMethod
;
@ApiModelProperty
(
value
=
"api地址"
)
private
String
apiUrl
;
@ApiModelProperty
(
value
=
"api描述"
)
private
String
apiDescption
;
@ApiModelProperty
(
value
=
"参数信息"
)
private
String
paramInfo
;
}
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/householdapi/face/model/HouseholdPvProducerInfoDto.java
0 → 100644
View file @
fac82491
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
model
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.typroject.tyboot.core.rdbms.model.BaseModel
;
import
java.util.Date
;
/**
* 户用光伏-厂商信息表
*
* @author system_generator
* @date 2023-06-07
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"HouseholdPvProducerInfoDto"
,
description
=
"户用光伏-厂商信息表"
)
public
class
HouseholdPvProducerInfoDto
extends
BaseModel
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"厂商名称"
)
private
String
prodcerName
;
@ApiModelProperty
(
value
=
"厂商账号"
)
private
String
prodcerAccount
;
@ApiModelProperty
(
value
=
"厂商密码"
)
private
String
prodcerPassword
;
@ApiModelProperty
(
value
=
"厂商appID"
)
private
String
prodcerAppid
;
@ApiModelProperty
(
value
=
"厂商appSecret"
)
private
String
prodcerAppsecret
;
@ApiModelProperty
(
value
=
"厂商url"
)
private
String
prodcerUrl
;
@ApiModelProperty
(
value
=
"公司id"
)
private
String
corporationId
;
@ApiModelProperty
(
value
=
"公共header信息"
)
private
String
headerInfo
;
}
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/dao/HouseholdPvApiMapper.java
0 → 100644
View file @
fac82491
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
orm
.
dao
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.api.householdapi.face.orm.entity.HouseholdPvApi
;
/**
* 户用光伏-厂商API haders Mapper 接口
*
* @author system_generator
* @date 2023-06-07
*/
public
interface
HouseholdPvApiMapper
extends
BaseMapper
<
HouseholdPvApi
>
{
}
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/dao/HouseholdPvProducerInfoMapper.java
0 → 100644
View file @
fac82491
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
orm
.
dao
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.api.householdapi.face.orm.entity.HouseholdPvProducerInfo
;
/**
* 户用光伏-厂商信息表 Mapper 接口
*
* @author system_generator
* @date 2023-06-07
*/
public
interface
HouseholdPvProducerInfoMapper
extends
BaseMapper
<
HouseholdPvProducerInfo
>
{
}
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/entity/HouseholdPvApi.java
0 → 100644
View file @
fac82491
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
orm
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity
;
import
java.util.Date
;
/**
* 户用光伏-厂商API haders
*
* @author system_generator
* @date 2023-06-07
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"household_pv_api"
)
public
class
HouseholdPvApi
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 厂商id
*/
@TableField
(
"producer_id"
)
private
String
producerId
;
/**
* api名称
*/
@TableField
(
"api_name"
)
private
String
apiName
;
/**
* 请求方式 GET或者POST
*/
@TableField
(
"request_method"
)
private
String
requestMethod
;
/**
* api地址
*/
@TableField
(
"api_url"
)
private
String
apiUrl
;
/**
* api描述
*/
@TableField
(
"api_descption"
)
private
String
apiDescption
;
/**
* 参数信息
*/
@TableField
(
"param_info"
)
private
String
paramInfo
;
}
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/entity/HouseholdPvProducerInfo.java
0 → 100644
View file @
fac82491
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
orm
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity
;
import
java.util.Date
;
/**
* 户用光伏-厂商信息表
*
* @author system_generator
* @date 2023-06-07
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"household_pv_producer_info"
)
public
class
HouseholdPvProducerInfo
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 厂商名称
*/
@TableField
(
"prodcer_name"
)
private
String
prodcerName
;
/**
* 厂商账号
*/
@TableField
(
"prodcer_account"
)
private
String
prodcerAccount
;
/**
* 厂商密码
*/
@TableField
(
"prodcer_password"
)
private
String
prodcerPassword
;
/**
* 厂商appID
*/
@TableField
(
"prodcer_appid"
)
private
String
prodcerAppid
;
/**
* 厂商appSecret
*/
@TableField
(
"prodcer_appsecret"
)
private
String
prodcerAppsecret
;
/**
* 厂商url
*/
@TableField
(
"prodcer_url"
)
private
String
prodcerUrl
;
/**
* 公司id
*/
@TableField
(
"corporationId"
)
private
String
corporationId
;
/**
* 公共header信息
*/
@TableField
(
"header_info"
)
private
String
headerInfo
;
}
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/IHouseholdPvApiService.java
0 → 100644
View file @
fac82491
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
service
;
/**
* 户用光伏-厂商API haders接口类
*
* @author system_generator
* @date 2023-06-07
*/
public
interface
IHouseholdPvApiService
{
}
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/IHouseholdPvCommonService.java
0 → 100644
View file @
fac82491
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
service
;
public
interface
IHouseholdPvCommonService
{
public
void
getRequestHeader
();
public
void
getRequestParams
();
}
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/IHouseholdPvProducerInfoService.java
0 → 100644
View file @
fac82491
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
service
;
/**
* 户用光伏-厂商信息表接口类
*
* @author system_generator
* @date 2023-06-07
*/
public
interface
IHouseholdPvProducerInfoService
{
}
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/HouseholdPvApiServiceImpl.java
0 → 100644
View file @
fac82491
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
service
.
impl
;
import
com.yeejoin.amos.api.householdapi.face.model.HouseholdPvApiDto
;
import
com.yeejoin.amos.api.householdapi.face.orm.dao.HouseholdPvApiMapper
;
import
com.yeejoin.amos.api.householdapi.face.orm.entity.HouseholdPvApi
;
import
com.yeejoin.amos.api.householdapi.face.service.IHouseholdPvApiService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.List
;
/**
* 户用光伏-厂商API haders服务实现类
*
* @author system_generator
* @date 2023-06-07
*/
@Service
public
class
HouseholdPvApiServiceImpl
extends
BaseService
<
HouseholdPvApiDto
,
HouseholdPvApi
,
HouseholdPvApiMapper
>
implements
IHouseholdPvApiService
{
/**
* 分页查询
*/
public
Page
<
HouseholdPvApiDto
>
queryForHouseholdPvApiPage
(
Page
<
HouseholdPvApiDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
HouseholdPvApiDto
>
queryForHouseholdPvApiList
()
{
return
this
.
queryForList
(
""
,
false
);
}
}
\ No newline at end of file
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/HouseholdPvProducerInfoServiceImpl.java
0 → 100644
View file @
fac82491
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
service
.
impl
;
import
com.yeejoin.amos.api.householdapi.face.model.HouseholdPvProducerInfoDto
;
import
com.yeejoin.amos.api.householdapi.face.orm.dao.HouseholdPvProducerInfoMapper
;
import
com.yeejoin.amos.api.householdapi.face.orm.entity.HouseholdPvProducerInfo
;
import
com.yeejoin.amos.api.householdapi.face.service.IHouseholdPvProducerInfoService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.List
;
/**
* 户用光伏-厂商信息表服务实现类
*
* @author system_generator
* @date 2023-06-07
*/
@Service
public
class
HouseholdPvProducerInfoServiceImpl
extends
BaseService
<
HouseholdPvProducerInfoDto
,
HouseholdPvProducerInfo
,
HouseholdPvProducerInfoMapper
>
implements
IHouseholdPvProducerInfoService
{
/**
* 分页查询
*/
public
Page
<
HouseholdPvProducerInfoDto
>
queryForHouseholdPvProducerInfoPage
(
Page
<
HouseholdPvProducerInfoDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
HouseholdPvProducerInfoDto
>
queryForHouseholdPvProducerInfoList
()
{
return
this
.
queryForList
(
""
,
false
);
}
}
\ No newline at end of file
amos-boot-data/amos-boot-data-accessapi/src/main/resources/application-dev.properties
View file @
fac82491
...
@@ -3,7 +3,7 @@ server.servlet.context-path=/accessapi
...
@@ -3,7 +3,7 @@ server.servlet.context-path=/accessapi
server.port
=
11005
server.port
=
11005
# jdbc_config
# jdbc_config
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.url
=
jdbc:mysql://172.16.10.
90:53306/tzs_
amos_openapi?allowMultiQueries=true&serverTimezone=GMT%2B8
\
spring.datasource.url
=
jdbc:mysql://172.16.10.
220:3306/
amos_openapi?allowMultiQueries=true&serverTimezone=GMT%2B8
\
&characterEncoding=utf8
&characterEncoding=utf8
spring.datasource.username
=
root
spring.datasource.username
=
root
spring.datasource.password
=
Yeejoin@2020
spring.datasource.password
=
Yeejoin@2020
...
@@ -19,7 +19,7 @@ spring.datasource.hikari.connection-test-query=SELECT 1
...
@@ -19,7 +19,7 @@ spring.datasource.hikari.connection-test-query=SELECT 1
# REDIS (RedisProperties)
# REDIS (RedisProperties)
spring.redis.database
=
1
spring.redis.database
=
1
spring.redis.host
=
172.16.10.
9
0
spring.redis.host
=
172.16.10.
22
0
spring.redis.port
=
6379
spring.redis.port
=
6379
spring.redis.password
=
yeejoin@2020
spring.redis.password
=
yeejoin@2020
spring.redis.lettuce.pool.max-active
=
200
spring.redis.lettuce.pool.max-active
=
200
...
@@ -29,7 +29,7 @@ spring.redis.lettuce.pool.min-idle=0
...
@@ -29,7 +29,7 @@ spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time
=
300
spring.redis.expire.time
=
300
#注册中心地址
#注册中心地址
eureka.client.service-url.defaultZone
=
http://172.16.
3.99
:10001/eureka/
eureka.client.service-url.defaultZone
=
http://172.16.
10.220
:10001/eureka/
eureka.instance.prefer-ip-address
=
true
eureka.instance.prefer-ip-address
=
true
management.endpoint.health.show-details
=
always
management.endpoint.health.show-details
=
always
management.endpoints.web.exposure.include
=
*
management.endpoints.web.exposure.include
=
*
...
@@ -43,7 +43,7 @@ eureka.instance.instance-id=${eureka.instance.ip-address}:${server.port}
...
@@ -43,7 +43,7 @@ eureka.instance.instance-id=${eureka.instance.ip-address}:${server.port}
##emqx
##emqx
emqx.clean-session
=
true
emqx.clean-session
=
true
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}
emqx.broker
=
tcp://172.16.10.
9
0:1883
emqx.broker
=
tcp://172.16.10.
22
0:1883
emqx.client-user-name
=
admin
emqx.client-user-name
=
admin
emqx.client-password
=
public
emqx.client-password
=
public
...
...
amos-boot-data/amos-boot-data-accessapi/src/main/resources/application.properties
View file @
fac82491
spring.profiles.active
=
dev
1
spring.profiles.active
=
dev
server.compression.enabled
=
true
server.compression.enabled
=
true
spring.jackson.dateFormat
=
yyyy-MM-dd HH:mm:ss
spring.jackson.dateFormat
=
yyyy-MM-dd HH:mm:ss
...
...
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