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
89d1ac8e
Commit
89d1ac8e
authored
Aug 24, 2023
by
杨阳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
打印日志
调整二维码接口参数验证 调整平台微信注册接口
parent
6b54a551
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
6 deletions
+23
-6
MobileLoginParamDto.java
...in/amos/boot/module/hygf/api/dto/MobileLoginParamDto.java
+3
-1
PeasantHouseholdDto.java
...in/amos/boot/module/hygf/api/dto/PeasantHouseholdDto.java
+13
-0
PeasantHouseholdWxController.java
...ule/hygf/biz/controller/PeasantHouseholdWxController.java
+4
-3
PeasantHouseholdServiceImpl.java
...le/hygf/biz/service/impl/PeasantHouseholdServiceImpl.java
+0
-0
WxServiceImpl.java
...amos/boot/module/hygf/biz/service/impl/WxServiceImpl.java
+3
-2
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/MobileLoginParamDto.java
View file @
89d1ac8e
...
@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.hygf.api.dto;
...
@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.hygf.api.dto;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.validation.Valid
;
/**
/**
*
*
* @author Provence
* @author Provence
...
@@ -61,5 +63,5 @@ public class MobileLoginParamDto {
...
@@ -61,5 +63,5 @@ public class MobileLoginParamDto {
private
String
verifyCode
;
private
String
verifyCode
;
@ApiModelProperty
(
"农户信息"
)
@ApiModelProperty
(
"农户信息"
)
private
PeasantHouseholdDto
peasantHouseholdDto
;
private
@Valid
PeasantHouseholdDto
peasantHouseholdDto
;
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/PeasantHouseholdDto.java
View file @
89d1ac8e
...
@@ -9,6 +9,9 @@ import lombok.Data;
...
@@ -9,6 +9,9 @@ import lombok.Data;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -39,13 +42,16 @@ public class PeasantHouseholdDto extends BaseDto {
...
@@ -39,13 +42,16 @@ public class PeasantHouseholdDto extends BaseDto {
private
String
telephone
;
private
String
telephone
;
@ApiModelProperty
(
value
=
"开发方名称"
)
@ApiModelProperty
(
value
=
"开发方名称"
)
@NotBlank
(
message
=
"开发方名称不能为空"
)
private
String
developerName
;
private
String
developerName
;
@ApiModelProperty
(
value
=
"开发方code"
)
@ApiModelProperty
(
value
=
"开发方code"
)
@NotBlank
(
message
=
"开发方code不能为空"
)
private
String
developerCode
;
private
String
developerCode
;
@ApiModelProperty
(
value
=
"开发方平台id"
)
@ApiModelProperty
(
value
=
"开发方平台id"
)
@NotNull
(
message
=
"开发方平台id不能为空"
)
private
Long
developerId
;
private
Long
developerId
;
@ApiModelProperty
(
value
=
"定金"
)
@ApiModelProperty
(
value
=
"定金"
)
...
@@ -90,7 +96,9 @@ public class PeasantHouseholdDto extends BaseDto {
...
@@ -90,7 +96,9 @@ public class PeasantHouseholdDto extends BaseDto {
@ApiModelProperty
(
value
=
"常住详细地址"
)
@ApiModelProperty
(
value
=
"常住详细地址"
)
private
String
permanentAddressDetail
;
private
String
permanentAddressDetail
;
@ApiModelProperty
(
value
=
"开发人"
)
@ApiModelProperty
(
value
=
"开发人"
)
@NotBlank
(
message
=
"开发人不能为空"
)
private
String
developer
;
private
String
developer
;
@ApiModelProperty
(
value
=
"常住地址"
)
@ApiModelProperty
(
value
=
"常住地址"
)
...
@@ -108,20 +116,25 @@ public class PeasantHouseholdDto extends BaseDto {
...
@@ -108,20 +116,25 @@ public class PeasantHouseholdDto extends BaseDto {
private
List
<
String
>
permanentAddressText
;
private
List
<
String
>
permanentAddressText
;
@ApiModelProperty
(
value
=
"区域公司id"
)
@ApiModelProperty
(
value
=
"区域公司id"
)
@NotNull
(
message
=
"区域公司id不能为空"
)
private
Long
regionalCompaniesSeq
;
private
Long
regionalCompaniesSeq
;
@ApiModelProperty
(
value
=
"区域公司code"
)
@ApiModelProperty
(
value
=
"区域公司code"
)
@NotBlank
(
message
=
"区域公司code不能为空"
)
private
String
regionalCompaniesCode
;
private
String
regionalCompaniesCode
;
@ApiModelProperty
(
value
=
"区域公司名称"
)
@ApiModelProperty
(
value
=
"区域公司名称"
)
@NotBlank
(
message
=
"区域公司名称不能为空"
)
private
String
regionalCompaniesName
;
private
String
regionalCompaniesName
;
@ApiModelProperty
(
value
=
"身份证正面"
)
@ApiModelProperty
(
value
=
"身份证正面"
)
@TableField
(
typeHandler
=
FastjsonTypeHandler
.
class
)
@TableField
(
typeHandler
=
FastjsonTypeHandler
.
class
)
@NotEmpty
(
message
=
"身份证正面不能为空"
)
private
List
<
Object
>
idCardFront
;
private
List
<
Object
>
idCardFront
;
@ApiModelProperty
(
value
=
"身份证反面"
)
@ApiModelProperty
(
value
=
"身份证反面"
)
@TableField
(
typeHandler
=
FastjsonTypeHandler
.
class
)
@TableField
(
typeHandler
=
FastjsonTypeHandler
.
class
)
@NotEmpty
(
message
=
"身份证反面不能为空"
)
private
List
<
Object
>
idCardOpposite
;
private
List
<
Object
>
idCardOpposite
;
@ApiModelProperty
(
value
=
"微信唯一id"
)
@ApiModelProperty
(
value
=
"微信唯一id"
)
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/PeasantHouseholdWxController.java
View file @
89d1ac8e
...
@@ -19,10 +19,10 @@ import io.swagger.annotations.Api;
...
@@ -19,10 +19,10 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -105,6 +105,7 @@ public class PeasantHouseholdWxController extends BaseController {
...
@@ -105,6 +105,7 @@ public class PeasantHouseholdWxController extends BaseController {
@RequestMapping
(
value
=
"/login"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/login"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"微信授权登陆"
,
notes
=
"微信授权登陆"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"微信授权登陆"
,
notes
=
"微信授权登陆"
)
public
ResponseModel
<
PeasantHouseholdWxDto
>
wxUserLogin
(
@ApiParam
@RequestBody
MobileLoginParamDto
mobileLoginParam
)
{
public
ResponseModel
<
PeasantHouseholdWxDto
>
wxUserLogin
(
@ApiParam
@RequestBody
MobileLoginParamDto
mobileLoginParam
)
{
log
.
info
(
"微信授权登录入参 => {}"
,
mobileLoginParam
);
if
(
StringUtils
.
isBlank
(
mobileLoginParam
.
getAmosUserId
()))
{
if
(
StringUtils
.
isBlank
(
mobileLoginParam
.
getAmosUserId
()))
{
// 扫码的userId为空, 则取默认值
// 扫码的userId为空, 则取默认值
mobileLoginParam
.
setAmosUserId
(
defaultUserId
);
mobileLoginParam
.
setAmosUserId
(
defaultUserId
);
...
@@ -116,8 +117,8 @@ public class PeasantHouseholdWxController extends BaseController {
...
@@ -116,8 +117,8 @@ public class PeasantHouseholdWxController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/register"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/register"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"微信农户注册"
,
notes
=
"微信农户注册"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"微信农户注册"
,
notes
=
"微信农户注册"
)
public
ResponseModel
<
PeasantHouseholdDto
>
wxUserRegister
(
@ApiParam
@RequestBody
MobileLoginParamDto
mobileLoginParam
)
{
public
ResponseModel
<
PeasantHouseholdDto
>
wxUserRegister
(
@
Validated
@
ApiParam
@RequestBody
MobileLoginParamDto
mobileLoginParam
)
{
// log.info("微信农户注册, 入参 => {}", JSONObject.toJSONString(mobileLoginParam)
);
log
.
info
(
"微信农户注册, 入参 => {}"
,
mobileLoginParam
);
if
(
null
==
mobileLoginParam
.
getPeasantHouseholdDto
())
{
if
(
null
==
mobileLoginParam
.
getPeasantHouseholdDto
())
{
throw
new
BadRequest
(
"农户信息不能为空"
);
throw
new
BadRequest
(
"农户信息不能为空"
);
}
}
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/PeasantHouseholdServiceImpl.java
View file @
89d1ac8e
This diff is collapsed.
Click to expand it.
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/WxServiceImpl.java
View file @
89d1ac8e
...
@@ -249,12 +249,13 @@ public class WxServiceImpl implements IWxService {
...
@@ -249,12 +249,13 @@ public class WxServiceImpl implements IWxService {
@Override
@Override
public
JSONObject
getCode2Session
(
String
code
)
{
public
JSONObject
getCode2Session
(
String
code
)
{
String
url
=
buildOpenIdUrl
(
appId
,
secret
,
code
);
String
url
=
buildOpenIdUrl
(
appId
,
secret
,
code
);
log
.
info
(
"微信 code2Session, code =>{}, 请求 => {}"
,
code
,
url
);
String
resultStr
=
HttpUtil
.
sendHttpGet
(
url
);
String
resultStr
=
HttpUtil
.
sendHttpGet
(
url
);
// resultStr => {"session_key":"Mj5xbDhcZU73DtUduI1xKg==","openid":"oRraY5aYJkxkDJiG4rBaaw4MSmPA"}
// resultStr => {"session_key":"Mj5xbDhcZU73DtUduI1xKg==","openid":"oRraY5aYJkxkDJiG4rBaaw4MSmPA"}
log
.
info
(
"微信
C
ode2Session, code =>{}, 结果 => {}"
,
code
,
resultStr
);
log
.
info
(
"微信
c
ode2Session, code =>{}, 结果 => {}"
,
code
,
resultStr
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
resultStr
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
resultStr
);
if
(
jsonObject
==
null
||
jsonObject
.
getIntValue
(
"errcode"
)
!=
0
)
{
if
(
jsonObject
==
null
||
jsonObject
.
getIntValue
(
"errcode"
)
!=
0
)
{
throw
new
BadRequest
(
"微信授权失败, 请重新授权"
);
throw
new
RuntimeException
(
"微信授权失败, 请重新授权"
);
}
}
return
jsonObject
;
return
jsonObject
;
}
}
...
...
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