Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
info-publish-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
info-publish-platform
Commits
cde9db23
Commit
cde9db23
authored
Dec 11, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加皮肤同步
parent
139bb839
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
2769 additions
and
2 deletions
+2769
-2
common-lib/src/main/java/com/mortals/xhx/common/pdu/skin/SkinBasePdu.java
...ain/java/com/mortals/xhx/common/pdu/skin/SkinBasePdu.java
+72
-0
common-lib/src/main/java/com/mortals/xhx/feign/skin/ISkinBaseFeign.java
.../main/java/com/mortals/xhx/feign/skin/ISkinBaseFeign.java
+100
-0
info-publish-manager-ui/admin/src/views/device/drawershow.vue
...-publish-manager-ui/admin/src/views/device/drawershow.vue
+1
-1
info-publish-manager/src/main/java/com/mortals/xhx/daemon/task/SyncSiteDeviceTaskImpl.java
...a/com/mortals/xhx/daemon/task/SyncSiteDeviceTaskImpl.java
+5
-1
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/dao/SkinDao.java
...rc/main/java/com/mortals/xhx/module/skin/dao/SkinDao.java
+17
-0
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/dao/ibatis/SkinDaoImpl.java
...a/com/mortals/xhx/module/skin/dao/ibatis/SkinDaoImpl.java
+20
-0
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/model/SkinEntity.java
...in/java/com/mortals/xhx/module/skin/model/SkinEntity.java
+234
-0
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/model/SkinQuery.java
...ain/java/com/mortals/xhx/module/skin/model/SkinQuery.java
+1310
-0
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/model/vo/SkinVo.java
...ain/java/com/mortals/xhx/module/skin/model/vo/SkinVo.java
+15
-0
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/service/SkinService.java
...java/com/mortals/xhx/module/skin/service/SkinService.java
+16
-0
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/service/impl/SkinServiceImpl.java
...mortals/xhx/module/skin/service/impl/SkinServiceImpl.java
+137
-0
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/web/SkinController.java
.../java/com/mortals/xhx/module/skin/web/SkinController.java
+73
-0
info-publish-manager/src/main/resources/sqlmap/module/skin/SkinMapper.xml
...ager/src/main/resources/sqlmap/module/skin/SkinMapper.xml
+769
-0
No files found.
common-lib/src/main/java/com/mortals/xhx/common/pdu/skin/SkinBasePdu.java
0 → 100644
View file @
cde9db23
package
com.mortals.xhx.common.pdu.skin
;
import
com.mortals.framework.model.BaseEntityLong
;
import
lombok.Data
;
/**
* 系统基础皮肤Pdu对象
*
* @author zxfei
* @date 2023-04-03
*/
@Data
public
class
SkinBasePdu
extends
BaseEntityLong
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 所属种类,来源种类
*/
private
Long
categoryId
;
/**
* 产品id
*/
private
Long
productId
;
/**
* 产品编码
*/
private
String
productCode
;
/**
* 产品名称
*/
private
String
productName
;
/**
* css模板合成后文件地址
*/
private
String
cssFilePath
;
/**
* 排序编号
*/
private
Integer
sortNum
;
/**
* 产品皮肤名称,唯一且不为空
*/
private
String
name
;
/**
* 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
*/
private
String
imageResolution
;
/**
* 预览图片
*/
private
String
previewImagePath
;
public
void
initAttrValue
(){
this
.
categoryId
=
null
;
this
.
productId
=
null
;
this
.
productName
=
""
;
this
.
cssFilePath
=
""
;
this
.
sortNum
=
null
;
this
.
name
=
""
;
this
.
imageResolution
=
"1"
;
this
.
previewImagePath
=
""
;
}
}
\ No newline at end of file
common-lib/src/main/java/com/mortals/xhx/feign/skin/ISkinBaseFeign.java
0 → 100644
View file @
cde9db23
package
com.mortals.xhx.feign.skin
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.skin.SkinBasePdu
;
import
com.mortals.xhx.feign.IFeign
;
import
feign.hystrix.FallbackFactory
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 系统基础皮肤 Feign接口
* @author zxfei
* @date 2023-04-03
*/
@FeignClient
(
name
=
"base-manager"
,
path
=
"/base"
,
fallbackFactory
=
SkinBaseFeignFallbackFactory
.
class
)
public
interface
ISkinBaseFeign
extends
IFeign
{
/**
* 查看系统基础皮肤列表
*
* @param skinBasePdu
* @return
*/
@PostMapping
(
value
=
"/skin/base/interlist"
)
Rest
<
RespData
<
List
<
SkinBasePdu
>>>
list
(
@RequestBody
SkinBasePdu
skinBasePdu
);
/**
* 查看系统基础皮肤
*
* @param id
* @return
*/
@GetMapping
(
value
=
"/skin/base/info"
)
Rest
<
SkinBasePdu
>
info
(
@RequestParam
(
value
=
"id"
)
Long
id
);
/**
* 删除系统基础皮肤
*
* @param ids
* @return
*/
@GetMapping
(
value
=
"/skin/base/delete"
)
Rest
<
Void
>
delete
(
Long
[]
ids
,
@RequestHeader
(
"Authorization"
)
String
authorization
);
/**
* 系统基础皮肤保存更新
*
* @param skinBasePdu
* @return
*/
@PostMapping
(
value
=
"/skin/base/save"
)
Rest
<
RespData
<
SkinBasePdu
>>
save
(
@RequestBody
SkinBasePdu
skinBasePdu
,
@RequestHeader
(
"Authorization"
)
String
authorization
);
}
@Slf4j
@Component
class
SkinBaseFeignFallbackFactory
implements
FallbackFactory
<
ISkinBaseFeign
>
{
@Override
public
ISkinBaseFeign
create
(
Throwable
t
)
{
return
new
ISkinBaseFeign
()
{
@Override
public
Rest
<
RespData
<
List
<
SkinBasePdu
>>>
list
(
SkinBasePdu
skinBasePdu
)
{
return
Rest
.
fail
(
"暂时无法获取系统基础皮肤列表,请稍后再试!"
);
}
@Override
public
Rest
<
SkinBasePdu
>
info
(
Long
id
)
{
return
Rest
.
fail
(
"暂时无法获取系统基础皮肤详细,请稍后再试!"
);
}
@Override
public
Rest
<
Void
>
delete
(
Long
[]
ids
,
String
authorization
)
{
return
Rest
.
fail
(
"暂时无法删除系统基础皮肤,请稍后再试!"
);
}
@Override
public
Rest
<
RespData
<
SkinBasePdu
>>
save
(
SkinBasePdu
skinBasePdu
,
String
authorization
)
{
return
Rest
.
fail
(
"暂时无法保存系统基础皮肤,请稍后再试!"
);
}
};
}
}
info-publish-manager-ui/admin/src/views/device/drawershow.vue
View file @
cde9db23
...
...
@@ -54,7 +54,7 @@
return
{
filePaths
:
""
,
fileNames
:
""
,
limit
:
1
0
,
limit
:
5
0
,
deviceFileEntityList
:
[],
deviceWorkmanEntityList
:[],
fileType
:[
'
png
'
,
'
jpg
'
,
'
jpeg
'
],
...
...
info-publish-manager/src/main/java/com/mortals/xhx/daemon/task/SyncSiteDeviceTaskImpl.java
View file @
cde9db23
...
...
@@ -16,6 +16,7 @@ import com.mortals.xhx.feign.site.ISiteFeign;
import
com.mortals.xhx.module.device.model.DeviceEntity
;
import
com.mortals.xhx.module.device.model.DeviceQuery
;
import
com.mortals.xhx.module.device.service.DeviceService
;
import
com.mortals.xhx.module.skin.service.SkinService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -40,7 +41,8 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
private
IDeviceFeign
deviceFeign
;
@Autowired
private
DeviceService
deviceService
;
@Autowired
private
SkinService
skinService
;
@Override
public
void
excuteTask
(
ITask
task
)
throws
AppException
{
...
...
@@ -48,6 +50,8 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
syncDevice
();
log
.
info
(
"结束同步设备列表!"
);
skinService
.
syncSkin
();
log
.
info
(
"开始同步皮肤列表!"
);
}
...
...
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/dao/SkinDao.java
0 → 100644
View file @
cde9db23
package
com.mortals.xhx.module.skin.dao
;
import
com.mortals.framework.dao.ICRUDDao
;
import
com.mortals.xhx.module.skin.model.SkinEntity
;
/**
* 皮肤Dao
* 皮肤 DAO接口
*
* @author zxfei
* @date 2023-04-03
*/
public
interface
SkinDao
extends
ICRUDDao
<
SkinEntity
,
Long
>{
}
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/dao/ibatis/SkinDaoImpl.java
0 → 100644
View file @
cde9db23
package
com.mortals.xhx.module.skin.dao.ibatis
;
import
com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis
;
import
com.mortals.xhx.module.skin.dao.SkinDao
;
import
com.mortals.xhx.module.skin.model.SkinEntity
;
import
org.springframework.stereotype.Repository
;
/**
* 皮肤DaoImpl DAO接口
*
* @author zxfei
* @date 2023-04-03
*/
@Repository
(
"skinDao"
)
public
class
SkinDaoImpl
extends
BaseCRUDDaoMybatis
<
SkinEntity
,
Long
>
implements
SkinDao
{
}
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/model/SkinEntity.java
0 → 100644
View file @
cde9db23
package
com.mortals.xhx.module.skin.model
;
import
com.mortals.xhx.module.skin.model.vo.SkinVo
;
/**
* 皮肤实体对象
*
* @author zxfei
* @date 2023-04-03
*/
public
class
SkinEntity
extends
SkinVo
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 所属种类,来源种类
*/
private
Long
categoryId
;
/**
* 产品id
*/
private
Long
productId
;
/**
* 产品名称
*/
private
String
productName
;
/**
* css模板合成后文件地址
*/
private
String
cssFilePath
;
/**
* 产品皮肤名称,唯一且不为空
*/
private
String
name
;
/**
* 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
*/
private
String
imageResolution
;
/**
* 预览图片
*/
private
String
previewImagePath
;
/**
* 排序编号
*/
private
Integer
sortNum
;
/**
* 是否使用
*/
private
Integer
used
;
public
SkinEntity
(){}
/**
* 获取 所属种类,来源种类
* @return Long
*/
public
Long
getCategoryId
(){
return
categoryId
;
}
/**
* 设置 所属种类,来源种类
* @param categoryId
*/
public
void
setCategoryId
(
Long
categoryId
){
this
.
categoryId
=
categoryId
;
}
/**
* 获取 产品id
* @return Long
*/
public
Long
getProductId
(){
return
productId
;
}
/**
* 设置 产品id
* @param productId
*/
public
void
setProductId
(
Long
productId
){
this
.
productId
=
productId
;
}
/**
* 获取 产品名称
* @return String
*/
public
String
getProductName
(){
return
productName
;
}
/**
* 设置 产品名称
* @param productName
*/
public
void
setProductName
(
String
productName
){
this
.
productName
=
productName
;
}
/**
* 获取 css模板合成后文件地址
* @return String
*/
public
String
getCssFilePath
(){
return
cssFilePath
;
}
/**
* 设置 css模板合成后文件地址
* @param cssFilePath
*/
public
void
setCssFilePath
(
String
cssFilePath
){
this
.
cssFilePath
=
cssFilePath
;
}
/**
* 获取 产品皮肤名称,唯一且不为空
* @return String
*/
public
String
getName
(){
return
name
;
}
/**
* 设置 产品皮肤名称,唯一且不为空
* @param name
*/
public
void
setName
(
String
name
){
this
.
name
=
name
;
}
/**
* 获取 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
* @return String
*/
public
String
getImageResolution
(){
return
imageResolution
;
}
/**
* 设置 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
* @param imageResolution
*/
public
void
setImageResolution
(
String
imageResolution
){
this
.
imageResolution
=
imageResolution
;
}
/**
* 获取 预览图片
* @return String
*/
public
String
getPreviewImagePath
(){
return
previewImagePath
;
}
/**
* 设置 预览图片
* @param previewImagePath
*/
public
void
setPreviewImagePath
(
String
previewImagePath
){
this
.
previewImagePath
=
previewImagePath
;
}
/**
* 获取 排序编号
* @return Integer
*/
public
Integer
getSortNum
(){
return
sortNum
;
}
/**
* 设置 排序编号
* @param sortNum
*/
public
void
setSortNum
(
Integer
sortNum
){
this
.
sortNum
=
sortNum
;
}
/**
* 获取 是否使用
* @return Integer
*/
public
Integer
getUsed
(){
return
used
;
}
/**
* 设置 是否使用
* @param used
*/
public
void
setUsed
(
Integer
used
){
this
.
used
=
used
;
}
@Override
public
int
hashCode
()
{
return
this
.
getId
().
hashCode
();
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
obj
==
null
)
return
false
;
if
(
obj
instanceof
SkinEntity
)
{
SkinEntity
tmp
=
(
SkinEntity
)
obj
;
if
(
this
.
getId
()
==
tmp
.
getId
())
{
return
true
;
}
}
return
false
;
}
public
String
toString
(){
StringBuilder
sb
=
new
StringBuilder
(
""
);
sb
.
append
(
",categoryId:"
).
append
(
getCategoryId
());
sb
.
append
(
",productId:"
).
append
(
getProductId
());
sb
.
append
(
",productName:"
).
append
(
getProductName
());
sb
.
append
(
",cssFilePath:"
).
append
(
getCssFilePath
());
sb
.
append
(
",name:"
).
append
(
getName
());
sb
.
append
(
",imageResolution:"
).
append
(
getImageResolution
());
sb
.
append
(
",previewImagePath:"
).
append
(
getPreviewImagePath
());
sb
.
append
(
",sortNum:"
).
append
(
getSortNum
());
sb
.
append
(
",used:"
).
append
(
getUsed
());
return
sb
.
toString
();
}
public
void
initAttrValue
(){
this
.
categoryId
=
null
;
this
.
productId
=
null
;
this
.
productName
=
null
;
this
.
cssFilePath
=
null
;
this
.
name
=
null
;
this
.
imageResolution
=
null
;
this
.
previewImagePath
=
null
;
this
.
sortNum
=
null
;
this
.
used
=
0
;
}
}
\ No newline at end of file
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/model/SkinQuery.java
0 → 100644
View file @
cde9db23
This diff is collapsed.
Click to expand it.
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/model/vo/SkinVo.java
0 → 100644
View file @
cde9db23
package
com.mortals.xhx.module.skin.model.vo
;
import
com.mortals.framework.model.BaseEntityLong
;
import
lombok.Data
;
/**
* 皮肤视图对象
*
* @author zxfei
* @date 2023-04-03
*/
@Data
public
class
SkinVo
extends
BaseEntityLong
{
private
Long
siteId
;
}
\ No newline at end of file
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/service/SkinService.java
0 → 100644
View file @
cde9db23
package
com.mortals.xhx.module.skin.service
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.skin.model.SkinEntity
;
/**
* SkinService
*
* 皮肤 service接口
*
* @author zxfei
* @date 2023-04-03
*/
public
interface
SkinService
extends
ICRUDService
<
SkinEntity
,
Long
>{
void
syncSkin
();
}
\ No newline at end of file
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/service/impl/SkinServiceImpl.java
0 → 100644
View file @
cde9db23
package
com.mortals.xhx.module.skin.service.impl
;
import
cn.hutool.core.util.StrUtil
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.skin.SkinBasePdu
;
import
com.mortals.xhx.common.utils.BeanUtil
;
import
com.mortals.xhx.feign.skin.ISkinBaseFeign
;
import
com.mortals.xhx.module.skin.dao.SkinDao
;
import
com.mortals.xhx.module.skin.model.SkinEntity
;
import
com.mortals.xhx.module.skin.model.SkinQuery
;
import
com.mortals.xhx.module.skin.service.SkinService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* SkinService
* 皮肤 service实现
*
* @author zxfei
* @date 2023-04-03
*/
@Service
(
"skinService"
)
@Slf4j
public
class
SkinServiceImpl
extends
AbstractCRUDServiceImpl
<
SkinDao
,
SkinEntity
,
Long
>
implements
SkinService
{
@Autowired
private
ISkinBaseFeign
skinBaseFeign
;
@Override
protected
void
updateBefore
(
SkinEntity
entity
,
Context
context
)
throws
AppException
{
super
.
updateBefore
(
entity
,
context
);
if
(
YesNoEnum
.
YES
.
getValue
()==
entity
.
getUsed
()){
//修改非当前皮肤都未未使用
SkinEntity
skinEntity
=
new
SkinEntity
();
skinEntity
.
setUsed
(
YesNoEnum
.
NO
.
getValue
());
SkinEntity
condition
=
new
SkinEntity
();
condition
.
setUsed
(
YesNoEnum
.
YES
.
getValue
());
this
.
updateBatch
(
skinEntity
,
condition
,
context
);
}
}
@Override
public
void
syncSkin
()
{
SkinBasePdu
skinBasePdu
=
new
SkinBasePdu
();
skinBasePdu
.
setProductCode
(
"xxgk"
);
skinBasePdu
.
setSize
(-
1
);
Rest
<
RespData
<
List
<
SkinBasePdu
>>>
skinBaseRest
=
skinBaseFeign
.
list
(
skinBasePdu
);
if
(
skinBaseRest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
List
<
SkinBasePdu
>
skinBasePduList
=
skinBaseRest
.
getData
().
getData
();
log
.
info
(
"信息公开皮肤总数量:{}"
,
skinBasePduList
.
size
());
if
(!
ObjectUtils
.
isEmpty
(
skinBasePduList
))
{
List
<
SkinEntity
>
newSkinList
=
skinBasePduList
.
stream
().
map
(
newSkin
->
{
SkinEntity
skinEntity
=
new
SkinEntity
();
skinEntity
.
initAttrValue
();
//存相对地址
newSkin
.
setCssFilePath
(
"/file"
+
StrUtil
.
subAfter
(
newSkin
.
getCssFilePath
(),
"/file"
,
false
));
newSkin
.
setPreviewImagePath
(
"/file"
+
StrUtil
.
subAfter
(
newSkin
.
getPreviewImagePath
(),
"/file"
,
false
));
BeanUtils
.
copyProperties
(
newSkin
,
skinEntity
,
BeanUtil
.
getNullPropertyNames
(
newSkin
));
return
skinEntity
;
}).
collect
(
Collectors
.
toList
());
List
<
SkinEntity
>
oldSkinList
=
this
.
find
(
new
SkinQuery
());
Map
<
Long
,
SkinEntity
>
oldSkinMap
=
oldSkinList
.
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
(),
y
->
y
,
(
o
,
n
)
->
n
));
Map
<
Long
,
SkinEntity
>
newSkinMap
=
newSkinList
.
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
(),
y
->
y
,
(
o
,
n
)
->
n
));
List
<
SkinEntity
>
updateSkinLsit
=
newSkinList
.
stream
().
map
(
item
->
{
if
(
oldSkinMap
.
containsKey
(
item
.
getId
()))
{
item
.
setUsed
(
oldSkinMap
.
get
(
item
.
getId
()).
getUsed
());
item
.
setUpdateTime
(
new
Date
());
return
item
;
}
return
null
;
}).
filter
(
f
->
f
!=
null
).
collect
(
Collectors
.
toList
());
List
<
SkinEntity
>
saveSkinList
=
newSkinList
.
stream
().
map
(
item
->
{
if
(!
oldSkinMap
.
containsKey
(
item
.
getId
()))
{
item
.
setCreateUserId
(
1L
);
item
.
setCreateUserName
(
"系统管理员"
);
item
.
setCreateTime
(
new
Date
());
return
item
;
}
return
null
;
}).
filter
(
f
->
f
!=
null
).
collect
(
Collectors
.
toList
());
//做差集
List
<
Long
>
delSkinList
=
oldSkinList
.
stream
().
map
(
item
->
{
if
(!
newSkinMap
.
containsKey
(
item
.
getId
()))
{
return
item
.
getId
();
}
return
null
;
}).
filter
(
f
->
f
!=
null
).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
updateSkinLsit
))
{
log
.
info
(
"皮肤更新,size:{}"
,
updateSkinLsit
.
size
());
this
.
update
(
updateSkinLsit
);
}
if
(!
ObjectUtils
.
isEmpty
(
saveSkinList
))
{
log
.
info
(
"皮肤新增,size:{}"
,
saveSkinList
.
size
());
this
.
save
(
saveSkinList
);
}
if
(!
ObjectUtils
.
isEmpty
(
delSkinList
))
{
log
.
info
(
"皮肤删除,size:{}"
,
delSkinList
.
size
());
this
.
remove
(
delSkinList
,
null
);
}
}
}
}
public
static
void
main
(
String
[]
args
)
{
// boolean b = StrUtil.subPre("http://192.168.0.98:11078/file/fileupload/1699947376437.png", "/file");
// System.out.println(b);
String
subAfter
=
StrUtil
.
subAfter
(
"http://192.168.0.98:11078/file/fileupload/1699947376437.png"
,
"/file"
,
false
);
System
.
out
.
println
(
subAfter
);
}
}
\ No newline at end of file
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/web/SkinController.java
0 → 100644
View file @
cde9db23
package
com.mortals.xhx.module.skin.web
;
import
com.alibaba.fastjson.JSON
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.common.pdu.device.DeviceMsgReqPdu
;
import
com.mortals.xhx.feign.device.IDeviceMessageFeign
;
import
com.mortals.xhx.module.skin.model.SkinEntity
;
import
com.mortals.xhx.module.skin.service.SkinService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Map
;
/**
* 皮肤
*
* @author zxfei
* @date 2023-04-03
*/
@RestController
@RequestMapping
(
"skin"
)
@Slf4j
public
class
SkinController
extends
BaseCRUDJsonBodyMappingController
<
SkinService
,
SkinEntity
,
Long
>
{
@Autowired
private
ParamService
paramService
;
@Autowired
private
IDeviceMessageFeign
deviceMessageFeign
;
public
SkinController
()
{
super
.
setModuleDesc
(
"皮肤"
);
}
@Override
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
this
.
addDict
(
model
,
"imageResolution"
,
paramService
.
getParamBySecondOrganize
(
"Skin"
,
"imageResolution"
));
this
.
addDict
(
model
,
"used"
,
paramService
.
getParamBySecondOrganize
(
"Skin"
,
"used"
));
super
.
init
(
model
,
context
);
}
@Override
protected
int
saveAfter
(
SkinEntity
entity
,
Map
<
String
,
Object
>
model
,
Context
context
)
throws
AppException
{
//推送皮肤更新消息
DeviceMsgReqPdu
deviceMsgReqPdu
=
new
DeviceMsgReqPdu
();
deviceMsgReqPdu
.
setSiteid
(
entity
.
getSiteId
());
deviceMsgReqPdu
.
setProductCode
(
"ybj"
);
deviceMsgReqPdu
.
setMessageType
(
"edition"
);
deviceMsgReqPdu
.
setData
(
"W10="
);
deviceMsgReqPdu
.
setTimestamp
(
System
.
currentTimeMillis
());
Rest
<
String
>
rest
=
deviceMessageFeign
.
callbackByProduct
(
deviceMsgReqPdu
);
log
.
info
(
"send device message==>{}"
,
JSON
.
toJSONString
(
rest
));
return
super
.
saveAfter
(
entity
,
model
,
context
);
}
@PostMapping
({
"refreshSkin"
})
@UnAuth
public
Rest
<
Object
>
refreshSkin
()
{
log
.
info
(
"刷新皮肤"
);
this
.
service
.
syncSkin
();
return
Rest
.
ok
(
"皮肤刷新操作成功"
);
}
}
\ No newline at end of file
info-publish-manager/src/main/resources/sqlmap/module/skin/SkinMapper.xml
0 → 100644
View file @
cde9db23
This diff is collapsed.
Click to expand it.
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