Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
rpc-openplatform
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c86703c4
authored
Dec 21, 2020
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改获取省市区地址服务接口 yangll
1 parent
1e87df1e
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
84 additions
and
28 deletions
rpc-openplatform-api/src/main/java/cn/com/glsx/openplatform/model/Area.java
rpc-openplatform-api/src/main/java/cn/com/glsx/openplatform/service/AdMgrService.java
rpc-openplatform-api/src/main/java/cn/com/glsx/openplatform/service/ApiMgrService.java
rpc-openplatform-api/src/main/java/cn/com/glsx/openplatform/service/CustomerMgrService.java
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/mapper/PlatformAdMapper.java
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/mapper/PlatformCustomerMapper.java
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/service/AdMgrServiceImpl.java
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/service/ApiMgrServiceImpl.java
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/service/CustomerMgrServiceImpl.java
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformAdMapper.xml
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformApiCallMapper.xml
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformCustomerMapper.xml
rpc-openplatform-container/src/main/resources/config/application.properties
rpc-openplatform-container/src/test/java/cn/com/glsx/openplatform/service/ApiMgrServiceImplTest.java
rpc-openplatform-container/src/test/java/cn/com/glsx/openplatform/service/CustomerMgrServiceImplTest.java
rpc-openplatform-api/src/main/java/cn/com/glsx/openplatform/model/Area.java
View file @
c86703c
...
...
@@ -15,13 +15,13 @@ import com.fasterxml.jackson.annotation.JsonFormat;
public
class
Area
implements
Serializable
{
private
List
<
Area
>
children
;
private
Long
id
;
private
Integer
id
;
private
String
areaName
;
private
String
areaCode
;
private
Long
parentId
;
private
Integer
parentId
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
initDate
;
...
...
@@ -34,11 +34,11 @@ public class Area implements Serializable {
this
.
children
=
children
;
}
public
Long
getId
()
{
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
...
...
@@ -58,11 +58,11 @@ public class Area implements Serializable {
this
.
areaCode
=
areaCode
;
}
public
Long
getParentId
()
{
public
Integer
getParentId
()
{
return
parentId
;
}
public
void
setParentId
(
Long
parentId
)
{
public
void
setParentId
(
Integer
parentId
)
{
this
.
parentId
=
parentId
;
}
...
...
rpc-openplatform-api/src/main/java/cn/com/glsx/openplatform/service/AdMgrService.java
View file @
c86703c
...
...
@@ -12,5 +12,9 @@ public interface AdMgrService {
int
updateAd
(
PlatformAd
ad
);
int
startandstop
(
int
id
,
int
status
);
Integer
startandstop
(
Integer
id
,
Integer
status
);
// int start(int id);
//
// int stop(int id);
}
rpc-openplatform-api/src/main/java/cn/com/glsx/openplatform/service/ApiMgrService.java
View file @
c86703c
...
...
@@ -8,5 +8,5 @@ import cn.hutool.db.Page;
public
interface
ApiMgrService
{
R
getApiMgrList
(
Page
page
);
int
startAndStop
(
int
id
,
int
status
);
Integer
startAndStop
(
Integer
id
,
Integer
status
);
}
rpc-openplatform-api/src/main/java/cn/com/glsx/openplatform/service/CustomerMgrService.java
View file @
c86703c
package
cn
.
com
.
glsx
.
openplatform
.
service
;
import
cn.com.glsx.openplatform.model.Area
;
import
cn.com.glsx.openplatform.model.PlatformCustomer
;
import
cn.com.glsx.openplatform.vo.R
;
import
cn.hutool.db.Page
;
...
...
@@ -20,5 +21,5 @@ public interface CustomerMgrService {
PlatformCustomer
login
(
PlatformCustomer
customer
);
List
<
String
>
getAddressOptionList
(
int
id
);
List
<
Area
>
getAddressOptionList
(
int
id
);
}
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/mapper/PlatformAdMapper.java
View file @
c86703c
...
...
@@ -2,6 +2,7 @@ package cn.com.glsx.openplatform.mapper;
import
cn.com.glsx.openplatform.model.PlatformAd
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.oreframework.datasource.mybatis.mapper.OreMapper
;
import
java.util.List
;
...
...
@@ -17,4 +18,6 @@ import java.util.List;
public
interface
PlatformAdMapper
extends
OreMapper
<
PlatformAd
>
{
List
<
PlatformAd
>
getAdMgrList
();
int
updateById
(
@Param
(
"id"
)
int
id
,
@Param
(
"status"
)
int
status
);
}
\ No newline at end of file
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/mapper/PlatformCustomerMapper.java
View file @
c86703c
package
cn
.
com
.
glsx
.
openplatform
.
mapper
;
import
cn.com.glsx.openplatform.model.Area
;
import
cn.com.glsx.openplatform.model.PlatformCustomer
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.oreframework.datasource.mybatis.mapper.OreMapper
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>Description:
...
...
@@ -25,7 +27,7 @@ public interface PlatformCustomerMapper extends OreMapper<PlatformCustomer> {
PlatformCustomer
login
(
PlatformCustomer
customer
);
List
<
String
>
getAddressOptionList
(
@Param
(
"id"
)
int
id
);
List
<
Area
>
getAddressOptionList
(
@Param
(
"id"
)
int
id
);
String
getAddressStr
(
@Param
(
"id"
)
Integer
id
);
...
...
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/service/AdMgrServiceImpl.java
View file @
c86703c
...
...
@@ -8,6 +8,7 @@ import com.alibaba.dubbo.config.annotation.Service;
import
com.github.pagehelper.PageHelper
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.util.Date
;
...
...
@@ -44,10 +45,10 @@ public class AdMgrServiceImpl implements AdMgrService {
}
@Override
public
int
startandstop
(
int
id
,
int
status
)
{
PlatformAd
ad
=
new
PlatformAd
();
ad
.
setId
(
id
);
ad
.
setStatus
(
status
);
return
adMapper
.
updateByPrimaryKeySelective
(
ad
)
;
@Transactional
()
public
Integer
startandstop
(
Integer
id
,
Integer
status
)
{
int
i
=
adMapper
.
updateById
(
id
,
status
);
LOGGER
.
info
(
"=i========"
+
i
);
return
i
;
}
}
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/service/ApiMgrServiceImpl.java
View file @
c86703c
...
...
@@ -8,6 +8,7 @@ import com.alibaba.dubbo.config.annotation.Service;
import
com.github.pagehelper.PageHelper
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.util.List
;
...
...
@@ -31,7 +32,11 @@ public class ApiMgrServiceImpl implements ApiMgrService {
}
@Override
public
int
startAndStop
(
int
id
,
int
status
)
{
return
apiMapper
.
updateById
(
id
,
status
);
@Transactional
()
public
Integer
startAndStop
(
Integer
id
,
Integer
status
)
{
int
i
=
apiMapper
.
updateById
(
id
,
status
);
LOGGER
.
info
(
"=i========"
+
i
);
System
.
out
.
println
(
"i = "
+
i
);
return
i
;
}
}
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/service/CustomerMgrServiceImpl.java
View file @
c86703c
package
cn
.
com
.
glsx
.
openplatform
.
service
;
import
cn.com.glsx.openplatform.mapper.PlatformCustomerMapper
;
import
cn.com.glsx.openplatform.model.Area
;
import
cn.com.glsx.openplatform.model.PlatformCustomer
;
import
cn.com.glsx.openplatform.util.RSAUtils
;
import
cn.com.glsx.openplatform.vo.R
;
...
...
@@ -88,8 +89,9 @@ public class CustomerMgrServiceImpl implements CustomerMgrService {
}
@Override
public
List
<
String
>
getAddressOptionList
(
int
id
)
{
return
customerMapper
.
getAddressOptionList
(
id
);
public
List
<
Area
>
getAddressOptionList
(
int
id
)
{
List
<
Area
>
addressOptionList
=
customerMapper
.
getAddressOptionList
(
id
);
return
addressOptionList
;
}
public
static
void
main
(
String
[]
args
)
{
...
...
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformAdMapper.xml
View file @
c86703c
...
...
@@ -24,6 +24,13 @@
update_time, create_by, update_by, remark
</sql>
<update
id=
"updateById"
>
update t_platform_ad
set status = #{status,jdbcType=INTEGER},
update_time = NOW()
where id = #{id,jdbcType=INTEGER}
</update>
<select
id=
"getAdMgrList"
resultType=
"cn.com.glsx.openplatform.model.PlatformAd"
>
select
<include
refid=
"Base_Column_List"
/>
...
...
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformApiCallMapper.xml
View file @
c86703c
...
...
@@ -34,10 +34,10 @@
left join t_platform_api c on a.api_id = c.id
where 1 = 1
<if
test=
"accessStartTime != null"
>
and create_time
>
= #{accessStartTime,jdbcType=TIMESTAMP}
and
a.
create_time
>
= #{accessStartTime,jdbcType=TIMESTAMP}
</if>
<if
test=
"accessEndTime != null"
>
and create_time
<
= #{accessEndTime,jdbcType=TIMESTAMP}
and
a.
create_time
<
= #{accessEndTime,jdbcType=TIMESTAMP}
</if>
</select>
...
...
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformCustomerMapper.xml
View file @
c86703c
...
...
@@ -31,7 +31,7 @@
<sql
id=
"Base_Column_List"
>
<!--@mbg.generated-->
id, customer_name, contact_person, `password`, contact_number, contact_email, province,
city, address, `status`,
public_key, private_key
, channel_number, create_time, update_time,
city, address, `status`,
key_id
, channel_number, create_time, update_time,
create_by, update_by, remark
</sql>
...
...
@@ -163,8 +163,6 @@
c.area_name as cityName,
concat(b.area_name, c.area_name, d.area_name, a.address) as address,
a.`status`,
a.public_key,
a.private_key,
a.channel_number,
a.create_time,
a.update_time,
...
...
@@ -194,8 +192,10 @@
and password = #{password,jdbcType=VARCHAR}
</select>
<select
id=
"getAddressOptionList"
resultType=
"java.lang.String"
>
select area_name
<select
id=
"getAddressOptionList"
resultType=
"cn.com.glsx.openplatform.model.Area"
>
select
id ,
area_name as areaName
from t_sys_area
where 1 = 1
<choose>
...
...
rpc-openplatform-container/src/main/resources/config/application.properties
View file @
c86703c
...
...
@@ -5,7 +5,7 @@ server.servlet.application-display-name=rpc-openplatform-container
logging.config
=
classpath:logback.xml
logging.path
=
/data/java_log/jetty/rpc-openplatform-container/rpc-openplatform-container.log
#logging.level.root=INFO
logging.level.
root
=
debug
logging.level.
cn.com
=
debug
ore.starter.class-
name
=
Main
# diamond config
ore.diamond.group
=
open-platform
...
...
rpc-openplatform-container/src/test/java/cn/com/glsx/openplatform/service/ApiMgrServiceImplTest.java
0 → 100644
View file @
c86703c
package
cn
.
com
.
glsx
.
openplatform
.
service
;
import
cn.com.glsx.openplatform.Main
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
javax.annotation.Resource
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
(
classes
=
Main
.
class
)
public
class
ApiMgrServiceImplTest
{
@Resource
private
AdMgrService
adMgrService
;
@Test
public
void
startAndStop
()
{
int
i
=
adMgrService
.
startandstop
(
1
,
1
);
System
.
out
.
println
(
"i = "
+
i
);
}
}
rpc-openplatform-container/src/test/java/cn/com/glsx/openplatform/service/CustomerMgrServiceImplTest.java
View file @
c86703c
package
cn
.
com
.
glsx
.
openplatform
.
service
;
import
cn.com.glsx.openplatform.Main
;
import
cn.com.glsx.openplatform.model.Area
;
import
cn.com.glsx.openplatform.model.PlatformCustomer
;
import
cn.hutool.core.util.RandomUtil
;
import
net.dreamlu.mica.core.utils.RsaUtil
;
...
...
@@ -13,6 +14,7 @@ import javax.annotation.Resource;
import
java.security.NoSuchAlgorithmException
;
import
java.security.PrivateKey
;
import
java.security.PublicKey
;
import
java.util.List
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
(
classes
=
Main
.
class
)
...
...
@@ -22,7 +24,6 @@ public class CustomerMgrServiceImplTest {
private
CustomerMgrService
customerMgrService
;
@Test
public
void
register
()
throws
NoSuchAlgorithmException
{
String
modulus
=
RandomUtil
.
randomNumbers
(
512
);
String
exponent
=
RandomUtil
.
randomNumbers
(
64
);
...
...
@@ -35,4 +36,10 @@ public class CustomerMgrServiceImplTest {
customer
.
setPublicKey
(
publicKey
.
getAlgorithm
());
customerMgrService
.
register
(
customer
);
}
@Test
public
void
test
()
{
List
<
Area
>
addressOptionList
=
customerMgrService
.
getAddressOptionList
(
0
);
System
.
out
.
println
(
"addressOptionList = "
+
addressOptionList
.
toString
());
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment