Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
glinfo-api
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
林业通
glinfo-api
Commits
f4e7fcb0
提交
f4e7fcb0
authored
1月 05, 2022
作者:
林业通
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
智能家居修改
上级
d6f0c88b
全部展开
显示空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
225 行增加
和
94 行删除
+225
-94
BdAbstractController.java
.../glinfo/enbao/common/controller/BdAbstractController.java
+2
-2
BaiDuAPIUtils.java
...in/java/tech/glinfo/enbao/common/utils/BaiDuAPIUtils.java
+0
-52
WaterMark.java
...c/main/java/tech/glinfo/enbao/common/utils/WaterMark.java
+0
-0
AppUserController.java
...o/enbao/modules/appuser/controller/AppUserController.java
+24
-12
WxRegisterForm.java
...ech/glinfo/enbao/modules/appuser/form/WxRegisterForm.java
+33
-0
LockParse.java
...src/main/java/tech/glinfo/enbao/modules/mq/LockParse.java
+3
-3
SpeakerParse.java
.../main/java/tech/glinfo/enbao/modules/mq/SpeakerParse.java
+1
-1
ShFamilyController.java
...linfo/enbao/modules/sh/controller/ShFamilyController.java
+9
-0
OtherShFamilyDao.java
...va/tech/glinfo/enbao/modules/sh/dao/OtherShFamilyDao.java
+3
-0
ShDeviceIndex.java
.../java/tech/glinfo/enbao/modules/sh/dto/ShDeviceIndex.java
+21
-0
ShFamilyIndex.java
.../java/tech/glinfo/enbao/modules/sh/dto/ShFamilyIndex.java
+22
-0
ShFamilyMemberDto.java
...a/tech/glinfo/enbao/modules/sh/dto/ShFamilyMemberDto.java
+2
-0
ShFamilyRoomIndex.java
...a/tech/glinfo/enbao/modules/sh/dto/ShFamilyRoomIndex.java
+18
-0
OtherShFamilyService.java
...glinfo/enbao/modules/sh/service/OtherShFamilyService.java
+2
-0
OtherShFamilyServiceImpl.java
...bao/modules/sh/service/impl/OtherShFamilyServiceImpl.java
+7
-0
application.yml
appapi/src/main/resources/application.yml
+20
-1
OtherShFamilyDao.xml
appapi/src/main/resources/mapper/sh/OtherShFamilyDao.xml
+43
-1
SysUserDao.xml
appapi/src/main/resources/mapper/sys/SysUserDao.xml
+0
-22
12-24.sql
doc/sql/12-24.sql
+15
-0
没有找到文件。
appapi/src/main/java/tech/glinfo/enbao/common/controller/BdAbstractController.java
浏览文件 @
f4e7fcb0
package
tech
.
glinfo
.
enbao
.
common
.
controller
;
package
tech
.
glinfo
.
enbao
.
common
.
controller
;
import
com.baidu.aip.face.AipFace
;
import
com.baidu.aip.face.AipFace
;
import
tech.glinfo.enbao.common.utils.BaiDuA
PI
Utils
;
import
tech.glinfo.enbao.common.utils.BaiDuA
pi
Utils
;
import
tech.glinfo.enbao.common.utils.R
;
import
tech.glinfo.enbao.common.utils.R
;
import
org.json.JSONArray
;
import
org.json.JSONArray
;
import
org.json.JSONObject
;
import
org.json.JSONObject
;
...
@@ -19,7 +19,7 @@ public abstract class BdAbstractController {
...
@@ -19,7 +19,7 @@ public abstract class BdAbstractController {
protected
Logger
logger
=
LoggerFactory
.
getLogger
(
getClass
());
protected
Logger
logger
=
LoggerFactory
.
getLogger
(
getClass
());
protected
R
baiduDetect
(
String
image
)
{
protected
R
baiduDetect
(
String
image
)
{
AipFace
apiFace
=
BaiDuA
PI
Utils
.
getApiFace
();
AipFace
apiFace
=
BaiDuA
pi
Utils
.
getApiFace
();
// 传入可选参数调用接口
// 传入可选参数调用接口
HashMap
<
String
,
String
>
options
=
new
HashMap
<
String
,
String
>();
HashMap
<
String
,
String
>
options
=
new
HashMap
<
String
,
String
>();
...
...
appapi/src/main/java/tech/glinfo/enbao/common/utils/BaiDuAPIUtils.java
deleted
100644 → 0
浏览文件 @
d6f0c88b
package
tech
.
glinfo
.
enbao
.
common
.
utils
;
import
com.baidu.aip.face.AipFace
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.stereotype.Component
;
/**
* 百度api工具类
*/
@ConfigurationProperties
(
prefix
=
"baidu"
)
@Component
public
class
BaiDuAPIUtils
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
getClass
());
private
static
String
appId
;
private
static
String
apiKey
;
private
static
String
secretKey
;
public
static
AipFace
getApiFace
()
{
return
ApiFaceUtils
.
instance
;
}
private
static
class
ApiFaceUtils
{
public
final
static
AipFace
instance
=
new
AipFace
(
appId
,
apiKey
,
secretKey
);
}
public
String
getAppId
()
{
return
appId
;
}
public
void
setAppId
(
String
appId
)
{
this
.
appId
=
appId
;
}
public
String
getApiKey
()
{
return
apiKey
;
}
public
void
setApiKey
(
String
apiKey
)
{
this
.
apiKey
=
apiKey
;
}
public
String
getSecretKey
()
{
return
secretKey
;
}
public
void
setSecretKey
(
String
secretKey
)
{
this
.
secretKey
=
secretKey
;
}
}
appapi/src/main/java/tech/glinfo/enbao/common/utils/WaterMark.java
deleted
100644 → 0
浏览文件 @
d6f0c88b
差异被折叠。
点击展开。
appapi/src/main/java/tech/glinfo/enbao/modules/appuser/controller/AppUserController.java
浏览文件 @
f4e7fcb0
...
@@ -61,24 +61,26 @@ public class AppUserController extends AbstractController {
...
@@ -61,24 +61,26 @@ public class AppUserController extends AbstractController {
@PostMapping
(
"register"
)
@PostMapping
(
"register"
)
@ApiOperation
(
"用户注册"
)
@ApiOperation
(
"用户注册"
)
@ApiLog
(
"用户注册"
)
@ApiLog
(
"用户注册"
)
public
R
register
(
@RequestBody
RegisterForm
form
){
public
R
register
(
@RequestBody
Wx
RegisterForm
form
){
//表单校验
//表单校验
ValidatorUtils
.
validateEntity
(
form
);
ValidatorUtils
.
validateEntity
(
form
);
AppUserEntity
userEntity
=
otherAppUserService
.
queryByPhone
(
form
.
getPhone
());
AppUserEntity
userEntity
=
otherAppUserService
.
queryByPhone
(
form
.
getPhone
());
if
(
userEntity
!=
null
)
{
if
(
userEntity
!=
null
)
{
throw
new
RRException
(
"手机号码已经注册过了"
);
return
R
.
error
(
"手机号码已经注册过了"
);
}
}
String
vcode
=
redisUtils
.
get
(
Constant
.
VCODE_KEY
+
Constant
.
VcodeType
.
REG
.
getValue
()
+
"_"
+
form
.
getPhone
());
/*
String vcode = redisUtils.get(Constant.VCODE_KEY + Constant.VcodeType.REG.getValue() + "_" + form.getPhone());
if(!form.getVcode().equals(vcode)) {
if(!form.getVcode().equals(vcode)) {
throw new RRException("验证码输入不正确");
throw new RRException("验证码输入不正确");
}
}
*/
AppUserEntity
user
=
new
AppUserEntity
();
AppUserEntity
user
=
new
AppUserEntity
();
user
.
setPhone
(
form
.
getPhone
());
user
.
setPhone
(
form
.
getPhone
());
user
.
setNickname
(
form
.
getNickname
());
user
.
setNickname
(
form
.
getNickname
());
user
.
setPassword
(
DigestUtils
.
sha256Hex
(
form
.
getPassword
()));
user
.
setOpenId
(
form
.
getOpenId
());
user
.
setHeadImgUrl
(
form
.
getHeadImgUrl
());
user
.
setPassword
(
DigestUtils
.
sha256Hex
(
"123456"
));
otherAppUserService
.
save
(
user
);
otherAppUserService
.
save
(
user
);
ShFamilyEntity
family
=
new
ShFamilyEntity
();
ShFamilyEntity
family
=
new
ShFamilyEntity
();
family
.
setName
(
"我的家"
);
family
.
setName
(
"我的家"
);
...
@@ -90,7 +92,12 @@ public class AppUserController extends AbstractController {
...
@@ -90,7 +92,12 @@ public class AppUserController extends AbstractController {
member
.
setUserId
(
user
.
getId
());
member
.
setUserId
(
user
.
getId
());
member
.
setIsAdmin
(
1
);
//管理员
member
.
setIsAdmin
(
1
);
//管理员
shFamilyMemberService
.
save
(
member
);
shFamilyMemberService
.
save
(
member
);
return
R
.
ok
();
String
token
=
jwtUtils
.
generateToken
(
user
.
getId
()
+
"#"
+
user
.
getPhone
());
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"token"
,
token
);
map
.
put
(
"expire"
,
jwtUtils
.
getExpire
());
map
.
put
(
"user"
,
user
);
return
R
.
ok
(
map
);
}
}
@PostMapping
(
"update"
)
@PostMapping
(
"update"
)
...
@@ -236,23 +243,28 @@ public class AppUserController extends AbstractController {
...
@@ -236,23 +243,28 @@ public class AppUserController extends AbstractController {
String
clientId
=
(
String
)
params
.
get
(
"clientId"
);
String
clientId
=
(
String
)
params
.
get
(
"clientId"
);
Integer
role
=
(
Integer
)
params
.
get
(
"role"
);
Integer
role
=
(
Integer
)
params
.
get
(
"role"
);
if
(
StringUtils
.
isNotEmpty
(
unionid
))
{
//
微信
登录
if
(
StringUtils
.
isNotEmpty
(
unionid
))
{
//
苹果
登录
//open_id 存unionID
//open_id 存unionID
AppUserEntity
user
=
otherAppUserService
.
getOne
(
new
QueryWrapper
<
AppUserEntity
>().
eq
(
"unionid"
,
unionid
));
AppUserEntity
user
=
otherAppUserService
.
getOne
(
new
QueryWrapper
<
AppUserEntity
>().
eq
(
"unionid"
,
unionid
));
if
(
user
!=
null
)
{
if
(
user
!=
null
)
{
// map.put("openId", openId);
// map.put("openId", openId);
return
R
.
ok
(
genTokenAndGetData
(
user
,
clientId
,
role
));
return
R
.
ok
(
genTokenAndGetData
(
user
,
clientId
,
role
));
}
else
{
}
else
{
return
R
.
ok
(
"当前微信暂未绑定任何账号!"
);
return
R
.
error
(
"当前Apple暂未绑定任何账号!"
);
}
}
}
else
if
(
StringUtils
.
isNotEmpty
(
openid
))
{
//
苹果
登录
}
else
if
(
StringUtils
.
isNotEmpty
(
openid
))
{
//
微信
登录
//open_id 存unionID
//open_id 存unionID
AppUserEntity
user
=
otherAppUserService
.
getOne
(
new
QueryWrapper
<
AppUserEntity
>().
eq
(
"open_id"
,
openid
));
AppUserEntity
user
=
otherAppUserService
.
getOne
(
new
QueryWrapper
<
AppUserEntity
>().
eq
(
"open_id"
,
openid
));
if
(
user
!=
null
)
{
if
(
user
!=
null
)
{
// map.put("openId", openId);
String
token
=
jwtUtils
.
generateToken
(
user
.
getId
()
+
"#"
+
user
.
getPhone
());
return
R
.
ok
(
genTokenAndGetData
(
user
,
clientId
,
role
));
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"token"
,
token
);
map
.
put
(
"expire"
,
jwtUtils
.
getExpire
());
map
.
put
(
"user"
,
user
);
return
R
.
ok
(
map
);
}
else
{
}
else
{
return
R
.
ok
(
"当前
Apple
暂未绑定任何账号!"
);
return
R
.
ok
(
"当前
微信
暂未绑定任何账号!"
);
}
}
}
else
{
}
else
{
return
R
.
error
(
"缺少参数,请核查!"
);
return
R
.
error
(
"缺少参数,请核查!"
);
...
...
appapi/src/main/java/tech/glinfo/enbao/modules/appuser/form/WxRegisterForm.java
0 → 100644
浏览文件 @
f4e7fcb0
package
tech
.
glinfo
.
enbao
.
modules
.
appuser
.
form
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
/**
* 注册表单
*
* @author linzhenjie@gltech.com
*/
@Data
@ApiModel
(
value
=
"注册表单"
)
public
class
WxRegisterForm
{
@ApiModelProperty
(
value
=
"手机号码"
)
@NotBlank
(
message
=
"手机号码不能为空"
)
private
String
phone
;
@ApiModelProperty
(
value
=
"昵称"
)
@NotBlank
(
message
=
"昵称不能为空"
)
private
String
nickname
;
@ApiModelProperty
(
value
=
"openId"
)
@NotBlank
(
message
=
"openId不能为空"
)
private
String
openId
;
@ApiModelProperty
(
value
=
"头像"
)
private
String
headImgUrl
;
}
appapi/src/main/java/tech/glinfo/enbao/modules/mq/LockParse.java
浏览文件 @
f4e7fcb0
...
@@ -302,7 +302,7 @@ public class LockParse implements IParse {
...
@@ -302,7 +302,7 @@ public class LockParse implements IParse {
String
content
=
datas
.
get
(
"content"
);
String
content
=
datas
.
get
(
"content"
);
logger
.
info
(
"上报试错告警"
+
content
);
logger
.
info
(
"上报试错告警"
+
content
);
int
action
=
Integer
.
parseInt
(
content
.
substring
(
4
,
6
),
16
);
int
action
=
Integer
.
parseInt
(
content
.
substring
(
4
,
6
),
16
);
AppUserEntity
userEntity
=
appUserService
.
getById
(
device
.
get
Publish
erId
());
AppUserEntity
userEntity
=
appUserService
.
getById
(
device
.
get
Us
erId
());
String
tishi
=
action
==
1
?
"指纹"
:
action
==
2
?
"密码"
:
action
==
3
?
"卡片"
:
action
==
20
?
"人脸"
:
action
==
21
?
"掌纹"
:
"未知"
;
String
tishi
=
action
==
1
?
"指纹"
:
action
==
2
?
"密码"
:
action
==
3
?
"卡片"
:
action
==
20
?
"人脸"
:
action
==
21
?
"掌纹"
:
"未知"
;
if
(
StringUtils
.
isNotBlank
(
userEntity
.
getThirdId
()))
{
if
(
StringUtils
.
isNotBlank
(
userEntity
.
getThirdId
()))
{
mqProducer
.
sendPush
(
tishi
+
"多次开锁失败提示"
,
"设备: "
+
device
.
getNumbering
()
+
" "
+
tishi
+
"多次开锁失败提示"
,
userEntity
.
getThirdId
());
mqProducer
.
sendPush
(
tishi
+
"多次开锁失败提示"
,
"设备: "
+
device
.
getNumbering
()
+
" "
+
tishi
+
"多次开锁失败提示"
,
userEntity
.
getThirdId
());
...
@@ -310,13 +310,13 @@ public class LockParse implements IParse {
...
@@ -310,13 +310,13 @@ public class LockParse implements IParse {
}
}
//处理设备期限使用标志
//处理设备期限使用标志
new
Thread
(
new
Runnable
()
{
/*
new Thread(new Runnable() {
@Override
@Override
public void run() {
public void run() {
logger.info("start handleEndTime");
logger.info("start handleEndTime");
timeParseUtils.handleEndTime(device.getId(), "06", device.getNumbering(), datas.get("cmd"));
timeParseUtils.handleEndTime(device.getId(), "06", device.getNumbering(), datas.get("cmd"));
}
}
}).
start
();
}).start();
*/
return
ws
;
return
ws
;
}
}
...
...
appapi/src/main/java/tech/glinfo/enbao/modules/mq/SpeakerParse.java
浏览文件 @
f4e7fcb0
...
@@ -122,7 +122,7 @@ public class SpeakerParse implements IParse {
...
@@ -122,7 +122,7 @@ public class SpeakerParse implements IParse {
redisUtils
.
set
(
AppContants
.
SPEAKER_FILE_SEND
+
device
.
getNumbering
()
+
"-stopsend"
,
1
,
5
);
redisUtils
.
set
(
AppContants
.
SPEAKER_FILE_SEND
+
device
.
getNumbering
()
+
"-stopsend"
,
1
,
5
);
return
null
;
return
null
;
}
else
if
(
"00"
.
equals
(
datas
.
get
(
"cmd"
)))
{
//解析后的中文
}
else
if
(
"00"
.
equals
(
datas
.
get
(
"cmd"
)))
{
//解析后的中文
parseText
(
device
.
getId
(),
device
.
getNumbering
(),
device
.
getSpareTwo
(),
content
,
null
,
device
.
get
Publish
erId
());
parseText
(
device
.
getId
(),
device
.
getNumbering
(),
device
.
getSpareTwo
(),
content
,
null
,
device
.
get
Us
erId
());
return
null
;
return
null
;
}
else
if
(
"998"
.
equals
(
datas
.
get
(
"cmd"
)))
{
//文件下发后状态
}
else
if
(
"998"
.
equals
(
datas
.
get
(
"cmd"
)))
{
//文件下发后状态
ShSpeakerSongEntity
song
=
shSpeakerSongService
.
getById
(
content
);
ShSpeakerSongEntity
song
=
shSpeakerSongService
.
getById
(
content
);
...
...
appapi/src/main/java/tech/glinfo/enbao/modules/sh/controller/ShFamilyController.java
浏览文件 @
f4e7fcb0
...
@@ -64,4 +64,12 @@ public class ShFamilyController {
...
@@ -64,4 +64,12 @@ public class ShFamilyController {
return
otherShFamilyService
.
delete
(
params
,
user
);
return
otherShFamilyService
.
delete
(
params
,
user
);
}
}
@Login
@GetMapping
(
"index"
)
@ApiOperation
(
"首页"
)
@ApiLog
(
"首页"
)
public
R
index
(
@RequestBody
Map
<
String
,
Object
>
params
,
@LoginUser
AppUserEntity
user
)
{
return
otherShFamilyService
.
index
(
user
.
getId
(),
Integer
.
valueOf
((
String
)
params
.
get
(
"familyId"
)));
}
}
}
\ No newline at end of file
appapi/src/main/java/tech/glinfo/enbao/modules/sh/dao/OtherShFamilyDao.java
浏览文件 @
f4e7fcb0
...
@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Mapper;
...
@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Mapper;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
org.apache.ibatis.annotations.Select
;
import
tech.glinfo.enbao.modules.sh.dto.ShFamilyDto
;
import
tech.glinfo.enbao.modules.sh.dto.ShFamilyDto
;
import
tech.glinfo.enbao.modules.sh.dto.ShFamilyIndex
;
import
tech.glinfo.enbao.modules.sh.entity.ShDeviceEntity
;
import
tech.glinfo.enbao.modules.sh.entity.ShDeviceEntity
;
import
tech.glinfo.enbao.modules.sh.entity.ShFamilyEntity
;
import
tech.glinfo.enbao.modules.sh.entity.ShFamilyEntity
;
...
@@ -33,4 +34,6 @@ public interface OtherShFamilyDao extends BaseMapper<ShFamilyEntity> {
...
@@ -33,4 +34,6 @@ public interface OtherShFamilyDao extends BaseMapper<ShFamilyEntity> {
ShFamilyDto
familyInfo
(
@Param
(
"params"
)
Integer
id
);
ShFamilyDto
familyInfo
(
@Param
(
"params"
)
Integer
id
);
ShFamilyIndex
index
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"familyId"
)
Integer
familyId
);
}
}
appapi/src/main/java/tech/glinfo/enbao/modules/sh/dto/ShDeviceIndex.java
0 → 100644
浏览文件 @
f4e7fcb0
package
tech
.
glinfo
.
enbao
.
modules
.
sh
.
dto
;
import
lombok.Data
;
/**
* @author lyt
* @date 2022/1/5 15:28
*/
@Data
public
class
ShDeviceIndex
{
private
Integer
id
;
private
String
name
;
private
String
numbering
;
private
Integer
onlineStatus
;
private
String
pic
;
}
appapi/src/main/java/tech/glinfo/enbao/modules/sh/dto/ShFamilyIndex.java
0 → 100644
浏览文件 @
f4e7fcb0
package
tech
.
glinfo
.
enbao
.
modules
.
sh
.
dto
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author lyt
* @date 2022/1/5 11:25
*/
@Data
public
class
ShFamilyIndex
{
private
Integer
id
;
private
String
name
;
private
List
<
ShDeviceIndex
>
devices
;
private
List
<
ShFamilyRoomIndex
>
rooms
;
}
appapi/src/main/java/tech/glinfo/enbao/modules/sh/dto/ShFamilyMemberDto.java
浏览文件 @
f4e7fcb0
...
@@ -12,4 +12,6 @@ public class ShFamilyMemberDto {
...
@@ -12,4 +12,6 @@ public class ShFamilyMemberDto {
private
Integer
id
;
private
Integer
id
;
private
String
nickname
;
private
String
nickname
;
private
Integer
isAdmin
;
}
}
appapi/src/main/java/tech/glinfo/enbao/modules/sh/dto/ShFamilyRoomIndex.java
0 → 100644
浏览文件 @
f4e7fcb0
package
tech
.
glinfo
.
enbao
.
modules
.
sh
.
dto
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author lyt
* @date 2022/1/5 11:25
*/
@Data
public
class
ShFamilyRoomIndex
{
private
Integer
id
;
private
String
name
;
}
appapi/src/main/java/tech/glinfo/enbao/modules/sh/service/OtherShFamilyService.java
浏览文件 @
f4e7fcb0
...
@@ -22,4 +22,6 @@ public interface OtherShFamilyService extends IService<ShFamilyEntity> {
...
@@ -22,4 +22,6 @@ public interface OtherShFamilyService extends IService<ShFamilyEntity> {
R
list
(
AppUserEntity
user
);
R
list
(
AppUserEntity
user
);
R
info
(
Integer
id
);
R
info
(
Integer
id
);
R
index
(
Integer
userId
,
Integer
familyId
);
}
}
appapi/src/main/java/tech/glinfo/enbao/modules/sh/service/impl/OtherShFamilyServiceImpl.java
浏览文件 @
f4e7fcb0
...
@@ -9,6 +9,7 @@ import tech.glinfo.enbao.common.utils.StringUtils;
...
@@ -9,6 +9,7 @@ import tech.glinfo.enbao.common.utils.StringUtils;
import
tech.glinfo.enbao.modules.appuser.entity.AppUserEntity
;
import
tech.glinfo.enbao.modules.appuser.entity.AppUserEntity
;
import
tech.glinfo.enbao.modules.sh.dao.OtherShFamilyDao
;
import
tech.glinfo.enbao.modules.sh.dao.OtherShFamilyDao
;
import
tech.glinfo.enbao.modules.sh.dto.ShFamilyDto
;
import
tech.glinfo.enbao.modules.sh.dto.ShFamilyDto
;
import
tech.glinfo.enbao.modules.sh.dto.ShFamilyIndex
;
import
tech.glinfo.enbao.modules.sh.entity.ShFamilyEntity
;
import
tech.glinfo.enbao.modules.sh.entity.ShFamilyEntity
;
import
tech.glinfo.enbao.modules.sh.entity.ShFamilyMemberEntity
;
import
tech.glinfo.enbao.modules.sh.entity.ShFamilyMemberEntity
;
import
tech.glinfo.enbao.modules.sh.service.OtherShFamilyService
;
import
tech.glinfo.enbao.modules.sh.service.OtherShFamilyService
;
...
@@ -88,5 +89,11 @@ public class OtherShFamilyServiceImpl extends ServiceImpl<OtherShFamilyDao, ShFa
...
@@ -88,5 +89,11 @@ public class OtherShFamilyServiceImpl extends ServiceImpl<OtherShFamilyDao, ShFa
return
R
.
ok
().
put
(
"family"
,
family
);
return
R
.
ok
().
put
(
"family"
,
family
);
}
}
@Override
public
R
index
(
Integer
userId
,
Integer
familyId
)
{
ShFamilyIndex
index
=
this
.
baseMapper
.
index
(
userId
,
familyId
);
return
R
.
ok
().
put
(
"data"
,
index
);
}
}
}
appapi/src/main/resources/application.yml
浏览文件 @
f4e7fcb0
...
@@ -12,7 +12,7 @@ server:
...
@@ -12,7 +12,7 @@ server:
spring
:
spring
:
# 环境 dev|test|prod
# 环境 dev|test|prod
profiles
:
profiles
:
active
:
dev
active
:
local
# jackson时间格式化
# jackson时间格式化
jackson
:
jackson
:
time-zone
:
GMT+8
time-zone
:
GMT+8
...
@@ -66,4 +66,23 @@ baidu:
...
@@ -66,4 +66,23 @@ baidu:
apiKey
:
45lWoxeKGTxjQTdliVSCj6G8
apiKey
:
45lWoxeKGTxjQTdliVSCj6G8
secretKey
:
Mk7QVOthvwqxFHZvZ0X7gOOTMcUEBBS8
secretKey
:
Mk7QVOthvwqxFHZvZ0X7gOOTMcUEBBS8
# netty-socketio 配置
socketio
:
host
:
127.0.0.1
port
:
8888
# 设置最大每帧处理数据的长度,防止他人利用大数据来攻击服务器
maxFramePayloadLength
:
1048576
# 设置http交互最大内容长度
maxHttpContentLength
:
1048576
# socket连接数大小(如只监听一个端口boss线程组为1即可)
bossCount
:
1
workCount
:
100
allowCustomRequests
:
true
# 协议升级超时时间(毫秒),默认10秒。HTTP握手升级为ws协议超时时间
upgradeTimeout
:
1000000
# Ping消息超时时间(毫秒),默认60秒,这个时间间隔内没有接收到心跳消息就会发送超时事件
pingTimeout
:
6000000
# Ping消息间隔(毫秒),默认25秒。客户端向服务器发送一条心跳消息间隔
pingInterval
:
25000
appapi/src/main/resources/mapper/sh/OtherShFamilyDao.xml
浏览文件 @
f4e7fcb0
...
@@ -10,17 +10,58 @@
...
@@ -10,17 +10,58 @@
<collection
property=
"members"
ofType=
"tech.glinfo.enbao.modules.sh.dto.ShFamilyMemberDto"
columnPrefix=
"item_"
>
<collection
property=
"members"
ofType=
"tech.glinfo.enbao.modules.sh.dto.ShFamilyMemberDto"
columnPrefix=
"item_"
>
<result
column=
"id"
property=
"id"
/>
<result
column=
"id"
property=
"id"
/>
<result
column=
"nickname"
property=
"nickname"
/>
<result
column=
"nickname"
property=
"nickname"
/>
<result
column=
"is_admin"
property=
"isAdmin"
/>
</collection>
</resultMap>
<resultMap
id=
"familyIndexResultMap"
type=
"tech.glinfo.enbao.modules.sh.dto.ShFamilyIndex"
>
<result
column=
"id"
property=
"id"
/>
<result
column=
"name"
property=
"name"
/>
<collection
property=
"devices"
ofType=
"tech.glinfo.enbao.modules.sh.dto.ShDeviceIndex"
columnPrefix=
"device_"
>
<result
column=
"id"
property=
"id"
/>
<result
column=
"name"
property=
"name"
/>
<result
column=
"numbering"
property=
"numbering"
/>
<result
column=
"onlineStatus"
property=
"onlineStatus"
/>
<result
column=
"pic"
property=
"pic"
/>
</collection>
<collection
property=
"rooms"
ofType=
"tech.glinfo.enbao.modules.sh.dto.ShFamilyRoomIndex"
columnPrefix=
"room_"
>
<result
column=
"id"
property=
"id"
/>
<result
column=
"name"
property=
"name"
/>
</collection>
</collection>
</resultMap>
</resultMap>
<select
id=
"familyInfo"
resultMap=
"familyResultMap"
>
<select
id=
"familyInfo"
resultMap=
"familyResultMap"
>
SELECT a.id, a.name, COUNT(c.id) room,
SELECT a.id, a.name, COUNT(c.id) room,
b.id item_id,
b.id item_id,
d.nickname item_nickname
d.nickname item_nickname,
b.is_admin item_isAdmin
FROM
FROM
sh_family a, sh_family_member b, sh_family_room c, app_user d
sh_family a, sh_family_member b, sh_family_room c, app_user d
WHERE
WHERE
a.id = b.family_id AND a.id = c.family_id AND b.user_id = d.id AND a.id = ${id}
a.id = b.family_id AND a.id = c.family_id AND b.user_id = d.id AND a.id = ${id}
</select>
</select>
<select
id=
"index"
resultMap=
"familyIndexResultMap"
>
SELECT a.id, a.name,
b.id device_id,
b.name device_name,
b.numbering device_numbering,
b.online_status device_onlineStatus,
b.pic device_pic,
c.id room_id,
c.name room_name
FROM
sh_family a LEFT JOIN sh_device b ON a.id = b.family_id LEFT JOIN sh_family_room c ON a.id = c.family_id
WHERE
<choose>
<when
test=
"familyId != null and familyId !=''"
>
a.id = ${familyId}
</when>
<otherwise>
a.id = (SELECT d.id FROM sh_family d WHERE d.user_id = ${userId} LIMIT 1)
</otherwise>
</choose>
</select>
</mapper>
</mapper>
\ No newline at end of file
appapi/src/main/resources/mapper/sys/SysUserDao.xml
deleted
100644 → 0
浏览文件 @
d6f0c88b
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"tech.glinfo.enbao.modules.sysuser.dao.SysUserDao"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"tech.glinfo.enbao.modules.sysuser.entity.SysUserEntity"
id=
"sysUserMap"
>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"username"
column=
"username"
/>
<result
property=
"password"
column=
"password"
/>
<result
property=
"salt"
column=
"salt"
/>
<result
property=
"email"
column=
"email"
/>
<result
property=
"mobile"
column=
"mobile"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"type"
column=
"type"
/>
<result
property=
"createUserId"
column=
"create_user_id"
/>
<result
property=
"createTime"
column=
"create_time"
/>
</resultMap>
</mapper>
\ No newline at end of file
doc/sql/12-24.sql
浏览文件 @
f4e7fcb0
...
@@ -16,6 +16,21 @@ CREATE TABLE `app_user` (
...
@@ -16,6 +16,21 @@ CREATE TABLE `app_user` (
KEY
`app_user_phone`
(
`phone`
)
USING
BTREE
KEY
`app_user_phone`
(
`phone`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COMMENT
=
'APP用户'
;
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COMMENT
=
'APP用户'
;
DROP
TABLE
IF
EXISTS
`app_api_log`
;
CREATE
TABLE
`app_api_log`
(
`id`
bigint
(
20
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键id'
,
`userid`
int
(
11
)
COMMENT
'用户'
,
`phone`
varchar
(
11
)
COMMENT
'手机号码'
,
`operation`
varchar
(
50
)
COMMENT
'用户操作'
,
`method`
varchar
(
200
)
COMMENT
'请求方法'
,
`params`
text
COMMENT
'请求参数'
,
`time`
bigint
NOT
NULL
COMMENT
'执行时长(毫秒)'
,
`ip`
varchar
(
64
)
COMMENT
'IP地址'
,
`create_date`
datetime
COMMENT
'创建时间'
,
PRIMARY
KEY
(
`id`
),
KEY
`app_api_log_phone`
(
`phone`
)
USING
BTREE
)
ENGINE
=
`InnoDB`
DEFAULT
CHARACTER
SET
utf8mb4
COMMENT
=
'API日志'
;
CREATE
TABLE
`sh_category`
(
CREATE
TABLE
`sh_category`
(
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
`name`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'分类名称'
,
`name`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'分类名称'
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论