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
83ff9217
Commit
83ff9217
authored
Dec 11, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加皮肤同步
parent
0ebee773
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
11 deletions
+63
-11
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/service/SkinService.java
...java/com/mortals/xhx/module/skin/service/SkinService.java
+13
-8
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/service/impl/SkinServiceImpl.java
...mortals/xhx/module/skin/service/impl/SkinServiceImpl.java
+14
-0
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/web/SkinController.java
.../java/com/mortals/xhx/module/skin/web/SkinController.java
+36
-3
No files found.
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/service/SkinService.java
View file @
83ff9217
package
com.mortals.xhx.module.skin.service
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.model.Context
;
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
>
{
* SkinService
* <p>
* 皮肤 service接口
*
* @author zxfei
* @date 2023-04-03
*/
public
interface
SkinService
extends
ICRUDService
<
SkinEntity
,
Long
>
{
void
syncSkin
();
Rest
<
Void
>
appUsed
(
SkinEntity
skinEntity
,
Context
context
);
}
\ No newline at end of file
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/service/impl/SkinServiceImpl.java
View file @
83ff9217
...
...
@@ -39,6 +39,20 @@ public class SkinServiceImpl extends AbstractCRUDServiceImpl<SkinDao, SkinEntity
@Autowired
private
ISkinBaseFeign
skinBaseFeign
;
@Override
public
Rest
<
Void
>
appUsed
(
SkinEntity
skinEntity
,
Context
context
)
{
//使用 部署
SkinEntity
model
=
new
SkinEntity
();
model
.
setUsed
(
YesNoEnum
.
NO
.
getValue
());
this
.
getDao
().
update
(
model
,
new
SkinEntity
());
//更新当前app
skinEntity
.
setUsed
(
YesNoEnum
.
YES
.
getValue
());
skinEntity
.
setUpdateTime
(
new
Date
());
this
.
getDao
().
update
(
skinEntity
);
return
Rest
.
ok
(
"使用应用成功!"
);
}
@Override
protected
void
updateBefore
(
SkinEntity
entity
,
Context
context
)
throws
AppException
{
super
.
updateBefore
(
entity
,
context
);
...
...
info-publish-manager/src/main/java/com/mortals/xhx/module/skin/web/SkinController.java
View file @
83ff9217
...
...
@@ -7,15 +7,15 @@ 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.code.YesNoEnum
;
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.apache.commons.lang3.ObjectUtils
;
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
org.springframework.web.bind.annotation.*
;
import
java.util.Map
;
...
...
@@ -62,6 +62,39 @@ public class SkinController extends BaseCRUDJsonBodyMappingController<SkinServic
return
super
.
saveAfter
(
entity
,
model
,
context
);
}
/**
*皮肤使用
*/
@PostMapping
(
value
=
"used"
)
public
Rest
<
String
>
used
(
@RequestBody
SkinEntity
entity
)
{
String
busiDesc
=
this
.
getModuleDesc
()
+
"皮肤选择使用"
;
Rest
<
String
>
rest
=
Rest
.
ok
(
busiDesc
+
" 【成功】"
);
try
{
if
(
ObjectUtils
.
isEmpty
(
entity
.
getId
()))
{
throw
new
AppException
(
"皮肤Id不能为空!"
);
}
SkinEntity
skinEntity
=
this
.
service
.
get
(
entity
.
getId
(),
getContext
());
if
(
ObjectUtils
.
isEmpty
(
skinEntity
))
{
throw
new
AppException
(
"当前皮肤不存在!skinId:"
+
entity
.
getId
());
}
if
(
skinEntity
.
getUsed
()==
entity
.
getUsed
()&&
skinEntity
.
getUsed
()==
YesNoEnum
.
YES
.
getValue
()){
throw
new
AppException
(
"当前皮肤不能取消选择!"
);
}
if
(
skinEntity
.
getUsed
()
==
YesNoEnum
.
YES
.
getValue
())
{
throw
new
AppException
(
"当前皮肤使用中!"
);
}
Rest
<
Void
>
usedRest
=
this
.
service
.
appUsed
(
skinEntity
,
getContext
());
recordSysLog
(
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
e
)
{
log
.
error
(
"皮肤切换"
,
e
);
return
Rest
.
fail
(
super
.
convertException
(
e
));
}
return
rest
;
}
@PostMapping
({
"refreshSkin"
})
@UnAuth
...
...
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